Skip to content

Commit d12dd66

Browse files
Copilotdependabot[bot]llastflowers
authored
Fix Storybook build: remove invalid positional argument in build-storybook script (#3004)
* Bump tar and storybook in /docs Removes [tar](https://github.com/isaacs/node-tar). It's no longer used after updating ancestor dependency [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/core). These dependencies need to be updated together. Removes `tar` Updates `storybook` from 7.6.21 to 10.2.17 - [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/v10.2.17/code/core) --- updated-dependencies: - dependency-name: tar dependency-version: dependency-type: indirect - dependency-name: storybook dependency-version: 10.2.17 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Initial plan * Fix storybook build: remove invalid positional argument `public/static` Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> * Fix ESM compatibility in .storybook/main.js (#3005) * Initial plan * Fix ESM compatibility: replace require('sass') with ESM import in main.js Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> * Fix Storybook 10 build: complete v7→v10 migration (#3007) * Initial plan * Initial plan for fixing storybook build failures Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> * Fix Storybook 10 build: update packages, add SCSS/Babel/docs support, fix compat shims Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> * Address code review: remove unused assert dep, rename config var, clean up shim script Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> * Fix docs npm install failure due to storybook peer dependency conflicts (#3008) * Initial plan * fix: resolve storybook peer dependency conflicts in docs install - Update @geometricpanda/storybook-addon-badges to ^2.0.5 which supports @storybook/blocks@^8.3.0 (v2.0.0 only supported ^7.0.0) - Add docs/.npmrc with legacy-peer-deps=true to handle the intentional mixed storybook 8/10 package setup used by shims and webpack aliases Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> * fix: regenerate docs/package-lock.json to resolve storybook binary not found (#3009) * Initial plan * fix: regenerate docs/package-lock.json to fix storybook binary not found Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
1 parent 784dce7 commit d12dd66

8 files changed

Lines changed: 4300 additions & 7790 deletions

File tree

docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true

docs/.storybook/main.js

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1+
import sass from 'sass'
2+
import {createRequire} from 'module'
3+
import {fileURLToPath} from 'url'
4+
5+
const require = createRequire(import.meta.url)
6+
17
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
28
const config = {
39
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
410
addons: [
5-
'@storybook/addon-links',
6-
'@storybook/addon-essentials',
7-
'@storybook/addon-interactions',
11+
'@storybook/addon-webpack5-compiler-babel',
12+
'@storybook/addon-docs',
813
'storybook-addon-pseudo-states',
9-
'@storybook/addon-storysource',
1014
'@geometricpanda/storybook-addon-badges',
11-
{
12-
name: '@storybook/addon-styling',
13-
options: {
14-
sass: {
15-
implementation: require('sass'),
16-
},
17-
},
18-
},
1915
],
2016
framework: {
2117
name: '@storybook/react-webpack5',
@@ -25,5 +21,30 @@ const config = {
2521
autodocs: 'tag',
2622
},
2723
staticDirs: ['../stories/static'],
24+
async webpackFinal(webpackConfig) {
25+
// Alias @storybook/blocks to the v10-compatible addon-docs/blocks
26+
webpackConfig.resolve = webpackConfig.resolve || {}
27+
webpackConfig.resolve.alias = {
28+
...webpackConfig.resolve.alias,
29+
'@storybook/blocks': fileURLToPath(import.meta.resolve('@storybook/addon-docs/blocks')),
30+
}
31+
32+
// Add SCSS support using sass-loader
33+
webpackConfig.module.rules.push({
34+
test: /\.s[ac]ss$/,
35+
use: [
36+
require.resolve('style-loader'),
37+
require.resolve('css-loader'),
38+
{
39+
loader: require.resolve('sass-loader'),
40+
options: {
41+
implementation: sass,
42+
},
43+
},
44+
],
45+
sideEffects: true,
46+
})
47+
return webpackConfig
48+
},
2849
}
2950
export default config

docs/.storybook/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {addons} from '@storybook/manager-api'
1+
import {addons} from 'storybook/manager-api'
22
import theme from './theme'
33

44
addons.setConfig({

docs/.storybook/theme.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)