2021-11-18 23:48:59 -06:00
|
|
|
const execa = require('execa');
|
2022-12-19 22:05:36 -06:00
|
|
|
const fs = require('fs');
|
2021-11-18 23:48:59 -06:00
|
|
|
|
|
|
|
(async () => {
|
2023-01-15 15:08:42 -06:00
|
|
|
await execa('pnpm', ['clean'], {
|
2022-02-05 17:39:30 -06:00
|
|
|
cwd: __dirname + '/../',
|
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-01-15 15:08:42 -06:00
|
|
|
await execa('pnpm', ['build-pre'], {
|
2022-12-19 22:05:36 -06:00
|
|
|
cwd: __dirname + '/../',
|
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-01-15 15:08:42 -06:00
|
|
|
execa('pnpm', ['dlx', 'gulp', 'watch'], {
|
2021-11-18 23:48:59 -06:00
|
|
|
cwd: __dirname + '/../',
|
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-01-15 15:08:42 -06:00
|
|
|
execa('pnpm', ['--filter', 'backend', 'watch'], {
|
2022-11-24 00:39:00 -06:00
|
|
|
cwd: __dirname + '/../',
|
2021-11-18 23:48:59 -06:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-01-15 15:08:42 -06:00
|
|
|
execa('pnpm', ['--filter', 'frontend', 'watch'], {
|
2022-11-24 00:39:00 -06:00
|
|
|
cwd: __dirname + '/../',
|
2021-11-18 23:48:59 -06:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2023-01-15 15:08:42 -06:00
|
|
|
execa('pnpm', ['--filter', 'sw', 'watch'], {
|
2022-11-24 00:39:00 -06:00
|
|
|
cwd: __dirname + '/../',
|
2022-04-30 07:52:07 -05:00
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
|
2021-11-18 23:48:59 -06:00
|
|
|
const start = async () => {
|
|
|
|
try {
|
2022-12-19 22:05:36 -06:00
|
|
|
const exist = fs.existsSync(__dirname + '/../packages/backend/built/boot/index.js')
|
|
|
|
if (!exist) throw new Error('not exist yet');
|
|
|
|
|
2023-01-15 15:08:42 -06:00
|
|
|
await execa('pnpm', ['start'], {
|
2021-11-18 23:48:59 -06:00
|
|
|
cwd: __dirname + '/../',
|
|
|
|
stdout: process.stdout,
|
|
|
|
stderr: process.stderr,
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
|
|
start();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
start();
|
|
|
|
})();
|