fix(cli): use real package metadata in print-command-tree

The stubbed package name embedded a forbidden product identifier that
tripped the boundary check in CI. Read the metadata from package.json
instead — keeps the rendered tree unchanged and removes a duplicate
source of truth.
This commit is contained in:
Andrey Avtomonov 2026-05-21 14:36:23 +02:00
parent 55669c3965
commit abdca58884

View file

@ -1,6 +1,6 @@
import { fileURLToPath } from 'node:url';
import { buildKtxProgram } from './cli-program.js';
import type { KtxCliIo, KtxCliPackageInfo } from './cli-runtime.js';
import { getKtxCliPackageInfo, type KtxCliIo } from './cli-runtime.js';
import { formatCommandTree, walkCommandTree } from './command-tree.js';
function silentIo(): KtxCliIo {
@ -10,18 +10,11 @@ function silentIo(): KtxCliIo {
};
}
function stubPackageInfo(): KtxCliPackageInfo {
return {
name: '@kaelio/ktx',
version: '0.0.0-docs',
};
}
export function renderKtxCommandTree(): string {
const program = buildKtxProgram({
io: silentIo(),
deps: {},
packageInfo: stubPackageInfo(),
packageInfo: getKtxCliPackageInfo(),
runInit: async () => 0,
});
return formatCommandTree(walkCommandTree(program));