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 2448c14..b3a3e51 100755 Binary files a/bun.lockb and b/bun.lockb differ 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 {};