Root tsconfig.json becomes a pure solution (files:[] + two references); the former root host aggregate moves verbatim to tsconfig.host.json. New tsconfig.base.client.json carries the shared client compiler shape (jsx/DOM lib/types:[]), and tsconfig.client.json plus the 12 packages/client tsconfigs extend it instead of restating the trio. tsconfig.build.json is deleted: the solution covers the full emit graph, absorbing the command-goal typecheck/build drift. Consumers migrate to the single graph: typecheck/build scripts and the lefthook pre-push hook run bare `tsc -b` (pre-push now covers the client side); the run-gates build gate needs typecheck so two concurrent tsc -b runs cannot race the same tsbuildinfo; ts-project.ts and the standalone doc-typecheck mode seed tsconfig.host.json explicitly (never the root solution — flattening host+client into one program collides the cordis Context merges); verify-cordis-config BFS seeds the root solution alone. Per missions/tsconfig-single-graph-migration.md §2–§3.
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { defineConfig } from 'tsdown'
|
|
|
|
/**
|
|
* JS bundling for vendored Cordis and Harness TypeScript packages.
|
|
* TypeScript source is compiled first by `tsc -b` (the root solution); tsdown
|
|
* reads only the emitted JS under lib/types and writes the package root and
|
|
* invariant companion runtime bundles. Declarations are NOT produced here,
|
|
* hence `dts: false`.
|
|
*
|
|
* Per-package shape overrides live in `<package>/tsdown.config.ts`
|
|
* (schemastery: dual ESM+CJS; logger-console: extra browser entry).
|
|
*/
|
|
export default defineConfig({
|
|
// Explicit globs keep bundling to vendored Cordis, the TypeScript package tree, and
|
|
// the Node CLI assembly. `apps/web` is a Vite application with no lib/types entry;
|
|
// `workspace: true` or `apps/*` would incorrectly treat it as a package bundle.
|
|
workspace: ['vendor/*', 'packages/*/*', 'apps/cli'],
|
|
// The brace glob admits the package companion when present while retaining the
|
|
// index-only build for vendored Cordis packages outside the Harness package tree.
|
|
entry: ['lib/types/{index,invariant}.js'],
|
|
outDir: 'lib',
|
|
format: ['esm'],
|
|
platform: 'node',
|
|
target: 'es2024',
|
|
// All packages set "type": "module"; fixedExtension false keeps ESM output
|
|
// at .js (not .mjs), matching the package.json main/exports fields.
|
|
fixedExtension: false,
|
|
dts: false,
|
|
clean: false,
|
|
})
|