-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update storybook to v6 (#1638)
* chore(deps-dev): bump @storybook/react from 5.3.18 to 6.0.26 Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 5.3.18 to 6.0.26. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.0.26/app/react) Signed-off-by: dependabot-preview[bot] <[email protected]> * chore: migrate storybook to v6 * chore: add node types to tsconfig * chore: get rid of tsconfig.build paths * chore: fix menu expander * chore: fix storybook links * chore: update snapshots Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
- Loading branch information
1 parent
530860f
commit 450b301
Showing
158 changed files
with
1,737 additions
and
977 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { STORY_RENDERED } from '@storybook/core-events' | ||
import { SET_STORIES, SELECT_STORY } from '@storybook/core-events' | ||
import addons from '@storybook/addons' | ||
|
||
import { scheduleWork } from './index' | ||
|
||
const ADDON_ID = 'menu-expand' | ||
|
||
addons.register(ADDON_ID, api => { | ||
api.on(STORY_RENDERED, scheduleWork(api)) | ||
api.once(SET_STORIES, scheduleWork(api)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
const webpack = require('webpack') | ||
const path = require('path') | ||
const { IgnoreNotFoundPlugin } = require('./plugins') | ||
|
||
// example1: /packages/picasso/src/Button/Button.tsx | ||
// example2: /packages/picasso-lab/src/Slider/Slider.tsx | ||
const PACKAGES_COMPONENT_DECLARATION_FILE_REGEXP = /packages\/.*\/src\/(.*)\/\1.tsx$/ | ||
|
||
const { env } = process | ||
const isDevelopment = env.NODE_ENV !== 'production' && env.NODE_ENV !== 'test' | ||
|
||
const tsConfigFile = path.join(__dirname, './tsconfig.json') | ||
const threadLoaders = [{ loader: 'cache-loader' }, { loader: 'thread-loader' }] | ||
|
||
module.exports = { | ||
addons: [ | ||
'storybook-readme/register', | ||
'@storybook/addon-viewport/register', | ||
'./addons/menu-expander/register', | ||
'./addons/anchor-link-handler/register', | ||
'./addons/document-title/register' | ||
], | ||
typescript: { | ||
check: isDevelopment, | ||
checkOptions: { | ||
tsconfig: tsConfigFile, | ||
checkSyntacticErrors: true | ||
}, | ||
reactDocgen: 'react-docgen-typescript', | ||
reactDocgenTypescriptOptions: { | ||
tsconfigPath: tsConfigFile, | ||
propFilter: prop => { | ||
if (prop.description.length === 0) return false | ||
|
||
if (prop.parent) { | ||
return !prop.parent.fileName.includes('node_modules') | ||
} | ||
|
||
return true | ||
} | ||
} | ||
}, | ||
webpackFinal: config => { | ||
config.entry = [ | ||
'core-js/stable', | ||
'regenerator-runtime/runtime', | ||
...config.entry | ||
] | ||
|
||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
oneOf: [ | ||
{ | ||
test: PACKAGES_COMPONENT_DECLARATION_FILE_REGEXP, | ||
use: threadLoaders | ||
}, | ||
{ use: threadLoaders } | ||
] | ||
}) | ||
|
||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
'~': path.resolve(__dirname, '..'), | ||
'@toptal/picasso': path.resolve(__dirname, '../packages/picasso/src'), | ||
'@toptal/picasso-shared': path.resolve( | ||
__dirname, | ||
'../packages/shared/src' | ||
), | ||
'@toptal/picasso/utils': path.resolve( | ||
__dirname, | ||
'../packages/picasso/src/utils' | ||
), | ||
'@toptal/picasso/Icon': path.resolve( | ||
__dirname, | ||
'../packages/picasso/src/Icon' | ||
), | ||
'@toptal/picasso-lab': path.resolve( | ||
__dirname, | ||
'../packages/picasso-lab/src' | ||
), | ||
'@toptal/picasso-forms': path.resolve( | ||
__dirname, | ||
'../packages/picasso-forms/src' | ||
), | ||
'@toptal/picasso-charts': path.resolve( | ||
__dirname, | ||
'../packages/picasso-charts/src' | ||
), | ||
'@topkit/analytics-charts': path.resolve( | ||
__dirname, | ||
'../packages/topkit-analytics-charts/src' | ||
) | ||
} | ||
|
||
config.plugins.push( | ||
new webpack.DefinePlugin({ | ||
TEST_ENV: JSON.stringify(env.TEST_ENV) | ||
}), | ||
// https://github.com/TypeStrong/ts-loader/issues/653 | ||
new IgnoreNotFoundPlugin(['OverridableComponent', 'StandardProps']) | ||
) | ||
|
||
config.node = { | ||
fs: 'empty', | ||
module: 'empty' | ||
} | ||
|
||
config.optimization.minimizer = [] | ||
|
||
return config | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
import 'storybook-readme/register' | ||
import '@storybook/addon-viewport/register' | ||
require('./addons/menu-expander/register') | ||
require('./addons/anchor-link-handler/register') | ||
require('./addons/document-title/register') | ||
import { create } from '@storybook/theming' | ||
import { addons } from '@storybook/addons' | ||
|
||
const theme = create({ | ||
base: 'light', | ||
brandTitle: 'Picasso', | ||
brandImage: | ||
'https://user-images.githubusercontent.com/437214/54037817-b4da1800-41c7-11e9-81f5-59ed43e38500.png' | ||
}) | ||
|
||
addons.setConfig({ | ||
showPanel: false, | ||
theme | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.