Skip to content

Commit 7508674

Browse files
authored
Fix bundling of embed package (#3716)
1 parent eea8f1e commit 7508674

File tree

7 files changed

+154
-110
lines changed

7 files changed

+154
-110
lines changed

.changeset/soft-hornets-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gitbook/embed": patch
3+
---
4+
5+
Fix bundling of packages

bun.lock

Lines changed: 121 additions & 89 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"devDependencies": {
55
"@biomejs/biome": "^1.9.4",
6-
"@changesets/cli": "^2.27.12",
6+
"@changesets/cli": "^2.29.7",
77
"turbo": "^2.5.0",
88
"vercel": "^39.3.0"
99
},
@@ -26,16 +26,18 @@
2626
"e2e": "turbo run e2e",
2727
"e2e-customers": "turbo run e2e-customers",
2828
"changeset": "changeset",
29-
"changeset-version": "changeset version && bun run format",
30-
"release": "turbo run release && changeset publish",
29+
"changeset-version": "changeset version && bun run format && bun update",
30+
"release": "turbo run release && bun run publish-all-packages",
31+
"publish-all-packages": "for dir in packages/*; do (cd \"$dir\" && bun publish || true); done && changeset tag",
3132
"download:env": "op read op://gitbook-x-dev/gitbook-open/.env.local >> .env.local",
3233
"clean": "turbo run clean"
3334
},
3435
"workspaces": {
3536
"packages": ["packages/*"],
3637
"catalog": {
3738
"@gitbook/api": "0.143.2",
38-
"bidc": "^0.0.2"
39+
"bidc": "^0.0.2",
40+
"tsdown": "^0.15.6"
3941
}
4042
},
4143
"patchedDependencies": {

packages/embed/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
"exports": {
66
".": {
77
"types": "./dist/index.d.ts",
8-
"default": "./dist/index.js",
9-
"standalone": "./dist/standalone/index.js",
10-
"react": "./dist/react/index.js"
8+
"default": "./dist/index.js"
9+
},
10+
"./react": {
11+
"types": "./dist/react/index.d.ts",
12+
"default": "./dist/react/index.js"
1113
}
1214
},
1315
"version": "0.1.1",
@@ -20,12 +22,16 @@
2022
"react": "^18.0.0"
2123
},
2224
"devDependencies": {
25+
"tsdown": "catalog:",
2326
"typescript": "^5.5.3",
2427
"react": "^19.0.0"
2528
},
2629
"scripts": {
27-
"build": "tsc && bun build src/standalone/index.ts --bundle --minify --outdir=standalone",
30+
"build": "bun run build-lib && bun run build-standalone",
31+
"build-lib": "tsdown",
32+
"build-standalone": "bun build src/standalone/index.ts --bundle --minify --outdir=standalone",
33+
"clean": "rm -rf ./dist",
2834
"typecheck": "tsc --noEmit"
2935
},
30-
"files": ["dist", "README.md", "CHANGELOG.md", "standalone"]
36+
"files": ["dist", "README.md", "CHANGELOG.md"]
3137
}

packages/embed/tsdown.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'tsdown';
2+
3+
export default defineConfig([
4+
{
5+
entry: ['src/index.ts', 'src/react/index.ts'],
6+
dts: true,
7+
format: ['esm'],
8+
},
9+
]);

packages/expr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
},
2222
"devDependencies": {
2323
"bun-types": "^1.1.20",
24-
"tsdown": "^0.15.0",
24+
"tsdown": "catalog:",
2525
"@types/estree": "^1.0.6",
2626
"@babel/types": "^7.26.0",
2727
"@types/json-schema": "^7.0.15",
2828
"@types/escodegen": "^0.0.10"
2929
},
3030
"scripts": {
31-
"build": "tsdown --project tsconfig.build.json",
31+
"build": "tsdown",
3232
"typecheck": "tsc --noEmit",
3333
"unit": "bun test",
3434
"clean": "rm -rf ./dist",

packages/expr/tsconfig.build.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)