Files
ui/pkgs/event/tsconfig.json
zeekayandHanzo Dev 55897f2948 event: build declarations under the TypeScript this package pins
`ignoreDeprecations: "6.0"` was set to keep the declaration build alive under
TypeScript 6, but this package pins `typescript: ^5.9.3` (<6) and publish.yml
builds it with `pnpm --filter @hanzo/event... build`, which resolves the
package's OWN TypeScript. So the release path is always TS 5.9.3, where "6.0" is
not an accepted value:

    error TS5103: Invalid value for '--ignoreDeprecations'
    DTS Build error         tsup exit=1        no .d.ts emitted

That is why 0.3.7 is absent from npmjs while package.json already names it — the
publish job could not get past the build. The reasoning behind the option was
sound and the direction was inverted.

tsup injects `baseUrl: compilerOptions.baseUrl || "."` into the config its
declaration worker runs (tsup/dist/rollup.js), so the deprecation cannot be
dodged by not writing one, and the escape hatch's accepted value is
version-specific. Measured, all six cells, tsup in pkgs/event:

                     TS 5.9.3 (pinned here)   TS 6.0.3 (repo root)
      absent         exit 0, 3 .d.ts          exit 1, TS5101
      "5.0"          exit 0, 3 .d.ts          exit 1, TS5101
      "6.0"          exit 1, TS5103           exit 0, 3 .d.ts

The two are mutually exclusive, so the value has to match the TypeScript the
package declares. "5.0" is not a middle ground — it is byte-identical to absent
under 5.9.3 and still fails under 6 — which leaves absent as the only correct
value and the smallest one.

Every failing cell exits 1, so no configuration here silently ships a typeless
tarball; the claim that tsup exits zero on a declaration failure does not hold
for any of them. Whether it exits zero or not, the publish job now also asserts
the types entrypoint exists before shipping.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 12:01:48 -07:00

52 lines
2.2 KiB
JSON

{
"compilerOptions": {
// No `ignoreDeprecations` here, and it must stay that way while this package
// builds on TypeScript 5.
//
// tsup's declaration worker injects `baseUrl: compilerOptions.baseUrl || "."`
// (tsup/dist/rollup.js) whether or not this file sets one, so the deprecation
// cannot be avoided by not writing it. The accepted value of the escape hatch
// is version-specific and the two are mutually exclusive — measured, all six
// cells, `tsup` in pkgs/event:
//
// TS 5.9.3 (declared here) TS 6.0.3 (repo root)
// absent exit 0, 3 .d.ts exit 1, TS5101
// "5.0" exit 0, 3 .d.ts exit 1, TS5101
// "6.0" exit 1, TS5103 exit 0, 3 .d.ts
//
// devDependencies pin `typescript: ^5.9.3` (<6), and publish.yml builds via
// `pnpm --filter @hanzo/event... build`, which resolves THIS package's
// TypeScript — so CI is always the left column and "6.0" fails the release
// outright. "5.0" is not a compromise: it is byte-identical to absent under
// 5.9.3 and still TS5101s under 6. Absent is therefore the only correct
// value, and the minimal one.
//
// Every failing cell exits 1, so this can never publish a typeless tarball
// by accident; publish.yml additionally asserts the `types` entrypoint
// exists before it ships. Revisit only together with the version pin above.
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": false,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"allowJs": false,
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.*", "**/*.spec.*"]
}