From 4852485f9a16d02c19f5970561d8d567048c288b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 23 Mar 2020 16:58:16 +0100 Subject: [PATCH 1/5] package/core: move storybook to separate private and nohoist package --- packages/core/package.json | 13 ++----------- packages/storybook/.storybook/main.js | 22 ++++++++++++++++++++++ packages/storybook/package.json | 21 +++++++++++++++++++++ yarn.lock | 6 +++--- 4 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 packages/storybook/.storybook/main.js create mode 100644 packages/storybook/package.json diff --git a/packages/core/package.json b/packages/core/package.json index 05ee131bc9..b6ceeb42f2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -8,9 +8,7 @@ "scripts": { "build": "tsc --outDir dist/cjs --noEmit false --module CommonJS", "lint": "backstage-cli lint", - "test": "backstage-cli test", - "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook" + "test": "backstage-cli test" }, "dependencies": { "@material-ui/core": "^4.9.1", @@ -28,17 +26,10 @@ "recompose": "0.30.0" }, "devDependencies": { - "@babel/core": "^7.9.0", "@spotify-backstage/cli": "^0.1.0", - "@storybook/addon-actions": "^5.3.17", - "@storybook/addon-links": "^5.3.17", - "@storybook/addons": "^5.3.17", - "@storybook/react": "^5.3.17", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", - "babel-loader": "^8.1.0", - "prop-types": "^15.7.2", - "ts-loader": "^6.2.1" + "prop-types": "^15.7.2" } } diff --git a/packages/storybook/.storybook/main.js b/packages/storybook/.storybook/main.js new file mode 100644 index 0000000000..7a51d41e0d --- /dev/null +++ b/packages/storybook/.storybook/main.js @@ -0,0 +1,22 @@ +module.exports = { + stories: [ + '../../core/src/layout/**/*.stories.tsx', + '../../core/src/components/**/*.stories.tsx', + ], + addons: ['@storybook/addon-actions', '@storybook/addon-links'], + webpackFinal: async config => { + config.module.rules.push({ + test: /\.(ts|tsx)$/, + use: [ + { + loader: require.resolve('ts-loader'), + options: { + transpileOnly: true, + }, + }, + ], + }); + config.resolve.extensions.push('.ts', '.tsx'); + return config; + }, +}; diff --git a/packages/storybook/package.json b/packages/storybook/package.json new file mode 100644 index 0000000000..f4e3b9d0ed --- /dev/null +++ b/packages/storybook/package.json @@ -0,0 +1,21 @@ +{ + "name": "storybook", + "version": "0.0.0", + "description": "Storybook build for core package", + "private": true, + "scripts": { + "start": "start-storybook -p 6006", + "build-storybook": "build-storybook --output-dir dist" + }, + "workspaces": { + "nohoist": [ + "@storybook/**" + ] + }, + "devDependencies": { + "@storybook/addon-actions": "^5.3.17", + "@storybook/addon-links": "^5.3.17", + "@storybook/addons": "^5.3.17", + "@storybook/react": "^5.3.17" + } +} diff --git a/yarn.lock b/yarn.lock index eaacf83d37..78f006747e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,7 +25,7 @@ invariant "^2.2.4" semver "^5.5.0" -"@babel/core@7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.7.5", "@babel/core@^7.9.0": +"@babel/core@7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.7.5": version "7.9.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e" integrity sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w== @@ -4688,7 +4688,7 @@ babel-jest@^25.1.0: chalk "^3.0.0" slash "^3.0.0" -babel-loader@8.1.0, babel-loader@^8.1.0: +babel-loader@8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" integrity sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw== @@ -12713,7 +12713,7 @@ minimist-options@^3.0.1: arrify "^1.0.1" is-plain-obj "^1.1.0" -minimist@1.2.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: +minimist@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= From f629c288ee81d9e0a195497d51598e7a3febe71d Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Tue, 24 Mar 2020 08:51:17 +0100 Subject: [PATCH 2/5] Add faq about repo managers --- docs/FAQ.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 3e0093355e..0945ef696a 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -20,3 +20,12 @@ Additional open sourced plugins would be added to the `plugins` directory in thi While we encourage using the open soure model, integrators that want to experiment with Backstage internally may also choose to develop closed source plugins in a manner that suits them best, for example in their respective Backstage source repository. + +## Any plans for integrating with other repository managers such as Gitlab or Bitbucket? + +We chose Github by the fact that it is the tool that we are most familiar with and that will naturally +lead to integrations for Github specifically being developed in an early stage. + +Hosting this project on Github does not exclude integrations with other alternatives such as Gitlab or +Bitbucket. We believe that in time there will be plugins that will provide functionality for these tools +as well. Hopefully contributed by the community. From 6b8f0d3961d0c86447996726271ad91346f261dd Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Tue, 24 Mar 2020 09:06:42 +0100 Subject: [PATCH 3/5] Review comment --- docs/FAQ.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 0945ef696a..9b9fff564e 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -29,3 +29,5 @@ lead to integrations for Github specifically being developed in an early stage. Hosting this project on Github does not exclude integrations with other alternatives such as Gitlab or Bitbucket. We believe that in time there will be plugins that will provide functionality for these tools as well. Hopefully contributed by the community. + +And note that implementations of Backstage can be hosted wherever you feel suits your needs best. From f9a47d9a0af62aa29673ca14b1d9fd7e6119afaa Mon Sep 17 00:00:00 2001 From: Mateus Marquezini Date: Tue, 24 Mar 2020 09:38:06 -0300 Subject: [PATCH 4/5] Build and test only changed packages (#352) * #285 build and test only changed packages * changed since flag param * fix build cause --since lerna flag * fix build cause --since lerna flag * removed checkout option * fix build cause --since lerna flag * fix build cause --since lerna flag * fix build in progress * fix build in progress * removed --since flag for build executions * removed --since flag for build executions * changed action checkout step * added new ref to the action checkout * removed ref prop from the action checkout. Added new step to fetch branches to compare when using lerna --since * changed --since param value * added --since flag to the build and renamed the fetch step * removed --since flag from build. Added new config to the checkout step workflow * removed --since flag from yarn build. Added new config to the checkout step workflow * removed --since flag from yarn build. Added new step to checkout branch master * Added new step to checkout branch master --- .github/workflows/frontend.yml | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 2842442bf9..527639abf1 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v2 + - name: fetch branch master + run: git fetch origin master - name: find location of yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/package.json b/package.json index 75c1dd7474..7c6f997efb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "start": "yarn build && yarn workspace @spotify-backstage/app start", "build": "lerna run build", - "test": "cross-env CI=true lerna run test -- --coverage", + "test": "cross-env CI=true lerna run test --since origin/master -- --coverage", "create-plugin": "backstage-cli create-plugin", "lint": "lerna run lint", "storybook": "yarn workspace @spotify-backstage/core storybook", From 123e5f80a8618e6df1ae0a5f99482761eb05df40 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 25 Mar 2020 01:24:49 +0100 Subject: [PATCH 5/5] package: update storybook command and remove build command --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 7c6f997efb..8a008a5ed3 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,7 @@ "test": "cross-env CI=true lerna run test --since origin/master -- --coverage", "create-plugin": "backstage-cli create-plugin", "lint": "lerna run lint", - "storybook": "yarn workspace @spotify-backstage/core storybook", - "build-storybook": "yarn workspace @spotify-backstage/core build-storybook" + "storybook": "yarn workspace storybook start" }, "workspaces": { "packages": [