Skip to content

Commit

Permalink
chore: upgrade Storybook + Vite (#211)
Browse files Browse the repository at this point in the history
* chore: upgrade Storybook + Vite
* style: fix lint errors
* chore(deps): install @vue/babel-plugin-jsx
  • Loading branch information
jledentu authored Nov 12, 2023
1 parent c1e0457 commit 6f443c6
Show file tree
Hide file tree
Showing 5 changed files with 3,899 additions and 5,566 deletions.
12 changes: 4 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,10 @@ module.exports = {
},
settings: {
"import/resolver": {
webpack: {
config: {
resolve: {
extensions: [".js", ".vue", ".json"],
alias: {
"@": path.resolve("src"),
},
},
"eslint-import-resolver-custom-alias": {
extensions: [".js", ".vue", ".json"],
alias: {
"@": path.resolve("src"),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 20.9.0
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
14 changes: 10 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ const { loadConfigFromFile, mergeConfig } = require("vite");
const vueJsx = require("@vitejs/plugin-vue-jsx");

module.exports = {
core: {
builder: "@storybook/builder-vite",
},
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
],

addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
framework: "@storybook/vue3",
framework: {
name: "@storybook/vue3-vite",
options: {},
},

async viteFinal(config) {
const { config: userConfig } = await loadConfigFromFile(
path.resolve(__dirname, "../vite.config.js")
Expand All @@ -33,4 +35,8 @@ module.exports = {
plugins: [...config.plugins, vueJsx()],
};
},

docs: {
autodocs: true,
},
};
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"build": "vite build",
"docs:dev": "concurrently 'vue-docgen -w' 'vuepress dev docs'",
"docs:build": "vue-docgen && vuepress build docs",
"storybook": "start-storybook -p 6006",
"storybook:build": "build-storybook -c .storybook -o docs/dist/stories",
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build -c .storybook -o docs/dist/stories",
"cz": "git-cz",
"test": "$npm_execpath run lint && jest --verbose --coverage",
"test:update": "jest --verbose --updateSnapshot",
Expand All @@ -65,17 +65,15 @@
"@rollup/plugin-replace": "^4.0.0",
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@storybook/addon-actions": "^6.4.22",
"@storybook/addon-controls": "^6.4.22",
"@storybook/addon-essentials": "^6.4.22",
"@storybook/addon-links": "^6.4.22",
"@storybook/builder-vite": "^0.1.33",
"@storybook/builder-webpack5": "^6.4.22",
"@storybook/manager-webpack5": "^6.4.22",
"@storybook/vue": "^6.4.22",
"@storybook/vue3": "^6.4.22",
"@vitejs/plugin-vue": "^2.3.3",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"@storybook/addon-actions": "^7.5.3",
"@storybook/addon-controls": "^7.5.3",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-links": "^7.5.3",
"@storybook/builder-vite": "^7.5.3",
"@storybook/vue3-vite": "^7.5.3",
"@vitejs/plugin-vue": "^4.4.1",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/babel-plugin-jsx": "^1.1.5",
"@vue/babel-preset-jsx": "^1.2.4",
"@vue/compat": "^3.2.37",
"@vue/compiler-sfc": "^3.2.37",
Expand All @@ -98,12 +96,13 @@
"dot": "^1.1.3",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-custom-alias": "^1.3.2",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-storybook": "^0.5.10",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-vue": "^8.5.0",
"husky": "^4.2.3",
"jest": "^27.5.1",
Expand All @@ -112,6 +111,8 @@
"jest-vue-preprocessor": "^1.7.1",
"lint-staged": "^10.0.7",
"prettier": "^2.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.70.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.0.0",
Expand All @@ -122,8 +123,9 @@
"rollup-plugin-vue": "^6.0.0",
"sass": "^1.49.9",
"semantic-release": "^17.0.4",
"storybook": "^7.5.3",
"uglify-es": "^3.3.4",
"vite": "^2.9.10",
"vite": "^4.5.0",
"vue": "^3.2.37",
"vue-docgen-cli": "^4.44.29",
"vuepress": "2.0.0-beta.61"
Expand Down
Loading

0 comments on commit 6f443c6

Please sign in to comment.