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