Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .changeset/type-check-tests-plugin-map-4040.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
---

Releases nothing on purpose: `@object-ui/plugin-map` now type-checks its four test files
(`tsconfig.test.json` chained from `type-check`), and its `TEST_DEBT` entry is gone. No
published source changed.

Its one declared code-tier error turned out to be config-tier under a fuller template,
the same reclassification `sdui-parser`'s 50 `TS2304`s got in objectui#3032. The error was
`TS2882` on `ObjectMap.tsx`'s side-effect import of `maplibre-gl/dist/maplibre-gl.css` —
raised not because the source is wrong (the package build compiles it cleanly) but because
`src/global.d.ts`, which declares `*.css`, was not a program input. An ambient declaration
file is only an input when a pattern NAMES it; being reachable by import is not enough,
since nothing imports it. `"src/**/*.d.ts"` in the project's `include` is the fix, and it
is the general shape for any package whose build gets ambient declarations for free from
`"include": ["src"]`.
2 changes: 1 addition & 1 deletion packages/plugin-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "vite build",
"test": "vitest run",
"test:watch": "vitest",
"type-check": "tsc --noEmit",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
},
"dependencies": {
Expand Down
30 changes: 30 additions & 0 deletions packages/plugin-map/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// Type-checks this package's TESTS, which `tsconfig.json` excludes.
// See `packages/types/tsconfig.test.json` for why that exclusion was a hole:
// the build correctly keeps tests out of `dist`, but nothing else compiled
// them, so a test could assert a contract the compiler never checked.
"extends": "../../tsconfig.json",
"compilerOptions": {
"noEmit": true,
// The package build emits `dist`; this project emits nothing, so it must
// not inherit `composite` / `declaration` from the build config.
"composite": false,
// The `toBeInTheDocument` / `toHaveTextContent` matchers these tests use are
// a global augmentation, not an import, and `@testing-library/jest-dom` does
// not live under `@types/` — so it is never picked up automatically and has
// to be named here. Naming `types` at all switches off automatic `@types/*`
// inclusion, which is fine: nothing in these tests touches Node globals.
"types": ["@testing-library/jest-dom"],
// Drop the root tsconfig's source-tree `paths` so `@object-ui/*` and
// `@objectstack/spec` resolve through the workspace dependency's built
// `.d.ts` instead of pulling sibling sources in as program inputs (TS6059).
"paths": {}
},
// `src/global.d.ts` is pulled in explicitly. The build program gets it for
// free from `"include": ["src"]`, but an ambient declaration file is only a
// program input when a pattern names it — being imported is not enough,
// because nothing imports it. Without it `ObjectMap.tsx`'s side-effect import
// of `maplibre-gl/dist/maplibre-gl.css` is TS2882 here and nowhere else,
// which reads as a defect in the source the build compiles cleanly.
"include": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/**/*.d.ts"]
}
1 change: 0 additions & 1 deletion scripts/check-type-check-coverage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export const TEST_DEBT = {
"@object-ui/auth": { errors: 2, issue: 4118 },
"@object-ui/plugin-chatbot": { errors: 2, issue: 4118 },
"@object-ui/plugin-grid": { errors: 2, issue: 4118 },
"@object-ui/plugin-map": { errors: 1, issue: 4118 },
};

// ── Collect workspace packages ───────────────────────────────────────────────
Expand Down
Loading