refactor(workspace): rename @ktx/cli to @kaelio/ktx and pack it directly

Promote the CLI workspace package to the public name `@kaelio/ktx` and
drop the separate `scripts/build-public-npm-package.mjs` wrapper. The
CLI package is now publishable in place (`publishConfig.access: public`,
`provenance: true`), so artifact packing uses `pnpm pack` against
`packages/cli/` instead of assembling a parallel package tree.

Updates all workspace filter invocations, docs, tests, and release
readiness checks to reference the new package name, and folds the
tarball-name helper into `scripts/public-npm-release-metadata.mjs`.
This commit is contained in:
Andrey Avtomonov 2026-05-21 13:05:14 +02:00
parent 34d4a1e9e1
commit aa523f9ab3
31 changed files with 99 additions and 452 deletions

View file

@ -5,10 +5,9 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { describe, it } from 'node:test';
import { PUBLIC_NPM_PACKAGE_VERSION } from './build-public-npm-package.mjs';
import { PUBLIC_NPM_PACKAGE_VERSION } from './public-npm-release-metadata.mjs';
import {
CLI_PYTHON_ASSET_MANIFEST,
INTERNAL_NPM_WORKSPACE_PACKAGES,
RUNTIME_WHEEL_DISTRIBUTION_NAME,
RUNTIME_WHEEL_NORMALIZED_NAME,
RUNTIME_WHEEL_PACKAGE_VERSION,
@ -62,12 +61,11 @@ async function writeReleaseMetadataInputs(root) {
requiredBeforePublishing: ['Choose public release version.'],
});
for (const packageInfo of INTERNAL_NPM_WORKSPACE_PACKAGES) {
for (const packageInfo of NPM_ARTIFACT_PACKAGES) {
await mkdir(join(root, packageInfo.packageRoot), { recursive: true });
await writeJson(join(root, packageInfo.packageRoot, 'package.json'), {
name: packageInfo.name,
version: '0.0.0-private',
private: true,
version: PUBLIC_NPM_PACKAGE_VERSION,
});
}
}
@ -112,16 +110,20 @@ describe('packageArtifactLayout', () => {
});
describe('buildArtifactCommands', () => {
it('builds the CLI package, then the runtime wheel, then packs npm artifacts', () => {
it('builds the CLI package, then the runtime wheel, then packs the npm tarball directly', () => {
const layout = packageArtifactLayout('/repo/ktx', PUBLIC_NPM_PACKAGE_VERSION);
const commands = buildArtifactCommands(layout);
assert.deepEqual(
commands.map((command) => [command.command, command.args]),
commands.map((command) => [command.command, command.args, command.cwd]),
[
['pnpm', ['--filter', '@ktx/cli', 'run', 'build']],
[process.execPath, ['scripts/build-python-runtime-wheel.mjs']],
[process.execPath, ['scripts/build-public-npm-package.mjs']],
['pnpm', ['--filter', '@kaelio/ktx', 'run', 'build'], '/repo/ktx'],
[process.execPath, ['scripts/build-python-runtime-wheel.mjs'], '/repo/ktx'],
[
'pnpm',
['pack', '--out', `/repo/ktx/dist/artifacts/npm/kaelio-ktx-${PUBLIC_NPM_PACKAGE_VERSION}.tgz`],
'/repo/ktx/packages/cli',
],
],
);
});