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

Build: Use TSUP to compile the renderers #18534

Merged
merged 16 commits into from
Jun 29, 2022
Merged
Prev Previous commit
Next Next commit
another one
  • Loading branch information
ndelangen committed Jun 22, 2022
commit 6ee74300675eb4dfae19df6fa4ed9a148f123d9c
30 changes: 26 additions & 4 deletions renderers/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./preview": {
"require": "./dist/config.js",
"import": "./dist/config.mjs",
"types": "./dist/config.d.ts"
},
"./package.json": {
"require": "./package.json",
"import": "./package.json",
"types": "./package.json"
}
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"templates/**/*",
Expand All @@ -30,7 +47,7 @@
"*.d.ts"
],
"scripts": {
"prepare": "node ../../scripts/prepare.js"
"prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.5",
Expand All @@ -46,6 +63,7 @@
"sveltedoc-parser": "4.1.0"
},
"devDependencies": {
"@digitak/esrun": "^3.2.2",
"svelte": "^3.31.2"
},
"peerDependencies": {
Expand All @@ -58,5 +76,9 @@
"publishConfig": {
"access": "public"
},
"bundlerEntrypoint": [
"./src/index.ts",
"./src/config.ts"
],
"gitHead": "3dd46982823b34d9f37be917b6247631081feff7"
}
2 changes: 1 addition & 1 deletion renderers/svelte/preview.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/esm/config';
export * from './dist/config';
5 changes: 5 additions & 0 deletions scripts/prepare/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
target: 'node16',
clean: true,
shims: true,
external: [
packageJson.name,
...Object.keys(packageJson.dependencies || {}),
...Object.keys(packageJson.peerDependencies || {}),
],

dts: optimized
? {
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9429,6 +9429,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/svelte@workspace:renderers/svelte"
dependencies:
"@digitak/esrun": ^3.2.2
"@storybook/addons": 7.0.0-alpha.5
"@storybook/client-logger": 7.0.0-alpha.5
"@storybook/core-client": 7.0.0-alpha.5
Expand Down