@enke.dev/bumper 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +8 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -2472,13 +2472,20 @@ import { join as join9 } from "node:path";
|
|
|
2472
2472
|
// src/utils/deps.utils.ts
|
|
2473
2473
|
import { rm } from "node:fs/promises";
|
|
2474
2474
|
import { join as join7 } from "node:path";
|
|
2475
|
+
var LOCKFILES = {
|
|
2476
|
+
["npm" /* Npm */]: ["package-lock.json", "npm-shrinkwrap.json"],
|
|
2477
|
+
["pnpm" /* Pnpm */]: ["pnpm-lock.yaml"],
|
|
2478
|
+
["bun" /* Bun */]: ["bun.lock", "bun.lockb"]
|
|
2479
|
+
};
|
|
2475
2480
|
async function cleanInstall(ctx, installCmd) {
|
|
2481
|
+
const lockfiles = LOCKFILES[ctx.packageManager] ?? [];
|
|
2476
2482
|
if (ctx.dryRun) {
|
|
2477
|
-
planLine("rm -rf node_modules");
|
|
2483
|
+
planLine(["rm -rf", "node_modules", ...lockfiles].join(" "));
|
|
2478
2484
|
planLine(installCmd.join(" "));
|
|
2479
2485
|
return;
|
|
2480
2486
|
}
|
|
2481
2487
|
await rm(join7(ctx.cwd, "node_modules"), { recursive: true, force: true });
|
|
2488
|
+
await Promise.all(lockfiles.map((file) => rm(join7(ctx.cwd, file), { force: true })));
|
|
2482
2489
|
await execOk(installCmd, { cwd: ctx.cwd });
|
|
2483
2490
|
}
|
|
2484
2491
|
async function selfUpdate(ctx, cmd) {
|