Uh oh!
There was an error while loading. Please reload this page.
fix(types): drop declarationMap and src from published files - #4897
Merged
Conversation
Ruled option (b) for the @object-ui/types half of the src-in-files finding: turn declarationMap off at the source instead of keeping a permanent per-package exception, or paying for inlineSources (which saves nothing and adds a third emitter shape). Order followed per the ruling: flipped declarationMap:false in packages/types/tsconfig.json first, clean-rebuilt, and confirmed dist has zero .map files / zero sourceMappingURL / zero ../src references (positive control against the pre-flip build showed 54 of each) — only then trimmed files to dist-only, matching #4847's shape. Updated the check-phantom-dependencies.mjs header paragraph: all three originally-recorded packages (data-objectstack, fields, types) have now dropped src from files. npm pack --dry-run: 203 -> 112 entries, 91 src/*.ts files leave, none arrives, dist/ (108 entries) is unchanged and now map-free. Fixes#4851 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbRmJD3iPhXjKr6vhd4Qkv
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-steve
marked this pull request as ready for review
August 17, 2026 02:25
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#4851
What
The
@object-ui/typeshalf of thesrc-in-filesfinding, ruled option (b) in themaintainer ruling:
turn
declarationMapoff at the source, then trimfilesto dist-only, matching theshape #4847 (
@object-ui/data-objectstack) and #4856 (@object-ui/fields) already used.Unlike those two, this one was not a mechanical delete:
packages/typesbuilds with abare
tscand haddeclarationMap: true, and its shippeddist/*.d.ts.mapnamedsources: ["../src/*.ts"]withsourcesContent: false— a real (if small) consumer:editor go-to-source. Deleting
srcfromfileswhile that map still pointed at itwould have shipped a tarball with broken-link maps, the one state the ruling excludes.
Order followed (per the ruling)
Flipped
declarationMap: falseinpackages/types/tsconfig.json. Checked theinheritance chain:
packages/types/tsconfig.jsonextends the repo-roottsconfig.json(nottsconfig.base.json— nothing underpackages/typesis onthat chain), and neither the root nor the package config ever set
sourceMap: truefor this package (confirmed via
tsc --showConfig), so the bare-tscbuild onlyever emitted
.d.ts+.d.ts.map, never.js.map.Clean rebuild (
rm -rf dist tsconfig.tsbuildinfo && tsc) — no workspace dependencybuild was needed (
@object-ui/typeshas none in this package's own build graphbeyond
@objectstack/spec, already installed).Verified
distwith a positive control:.mapfilessourceMappingURLoccurrences../srcreferencesThe pre-flip run is the positive control proving the greps actually hit something
(not a vacuously-passing pattern) before trusting the post-flip zeros.
Trimmed
filesto["dist", "README.md", "CHANGELOG.md", "LICENSE"], afterconfirming all four points of finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847's pre-deletion checklist for this package:
exportsmap: 11 subpath entries, every condition targetsdist.main/module/types: all./dist/....@object-ui/types/src(docs, code) — zero hits; no guideteaches a
srcdeep-import for this package (unlikefields, which had this in3 skill guides per finding: @object-ui/fields 与 @object-ui/types 的 files 仍含 src(#4847 同族余下两例;types 那处承重,不是机械删除) #4851's own investigation — filed separately as 三份 skill 指南教消费者
@source扫node_modules/@object-ui/*/src—— 四个包里三个从不发布 src,且三份文件完全不提 style.css #4858, notapplicable here since
typeshas no such guide text at all).npm pack --dry-runbefore/after, on the freshly rebuiltdist:91
src/*.tsfiles leave, none arrives; thedist/entry count (108) is unchangedbyte-for-byte apart from the edited
package.json.Updated the
scripts/check-phantom-dependencies.mjsheader paragraph: it previouslyread "
fields/typesstill listsrc, andtypes's entry is load-bearing" (alreadyupdated once by [fields]
files去src(#4851 的 fields 半)—— 先实测 dist map 形态,同形则照 #4847 机械删,异形停手 #4856/PR chore(fields): files 不再列 src —— 173 个源码文件(97 个测试)退出发布物 (#4856) #4861 to retire thedata-objectstackexample). This PRretires the last of the three — the paragraph now states all three originally-recorded
packages have dropped
srcfromfiles, and explains whytypesneeded thedeclarationMapflip first rather than a bare delete.Consumer impact
Go-to-source for
@object-ui/typesconsumers now resolves to the shipped.d.tsinstead of the original
.ts— a deliberate, near-zero-pull trade per the ruling(
typesis a pure-types package built by baretsc, so its declarations arenear-isomorphic to their source). No public type surface changed;
exportstargets areunchanged.
Tests (HEAD
903f47f)pnpm exec vitest run --root . scripts/__tests__/package-files-exist.test.ts— 18/18 passedpnpm exec vitest run packages/types/ --maxWorkers=2— 36 files / 428 tests passednode scripts/check-phantom-dependencies.mjs— passing (re-run at HEAD)cd packages/types && npm run type-check(tsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json) — cleannode scripts/check-control-bytes.mjs— passingnode scripts/check-package-self-import.mjs— passingnode scripts/check-changeset-presence.mjs/check-changeset-no-major.mjs— passing (re-run at HEAD)node scripts/check-published-dist-tooling.mjs— not run locally: this gate costsa full monorepo build (objectui#4846) and is not implicated by this diff (no change to
what any package's build program emits); left to CI per "本地验证范围".
Out-of-scope finding (not fixed here)
While auditing
packages/types/package.json'sexportsmap against the builtdist,found
exports["."].requirepoints at./dist/index.cjs, which the package's baretscbuild ("build": "tsc") never emits — confirmed pre-existing onorigin/main,unrelated to this change. Filed as #4896, out of this PR's file surface.
Generated by Claude Code