Build MerchantFlow onboarding CRM foundation

This commit is contained in:
Oleksandr Prokhorenko
2026-09-24 16:43:22 +03:00
commit 3aa47d825f
78 changed files with 10739 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { spawn } from 'node:child_process';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
// Stop both processes together, including when Turbo or Playwright stops this task.
const children = [
spawn(
process.execPath,
[require.resolve('typescript/bin/tsc'), '--watch', '--preserveWatchOutput'],
{ stdio: 'inherit' },
),
spawn(process.execPath, ['--watch', 'dist/main.js'], { stdio: 'inherit' }),
];
let stopping = false;
function stop(code = 0) {
if (stopping) return;
stopping = true;
for (const child of children) child.kill('SIGTERM');
process.exitCode = code;
}
process.on('SIGINT', () => stop());
process.on('SIGTERM', () => stop());
for (const child of children) {
child.on('error', (error) => {
console.error(error.message);
stop(1);
});
child.on('exit', (code) => {
if (!stopping) stop(code ?? 1);
});
}