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
21 changes: 21 additions & 0 deletions .changeset/types-files-drops-src-4851.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
---
'@object-ui/types': patch
---

`@object-ui/types` stops publishing its `src/` tree

Its manifest's `files` array listed `src` alongside `dist`, so every published tarball carried all 91 source files. Unlike the two sibling packages already fixed (`@object-ui/data-objectstack` #4847, `@object-ui/fields` #4856), this one was not a mechanical delete: `packages/types/tsconfig.json` built with a bare `tsc` and `declarationMap: true`, and its shipped `dist/*.d.ts.map` named `sources: ["../src/*.ts"]` with `sourcesContent: false` — a real, if small, consumer (editor go-to-source). Deleting `src` from `files` while that map still pointed at it would have shipped a tarball with a broken-link map.

Maintainer ruling (2026-08-17, objectui#4851): turn `declarationMap` off at the source rather than keep a permanent per-package exception in the phantom-dependencies gate's header, or add `inlineSources` (which saves nothing and adds a third emitter shape). `types` is a pure-types package built by bare `tsc`, so its `.d.ts` is near-isomorphic to its source — go-to-source degrading to the `.d.ts` is a near-zero-pull, deliberate trade.

Order followed: flipped `declarationMap: false` in `packages/types/tsconfig.json` first, clean-rebuilt, and confirmed the published `dist` has zero `.map` files, zero `sourceMappingURL` occurrences, and zero `../src` references (a positive control against the pre-flip build showed 54 of each, so the greps are exercised, not vacuous) — only then trimmed `files` to `["dist", "README.md", "CHANGELOG.md", "LICENSE"]`.

`npm pack --dry-run` across the change, on the freshly rebuilt `dist`:

| | before | after |
| --- | --- | --- |
| entries | 203 | 112 |
| unpacked | 3974143 B | 2828454 B |
| tarball | 656307 B | 414644 B |

91 `src/*.ts` files leave, none arrives; the `dist/` entry count (108) is unchanged, and its `.d.ts` payload is now map-free.
5 changes: 2 additions & 3 deletions packages/types/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,10 +56,9 @@
},
"files": [
"dist",
"src",
"README.md",
"LICENSE",
"CHANGELOG.md"
"CHANGELOG.md",
"LICENSE"
],
"scripts": {
"build": "tsc",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/tsconfig.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"declarationMap": true,
"declarationMap": false,
"composite": true,
"noEmit": false,
"lib": ["ES2020", "DOM"],
Expand Down
36 changes: 20 additions & 16 deletions scripts/check-phantom-dependencies.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,23 +75,27 @@
* measured 73 `*.test.d.ts` files landing in the published `dist/` of
* `@object-ui/fields` and `@object-ui/plugin-editor`, and three packages
* (`fields`, `types`, `data-objectstack`) listed `src` in `files`, so their
* tarballs carried the test SOURCES too. Two of the three no longer do:
* tarballs carried the test SOURCES too. None of the three do anymore.
* objectui#4847 dropped `src` from `data-objectstack`'s `files` (43 source
* files, 38 of them tests, left that tarball) and objectui#4856 dropped it
* from `fields`' (173 source files, 97 of them tests). Only `types` still
* lists it, and there the entry is load-bearing rather than leftover,
* because it builds with a bare `tsc` under the root's `declarationMap` /
* `sourceMap` and no `inlineSources`, so its shipped `dist/*.d.ts.map` name
* `../src/*.ts` with no embedded content — dropping `src` there would leave
* published maps pointing at files the tarball no longer carries. `fields`
* was measurably NOT that shape, which is why the two were split rather than
* fixed together: its declarations come from `vite-plugin-dts`, and a clean
* rebuild emits zero `.map` files and zero `sourceMappingURL` comments, so
* nothing in its `dist` referred back to `src` at all. That is a real defect
* where it is one, and it is already filed; it is not this gate's, because
* nothing resolves those files and so no install of them can fail. Stated
* here rather than glossed, because "the build excludes tests" is the
* plausible-sounding version of this paragraph and it is not what the
* files, 38 of them tests, left that tarball); objectui#4856 dropped it
* from `fields`' (173 source files, 97 of them tests) after a clean rebuild
* measured zero `.map` files and zero `sourceMappingURL` comments in its
* `vite-plugin-dts` output, so nothing in its `dist` referred back to `src`
* at all. `types` was the holdout: it builds with a bare `tsc`, and until
* objectui#4851 its `tsconfig.json` set `declarationMap: true` with no
* `inlineSources`, so its shipped `dist/*.d.ts.map` named `../src/*.ts`
* with no embedded content — dropping `src` from `files` while that was
* still true would have left published maps pointing at files the tarball
* no longer carried. objectui#4851 closed the gap at the source instead of
* leaving the exception standing: `declarationMap` is now `false`, a clean
* rebuild confirmed zero `.map` files, zero `sourceMappingURL` comments,
* and zero `../src` references in `dist`, and only then did `src` come out
* of `files`. Go-to-source for `@object-ui/types` consumers now resolves
* to the `.d.ts`, not the original `.ts` — a deliberate, near-zero-pull
* trade for a pure-types package whose declarations are near-isomorphic to
* their source, made explicitly rather than left as a silent regression.
* Stated here rather than glossed, because "the build excludes tests" is
* the plausible-sounding version of this paragraph and it is not what the
* repository measures.
*
* The root allowance is a decision, not an oversight, and it is worth stating
Expand Down
Loading