Skip to content

refactor(components)!: retire 63 zero-consumer shadcn sub-part entry exports - #30752

Queued
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-xqm2dn
Queued

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-xqm2dn

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #25921. The umbrella stays open; this is barrel batch 6, claim 6672518852 (seat domain:ui#6). Earlier batches: #30541, #30576, #30629, #30650, #30708.

Clause-②: no (narrowing)
Metadata-protocol: none

维护者速读

  • 改了什么:@object-ui/components 的包入口不再导出 63 个 shadcn 子部件。其中 typography.tsx 的 12 个 Typography* 包内也无人读,连文件删除;其余 51 个只离开入口,留在各自的 shadcn 模块里供本包渲染器使用。
  • 为什么改:这 63 个名字在仓内(包外,含测试与文档)与 hotcrm 均零引用,README 未教,也不被保留导出的签名用到。本卡逐包收窄无人使用的公开导出。
  • 风险与回滚:对外是 breaking 收窄,只影响直接从包入口 import 这些名字的外部宿主;控制台、所有 @object-ui/* 包和所有 schema 节点类型(menubar、pagination、carousel 等)照常渲染。src/ui/index.ts 的 13 行 export * 改成具名列表,反向探针证明其余 408 个入口名一个不少。回滚即 revert 本 PR。
  • 先看:ui/packages/components/src/ui/index.ts(具名列表,漏列即丢活名)、5 个渲染器的 import 改指模块文件、.changeset/25921-components-zero-consumer-exports.md(迁移说明)。
  • 两分钟验证:git grep -l -w -e TypographyH1 -e MenubarContent -e PaginationLink -- ':!ui/packages/components' ':!**/CHANGELOG.md' 应只命中本 PR 的 changeset。
  • 需要你做的:无,席位落地。

What changes

  • @object-ui/components, deleted (nothing inside the package read them, tests included): src/ui/typography.tsx with TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyP, TypographyBlockquote, TypographyList, TypographyInlineCode, TypographyLead, TypographyLarge, TypographySmall, TypographyMuted. The file is not in shadcn-components.json, so no registry sync restores it.
  • @object-ui/components, off the entry only (the shadcn module files are untouched, so pnpm shadcn:update stays a clean re-fetch): 51 sub-parts of alert-dialog (2), breadcrumb (2), carousel (3), command (1), context-menu (7), drawer (2), form (1, useFormField), input-otp (2), menubar (13), navigation-menu (8), pagination (6), select (3), table (1). Names per module are in the changeset. Those thirteen export * lines in src/ui/index.ts (an unpublished sub-barrel; exports has only . and ./style.css) become named lists of the kept parts.
  • Kept by keep rule 3 although zero outside hits: type CarouselApi (the kept Carousel's setApi prop names it) and toggleVariants (the kept Toggle / ToggleGroup props are typed as VariantProps of typeof toggleVariants). export * from './toggle' therefore stays as is.
  • In-package readers that took a retired part through the ../../ui barrel now import it from its module file: renderers/complex/carousel.tsx, renderers/complex/table.tsx, renderers/form/input-otp.tsx, renderers/overlay/context-menu.tsx, renderers/navigation/header-bar.tsx (BreadcrumbSeparator only); and one test, __tests__/snapshot-critical.test.tsx, which imported BreadcrumbSeparator from the package entry.
  • One prose line in ui/apps/console/src/__tests__/preview-samples-registry-resolvable.test.ts named the ui/typography primitives as existing; it now says they are deleted.
  • One new changeset, .changeset/25921-components-zero-consumer-exports.md: patch level, ! title, BREAKING paragraph that separates the deleted names from the off-entry ones, FROM/TO lines for every retired name, ADR-0087 marker not-required (runtime-export-retired …) naming all 63 operands.

Why

Card #25921 narrows ui/packages barrels to names someone imports. The checker export list after this PR is exactly the census list minus these 63 (471 to 408), nothing added.

Tests

Census on origin/main ab44ec9 with the method of batches 1 to 5: entry export names from the TypeScript checker (getExportsOfModule on src/index.ts, 471); per name git grep -l -w -F outside the package, minus **/CHANGELOG.md, pnpm-lock.yaml and .changeset/** (test files and prose count); the package *.md, docs/ and *.json; keep rule 3; hotcrm 6961ab1 (0 hits for all 65; hotcrm does not import @object-ui/components at all, control Select 8 files). Full per-name table with same-module controls: project file issue-25921-seat6/census-b6.md.

Package Entry names Zero outside hits Of those under src/ui/ (this batch) Kept (rule 3) Retired
@object-ui/components 471 150 (147 after README) 65 2 63

The other 82 zero-hit names (under custom/, notifications/, hooks/, renderers/, lib/, dev/, share/, mostly Props types of kept components) are left for a later batch.

Controls (outside hits, same module as the retired names): Select 458, Command 215, Table 180, AlertDialog 58, Drawer 51, Breadcrumb 13, ContextMenu 4, Carousel 3; Form 326 with FormField 142.

Readings at 7b1fe21 (branch head; origin/main has since moved 8 commits, none touching ui/packages/components, and a re-grep of the 63 names on that origin/main outside the package still answers 0 files):

Build, type-check, package tests
  • pnpm --filter '@object-ui/components...' build (the package and its dependency closure): VERDICT command-exit 0 under os-verify-lock; components rebuilt after the edit.
  • pnpm --filter @object-ui/components type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 0.
  • pnpm --filter @object-ui/components test: Test Files 477 passed, 1 skipped (478); Tests 4565 passed, 24 skipped (4589); VERDICT command-exit 0.
Reverse check over every former entry name

A temporary probe under ui/packages/plugin-view/src importing ALL 471 base entry names of @object-ui/components (as import type), tsc --noEmit -p in ui/packages/plugin-view against the rebuilt dist/index.d.ts: exactly 63 errors in the probe (TS2305 / TS2724), and the set of names they name is identical (diff empty) to the 63 retired names; the other 408 resolve. The run's 3 other errors are unbuilt sibling packages imported by ObjectView.tsx (plugin-grid, plugin-form, permissions), outside the probe. Probe deleted; git status clean.

Gates
  • node scripts/pm/dispatch-gates.mjs --commands: 37 derived families, each run with its exit code captured before any pipe, all exit 0 on the final head. Two needed a second run: check-adr-0087-registration --base origin/main was red on the first commit (the grouped shadcn FROM line named no operand), fixed by the second commit and green on 7b1fe21 with all 63 operands verified; check:type-check-debt first answered PREREQUISITE NOT MET (exit 3, the closure build did not get the lock while dogfood held it) and was re-run under the lock: OK, 0 ledger entries re-measured, 0 raw tsc errors.
  • dispatch-gates --ran: 37 derived, 37 run, 0 NOT-MEASURED (a derived zero: all 37 recorded an exit code, none 3).
  • node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0, 0 anchored files in the change set.
Dogfood (narrowing arm)

pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test under os-verify-lock on 7b1fe21: VERDICT command-exit 0; Test Files 421 passed, 3 skipped (424); Tests 3513 passed, 36 skipped (3549); no failures.

No ablation: export lines, import paths and one deleted file nothing read.

Acceptance notes

  • Family heads kept by the mechanical rule: Menubar, MenubarMenu, MenubarItem, NavigationMenuItem, InputOTPGroup, InputOTPSeparator, Carousel, CarouselItem (with CarouselApi), Pagination. Their outside hits are homonyms (same-named interfaces in @object-ui/types, schema-catalog titles, test prose about the schema renderers), none an import from this package. After this batch they cannot build their primitive from the entry alone. Left as is because the claim counts prose; the seat may rule them into a later batch.
  • No shadcn module file is edited, so names with no reader even inside their own module (for example MenubarCheckboxItem) are off the entry but still in the file: deleting them would diverge the file from the registry copy pnpm shadcn:update re-fetches.

Verification

Reviewer: git grep -l -w -e TypographyH1 -e MenubarContent -e PaginationLink -- ':!ui/packages/components' ':!**/CHANGELOG.md' answers only this PR's changeset; the CI Type Check UI lane compiles every @object-ui/* consumer against the narrowed entry.


Generated by Claude Code

…exports

The package entry re-exported every shadcn primitive with `export *`.
Sixty-three sub-parts have no importer outside the package (workspace,
docs and hotcrm), are not taught in the package README, and no kept
export's signature names them. Thirteen `export *` lines in
`src/ui/index.ts` become named lists of their kept parts; the renderers
that read a retired part import it from its module file instead.

`src/ui/typography.tsx` had no reader inside the package either and is
deleted (12 names). It is not a shadcn registry component.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgV6Wix8Nbop1d5WqZB
The ADR-0087 runtime-export-retired marker reads each operand's FROM
side; the grouped shadcn line named none.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgV6Wix8Nbop1d5WqZB
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 6, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2

维护者速读

席位核对 — ACCEPT · head 7b1fe21

  • 形态:10 文件 +139/−106(子 barrel、删 typography.tsx、5 个渲染器与 2 个测试改从模块引、一份 changeset)。check-governed-merges --pr 30752:NOT governed,245 行 ≤ 3000。Part of #25921,draft,目标 main,merge-tree 对 main 干净。批次与认领 6672518852 及其批次修订一致。
  • 契约(收窄,契约复核档):Clause-② no (narrowing),Metadata-protocol none。席位在 head 上独立复核:从 changeset 的 ADR-0087 标记取出全部 63 个退役名,在 origin/main 上对 ui/packages/components 之外(排除 CHANGELOG 与 .changeset,散文计入)逐名 git grep -w,全部 0 个文件;12 个 Typography* 在分支 ui/ 下除 changeset 外 0 处;包 README 不提这 63 个名字。具名列表由 dev 的反向探针兜底:探针覆盖全部 471 个旧入口名,恰好 63 个报错,名单与退役集一致,其余 408 个都能解析。保留项:CarouselApi(Carousel 的 setApi 用它)、toggleVariants(Toggle / ToggleGroup 的 props 用它),以及包外命中全是同名异物的族首(Menubar、MenubarMenu、MenubarItem、NavigationMenuItem、InputOTPGroup、InputOTPSeparator、Carousel、CarouselItem、Pagination),按认领的散文计入规则本批不动。changeset 带 ! 标题、BREAKING 段、FROM/TO 与 runtime-export-retired 的 ADR-0087 标记。收窄没有未列明的使用方,席位接受。
  • 前提实测:dev 报告 6673431557,读数都在 7b1fe21 上:components 闭包构建 VERDICT 0,type-check exit 0,components 测试 477 个文件全过(1 跳过),派生门禁 37/37 exit 0,dogfood 424 个文件中 421 过、3 跳过。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped,0 红。
  • 接受的偏差:① 子 barrel 改具名列表后,这些 shadcn 模块以后新增的导出不会再自动进入入口,这是有意收紧;pnpm shadcn:update 照常重拉模块文件。② 族首保留,导致这些族在入口上只剩半套,宿主无法只靠入口拼出 menubar 等原语;这正是下一批要处理的。
  • 范围外去向:同名异物的族首由席位裁定 B,留给下一批,条件是普查逐条给出每处命中解析到的另一个声明,Pagination 除外;custom/、notifications/、hooks/、renderers/、lib/ 下另有 82 个零命中名,以及子路径入口(等 check-adr-0087(runtime-export-retired): the operand names only a package's root entry, so a retired SUBPATH export (./locales/zh → ./locales/zh-Hans) can only be held as no-migration-prescription #30598),都留在 retire the zero-consumer surface: nine dead modules (2,211 LOC), plugin-ai, runner's publish flag, test-only reset helpers on public barrels, the providers trio, 122 dead i18n keys, root orphans #25921。落地时写进 Release,卡回 pm:queue。
  • 落地条款:中继 pr_ready + automerge_enable。合并后卡不关(Part of),席位一并摘掉 pm:dispatched、换回 pm:queue、取消指派,并留 Release 评论。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 6, 2026 00:59
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 6, 2026 00:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 6, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant