feat: add --spec-version option to tier-check (#176)
* feat: add --spec-version option to tier-check * refactor: share resolveSpecVersion between CLI and tier-check Move resolveSpecVersion to src/scenarios/index.ts so tier-check can reuse it instead of duplicating the validation logic. --------- Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
parent
fe16e381c7
commit
1c48a30ff6
1 changed files with 72 additions and 39 deletions
11
src/index.ts
11
src/index.ts
|
|
@ -24,7 +24,7 @@ import {
|
|||
listScenariosForSpec,
|
||||
listClientScenariosForSpec,
|
||||
getScenarioSpecVersions,
|
||||
ALL_SPEC_VERSIONS
|
||||
resolveSpecVersion
|
||||
} from './scenarios';
|
||||
import type { SpecVersion } from './scenarios';
|
||||
import { ConformanceCheck } from './types';
|
||||
|
|
@ -37,15 +37,6 @@ import {
|
|||
import { createTierCheckCommand } from './tier-check';
|
||||
import packageJson from '../package.json';
|
||||
|
||||
function resolveSpecVersion(value: string): SpecVersion {
|
||||
if (ALL_SPEC_VERSIONS.includes(value as SpecVersion)) {
|
||||
return value as SpecVersion;
|
||||
}
|
||||
console.error(`Unknown spec version: ${value}`);
|
||||
console.error(`Valid versions: ${ALL_SPEC_VERSIONS.join(', ')}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Note on naming: `command` refers to which CLI command is calling this.
|
||||
// The `client` command tests Scenario objects (which test clients),
|
||||
// and the `server` command tests ClientScenario objects (which test servers).
|
||||
|
|
|
|||
Loading…
Reference in a new issue