|
|
@@ -43,6 +43,8 @@ In-package relative imports use explicit `.ts` specifiers.
|
|
|
- Referenced package/vendor projects keep the same emit behavior as build, so typecheck refreshes their `lib/types` outputs instead of using a separate no-emit graph. Project-specific strictness changes live in the owning `packages/*/*/tsconfig.json` or `vendor/*/tsconfig.json`.
|
|
|
- The no-emit aggregates disable `rewriteRelativeImportExtensions`; they emit nothing and include tests that import helpers across project-reference boundaries. Package/vendor emit projects keep the rewrite enabled.
|
|
|
|
|
|
+Composite projects keep their incremental build information inside their package-local `lib/` output. `pnpm run clean` explicitly removes package/vendor/CLI `lib/` outputs, legacy root build information, and deleted `packages/*/*` directories that contain only known generated residue. It preserves `node_modules` for every package that still has a `package.json`, and refuses to remove a manifest-less directory containing unknown files. Build does not invoke clean automatically, so ordinary builds retain incremental state.
|
|
|
+
|
|
|
The command orchestration shape is:
|
|
|
|
|
|
```sh
|
|
|
@@ -55,6 +57,9 @@ tsx scripts/verify-node-next-types.ts
|
|
|
|
|
|
pnpm run typecheck:
|
|
|
tsc -b
|
|
|
+
|
|
|
+pnpm run clean:
|
|
|
+tsx scripts/clean.ts
|
|
|
```
|
|
|
|
|
|
`pnpm run demo:*` still runs `src` directly through tsx and root paths, without a compile step.
|
|
|
@@ -63,6 +68,8 @@ tsc -b
|
|
|
|
|
|
- **Keep `tsdown`/oxc as the TypeScript transformer** — oxc's transform is not `tsc` behavior (decorator transform differs, bundled JS differs from per-file emit), and its bundled `.d.ts` conflicts with Cordis' internal relative module augmentation shape.
|
|
|
- **One root strict program over packages, vendor, examples, tests, and scripts** — vendor source triggers type errors outside this project's ownership under the root strict flags; project references with per-project strictness are the boundary that works.
|
|
|
+- **Clean before every build** — this would discard the incremental state owned by `tsc` and the bundler even when the workspace layout is unchanged.
|
|
|
+- **Remove every package-level `node_modules`** — valid package dependency links do not cause the workspace-discovery failure, and deleting them would turn build cleanup into dependency reinstallation.
|
|
|
|
|
|
## Consequences
|
|
|
|
|
|
@@ -76,5 +83,6 @@ Build responsibilities are clearer:
|
|
|
- `lib/index.*` is the publish runtime output and is generated by the bundler, currently `tsdown`.
|
|
|
- `pnpm run verify-node-next-types` scans built declarations for relative specifiers without file extensions, then typechecks a temporary external ESM consumer with `moduleResolution: "NodeNext"` against the built `types`/`exports` surface, so declaration specifier regressions fail before publish.
|
|
|
- The `typecheck` command uses `tsconfig.json`. Examples, tests, and scripts are checked by the root no-emit project, while packages and vendor modules keep the same emit behavior as `build`. Package and vendor source stays behind project-reference boundaries.
|
|
|
+- After changing branches or updating a checkout that deleted packages, contributors can run `pnpm run clean` to remove stale package directories before rebuilding. Unknown files in a manifest-less package directory require manual classification instead of being deleted.
|
|
|
|
|
|
The Cordis vendor copy now has one more type-structure divergence from upstream. During upstream sync, that divergence must be reapplied or explicitly retired.
|