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
|
|
@ -227,6 +227,15 @@ export const ALL_SPEC_VERSIONS: SpecVersion[] = [
|
|||
'extension'
|
||||
];
|
||||
|
||||
export 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);
|
||||
}
|
||||
|
||||
export function listScenariosForSpec(version: SpecVersion): string[] {
|
||||
return scenariosList
|
||||
.filter((s) => s.specVersions.includes(version))
|
||||
|
|
|
|||
Loading…
Reference in a new issue