firefish/scripts/clean-npm.mjs

44 lines
1 KiB
JavaScript
Raw Normal View History

2023-11-06 10:30:00 +09:00
import fs from "node:fs";
import path, { join } from "node:path";
import { fileURLToPath } from "node:url";
import { execa } from "execa";
2023-07-20 04:17:05 +09:00
(async () => {
2023-11-06 10:30:00 +09:00
const __dirname = path.dirname(fileURLToPath(import.meta.url));
2023-07-20 04:17:05 +09:00
fs.rmSync(join(__dirname, "/../packages/backend/node_modules"), {
recursive: true,
force: true,
});
fs.rmSync(join(__dirname, "/../packages/backend-rs/node_modules"), {
2023-07-20 04:17:05 +09:00
recursive: true,
force: true,
});
fs.rmSync(join(__dirname, "/../packages/client/node_modules"), {
recursive: true,
force: true,
});
fs.rmSync(join(__dirname, "/../packages/sw/node_modules"), {
recursive: true,
force: true,
});
fs.rmSync(join(__dirname, "/../packages/firefish-js/node_modules"), {
recursive: true,
force: true,
});
fs.rmSync(join(__dirname, "/../packages/megalodon/node_modules"), {
recursive: true,
force: true,
});
2023-07-20 04:17:05 +09:00
fs.rmSync(join(__dirname, "/../node_modules"), {
recursive: true,
force: true,
});
execa("pnpm", ["store", "prune"], {
cwd: join(__dirname, "/../"),
stdio: "inherit",
});
})();