mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
Fix release script boundary checks
This commit is contained in:
parent
88a65bbdc7
commit
1d7766f6ff
3 changed files with 24 additions and 3 deletions
|
|
@ -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_'];
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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/);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue