Repository navigation
Commit 8b1728b
committed
ci: check the public type surface with api-extractor
4.2.4 shipped a breaking type change as a patch. ObservableStatus<T>
went from a flat interface to a discriminated union, so data became
T | undefined and the documented destructure-and-use pattern stopped
compiling for strict-TS consumers. Nothing in the release flow compared
the published type surface, so it went out unnoticed.
api-extractor generates etc/reactfire.api.md, a report of every public
export. CI regenerates it and fails when it no longer matches, so a
change to the type surface shows up as a reviewable diff in the pull
request instead of being discovered by a consumer after release.
The report is generated by npm run api:report and never hand-edited.
Nothing here is maintained by hand.
Verified against a faithful reproduction of 4.2.4, patched so only
consumers break rather than internals: plain tsc still passes, and
api:check exits 1 with a one-line diff, data: T becoming
T | undefined.
Two notes for review:
api-extractor bundles TypeScript 5.9.3 and this repo is on 6.0.3, so it
prints a version warning on every run. The emitted .d.ts contain no
TypeScript 6 only syntax, and the report reproduces the emitted
signatures exactly, so the older engine has nothing to misparse. Worth
rechecking if the public surface ever adopts newer syntax.
The job builds with vite, not tsc. tsconfig.json sets noEmit, so tsc is
a type check only; @rollup/plugin-typescript inside the vite build is
what emits the declarations api-extractor reads.
Closes #7491 parent 0b90534 commit 8b1728b
6 files changed
Lines changed: 883 additions & 2 deletions
File tree
- .github/workflows
- etc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
85 | 113 | | |
86 | 114 | | |
87 | 115 | | |
| |||
152 | 180 | | |
153 | 181 | | |
154 | 182 | | |
155 | | - | |
| 183 | + | |
156 | 184 | | |
157 | 185 | | |
158 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 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 | + | |
0 commit comments