Skip to content

Commit 85d9264

Browse files
refactor(components)!: retire ten zero-consumer shadcn sub-part entry exports (#31318)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XLrM5uzVJrXqe52zucmt8q9)_ Part of #25921 Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none (none of the ten names appears under `skills/**` or `content/docs/**`) ## 维护者速读 - 改了什么:`@object-ui/components` 的根入口不再导出 10 个 shadcn 子部件(`DialogPortal`、`DialogOverlay`、`DialogClose`、`DropdownMenuPortal`、`SheetPortal`、`SheetClose`、`SidebarSeparator`、`SidebarGroupAction`、`SidebarMenuBadge`、`SidebarMenuSkeleton`);这是 #25921 的第 14 批,形状同第 6 批 #30752。 - 为什么改:两个仓库里没有任何代码从包入口引用它们;包外仅有的同名文字是上游 shadcn registry 快照(各自声明自己的副本)和一处说 Radix 原语的注释。 - 风险与回滚:shadcn 模块文件一个字节不动,包内 `MobileDialogContent` 照常直接从 `../ui/dialog` 读两个部件;外部 npm 宿主若从入口 import 这些名字会编译失败(未实测,changeset 写了 BREAKING 与替代写法)。`!` patch,回滚即 revert 本 PR。 - 先看:`ui/packages/components/src/ui/index.ts`(四处 `export *` 改具名列表)、`.changeset/25921-components-shadcn-subparts.md`。 - 两分钟验证:`node scripts/check-adr-0087-registration.mjs --base origin/main`,预期十个名字都 `verified … (export, ui/packages/components/src/ui/…)`、退出 0。 - 需要你做的:无,席位落地。 ## What changes Batch 14 as named in the seat's amendment 6714859776 on claim 6714776657 (census `/mnt/project-files/pm-orders/ui/25921-b14-census.md`, `origin/main` `7c523aa1`, hotcrm `6961ab13`). - **`ui/packages/components/src/ui/index.ts`** (the unpublished sub-barrel that `src/index.ts` star-exports): the `export *` lines for `./dialog`, `./dropdown-menu`, `./sheet` and `./sidebar` become named lists without the ten names. The four shadcn module files are unchanged (No-Touch, ui AGENTS #7); no module is deleted. - **Changeset** `.changeset/25921-components-shadcn-subparts.md`: `!` patch, BREAKING, FROM/TO for each name, `runtime-export-retired` ×10 (FROM spans 1:1), both declaration lines. Every other name of the four modules stays exported, among them `DialogContent`, `SheetOverlay`, `SheetContent`, every other `DropdownMenu*` part, `SidebarMenuAction`, `useSidebar` and `useOptionalSidebar`. `DrawerClose` stays too (seat ruling in 6714859776). ## Tests - Census per name (`git grep -lw` on `origin/main` outside `ui/packages/components`): every hit is in `ui/scripts/__tests__/fixtures/shadcn-registry/{dialog,dropdown-menu,sheet,sidebar}.registry.txt`, the upstream snapshots that declare their own copies. `DialogPortal` also hits a comment in `ui/e2e/console-boot-indicator.spec.ts` that names Radix's own part. hotcrm 0 for all ten. Positive controls, same command (files): `DialogContent` 67, `SheetContent` 29, `DropdownMenuItem` 87, `SidebarMenuButton` 14. - In-package readers: only `src/custom/mobile-dialog-content.tsx` reads `DialogPortal` and `DialogOverlay`, and it imports them from `../ui/dialog`, not through the sub-barrel. - Reverse probe of the entry (TypeScript checker export list of `src/index.ts`): 364 names before, 354 after; exactly these ten gone, none added. Built `dist/index.js` imported at runtime: none of the ten is a key; the controls `DialogContent`, `SheetContent`, `DropdownMenuItem`, `SidebarMenuButton` and `DrawerClose` are. - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/` → Test Files 477 passed | 1 skipped (478), Tests 4573 passed | 24 skipped. `pnpm --filter @object-ui/components run type-check` → exit 0. - No test was added or removed, and there is no ablation: this only stops re-exporting ten names and changes no tested behaviour. ## Acceptance notes - Left on the card: `DrawerClose` (its outside hits are JSX text in an eslint rule comment and its RuleTester fixture; seat ruling 6714859776), `MobileDialogContentProps` (a `custom/` Props type with zero hits, not the shadcn family), and the census's other notes (plugin-timeline primitives and fields' `index.tsx` values need a module move; react's `LazyPluginLoader` trio is taught by name in `content/docs/frontend/*` and `skills/objectui/guides/page-builder.md`). ## Verification <details><summary>Derived gates on HEAD 254394d (30/30, all exit 0, --ran reconciled)</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran` → "30 derived famil(ies) accounted for — 30 run, 0 NOT-MEASURED". - `node scripts/check-adr-0087-registration.mjs --base origin/main` exit 0: all ten `verified … (export, ui/packages/components/src/ui/…)`; `--self-test` exit 0 - `node scripts/check-changeset-no-major.mjs --base origin/main` exit 0 - `node scripts/check-empty-changeset.mjs --base origin/main` exit 0; `--self-test` exit 0 - `node scripts/check-closing-keyword-parity.mjs` exit 0; `--self-test` exit 0 - `node scripts/check-comment-mask-corpus.mjs`, `check-sdui-manifest.mjs` (+ `--self-test`), `ci/snapshot-next.mjs --self-test`, `pm/release-rehearsal-clone.mjs --self-test`, `release-pending-publish.mjs --self-test`: exit 0 - `pnpm --dir ui exec vitest run scripts/` → Test Files 170 passed | 2 skipped (172), Tests 4996 passed - `pnpm --filter @objectstack/spec run check:duration-unit-keys`, `pnpm check:changeset-gate-self-tests`, `check:closed-ceremony-text`, `check:dispatcher-error-vocabulary`, `check:driver-memory-census`, `check:gitlink-declared`, `check:nul-bytes`, `check:published-files`, `check:refd-timer-probe`, `check:registry-log-declared`, `check:rest-log-spy-declared`, `check:skill-identifier-liveness`, `check:test-source-alias`, `check:tier-file-adoption`, `check:undeclared-dep-imports`, `check:watch-hint-literal`: exit 0 Outside the derivation: `pnpm check:changeset-fixed` exit 0; `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0 (no anchored file); `pnpm check:published-readme-exports` exit 3, NOT MEASURED (31 unrelated packages unbuilt locally; CI runs it). </details> <details><summary>Full dogfood battery on HEAD 254394d</summary> `bash scripts/pm/os-verify-lock.sh -c "pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test"` → `os-verify-lock: VERDICT command-exit 0` (held 33m38s) · Test Files 435 passed | 3 skipped (438) · Tests 3610 passed | 41 skipped (3651) · no failure. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5mTpxApu2S7hHNSreS)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5mTpxApu2S7hHNSreS Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2f05a46 commit 85d9264

2 files changed

Lines changed: 88 additions & 4 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
refactor(components)!: retire ten zero-consumer shadcn sub-part exports (dialog, dropdown-menu, sheet and sidebar parts)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/components#DialogPortal, @object-ui/components#DialogOverlay, @object-ui/components#DialogClose, @object-ui/components#DropdownMenuPortal, @object-ui/components#SheetPortal, @object-ui/components#SheetClose, @object-ui/components#SidebarSeparator, @object-ui/components#SidebarGroupAction, @object-ui/components#SidebarMenuBadge, @object-ui/components#SidebarMenuSkeleton) the retired operands are React UI primitives of the components package; nothing in the workspace or in hotcrm imports any of them from the package entry (the only other spellings are the upstream shadcn registry snapshots under `ui/scripts/__tests__/fixtures/shadcn-registry/`, which declare their own copies, and a comment naming Radix's own portal part), and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these ten names from `@object-ui/components`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected, and every schema node type (`dialog`, `sheet`, `dropdown-menu`, `sidebar` and the rest) renders exactly as before.
13+
14+
All ten stay in their shadcn modules, which `pnpm shadcn:update` keeps in step with the registry and which this package's own code still reads (`MobileDialogContent` mounts `DialogPortal` and `DialogOverlay`); only the entry stops publishing them:
15+
16+
- `dialog`: `DialogPortal`, `DialogOverlay`, `DialogClose`
17+
- `dropdown-menu`: `DropdownMenuPortal`
18+
- `sheet`: `SheetPortal`, `SheetClose`
19+
- `sidebar`: `SidebarSeparator`, `SidebarGroupAction`, `SidebarMenuBadge`, `SidebarMenuSkeleton`
20+
21+
Every other name the entry exported stays exported unchanged, among them `Dialog`, `DialogTrigger`, `DialogContent` and its header, footer, title and description parts, `DropdownMenu` with its trigger, content, item, group, label, separator, shortcut, radio, checkbox and sub-menu parts, `Sheet` with `SheetOverlay`, `SheetTrigger`, `SheetContent` and its header, footer, title and description parts, and `Sidebar`, `SidebarProvider`, `useSidebar`, `useOptionalSidebar` with every other sidebar part.
22+
23+
What leaves, and what to write instead:
24+
25+
- FROM `DialogPortal`, `DialogOverlay` TO `DialogContent`, which already mounts the portal and the overlay.
26+
- FROM `DialogClose` TO the close button `DialogContent` already draws, or the `Close` part of `@radix-ui/react-dialog` for a custom one.
27+
- FROM `DropdownMenuPortal` TO `DropdownMenuContent`, which already mounts its own portal; for a sub-menu, the `Portal` part of `@radix-ui/react-dropdown-menu` around `DropdownMenuSubContent`.
28+
- FROM `SheetPortal` TO `SheetContent`, which already mounts the portal and the overlay.
29+
- FROM `SheetClose` TO the close button `SheetContent` already draws, or the `Close` part of `@radix-ui/react-dialog` for a custom one.
30+
- FROM `SidebarSeparator`, `SidebarGroupAction`, `SidebarMenuBadge`, `SidebarMenuSkeleton` TO the same parts in the host's own tree (`npx shadcn@latest add sidebar`), or `Separator`, `SidebarMenuAction` and `Skeleton`, which stay exported.

‎ui/packages/components/src/ui/index.ts‎

Lines changed: 58 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)