From 1d7766f6ff3d7399fca01e750fa512aee0f98788 Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Mon, 11 May 2026 15:19:12 +0200 Subject: [PATCH] Fix release script boundary checks --- scripts/check-boundaries.mjs | 2 +- scripts/check-boundaries.test.mjs | 1 + scripts/examples-docs.test.mjs | 24 ++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/check-boundaries.mjs b/scripts/check-boundaries.mjs index 0da8e401..f0ec86f0 100644 --- a/scripts/check-boundaries.mjs +++ b/scripts/check-boundaries.mjs @@ -9,7 +9,7 @@ const runtimeAssetPatterns = [/^packages\/[^/]+\/prompts\/.+\.md$/, /^packages\/ const identifierSkipPrefixes = ['docs/', 'examples/', 'python/ktx-sl/plans/', 'python/ktx-sl/openspec/']; const identifierAllowPatterns = [ /^packages\/cli\/src\/(?:index|managed-local-embeddings|managed-python-command|managed-python-daemon|managed-python-runtime|runtime)(?:\.test)?\.ts$/, - /^scripts\/(?:build-public-npm-package|build-python-runtime-wheel|local-embeddings-runtime-smoke|package-artifacts|published-package-smoke|release-readiness)(?:\.test)?\.mjs$/, + /^scripts\/(?:build-public-npm-package|build-python-runtime-wheel|local-embeddings-runtime-smoke|package-artifacts|publish-public-npm-package|published-package-smoke|release-readiness)(?:\.test)?\.mjs$/, ]; const forbiddenIdentifierTerms = ['kae' + 'lio', 'Kae' + 'lio', 'KAE' + 'LIO_']; diff --git a/scripts/check-boundaries.test.mjs b/scripts/check-boundaries.test.mjs index 13cc9fdf..8d7fabdd 100644 --- a/scripts/check-boundaries.test.mjs +++ b/scripts/check-boundaries.test.mjs @@ -70,6 +70,7 @@ describe('scanFileContent', () => { assert.equal(scanFileContent('scripts/local-embeddings-runtime-smoke.mjs', `@${name}/ktx`).length, 0); assert.equal(scanFileContent('scripts/package-artifacts.test.mjs', `${name}-ktx`).length, 0); + assert.equal(scanFileContent('scripts/publish-public-npm-package.test.mjs', `@${name}/ktx`).length, 0); assert.equal(scanFileContent('packages/cli/src/managed-python-runtime.ts', `${name}_ktx`).length, 0); }); diff --git a/scripts/examples-docs.test.mjs b/scripts/examples-docs.test.mjs index 7c8b2040..b9f63d65 100644 --- a/scripts/examples-docs.test.mjs +++ b/scripts/examples-docs.test.mjs @@ -10,6 +10,10 @@ function publicNpmPackageName() { return `@${['kae', 'lio'].join('')}/ktx`; } +function runtimeWheelPackageName() { + return `${['kae', 'lio'].join('')}-ktx`; +} + function escapeRegExp(value) { return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } @@ -18,6 +22,10 @@ function publicPackagePattern(text) { return new RegExp(text.replaceAll('{package}', escapeRegExp(publicNpmPackageName()))); } +function runtimeWheelPackagePattern(text) { + return new RegExp(text.replaceAll('{package}', escapeRegExp(runtimeWheelPackageName()))); +} + describe('standalone example docs', () => { it('documents the local warehouse example from the examples index', async () => { const examples = await readText('examples/README.md'); @@ -151,7 +159,12 @@ describe('standalone example docs', () => { assert.match(rootReadme, /ktx runtime prune --yes/); assert.match(rootReadme, /KTX requires `uv` on `PATH`/); assert.match(rootReadme, /KTX doesn't download `uv` automatically/); - assert.match(rootReadme, /release\s+artifact manifest contains the public npm tarball and the\s+bundled `kaelio-ktx`\s+runtime wheel/); + assert.match( + rootReadme, + runtimeWheelPackagePattern( + 'release\\s+artifact manifest contains the public npm tarball and the\\s+bundled `{package}`\\s+runtime wheel', + ), + ); assert.match(rootReadme, /source packages for\s+development, not public release artifacts/); assert.match(rootReadme, /ktx serve --mcp stdio/); assert.doesNotMatch(rootReadme, /uv run ktx-daemon serve-http/); @@ -163,7 +176,14 @@ describe('standalone example docs', () => { assert.match(readme, publicPackagePattern('{package}')); assert.match(readme, /managed Python runtime/); - assert.match(readme, /public `@kaelio\/ktx` npm tarball and the\s+bundled `kaelio-ktx`\s+runtime wheel/); + assert.match( + readme, + new RegExp( + `public \`${escapeRegExp(publicNpmPackageName())}\` npm tarball and the\\s+bundled \`${escapeRegExp( + runtimeWheelPackageName(), + )}\`\\s+runtime wheel`, + ), + ); assert.match(readme, /does not install standalone\s+Python packages directly/); assert.doesNotMatch(readme, /standalone Python distributions/); assert.doesNotMatch(readme, /installs the Python artifacts directly/);