fix(cli): build runtime assets during dev setup (#121)

This commit is contained in:
Andrey Avtomonov 2026-05-17 01:04:44 +02:00 committed by GitHub
parent c7e6b5001d
commit de72a10ffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 85 additions and 7 deletions

View file

@ -942,6 +942,16 @@ async function buildArtifacts(layout) {
await assertPathExists(artifactManifestPath(layout), 'artifact manifest');
}
async function buildRuntimeWheelAssets(layout) {
await rm(layout.pythonDir, { recursive: true, force: true });
await mkdir(layout.pythonDir, { recursive: true });
const [, wheelCommand] = buildArtifactCommands(layout);
await runCommand(wheelCommand.command, wheelCommand.args, { cwd: wheelCommand.cwd });
const pythonArtifacts = await findPythonArtifacts(layout.pythonDir);
await copyRuntimeWheelAssets(layout, pythonArtifacts);
}
async function verifyNpmArtifacts(layout, tmpRoot) {
for (const packageInfo of NPM_ARTIFACT_PACKAGES) {
await assertPathExists(layout.npmTarballs[packageInfo.name], `${packageInfo.name} tarball`);
@ -1011,6 +1021,10 @@ async function main() {
await buildArtifacts(layout);
return;
}
if (command === 'build-runtime') {
await buildRuntimeWheelAssets(layout);
return;
}
if (command === 'verify') {
await verifyArtifacts(layout);
return;

View file

@ -41,6 +41,12 @@ export async function runSetupDev(options = {}) {
args: ['run', 'build'],
retry: 'pnpm run build',
},
{
name: 'runtime wheel assets',
command: 'pnpm',
args: ['run', 'artifacts:build-runtime'],
retry: 'pnpm run artifacts:build-runtime',
},
{
name: 'doctor setup',
command: process.execPath,

View file

@ -22,6 +22,7 @@ test('runSetupDev runs phased setup without global linking', async () => {
['pnpm', ['install', '--frozen-lockfile']],
['pnpm', ['run', 'native:rebuild']],
['pnpm', ['run', 'build']],
['pnpm', ['run', 'artifacts:build-runtime']],
[process.execPath, ['packages/cli/dist/bin.js', 'status', '--no-input']],
],
);