Skip to content

Commit ea1dd1f

Browse files
authored
chore(repo): Add Typedoc (#4925)
1 parent 8b0b8b2 commit ea1dd1f

35 files changed

+242
-138
lines changed

.changeset/shiny-schools-search.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ package-lock.json
1717
**/integration/templates/**/*
1818
commitlint.config.ts
1919
vitest.workspace.mjs
20+
typedoc.config.mjs

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,5 @@ test-results
9494
scripts/.env
9595
!scripts/.env.example
9696

97-
97+
# typedoc
98+
.typedoc

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"test:integration:tanstack-start": "E2E_APP_ID=tanstack.start pnpm test:integration:base --grep @tanstack-start",
4545
"test:integration:vue": "E2E_APP_ID=vue.vite pnpm test:integration:base --grep @vue",
4646
"turbo:clean": "turbo daemon clean",
47+
"typedoc:generate": "typedoc --tsconfig tsconfig.typedoc.json",
4748
"version-packages": "changeset version && pnpm install --lockfile-only --engine-strict=false",
4849
"version-packages:canary": "./scripts/canary.mjs",
4950
"version-packages:snapshot": "./scripts/snapshot.mjs",
@@ -103,6 +104,7 @@
103104
"tsup": "catalog:repo",
104105
"turbo": "^2.0.14",
105106
"turbo-ignore": "^2.0.6",
107+
"typedoc": "0.27.6",
106108
"typescript": "catalog:repo",
107109
"verdaccio": "^5.26.3",
108110
"vitest": "3.0.2",

packages/astro/src/react/hooks.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ type UseAuth = () => UseAuthReturn;
121121
* For projects using a server, you can have immediate access to this data during SSR.
122122
*
123123
* @example
124-
* A simple example:
125-
*
126124
* function Hello() {
127125
* const { isSignedIn, sessionId, userId } = useAuth();
128126
* if(isSignedIn) {
@@ -132,9 +130,8 @@ type UseAuth = () => UseAuthReturn;
132130
* return <div>...</div>
133131
* }
134132
*
135-
* @example
136133
* This page will be fully rendered during SSR:
137-
*
134+
* @example
138135
* export HelloPage = () => {
139136
* const { isSignedIn, sessionId, userId } = useAuth();
140137
* console.log(isSignedIn, sessionId, userId)

packages/astro/src/stores/external.ts

-20
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import { $clerk, $csrState, $initialState } from './internal';
88
* A client side store that returns the loaded state of clerk-js.
99
*
1010
* @example
11-
* A simple example:
12-
*
1311
* $isLoadedStore.subscribe((authloaded => console.log(loaded))
1412
*/
1513
export const $isLoadedStore = computed([$csrState], state => state.isLoaded);
@@ -19,8 +17,6 @@ export const $isLoadedStore = computed([$csrState], state => state.isLoaded);
1917
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
2018
*
2119
* @example
22-
* A simple example:
23-
*
2420
* $authStore.subscribe((auth) => console.log(auth.userId))
2521
*/
2622
export const $authStore = batched([$csrState, $initialState], (state, initialState) => {
@@ -42,8 +38,6 @@ export const $authStore = batched([$csrState, $initialState], (state, initialSta
4238
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
4339
*
4440
* @example
45-
* A simple example:
46-
*
4741
* $userStore.subscribe((user) => console.log(user.id))
4842
*/
4943
export const $userStore = computed([$authStore], auth => auth.user);
@@ -54,8 +48,6 @@ export const $userStore = computed([$authStore], auth => auth.user);
5448
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
5549
*
5650
* @example
57-
* A simple example:
58-
*
5951
* $sessionStore.subscribe((session) => console.log(session.id))
6052
*/
6153
export const $sessionStore = computed([$authStore], auth => auth.session);
@@ -66,8 +58,6 @@ export const $sessionStore = computed([$authStore], auth => auth.session);
6658
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
6759
*
6860
* @example
69-
* A simple example:
70-
*
7161
* $organizationStore.subscribe((org) => console.log(org.id))
7262
*/
7363
export const $organizationStore = computed([$authStore], auth => auth.organization);
@@ -78,8 +68,6 @@ export const $organizationStore = computed([$authStore], auth => auth.organizati
7868
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
7969
*
8070
* @example
81-
* A simple example:
82-
*
8371
* $clientStore.subscribe((client) => console.log(client.activeSessions))
8472
*/
8573
export const $clientStore = computed([$csrState], csr => csr.client);
@@ -90,8 +78,6 @@ export const $clientStore = computed([$csrState], csr => csr.client);
9078
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
9179
*
9280
* @example
93-
* A simple example:
94-
*
9581
* $clerkStore.subscribe((clerk) => console.log(clerk.publishableKey))
9682
*/
9783
export const $clerkStore = computed([$clerk], clerk => clerk);
@@ -102,8 +88,6 @@ export const $clerkStore = computed([$clerk], clerk => clerk);
10288
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
10389
*
10490
* @example
105-
* A simple example:
106-
*
10791
* $sessionListStore.subscribe((sessionList) => sessionList.map((session) => console.log('Session id:', sessino.id) ))
10892
*/
10993
export const $sessionListStore = computed([$clientStore], client => client?.sessions);
@@ -114,8 +98,6 @@ export const $sessionListStore = computed([$clientStore], client => client?.sess
11498
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
11599
*
116100
* @example
117-
* A simple example:
118-
*
119101
* $signInStore.subscribe((signIn) => console.log(signIn.status))
120102
*/
121103
export const $signInStore = computed([$clientStore], client => client?.signIn);
@@ -126,8 +108,6 @@ export const $signInStore = computed([$clientStore], client => client?.signIn);
126108
* It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)
127109
*
128110
* @example
129-
* A simple example:
130-
*
131111
* $signUpStore.subscribe((signUp) => console.log(signUp.status))
132112
*/
133113
export const $signUpStore = computed([$clientStore], client => client?.signUp);

packages/backend/src/api/endpoints/InvitationApi.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,24 @@ type GetInvitationListParams = ClerkPaginationRequest<{
2020
* Filters invitations based on their status(accepted, pending, revoked).
2121
*
2222
* @example
23-
* get all revoked invitations
24-
*
23+
* Get all revoked invitations
24+
* ```ts
2525
* import { createClerkClient } from '@clerk/backend';
2626
* const clerkClient = createClerkClient(...)
2727
* await clerkClient.invitations.getInvitationList({ status: 'revoked' })
28-
*
28+
* ```
2929
*/
3030
status?: 'accepted' | 'pending' | 'revoked';
3131
/**
3232
* Filters invitations based on `email_address` or `id`.
3333
*
3434
* @example
35-
* get all invitations for a specific email address
35+
* Get all invitations for a specific email address
36+
* ```ts
3637
* import { createClerkClient } from '@clerk/backend';
3738
* const clerkClient = createClerkClient(...)
3839
* await clerkClient.invitations.getInvitationList({ query: 'user@example.com' })
39-
*
40+
* ```
4041
*/
4142
query?: string;
4243
}>;

packages/backend/src/tokens/authObjects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export type SignedInAuthObject = {
4040
* Each item represents the minutes that have passed since the last time a first or second factor were verified.
4141
* [fistFactorAge, secondFactorAge]
4242
*/
43-
factorVerificationAge: [number, number] | null;
43+
factorVerificationAge: [firstFactorAge: number, secondFactorAge: number] | null;
4444
getToken: ServerGetToken;
4545
has: CheckAuthorizationFromSessionClaims;
4646
debug: AuthObjectDebug;

packages/clerk-js/src/ui/customizables/makeCustomizable.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,27 @@ type Customizable<T = Record<never, never>> = T & {
1010
* elementDescriptor - An optional property that can be an `ElementDescriptor` or an array of `ElementDescriptor` or `undefined`. This property is used to describe the elements for styling purposes.
1111
*
1212
* @example
13+
* ```tsx
1314
* <Box
1415
* elementDescriptor={[descriptors.icon, descriptors.iconInitials]}
1516
* />
1617
*
1718
* // Output: `cl-icon cl-iconInitials`
19+
* ```
1820
*/
1921
elementDescriptor?: ElementDescriptor | Array<ElementDescriptor | undefined>;
2022
/**
2123
* elementId - An optional property that can be an `ElementId`. This property is used to set a unique identifier for the element.
2224
*
2325
* @example
26+
* ```tsx
2427
* <Box
2528
* elementDescriptor={[descriptors.icon, descriptors.iconInitials]}
2629
* elementId={descriptors.icon.setId(id)}
2730
* />
2831
*
2932
* // Output: `cl-icon cl-iconInitials cl-icon__google cl-iconInitials__google`
33+
* ```
3034
*/
3135
elementId?: ElementId;
3236
css?: never;

packages/clerk-js/src/utils/url.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ export const hasUrlInFragment = (_url: URL | string) => {
294294
* and also includes all search params from both places.
295295
*
296296
* @example
297-
* Input
298-
* https://accounts.clerk.com/sign-in?user_param=hello#/verify/factor-one?redirect_url=/protected
299-
* Return value:
300-
* https://accounts.clerk.com/sign-in/verify/factor-one?user_param=hello&redirect_url=/protected
297+
* ```ts
298+
* mergeFragmentIntoUrl('https://accounts.clerk.com/sign-in?user_param=hello#/verify/factor-one?redirect_url=/protected')
299+
* // Returns: 'https://accounts.clerk.com/sign-in/verify/factor-one?user_param=hello&redirect_url=/protected'
300+
* ```
301301
*/
302302
export const mergeFragmentIntoUrl = (_url: string | URL): URL => {
303303
const url = new URL(_url);

packages/elements/src/react/common/form/field-state.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const DISPLAY_NAME = 'ClerkElementsFieldState';
2121
* @param {Function} children - A function that receives `state`, `message`, and `codes` as an argument. `state` will is a union of `"success" | "error" | "idle" | "warning" | "info"`. `message` will be the corresponding message, e.g. error message. `codes` will be an array of keys that were used to generate the password validation messages. This prop is only available when the field is of type `password` and has `validatePassword` set to `true`.
2222
*
2323
* @example
24-
*
2524
* <Clerk.Field name="email">
2625
* <Clerk.Label>Email</Clerk.Label>
2726
* <Clerk.FieldState>

packages/expo/src/provider/ClerkProvider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export type ClerkProviderProps = React.ComponentProps<typeof ClerkReactProvider>
1717
/**
1818
* Note: Passkey support in Expo is currently in a limited rollout phase.
1919
* If you're interested in using this feature, please contact us for early access or additional details.
20-
*
21-
* @experimental This API is experimental and may change at any moment.
20+
* This API is experimental and may change at any moment.
21+
* @experimental
2222
*/
2323
__experimental_passkeys?: BuildClerkOptions['__experimental_passkeys'];
2424
/**

packages/expo/src/provider/singleton/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export type BuildClerkOptions = {
1919
/**
2020
* Note: Passkey support in Expo is currently in a limited rollout phase.
2121
* If you're interested in using this feature, please contact us for early access or additional details.
22-
*
23-
* @experimental This API is experimental and may change at any moment.
22+
* This API is experimental and may change at any moment.
23+
* @experimental
2424
*/
2525
__experimental_passkeys?: {
2626
get: ({

packages/nextjs/src/client-boundary/PromisifiedAuthProvider.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ export function PromisifiedAuthProvider({
3030
* simply by using the `ClerkProvider`.
3131
*
3232
* @example
33-
* A simple example:
34-
*
3533
* import { useAuth } from '@clerk/nextjs'
3634
*
3735
* function Hello() {
@@ -44,15 +42,17 @@ export function PromisifiedAuthProvider({
4442
* }
4543
*
4644
* @example
47-
* Basic example in a NextJs app. This page will be fully rendered during SSR:
45+
* This page will be fully rendered during SSR.
4846
*
47+
* ```tsx
4948
* import { useAuth } from '@clerk/nextjs'
5049
*
5150
* export HelloPage = () => {
5251
* const { isSignedIn, sessionId, userId } = useAuth();
5352
* console.log(isSignedIn, sessionId, userId)
5453
* return <div>...</div>
5554
* }
55+
* ```
5656
*/
5757
export function usePromisifiedAuth() {
5858
const isPagesRouter = useRouter();

packages/react/src/components/uiComponents.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ type UserButtonPropsWithoutCustomPages = Without<
7878
userProfileProps?: Pick<UserProfileProps, 'additionalOAuthScopes' | 'appearance'>;
7979
/**
8080
* Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.
81-
* @experimental This API is experimental and may change at any moment.
81+
* This API is experimental and may change at any moment.
82+
* @experimental
8283
* @default undefined
8384
*/
8485
__experimental_asProvider?: boolean;
@@ -107,7 +108,8 @@ type OrganizationSwitcherPropsWithoutCustomPages = Without<
107108
organizationProfileProps?: Pick<OrganizationProfileProps, 'appearance'>;
108109
/**
109110
* Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.
110-
* @experimental This API is experimental and may change at any moment.
111+
* This API is experimental and may change at any moment.
112+
* @experimental
111113
* @default undefined
112114
*/
113115
__experimental_asProvider?: boolean;

packages/react/src/hooks/useAuth.ts

-13
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ type UseAuth = (initialAuthState?: any) => UseAuthReturn;
2323
* simply by using the `ClerkProvider`.
2424
*
2525
* @example
26-
* A simple example:
27-
*
2826
* import { useAuth } from '@clerk/clerk-react'
2927
*
3028
* function Hello() {
@@ -35,17 +33,6 @@ type UseAuth = (initialAuthState?: any) => UseAuthReturn;
3533
* console.log(sessionId, userId)
3634
* return <div>...</div>
3735
* }
38-
*
39-
* @example
40-
* Basic example in a NextJs app. This page will be fully rendered during SSR:
41-
*
42-
* import { useAuth } from '@clerk/nextjs'
43-
*
44-
* export HelloPage = () => {
45-
* const { isSignedIn, sessionId, userId } = useAuth();
46-
* console.log(isSignedIn, sessionId, userId)
47-
* return <div>...</div>
48-
* }
4936
*/
5037
export const useAuth: UseAuth = (initialAuthState = {}) => {
5138
useAssertWrappedByClerkProvider('useAuth');

packages/shared/src/react/hooks/useSession.ts

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ type UseSession = () => UseSessionReturn;
1212
* safely access `isSignedIn` state and `session`.
1313
*
1414
* @example
15-
* A simple example:
16-
*
1715
* import { useSession } from '@clerk/clerk-react'
1816
*
1917
* function Hello() {

packages/shared/src/react/hooks/useUser.ts

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { useAssertWrappedByClerkProvider, useUserContext } from '../contexts';
1010
* safely access `isSignedIn` state and `user`.
1111
*
1212
* @example
13-
* A simple example:
14-
*
1513
* import { useUser } from '@clerk/clerk-react'
1614
*
1715
* function Hello() {

packages/types/src/clerk.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ export interface Clerk {
346346
/**
347347
* Prefetches the data displayed by an organization switcher.
348348
* It can be used when `mountOrganizationSwitcher({ asStandalone: true})`, to avoid unwanted loading states.
349-
* @experimantal This API is still under active development and may change at any moment.
349+
* This API is still under active development and may change at any moment.
350+
* @experimental
350351
* @param props Optional user verification configuration parameters.
351352
*/
352353
__experimental_prefetchOrganizationSwitcher: () => void;
@@ -1080,8 +1081,8 @@ export type UserProfileProps = RoutingOptions & {
10801081
*/
10811082
customPages?: CustomPage[];
10821083
/**
1083-
* @experimental
10841084
* Specify on which page the user profile modal will open.
1085+
* @experimental
10851086
**/
10861087
__experimental_startPath?: string;
10871088
};
@@ -1161,7 +1162,8 @@ export type UserButtonProps = UserButtonProfileMode & {
11611162
/**
11621163
* If true the `<UserButton />` will only render the popover.
11631164
* Enables developers to implement a custom dialog.
1164-
* @experimental This API is experimental and may change at any moment.
1165+
* This API is experimental and may change at any moment.
1166+
* @experimental
11651167
* @default undefined
11661168
*/
11671169
__experimental_asStandalone?: boolean | ((opened: boolean) => void);
@@ -1230,7 +1232,8 @@ export type OrganizationSwitcherProps = CreateOrganizationMode &
12301232
/**
12311233
* If true, `<OrganizationSwitcher />` will only render the popover.
12321234
* Enables developers to implement a custom dialog.
1233-
* @experimental This API is experimental and may change at any moment.
1235+
* This API is experimental and may change at any moment.
1236+
* @experimental
12341237
* @default undefined
12351238
*/
12361239
__experimental_asStandalone?: boolean | ((opened: boolean) => void);

0 commit comments

Comments
 (0)