2023-11-06 10:30:00 +09:00
|
|
|
import path, { join } from "node:path";
|
|
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import { execa } from "execa";
|
2021-11-19 14:48:59 +09:00
|
|
|
|
|
|
|
(async () => {
|
2023-11-06 10:30:00 +09:00
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
2023-06-24 13:22:44 +09:00
|
|
|
await execa("pnpm", ["clean"], {
|
2023-11-06 10:30:00 +09:00
|
|
|
cwd: join(__dirname, "/../"),
|
2022-02-06 08:39:30 +09:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-06-24 13:22:44 +09:00
|
|
|
execa("pnpm", ["dlx", "gulp", "watch"], {
|
2023-11-06 10:30:00 +09:00
|
|
|
cwd: join(__dirname, "/../"),
|
2021-11-19 14:48:59 +09:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-06-24 13:22:44 +09:00
|
|
|
execa("pnpm", ["--filter", "backend", "watch"], {
|
2023-11-06 10:30:00 +09:00
|
|
|
cwd: join(__dirname, "/../"),
|
2021-11-19 14:48:59 +09:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-06-24 13:22:44 +09:00
|
|
|
execa("pnpm", ["--filter", "client", "watch"], {
|
2023-11-06 10:30:00 +09:00
|
|
|
cwd: join(__dirname, "/../"),
|
2021-11-19 14:48:59 +09:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-06-24 13:22:44 +09:00
|
|
|
execa("pnpm", ["--filter", "sw", "watch"], {
|
2023-11-06 10:30:00 +09:00
|
|
|
cwd: join(__dirname, "/../"),
|
2022-04-30 21:52:07 +09:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2021-11-19 14:48:59 +09:00
|
|
|
const start = async () => {
|
|
|
|
try {
|
2023-06-24 13:22:44 +09:00
|
|
|
await execa("pnpm", ["start"], {
|
2023-11-06 10:30:00 +09:00
|
|
|
cwd: join(__dirname, "/../"),
|
2021-11-19 14:48:59 +09:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
} catch (e) {
|
2023-06-24 13:22:44 +09:00
|
|
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
2021-11-19 14:48:59 +09:00
|
|
|
start();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
start();
|
|
|
|
})();
|