Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preact: Enable ts plugin by default #21225

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion code/presets/preact-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.19.0",
"@babel/plugin-transform-react-jsx": "^7.21.0",
"@babel/preset-typescript": "^7.21.0",
"@storybook/core-webpack": "7.0.0-beta.53",
"@types/node": "^16.0.0"
},
Expand Down
9 changes: 8 additions & 1 deletion code/presets/preact-webpack/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { StorybookConfig } from './types';

export * from './types';

export const babel: StorybookConfig['babelDefault'] = (config) => {
export const babel: StorybookConfig['babelDefault'] = (config, options) => {
return {
...config,
plugins: [
Expand All @@ -19,6 +19,13 @@ export const babel: StorybookConfig['babelDefault'] = (config) => {
return true;
}),
],
overrides: [
// Transforms to apply only to first-party code:
{
exclude: '**/node_modules/**',
presets: [require.resolve('@babel/preset-typescript')],
},
],
};
};

Expand Down
99 changes: 98 additions & 1 deletion code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,24 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-create-class-features-plugin@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/helper-create-class-features-plugin@npm:7.21.0"
dependencies:
"@babel/helper-annotate-as-pure": ^7.18.6
"@babel/helper-environment-visitor": ^7.18.9
"@babel/helper-function-name": ^7.21.0
"@babel/helper-member-expression-to-functions": ^7.21.0
"@babel/helper-optimise-call-expression": ^7.18.6
"@babel/helper-replace-supers": ^7.20.7
"@babel/helper-skip-transparent-expression-wrappers": ^7.20.0
"@babel/helper-split-export-declaration": ^7.18.6
peerDependencies:
"@babel/core": ^7.0.0
checksum: a034b6cc4ebf255ba3b1a5093ddf09321f7a70e438490c2ae5e517de8dfbf4cf5086f725e28f01864eb3798f704ce2be9b1adb0a748d756ebae14c4c8d6d8188
languageName: node
linkType: hard

"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.20.5":
version: 7.20.5
resolution: "@babel/helper-create-regexp-features-plugin@npm:7.20.5"
Expand Down Expand Up @@ -639,6 +657,16 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-function-name@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/helper-function-name@npm:7.21.0"
dependencies:
"@babel/template": ^7.20.7
"@babel/types": ^7.21.0
checksum: 5b4387afd34cd98a3a7f24f42250a5db6f7192a46e57bdbc151dc311b6299ceac151c5236018469af193dfb887b0b7ef8fe7ed89459cd05f00d69b3710c17498
languageName: node
linkType: hard

"@babel/helper-hoist-variables@npm:^7.18.6":
version: 7.18.6
resolution: "@babel/helper-hoist-variables@npm:7.18.6"
Expand All @@ -657,6 +685,15 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-member-expression-to-functions@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/helper-member-expression-to-functions@npm:7.21.0"
dependencies:
"@babel/types": ^7.21.0
checksum: e9e5a57a306268e379ebefa7698008dfff60e53c35e719f2ad0e9b447901a05ec0cb03982d4f386acdcbdddbdf2ee04950cdc464754253bb488c7da2ff922503
languageName: node
linkType: hard

"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.8.3":
version: 7.18.6
resolution: "@babel/helper-module-imports@npm:7.18.6"
Expand Down Expand Up @@ -781,6 +818,13 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-validator-option@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/helper-validator-option@npm:7.21.0"
checksum: a5efbf3f09f1514d1704f3f7bf0e5fac401fff48a9b84a9eb47a52a4c13beee9802c6cf212a82c5fb95f6cc6b5932cb32e756cf33075be17352f64827a8ec066
languageName: node
linkType: hard

"@babel/helper-wrap-function@npm:^7.18.9":
version: 7.20.5
resolution: "@babel/helper-wrap-function@npm:7.20.5"
Expand Down Expand Up @@ -1666,6 +1710,21 @@ __metadata:
languageName: node
linkType: hard

"@babel/plugin-transform-react-jsx@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/plugin-transform-react-jsx@npm:7.21.0"
dependencies:
"@babel/helper-annotate-as-pure": ^7.18.6
"@babel/helper-module-imports": ^7.18.6
"@babel/helper-plugin-utils": ^7.20.2
"@babel/plugin-syntax-jsx": ^7.18.6
"@babel/types": ^7.21.0
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 88ea88e17cbcff8c0b4b022d38020161f59ef37847b5e57074c135d109b8d4b2def57fb13d79dffad3a8d04e5113eb15aea3d73937e4ba563f0dbdd78115a584
languageName: node
linkType: hard

"@babel/plugin-transform-react-pure-annotations@npm:^7.18.6":
version: 7.18.6
resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.18.6"
Expand Down Expand Up @@ -1786,6 +1845,19 @@ __metadata:
languageName: node
linkType: hard

"@babel/plugin-transform-typescript@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/plugin-transform-typescript@npm:7.21.0"
dependencies:
"@babel/helper-create-class-features-plugin": ^7.21.0
"@babel/helper-plugin-utils": ^7.20.2
"@babel/plugin-syntax-typescript": ^7.20.0
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 7715c092e690196c05b0e49c7602ef7c6780940488b48d4d8b48a745ff67d4ea0e4424c1192748555721373b14a62faedb02de0188e961065b1f5c990aa37bec
languageName: node
linkType: hard

"@babel/plugin-transform-unicode-escapes@npm:^7.18.10":
version: 7.18.10
resolution: "@babel/plugin-transform-unicode-escapes@npm:7.18.10"
Expand Down Expand Up @@ -1961,6 +2033,19 @@ __metadata:
languageName: node
linkType: hard

"@babel/preset-typescript@npm:^7.21.0":
version: 7.21.0
resolution: "@babel/preset-typescript@npm:7.21.0"
dependencies:
"@babel/helper-plugin-utils": ^7.20.2
"@babel/helper-validator-option": ^7.21.0
"@babel/plugin-transform-typescript": ^7.21.0
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 26e4055272b6dff5622e33534eab6f6397cf2abbeaa326a7a416da06437e6d3a7e0ba0188dfec01f94f30fca3f09a1e01f8a30511277202de150459e54db8075
languageName: node
linkType: hard

"@babel/register@npm:^7.13.16":
version: 7.18.9
resolution: "@babel/register@npm:7.18.9"
Expand Down Expand Up @@ -2089,6 +2174,17 @@ __metadata:
languageName: node
linkType: hard

"@babel/types@npm:^7.21.0":
version: 7.21.2
resolution: "@babel/types@npm:7.21.2"
dependencies:
"@babel/helper-string-parser": ^7.19.4
"@babel/helper-validator-identifier": ^7.19.1
to-fast-properties: ^2.0.0
checksum: e9a5445dd55f86decc373c24abe10eb76ff9247d30cf46267bc4998c29152ebcec8f6a768b03cbb5d5a728232acc7084913d8e1c60e69477f592244700457d4e
languageName: node
linkType: hard

"@base2/pretty-print-object@npm:1.0.1":
version: 1.0.1
resolution: "@base2/pretty-print-object@npm:1.0.1"
Expand Down Expand Up @@ -6547,7 +6643,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/preset-preact-webpack@workspace:presets/preact-webpack"
dependencies:
"@babel/plugin-transform-react-jsx": ^7.19.0
"@babel/plugin-transform-react-jsx": ^7.21.0
"@babel/preset-typescript": ^7.21.0
"@storybook/core-webpack": 7.0.0-beta.53
"@types/node": ^16.0.0
preact: ^10.5.13
Expand Down