mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
chore(deps-dev): use culls
to prune package.json (#2078)
This commit is contained in:
parent
6817892575
commit
107b77df6e
6 changed files with 13 additions and 27 deletions
|
@ -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");
|
Loading…
Add table
Add a link
Reference in a new issue