mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-28 08:49:38 +02:00
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:
parent
34d4a1e9e1
commit
aa523f9ab3
31 changed files with 99 additions and 452 deletions
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
"name": "@ktx/cli",
|
||||
"name": "@kaelio/ktx",
|
||||
"version": "0.4.1",
|
||||
"description": "Standalone ktx context layer CLI",
|
||||
"private": true,
|
||||
"description": "Standalone ktx context layer for database agents",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
|
|
@ -24,6 +23,10 @@
|
|||
"dist",
|
||||
"assets"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"assets:demo": "node scripts/build-demo-assets.mjs",
|
||||
"build": "tsc -p tsconfig.json && node scripts/copy-runtime-assets.mjs && node ../../scripts/prepare-cli-bin.mjs",
|
||||
|
|
@ -89,11 +92,11 @@
|
|||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kaelio/ktx.git",
|
||||
"url": "https://github.com/Kaelio/ktx",
|
||||
"directory": "packages/cli"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kaelio/ktx/issues"
|
||||
"url": "https://github.com/Kaelio/ktx/issues"
|
||||
},
|
||||
"homepage": "https://github.com/kaelio/ktx#readme"
|
||||
"homepage": "https://github.com/Kaelio/ktx#readme"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { describe, expect, it, vi } from 'vitest';
|
|||
import { renderReindexJson, renderReindexPlain, reindexHasErrors } from './admin-reindex.js';
|
||||
import { runKtxCli } from './index.js';
|
||||
|
||||
const cliVersion = (createRequire(import.meta.url)('@ktx/cli/package.json') as { version: string })
|
||||
const cliVersion = (createRequire(import.meta.url)('@kaelio/ktx/package.json') as { version: string })
|
||||
.version;
|
||||
|
||||
function makeIo(options: { stdoutIsTTY?: boolean } = {}) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ function stubIo(): KtxCliIo {
|
|||
|
||||
function stubPackageInfo(): KtxCliPackageInfo {
|
||||
return {
|
||||
name: '@ktx/cli',
|
||||
name: '@kaelio/ktx',
|
||||
version: '0.0.0-test',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ function makeContext(overrides: Partial<KtxCliCommandContext> = {}): KtxCliComma
|
|||
stderr: { write: vi.fn() },
|
||||
},
|
||||
deps: {},
|
||||
packageInfo: { name: '@ktx/cli', version: '0.0.0-test' },
|
||||
packageInfo: { name: '@kaelio/ktx', version: '0.0.0-test' },
|
||||
setExitCode: (code) => {
|
||||
exitCode = code;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ function makeContext(overrides: Partial<KtxCliCommandContext> = {}): KtxCliComma
|
|||
stderr: { write: vi.fn() },
|
||||
},
|
||||
deps: {},
|
||||
packageInfo: { name: '@ktx/cli', version: '0.0.0-test' },
|
||||
packageInfo: { name: '@kaelio/ktx', version: '0.0.0-test' },
|
||||
setExitCode: (code) => {
|
||||
exitCode = code;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ describe('runSetupDoctorChecks', () => {
|
|||
if (command === 'pnpm' && args[0] === '--version') return '10.28.0';
|
||||
if (command === 'corepack' && args[0] === '--version') return '0.32.0';
|
||||
if (command === 'uv' && args[0] === '--version') return 'uv 0.9.5';
|
||||
if (command === process.execPath && args.includes('--version')) return '@ktx/cli 0.0.0-private';
|
||||
if (command === process.execPath && args.includes('--version')) return '@kaelio/ktx 0.0.0-private';
|
||||
throw new Error(`${command} ${args.join(' ')}`);
|
||||
},
|
||||
pathExists: async () => true,
|
||||
|
|
@ -163,7 +163,7 @@ describe('runSetupDoctorChecks', () => {
|
|||
if (command === 'pnpm' && args[0] === '--version') return '10.28.0';
|
||||
if (command === 'corepack' && args[0] === '--version') throw new Error('spawn corepack ENOENT');
|
||||
if (command === 'uv' && args[0] === '--version') return 'uv 0.9.5';
|
||||
if (command === process.execPath && args.includes('--version')) return '@ktx/cli 0.0.0-private';
|
||||
if (command === process.execPath && args.includes('--version')) return '@kaelio/ktx 0.0.0-private';
|
||||
throw new Error(`${command} ${args.join(' ')}`);
|
||||
},
|
||||
pathExists: async () => true,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const cliPackageJson = require('@ktx/cli/package.json') as { name: string; version: string };
|
||||
const cliPackageJson = require('@kaelio/ktx/package.json') as { name: string; version: string };
|
||||
const cliVersion = cliPackageJson.version;
|
||||
|
||||
function makeIo(options: { stdoutIsTty?: boolean } = {}) {
|
||||
|
|
@ -47,16 +47,16 @@ function makeIo(options: { stdoutIsTty?: boolean } = {}) {
|
|||
describe('getKtxCliPackageInfo', () => {
|
||||
it('identifies the CLI package', () => {
|
||||
expect(getKtxCliPackageInfo()).toEqual({
|
||||
name: '@ktx/cli',
|
||||
name: '@kaelio/ktx',
|
||||
version: cliVersion,
|
||||
});
|
||||
});
|
||||
|
||||
it('exports package metadata for package managers and runtime diagnostics', () => {
|
||||
const packageJson = require('@ktx/cli/package.json') as { name: string; version: string };
|
||||
const packageJson = require('@kaelio/ktx/package.json') as { name: string; version: string };
|
||||
|
||||
expect(packageJson).toMatchObject({
|
||||
name: '@ktx/cli',
|
||||
name: '@kaelio/ktx',
|
||||
version: cliVersion,
|
||||
});
|
||||
expect(cliVersion).toMatch(/^\d+\.\d+\.\d+/);
|
||||
|
|
@ -116,7 +116,7 @@ describe('runKtxCli', () => {
|
|||
|
||||
await expect(runKtxCli(['--version'], testIo.io)).resolves.toBe(0);
|
||||
|
||||
expect(testIo.stdout()).toBe(`@ktx/cli ${cliVersion}\n`);
|
||||
expect(testIo.stdout()).toBe(`@kaelio/ktx ${cliVersion}\n`);
|
||||
expect(testIo.stderr()).toBe('');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ function silentIo(): KtxCliIo {
|
|||
|
||||
function stubPackageInfo(): KtxCliPackageInfo {
|
||||
return {
|
||||
name: '@ktx/cli',
|
||||
name: '@kaelio/ktx',
|
||||
version: '0.0.0-docs',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue