-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: move to new v.6 of storybook (#305)
Signed-off-by: Nastya Rusina <nastya@union.ai>
- Loading branch information
Showing
24 changed files
with
3,665 additions
and
4,865 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 was deleted.
Oops, something went wrong.
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,4 +1,20 @@ | ||
module.exports = { | ||
stories: ['../src/components/**/*.stories.tsx'], | ||
addons: ['@storybook/addon-knobs'] | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'], | ||
framework: '@storybook/react', | ||
webpackFinal: async (config, { configType }) => { | ||
config.resolve.modules = ['src', 'node_modules']; | ||
config.module.rules = [ | ||
...config.module.rules, | ||
{ | ||
// needed to ensure proper same level of typing between app and storybook built. | ||
// without it we have troubles with exporting flyteidl types due to nested namespace nature of | ||
// flyteidl.d.ts file. | ||
test: /\.tsx?$/, | ||
exclude: /node_modules/, | ||
use: ['babel-loader', { loader: 'ts-loader', options: { transpileOnly: true } }] | ||
} | ||
]; | ||
return config; | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
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,26 +1,20 @@ | ||
import '../src/protobuf'; | ||
import { withKnobs } from '@storybook/addon-knobs'; | ||
import { addDecorator } from '@storybook/react'; | ||
import * as React from 'react'; | ||
import StoryRouter from 'storybook-react-router'; | ||
import React from 'react'; | ||
import { StorybookContainer } from './StorybookContainer'; | ||
|
||
addDecorator(withKnobs); | ||
addDecorator(StoryRouter()); | ||
addDecorator(Story => ( | ||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/ | ||
} | ||
} | ||
}; | ||
|
||
export const decorators = [ | ||
Story => ( | ||
<StorybookContainer> | ||
<Story /> | ||
<Story /> | ||
</StorybookContainer> | ||
)); | ||
|
||
// Storybook executes this module in both bootstap phase (Node) | ||
// and a story's runtime (browser). However, cannot call `setupWorker` | ||
// in Node environment, so need to check if we're in a browser. | ||
if (typeof global.process === 'undefined') { | ||
const { worker } = require('./worker'); | ||
|
||
// Start the mocking when each story is loaded. | ||
// Repetitive calls to the `.start()` method will check for an existing | ||
// worker and reuse it. | ||
worker.start(); | ||
} | ||
) | ||
]; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.