From 81b778ce328c810c06f65dd7bf24112050575a17 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Sep 2026 13:02:35 +0000 Subject: [PATCH] fix(fields): exclude tooling DIRECTORIES from the emitting program, not just the `*.test.*` name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `@object-ui/fields` shipped `dist/__tests__/numberInputBrowserReadings.d.ts` inside its published tarball, which made `check:published-dist` red on `main` and — since the same script is the first link in `changeset:publish` — failed the publish command at its first step. `numberInputBrowserReadings.ts` holds the measured Chromium/happy-dom readings the number-widget suites share. It carries no assertions, so it is deliberately not a `*.test.ts`, and the name-only exclude list did not catch it while its 79 neighbours in the same directory were kept out. Which program had to change was measured, not assumed: this package builds with `tsc && vite build` and the `tsc` leg inherits the root's `noEmit`. Run alone, `tsc` exited 0 and wrote zero files; `vite build` alone produced the whole 81-file output including the offending declaration. vite-plugin-dts is the emitting program and builds its declaration program from this package's `tsconfig.json` (its `dts()` options pass no `exclude`), so the exclude belongs there. After the change the same vite-only leg emits 80 files and zero tooling artifacts, with `dist/index.d.ts` still present as a control. Third instance of the same name-versus-directory mismatch (objectui#4006 here, objectui#4836 in plugin-grid / plugin-view / plugin-designer), so the table is now the directory convention itself rather than a list of names to extend. `__mocks__` / `__benchmarks__` match nothing here today and are listed for that reason. The name patterns stay: 52 `*.test.ts(x)` files in this package sit outside any `__tests__/` directory. No type coverage moves. `numberInputBrowserReadings.ts` is the only file the directory patterns newly remove from the build program, and the `tsconfig.test.json` chained off `type-check` already reads it as a transitive input of the three suites that import it — measured with `--listFiles` before and after, each zero carrying a live control. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012wwHa4aaFybxXrfmfHioDM --- .../6943-fields-tooling-dirs-out-of-emit.md | 31 +++++++++++++++ packages/fields/tsconfig.json | 39 ++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .changeset/6943-fields-tooling-dirs-out-of-emit.md diff --git a/.changeset/6943-fields-tooling-dirs-out-of-emit.md b/.changeset/6943-fields-tooling-dirs-out-of-emit.md new file mode 100644 index 0000000000..25630dfee6 --- /dev/null +++ b/.changeset/6943-fields-tooling-dirs-out-of-emit.md @@ -0,0 +1,31 @@ +--- +'@object-ui/fields': patch +--- + +Stop shipping `dist/__tests__/numberInputBrowserReadings.d.ts` in the published tarball +(objectui#6943). `packages/fields/tsconfig.json` now excludes the tooling DIRECTORIES +(`__tests__`, `__mocks__`, `__benchmarks__`), not just the `*.test.*` NAME. + +`numberInputBrowserReadings.ts` holds the measured Chromium/happy-dom readings the number +widget suites share. It is deliberately not a `*.test.ts` — it carries no assertions — so +the name-only exclude list did not catch it, and it was emitted into `dist` and published +while its 79 neighbours in the same directory were kept out. That made +`check:published-dist` red on `main`, and because the same script is the first link in +`changeset:publish`, it also failed the publish command at its first step. + +This is the third instance of the same name-versus-directory mismatch (objectui#4006 here, +objectui#4836 in plugin-grid / plugin-view / plugin-designer), so the exclude table is now +the directory convention itself rather than a list of names to extend. + +Which program had to be fixed was measured rather than assumed, because this package's +build is `tsc && vite build` and the `tsc` leg inherits the root's `noEmit`: run alone the +`tsc` leg exited 0 and wrote zero files, while `vite build` alone produced the whole +81-file output including the offending declaration. vite-plugin-dts is the emitting +program, and it builds its declaration program from this package's `tsconfig.json`, so +that is where the exclude belongs. + +No type coverage moves with the change and no API surface moves: `numberInputBrowserReadings.ts` +is the only file the directory patterns newly remove from the build program, and the +`tsconfig.test.json` chained off `type-check` already reads it as a transitive input of the +three suites that import it. The name patterns stay, because 52 `*.test.ts(x)` files in this +package sit outside any `__tests__/` directory. diff --git a/packages/fields/tsconfig.json b/packages/fields/tsconfig.json index 2a8827504b..8c3615cba9 100644 --- a/packages/fields/tsconfig.json +++ b/packages/fields/tsconfig.json @@ -30,5 +30,42 @@ // Their type coverage did not go away with them: it moved to the // `tsconfig.test.json` chained off this package's `type-check` script, which // is what scripts/check-type-check-coverage.mjs verifies. - "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"] + // + // The exclusions cover TOOLING DIRECTORIES, not just the `*.test.*` name + // (objectui#6943 — the THIRD instance of that mismatch, after objectui#4006 + // here and objectui#4836 in plugin-{grid,view,designer}). Which program the + // directories have to be excluded FROM was measured on 56453410f rather than + // assumed, because the comment above says `tsc` here only checks: run alone, + // the `tsc` leg of `build` exited 0 and wrote ZERO files, while `vite build` + // alone produced the whole 81-file output — including + // `dist/__tests__/numberInputBrowserReadings.d.ts`. So vite-plugin-dts is the + // emitting program, and it builds its declaration program from THIS config + // (`dts()` in `vite.config.ts` passes no `exclude` of its own), which is why + // the fix belongs here and not in the plugin options. + // + // That file is not a `*.test.ts` by NAME, so the name-only list let it ship in + // the tarball while its 79 neighbours in the same directory were caught. + // + // The name patterns stay: 52 `*.test.ts(x)` files in this package sit outside + // any `__tests__/` directory, so the directory patterns do not subsume them. + // `__mocks__` / `__benchmarks__` match nothing here today and are listed so + // the table is the directory convention itself — exactly as `TOOLING_FILE` in + // scripts/check-phantom-dependencies.mjs spells it — rather than a list that + // has to be extended the next time such a directory appears. + // + // No type coverage moves with this change. `numberInputBrowserReadings.ts` is + // the only file the directory patterns newly remove from this program, and the + // `tsconfig.test.json` chained off `type-check` already reads it as a + // transitive input of the three suites that import it (measured with + // `tsc -p tsconfig.test.json --listFiles`, before and after), so it needs no + // entry there — the same reason plugin-grid's `explainDouble.ts` needed none. + "exclude": [ + "node_modules", + "dist", + "**/__tests__/**", + "**/__mocks__/**", + "**/__benchmarks__/**", + "**/*.test.ts", + "**/*.test.tsx" + ] }