-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update storybook for bazel migration (#265)
* Storybook 7 + Bazel 6 * Fix react references with storybook & pnpm * Update storybook to bazel 6 and storybook 7 * Convert rest of mocks to use tsx. Update all stories * Use rules_bazel commit sha * Fix some styling * Remove chakra from reference assets * Update rules
- Loading branch information
Showing
144 changed files
with
7,826 additions
and
9,220 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
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
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 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
import path from "path"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.@(stories.@(js|tsx|ts))", "../src/**/*.mdx"], | ||
addons: ["@storybook/addon-docs", "@player-ui/storybook-addon-player"], | ||
typescript: { | ||
reactDocgen: false, | ||
}, | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {}, | ||
}, | ||
webpackFinal(config) { | ||
if (config.resolve) { | ||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
|
||
// storybook + pnpm issue | ||
// https://github.com/storybookjs/storybook/discussions/22650#discussioncomment-6414161 | ||
react: path.resolve(__dirname, "../../../node_modules/react"), | ||
"react-dom": path.resolve(__dirname, "../../../node_modules/react-dom"), | ||
}; | ||
} | ||
return config; | ||
}, | ||
refs: { | ||
"@chakra-ui/react": { | ||
disable: true, | ||
}, | ||
}, | ||
}; | ||
|
||
module.exports = 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,34 +1,34 @@ | ||
import { PlayerDecorator } from '@player-ui/storybook'; | ||
import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; | ||
import { CommonTypesPlugin } from '@player-ui/common-types-plugin'; | ||
import { DataChangeListenerPlugin } from '@player-ui/data-change-listener-plugin'; | ||
import { ComputedPropertiesPlugin } from '@player-ui/computed-properties-plugin' | ||
import * as dslRefComponents from '@player-ui/reference-assets-components'; | ||
// import { PlayerDecorator } from "@player-ui/storybook-addon-player"; | ||
import { ReferenceAssetsPlugin } from "@player-ui/reference-assets-plugin-react"; | ||
import { CommonTypesPlugin } from "@player-ui/common-types-plugin"; | ||
import { DataChangeListenerPlugin } from "@player-ui/data-change-listener-plugin"; | ||
import { ComputedPropertiesPlugin } from "@player-ui/computed-properties-plugin"; | ||
import * as dslRefComponents from "@player-ui/reference-assets-plugin-components"; | ||
|
||
import "@player-ui/reference-assets-plugin-react/dist/index.css"; | ||
|
||
const reactPlayerPlugins = [ | ||
new ReferenceAssetsPlugin(), | ||
new CommonTypesPlugin(), | ||
new DataChangeListenerPlugin(), | ||
new ComputedPropertiesPlugin(), | ||
] | ||
]; | ||
|
||
export const parameters = { | ||
reactPlayerPlugins, | ||
dslEditor: { | ||
additionalModules: { | ||
'@player-ui/reference-assets-components': dslRefComponents, | ||
"@player-ui/reference-assets-plugin-components": dslRefComponents, | ||
}, | ||
}, | ||
options: { | ||
storySort: { | ||
order: [ | ||
'Welcome', | ||
'Player', | ||
'Reference Assets', | ||
['Overview', 'Intro'], | ||
] | ||
} | ||
} | ||
} | ||
|
||
export const decorators = [PlayerDecorator]; | ||
"Welcome", | ||
"React Player", | ||
"Reference Assets", | ||
["Docs", "Overview", "Intro"], | ||
], | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.