From b31c71f6ca00bf2fd46e29e3f01d557d250fe12d Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Wed, 20 Nov 2024 09:18:11 -0800 Subject: [PATCH] build: add script to prune package before publish --- .github/workflows/release.yml | 3 +++ bun.lockb | Bin 48334 -> 50242 bytes package.json | 4 +++- scripts/prune-package.ts | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scripts/prune-package.ts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 112ff0a..3619d7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,9 @@ jobs: node-version: "20.x" registry-url: "https://registry.npmjs.org" + - name: Prune package.json + run: bun run build:prune-package + - name: Publish package env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/bun.lockb b/bun.lockb index 2448c148eabf3d2e8a39eaa19272cc60de9ff2a8..b3a3e5141bff1db7d5620d436fb48beee7b1b377 100755 GIT binary patch delta 7551 zcmeHMX;f5Kw!XKZkjo?@2t}z3A}B}!7Fd)BS8Yv<1J0T_2C)R3Pzr}4#wrvP6cyZx z#yCce#3`W0G>OL9#3@gW9iJM_Gs$~N)M)pL{SuN^-?#6r+mFt&`%ka8-k&~eeP`dj z&pzkuz0W@9-a7SZlkQ}NN42T*`d>dCXD$z3@b%dvLDr_HJ$SC}_BwHh2j_2zaMX5Q0I+wNS^~ z>88by^Z0$d1tCBXoUZ&Fd*YPoIeF<2_@N;YloejU?9At)Ln}}ntYZV4AZNp_qlyN- zFRByS=h~(h+XP_%I=6&89kexQ3JAdifJ`?o~90w=V`XM=~__k zKeI3~H^*)hcEA_r^Ihpd6p6_QIJ{ z3Z~mi+~!XN(+0YwqT4b{qPM>QN60n*PkVk>~2xA3T zYdmlVEL7pVnSx*oQwL0e^=yzQ(t#J~5U3IXP{mMK!=7w(^Q%Fbw-*-W+KL>44-NH* z>)f}UAi#B3cTjdK1(eMSX|I~=0OelOXq!h;_mgc^t=#;=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mDC8Hb~f#?a^5<|a_IikvRfr@J?^IGEDPYR z40@70@(%hnl{?H(BXi5QIbHTO+iK(FQr~Z;H=zr%%#EXuH)xKGp@Z8p@QZzNo3qHi zx7z-6*@OMPKm0RvVNssDNbJGydn`<^e)Cx9sizKbwpt-QKxv)V$!DmlvnKOJXyM!r zPR0=v4f@TigV*G&_b*72Z$pC9F!-sH&UL2L_JVg9Pgc^2j`0UF`RkKYqiHU$VS{81JL{ z?dAB^KC<1)SNSacQMVX7)*zvu-{F*b^u`XS%f3(i(aY~0T0L+2($B|;q4=FnS0#>c zj_~Z6r^+in2={$1ucvEwzAM*I?k=aRZMdm5E&ho|mbL%5#UWQ)3Ef4NyF8eybC<_; z3CBCz8@;>l_2#R7>A_g6h26qCV@RZa_!Pr+S;O7iucCWW+rxZTSzdpa^1GaJ43(i? zL;fxgrFIuOmS)n7?vx_?x-tCT$8UYmw)d2_Ri8;$3@{E3FZLWV9{co}Zja-5CcWRC zlKHP2G#hc{lDFNY4clqdeUl@Zp@sM5Wxb3C4r_C9(JOMrfQ$EAdSefp`q2}Y7ncmr br-o1pow;vRkJ_D_NuN9!*E8>hU&_A&b~TY7 diff --git a/package.json b/package.json index 52095e0..9219a57 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "type": "module", "svelte": "./src/index.js", "main": "./src/index.js", - "types": "./index.d.ts", + "types": "./src/index.d.ts", "exports": { "./*.svelte": { "types": "./src/*.svelte.d.ts", @@ -25,6 +25,7 @@ }, "scripts": { "dev": "rollup -cw", + "build:prune-package": "bun scripts/prune-package.ts", "test": "svelte-check --workspace tests" }, "dependencies": { @@ -33,6 +34,7 @@ }, "devDependencies": { "@rollup/plugin-commonjs": "^21.0.2", + "@types/bun": "^1.1.13", "svelte": "^3.59.1", "svelte-check": "^3.6.2", "svelte-readme": "^3.6.3", diff --git a/scripts/prune-package.ts b/scripts/prune-package.ts new file mode 100644 index 0000000..d9092b5 --- /dev/null +++ b/scripts/prune-package.ts @@ -0,0 +1,9 @@ +const pkgJson = await Bun.file("./package.json").json(); + +// Remove unrelated metadata from package.json for publishing. +delete pkgJson.scripts; +delete pkgJson.devDependencies; + +await Bun.write("./package.json", JSON.stringify(pkgJson, null, 2) + "\n"); + +export {};