Skip to content

Commit 95bc382

Browse files
author
Frank
committed
docs sync
1 parent cbf16aa commit 95bc382

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

packages/openauth/src/ui/password.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export interface PasswordUIOptions {
158158
* Creates a UI for the Password provider flow.
159159
* @param input - Configure the UI.
160160
*/
161-
export function PasswordUI(input: PasswordUIOptions) {
161+
export function PasswordUI(input: PasswordUIOptions): PasswordConfig {
162162
const copy = {
163163
...DEFAULT_COPY,
164164
...input.copy,
@@ -384,5 +384,5 @@ export function PasswordUI(input: PasswordUIOptions) {
384384
},
385385
})
386386
},
387-
} satisfies PasswordConfig
387+
}
388388
}

www/astro.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export default defineConfig({
8989
items: [
9090
{ label: "Apple", slug: "docs/adapter/apple" },
9191
{ label: "Google", slug: "docs/adapter/google" },
92+
{ label: "Password", slug: "docs/adapter/password" },
9293
],
9394
},
9495
{
@@ -102,7 +103,11 @@ export default defineConfig({
102103
},
103104
{
104105
label: "Storage",
105-
items: ["docs/storage/memory", "docs/storage/dynamo", "docs/storage/cloudflare"],
106+
items: [
107+
"docs/storage/memory",
108+
"docs/storage/dynamo",
109+
"docs/storage/cloudflare",
110+
],
106111
},
107112
],
108113
}),

www/generate.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function renderInterfaces(module: TypeDoc.DeclarationReflection) {
338338
`**Type** ${renderSignatureAsType(m.signatures![0])}`,
339339
`</InlineSection>`,
340340
`</Section>`,
341-
renderComment(m.comment),
341+
renderComment(m.signatures![0].comment),
342342
`</Segment>`,
343343
]),
344344
]
@@ -434,7 +434,7 @@ function renderType(type: TypeDoc.SomeType): Text {
434434
type.type === "reflection" &&
435435
type.declaration.kind === TypeDoc.ReflectionKind.TypeLiteral
436436
) {
437-
return `<code class="primitive">object type</code>`
437+
return renderCallbackType(type)
438438
}
439439
return `<code class="primitive">${type.type}</code>`
440440

@@ -502,6 +502,10 @@ function renderType(type: TypeDoc.SomeType): Text {
502502
)}<code class="symbol">)[]</code>`
503503
: `${renderType(type.elementType)}<code class="symbol">[]</code>`
504504
}
505+
function renderCallbackType(type: TypeDoc.ReflectionType) {
506+
// return renderSignatureAsType(type.declaration.signatures![0])
507+
return `<code class="primitive">object type</code>`
508+
}
505509
function renderTypescriptType(type: TypeDoc.ReferenceType) {
506510
// ie. Record<string, string>
507511
return [
@@ -517,10 +521,20 @@ function renderType(type: TypeDoc.SomeType): Text {
517521

518522
if (type.reflection?.kind === TypeDoc.ReflectionKind.Class) {
519523
const r = type.reflection as TypeDoc.DeclarationReflection
520-
if (r.sources?.[0]?.fileName.endsWith("error.ts")) {
524+
if (r.sources?.[0]?.fileName.endsWith("error.ts"))
521525
return `[<code class="type">${r.name}</code>](/docs/authorizer#${r.name.toLowerCase()})`
526+
}
527+
528+
if (type.reflection?.kind === TypeDoc.ReflectionKind.Interface) {
529+
const r = type.reflection as TypeDoc.DeclarationReflection
530+
if (
531+
r.sources?.[0]?.fileName.startsWith("packages/openauth/src/adapter/")
532+
) {
533+
const adapter = r.sources?.[0]?.fileName.split("/").pop()?.split(".")[0]
534+
return `[<code class="type">${r.name}</code>](/docs/adapter/${adapter}#${r.name.toLowerCase()})`
522535
}
523536
}
537+
524538
return `[<code class="type">${type.name}</code>](#${type.name.toLowerCase()})`
525539
}
526540
}
@@ -643,6 +657,7 @@ async function build() {
643657
entryPoints: [
644658
"../packages/openauth/src/adapter/apple.ts",
645659
"../packages/openauth/src/adapter/google.ts",
660+
"../packages/openauth/src/adapter/password.ts",
646661
"../packages/openauth/src/session.ts",
647662
"../packages/openauth/src/ui/theme.ts",
648663
"../packages/openauth/src/ui/code.tsx",

0 commit comments

Comments
 (0)