tsc --build false negative through export * facade project
TypeScript Version
7.0.1-rc
Repro
Repo: https://github.com/jasonkuhrt/ts-project-reference-reexport-stale-repro
git clone https://github.com/jasonkuhrt/ts-project-reference-reexport-stale-repro.git
cd ts-project-reference-reexport-stale-repro
pnpm install
pnpm repro
Project layout:
.
├── source/
│ ├── tsconfig.json # composite project
│ └── index.ts # exports Status
├── facade/
│ ├── tsconfig.json # composite project, references ../source
│ └── index.ts # re-exports source
└── consumer/
├── tsconfig.json # composite project, references ../facade
└── index.ts # imports Status through facade
Dependency path:
consumer/index.ts -> facade/index.ts -> source/index.ts
Relevant source:
// source/index.ts
export type Status = "old";
// facade/index.ts
export * from "../source/index";
// consumer/index.ts
import type { Status } from "../facade/index";
export const status: "old" = null as unknown as Status;
The only compiler option in each project is composite: true.
Actual Behavior
pnpm repro first builds with:
// source/index.ts
export type Status = "old";
Then it changes the source project to:
export type Status = "new";
The incremental build incorrectly exits 0.
The facade declaration remains textually unchanged:
export * from "../source/index";
The consumer declaration remains stale:
export declare const status: "old";
Expected Behavior
The incremental build should fail like the clean build does:
consumer/index.ts(3,14): error TS2322: Type '"new"' is not assignable to type '"old"'.
Notes
This is not pnpm workspace/package-exports behavior. The repro uses no workspace
packages and no package imports.
#46153 looks related,
but this is a minimal export * facade case where the intermediate project emits
stable declaration text while its re-exported public API changes.
tsc --buildfalse negative throughexport *facade projectTypeScript Version
7.0.1-rcRepro
Repo: https://github.com/jasonkuhrt/ts-project-reference-reexport-stale-repro
git clone https://github.com/jasonkuhrt/ts-project-reference-reexport-stale-repro.git cd ts-project-reference-reexport-stale-repro pnpm install pnpm reproProject layout:
Dependency path:
Relevant source:
The only compiler option in each project is
composite: true.Actual Behavior
pnpm reprofirst builds with:Then it changes the source project to:
The incremental build incorrectly exits
0.The facade declaration remains textually unchanged:
The consumer declaration remains stale:
Expected Behavior
The incremental build should fail like the clean build does:
Notes
This is not pnpm workspace/package-exports behavior. The repro uses no workspace
packages and no package imports.
#46153 looks related,
but this is a minimal
export *facade case where the intermediate project emitsstable declaration text while its re-exported public API changes.