Skip to content

Commit fabf42f

Browse files
committed
chore: 🤖 fix Storybook build
1 parent 9ef9535 commit fabf42f

5 files changed

Lines changed: 3362 additions & 6585 deletions

File tree

.storybook/addons.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import '@storybook/addon-knobs/register';
21
import '@storybook/addon-options/register';
32
import '@storybook/addon-actions/register';
43
import '@storybook/addon-notes/register';

.storybook/webpack.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ module.exports = async ({ config, mode }) => {
2525
},
2626
},
2727
},
28+
// Transpile react-draggable to handle optional chaining syntax
29+
{
30+
test: /\.js$/,
31+
include: /node_modules[\\/]react-draggable/,
32+
use: {
33+
loader: 'babel-loader',
34+
options: {
35+
presets: ['@babel/preset-env'],
36+
plugins: [
37+
'@babel/plugin-transform-optional-chaining',
38+
'@babel/plugin-transform-nullish-coalescing-operator',
39+
],
40+
},
41+
},
42+
},
2843
);
2944

3045
config.plugins.push(new ForkTsCheckerWebpackPlugin());

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ module.exports = {
1111
"@babel/preset-react",
1212
"@babel/preset-typescript"
1313
],
14+
plugins: [
15+
"@babel/plugin-transform-optional-chaining",
16+
"@babel/plugin-transform-nullish-coalescing-operator"
17+
],
1418
env: {
1519
test: {
1620
plugins: ['dynamic-import-node']

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"build:es": "tsc -m esNext --outDir esm",
2525
"build": "yarn build:cjs && yarn build:es",
2626
"clean": "rimraf lib storybook-static esm",
27-
"storybook": "start-storybook -p 6008",
28-
"storybook:build": "build-storybook",
27+
"storybook": "NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6008",
28+
"storybook:build": "NODE_OPTIONS=--openssl-legacy-provider build-storybook",
2929
"storybook:upload": "gh-pages -d storybook-static --git \"$(which git)\"",
3030
"storybook:clean": "rimraf storybook-static",
3131
"release": "semantic-release"
@@ -69,6 +69,8 @@
6969
"devDependencies": {
7070
"@babel/core": "7.28.3",
7171
"@babel/plugin-syntax-dynamic-import": "7.8.3",
72+
"@babel/plugin-transform-nullish-coalescing-operator": "^7.28.6",
73+
"@babel/plugin-transform-optional-chaining": "^7.28.6",
7274
"@babel/preset-env": "7.28.3",
7375
"@babel/preset-react": "7.27.1",
7476
"@babel/preset-typescript": "7.27.1",
@@ -156,6 +158,9 @@
156158
"git add"
157159
]
158160
},
161+
"resolutions": {
162+
"react-draggable": "4.4.5"
163+
},
159164
"volta": {
160165
"node": "14.21.3",
161166
"yarn": "1.22.22"

0 commit comments

Comments
 (0)