From 79ddb13a6425fc57cd74ea763aac65faa8889529 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 18:00:08 +0000 Subject: [PATCH] refactor(auth,plugin-detail)!: retire 33 zero-consumer entry exports Barrel batch 3 of the zero-consumer sweep: @object-ui/auth stops exporting 12 names and @object-ui/plugin-detail 21, each with no importer outside its package (workspace and hotcrm), not taught in the package README, and not reached by a kept export's signature. Every module stays; only the entry lines change. One `!` patch changeset per package names each retired operand. Claude-Session: https://claude.ai/code/session_01L6bhgT8zkQTEh2HjcmxipS Co-authored-by: Claude --- .../25921-auth-zero-consumer-exports.md | 21 ++++++++++++++++ ...921-plugin-detail-zero-consumer-exports.md | 25 +++++++++++++++++++ ui/packages/auth/src/index.ts | 23 +++++------------ ui/packages/plugin-detail/src/index.tsx | 23 ++++------------- 4 files changed, 57 insertions(+), 35 deletions(-) create mode 100644 .changeset/25921-auth-zero-consumer-exports.md create mode 100644 .changeset/25921-plugin-detail-zero-consumer-exports.md diff --git a/.changeset/25921-auth-zero-consumer-exports.md b/.changeset/25921-auth-zero-consumer-exports.md new file mode 100644 index 00000000000..b94a45754e5 --- /dev/null +++ b/.changeset/25921-auth-zero-consumer-exports.md @@ -0,0 +1,21 @@ +--- +'@object-ui/auth': patch +--- + +refactor(auth)!: retire twelve zero-consumer exports (the Turnstile script URL, the two phone-identifier helpers, the authenticated-fetch options type, the org-role list, the invitation-status list and guard, and five form primitives) + +Clause-②: no (narrowing) +Metadata-protocol: none + + + +**BREAKING** for a host that imports any of these twelve names from `@object-ui/auth`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Every module stays in the package: `TurnstileWidget` keeps loading its script, `LoginForm` keeps reading phone identifiers, `createAuthClient` keeps narrowing invitation statuses, `org-roles.ts` keeps building its pickers from the role list, and `LoginForm` / `RegisterForm` / `ForgotPasswordForm` keep drawing with the form primitives. Only the entry stops publishing them. `TurnstileWidget`, `createAuthenticatedFetch`, `ORG_ROLE_OWNER` / `ORG_ROLE_ADMIN` / `ORG_ROLE_DELEGATED_ADMIN` / `ORG_ROLE_MEMBER`, `ORG_ROLE_LABELS`, `orgRoleGrade`, `invitableOrgRoles`, `assignableOrgRoles`, the `OrgRole` and `AuthInvitationStatus` types, `AUTH_LINK_CLASS`, `AUTH_PRIMARY_BUTTON_CLASS`, `AuthAlertIcon`, `AuthErrorBanner`, `AuthFormHeader` and `AuthSpinner` stay exported unchanged. + +What leaves, and what to write instead: + +- FROM `TURNSTILE_SCRIPT_URL` TO `TurnstileWidget`, which loads the Cloudflare Turnstile script itself. +- FROM `normalizePhoneIdentifier`, `looksLikePhoneIdentifier` TO `LoginForm`, which accepts a phone number as the identifier and normalizes it; keep a local copy if your own sign-in form needs them. +- FROM `AuthenticatedAdapterOptions` TO a local interface: no function in the package takes it (`createAuthenticatedFetch` has its own options). +- FROM `ORG_ROLES` TO `invitableOrgRoles` / `assignableOrgRoles` for the roles a picker offers, or the four `ORG_ROLE_*` constants. +- FROM `AUTH_INVITATION_STATUSES`, `isAuthInvitationStatus` TO the `AuthInvitationStatus` type; `AuthInvitation.status` already arrives narrowed from `createAuthClient`. +- FROM `AUTH_FIELD_LABEL_CLASS`, `AUTH_INPUT_CLASS`, `AuthCheckIcon`, `AuthDivider`, `AuthMailIcon` TO no replacement: the built-in forms apply them themselves; copy the class strings or icons if a custom form needs the same look. diff --git a/.changeset/25921-plugin-detail-zero-consumer-exports.md b/.changeset/25921-plugin-detail-zero-consumer-exports.md new file mode 100644 index 00000000000..c912292a1ee --- /dev/null +++ b/.changeset/25921-plugin-detail-zero-consumer-exports.md @@ -0,0 +1,25 @@ +--- +'@object-ui/plugin-detail': patch +--- + +refactor(plugin-detail)!: retire twenty-one zero-consumer exports (record-page synthesis, layout, related-card and timeline helpers, one hook and three types) + +Clause-②: no (narrowing) +Metadata-protocol: none + + + +**BREAKING** for a host that imports any of these twenty-one names from `@object-ui/plugin-detail`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Every module stays in the package and keeps its in-package readers (the record page synthesizer, `DetailView`, `RecordPageColumns`, the related cards and the timeline stream); only the entry stops publishing them. Everything else on the entry, including `buildDefaultPageSchema`, `buildDefaultTabs`, `isWideFieldType`, `InlineFieldInput`, `recordSitsInQueue`, `DefaultRecordPageContext`, `prefetchRelatedCounts`, `relatedCountTargetsIn`, `mergeTimelineStream`, `resolveRelatedArrangement` and the `RelatedArrangement` / `RecordPageTier` / `DefaultPageColumns` types, stays exported unchanged. + +What leaves, and what to write instead: + +- FROM `buildDefaultDiscussion`, `buildDefaultTimeline`, `deriveStages` TO `buildDefaultPageSchema`, which builds the whole default record page including its discussion, timeline and stage path. +- FROM `RECORD_PAGE_WIDE_MIN_WIDTH`, `recordPageColumnOfTab`, `RecordPageColumn` TO `recordPageTierFor` and `buildDefaultPageColumns`, which place the page's tabs into columns for a width. +- FROM `inferDetailColumns`, `applyAutoSpan`, `applyDetailAutoLayout` TO `DetailView`, which lays out its sections itself; `isWideFieldType` stays. +- FROM `extractLookupId`, `TEXTUAL_REF_FALLBACK_TYPES` TO `InlineFieldInput`, which reads lookup values itself. +- FROM `queueClaimAdmitted` TO `useQueueClaimOffered`, which answers whether the Claim button shows. +- FROM `useDefaultRecordPage` TO `DefaultRecordPageContext` with `useContext`. +- FROM `relatedCountTargetOf` TO `relatedCountTargetsIn`. +- FROM `filterTimelineStream` TO `mergeTimelineStream`; the timeline panel applies its filter chips itself. +- FROM `RELATED_CARD_NEW_BADGE_MS`, `editRelatedArrangement`, `relatedCardId`, `relatedDefaultOrderHash`, `RelatedArrangementEdit` TO `resolveRelatedArrangement` with `relatedArrangementFromRecord` / `relatedArrangementToRecord`; the related cards edit and badge the arrangement themselves. +- FROM `DetailTabsProps` TO `DetailViewProps`: `DetailTabs` is not on the entry, `DetailView` renders it. diff --git a/ui/packages/auth/src/index.ts b/ui/packages/auth/src/index.ts index 05887449305..5cf4b2d52c0 100644 --- a/ui/packages/auth/src/index.ts +++ b/ui/packages/auth/src/index.ts @@ -39,7 +39,6 @@ export { LoginForm, type LoginFormProps, type LoginFormLabels } from './LoginFor export { RegisterForm, type RegisterFormProps, type RegisterFormLabels } from './RegisterForm.js'; export { TurnstileWidget, - TURNSTILE_SCRIPT_URL, type TurnstileWidgetProps, type TurnstileWidgetLabels, type TurnstileApi, @@ -49,8 +48,7 @@ export { SocialSignInButtons, type SocialSignInButtonsProps } from './SocialSign export { UserMenu, type UserMenuProps } from './UserMenu.js'; export { PreviewBanner, type PreviewBannerProps } from './PreviewBanner.js'; export { createAuthClient, TokenStorage } from './createAuthClient.js'; -export { normalizePhoneIdentifier, looksLikePhoneIdentifier } from './phone-identifier.js'; -export { createAuthenticatedFetch, ActiveOrganizationStorage, type AuthenticatedAdapterOptions } from './createAuthenticatedFetch.js'; +export { createAuthenticatedFetch, ActiveOrganizationStorage } from './createAuthenticatedFetch.js'; // objectui#10193 — "the browser changed hands in this page-load". The purge on a // change of session user clears storage; state already derived from it in // memory (the UI language, first of all) is re-derived by whoever owns it, and @@ -69,7 +67,6 @@ export { ORG_ROLE_ADMIN, ORG_ROLE_DELEGATED_ADMIN, ORG_ROLE_MEMBER, - ORG_ROLES, ORG_ROLE_LABELS, orgRoleGrade, invitableOrgRoles, @@ -78,28 +75,20 @@ export { } from './org-roles.js'; // Invitation lifecycle vocabulary — a CLOSED set of four, bound to better-auth's -// own `InvitationStatus` so it cannot drift, plus the narrowing guard the wire -// boundary uses. Exported because a screen switching on `AuthInvitation.status` -// needs the union by name (objectui#3879). -export { - AUTH_INVITATION_STATUSES, - isAuthInvitationStatus, - type AuthInvitationStatus, -} from './invitation-status.js'; +// own `InvitationStatus` so it cannot drift. Only the union is exported, because +// a screen switching on `AuthInvitation.status` needs it by name +// (objectui#3879); the status list and the narrowing guard the wire boundary +// uses stay in `invitation-status.ts`. +export type { AuthInvitationStatus } from './invitation-status.js'; // Shared auth form primitives — exposed so consumers can build custom forms // that match the look of LoginForm / RegisterForm / ForgotPasswordForm. export { - AUTH_FIELD_LABEL_CLASS, - AUTH_INPUT_CLASS, AUTH_LINK_CLASS, AUTH_PRIMARY_BUTTON_CLASS, AuthAlertIcon, - AuthCheckIcon, - AuthDivider, AuthErrorBanner, AuthFormHeader, - AuthMailIcon, AuthSpinner, } from './authStyles.js'; diff --git a/ui/packages/plugin-detail/src/index.tsx b/ui/packages/plugin-detail/src/index.tsx index 00ab02bc625..cfaf573b843 100644 --- a/ui/packages/plugin-detail/src/index.tsx +++ b/ui/packages/plugin-detail/src/index.tsx @@ -131,15 +131,15 @@ export type { RecordOperation } from './useRecordEditable'; // The Claim affordance on a record sitting in an ownership queue (objectstack // ADR-0142 D4): the server's `queue_claim` answer decides the button, the // claim is `{ owner_id: }` through the normal update. -export { recordSitsInQueue, queueClaimAdmitted, useQueueClaimOffered, claimQueuedRecord, seedQueueClaimDecision } from './queueClaim'; +export { recordSitsInQueue, useQueueClaimOffered, claimQueuedRecord, seedQueueClaimDecision } from './queueClaim'; export type { QueueClaimOutcome, ClaimWriter } from './queueClaim'; export { SectionGroup } from './SectionGroup'; export { HeaderHighlight } from './HeaderHighlight'; -export { InlineFieldInput, extractLookupId, TEXTUAL_REF_FALLBACK_TYPES } from './InlineFieldInput'; +export { InlineFieldInput } from './InlineFieldInput'; export type { InlineFieldInputProps } from './InlineFieldInput'; export { InlineEditSaveBar } from './InlineEditSaveBar'; export type { InlineEditSaveBarProps } from './InlineEditSaveBar'; -export { inferDetailColumns, isWideFieldType, applyAutoSpan, applyDetailAutoLayout } from './autoLayout'; +export { isWideFieldType } from './autoLayout'; export { useDetailTranslation, DETAIL_DEFAULT_TRANSLATIONS, createSafeTranslationHook } from './useDetailTranslation'; export { RecordComments } from './RecordComments'; export { ActivityTimeline } from './ActivityTimeline'; @@ -156,7 +156,6 @@ export { RecordMetaFooter } from './RecordMetaFooter'; export type { RecordMetaFooterProps } from './RecordMetaFooter'; export type { DetailViewProps } from './DetailView'; export type { DetailSectionProps, VirtualScrollOptions } from './DetailSection'; -export type { DetailTabsProps } from './DetailTabs'; export type { RelatedListProps } from './RelatedList'; // objectstack#27627 — the order a related list's row read asks, for the record // page's payload to ask a compact card's first rows in. @@ -187,10 +186,7 @@ export { buildDefaultHighlights, buildDefaultDetails, buildDefaultTabs, - buildDefaultDiscussion, - buildDefaultTimeline, detectStatusField, - deriveStages, deriveHighlightFields, deriveFieldGroupDetailSections, resolveDetailSections, @@ -205,11 +201,9 @@ export type { // out by its width: the tier a container takes, the page partitioned into its // details and panels, and the layout. export { - RECORD_PAGE_WIDE_MIN_WIDTH, RECORD_PAGE_TWO_COLUMN_MIN_WIDTH, recordPageTierFor, recordPageTierHasRightColumn, - recordPageColumnOfTab, buildDefaultPageColumns, bodyTableIdsOf, RECORD_PAGE_TIMELINE_PANEL, @@ -218,7 +212,6 @@ export { export { relatedListEntryNames } from './synth/relatedListEntry'; export type { RecordPageTier, - RecordPageColumn, DefaultPageColumns, } from './synth/recordPageColumns'; export { useRecordPageTier } from './useRecordPageTier'; @@ -227,11 +220,11 @@ export { RecordPageColumns } from './RecordPageColumns'; export type { RecordPageColumnsProps } from './RecordPageColumns'; // objectstack#27055 — the record page v3 face: a host drawing the // synthesized default page in its tabbed tier marks it, as the column tiers do. -export { DefaultRecordPageContext, useDefaultRecordPage } from './defaultRecordPage'; +export { DefaultRecordPageContext } from './defaultRecordPage'; export { RecordBodyTablesContext } from './relatedListCompact'; // objectstack#27056 — for the app-shell record drawer's prefetch: it warms // the next record's related counts before the reader steps to it. -export { prefetchRelatedCounts, relatedCountTargetsIn, relatedCountTargetOf } from './useRelatedCounts'; +export { prefetchRelatedCounts, relatedCountTargetsIn } from './useRelatedCounts'; export type { RelatedCountTarget, RelatedCountsSource } from './useRelatedCounts'; // objectstack#27055, Target 3 — the timeline as ONE stream: the host hands // the record's field changes over through this context. @@ -246,7 +239,6 @@ export { RECORD_TIMELINE_PANEL_MAX_ENTRIES, auditEntriesToFeedItems, mergeTimelineStream, - filterTimelineStream, } from './recordTimelineStream'; export type { AuditEntryLike, TimelineStreamFilter } from './recordTimelineStream'; // objectstack#27055 — the reader's arrangement of the related cards: the pure @@ -254,18 +246,13 @@ export type { AuditEntryLike, TimelineStreamFilter } from './recordTimelineStrea // workspace-preference store. export { EMPTY_RELATED_ARRANGEMENT, - RELATED_CARD_NEW_BADGE_MS, - editRelatedArrangement, RELATED_ARRANGEMENT_RECORD_VERSION, relatedArrangementFromRecord, relatedArrangementToRecord, - relatedCardId, - relatedDefaultOrderHash, resolveRelatedArrangement, } from './synth/relatedArrangement'; export type { RelatedArrangement, - RelatedArrangementEdit, RelatedCardId, ResolvedRelatedArrangement, } from './synth/relatedArrangement';