Skip to content

Commit

Permalink
update storybook to v7
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Perez committed Nov 21, 2023
1 parent c9991c7 commit f63518f
Show file tree
Hide file tree
Showing 38 changed files with 7,781 additions and 7,094 deletions.
2 changes: 1 addition & 1 deletion .babelrc.build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: "./.babelrc.js",
extends: "./babel.config.js",
ignore: [/^.*(.test.)[j|t]sx?$/],
};
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
const BABEL_PATH = path.resolve(__dirname, ".babelrc.js"); // eslint-disable-line no-undef
const BABEL_PATH = path.resolve(__dirname, "babel.config.js"); // eslint-disable-line no-undef

module.exports = {
settings: {
Expand All @@ -17,6 +17,7 @@ module.exports = {
"plugin:react-hooks/recommended",
"plugin:eslint-comments/recommended",
"prettier",
"plugin:storybook/recommended"
],
rules: {
"eslint-comments/disable-enable-pair": "off",
Expand Down
21 changes: 17 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ const STORIES = path.resolve(ROOT, "stories");
module.exports = {
webpackFinal: async (config) => {
// Read all the victory packages and alias.
glob.sync(path.join(PKGS, "victory*/package.json").replace(/\\/g, "/")).forEach((pkgPath) => {
const key = path.dirname(path.relative(PKGS, pkgPath));
config.resolve.alias[key] = path.resolve(path.dirname(pkgPath));
});
glob
.sync(path.join(PKGS, "victory*/package.json").replace(/\\/g, "/"))
.forEach((pkgPath) => {
const key = path.dirname(path.relative(PKGS, pkgPath));
config.resolve.alias[key] = path.resolve(path.dirname(pkgPath));
});

return config;
},

addons: [
"@storybook/addon-options/register",
{
Expand All @@ -30,8 +33,18 @@ module.exports = {
},
},
],

// Use glob to locate the stories, because it ignores our circular dependencies.
stories: glob.sync("../**/*.stories.@(js|jsx|ts|tsx)", {
cwd: __dirname,
}),

framework: {
name: "@storybook/react-webpack5",
options: {},
},

features: {
storyStoreV7: false, // 👈 Opt out of on-demand story loading
},
};
File renamed without changes.
2 changes: 1 addition & 1 deletion config/webpack/demo/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
use: {
loader: "babel-loader",
// eslint-disable-next-line global-require
options: require("../../../.babelrc.js"),
options: require("../../../babel.config.js"),
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
use: {
loader: "babel-loader",
// eslint-disable-next-line global-require
options: require("../../.babelrc.js"),
options: require("../../babel.config.js"),
},
},
],
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "^7.17.12",
"@changesets/cli": "^2.24.1",
"@storybook/addon-actions": "^6.5.6",
"@storybook/addon-actions": "^7.5.3",
"@storybook/addon-options": "^5.3.21",
"@storybook/addon-storysource": "^6.5.6",
"@storybook/react": "^6.5.6",
"@storybook/addon-storysource": "^7.5.3",
"@storybook/react": "^7.5.3",
"@storybook/react-webpack5": "^7.5.3",
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
Expand Down Expand Up @@ -83,6 +84,7 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.0.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-storybook": "^0.6.15",
"fs-extra": "^10.0.0",
"glob": "8.0.3",
"immutable": "^3.8.2",
Expand All @@ -104,6 +106,7 @@
"remark-stringify": "^7.0.3",
"rimraf": "^3.0.2",
"seedrandom": "^3.0.5",
"storybook": "^7.5.3",
"styled-components": "^5.3.5",
"ts-jest": "^28.0.7",
"ts-loader": "^9.3.0",
Expand Down Expand Up @@ -158,8 +161,8 @@
"types:check": "wireit",
"types:create": "wireit",
"storybook:build": "wireit",
"build-storybook": "pnpm run build:lib:esm && pnpm exec build-storybook",
"storybook:server": "concurrently --raw \"pnpm:build:lib:esm --watch\" \"start-storybook -p 6006\"",
"build-storybook": "pnpm run build:lib:esm && pnpm exec storybook build",
"storybook:server": "concurrently --raw \"pnpm:build:lib:esm --watch\" \"storybook dev -p 6006\"",
"chromatic": "wireit",
"chromatic:ci": "wireit",
"sync": "wireit",
Expand Down Expand Up @@ -482,7 +485,7 @@
]
},
"storybook:build": {
"command": "build-storybook",
"command": "storybook build",
"files": [
".storybook",
"stories",
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -97,7 +97,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -124,7 +124,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js",
"../../config/webpack.config.dev.js"
Expand All @@ -147,7 +147,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js"
],
Expand Down Expand Up @@ -279,7 +279,7 @@
"command": "nps jest:pkg",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"../../babel.config.js",
"../../test/jest-config.js",
"../../test/jest-setup.ts"
],
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-axis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -95,7 +95,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -121,7 +121,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js",
"../../config/webpack.config.dev.js"
Expand All @@ -143,7 +143,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js"
],
Expand Down Expand Up @@ -271,7 +271,7 @@
"command": "nps jest:pkg",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"../../babel.config.js",
"../../test/jest-config.js",
"../../test/jest-setup.ts"
],
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -97,7 +97,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -124,7 +124,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js",
"../../config/webpack.config.dev.js"
Expand All @@ -147,7 +147,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js"
],
Expand Down Expand Up @@ -279,7 +279,7 @@
"command": "nps jest:pkg",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"../../babel.config.js",
"../../test/jest-config.js",
"../../test/jest-setup.ts"
],
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-box-plot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -97,7 +97,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -124,7 +124,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js",
"../../config/webpack.config.dev.js"
Expand All @@ -147,7 +147,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js"
],
Expand Down Expand Up @@ -279,7 +279,7 @@
"command": "nps jest:pkg",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"../../babel.config.js",
"../../test/jest-config.js",
"../../test/jest-setup.ts"
],
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-brush-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -95,7 +95,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -121,7 +121,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js",
"../../config/webpack.config.dev.js"
Expand All @@ -143,7 +143,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js"
],
Expand Down Expand Up @@ -268,7 +268,7 @@
"command": "nps jest:pkg",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"../../babel.config.js",
"../../test/jest-config.js",
"../../test/jest-setup.ts"
],
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-brush-line/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -92,7 +92,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js"
],
"output": [
Expand All @@ -118,7 +118,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js",
"../../config/webpack.config.dev.js"
Expand All @@ -140,7 +140,7 @@
"src/**",
"!src/**/*.test.*",
"../../.babelrc.build.js",
"../../.babelrc.js",
"../../babel.config.js",
"../../package-scripts.js",
"../../config/webpack.config.js"
],
Expand Down Expand Up @@ -265,7 +265,7 @@
"command": "nps jest:pkg",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"../../babel.config.js",
"../../test/jest-config.js",
"../../test/jest-setup.ts"
],
Expand Down
Loading

0 comments on commit f63518f

Please sign in to comment.