Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/25921-auth-zero-consumer-exports.md
Original file line number Diff line number Diff line change
@@ -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

<!-- adr-0087: not-required (runtime-export-retired @object-ui/auth#TURNSTILE_SCRIPT_URL, @object-ui/auth#normalizePhoneIdentifier, @object-ui/auth#looksLikePhoneIdentifier, @object-ui/auth#AuthenticatedAdapterOptions, @object-ui/auth#ORG_ROLES, @object-ui/auth#AUTH_INVITATION_STATUSES, @object-ui/auth#isAuthInvitationStatus, @object-ui/auth#AUTH_FIELD_LABEL_CLASS, @object-ui/auth#AUTH_INPUT_CLASS, @object-ui/auth#AuthCheckIcon, @object-ui/auth#AuthDivider, @object-ui/auth#AuthMailIcon) the retired operands are a script URL constant, two sign-in identifier helpers, an options interface, two closed vocabulary lists with one narrowing guard, two class-name strings and three presentational components; 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, so there is nothing for `objectstack migrate meta` to rewrite -->

**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.
25 changes: 25 additions & 0 deletions .changeset/25921-plugin-detail-zero-consumer-exports.md
Original file line number Diff line number Diff line change
@@ -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

<!-- adr-0087: not-required (runtime-export-retired @object-ui/plugin-detail#queueClaimAdmitted, @object-ui/plugin-detail#extractLookupId, @object-ui/plugin-detail#TEXTUAL_REF_FALLBACK_TYPES, @object-ui/plugin-detail#inferDetailColumns, @object-ui/plugin-detail#applyAutoSpan, @object-ui/plugin-detail#applyDetailAutoLayout, @object-ui/plugin-detail#DetailTabsProps, @object-ui/plugin-detail#buildDefaultDiscussion, @object-ui/plugin-detail#buildDefaultTimeline, @object-ui/plugin-detail#deriveStages, @object-ui/plugin-detail#RECORD_PAGE_WIDE_MIN_WIDTH, @object-ui/plugin-detail#recordPageColumnOfTab, @object-ui/plugin-detail#RecordPageColumn, @object-ui/plugin-detail#useDefaultRecordPage, @object-ui/plugin-detail#relatedCountTargetOf, @object-ui/plugin-detail#filterTimelineStream, @object-ui/plugin-detail#RELATED_CARD_NEW_BADGE_MS, @object-ui/plugin-detail#editRelatedArrangement, @object-ui/plugin-detail#relatedCardId, @object-ui/plugin-detail#relatedDefaultOrderHash, @object-ui/plugin-detail#RelatedArrangementEdit) the retired operands are pure helpers of the synthesized record page, its layout and its related cards, one React context hook, and three TypeScript types; 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, so there is nothing for `objectstack migrate meta` to rewrite -->

**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.
23 changes: 6 additions & 17 deletions ui/packages/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -69,7 +67,6 @@ export {
ORG_ROLE_ADMIN,
ORG_ROLE_DELEGATED_ADMIN,
ORG_ROLE_MEMBER,
ORG_ROLES,
ORG_ROLE_LABELS,
orgRoleGrade,
invitableOrgRoles,
Expand All @@ -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';

Expand Down
23 changes: 5 additions & 18 deletions ui/packages/plugin-detail/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: <self> }` 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';
Expand All @@ -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.
Expand Down Expand Up @@ -187,10 +186,7 @@ export {
buildDefaultHighlights,
buildDefaultDetails,
buildDefaultTabs,
buildDefaultDiscussion,
buildDefaultTimeline,
detectStatusField,
deriveStages,
deriveHighlightFields,
deriveFieldGroupDetailSections,
resolveDetailSections,
Expand All @@ -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,
Expand All @@ -218,7 +212,6 @@ export {
export { relatedListEntryNames } from './synth/relatedListEntry';
export type {
RecordPageTier,
RecordPageColumn,
DefaultPageColumns,
} from './synth/recordPageColumns';
export { useRecordPageTier } from './useRecordPageTier';
Expand All @@ -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.
Expand All @@ -246,26 +239,20 @@ 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
// merge rule and the stored record's codec halves, for the host's
// 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';
Expand Down
Loading