Merge pull request #9089 from backstage/storybook-move
Moved Storybook from package to root of the project (continued)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@techdocs/cli': patch
|
||||
---
|
||||
|
||||
Bumped `react-dev-utils` from `^12.0.0-next.47` to `^12.0.0-next.60`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/dev-utils': patch
|
||||
---
|
||||
|
||||
Bumped `react-hot-loader` from `^4.12.21` to `^4.13.0`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Upgraded `webpack`, `webpack-dev-server`,`fork-ts-checker-webpack-plugin`, `react-dev-utils`, and `react-hot-loader`. Since `ForkTsCheckerWebpackPlugin` no longer runs ESLint, we now include the `ESLintPlugin` from `eslint-webpack-plugin` if the `--check` flag is passed.
|
||||
@@ -16,3 +16,11 @@ updates:
|
||||
open-pull-requests-limit: 5
|
||||
labels:
|
||||
- dependencies
|
||||
- package-ecosystem: npm
|
||||
directory: '/storybook/'
|
||||
schedule:
|
||||
interval: daily
|
||||
time: '04:00'
|
||||
open-pull-requests-limit: 5
|
||||
labels:
|
||||
- dependencies
|
||||
|
||||
@@ -34,6 +34,9 @@ jobs:
|
||||
- name: microsite yarn install
|
||||
run: yarn install --frozen-lockfile
|
||||
working-directory: microsite
|
||||
- name: storybook yarn install
|
||||
run: yarn install --frozen-lockfile
|
||||
working-directory: storybook
|
||||
|
||||
- name: build API reference
|
||||
run: yarn build:api-docs
|
||||
@@ -43,10 +46,11 @@ jobs:
|
||||
working-directory: microsite
|
||||
|
||||
- name: build storybook
|
||||
run: yarn workspace storybook build-storybook
|
||||
run: yarn build-storybook
|
||||
working-directory: storybook
|
||||
|
||||
- name: move storybook dist into microsite
|
||||
run: mv packages/storybook/dist/ microsite/build/backstage/storybook
|
||||
run: mv storybook/dist/ microsite/build/backstage/storybook
|
||||
|
||||
- name: Check the build output
|
||||
run: ls microsite/build/backstage && ls microsite/build/backstage/storybook
|
||||
|
||||
@@ -3,7 +3,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/chromatic-storybook-test.yml'
|
||||
- 'packages/storybook/**'
|
||||
- 'storybook/**'
|
||||
- 'packages/config/src/**'
|
||||
- 'packages/theme/src/**'
|
||||
- 'packages/types/src/**'
|
||||
@@ -47,8 +47,13 @@ jobs:
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: yarn install
|
||||
|
||||
- name: top-level install
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: storybook yarn install
|
||||
run: yarn install --frozen-lockfile
|
||||
working-directory: storybook
|
||||
# End of yarn setup
|
||||
|
||||
- run: yarn build-storybook
|
||||
@@ -59,5 +64,5 @@ jobs:
|
||||
# projetToken intentionally shared to allow collaborators to run Chromatic on forks
|
||||
# https://www.chromatic.com/docs/custom-ci-provider#run-chromatic-on-external-forks-of-open-source-projects
|
||||
projectToken: 9tzak77m9nj
|
||||
workingDir: 'packages/storybook'
|
||||
storybookBuildDir: 'dist'
|
||||
workingDir: storybook
|
||||
storybookBuildDir: dist
|
||||
|
||||
@@ -60,8 +60,8 @@ core
|
||||
|
||||
## Running locally
|
||||
|
||||
Go to `packages/storybook`, run `yarn install` and install the dependencies,
|
||||
then run the following on your command line: `yarn start`
|
||||
Go to `storybook`, run `yarn install` and install the dependencies, then run the
|
||||
following on your command line: `yarn start`
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ are separated out into their own folder, see further down.
|
||||
- [`integration/`](https://github.com/backstage/backstage/tree/master/packages/integration) -
|
||||
Common functionalities of integrations like GitHub, GitLab, etc.
|
||||
|
||||
- [`storybook/`](https://github.com/backstage/backstage/tree/master/packages/storybook) -
|
||||
- [`storybook/`](https://github.com/backstage/backstage/tree/master/storybook) -
|
||||
This folder contains only the Storybook config which helps visualize our
|
||||
reusable React components. Stories are within the core package, and are
|
||||
published in the [Backstage Storybook](https://backstage.io/storybook).
|
||||
|
||||
@@ -162,7 +162,7 @@ it's necessary it can be used, but there will be breaking changes.
|
||||
|
||||
Stability: `0`
|
||||
|
||||
### `storybook` [GitHub](https://github.com/backstage/backstage/tree/master/packages/storybook/)
|
||||
### `storybook` [GitHub](https://github.com/backstage/backstage/tree/master/storybook/)
|
||||
|
||||
Internal storybook build for publishing stories to
|
||||
https://backstage.io/storybook
|
||||
|
||||
+2
-6
@@ -29,10 +29,10 @@
|
||||
"release": "node scripts/prepare-release.js && changeset version && yarn diff --yes && yarn prettier --write '{packages,plugins}/*/{package.json,CHANGELOG.md}' && yarn install",
|
||||
"prettier:check": "prettier --check .",
|
||||
"lerna": "lerna",
|
||||
"storybook": "yarn workspace storybook start",
|
||||
"storybook": "yarn --cwd storybook start",
|
||||
"snyk:test": "npx snyk test --yarn-workspaces --strict-out-of-sync=false",
|
||||
"snyk:test:package": "yarn snyk:test --include",
|
||||
"build-storybook": "yarn workspace storybook build-storybook",
|
||||
"build-storybook": "yarn --cwd storybook build-storybook",
|
||||
"techdocs-cli": "node scripts/techdocs-cli.js",
|
||||
"techdocs-cli:dev": "cross-env TECHDOCS_CLI_DEV_MODE=true node scripts/techdocs-cli.js",
|
||||
"prepare": "husky install",
|
||||
@@ -42,10 +42,6 @@
|
||||
"packages": [
|
||||
"packages/*",
|
||||
"plugins/*"
|
||||
],
|
||||
"nohoist": [
|
||||
"**/@storybook/**",
|
||||
"**/@storybook"
|
||||
]
|
||||
},
|
||||
"resolutions": {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-hot-loader": "^4.12.21",
|
||||
"react-hot-loader": "^4.13.0",
|
||||
"react-router": "6.0.0-beta.0",
|
||||
"react-router-dom": "6.0.0-beta.0",
|
||||
"react-use": "^17.2.4",
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"esbuild": "^0.14.10",
|
||||
"esbuild-loader": "^2.18.0",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-webpack-plugin": "^2.6.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-formatter-friendly": "^7.0.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
@@ -72,7 +73,7 @@
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-hooks": "^4.3.0",
|
||||
"express": "^4.17.1",
|
||||
"fork-ts-checker-webpack-plugin": "^4.0.5",
|
||||
"fork-ts-checker-webpack-plugin": "^7.0.0-alpha.8",
|
||||
"fs-extra": "9.1.0",
|
||||
"glob": "^7.1.7",
|
||||
"handlebars": "^4.7.3",
|
||||
@@ -89,8 +90,8 @@
|
||||
"ora": "^5.3.0",
|
||||
"postcss": "^8.1.0",
|
||||
"process": "^0.11.10",
|
||||
"react-dev-utils": "^12.0.0-next.47",
|
||||
"react-hot-loader": "^4.12.21",
|
||||
"react-dev-utils": "^12.0.0-next.60",
|
||||
"react-hot-loader": "^4.13.0",
|
||||
"recursive-readdir": "^2.2.2",
|
||||
"replace-in-file": "^6.0.0",
|
||||
"rollup": "^2.60.2",
|
||||
@@ -106,8 +107,8 @@
|
||||
"tar": "^6.1.2",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"util": "^0.12.3",
|
||||
"webpack": "^5.48.0",
|
||||
"webpack-dev-server": "4.3.1",
|
||||
"webpack": "^5.66.0",
|
||||
"webpack-dev-server": "^4.7.3",
|
||||
"webpack-node-externals": "^3.0.0",
|
||||
"yaml": "^1.10.0",
|
||||
"yml-loader": "^2.1.0",
|
||||
@@ -135,8 +136,6 @@
|
||||
"@types/rollup-plugin-postcss": "^2.0.0",
|
||||
"@types/tar": "^6.1.1",
|
||||
"@types/terser-webpack-plugin": "^5.0.4",
|
||||
"@types/webpack": "^5.28.0",
|
||||
"@types/webpack-dev-server": "^3.11.5",
|
||||
"@types/yarnpkg__lockfile": "^1.1.4",
|
||||
"del": "^6.0.0",
|
||||
"mock-fs": "^5.1.0",
|
||||
@@ -151,9 +150,6 @@
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/webpack-dev-server/@types/webpack": "^5.28.0"
|
||||
},
|
||||
"files": [
|
||||
"asset-types",
|
||||
"templates",
|
||||
|
||||
@@ -34,6 +34,7 @@ import { BundlingOptions, BackendBundlingOptions } from './types';
|
||||
import { version } from '../../lib/version';
|
||||
import { paths as cliPaths } from '../../lib/paths';
|
||||
import { runPlain } from '../run';
|
||||
import ESLintPlugin from 'eslint-webpack-plugin';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
|
||||
export function resolveBaseUrl(config: Config): URL {
|
||||
@@ -89,21 +90,14 @@ export async function createConfig(
|
||||
|
||||
const baseUrl = frontendConfig.getString('app.baseUrl');
|
||||
const validBaseUrl = new URL(baseUrl);
|
||||
|
||||
if (checksEnabled) {
|
||||
plugins.push(
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
typescript: paths.targetTsConfig,
|
||||
eslint: true,
|
||||
eslintOptions: {
|
||||
files: ['**', '!**/__tests__/**', '!**/?(*.)(spec|test).*'],
|
||||
options: {
|
||||
parserOptions: {
|
||||
project: paths.targetTsConfig,
|
||||
tsconfigRootDir: paths.targetPath,
|
||||
},
|
||||
},
|
||||
},
|
||||
typescript: { configFile: paths.targetTsConfig },
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
context: paths.targetPath,
|
||||
files: ['**', '!**/__tests__/**', '!**/?(*.)(spec|test).*'],
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -350,17 +344,10 @@ export async function createBackendConfig(
|
||||
...(checksEnabled
|
||||
? [
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
typescript: paths.targetTsConfig,
|
||||
eslint: true,
|
||||
eslintOptions: {
|
||||
files: ['**', '!**/__tests__/**', '!**/?(*.)(spec|test).*'],
|
||||
options: {
|
||||
parserOptions: {
|
||||
project: paths.targetTsConfig,
|
||||
tsconfigRootDir: paths.targetPath,
|
||||
},
|
||||
},
|
||||
},
|
||||
typescript: { configFile: paths.targetTsConfig },
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
files: ['**', '!**/__tests__/**', '!**/?(*.)(spec|test).*'],
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
|
||||
Vendored
+3
-1
@@ -19,7 +19,9 @@ declare namespace NodeJS {
|
||||
readonly NODE_ENV: 'development' | 'production' | 'test';
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'fs' {
|
||||
export interface StatSyncFn {}
|
||||
}
|
||||
declare module 'rollup-plugin-image-files' {
|
||||
export default function image(options?: any): any;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"react-use": "^17.2.4",
|
||||
"react-hot-loader": "^4.12.21",
|
||||
"react-hot-loader": "^4.13.0",
|
||||
"react-router": "6.0.0-beta.0",
|
||||
"react-router-dom": "6.0.0-beta.0",
|
||||
"zen-observable": "^0.8.15"
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
"@types/http-proxy": "^1.17.4",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/node": "^14.14.32",
|
||||
"@types/react-dev-utils": "^9.0.4",
|
||||
"@types/serve-handler": "^6.1.0",
|
||||
"@types/webpack-env": "^1.15.3",
|
||||
"embedded-techdocs-app": "0.2.60",
|
||||
@@ -65,7 +64,7 @@
|
||||
"dockerode": "^3.3.1",
|
||||
"fs-extra": "^9.0.1",
|
||||
"http-proxy": "^1.18.1",
|
||||
"react-dev-utils": "^12.0.0-next.47",
|
||||
"react-dev-utils": "^12.0.0-next.60",
|
||||
"serve-handler": "^6.1.3",
|
||||
"winston": "^3.2.1"
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = ({ args }) => {
|
||||
// If it's called with args, each arg should be the path to a package that we will
|
||||
// show the stories from, for example `yarn storybook plugins/catalog`.
|
||||
|
||||
const rootPath = '../../..';
|
||||
const rootPath = '../../';
|
||||
const storiesSrcGlob = 'src/**/*.stories.tsx';
|
||||
|
||||
const getStoriesPath = package =>
|
||||
@@ -8,11 +8,10 @@
|
||||
"build-storybook": "build-storybook --output-dir dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/theme": "^0.2.0",
|
||||
"@backstage/test-utils": "^0.2.3",
|
||||
"@backstage/core-app-api": "^0.5.0",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@sucrase/webpack-loader": "^2.0.0",
|
||||
"sucrase": "^3.20.2",
|
||||
"react": "^17.0.2",
|
||||
"react-hot-loader": "^4.13.0",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -23,5 +22,11 @@
|
||||
"@storybook/addons": "^6.1.11",
|
||||
"@storybook/react": "^6.3.6",
|
||||
"storybook-dark-mode": "^1.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@backstage/theme": "file:../packages/theme",
|
||||
"@backstage/test-utils": "file:../packages/test-utils",
|
||||
"@backstage/core-app-api": "file:../packages/core-app-api",
|
||||
"@backstage/core-plugin-api": "file:../packages/core-plugin-api"
|
||||
}
|
||||
}
|
||||
+8873
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user