mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
Install storybook
This commit is contained in:
parent
222223d075
commit
332e850f3b
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
extends: '../../eslintrc.js.base.json',
|
||||
extends: ['../../eslintrc.js.base.json', 'plugin:storybook/recommended'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
|
|
2
packages/redux-devtools-ui/.gitignore
vendored
2
packages/redux-devtools-ui/.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
storybook-static
|
||||
|
||||
*storybook.log
|
30
packages/redux-devtools-ui/.storybook/main.ts
Normal file
30
packages/redux-devtools-ui/.storybook/main.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import type { StorybookConfig } from '@storybook/react-webpack5';
|
||||
|
||||
import { join, dirname } from 'path';
|
||||
|
||||
/**
|
||||
* This function is used to resolve the absolute path of a package.
|
||||
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
||||
*/
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(require.resolve(join(value, 'package.json')));
|
||||
}
|
||||
const config: StorybookConfig = {
|
||||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
||||
addons: [
|
||||
getAbsolutePath('@storybook/addon-webpack5-compiler-swc'),
|
||||
getAbsolutePath('@storybook/addon-onboarding'),
|
||||
getAbsolutePath('@storybook/addon-links'),
|
||||
getAbsolutePath('@storybook/addon-essentials'),
|
||||
getAbsolutePath('@chromatic-com/storybook'),
|
||||
getAbsolutePath('@storybook/addon-interactions'),
|
||||
],
|
||||
framework: {
|
||||
name: getAbsolutePath('@storybook/react-webpack5'),
|
||||
options: {},
|
||||
},
|
||||
docs: {
|
||||
autodocs: 'tag',
|
||||
},
|
||||
};
|
||||
export default config;
|
14
packages/redux-devtools-ui/.storybook/preview.ts
Normal file
14
packages/redux-devtools-ui/.storybook/preview.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import type { Preview } from '@storybook/react';
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default preview;
|
|
@ -25,6 +25,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "pnpm run storybook",
|
||||
"storybook": "storybook dev -p 6006 --static-dir ./fonts",
|
||||
"build:storybook": "storybook build --static-dir ./fonts --quiet",
|
||||
"build": "pnpm run build:lib && pnpm run build:storybook",
|
||||
"build:lib": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run build:css",
|
||||
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
|
||||
|
@ -63,6 +65,16 @@
|
|||
"@babel/preset-env": "^7.24.3",
|
||||
"@babel/preset-react": "^7.24.1",
|
||||
"@babel/preset-typescript": "^7.24.1",
|
||||
"@chromatic-com/storybook": "1.2.25",
|
||||
"@storybook/addon-essentials": "^8.0.5",
|
||||
"@storybook/addon-interactions": "^8.0.5",
|
||||
"@storybook/addon-links": "^8.0.5",
|
||||
"@storybook/addon-onboarding": "^8.0.5",
|
||||
"@storybook/addon-webpack5-compiler-swc": "1.0.2",
|
||||
"@storybook/blocks": "^8.0.5",
|
||||
"@storybook/react": "^8.0.5",
|
||||
"@storybook/react-webpack5": "^8.0.5",
|
||||
"@storybook/test": "^8.0.5",
|
||||
"@testing-library/dom": "^9.3.4",
|
||||
"@testing-library/react": "^14.2.2",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
|
@ -79,6 +91,7 @@
|
|||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-storybook": "^0.8.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"ncp": "^2.0.0",
|
||||
|
@ -86,6 +99,7 @@
|
|||
"react-dom": "^18.2.0",
|
||||
"react-is": "^18.2.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"storybook": "^8.0.5",
|
||||
"styled-components": "^5.3.11",
|
||||
"stylelint": "^16.3.1",
|
||||
"stylelint-config-standard": "^36.0.0",
|
||||
|
|
2334
pnpm-lock.yaml
2334
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user