-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,405 additions
and
3,946 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'sku': minor | ||
--- | ||
|
||
Re-export all of `@storybook/react` | ||
|
||
Previously, only specific APIs were re-exported under `sku/@storybook/react`. All APIs are now re-exported. |
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,43 @@ | ||
--- | ||
'sku': major | ||
--- | ||
|
||
Support Storybook v7 | ||
|
||
sku now supports Storybook v7. Please read [the Storybook migration guide] for a high-level overview of what has changed. For a more detailed list of changes, take a look at [the full migration notes]. | ||
**NOTE**: Since sku installs and configures Storybook for you, a lot of the changes will not be relevant to users. | ||
|
||
**BREAKING CHANGE** | ||
|
||
As of Storybook v7, stories that use the `storiesOf` API will not work by default. The `storiesOf` API is deprecated and will be removed in Storybook v8, so it is highly encouraged to migrate your stories to the [Component Story Format (CSF)][csf]. | ||
|
||
Migration can be done automatically via the migration tools provided by Storybook: | ||
|
||
```sh | ||
npx storybook@7 migrate storiesof-to-csf --glob="src/**/*.stories.tsx" | ||
``` | ||
|
||
After doing this migration, your stories may need some manual cleanup to function correctly, such as adding [a default metadata export][meta]. | ||
|
||
When your stories are working, you can also optionally migrate to the newer [CSF 3]: | ||
|
||
```sh | ||
npx storybook@7 migrate csf-2-to-3 --glob="src/**/*.stories.tsx" | ||
``` | ||
|
||
If you cannot migrate your stories to CSF, or you need to dynamically generate stories with `storiesOf` (see [this issue][storiesof issue] for more info on the future of the `storiesOf` API), you can set the `storybookStoryStore` flag to `false` in your sku config: | ||
|
||
```ts | ||
import { type SkuConfig } from 'sku'; | ||
|
||
export default { | ||
storybookStoryStore: false, | ||
} satisfies SkuConfig; | ||
``` | ||
|
||
[the storybook migration guide]: https://storybook.js.org/docs/react/migration-guide#page-top | ||
[the full migration notes]: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700 | ||
[csf]: https://storybook.js.org/docs/react/api/csf | ||
[meta]: https://storybook.js.org/docs/react/api/csf#default-export | ||
[csf 3]: https://storybook.js.org/blog/storybook-csf3-is-here/ | ||
[storiesof issue]: https://github.com/storybookjs/storybook/issues/9828#issuecomment-1370291568 |
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 |
---|---|---|
|
@@ -7,3 +7,5 @@ dist/ | |
report/ | ||
tsconfig.json | ||
# end managed by sku | ||
|
||
src/ |
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,7 +1,7 @@ | ||
# managed by sku | ||
*.less.d.ts | ||
coverage/ | ||
dist-build/ | ||
dist-start/ | ||
dist-storybook/ | ||
report/ | ||
# end managed by sku |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
.eslintrc | ||
.prettierrc | ||
coverage/ | ||
dist-build/ | ||
dist-start/ | ||
dist-storybook/ | ||
report/ | ||
tsconfig.json | ||
|
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,7 +1,7 @@ | ||
# managed by sku | ||
*.less.d.ts | ||
coverage/ | ||
dist-build/ | ||
dist-start/ | ||
dist-storybook/ | ||
report/ | ||
# end managed by sku |
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 |
---|---|---|
@@ -1,15 +1,4 @@ | ||
// This is provided so consumers can import `sku/@storybook/react`, | ||
// since they don't depend on `@storybook/react` directly. | ||
|
||
export { | ||
addDecorator, | ||
addParameters, | ||
configure, | ||
setAddon, | ||
storiesOf, | ||
forceReRender, | ||
getStorybook, | ||
type Meta, | ||
type StoryObj, | ||
type DecoratorFn, | ||
} from '@storybook/react'; | ||
export * from '@storybook/react'; |
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 +1 @@ | ||
module.exports = require('../config'); | ||
export { default } from '../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,13 +1,44 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { paths, storybookAddons } = require('../../context'); | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { createRequire } from 'module'; | ||
import { paths, storybookAddons, storybookStoryStore } from '../../context'; | ||
|
||
module.exports = { | ||
const require = createRequire(import.meta.url); | ||
|
||
/** @type {import("@storybook/react-webpack5").StorybookConfig} */ | ||
export default { | ||
stories: paths.src | ||
.filter((srcPath) => fs.statSync(srcPath).isDirectory()) | ||
.map((srcPath) => path.join(srcPath, '**/*.stories.@(js|ts|tsx)')), | ||
addons: storybookAddons, | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
core: { | ||
builder: 'webpack5', | ||
builder: { | ||
name: '@storybook/builder-webpack5', | ||
options: { | ||
fsCache: true, | ||
}, | ||
}, | ||
}, | ||
features: { | ||
storyStoreV7: storybookStoryStore, | ||
}, | ||
babel: (config) => ({ | ||
...config, | ||
presets: [ | ||
...config.presets, | ||
[ | ||
require.resolve('@babel/preset-env'), | ||
{ | ||
targets: { | ||
chrome: 100, | ||
}, | ||
}, | ||
], | ||
require.resolve('@babel/preset-typescript'), | ||
], | ||
}), | ||
}; |
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 +1 @@ | ||
module.exports = require('../config'); | ||
export { default } from '../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
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.