Repository navigation
Commit 7992d19
committed
fix(scripts): add the git-env declaration mirror the spec TS lane needs
CI red on 6b398c3: `packages/spec` `pnpm run typecheck` exited 2 with TS7016
at both converted fixtures -- "Could not find a declaration file for module
'../../../scripts/git-env.mjs'". Reproduced locally against
`check:scripts-typecheck`, the lane that owns it: `tsconfig.scripts.json`
includes `scripts/**/*`, inherits `strict` from the root config and sets no
`allowJs`, so an untyped `.mjs` import from `packages/spec/scripts/` is TS7016.
The mechanical difference from the live precedent: `scripts/js-comment-mask.mjs`
and `scripts/check-regen-pending.mjs` each ship a hand-written `.d.mts` sibling
(#5475, #10398) -- nine of them existed before this commit -- and
`scripts/git-env.mjs` did not. That is also why the pre-existing
`check-regen-pending.mjs` import in the very same test file type-checks.
So this copies that shape and nothing else: one sibling declaration, PARTIAL on
purpose per `invoked-as.d.mts`, declaring only the export TypeScript consumes.
`check:declaration-mirrors` discovers the corpus rather than listing it and now
reports "OK: 10 hand-written declaration(s) agree with their modules on name,
kind and required arity" -- `gitFreeEnv`'s `Function.length` is 0 and the
declaration's required arity is 0.
1 parent 6b398c3 commit 7992d19
1 file changed
Lines changed: 43 additions & 0 deletions
| 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 | + | |
0 commit comments