Skip to content

Commit

Permalink
Update storybook to v7 (#357)
Browse files Browse the repository at this point in the history
* Migration

* Change npmrc
  • Loading branch information
andrzejewsky authored Apr 12, 2023
1 parent 9812952 commit 910df37
Show file tree
Hide file tree
Showing 5 changed files with 3,017 additions and 6,522 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
"plugin:import/recommended",
"plugin:import/typescript",
"prettier",
"plugin:storybook/recommended",
],
overrides: [],
parser: "@typescript-eslint/parser",
Expand Down
3 changes: 0 additions & 3 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
legacy-peer-deps=true
// TODO: #210 remove when upgrade storybook to v7
public-hoist-pattern[]=*storybook*
auto-install-peers=true
strict-peer-dependencies=false
18 changes: 13 additions & 5 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
const { mergeConfig } = require("vite");
const { resolve } = require("path");

module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-mdx-gfm",
],
staticDirs: [{ from: "../public", to: "/assets" }],
framework: "@storybook/react",
core: {
builder: "@storybook/builder-vite",
staticDirs: [
{
from: "../public",
to: "/assets",
},
],
framework: {
name: "@storybook/react-vite",
options: {},
},
features: {
storyStoreV7: true,
Expand All @@ -26,4 +31,7 @@ module.exports = {
plugins: [require("@vanilla-extract/vite-plugin").vanillaExtractPlugin()],
});
},
docs: {
autodocs: false,
},
};
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"scripts": {
"build:legacy": "cd legacy && npm run build",
"build:next": "npm-run-all check-types:next && vite build",
"build-storybook": "cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook",
"build-storybook": "cross-env NODE_OPTIONS=--openssl-legacy-provider storybook build",
"lint:legacy": "cd legacy && npm run lint",
"lint:next": "eslint 'src/**/*.@(tsx|ts|jsx|js)' --fix",
"check-types:next": "tsc",
Expand All @@ -64,7 +64,7 @@
"check-types": "npm-run-all check-types:*",
"test": "npm-run-all test:*",
"build": "npm-run-all build:*",
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider storybook dev -p 6006",
"make-release": "release-it pre",
"release": "npm-run-all build make-release",
"prepare": "is-ci || husky install"
Expand All @@ -78,12 +78,13 @@
},
"devDependencies": {
"@babel/core": "^7.20.7",
"@storybook/addon-actions": "^6.5.15",
"@storybook/addon-essentials": "^6.5.15",
"@storybook/addon-interactions": "^6.5.15",
"@storybook/addon-links": "^6.5.15",
"@storybook/builder-vite": "^0.2.6",
"@storybook/react": "^6.5.15",
"@storybook/addon-actions": "^7.0.3",
"@storybook/addon-essentials": "^7.0.3",
"@storybook/addon-interactions": "^7.0.3",
"@storybook/addon-links": "^7.0.3",
"@storybook/addon-mdx-gfm": "^7.0.3",
"@storybook/react": "^7.0.3",
"@storybook/react-vite": "^7.0.3",
"@types/react": "^17.0.50",
"@types/react-dom": "^17.0.17",
"@typescript-eslint/eslint-plugin": "^5.48.1",
Expand All @@ -101,6 +102,7 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.11",
"husky": "^8.0.3",
"is-ci": "^3.0.1",
"lint-staged": "^13.1.0",
Expand All @@ -110,6 +112,7 @@
"react-dom": "^17.0.2",
"release-it": "^15.6.0",
"require-from-string": "^2.0.2",
"storybook": "^7.0.3",
"typescript": "^4.9.3",
"vite": "^3.2.5",
"vite-plugin-dts": "^1.7.1",
Expand Down
Loading

1 comment on commit 910df37

@vercel
Copy link

@vercel vercel bot commented on 910df37 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.