|
| 1 | +--- |
| 2 | +"@objectstack/service-storage": patch |
| 3 | +--- |
| 4 | + |
| 5 | +fix(service-storage): put the test layer in front of tsc, and repair what it was hiding (#15050) |
| 6 | + |
| 7 | +`packages/services/service-storage` had **no `typecheck` script at all** — its |
| 8 | +scripts were `build` and `test` — so no tsc program anywhere read this |
| 9 | +package's test layer, and its errors were carried instead as a 51-error DEBT |
| 10 | +entry in `scripts/check-type-check-coverage.mjs`. Gives it the #14062 / |
| 11 | +#14181 "checked test zone" shape: a sibling `tsconfig.test.json` (module |
| 12 | +semantics only — `esnext` / `bundler` / `lib: ES2022` — matching how vitest |
| 13 | +actually executes these files; strictness inherited and untouched) plus a |
| 14 | +`tsconfig.scripts.json` for `scripts/i18n-extract.config.ts` (the ninth |
| 15 | +instance of #11351, previously excluded from that ledger only because this |
| 16 | +package had no `typecheck` script to hang it on), both named by a new |
| 17 | +`typecheck` script. |
| 18 | + |
| 19 | +Measured before repair: 51 errors under BUILD semantics (`tsc --noEmit -p |
| 20 | +tsconfig.json`, which already includes the tests — matching the DEBT entry's |
| 21 | +recorded number exactly), 10 under the split. Unlike `service-cluster` |
| 22 | +(#14181), this package's BUILD reading was *not* already clean, so both |
| 23 | +programs needed genuine repair, not just the test-only split: 23 `TS2835` |
| 24 | +(relative imports missing their `.js` extension, required under BUILD's |
| 25 | +NodeNext resolution) were fixed by *adding* the extension — which resolves |
| 26 | +correctly under both NodeNext and the split's bundler mode — and clearing |
| 27 | +that also cleared all 15 `TS7006` "implicitly any" as a downstream cascade |
| 28 | +from the same unresolved imports (the shape `@objectstack/core` reported at |
| 29 | +98 → 4). The remaining 3 `TS2550` (`Array.prototype.at` needing `lib` |
| 30 | +es2022) are rewritten to indexed access rather than widening the shared |
| 31 | +BUILD `tsconfig.json`. The 8 code-tier errors (`TS2339` × 4 — a test |
| 32 | +helper's object-spread dropped its `Record<string, unknown>` index |
| 33 | +signature, fixed with an explicit return-shape annotation; `TS2347` × 4 — a |
| 34 | +fake `ctx: any`'s `getService<T>(...)` calls converted to `getService(...) |
| 35 | +as T`, the pattern one call site in the same file had already adopted for |
| 36 | +exactly this reason) are genuine test-file fixes. Both readings now agree at |
| 37 | +0/0 — the same result `service-cluster` reported, reached by a longer road. |
| 38 | + |
| 39 | +The package's DEBT entry (51 errors) is **deleted**, not lowered — the |
| 40 | +graduation this ratchet's invariant requires. No `test-typecheck-debt.json` |
| 41 | +is added: residue is 0, so none is owed (#5286, maintainer-only to open). |
| 42 | +`check:type-source-resolution` went red from onboarding the two new |
| 43 | +programs (the documented onboarding-limb case): a registry entry is added |
| 44 | +rather than `paths`, measured both ways — `paths` takes this package's test |
| 45 | +layer from 0 errors to 306, all in other packages' source. |
| 46 | + |
| 47 | +No runtime code changes: `src/**` excluding tests is byte-identical, so no |
| 48 | +shipped behaviour moves. The `patch` level reflects the published |
| 49 | +`package.json` gaining `typecheck` / `check:test-typecheck` scripts and a |
| 50 | +`tsx` devDependency. |
0 commit comments