Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 6 additions & 3 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ jobs:
check_broken_links:
name: Check Broken Links
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' }}
needs: [changes, preview]
if: ${{ needs.changes.outputs.docs == 'true' && needs.preview.outputs.preview-url != '' }}
steps:
- name: "Checkout files"
uses: actions/checkout@v3
Expand All @@ -119,8 +119,11 @@ jobs:
sudo mv lychee /usr/local/bin/
lychee --version

- name: Wait for preview deployment to stabilize
run: sleep 60

- name: Check for broken links
run: yarn docs:broken-links
run: yarn docs:broken-links --base-url "${{ needs.preview.outputs.preview-url }}"

lint:
name: Lint
Expand Down
14 changes: 0 additions & 14 deletions account-kit/wallet-client/src/exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,17 @@ export {
} from "@alchemy/wallet-api-types/rpc";

// client actions
export type * from "../client/actions/getCallsStatus.js";
export { getCallsStatus } from "../client/actions/getCallsStatus.js";
export type * from "../client/actions/grantPermissions.js";
export { grantPermissions } from "../client/actions/grantPermissions.js";
export type * from "../client/actions/listAccounts.js";
export { listAccounts } from "../client/actions/listAccounts.js";
export type * from "../client/actions/prepareCalls.js";
export { prepareCalls } from "../client/actions/prepareCalls.js";
export type * from "../client/actions/requestAccount.js";
export { requestAccount } from "../client/actions/requestAccount.js";
export type * from "../client/actions/signSignatureRequest.js";
export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
export type * from "../client/actions/signPreparedCalls.js";
export { signPreparedCalls } from "../client/actions/signPreparedCalls.js";
export type * from "../client/actions/signMessage.js";
export { signMessage } from "../client/actions/signMessage.js";
export type * from "../client/actions/signTypedData.js";
export { signTypedData } from "../client/actions/signTypedData.js";
export type * from "../client/actions/sendPreparedCalls.js";
export { sendPreparedCalls } from "../client/actions/sendPreparedCalls.js";
export type * from "../client/actions/sendCalls.js";
export { sendCalls } from "../client/actions/sendCalls.js";
export type * from "../client/actions/waitForCallsStatus.js";
export { waitForCallsStatus } from "../client/actions/waitForCallsStatus.js";
export type * from "../client/actions/prepareSign.js";
export { prepareSign } from "../client/actions/prepareSign.js";
export type * from "../client/actions/formatSign.js";
export { formatSign } from "../client/actions/formatSign.js";
85 changes: 8 additions & 77 deletions custom-frontmatter.mjs
Original file line number Diff line number Diff line change
@@ -1,44 +1,6 @@
import { ReflectionKind } from "typedoc";
import { MarkdownPageEvent } from "typedoc-plugin-markdown";

/**
* Determine if a function should be categorized as a component (React components)
*
* @param {string} fileName - The function name
* @param {string} packageName - The package name
* @returns {boolean} True if it should be categorized as a component
*/
function isReactComponent(fileName, packageName) {
// React components typically start with uppercase letter
const isUpperCase = fileName[0] === fileName[0].toUpperCase();

// Known React components
const reactComponents = [
"AlchemyAccountProvider",
"AuthCard",
"Dialog",
"UiConfigProvider",
];

return (
(packageName === "react" || packageName === "react-native") &&
(isUpperCase || reactComponents.includes(fileName))
);
}

/**
* Extract package name from URL path
*
* @param {string} url - The page URL
* @returns {string|null} The package name (e.g., 'react', 'react-native', 'core')
*/
function extractPackageFromUrl(url) {
if (!url) return null;

const match = url.match(/^(?:account-kit|aa-sdk)\/([^/]+)\//);
return match ? match[1] : null;
}

/**
* Custom plugin to generate frontmatter with title, description, and slug
*
Expand All @@ -48,15 +10,12 @@ export function load(app) {
// Handle frontmatter generation
app.renderer.on(
MarkdownPageEvent.BEGIN,
/** @param {import('typedoc-plugin-markdown').MarkdownPageEvent} page - The markdown page event containing model and URL information */
/** @param {import('typedoc-plugin-markdown').MarkdownPageEvent} page */
(page) => {
if (!page.model) return;

let title = page.model.name;

// Extract package name from URL for categorization
const packageName = extractPackageFromUrl(page.url);

if (page.model.kind === ReflectionKind.Class) {
title = page.model.name;
} else if (page.model.kind === ReflectionKind.Interface) {
Expand Down Expand Up @@ -95,17 +54,7 @@ export function load(app) {
} else if (page.model.kind === ReflectionKind.Interface) {
description = `Overview of the ${page.model.name} interface`;
} else if (page.model.kind === ReflectionKind.Function) {
// Apply same categorization logic as YAML generator
if (isReactComponent(page.model.name, packageName)) {
description = `Overview of the ${page.model.name} component`;
} else if (
page.model.name.startsWith("use") &&
(packageName === "react" || packageName === "react-native")
) {
description = `Overview of the ${page.model.name} hook`;
} else {
description = `Overview of the ${page.model.name} function`;
}
description = `Overview of the ${page.model.name} function`;
} else if (page.model.kind === ReflectionKind.Constructor) {
description = `Overview of the ${page.model.parent?.name || page.model.name} constructor`;
} else if (page.model.kind === ReflectionKind.Method) {
Expand All @@ -129,31 +78,13 @@ export function load(app) {
// Generate slug from the URL path
let slug = "";
if (page.url) {
let processedUrl = page.url
.replace(/\.mdx$/, "")
.replace(/\/src/g, "")
.replace(/\/exports/g, "");

if (page.model.kind === ReflectionKind.Function) {
if (isReactComponent(page.model.name, packageName)) {
// Replace /functions/ with /components/ for React components
processedUrl = processedUrl.replace(
/\/functions\//,
"/components/",
);
} else if (
page.model.name.startsWith("use") &&
(packageName === "react" || packageName === "react-native")
) {
// Replace /functions/ with /hooks/ for React hooks
processedUrl = processedUrl.replace(/\/functions\//, "/hooks/");
}
}

slug = `wallets/reference/${processedUrl}`;
slug = `wallets/reference/${page.url.replace(/\.mdx$/, "")}`;

// For README.mdx files, also clean up the slug
if (isReadmeFile) {
slug = slug.replace(/\/README$/, "");
slug = slug
.replace(/\/src\/exports\/README$/, "")
.replace(/\/src\/README$/, "");
}
}

Expand All @@ -169,7 +100,7 @@ export function load(app) {
// Handle adding auto-generated comment to final content
app.renderer.on(
MarkdownPageEvent.END,
/** @param {import('typedoc-plugin-markdown').MarkdownPageEvent} page - The markdown page event containing content to modify */
/** @param {import('typedoc-plugin-markdown').MarkdownPageEvent} page */
(page) => {
if (!page.contents) return;

Expand Down
Loading
Loading