From 27be05892fc8e3f743e8acb64d0b64b2b091fc03 Mon Sep 17 00:00:00 2001 From: Steven Chen Date: Tue, 29 Oct 2024 14:12:35 +0800 Subject: [PATCH 1/4] chore: update packages --- .eslintrc.js | 19 - .husky/.gitignore | 1 - .husky/pre-commit | 4 - .storybook/main.js | 15 +- .storybook/preview.tsx | 2 +- docs/iframe.html | 285 +- docs/index.html | 135 +- eslint.config.mjs | 47 + package.json | 117 +- pnpm-lock.yaml | 13999 +++++++--------- rollup.config.js | 2 +- src/components/Button/Button.stories.tsx | 2 - src/components/Button/Button.tsx | 15 +- .../DialogButton/DialogButton.stories.tsx | 1 - .../Button/DialogButton/DialogButton.tsx | 3 +- .../Button/DialogButton/DialogButton.types.ts | 4 +- .../Dropdown/DropdownColor/DropdownColor.tsx | 2 +- src/components/Step/Step.types.ts | 1 + src/components/Switch/Switch.tsx | 7 +- src/svg/CheckboxSvgIcon.tsx | 1 - 20 files changed, 6873 insertions(+), 7789 deletions(-) delete mode 100644 .eslintrc.js delete mode 100644 .husky/.gitignore delete mode 100755 .husky/pre-commit create mode 100644 eslint.config.mjs diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 8a444f5..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - sourceType: 'module' - }, - plugins: ['@typescript-eslint/eslint-plugin'], - extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:storybook/recommended'], - root: true, - env: { - node: true, - jest: true - }, - ignorePatterns: ['.eslintrc.js', 'lib/**/*.js', 'lib/**/*.ts', 'rollup.config.js'], - rules: { - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-empty-function': 'off' - } -}; \ No newline at end of file diff --git a/.husky/.gitignore b/.husky/.gitignore deleted file mode 100644 index 31354ec..0000000 --- a/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index c37466e..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx lint-staged \ No newline at end of file diff --git a/.storybook/main.js b/.storybook/main.js index 9cf2e3e..6dd7712 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -4,7 +4,11 @@ const { mergeConfig } = require('vite'); module.exports = { stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], - addons: ['@storybook/addon-links', '@storybook/addon-essentials'], + addons: [ + '@storybook/addon-links', + '@storybook/addon-essentials', + '@chromatic-com/storybook' + ], core: { builder: '@storybook/builder-vite', }, @@ -19,17 +23,10 @@ module.exports = { }, }, viteFinal: async (config) => { - return mergeConfig(config, { - optimizeDeps: { - include: ['storybook-dark-mode'], - }, - }); + return mergeConfig(config); }, framework: { name: '@storybook/react-webpack5', options: {}, }, - docs: { - autodocs: true, - }, }; diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index fe45bc2..1bf20fe 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -13,7 +13,6 @@ export const decorators = [ ]; export const parameters = { - actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { date: /Date$/, @@ -37,3 +36,4 @@ export const parameters = { ], }, }; +export const tags = ['autodocs']; diff --git a/docs/iframe.html b/docs/iframe.html index 28aea16..fadcdf2 100644 --- a/docs/iframe.html +++ b/docs/iframe.html @@ -1,33 +1,63 @@ - + - - - - Storybook - - - - - - - - - - + + + Storybook + + + + + + - + - + - + - + - + - + - + - + + + + + - - - - - - - - - - - - - - - - - - -
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-

No Preview

-

Sorry, but you either have no stories or none are selected somehow.

-
    -
  • Please check the Storybook config.
  • -
  • Try reloading the page.
  • -
-

- If the problem persists, check the browser console, or the terminal you've run Storybook from. -

-
-
- -
-
-

-

- The component failed to render properly, likely due to a configuration issue in Storybook. - Here are some common causes and how you can address them: -

-
    -
  1. - Missing Context/Providers: You can use decorators to supply specific - contexts or providers, which are sometimes necessary for components to render correctly. For - detailed instructions on using decorators, please visit the - Decorators documentation. -
  2. -
  3. - Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary - settings for loaders, plugins, and other relevant parameters. You can find step-by-step - guides for configuring - Webpack or - Vite - with Storybook. -
  4. -
  5. - Missing Environment Variables: Your Storybook may require specific - environment variables to function as intended. You can set up custom environment variables - as outlined in the - Environment Variables documentation. -
  6. -
-
-
-
- -
-
- - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 49d91f8..0000000 --- a/docs/index.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - @storybook/core - Storybook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -