mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
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`.
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { test } from 'node:test';
|
|
import { linkDevCli } from './link-dev-cli.mjs';
|
|
|
|
test('linkDevCli writes a ktx-dev launcher by default', async () => {
|
|
const writes = [];
|
|
const chmods = [];
|
|
|
|
const result = await linkDevCli({
|
|
rootDir: '/workspace/ktx',
|
|
globalBin: '/pnpm/bin',
|
|
binPath: '/workspace/ktx/packages/cli/dist/bin.js',
|
|
execText: async (command, args) => {
|
|
assert.equal(command, 'ktx-dev');
|
|
assert.deepEqual(args, ['--version']);
|
|
return '@kaelio/ktx 0.0.0-private';
|
|
},
|
|
writeFile: async (path, content) => writes.push({ path, content }),
|
|
chmod: async (path, mode) => chmods.push({ path, mode }),
|
|
access: async () => undefined,
|
|
});
|
|
|
|
assert.equal(result.binaryName, 'ktx-dev');
|
|
assert.equal(writes[0].path, '/pnpm/bin/ktx-dev');
|
|
assert.match(writes[0].content, /packages\/cli\/dist\/bin.js/);
|
|
assert.deepEqual(chmods, [{ path: '/pnpm/bin/ktx-dev', mode: 0o755 }]);
|
|
});
|
|
|
|
test('linkDevCli can explicitly write ktx when requested', async () => {
|
|
const writes = [];
|
|
|
|
const result = await linkDevCli({
|
|
rootDir: '/workspace/ktx',
|
|
binaryName: 'ktx',
|
|
globalBin: '/pnpm/bin',
|
|
binPath: '/workspace/ktx/packages/cli/dist/bin.js',
|
|
execText: async () => '@kaelio/ktx 0.0.0-private',
|
|
writeFile: async (path, content) => writes.push({ path, content }),
|
|
chmod: async () => undefined,
|
|
access: async () => undefined,
|
|
});
|
|
|
|
assert.equal(result.binaryName, 'ktx');
|
|
assert.equal(writes[0].path, '/pnpm/bin/ktx');
|
|
});
|