Skip to content
Merged
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
  •  
  •  
  •  
329 changes: 186 additions & 143 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,173 @@
import { defineConfig } from 'vitepress'
import type { DefaultTheme } from 'vitepress'

// Helper: deep-clone a sidebar array and prefix every root-absolute `link`
// with the given version path (e.g. '/0.16.23'). Used to mirror the latest
// sidebars for the frozen archived version without hand-editing each entry.
function prefixSidebar(
items: DefaultTheme.SidebarItem[],
prefix: string
): DefaultTheme.SidebarItem[] {
return items.map((item) => {
const next: DefaultTheme.SidebarItem = { ...item }
if (typeof next.link === 'string' && next.link.startsWith('/')) {
next.link = prefix + next.link
}
if (Array.isArray(next.items)) {
next.items = prefixSidebar(next.items, prefix)
}
return next
})
}

// --- Latest (root) sidebars -------------------------------------------------

const guideSidebar: DefaultTheme.SidebarItem[] = [
{
text: 'Introduction',
items: [
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Quick Start', link: '/guide/quick-start' }
]
},
{
text: 'Core Concepts',
items: [
{ text: 'Account Abstraction', link: '/guide/concepts/account-abstraction' },
{ text: 'SuperPaymaster (AOA+)', link: '/guide/concepts/superpaymaster' },
{ text: 'EOA Rainbow Bridge', link: '/guide/concepts/rainbow-bridge' },
{ text: 'Reputation System', link: '/guide/concepts/reputation' }
]
},
{
text: 'Use Cases',
items: [
{ text: 'Community Management', link: '/guide/use-cases/community-management' },
{ text: 'Gasless Transactions', link: '/guide/use-cases/gasless-transactions' },
{ text: 'Operator Staking', link: '/guide/use-cases/operator-staking' },
{ text: 'Build Your Own Protocol', link: '/guide/use-cases/yop' }
]
},
{
text: 'Deployments',
items: [
{ text: 'Overview (Optimism Default)', link: '/guide/deployments/' },
{ text: 'Optimism Contracts', link: '/guide/deployments/verify.optimism.contracts' },
{ text: 'OP-Sepolia Contracts', link: '/guide/deployments/verify.op-sepolia.contracts' },
{ text: 'Sepolia Contracts', link: '/guide/deployments/verify.sepolia.contracts' }
]
},
{
text: 'Operations',
items: [
{ text: 'Configuration Sync', link: '/guide/docs/Configuration_Sync' },
{ text: 'Gasless Tester Guide', link: '/guide/docs/TESTER_GUIDE_GASLESS' },
{ text: 'Account Initialization (CN)', link: '/guide/docs/Account_Initialization_Guide_CN' },
{ text: 'Stage3 Analysis', link: '/guide/docs/SDK_STAGE3_ANALYSIS' }
]
},
{
text: 'Lifecycle API (L3)',
items: [
{ text: 'Developer Guide', link: '/guide/docs/L3_Lifecycle_Developer_Guide' },
{ text: 'Complete Demo Walkthrough', link: '/guide/docs/L3_Complete_Demo_Walkthrough' },
{ text: 'Patterns Design', link: '/guide/docs/L3_Lifecycle_Patterns_Design' }
]
}
]

const zhGuideSidebar: DefaultTheme.SidebarItem[] = [
{
text: '快速入门',
items: [
{ text: '开始使用', link: '/zh/guide/getting-started' },
{ text: '安裝', link: '/zh/guide/installation' },
{ text: '快速開始', link: '/zh/guide/quick-start' }
]
},
{
text: '核心概念',
items: [
{ text: '賬戶抽象', link: '/zh/guide/concepts/account-abstraction' },
{ text: 'SuperPaymaster (AOA+)', link: '/zh/guide/concepts/superpaymaster' },
{ text: 'EOA Rainbow Bridge', link: '/zh/guide/concepts/rainbow-bridge' },
{ text: '聲譽系統', link: '/zh/guide/concepts/reputation' }
]
},
{
text: '应用场景',
items: [
{ text: '社区管理', link: '/zh/guide/use-cases/community-management' },
{ text: 'Gasless 交易', link: '/zh/guide/use-cases/gasless-transactions' },
{ text: 'Operator 質押', link: '/zh/guide/use-cases/operator-staking' },
{ text: '自建協議', link: '/zh/guide/use-cases/yop' }
]
}
]

const apiSidebar: DefaultTheme.SidebarItem[] = [
{
text: 'Getting Started',
items: [
{ text: 'Overview', link: '/api/' },
{ text: 'Installation', link: '/api/@aastar/sdk#installation' },
{ text: 'Quick Start', link: '/api/@aastar/sdk#usage' }
]
},
{
text: '@aastar/sdk (Meta Package)',
items: [
{ text: 'Overview', link: '/api/@aastar/sdk' },
{ text: 'Node.js Tools', link: '/api/@aastar/sdk/node' }
]
},
{
text: 'Core Modules',
collapsed: false,
items: [
{ text: '@aastar/community', link: '/api/@aastar/community' },
{ text: '@aastar/operator', link: '/api/@aastar/operator' },
{ text: '@aastar/enduser', link: '/api/@aastar/enduser' },
{ text: '@aastar/core', link: '/api/@aastar/core' },
{ text: '@aastar/account', link: '/api/@aastar/account' },
{ text: '@aastar/paymaster', link: '/api/@aastar/paymaster' },
{ text: '@aastar/tokens', link: '/api/@aastar/tokens' },
{ text: '@aastar/identity', link: '/api/@aastar/identity' },
{ text: '@aastar/analytics', link: '/api/@aastar/analytics' },
{ text: '@aastar/dapp', link: '/api/@aastar/dapp' }
]
},
{
text: 'Examples',
items: [
{ text: 'SDK Handbooks', link: '/api/@aastar/sdk#core-scenarios' }
]
}
]

const examplesSidebar: DefaultTheme.SidebarItem[] = [
{
text: 'Complete Examples',
items: [
{ text: 'Overview', link: '/examples/' },
{ text: 'Operator Flow', link: '/examples/operator-flow' },
{ text: 'Community Flow', link: '/examples/community-flow' },
{ text: 'End User Flow', link: '/examples/enduser-flow' },
{ text: 'L3 Complete Lifecycle', link: '/guide/docs/L3_Complete_Demo_Walkthrough' },
{ text: 'Multi-Chain Setup', link: '/examples/multi-chain' }
]
}
]

const ARCHIVED_VERSION = '/0.16.23'

export default defineConfig({
title: 'AAStar SDK',
description: 'Build Your Own Protocol with Account Abstraction',

lang: 'en',
ignoreDeadLinks: true,
ignoreDeadLinks: true,
lastUpdated: true,
vite: {
plugins: [
Expand Down Expand Up @@ -52,159 +214,40 @@ export default defineConfig({
themeConfig: {
logo: '/aastar-logo.png',
lastUpdatedText: 'Last Updated',

// Enable right sidebar (TOC)
outline: {
level: [2, 3],
label: 'On this page'
},

nav: [
{ text: 'Guide', link: '/guide/getting-started' },
{ text: 'API', link: '/api/' },
{ text: 'Examples', link: '/examples/' },
{ text: 'Deployments', link: '/guide/deployments/' },
{ text: 'History', link: '/changelog' }
{ text: 'History', link: '/changelog' },
{
text: 'v0.20.x (latest)',
items: [
{ text: 'v0.20.x (latest)', link: '/' },
{ text: 'v0.16.23', link: '/0.16.23/' }
]
}
],

sidebar: {
'/guide/': [
{
text: 'Introduction',
items: [
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Quick Start', link: '/guide/quick-start' }
]
},
{
text: 'Core Concepts',
items: [
{ text: 'Account Abstraction', link: '/guide/concepts/account-abstraction' },
{ text: 'SuperPaymaster (AOA+)', link: '/guide/concepts/superpaymaster' },
{ text: 'EOA Rainbow Bridge', link: '/guide/concepts/rainbow-bridge' },
{ text: 'Reputation System', link: '/guide/concepts/reputation' }
]
},
{
text: 'Use Cases',
items: [
{ text: 'Community Management', link: '/guide/use-cases/community-management' },
{ text: 'Gasless Transactions', link: '/guide/use-cases/gasless-transactions' },
{ text: 'Operator Staking', link: '/guide/use-cases/operator-staking' },
{ text: 'Build Your Own Protocol', link: '/guide/use-cases/yop' }
]
},
{
text: 'Deployments',
items: [
{ text: 'Overview (Optimism Default)', link: '/guide/deployments/' },
{ text: 'Optimism Contracts', link: '/guide/deployments/verify.optimism.contracts' },
{ text: 'OP-Sepolia Contracts', link: '/guide/deployments/verify.op-sepolia.contracts' },
{ text: 'Sepolia Contracts', link: '/guide/deployments/verify.sepolia.contracts' }
]
},
{
text: 'Operations',
items: [
{ text: 'Configuration Sync', link: '/guide/docs/Configuration_Sync' },
{ text: 'Gasless Tester Guide', link: '/guide/docs/TESTER_GUIDE_GASLESS' },
{ text: 'Account Initialization (CN)', link: '/guide/docs/Account_Initialization_Guide_CN' },
{ text: 'Stage3 Analysis', link: '/guide/docs/SDK_STAGE3_ANALYSIS' }
]
},
{
text: 'Lifecycle API (L3)',
items: [
{ text: 'Developer Guide', link: '/guide/docs/L3_Lifecycle_Developer_Guide' },
{ text: 'Complete Demo Walkthrough', link: '/guide/docs/L3_Complete_Demo_Walkthrough' },
{ text: 'Patterns Design', link: '/guide/docs/L3_Lifecycle_Patterns_Design' }
]
}
],

'/zh/guide/': [
{
text: '快速入门',
items: [
{ text: '开始使用', link: '/zh/guide/getting-started' },
{ text: '安裝', link: '/zh/guide/installation' },
{ text: '快速開始', link: '/zh/guide/quick-start' }
]
},
{
text: '核心概念',
items: [
{ text: '賬戶抽象', link: '/zh/guide/concepts/account-abstraction' },
{ text: 'SuperPaymaster (AOA+)', link: '/zh/guide/concepts/superpaymaster' },
{ text: 'EOA Rainbow Bridge', link: '/zh/guide/concepts/rainbow-bridge' },
{ text: '聲譽系統', link: '/zh/guide/concepts/reputation' }
]
},
{
text: '应用场景',
items: [
{ text: '社区管理', link: '/zh/guide/use-cases/community-management' },
{ text: 'Gasless 交易', link: '/zh/guide/use-cases/gasless-transactions' },
{ text: 'Operator 質押', link: '/zh/guide/use-cases/operator-staking' },
{ text: '自建協議', link: '/zh/guide/use-cases/yop' }
]
}
],

'/api/': [
{
text: 'Getting Started',
items: [
{ text: 'Overview', link: '/api/' },
{ text: 'Installation', link: '/api/@aastar/sdk#installation' },
{ text: 'Quick Start', link: '/api/@aastar/sdk#usage' }
]
},
{
text: '@aastar/sdk (Meta Package)',
items: [
{ text: 'Overview', link: '/api/@aastar/sdk' },
{ text: 'Node.js Tools', link: '/api/@aastar/sdk/node' }
]
},
{
text: 'Core Modules',
collapsed: false,
items: [
{ text: '@aastar/community', link: '/api/@aastar/community' },
{ text: '@aastar/operator', link: '/api/@aastar/operator' },
{ text: '@aastar/enduser', link: '/api/@aastar/enduser' },
{ text: '@aastar/core', link: '/api/@aastar/core' },
{ text: '@aastar/account', link: '/api/@aastar/account' },
{ text: '@aastar/paymaster', link: '/api/@aastar/paymaster' },
{ text: '@aastar/tokens', link: '/api/@aastar/tokens' },
{ text: '@aastar/identity', link: '/api/@aastar/identity' },
{ text: '@aastar/analytics', link: '/api/@aastar/analytics' },
{ text: '@aastar/dapp', link: '/api/@aastar/dapp' }
]
},
{
text: 'Examples',
items: [
{ text: 'SDK Handbooks', link: '/api/@aastar/sdk#core-scenarios' }
]
}
],

'/examples/': [
{
text: 'Complete Examples',
items: [
{ text: 'Overview', link: '/examples/' },
{ text: 'Operator Flow', link: '/examples/operator-flow' },
{ text: 'Community Flow', link: '/examples/community-flow' },
{ text: 'End User Flow', link: '/examples/enduser-flow' },
{ text: 'L3 Complete Lifecycle', link: '/guide/docs/L3_Complete_Demo_Walkthrough' },
{ text: 'Multi-Chain Setup', link: '/examples/multi-chain' }
]
}
]
'/guide/': guideSidebar,
'/zh/guide/': zhGuideSidebar,
'/api/': apiSidebar,
'/examples/': examplesSidebar,

// Mirrored sidebars for the frozen archived version (v0.16.23).
// Links are auto-prefixed with the version path via prefixSidebar().
'/0.16.23/guide/': prefixSidebar(guideSidebar, ARCHIVED_VERSION),
'/0.16.23/api/': prefixSidebar(apiSidebar, ARCHIVED_VERSION),
'/0.16.23/examples/': prefixSidebar(examplesSidebar, ARCHIVED_VERSION),
'/0.16.23/zh/guide/': prefixSidebar(zhGuideSidebar, ARCHIVED_VERSION)
},

socialLinks: [
Expand All @@ -213,7 +256,7 @@ export default defineConfig({
],

footer: {
message: 'Released under the MIT License.',
message: 'Released under the Apache-2.0 License.',
copyright: 'Copyright © 2023-present AAStar Community'
},

Expand Down
Loading
Loading