The tree carried uncommitted work from several areas (web push, mobile screens, admin charts, test-hygiene cleanup, CI and map docs). It is landed as one commit so the release pipeline can start from a clean tree; the desktop transcript-correction behaviour shipped in the previous commit and is unchanged here.
53 lines
2 KiB
JavaScript
53 lines
2 KiB
JavaScript
// scripts/ci/build-all.mjs
|
|
// Local Full CI Pipeline Verification Runner
|
|
|
|
import { spawn } from 'node:child_process';
|
|
import process from 'node:process';
|
|
|
|
function runStep(name, cmd, args) {
|
|
return new Promise((resolve, reject) => {
|
|
console.log(`\n==================================================`);
|
|
console.log(`▶ STEP: ${name} (${cmd} ${args.join(' ')})`);
|
|
console.log(`==================================================`);
|
|
|
|
const start = Date.now();
|
|
const isWindows = process.platform === 'win32';
|
|
const actualCmd = isWindows && cmd === 'npm' ? 'npm.cmd' : cmd;
|
|
|
|
const proc = spawn(actualCmd, args, { stdio: 'inherit', shell: isWindows });
|
|
|
|
proc.on('close', (code) => {
|
|
const duration = ((Date.now() - start) / 1000).toFixed(2);
|
|
if (code === 0) {
|
|
console.log(`✔ SUCCESS: ${name} (took ${duration}s)`);
|
|
resolve();
|
|
} else {
|
|
console.error(`✖ FAILED: ${name} (exit code ${code})`);
|
|
reject(new Error(`Step failed: ${name}`));
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
async function main() {
|
|
const totalStart = Date.now();
|
|
console.log('🚀 Starting Full CI/CD Build & Verification Pipeline...\n');
|
|
|
|
try {
|
|
await runStep('Typecheck All Workspaces', 'npm', ['run', 'typecheck']);
|
|
await runStep('Run Vitest Test Suites', 'npm', ['test']);
|
|
await runStep('Build Desktop App (Renderer + Main + Preload)', 'npm', ['run', 'build', '--workspace=@d3ro/desktop']);
|
|
await runStep('Build Admin Dashboard (Next.js 14)', 'npm', ['run', 'build', '--workspace=@d3ro/admin']);
|
|
await runStep('Build Web App (Next.js)', 'npm', ['run', 'build', '--workspace=@d3ro/web']);
|
|
|
|
const totalDuration = ((Date.now() - totalStart) / 1000).toFixed(2);
|
|
console.log(`\n==================================================`);
|
|
console.log(`🎉 ALL CI/CD STEPS PASSED SUCCESSFULLY! (Total: ${totalDuration}s)`);
|
|
console.log(`==================================================\n`);
|
|
} catch (err) {
|
|
console.error(`\n❌ CI/CD Pipeline execution aborted: ${err.message}`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
main();
|