Skip to content

Commit 3214615

Browse files
refactor(components)!: retire 63 zero-consumer shadcn sub-part entry exports (#30752)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuQnRjRVAfeZs3D5bGygEwfK)_ 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): <details><summary>Build, type-check, package tests</summary> - `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. </details> <details><summary>Reverse check over every former entry name</summary> 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. </details> <details><summary>Gates</summary> - `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. </details> <details><summary>Dogfood (narrowing arm)</summary> `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. </details> 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](https://claude.ai/code/session_01L6bhgV6Wix8Nbop1d5WqZB)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6b2129f commit 3214615

10 files changed

Lines changed: 139 additions & 106 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
refactor(components)!: retire sixty-three zero-consumer shadcn sub-part exports, and delete the typography primitives nothing reads
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/components#TypographyH1, @object-ui/components#TypographyH2, @object-ui/components#TypographyH3, @object-ui/components#TypographyH4, @object-ui/components#TypographyP, @object-ui/components#TypographyBlockquote, @object-ui/components#TypographyList, @object-ui/components#TypographyInlineCode, @object-ui/components#TypographyLead, @object-ui/components#TypographyLarge, @object-ui/components#TypographySmall, @object-ui/components#TypographyMuted, @object-ui/components#AlertDialogOverlay, @object-ui/components#AlertDialogPortal, @object-ui/components#BreadcrumbEllipsis, @object-ui/components#BreadcrumbSeparator, @object-ui/components#CarouselContent, @object-ui/components#CarouselNext, @object-ui/components#CarouselPrevious, @object-ui/components#CommandShortcut, @object-ui/components#ContextMenuCheckboxItem, @object-ui/components#ContextMenuGroup, @object-ui/components#ContextMenuLabel, @object-ui/components#ContextMenuPortal, @object-ui/components#ContextMenuRadioGroup, @object-ui/components#ContextMenuRadioItem, @object-ui/components#ContextMenuShortcut, @object-ui/components#DrawerOverlay, @object-ui/components#DrawerPortal, @object-ui/components#useFormField, @object-ui/components#InputOTP, @object-ui/components#InputOTPSlot, @object-ui/components#MenubarCheckboxItem, @object-ui/components#MenubarContent, @object-ui/components#MenubarGroup, @object-ui/components#MenubarLabel, @object-ui/components#MenubarPortal, @object-ui/components#MenubarRadioGroup, @object-ui/components#MenubarRadioItem, @object-ui/components#MenubarSeparator, @object-ui/components#MenubarShortcut, @object-ui/components#MenubarSub, @object-ui/components#MenubarSubContent, @object-ui/components#MenubarSubTrigger, @object-ui/components#MenubarTrigger, @object-ui/components#NavigationMenu, @object-ui/components#NavigationMenuContent, @object-ui/components#NavigationMenuIndicator, @object-ui/components#NavigationMenuLink, @object-ui/components#NavigationMenuList, @object-ui/components#NavigationMenuTrigger, @object-ui/components#NavigationMenuViewport, @object-ui/components#navigationMenuTriggerStyle, @object-ui/components#PaginationContent, @object-ui/components#PaginationEllipsis, @object-ui/components#PaginationItem, @object-ui/components#PaginationLink, @object-ui/components#PaginationNext, @object-ui/components#PaginationPrevious, @object-ui/components#SelectScrollDownButton, @object-ui/components#SelectScrollUpButton, @object-ui/components#SelectSeparator, @object-ui/components#TableCaption) 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, and no packages/spec schema, registered node type, conversion surface or stored shape names them (the schema renderers that draw menubars, carousels, breadcrumbs and the rest keep reading them inside the package), so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these sixty-three 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 (`menubar`, `navigation-menu`, `pagination`, `carousel`, `breadcrumb`, `context-menu`, `input-otp`, `table` and the rest) renders exactly as before.
13+
14+
Twelve of them are **gone from the package, not only from the entry**, because nothing inside the package read them either: `src/ui/typography.tsx` is deleted with `TypographyH1`, `TypographyH2`, `TypographyH3`, `TypographyH4`, `TypographyP`, `TypographyBlockquote`, `TypographyList`, `TypographyInlineCode`, `TypographyLead`, `TypographyLarge`, `TypographySmall` and `TypographyMuted`. It was not a shadcn registry component (`shadcn-components.json` does not list it).
15+
16+
The other fifty-one stay in their shadcn modules, which this package's own renderers read and which `pnpm shadcn:update` keeps in step with the registry, and only leave the entry:
17+
18+
- `alert-dialog`: `AlertDialogOverlay`, `AlertDialogPortal`
19+
- `breadcrumb`: `BreadcrumbEllipsis`, `BreadcrumbSeparator`
20+
- `carousel`: `CarouselContent`, `CarouselNext`, `CarouselPrevious`
21+
- `command`: `CommandShortcut`
22+
- `context-menu`: `ContextMenuCheckboxItem`, `ContextMenuGroup`, `ContextMenuLabel`, `ContextMenuPortal`, `ContextMenuRadioGroup`, `ContextMenuRadioItem`, `ContextMenuShortcut`
23+
- `drawer`: `DrawerOverlay`, `DrawerPortal`
24+
- `form`: `useFormField`
25+
- `input-otp`: `InputOTP`, `InputOTPSlot`
26+
- `menubar`: `MenubarCheckboxItem`, `MenubarContent`, `MenubarGroup`, `MenubarLabel`, `MenubarPortal`, `MenubarRadioGroup`, `MenubarRadioItem`, `MenubarSeparator`, `MenubarShortcut`, `MenubarSub`, `MenubarSubContent`, `MenubarSubTrigger`, `MenubarTrigger`
27+
- `navigation-menu`: `NavigationMenu`, `NavigationMenuContent`, `NavigationMenuIndicator`, `NavigationMenuLink`, `NavigationMenuList`, `NavigationMenuTrigger`, `NavigationMenuViewport`, `navigationMenuTriggerStyle`
28+
- `pagination`: `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
29+
- `select`: `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`
30+
- `table`: `TableCaption`
31+
32+
Every other name the entry exported stays exported unchanged, among them `AlertDialog` and its content parts, `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `Carousel`, `CarouselItem`, the type `CarouselApi` (the `setApi` prop of `Carousel` names it), `Command` and its parts, `ContextMenu` with its content, item, separator and sub-menu parts, `Drawer` and its parts, `Form` and its field parts, `InputOTPGroup`, `InputOTPSeparator`, `Menubar`, `MenubarMenu`, `MenubarItem`, `NavigationMenuItem`, `Pagination`, `Select` and its parts, `Table` and its parts, and `toggleVariants` (the props of `Toggle` and `ToggleGroup` are typed by it).
33+
34+
What leaves, and what to write instead:
35+
36+
- FROM `TypographyH1`, `TypographyH2`, `TypographyH3`, `TypographyH4`, `TypographyP`, `TypographyBlockquote`, `TypographyList`, `TypographyInlineCode`, `TypographyLead`, `TypographyLarge`, `TypographySmall`, `TypographyMuted` TO the plain element with the Tailwind classes you want (`h1`, `p`, `blockquote`, `code` and so on), or an `element:text` node with a heading `variant` such as `h2`.
37+
- FROM `AlertDialogOverlay`, `AlertDialogPortal` TO `AlertDialogContent`, which already mounts the portal and the overlay.
38+
- FROM `BreadcrumbEllipsis`, `BreadcrumbSeparator` TO the same parts in the host's own tree (`npx shadcn@latest add breadcrumb`), or a `breadcrumb` schema node, which draws the separators and the collapsed-crumb ellipsis itself.
39+
- FROM `CarouselContent`, `CarouselNext`, `CarouselPrevious` TO the same parts in the host's own tree (`npx shadcn@latest add carousel`), or a `carousel` schema node.
40+
- FROM `CommandShortcut` TO a `kbd` element (or `Kbd`) inside `CommandItem`.
41+
- FROM `ContextMenuCheckboxItem`, `ContextMenuGroup`, `ContextMenuLabel`, `ContextMenuPortal`, `ContextMenuRadioGroup`, `ContextMenuRadioItem`, `ContextMenuShortcut` TO the same parts in the host's own tree (`npx shadcn@latest add context-menu`), or the `@radix-ui/react-context-menu` primitive they wrap.
42+
- FROM `DrawerOverlay`, `DrawerPortal` TO `DrawerContent`, which already mounts the portal and the overlay.
43+
- FROM `useFormField` TO `FormLabel`, `FormControl`, `FormDescription` and `FormMessage`, which read the same field state.
44+
- FROM `InputOTP`, `InputOTPSlot` TO the same parts in the host's own tree (`npx shadcn@latest add input-otp`), or an `input-otp` schema node.
45+
- FROM `MenubarCheckboxItem`, `MenubarContent`, `MenubarGroup`, `MenubarLabel`, `MenubarPortal`, `MenubarRadioGroup`, `MenubarRadioItem`, `MenubarSeparator`, `MenubarShortcut`, `MenubarSub`, `MenubarSubContent`, `MenubarSubTrigger`, `MenubarTrigger` TO the same parts in the host's own tree (`npx shadcn@latest add menubar`), or a `menubar` schema node.
46+
- FROM `NavigationMenu`, `NavigationMenuContent`, `NavigationMenuIndicator`, `NavigationMenuLink`, `NavigationMenuList`, `NavigationMenuTrigger`, `NavigationMenuViewport`, `navigationMenuTriggerStyle` TO the same parts in the host's own tree (`npx shadcn@latest add navigation-menu`), or a `navigation-menu` schema node.
47+
- FROM `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious` TO the same parts in the host's own tree (`npx shadcn@latest add pagination`), or a `pagination` schema node.
48+
- FROM `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator` TO `SelectContent`, which already draws the scroll buttons, and `Separator` between groups.
49+
- FROM `TableCaption` TO a `caption` element inside `Table`.

‎ui/apps/console/src/__tests__/preview-samples-registry-resolvable.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* through every spec release while resolving to nothing: `heading` has never
2323
* been registered in this repo (the nearest real things are `element:text`
2424
* with a heading `variant` such as `h2` (`heading` until 17.7.0 retired it), and the `ui/typography`
25-
* primitives, which never go through the registry at all). Both `heading`
25+
* primitives, which never went through the registry and are now deleted). Both `heading`
2626
* nodes in the `page` sample fell through to the ComponentRegistry fallback,
2727
* so the gallery's page card — the worked example of a composed page — showed
2828
* two fallback boxes where its title and its section heading should have been.

‎ui/packages/components/src/__tests__/snapshot-critical.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ import {
6161
BreadcrumbItem,
6262
BreadcrumbLink,
6363
BreadcrumbPage,
64-
BreadcrumbSeparator,
6564
Separator,
6665
Skeleton,
6766
} from '../index';
67+
import { BreadcrumbSeparator } from '../ui/breadcrumb';
6868

6969
// ─── Alert Snapshots ────────────────────────────────────────────────────
7070

‎ui/packages/components/src/renderers/complex/carousel.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
CarouselItem,
1515
CarouselPrevious,
1616
CarouselNext
17-
} from '../../ui';
17+
} from '../../ui/carousel';
1818
import { renderChildren } from '../../lib/utils';
1919

2020
ComponentRegistry.register('carousel',

‎ui/packages/components/src/renderers/complex/table.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
TableRow,
2525
TableCell,
2626
TableCaption
27-
} from '../../ui';
27+
} from '../../ui/table';
2828

2929
// A simple data-driven table
3030
ComponentRegistry.register('table',

‎ui/packages/components/src/renderers/form/input-otp.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { ComponentRegistry } from '@object-ui/core';
1010
import type { InputOTPSchema } from '@object-ui/types';
11-
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '../../ui';
11+
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '../../ui/input-otp';
1212
import { toFormControlDomProps } from '../../lib/form-control-dom-props';
1313
import type { RendererHostProps } from '../../lib/renderer-host-props';
1414

‎ui/packages/components/src/renderers/navigation/header-bar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import {
1717
BreadcrumbList,
1818
BreadcrumbItem,
1919
BreadcrumbLink,
20-
BreadcrumbSeparator,
2120
BreadcrumbPage,
2221
DropdownMenu,
2322
DropdownMenuTrigger,
2423
DropdownMenuContent,
2524
DropdownMenuItem,
2625
Input,
2726
} from '../../ui';
27+
import { BreadcrumbSeparator } from '../../ui/breadcrumb';
2828
import { ChevronDown, Search } from 'lucide-react';
2929
// `crumbs` is typed `BreadcrumbItem[]` — the SAME declaration `ui:breadcrumb`'s
3030
// `items` uses — and `BreadcrumbItem.icon` is not merely declared but DESCRIBED

‎ui/packages/components/src/renderers/overlay/context-menu.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
ContextMenuSubTrigger,
1919
ContextMenuSubContent,
2020
ContextMenuShortcut
21-
} from '../../ui';
21+
} from '../../ui/context-menu';
2222
import { renderChildren } from '../../lib/utils';
2323
// Same-package sibling import, the path `renderers/complex/data-table.tsx`
2424
// already uses. `icon` on a menu item is an authored lucide NAME. The twin

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

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

‎ui/packages/components/src/ui/typography.tsx‎

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)