Skip to content
Open
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
13 changes: 13 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ jobs:
- name: Validate RPC specs
run: pnpm run generate:rpc

docs-yml:
name: docs.yml Schema
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm
- name: Validate docs.yml against schema
run: pnpm run validate:docs-yml

lint:
name: Lint Files
runs-on: ubuntu-latest
Expand Down
179 changes: 179 additions & 0 deletions content/docs-yml.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Alchemy docs.yml",
"description": "Navigation configuration for the Alchemy docs site. Allows only the options supported by the content indexer (src/content-indexer/types/docsYaml.ts), including Alchemy-specific extensions (skip-slug, flattened).",
"type": "object",
"additionalProperties": false,
"required": ["navigation"],
"properties": {
"tabs": {
"description": "Top-level tabs shown in the docs header. Keys are tab identifiers referenced by navigation[].tab.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/tabConfig"
}
},
"navigation": {
"description": "Sidebar navigation layout for each tab.",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["tab"],
"properties": {
"tab": {
"description": "Tab identifier; must match a key under tabs.",
"type": "string"
},
"layout": {
"description": "Navigation items for this tab. Omit for tabs whose content is generated elsewhere (e.g. the changelog tab).",
"type": "array",
"items": {
"$ref": "#/definitions/navigationItem"
}
}
}
}
}
},
"definitions": {
"tabConfig": {
"type": "object",
"additionalProperties": false,
"required": ["display-name"],
"properties": {
"display-name": {
"description": "Human-readable tab label shown in the header.",
"type": "string"
},
"slug": {
"description": "URL segment for the tab. Defaults to the kebab-cased tab key.",
"type": "string"
},
"skip-slug": {
"description": "Alchemy extension: omit this tab's slug from descendant URL paths.",
"type": "boolean"
}
}
},
"navigationItem": {
"oneOf": [
{ "$ref": "#/definitions/pageItem" },
{ "$ref": "#/definitions/sectionItem" },
{ "$ref": "#/definitions/linkItem" },
{ "$ref": "#/definitions/apiItem" }
]
},
"mdxPath": {
"type": "string",
"pattern": "\\.mdx$"
},
"pageItem": {
"description": "A single docs page backed by an MDX file.",
"type": "object",
"additionalProperties": false,
"required": ["page", "path"],
"properties": {
"page": {
"description": "Page title shown in the sidebar.",
"type": "string"
},
"path": {
"description": "Path to the page's .mdx file, relative to the content directory.",
"$ref": "#/definitions/mdxPath"
},
"slug": {
"description": "URL segment for the page. Defaults to the kebab-cased page title. May contain slashes to override the full path.",
"type": "string"
},
"hidden": {
"description": "Hide this page from the sidebar and search indexing.",
"type": "boolean"
}
}
},
"sectionItem": {
"description": "A collapsible group of navigation items, optionally with an overview page.",
"type": "object",
"additionalProperties": false,
"required": ["section", "contents"],
"properties": {
"section": {
"description": "Section title shown in the sidebar.",
"type": "string"
},
"contents": {
"description": "Child navigation items.",
"type": "array",
"items": {
"$ref": "#/definitions/navigationItem"
}
},
"path": {
"description": "Optional overview page for the section: path to an .mdx file, relative to the content directory.",
"$ref": "#/definitions/mdxPath"
},
"slug": {
"description": "URL segment for the section. Defaults to the kebab-cased section title.",
"type": "string"
},
"skip-slug": {
"description": "Alchemy extension: omit this section's slug from descendant URL paths.",
"type": "boolean"
},
"hidden": {
"description": "Hide this section and its contents from the sidebar and search indexing.",
"type": "boolean"
}
}
},
"linkItem": {
"description": "A sidebar entry linking to an internal path or external URL.",
"type": "object",
"additionalProperties": false,
"required": ["link", "href"],
"properties": {
"link": {
"description": "Link text shown in the sidebar.",
"type": "string"
},
"href": {
"description": "Destination: an internal path (e.g. /docs/...) or an external URL.",
"type": "string"
}
}
},
"apiItem": {
"description": "An auto-generated API reference section backed by an uploaded API spec.",
"type": "object",
"additionalProperties": false,
"required": ["api", "api-name"],
"properties": {
"api": {
"description": "Title for the API reference section.",
"type": "string"
},
"api-name": {
"description": "Identifier of the API spec to render (must match an uploaded spec name).",
"type": "string"
},
"slug": {
"description": "URL segment for the API section. Defaults to the kebab-cased title.",
"type": "string"
},
"skip-slug": {
"description": "Alchemy extension: omit this section's slug from endpoint URL paths.",
"type": "boolean"
},
"hidden": {
"description": "Hide the endpoints from the sidebar and search indexing.",
"type": "boolean"
},
"flattened": {
"description": "Alchemy extension: render endpoints as a flat list instead of grouped by spec hierarchy.",
"type": "boolean"
}
}
}
}
}
20 changes: 1 addition & 19 deletions content/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# yaml-language-server: $schema=https://schema.buildwithfern.dev/docs-yml.json

instances:
- url: https://alchemy.com/docs
Comment on lines -3 to -4

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused field

# yaml-language-server: $schema=./docs-yml.schema.json

tabs:
get-started:
Expand All @@ -24,7 +21,6 @@ tabs:
slug: rollups
changelog:
display-name: Changelog
changelog: ./changelog

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

slug: changelog

navigation:
Expand Down Expand Up @@ -879,7 +875,6 @@ navigation:
- page: Using API
path: wallets/pages/smart-wallets/quickstart/api.mdx
- section: Send transactions
collapsed: true

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapsed does nothing currrently

contents:
- page: Single transactions
path: wallets/pages/transactions/send-transactions/index.mdx
Expand All @@ -889,19 +884,16 @@ navigation:
path: wallets/pages/transactions/send-parallel-transactions/index.mdx
- section: Debug transactions
path: wallets/pages/transactions/debug-transactions/index.mdx
collapsed: true
contents:
- page: Debug with Tenderly
path: wallets/pages/transactions/debug-transactions/debug-with-tenderly.mdx
- section: EIP-7702
path: wallets/pages/transactions/using-eip-7702/index.mdx
collapsed: true
contents:
- page: Undelegate 7702 account
path: wallets/pages/transactions/undelegate-account/index.mdx
- section: Sponsor gas
path: wallets/pages/transactions/sponsor-gas/overview.mdx
collapsed: true
contents:
- page: Full sponsorship
path: wallets/pages/transactions/sponsor-gas/index.mdx
Expand All @@ -912,14 +904,12 @@ navigation:
- page: Solana sponsorship
path: wallets/pages/transactions/sponsor-gas/solana/index.mdx
- section: Swap tokens
collapsed: true
contents:
- page: Same-chain swaps
path: wallets/pages/transactions/swap-tokens/index.mdx
- page: Cross-chain swaps
path: wallets/pages/transactions/cross-chain-swap-tokens/index.mdx
- section: Grant session keys
collapsed: true
contents:
- page: Overview
path: wallets/pages/smart-wallets/session-keys/index.mdx
Expand All @@ -932,7 +922,6 @@ navigation:
- page: Retry transactions
path: wallets/pages/transactions/retry-transactions/index.mdx
- section: Sign
collapsed: true
contents:
- page: Sign messages
path: wallets/pages/transactions/signing/sign-messages/index.mdx
Expand All @@ -947,7 +936,6 @@ navigation:
path: wallets/pages/authentication/overview.mdx
- section: Privy
path: wallets/pages/third-party/signers/privy.mdx
collapsed: true
contents:
- page: Signer migration overview
path: wallets/wallet-integrations/privy/signer-migration-overview.mdx
Expand All @@ -966,10 +954,8 @@ navigation:
- page: Other signers
path: wallets/pages/third-party/signers/custom-integration.mdx
- section: Account Kit (v4)
collapsed: true
contents:
- section: Login methods
collapsed: true
contents:
- page: Email OTP
path: wallets/pages/authentication/login-methods/email-otp.mdx
Expand All @@ -992,7 +978,6 @@ navigation:
- page: Adding and removing login methods
path: wallets/pages/react/login-methods/adding-and-removing-login-methods.mdx
- section: UI components
collapsed: true
contents:
- page: Using UI components
path: wallets/pages/react/ui-components.mdx
Expand All @@ -1001,21 +986,18 @@ navigation:
- page: Tailwind setup
path: wallets/pages/react/customization/tailwind-setup.mdx
- section: Whitelabel
collapsed: true
contents:
- page: React hooks
path: wallets/pages/react/react-hooks.mdx
- page: Other JS initialization
path: wallets/pages/signer/quickstart.mdx
- section: Connectors
collapsed: true
contents:
- page: Connect external wallets
path: wallets/pages/react/login-methods/eoa-login.mdx
- page: Customize
path: wallets/pages/react/connectors/customization.mdx
- section: MFA
collapsed: true
contents:
- page: Set up MFA
path: wallets/pages/react/mfa/setup-mfa.mdx
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"clean": "rm -rf content/api-specs",
"validate:rest": "./scripts/generate-open-api.sh --validate-only",
"validate:rpc": "tsx ./scripts/validate-rpc.ts",
"validate:docs-yml": "tsx ./scripts/validate-docs-yml.ts",
"validate": "pnpm run validate:rest & pnpm run validate:rpc",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
Expand Down Expand Up @@ -64,6 +65,7 @@
"@types/remove-markdown": "^0.3.4",
"@typescript-eslint/parser": "^8.31.0",
"@vitest/coverage-v8": "^4.0.16",
"ajv": "^8.20.0",
"eslint": "^9.25.1",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-mdx": "^3.4.1",
Expand Down
Loading
Loading