From 488232ce738c7ccb22ee6ce56960e13a1f57e091 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 1 Apr 2020 22:57:48 +0200 Subject: [PATCH 1/3] package: pretty --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8a862e04b5..1db293f059 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ } }, "lint-staged": { - "*.{js,jsx,ts,tsx}": [ - "prettier --config ./prettier.config.js --list-different --write" - ] + "*.{js,jsx,ts,tsx}": [ + "prettier --config ./prettier.config.js --list-different --write" + ] } } From ab827f36e1909f6c96965f0f86cac03441949cec Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 1 Apr 2020 23:10:22 +0200 Subject: [PATCH 2/3] package,github/workflows: add root lerna command and use in github workflows + fix master --- .github/workflows/frontend.yml | 17 +++++++++++++---- .github/workflows/master.yml | 17 +++++++++++++---- package.json | 1 + 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index d2f668e955..37aa16deb3 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -48,12 +48,21 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: yarn install run: yarn install --frozen-lockfile - - run: yarn lint - - run: yarn build - - run: yarn test + + - name: lint + run: yarn lerna -- run lint --since origin/master + + - name: build + run: yarn build + + - name: test + run: yarn lerna -- run test --since origin/master -- --coverage + - name: yarn bundle, if app was changed - run: git diff --quiet origin/master HEAD -- packages/app packages/core || yarn bundle + run: git diff --quiet origin/master HEAD -- yarn.lock packages/app packages/core || yarn bundle + - name: verify storybook run: yarn workspace storybook build-storybook diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index ddce729bd8..6df9738bbc 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -47,16 +47,25 @@ jobs: with: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ # Needed for auth + - name: yarn install run: yarn install --frozen-lockfile - - run: yarn lint - - run: yarn build - - run: yarn test + + - name: lint + run: yarn lerna -- run lint + + - name: build + run: yarn build + + - name: test + run: yarn lerna -- run test -- --coverage + # Publishes current version of packages that are not already present in the registry - name: publish - run: npx --no-install lerna publish from-package --yes + run: yarn lerna -- publish from-package --yes env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # Tags the commit with the version in the core package if the tag doesn't exist - uses: Klemensas/action-autotag@1.2.3 with: diff --git a/package.json b/package.json index 1db293f059..c1c67c7e1d 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "create-plugin": "backstage-cli create-plugin", "release": "if [ \"$(git symbolic-ref --short HEAD)\" = master ]; then echo \"don't try to release master\"; exit 1; else lerna version --no-push; fi", "lint": "cross-env CI=true lerna run lint --since origin/master --", + "lerna": "lerna", "storybook": "yarn workspace storybook start" }, "workspaces": { From 3404afcd1eea9c9bb90a2e74858b3a9083f50040 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 1 Apr 2020 23:16:44 +0200 Subject: [PATCH 3/3] package: simplify lint and test scripts + run build before tests --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c1c67c7e1d..68e4319d83 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "start": "yarn build && yarn workspace example-app start", "bundle": "yarn build && yarn workspace example-app bundle", "build": "lerna run build", - "test": "cross-env CI=true lerna run test --since origin/master -- --coverage", + "test": "yarn build && lerna run test --since origin/master -- --coverage", + "lint": "lerna run lint --since origin/master --", "create-plugin": "backstage-cli create-plugin", "release": "if [ \"$(git symbolic-ref --short HEAD)\" = master ]; then echo \"don't try to release master\"; exit 1; else lerna version --no-push; fi", - "lint": "cross-env CI=true lerna run lint --since origin/master --", "lerna": "lerna", "storybook": "yarn workspace storybook start" },