在 Makelore 构建并预检静态发布产物

This commit is contained in:
2026-08-12 21:19:39 +08:00
parent 3a80625fe2
commit 5b44864265
26 changed files with 1275 additions and 217 deletions

View File

@@ -141,6 +141,9 @@ const expectedCommit = option('--expected-commit', null);
const expectedBuildId = option('--expected-build-id', null);
const manifestPath = option('--manifest', null);
const resourcesDir = join(dirname(appExecutable), 'resources');
const npmRuntimeDir = join(resourcesDir, 'publish-runtime');
const npmPackagePath = join(npmRuntimeDir, 'package.json');
const npmCliPath = join(npmRuntimeDir, 'bin', 'npm-cli.js');
const appAsarPath = join(resourcesDir, 'app.asar');
const appAsarUnpackedPath = join(resourcesDir, 'app.asar.unpacked');
const opencodeRuntimeDir = join(resourcesDir, 'opencode-ai');
@@ -154,6 +157,8 @@ for (const filePath of [
appExecutable,
installerPath,
appAsarPath,
npmPackagePath,
npmCliPath,
opencodePackagePath,
opencodeExecutable,
pythonExecutable,
@@ -317,6 +322,13 @@ if (!isPathInside(appAsarPath, probe.playwrightPackageResolved)) {
if (!isPathInside(appAsarPath, probe.playwrightCliResolved)) {
throw new Error(`@playwright/mcp CLI was not resolved from app.asar: ${probe.playwrightCliResolved}`);
}
const packagedNpm = JSON.parse(readFileSync(npmPackagePath, 'utf8'));
assertEqual(packagedNpm.version, packageJson.dependencies.npm, 'packaged npm version');
const npmVersion = run(appExecutable, [npmCliPath, '--version'], {
cwd: dirname(appExecutable),
env: { ...installLocalProbeEnv, ELECTRON_RUN_AS_NODE: '1' },
});
assertEqual(npmVersion, packageJson.dependencies.npm, 'packaged npm CLI version');
run(appExecutable, [probe.playwrightCliResolved, '--help'], {
cwd: dirname(appExecutable),
env: { ...installLocalProbeEnv, ELECTRON_RUN_AS_NODE: '1' },
@@ -371,6 +383,7 @@ const evidence = {
},
python: pythonProbe,
uv: { executable: uvExecutable, version: uvVersion },
npm: { packageJson: npmPackagePath, cli: npmCliPath, version: npmVersion },
},
nativeModules: {
msgpackr: probe.msgpackResolved,