mirror of
https://example.com
synced 2024-11-22 07:16:39 +09:00
dev: add clean-npm and clean-cargo, rename clean to clean-built
This commit is contained in:
parent
1d5372282f
commit
f0d82ebb94
4 changed files with 17 additions and 35 deletions
|
@ -24,8 +24,10 @@
|
|||
"debug": "pnpm run build:debug && pnpm run start",
|
||||
"build:debug": "pnpm clean && pnpm --filter firefish-js run build:types && pnpm -r --parallel run build:debug && pnpm run gulp",
|
||||
"format": "pnpm -r --parallel run format",
|
||||
"clean": "pnpm node ./scripts/clean.mjs",
|
||||
"clean-all": "pnpm node ./scripts/clean-all.mjs",
|
||||
"clean": "pnpm node ./scripts/clean-built.mjs",
|
||||
"clean-cargo": "pnpm node ./scripts/clean-cargo.mjs",
|
||||
"clean-npm": "pnpm node ./scripts/clean-npm.mjs",
|
||||
"clean-all": "pnpm run clean && pnpm run claen-cargo && pnpm run clean-npm",
|
||||
"cleanall": "pnpm run clean-all"
|
||||
},
|
||||
"resolutions": {
|
||||
|
|
13
scripts/clean-cargo.mjs
Normal file
13
scripts/clean-cargo.mjs
Normal file
|
@ -0,0 +1,13 @@
|
|||
import fs from "node:fs";
|
||||
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,31 @@ import { execa } from "execa";
|
|||
(async () => {
|
||||
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"), {
|
||||
recursive: 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"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
|
||||
fs.rmSync(join(__dirname, "/../packages/client/built"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.rmSync(join(__dirname, "/../packages/client/node_modules"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
|
||||
fs.rmSync(join(__dirname, "/../packages/sw/built"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.rmSync(join(__dirname, "/../packages/sw/node_modules"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.rmSync(join(__dirname, "/../packages/firefish-js/built"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.rmSync(join(__dirname, "/../packages/firefish-js/node_modules"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.rmSync(join(__dirname, "/../packages/megalodon/lib"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.rmSync(join(__dirname, "/../packages/megalodon/node_modules"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
|
||||
fs.rmSync(join(__dirname, "/../built"), { recursive: true, force: true });
|
||||
fs.rmSync(join(__dirname, "/../node_modules"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
|
@ -68,9 +40,4 @@ import { execa } from "execa";
|
|||
cwd: join(__dirname, "/../"),
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
execa("cargo", ["clean"], {
|
||||
cwd: join(__dirname, "/../packages/backend/native-utils"),
|
||||
stdio: "inherit",
|
||||
});
|
||||
})();
|
Loading…
Reference in a new issue