chore: install Storybook

This commit is contained in:
MAZE 2024-04-27 20:07:39 +03:30
parent 583578b315
commit 65ca7e1c94
6 changed files with 8501 additions and 188 deletions

View File

@ -1,15 +1,12 @@
{
"root": true,
"env": {
"browser": true,
"amd": true,
"node": true,
"es2022": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
@ -17,7 +14,6 @@
"jsx": true
}
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
@ -28,9 +24,9 @@
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
"plugin:astro/recommended",
"prettier"
"prettier",
"plugin:storybook/recommended"
],
"plugins": [
"@typescript-eslint",
"typescript-sort-keys",
@ -38,7 +34,6 @@
"sort-destructure-keys",
"prettier"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"prettier/prettier": "error",
@ -54,48 +49,39 @@
}
]
},
"settings": {
"react": {
"version": "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx", ".js", ".jsx"]
},
"import/resolver": {
"typescript": true,
"node": true,
"alias": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
"map": [["@", "./src"]]
}
}
},
"overrides": [
{
"files": ["**/*.astro"],
"parser": "astro-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"extraFileExtensions": [".astro"]
},
"rules": {
"prettier/prettier": "error",
"react/no-unknown-property": "off",
"react/jsx-key": "off"
},
"globals": {
"Astro": "readonly"
}
},
{
"files": ["**/*.astro/*.js"],
"rules": {

2
.gitignore vendored
View File

@ -19,3 +19,5 @@ pnpm-debug.log*
# macOS-specific files
.DS_Store
*storybook.log

19
.storybook/main.js Normal file
View File

@ -0,0 +1,19 @@
/** @type { import('@storybook/react-vite').StorybookConfig } */
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;

13
.storybook/preview.js Normal file
View File

@ -0,0 +1,13 @@
/** @type { import('@storybook/react').Preview } */
const preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};
export default preview;

8621
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,9 @@
"release": "standard-version --no-verify",
"release:major": "npm run release -- --release-as major",
"release:minor": "npm run release -- --release-as minor",
"release:patch": "npm run release -- --release-as patch"
"release:patch": "npm run release -- --release-as patch",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@astrojs/react": "^3.0.3",
@ -41,8 +43,17 @@
"zustand": "4.4.3"
},
"devDependencies": {
"@chromatic-com/storybook": "1.3.3",
"@commitlint/cli": "17.7.2",
"@commitlint/config-conventional": "17.7.0",
"@storybook/addon-essentials": "8.0.9",
"@storybook/addon-interactions": "8.0.9",
"@storybook/addon-links": "8.0.9",
"@storybook/addon-onboarding": "8.0.9",
"@storybook/blocks": "8.0.9",
"@storybook/react": "8.0.9",
"@storybook/react-vite": "8.0.9",
"@storybook/test": "8.0.9",
"@typescript-eslint/eslint-plugin": "6.7.4",
"@typescript-eslint/parser": "6.7.4",
"astro-eslint-parser": "0.16.0",
@ -61,6 +72,7 @@
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-sort-destructure-keys": "1.5.0",
"eslint-plugin-sort-keys-fix": "1.1.2",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-typescript-sort-keys": "3.1.0",
"husky": "8.0.3",
"lint-staged": "14.0.1",
@ -68,7 +80,9 @@
"postcss-nesting": "12.0.1",
"prettier": "3.0.3",
"prettier-plugin-astro": "0.12.0",
"prop-types": "15.8.1",
"standard-version": "9.5.0",
"storybook": "8.0.9",
"stylelint": "15.10.3",
"stylelint-config-html": "1.1.0",
"stylelint-config-recess-order": "4.4.0",