dev: create clean-npm/clean-cargo scripts
This commit is contained in:
parent
08232ae946
commit
aca288fb4d
4 changed files with 16 additions and 37 deletions
|
@ -30,9 +30,10 @@
|
||||||
"mocha": "pnpm --filter backend run mocha",
|
"mocha": "pnpm --filter backend run mocha",
|
||||||
"test": "pnpm run mocha",
|
"test": "pnpm run mocha",
|
||||||
"format": "pnpm -r --parallel run format",
|
"format": "pnpm -r --parallel run format",
|
||||||
"clean": "pnpm node ./scripts/clean.mjs",
|
"clean": "pnpm node ./scripts/clean-built.mjs",
|
||||||
"clean-all": "pnpm node ./scripts/clean-all.mjs",
|
"clean-npm": "pnpm node ./scripts/clean-npm.mjs",
|
||||||
"cleanall": "pnpm run clean-all"
|
"clean-cargo": "pnpm node ./scripts/clean-cargo.mjs",
|
||||||
|
"clean-all": "pnpm run clean && pnpm run clean-cargo && pnpm run clean-npm"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"chokidar": "^3.3.1"
|
"chokidar": "^3.3.1"
|
||||||
|
|
12
scripts/clean-cargo.mjs
Normal file
12
scripts/clean-cargo.mjs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import path, { join } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { execa } from "execa";
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
execa("cargo", ["clean"], {
|
||||||
|
cwd: join(__dirname, "/../packages/backend/native-utils"),
|
||||||
|
stdio: "inherit",
|
||||||
|
});
|
||||||
|
})();
|
|
@ -6,59 +6,30 @@ import { execa } from "execa";
|
||||||
(async () => {
|
(async () => {
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/backend/built"), {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/backend/node_modules"), {
|
fs.rmSync(join(__dirname, "/../packages/backend/node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/backend/native-utils/built"), {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/backend/native-utils/node_modules"), {
|
fs.rmSync(join(__dirname, "/../packages/backend/native-utils/node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/client/built"), {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/client/node_modules"), {
|
fs.rmSync(join(__dirname, "/../packages/client/node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/sw/built"), {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/sw/node_modules"), {
|
fs.rmSync(join(__dirname, "/../packages/sw/node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
fs.rmSync(join(__dirname, "/../packages/firefish-js/built"), {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/firefish-js/node_modules"), {
|
fs.rmSync(join(__dirname, "/../packages/firefish-js/node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
fs.rmSync(join(__dirname, "/../packages/megalodon/lib"), {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
fs.rmSync(join(__dirname, "/../packages/megalodon/node_modules"), {
|
fs.rmSync(join(__dirname, "/../packages/megalodon/node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.rmSync(join(__dirname, "/../built"), { recursive: true, force: true });
|
|
||||||
fs.rmSync(join(__dirname, "/../node_modules"), {
|
fs.rmSync(join(__dirname, "/../node_modules"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
|
@ -68,9 +39,4 @@ import { execa } from "execa";
|
||||||
cwd: join(__dirname, "/../"),
|
cwd: join(__dirname, "/../"),
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
});
|
});
|
||||||
|
|
||||||
execa("cargo", ["clean"], {
|
|
||||||
cwd: join(__dirname, "/../packages/backend/native-utils"),
|
|
||||||
stdio: "inherit",
|
|
||||||
});
|
|
||||||
})();
|
})();
|
Loading…
Reference in a new issue