mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
fix(cli): build runtime assets during dev setup (#121)
This commit is contained in:
parent
c7e6b5001d
commit
de72a10ffb
6 changed files with 85 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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']],
|
||||
],
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue