Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
feat(yarn2): update to yarn 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nellyk committed May 17, 2021
1 parent bf5d231 commit f583464
Show file tree
Hide file tree
Showing 17 changed files with 19,086 additions and 14,869 deletions.
35 changes: 8 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,24 @@ name: Release

on:
push:
branches:
- main
branches: [ main, beta ]
jobs:
info:
name: Check commit
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- id: commit
run: echo "::set-output name=message::${{ github.event.head_commit.message }}"
outputs:
commitMsg: ${{ steps.commit.outputs.message }}
release:
name: Release
needs: [info]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Node Install
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Installing Packages
env:
NODE_ENV: development
run: yarn install --frozen-lockfile
- name: Testing Packages
run: yarn test
node-version: '12x'
- name: Releasing Packages
env:
NODE_ENV: production
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |-
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
yarn lerna:deploy -- "${{ needs.info.outputs.commitMsg }}"
run: yarn release
23 changes: 15 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
git remote set-branches --add origin main
git fetch
- name: Node Install
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
uses: actions/setup-node@v1
- name: Installing Packages
env:
NODE_ENV: development
run: yarn install --frozen-lockfile
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Use Yarn cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install project dependencies
run: yarn install --check-cache
- name: Unit Tests
run: yarn test:unit
- name: Git History Test
run: yarn test:git-history
- name: Lockfile Lint Test
run: yarn test:lockfile
- name: Lint
run: yarn test:lint
run: yarn test:lint
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ bundle.integrity.manifest.json
# yarn
yarn-debug.log*
yarn-error.log*
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

77 changes: 77 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions .yarn/releases/yarn-2.4.1.cjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
enableGlobalCache: true

nodeLinker: node-modules

npmRegistryServer: "https://registry.yarnpkg.com"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-2.4.1.cjs
12 changes: 0 additions & 12 deletions lerna.json

This file was deleted.

21 changes: 0 additions & 21 deletions lernaDeploy.js

This file was deleted.

40 changes: 35 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
"test:git-history": "commitlint --from origin/main --to HEAD",
"posttest": "yarn test:lint && yarn test:git-history && yarn test:lockfile",
"test:lockfile": "lockfile-lint --path yarn.lock --allowed-hosts registry.yarnpkg.com --validate-https",
"lerna:version": "lerna version",
"lerna:publish": "lerna publish from-package --yes",
"lerna:deploy": "node lernaDeploy.js"
"release": "yarn workspaces foreach --verbose run release"
},
"devDependencies": {
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.2.3",
"@semantic-release/npm": "^7.1.3",
"@semantic-release/release-notes-generator": "^9.0.2",
"amex-jest-preset": "^6.1.0",
"cross-env": "^7.0.2",
"enzyme": "^3.11.0",
Expand All @@ -35,16 +39,42 @@
"eslint-config-amex": "^11.0.1",
"husky": "^4.3.0",
"jest": "^26.6.3",
"lerna": "^3.20.2",
"lockfile-lint": "^4.1.0",
"mock-fs": "^4.7.0",
"prop-types": "*",
"regenerator-runtime": "^0.13.7"
"regenerator-runtime": "^0.13.7",
"semantic-release": "^17.4.3",
"semantic-release-monorepo": "^7.0.5"
},
"husky": {
"hooks": {
"pre-commit": "yarn test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"release": {
"extends": "semantic-release-monorepo",
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
}
}
3 changes: 3 additions & 0 deletions packages/eslint-plugin-one-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"jest": {
"preset": "amex-jest-preset"
},
"scripts": {
"release": "semantic-release"
},
"repository": {
"url": "https://github.com/americanexpress/one-app-cli.git",
"directory": "packages/eslint-plugin-one-app"
Expand Down
3 changes: 3 additions & 0 deletions packages/generator-one-app-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "6.12.0",
"description": "generator for One App Modules",
"license": "Apache-2.0",
"scripts": {
"release": "semantic-release"
},
"contributors": [
"Andres Escobar <Andres.Escobar@aexp.com> (https://github.com/anescobar1991)",
"James Singleton <James.Singleton1@aexp.com> (https://github.com/JamesSingleton)",
Expand Down
7 changes: 4 additions & 3 deletions packages/holocron-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.1",
"description": "A micro-frontend dev server for Holocron Modules",
"license": "Apache-2.0",
"scripts": {
"release": "semantic-release"
},
"keywords": [
"one-amex",
"one-app",
Expand All @@ -26,9 +29,7 @@
"publishConfig": {
"access": "public"
},
"bin": {
"holocron-dev-server": "bin/holocron-dev-server.js"
},
"bin": "bin/holocron-dev-server.js",
"files": [
"bin/",
"src/",
Expand Down
9 changes: 6 additions & 3 deletions packages/one-app-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"version": "6.12.0",
"description": "A command line interface(CLI) tool for bundling One App and its modules.",
"main": "index.js",
"scripts": {
"release": "semantic-release"
},
"bin": {
"serve-module": "bin/serve-module.js",
"drop-module": "bin/drop-module.js",
"bundle-module": "bin/bundle-module.js",
"bundle-one-app": "bin/bundle-one-app.js",
"bundle-module": "bin/bundle-module.js"
"drop-module": "bin/drop-module.js",
"serve-module": "bin/serve-module.js"
},
"repository": {
"url": "https://github.com/americanexpress/one-app-cli.git",
Expand Down
3 changes: 3 additions & 0 deletions packages/one-app-locale-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@americanexpress/one-app-locale-bundler",
"version": "6.5.0",
"description": "A command line interface(CLI) tool for bundling the locale files.",
"scripts": {
"release": "semantic-release"
},
"bin": {
"bundle-module-locale": "./bin/bundle-module-locale.js"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/one-app-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "6.12.0",
"description": "CLI for running One App locally",
"license": "Apache-2.0",
"scripts": {
"release": "semantic-release"
},
"contributors": [
"Andres Escobar <Andres.Escobar@aexp.com> (https://github.com/anescobar1991)",
"James Singleton <James.Singleton1@aexp.com> (https://github.com/JamesSingleton)",
Expand All @@ -14,8 +17,8 @@
"Nelly Kiboi <Nelly.J.Kiboi@aexp.com> (https://github.com/nellyk)"
],
"bin": {
"one-app-runner": "./bin/one-app-runner.js",
"create-runner-env": "./bin/create-runner-env.js",
"one-app-runner": "./bin/one-app-runner.js",
"one-app-runner-test": "bin/one-app-runner-test.js"
},
"files": [
Expand Down
Loading

0 comments on commit f583464

Please sign in to comment.