Skip to content

Commit

Permalink
[other] Upgrade storybook to v7 (#98)
Browse files Browse the repository at this point in the history
* upgrade storybook to v7

* bump min node version to 16

* fix storybook bugs

* replace storybook/react with storybook/nextjs
  • Loading branch information
RealDyllon authored Jun 2, 2023
1 parent 74ac599 commit 3bbcee6
Show file tree
Hide file tree
Showing 7 changed files with 2,966 additions and 4,392 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"turbo": "^1.8.2"
},
"engines": {
"node": ">=14.0.0",
"node": ">=16.0.0",
"npm": "please-use-yarn",
"yarn": ">= 1.22.17",
"pnpm": "please-use-yarn"
Expand Down
16 changes: 16 additions & 0 deletions packages/ui/.babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
2 changes: 1 addition & 1 deletion packages/ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["custom"],
extends: ["custom"]
};
27 changes: 0 additions & 27 deletions packages/ui/.storybook/main.js

This file was deleted.

37 changes: 37 additions & 0 deletions packages/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {StorybookConfig} from "@storybook/nextjs";

const config: StorybookConfig = {
stories: [
"../components/**/*.stories.mdx",
"../components/**/*.stories.@(js|jsx|ts|tsx)",
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
],
addons: [
"@chakra-ui/storybook-addon",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-mdx-gfm"],
framework: {
name: "@storybook/nextjs",
options: {
nextConfigPath: "../next.config.js",
}
},
features: {
// emotionAlias: false
},
typescript: {
reactDocgen: "react-docgen"
},
staticDirs: ["../assets"],
docs: {
autodocs: true
},
core: {
disableTelemetry: true
},
};

export default config;
35 changes: 19 additions & 16 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,45 @@
"scripts": {
"lint": "TIMING=1 eslint \"**/*.ts*\"",
"lint:fix": "TIMING=1 eslint --fix \"**/*.ts*\"",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"devDependencies": {
"@babel/core": "^7.19.6",
"@babel/preset-env": "^7.22.4",
"@babel/preset-react": "^7.22.3",
"@babel/preset-typescript": "^7.21.5",
"@chakra-ui/react": "^2.3.6",
"@chakra-ui/storybook-addon": "^4.0.12",
"@chakra-ui/storybook-addon": "^4.0.16",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@storybook/addon-actions": "^6.5.13",
"@storybook/addon-essentials": "^6.5.13",
"@storybook/addon-interactions": "^6.5.13",
"@storybook/addon-links": "^6.5.13",
"@storybook/addons": "^6.5.13",
"@storybook/builder-webpack5": "^6.5.13",
"@storybook/jest": "^0.0.10",
"@storybook/manager-webpack5": "^6.5.13",
"@storybook/react": "^6.5.13",
"@storybook/testing-library": "^0.0.13",
"@storybook/theming": "^6.5.13",
"@storybook/addon-actions": "^7.0.18",
"@storybook/addon-essentials": "^7.0.18",
"@storybook/addon-interactions": "^7.0.18",
"@storybook/addon-links": "^7.0.18",
"@storybook/addons": "^7.0.18",
"@storybook/jest": "^0.1.0",
"@storybook/nextjs": "^7.0.18",
"@storybook/testing-library": "^0.1.0",
"@storybook/theming": "^7.0.18",
"@types/react": "18.0.24",
"@types/react-dom": "18.0.8",
"babel-loader": "^8.2.5",
"eslint": "^7.32.0",
"eslint-config-custom": "*",
"eslint-plugin-storybook": "^0.6.12",
"framer-motion": "^6",
"react": "^18.2.0",
"react-dom": "18.2.0",
"storybook-addon-next": "^1.6.10",
"storybook": "^7.0.18",
"tsconfig": "*",
"typescript": "^4.5.2"
},
"dependencies": {
"@fontsource/poppins": "^4.5.10",
"@fontsource/roboto": "^4.5.8",
"@fontsource/roboto-slab": "^4.5.9",
"@fontsource/work-sans": "^4.5.14"
"@fontsource/work-sans": "^4.5.14",
"@storybook/addon-docs": "^7.0.18"
}
}
Loading

1 comment on commit 3bbcee6

@vercel
Copy link

@vercel vercel bot commented on 3bbcee6 Jun 2, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

website-ui-storybook – ./packages/ui

website-ui-storybook-git-main-cse-it.vercel.app
storybook.ui.dev.ntuscse.com
website-ui-storybook-cse-it.vercel.app

Please sign in to comment.