chore(deps-dev): use culls to prune package.json

This commit is contained in:
Eric Liu 2024-12-15 19:37:13 -08:00
commit 237295e033
4 changed files with 2 additions and 26 deletions

View file

@ -23,7 +23,7 @@ jobs:
run: npm run build:docs
- name: Prune package.json
run: node scripts/build-package.js
run: npx culls --preserve=svelte
- name: Publish package (stable)
if: ${{ ! contains(github.ref, '-next') }}

BIN
bun.lockb Executable file

Binary file not shown.

View file

@ -53,6 +53,7 @@
"carbon-components": "10.58.12",
"carbon-icons-svelte": "^12.1.0",
"carbon-preprocess-svelte": "^0.11.7",
"culls": "^0.1.1",
"jsdom": "^25.0.1",
"postcss": "^8.4.16",
"prettier": "^3.3.3",

View file

@ -1,25 +0,0 @@
// @ts-check
import fs from "node:fs";
import path from "node:path";
import pkg from "../package.json" assert { type: "json" };
/** @type {Array<keyof typeof pkg>} */
const keys_to_remove = ["prettier", "standard-version", "devDependencies"];
for (const key of keys_to_remove) {
delete pkg[key];
}
/** @type {Set<keyof typeof pkg.scripts>} */
const scripts_to_keep = new Set(["postinstall"]);
for (const script in pkg.scripts) {
// @ts-ignore
if (!scripts_to_keep.has(script)) {
delete pkg.scripts[script];
}
}
// Write the updated package.json file.
const pkgPath = path.join(process.cwd(), "package.json");
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");