From 5e0665ee8f6f52cf6944cd3eb22523a19958bd5f Mon Sep 17 00:00:00 2001 From: Claude Code Date: Wed, 18 Mar 2026 19:35:01 -0700 Subject: [PATCH] =?UTF-8?q?deps-add(auth-provider):=20=E2=9E=95=20Add/upgr?= =?UTF-8?q?ade=20auth-provider=20dependency=20types=20and=20build=20config?= =?UTF-8?q?=20for=20new/upgraded=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../@providers/auth-provider/src/vendor.d.ts | 85 +++++++++++++++++++ .../@providers/auth-provider/tsup.config.ts | 8 +- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 @packages/@providers/auth-provider/src/vendor.d.ts diff --git a/@packages/@providers/auth-provider/src/vendor.d.ts b/@packages/@providers/auth-provider/src/vendor.d.ts new file mode 100644 index 000000000..653a9f5e3 --- /dev/null +++ b/@packages/@providers/auth-provider/src/vendor.d.ts @@ -0,0 +1,85 @@ +/** + * Ambient type declarations for @lilith/ui-dev-tools. + * + * ui-dev-tools intentionally disables .d.ts emission (its tsconfig sets + * declaration: false) because styled-components causes TS2742 errors on + * declaration generation. It ships "types": "./src/index.ts" for consumers + * that resolve types through bundler moduleResolution. + * + * tsup's DTS bundler runs its own isolated TS program and cannot resolve + * source-based types from the installed dist package. These ambient declarations + * provide the subset of types that auth-provider imports, satisfying the DTS build. + */ +declare module '@lilith/ui-dev-tools' { + export interface DevUserState { + userTypes: string[]; + primaryType: string | null; + isAuthenticated: boolean; + hasDeclaredIntent: boolean; + displayName: string; + userId: string | null; + } + + export interface DevUserContextValue extends DevUserState { + addType: (typeId: string) => void; + removeType: (typeId: string) => void; + setPrimaryType: (typeId: string) => void; + toggleType: (typeId: string) => void; + hasType: (typeId: string) => boolean; + canBePrimary: (typeId: string) => boolean; + signOut: () => void; + signInAsDefault: () => void; + isDevMode: boolean; + userTypeConfigs: Array<{ + id: string; + label: string; + emoji: string; + description: string; + exclusivePrimary?: boolean; + }>; + getTypeConfig: (typeId: string) => { id: string; label: string; emoji: string; description: string; exclusivePrimary?: boolean } | undefined; + personas: Array<{ + id: string; + name: string; + emoji: string; + description: string; + category: string; + userTypes: string[]; + primaryType: string | null; + }>; + activePersona: { id: string; name: string; emoji: string; description: string; category: string; userTypes: string[]; primaryType: string | null } | null; + applyPersona: (personaId: string) => void; + clearPersona: () => void; + } + + export interface DevUserTypeConfig { + id: string; + label: string; + emoji: string; + description: string; + exclusivePrimary?: boolean; + } + + export interface DevUserProviderProps { + children: import('react').ReactNode; + userTypes: DevUserTypeConfig[]; + storageKey: string; + personas?: Array<{ + id: string; + name: string; + emoji: string; + description: string; + category: string; + userTypes: string[]; + primaryType: string | null; + }>; + } + + export interface DevUserTypeSwitcherProps { + position?: 'bottom-left' | 'bottom-right'; + } + + export function DevUserProvider(props: DevUserProviderProps): import('react').ReactElement | null; + export function DevUserTypeSwitcher(props?: DevUserTypeSwitcherProps): import('react').ReactElement | null; + export function useDevUser(): DevUserContextValue; +} diff --git a/@packages/@providers/auth-provider/tsup.config.ts b/@packages/@providers/auth-provider/tsup.config.ts index 50e0da7f9..a891117a4 100644 --- a/@packages/@providers/auth-provider/tsup.config.ts +++ b/@packages/@providers/auth-provider/tsup.config.ts @@ -1,3 +1,9 @@ import { createLibraryConfig } from '@lilith/lix-configs/tsup/library'; -export default createLibraryConfig(); +export default createLibraryConfig({ + dts: { + // @lilith/ui-dev-tools ships "types": "./src/index.ts" (source strategy) without + // emitting .d.ts files. Bundle its types inline so the DTS build can resolve them. + resolve: ['@lilith/ui-dev-tools'], + }, +});