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
13 changes: 13 additions & 0 deletions .changeset/6703-dist-completeness-gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
---

Build tooling only — no package source changes, so nothing is released here.

`packages/*` built by plain `tsc` are `composite`, and TypeScript resolves their
`tsconfig.tsbuildinfo` next to `tsconfig.json` rather than inside the `dist/` it
describes. Once those two disagree, `tsc` believes the record: it emits nothing,
repairs nothing and exits 0, and the damage surfaces as ordinary-looking type
errors in whichever packages import the truncated artifact (objectui#6703).

Each such build now ends by asserting that every file `tsc` says it emits is on
disk, and each `clean` takes the buildinfo with the `dist/` it describes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"check:icon-record-names": "node scripts/check-lucide-icon-record-names.mjs",
"check:phantom-deps": "node scripts/check-phantom-dependencies.mjs",
"check:self-import": "node scripts/check-package-self-import.mjs",
"check:dist-completeness": "node scripts/check-dist-completeness.mjs --all",
"check:esm-specifiers": "node scripts/check-node-esm-load.mjs --specifiers-only",
"check:node-esm-load": "node scripts/check-node-esm-load.mjs",
"check:control-bytes": "node scripts/check-control-bytes.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"./styles.css": "./src/styles.css"
},
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"LICENSE"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
4 changes: 2 additions & 2 deletions packages/collaboration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"LICENSE"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
},
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"LICENSE"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
4 changes: 2 additions & 2 deletions packages/permissions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"LICENSE"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
2 changes: 1 addition & 1 deletion packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
2 changes: 1 addition & 1 deletion packages/react-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dist"
],
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
2 changes: 1 addition & 1 deletion packages/sdui-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dist"
],
"scripts": {
"build": "tsc",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"test": "vitest run",
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
"lint": "eslint ."
Expand Down
4 changes: 2 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"LICENSE"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"build": "tsc && node ../../scripts/check-dist-completeness.mjs",
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"type-check": "tsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json",
"lint": "eslint ."
},
Expand Down
31 changes: 29 additions & 2 deletions packages/types/src/__tests__/package-exports-manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@
* be vacuously absent-or-red on a cold CI cache, not a meaningful signal.
* The artifact-level claim (a clean `tsc` build never emits `.cjs`) was
* verified by hand for this fix and is not expected to regress silently: the
* package's `"build": "tsc"` script and lack of any bundler/dual-emit step
* package's bare-`tsc` EMIT step and lack of any bundler/dual-emit step
* are exactly the two other things this test pins, so a future edit that
* reintroduces a `require` condition without ALSO reintroducing the emit step
* would still need to touch this file's expectations to pass CI.
*
* The build script is read as a chain rather than as one string: its first
* segment is the emit and must be bare `tsc`, and every later segment is
* enumerated in the test, so non-emitting post-build checks can be added
* without weakening any of the above. See that case for why.
*/
import { readFileSync } from 'node:fs';
import { createRequire } from 'node:module';
Expand All @@ -64,7 +69,29 @@ describe('@object-ui/types package.json exports map (objectui#4896)', () => {
// If this ever changes to a bundler/dual-emit build, the `require`-less
// exports map below should be revisited rather than assumed to still be
// correct.
expect(pkg.scripts?.build).toBe('tsc');
//
// What that sentence pins is that NOTHING IN THE BUILD EMITS A SECOND
// FORMAT. `toBe('tsc')` conflated it with the literal string, so appending
// a post-build assertion that emits nothing at all (objectui#6703) turned
// this red while the CJS question was untouched — a spelling too strict for
// its own stated meaning.
//
// The chain is therefore split instead of compared whole. The EMITTING step
// must be bare `tsc`; every other step is enumerated right here, so a
// bundler — or any new step whatsoever — still cannot arrive without
// editing this expectation and justifying it. That is exactly what the
// header above asks for, and it is no weaker than the old spelling: both
// fail on any change, this one just fails for the right reason.
//
// The first assertion is the same question `buildsWithTsc()` asks in
// `scripts/check-dist-completeness.mjs`, RESTATED rather than imported:
// this package's test program sets `allowJs: false` and includes only
// `src/**/*.test.ts`, so importing that `.mjs` fails with TS7016 (measured,
// not assumed). The duplication is structural — change one, change the
// other.
const steps = (pkg.scripts?.build ?? '').split('&&').map((step) => step.trim());
expect(steps[0]).toBe('tsc');
expect(steps.slice(1)).toEqual(['node ../../scripts/check-dist-completeness.mjs']);
});

it('the root "." export carries exactly {types, import} — no "require" condition', () => {
Expand Down
Loading
Loading