diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c4bc57..a657b96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,9 @@ jobs: run: bun install - name: Build package - run: bun prepack + run: | + bun run prepack + bun run build:prune-package - name: Publish package env: diff --git a/package.json b/package.json index 2900d14..4aacf67 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ } }, "scripts": { - "prepack": "bun test" + "prepack": "bun test", + "build:prune-package": "bun scripts/prune-package.ts" }, "devDependencies": { "@carbon/icon-helpers": "latest", diff --git a/scripts/prune-package.ts b/scripts/prune-package.ts new file mode 100644 index 0000000..a090e5d --- /dev/null +++ b/scripts/prune-package.ts @@ -0,0 +1,10 @@ +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 { }; +