Commit edf7b37
authored
fix(contract): restate MAX_PRIORITY_ELIGIBILITY_WINDOW_MINUTES so the generated schemas compile (#9936)
main is currently failing `contract:api-schemas:check` for every PR.
#9738 added `.max(MAX_PRIORITY_ELIGIBILITY_WINDOW_MINUTES)` to the settings
schema in src/openapi/schemas.ts. gen-contract-api-schemas.ts copies that
schema verbatim into @loopover/contract, which cannot import the Worker's
src/ -- so a referenced constant has to be restated in the contract's own
limits.ts. That step was missed, leaving both paths broken: regenerating
emits a file referencing a name it never imports (TS2304, contract build
fails), and NOT regenerating leaves the drift check red.
The generator's doc calls this "the loud failure this wants", and it worked --
it just needs the constant it was asking for.
Also pins the three restated Worker bounds against their originals. limits.ts
says they are "pinned against their originals like every other entry here",
but PREFLIGHT_LIMITS was the only group with a meta-test doing that; the
single constants were restated on trust. Nothing at compile time relates the
two copies (that is the whole reason the contract is a zod-only leaf), so a
one-sided edit would surface as a client-side validation error rather than a
build failure. The compile-time failure only catches a MISSING constant, never
a drifted VALUE.1 parent b21216b commit edf7b37
3 files changed
Lines changed: 51 additions & 1 deletion
File tree
- packages/loopover-contract/src
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments