Repository navigation
Conversation
…ictly Register every x-tclk-* annotation keyword found in the schema, so the README recipe and the test keep working when a new annotation is added. Fixes flop-labs#199 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for picking this up. Deriving the keyword set from the schema, as @maho0638 suggested, is better than the hard-coded three names in the patch I'd prepared. One small thing in the README snippet: import { Ajv2020 } from "ajv/dist/2020.js";Checked on |
… under Node16 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, reproduced: with |
What
The README now shows how to compile
schema/tclk1-frames.schema.jsonunder Ajv's default strict mode: collect everyx-tclk-*key the schema uses and register it withajv.addKeywordbeforecompile. A new test compiles the whole schema that way with a defaultAjv2020, and also checks that an unregistered default instance still rejects it.ajv@8.20.0(already the locked version) is added as a root dev dependency for the test.Why
Fixes #199 with option (b). A default
new Ajv2020().compile(schema)throws onx-tclk-canonicalPattern, and nothing compiled the whole document, so integrators found out at runtime. Following @maho0638's note, the keyword list is derived from the schema instead of hard-coding three names, so #177 / #185 (x-tclk-runtimeConstraint) keep working once merged. Thanks to @vanilla3 and @bdunn77 for confirming the reproduction. The schema and SPEC.md are unchanged.Checks
pnpm install --frozen-lockfile && pnpm -r --include-workspace-root buildpnpm -r --include-workspace-root testCHANGELOG.mdhas an[Unreleased]entryREADME.mdI used an AI assistant (Claude) while preparing this. I reproduced the issue and checked the change and tests myself.