Makelore 2.0 initial clean snapshot

This commit is contained in:
inman
2026-07-29 17:22:35 +08:00
commit b8ca3f8eea
694 changed files with 139782 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const require = createRequire(import.meta.url);
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const rawArgs = process.argv.slice(2);
const verifyReleaseRuntime = rawArgs.includes('--verify-release-runtime');
const vitestArgs = rawArgs.filter(
(arg) => arg !== '--verify-release-runtime' && arg !== '--',
);
const electronExecutable = require('electron');
const electronPackagePath = require.resolve('electron/package.json');
const electronPackage = JSON.parse(readFileSync(electronPackagePath, 'utf8'));
const vitestPackagePath = require.resolve('vitest/package.json');
const vitestCli = join(dirname(vitestPackagePath), 'vitest.mjs');
const result = spawnSync(electronExecutable, [
vitestCli,
'run',
'--config',
join(root, 'vitest.electron.config.ts'),
...vitestArgs,
], {
cwd: root,
stdio: 'inherit',
windowsHide: true,
env: {
...process.env,
ELECTRON_RUN_AS_NODE: '1',
NIANCODE_LOCAL_ELECTRON_VERSION: electronPackage.version,
...(verifyReleaseRuntime ? { NIANCODE_VERIFY_RELEASE_RUNTIME: '1' } : {}),
},
});
if (result.error) {
console.error('[electron-runtime] failed to start Electron:', result.error);
process.exit(1);
}
if (result.signal) {
console.error(`[electron-runtime] Electron ended by signal ${result.signal}`);
process.exit(1);
}
if (result.status === null) {
console.error('[electron-runtime] Electron returned no exit status');
process.exit(1);
}
process.exit(result.status);