Repository navigation
finding: @object-ui/fields 与 @object-ui/types 的 files 仍含 src(#4847 同族余下两例;types 那处承重,不是机械删除) #4851
Description
Activity
【PM 分诊】objectui 分片 PM(session_01GTRjn8xBqp75dk7kFupVRt):本卡两半判定不同,拆开处置 ——
- fields 半 → [fields]
files去src(#4851 的 fields 半)—— 先实测 dist map 形态,同形则照 #4847 机械删,异形停手 #4856 晋级实施(批次 12 补位):条件机械 —— 先干净重建实测 vite-plugin-dts 的 map 形态,同形(无 map / map 自带内容)照 finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847 删,异形(map 指回../src)停手回传归入下一条。 - types 半 → 本卡转
needs-user-decision:declarationMap: true+ mapsources指../src且无sourcesContent是实测在案的承重 —— 待裁的取舍是「发布的 declaration map 要不要能跳回源码」:(a) 保留src于files(map 的消费者是正当的,今天的状态即答案,关卡即可);(b) 产出侧关declarationMap(瘦身,go-to-source 退化到.d.ts);(c) 开inlineSources(不省体积,仅消除断链风险)。⛔ 只删files里的src留断链 map 不是选项。机制化的门已由 finding: 「已发布 dist 不得含 tooling 产物」今天没有任何门看得见 —— 判据必须是产物级的,而 CI 没有全仓 build #4846 裁定(release 时产物级)覆盖,不在本卡重复。
Generated by Claude Code
- fields 半 → [fields]
fields 半的 map 读数(本卡说「没有量」的那一项,现已实测)
本卡正文写着「
@object-ui/fields的 emitter 是第三种(vite-plugin-dts),它的 dts 是否产.d.ts.map、产的 map 指哪里,得单独干净重建后实测,本卡没有量」。#4856 量了,读数如下,补进这里以便 types 半取舍时手上是三种 emitter 的完整对照。干净重建
@object-ui/fields(删dist与tsconfig.tsbuildinfo,先建依赖再建本体;build是tsc && vite build && node scripts/build-css.mjs):读数 值 dist/文件总数78(75 个 .d.ts+index.js+index.cjs+index.css).d.ts.map0 .js.map0 任何 .map0 含 sourceMappingURL的文件0 提到 ../src的文件0 没有 map,所以没有
sources指向、也没有sourcesContent可读 —— 与types的承重形态相反。原因可查而不只是巧合:packages/fields/tsconfig.json继承的是根tsconfig.json,而根tsconfig.json是noEmit: true且不设declarationMap/sourceMap;设这两项的是tsconfig.base.json,它不在 fields 的继承链上(fields 那条注释也说了:tsc在这里只做检查,dist由 vite-plugin-dts 写出)。vite.config.ts也没开build.sourcemap。三种 emitter 的完整对照,补齐本卡的表:
包 build dist 里的 map src是否承重处置 @object-ui/data-objectstacktsup(sourcemap: false)0 否 已删(#4847 / PR #4852) @object-ui/fieldstsc && vite build && build-css0 否 已删(#4856 / PR #4861,draft) @object-ui/types裸 tsc(declarationMap: true)有, sources=["../src/*.ts"]、sourcesContent=false是 仍待本卡裁 fields侧的 pack 对照:条目 255 -> 82,unpacked 2265557 -> 841772 B,tarball 629843 -> 252364 B;消失 173(97 个测试 + 76 个实现源码),新增 0,src/以外零条目移动。一个在 fields 上命中、在
data-objectstack上没命中的前置核查项#4847 的前置核查 ③(「全仓与文档是否教过
srcdeep-path」)在 fields 上命中了,但命中的不是 map,也不是 fields 专有问题:三份 skill 指南给消费者的 Tailwind 样板里有@source "../node_modules/@object-ui/fields/src/**/*.tsx";。追下去发现同一段样板对components/layout/react写了同样的三行,而那三个包的files只有dist—— 四条 glob 里三条今天就已经匹配 0 个文件,且那三份文件从不教 #4059 之后的正路style.css。仓内两处维护中的答案(packages/components/README.md:64明确禁止这条@source;CLI scaffold 扫的是node_modules/@object-ui/*/dist/**/*.js)说的正相反。已另立 #4858 记录,PR #4861 未修它。这一条对 types 半也有影响:如果将来 types 的取舍倾向「保留
src以免断链」,那份指南同样不构成保留理由 —— 它对 types 根本没写@source行,types 的真实消费者只有 declaration map 一个。
Generated by Claude Code
Maintainer ruling (2026-08-17, recorded by PM session
session_01DbRmJD3iPhXjKr6vhd4Qkv). The maintainer reviewed the four-card decision-inbox analysis in PM chat and approved its recommendations, verbatim: 「同意」.Ruled: option (b) for the
@object-ui/typeshalf — turndeclarationMapoff at the source, then shrinkfilesto dist-only.Rationale on record:
typesis a pure-types package built by baretsc— its.d.tsoutput is near-isomorphic to its source, so go-to-source degrading to the.d.tsis a cosmetic loss with near-zero pull.- The sibling packages are already dist-only (
data-objectstackfinding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847 / PR chore(data-objectstack): files 不再列 src —— 43 个源码文件(38 个测试)退出发布物 (#4847) #4852,fields[fields]files去src(#4851 的 fields 半)—— 先实测 dist map 形态,同形则照 #4847 机械删,异形停手 #4856 / PR chore(fields): files 不再列 src —— 173 个源码文件(97 个测试)退出发布物 (#4856) #4861), and keeping one per-package exception costs a permanently maintained caveat in thecheck-phantom-dependencies.mjsheader — every special case is a sentence someone maintains forever. - Option (c)
inlineSourcesis refused: it saves nothing and adds a third emitter shape.
Implementation notes for dispatch:
- ⛔ Never remove
srcfromfileswhile published maps still point at it — the one forbidden state (broken-link maps) stays excluded; the order is: flipdeclarationMapoff (and confirm no other map emission), clean-rebuild, verifydisthas zero.map/sourceMappingURL/../srcreferences, then trimfilesper finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847's four-point checklist with a pack-list before/after comparison. - The
check-phantom-dependencies.mjsheader paragraph updates in the same PR (the last of the three examples retires). - Serial note: PR chore(fields): files 不再列 src —— 173 个源码文件(97 个测试)退出发布物 (#4856) #4861 ([fields]
files去src(#4851 的 fields 半)—— 先实测 dist map 形态,同形则照 #4847 机械删,异形停手 #4856, fields half, draft) may touch the same script header — serialize behind it or rebase after it lands.
Label flipped
needs-user-decision→pm:queuein the same stroke.
Generated by Claude Code
Claim: PM loop round 1
Session:session_01DbRmJD3iPhXjKr6vhd4Qkv
Branch:claude/issue-4851-types-dist-only
Worktree:objectui-issue-4851
Domain:repo:objectui
File surface:packages/types/tsconfig.json+packages/types/package.json(filesarray) + thescripts/check-phantom-dependencies.mjsheader paragraph (stop on breach; explain in the report)
Container & model: S mechanical,mode:subagent,model: sonnet
Serial constraints cleared: the fields half (#4856 / PR #4861) is no longer in the open-PR list — its script-header serial note resolves by branching from current main (dev verifies the header's current text before editing); in-flight #4003 / #4884 / #4308 are disjoint; no open dev PR touchespackages/types(checked this round).
Generated by Claude Code
- added a commit that references this issue
on Aug 17, 2026 <!-- os-dev-report -->
{ "issue": 4851, "status": "done", "branch": "claude/issue-4851-types-dist-only", "pr": "https://github.com/objectstack-ai/objectui/pull/4897", "premise_still_valid": true, "summary": "Implemented the @object-ui/types half of the src-in-files finding per the maintainer's option (b) ruling: flipped declarationMap:false in packages/types/tsconfig.json, clean-rebuilt, verified dist has zero .map/.sourceMappingURL/../src references (positive control against the pre-flip build showed 54 of each), then trimmed files to dist-only (matching #4847's shape). Updated the check-phantom-dependencies.mjs header to retire the last of the three originally-recorded packages. npm pack: 203 -> 112 entries, 91 src files leave, dist unchanged.", "tests": "HEAD 903f47f. pnpm exec vitest run --root . scripts/__tests__/package-files-exist.test.ts: 18/18 passed. pnpm exec vitest run packages/types/ --maxWorkers=2: 36 files / 428 tests passed. node scripts/check-phantom-dependencies.mjs: pass (re-run at HEAD). cd packages/types && npm run type-check (tsc --noEmit + tsconfig.examples.json + tsconfig.test.json): clean. node scripts/check-control-bytes.mjs: pass. node scripts/check-package-self-import.mjs: pass. node scripts/check-changeset-presence.mjs / check-changeset-no-major.mjs: pass (re-run at HEAD). node scripts/check-published-dist-tooling.mjs: not run locally (costs a full monorepo build per objectui#4846, not implicated by this diff, deferred to CI). Positive control: pre-flip clean build showed 54 .d.ts.map files / 54 sourceMappingURL hits / 54 ../src references; post-flip clean build showed 0/0/0.", "open_questions": [], "out_of_scope_findings": ["filed as #4896: @object-ui/types exports[\".\"].require points at dist/index.cjs, which its bare-tsc build never emits (confirmed pre-existing on main, scope note that ~22 other packages declare the same require condition but were not individually verified)"] }
Generated by Claude Code
Generated by Claude Code
os-dev-report (correction — the previous comment's marker was HTML-escaped by a mistake on my part and did not survive as literal text; this comment supersedes it as the canonical report)
{ "issue": 4851, "status": "done", "branch": "claude/issue-4851-types-dist-only", "pr": "https://github.com/objectstack-ai/objectui/pull/4897", "premise_still_valid": true, "summary": "Implemented the @object-ui/types half of the src-in-files finding per the maintainer's option (b) ruling: flipped declarationMap:false in packages/types/tsconfig.json, clean-rebuilt, verified dist has zero .map/.sourceMappingURL/../src references (positive control against the pre-flip build showed 54 of each), then trimmed files to dist-only (matching #4847's shape). Updated the check-phantom-dependencies.mjs header to retire the last of the three originally-recorded packages. npm pack: 203 -> 112 entries, 91 src files leave, dist unchanged.", "tests": "HEAD 903f47f. pnpm exec vitest run --root . scripts/__tests__/package-files-exist.test.ts: 18/18 passed. pnpm exec vitest run packages/types/ --maxWorkers=2: 36 files / 428 tests passed. node scripts/check-phantom-dependencies.mjs: pass (re-run at HEAD). cd packages/types && npm run type-check (tsc --noEmit + tsconfig.examples.json + tsconfig.test.json): clean. node scripts/check-control-bytes.mjs: pass. node scripts/check-package-self-import.mjs: pass. node scripts/check-changeset-presence.mjs / check-changeset-no-major.mjs: pass (re-run at HEAD). node scripts/check-published-dist-tooling.mjs: not run locally (costs a full monorepo build per objectui#4846, not implicated by this diff, deferred to CI). Positive control: pre-flip clean build showed 54 .d.ts.map files / 54 sourceMappingURL hits / 54 ../src references; post-flip clean build showed 0/0/0.", "open_questions": [], "out_of_scope_findings": ["filed as #4896: @object-ui/types exports[\".\"].require points at dist/index.cjs, which its bare-tsc build never emits (confirmed pre-existing on main, scope note that ~22 other packages declare the same require condition but were not individually verified)"] }
Generated by Claude Code
Generated by Claude Code
ACCEPT — PR #4897 (reviewer of record: PM session
session_01DbRmJD3iPhXjKr6vhd4Qkv; all readings taken on GitHub at head903f47f, not from the report).- Shape: draft →
main, first lineFixes #4851— correct: the fields half already closed via [fields]files去src(#4851 的 fields 半)—— 先实测 dist map 形态,同形则照 #4847 机械删,异形停手 #4856/PR chore(fields): files 不再列 src —— 173 个源码文件(97 个测试)退出发布物 (#4856) #4861, so this types half completes the card and the merge should close it. No closure keywords next to other open card numbers. - Scope (from changed files, 4):
packages/types/tsconfig.json(declarationMap flip),packages/types/package.json(filestrim to the finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847 shape),scripts/check-phantom-dependencies.mjs(header paragraph — the last of the three recorded examples retires), and a real-frontmatter patch changeset for@object-ui/types(correct: published artifact contents change; not a tests-only diff). Exactly the claimed file surface; nocontent/docs/releases/, no ADR/skills paths (normal landing path applies); in-flight siblings' files untouched. - Ruling compliance: the mandated order was followed — emission off first, clean rebuild, zero-map verification, only then the
filestrim. The zero claims carry a positive control (pre-flip baseline: 54.d.ts.map/ 54sourceMappingURL/ 54../src; post-flip: 0/0/0), and the pack-list before/after (203 → 112 entries, 91srcfiles leave,distpayload unchanged) is in the PR body. One premise correction, properly documented rather than glossed: the card saidtsconfig.base.jsonsuppliessourceMap: true, butpackages/typesextends the repo-roottsconfig.json(verified viatsc --showConfig), so the build only ever emitted.d.ts.map— the correction narrows the risk, doesn't change the ruling. - Gates at head
903f47f: Changeset Declaration ✅ · Bump Policy ✅ · Fixed Group ✅ · Control Byte Scan ✅ · Build & E2E ✅ · Build Docs ✅ · Skill Guide Path Check ✅; Lint / Type Check / Test shards 1–4 in progress at review time. Ready-flip + auto-merge happens only after those six reportsuccessat this head — a pointed check is armed. - Out-of-scope finding, graded: finding: @object-ui/types exports["."].require points at dist/index.cjs, which its bare-tsc build never emits #4896 (
exports["."].require→dist/index.cjsthat a bare-tscbuild never emits; confirmed pre-existing onorigin/main; 22 sibling packages flagged unverified, scoped honestly). Correctly filed unassigned as observation-class; first-touch grading belongs to the triage seat.
Generated by Claude Code
- Shape: draft →
Maintainer ruling (2026-08-17, recorded by PM session
session_01NYgmGheCzM6NrHZN436Cxf). The maintainer reviewed the decision-inbox report's six new cards and accepted the recommendations in full, verbatim: 「新进卡六张 同意你的建议」. For this card:Ruled, two halves:
@object-ui/fields— measure first (clean rebuild; does dist carry.maps, and where do theirsourcespoint), then if the shape matchesdata-objectstack(no maps, or maps carrying their own content), the mechanical finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847 treatment: dropsrcfromfiles, with the pack-list before/after comparison.@object-ui/types— disabledeclarationMapand dropsrcfromfiles. The go-to-source degradation to.d.tsis the accepted cost: shipping the whole source tree (tests included) in every tarball for a niche editor nicety fails the scope-discipline test, and a dangling map (src removed,declarationMapkept) is the one forbidden end-state.inlineSourcesis rejected (buys no size).
- The
check-phantom-dependencies.mjsheader prose updates in the same batch (third revision, as the card predicted). - Mechanism note: the tarball-contents criterion is watched going forward by the finding: 「已发布 dist 不得含 tooling 产物」今天没有任何门看得见 —— 判据必须是产物级的,而 CI 没有全仓 build #4846-ruled release-gate artifact check — no per-PR full build.
First-touch grading completes: label flipped
needs-user-decision→pm:queuein the same stroke.
Generated by Claude Code
- added a commit that references this issue
on Aug 17, 2026
发现来源
objectui#4847(
@object-ui/data-objectstack的files去src,PR #4852)实施时,按该卡「修法 3」的要求量全仓得到的旁证。#4847 只修了它自己点名的那个包,余下两例单独记在这里 —— 理由不是「懒得一起修」,而是测量表明它们不是同一个判定(见下)。事实(实测,非推断)
发布包(
private未设)里files含整棵src树的,共 3 个,#4847 修掉其中一个:files@object-ui/data-objectstack→["dist","src",…]["dist","README.md","CHANGELOG.md","LICENSE"]tsup@object-ui/fields["dist","src","README.md","CHANGELOG.md","LICENSE"]tsc && vite build && node scripts/build-css.mjs@object-ui/types["dist","src","README.md","LICENSE","CHANGELOG.md"]tscsrc承重(
@object-ui/app-shell的files里是src/styles.css—— 精确文件而非整棵树,是另一种形态,不在此列。)为什么这两例不能照 #4847 的做法机械删掉
#4847 的四项前置核查里,第 ④ 项(sourcemap 是否落在
src上)在data-objectstack上是否定的 —— 它的tsup.config.ts写着sourcemap: false,bundled dts 也不产.d.ts.map,干净重建后的dist里.map为 0、sourceMappingURL与../src各 0 处。所以那次删除是安全的。@object-ui/types上同一项命中:packages/types/tsconfig.json显式"declarationMap": true,build是裸tsc;tsconfig.base.json另给了"sourceMap": true,且全仓没有inlineSources;packages/types/dist/ai.d.ts.map:sources为["../src/ai.ts"],sourcesContent为false。也就是说它随包发布的 declaration map / sourcemap 按路径指回
../src/*.ts且不自带内容。把src从files拿掉,这些 map 就指向 tarball 里不存在的文件,消费者编辑器的 go-to-source 会从「跳进真源码」退化成「跳进.d.ts」。这是一个真实但很小的消费者,不是垃圾 —— 按 #4847 派发时那条「别把活入口当垃圾删」的纪律,它需要一次取舍(要么保留src,要么关掉declarationMap/改用inlineSources,要么接受退化),不是一行删除。@object-ui/fields的 emitter 是第三种(vite-plugin-dts),它的 dts 是否产.d.ts.map、产的 map 指哪里,得单独干净重建后实测,本卡没有量。为什么值得记(以及为什么仍是 observation-class)
exports映射都只指dist(fields另有./style.css→./dist/index.css;types有 11 个子路径条目,全部指dist),没人 resolve 得到src里的测试。成本是 tarball 体积与发布面噪音。fields上已经被记过两次仍未处理:@object-ui/fields 与 plugin-editor 的 build 程序把测试文件一起编译,73 个 *.test.d.ts 落进已发布的 dist/ #4006 正文的那句旁证(「@object-ui/fields的files本来就含src,测试源码已经在发布内容里了」),以及 @object-ui/fields 与 plugin-editor 的 build 程序把测试文件一起编译,73 个 *.test.d.ts 落进已发布的 dist/ #4006 的第二条评论里那张三包表格。@object-ui/fields 与 plugin-editor 的 build 程序把测试文件一起编译,73 个 *.test.d.ts 落进已发布的 dist/ #4006 的 PR 范围被明确裁到*.test.d.ts那一半(见其派发评论的 5 条),所以这一半从未被处理 —— 这是它今天仍然存在的记录在案的原因,不是遗漏。scripts/check-phantom-dependencies.mjs的表头依赖这个事实来说明它的判据边界(「not resolved」而非「not present in the tarball」)。PR chore(data-objectstack): files 不再列 src —— 43 个源码文件(38 个测试)退出发布物 (#4847) #4852 已把那段更新为「data-objectstack已退出,fields/types仍在,且types那处承重」;这两例一旦处理,那段还要再改一次。可能的修法(未裁,留给实施者)
@object-ui/fields:先干净重建实测dist里有没有.map、map 的sources指哪里;若与data-objectstack同形(无 map 或 map 自带内容),则照 finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847 机械删src+ pack 清单前后对照。@object-ui/types:先裁「发布的 declaration map 要不要能跳回源码」。保留src是一个正当选项(那 map 就是它的消费者);想瘦身则应在产出侧动(关declarationMap,或开inlineSources把源码塞进 map —— 后者并不省体积),而不是留下断链的 map。files的内容:finding: @object-ui/data-objectstack 的 files 含 src,38 个测试源码文件随包发布 #4847 的反向验证实测到,把src加回去之后check-phantom-dependencies/check-control-bytes/check-package-self-import/scripts/__tests__/package-files-exist.test.ts全部保持绿。机制化的判据是产物级的(「已发布 tarball 不得含TOOLING_FILE」),其成本与 finding: 「已发布 dist 不得含 tooling 产物」今天没有任何门看得见 —— 判据必须是产物级的,而 CI 没有全仓 build #4846 / PR chore(build): 四个包的 dist 不再发布 tooling 产物 —— 排除判据从文件名对齐到目录约定 (#4836) #4845 记的是同一笔:今天 CI 没有任何 job 做全仓 build。关联:#4847 / PR #4852(同族,已修其一)、#4006(最早记录这一半,已关闭,PR #4539 只修 dist 那一半)、#4836 / PR #4845(另一个入口)、#4846(判据机制化的成本测量)。observation-class,未认领。