11import { defineConfig } from 'vitepress'
2+ import type { DefaultTheme } from 'vitepress'
3+
4+ // Helper: deep-clone a sidebar array and prefix every root-absolute `link`
5+ // with the given version path (e.g. '/0.16.23'). Used to mirror the latest
6+ // sidebars for the frozen archived version without hand-editing each entry.
7+ function prefixSidebar (
8+ items : DefaultTheme . SidebarItem [ ] ,
9+ prefix : string
10+ ) : DefaultTheme . SidebarItem [ ] {
11+ return items . map ( ( item ) => {
12+ const next : DefaultTheme . SidebarItem = { ...item }
13+ if ( typeof next . link === 'string' && next . link . startsWith ( '/' ) ) {
14+ next . link = prefix + next . link
15+ }
16+ if ( Array . isArray ( next . items ) ) {
17+ next . items = prefixSidebar ( next . items , prefix )
18+ }
19+ return next
20+ } )
21+ }
22+
23+ // --- Latest (root) sidebars -------------------------------------------------
24+
25+ const guideSidebar : DefaultTheme . SidebarItem [ ] = [
26+ {
27+ text : 'Introduction' ,
28+ items : [
29+ { text : 'Getting Started' , link : '/guide/getting-started' } ,
30+ { text : 'Installation' , link : '/guide/installation' } ,
31+ { text : 'Quick Start' , link : '/guide/quick-start' }
32+ ]
33+ } ,
34+ {
35+ text : 'Core Concepts' ,
36+ items : [
37+ { text : 'Account Abstraction' , link : '/guide/concepts/account-abstraction' } ,
38+ { text : 'SuperPaymaster (AOA+)' , link : '/guide/concepts/superpaymaster' } ,
39+ { text : 'EOA Rainbow Bridge' , link : '/guide/concepts/rainbow-bridge' } ,
40+ { text : 'Reputation System' , link : '/guide/concepts/reputation' }
41+ ]
42+ } ,
43+ {
44+ text : 'Use Cases' ,
45+ items : [
46+ { text : 'Community Management' , link : '/guide/use-cases/community-management' } ,
47+ { text : 'Gasless Transactions' , link : '/guide/use-cases/gasless-transactions' } ,
48+ { text : 'Operator Staking' , link : '/guide/use-cases/operator-staking' } ,
49+ { text : 'Build Your Own Protocol' , link : '/guide/use-cases/yop' }
50+ ]
51+ } ,
52+ {
53+ text : 'Deployments' ,
54+ items : [
55+ { text : 'Overview (Optimism Default)' , link : '/guide/deployments/' } ,
56+ { text : 'Optimism Contracts' , link : '/guide/deployments/verify.optimism.contracts' } ,
57+ { text : 'OP-Sepolia Contracts' , link : '/guide/deployments/verify.op-sepolia.contracts' } ,
58+ { text : 'Sepolia Contracts' , link : '/guide/deployments/verify.sepolia.contracts' }
59+ ]
60+ } ,
61+ {
62+ text : 'Operations' ,
63+ items : [
64+ { text : 'Configuration Sync' , link : '/guide/docs/Configuration_Sync' } ,
65+ { text : 'Gasless Tester Guide' , link : '/guide/docs/TESTER_GUIDE_GASLESS' } ,
66+ { text : 'Account Initialization (CN)' , link : '/guide/docs/Account_Initialization_Guide_CN' } ,
67+ { text : 'Stage3 Analysis' , link : '/guide/docs/SDK_STAGE3_ANALYSIS' }
68+ ]
69+ } ,
70+ {
71+ text : 'Lifecycle API (L3)' ,
72+ items : [
73+ { text : 'Developer Guide' , link : '/guide/docs/L3_Lifecycle_Developer_Guide' } ,
74+ { text : 'Complete Demo Walkthrough' , link : '/guide/docs/L3_Complete_Demo_Walkthrough' } ,
75+ { text : 'Patterns Design' , link : '/guide/docs/L3_Lifecycle_Patterns_Design' }
76+ ]
77+ }
78+ ]
79+
80+ const zhGuideSidebar : DefaultTheme . SidebarItem [ ] = [
81+ {
82+ text : '快速入门' ,
83+ items : [
84+ { text : '开始使用' , link : '/zh/guide/getting-started' } ,
85+ { text : '安裝' , link : '/zh/guide/installation' } ,
86+ { text : '快速開始' , link : '/zh/guide/quick-start' }
87+ ]
88+ } ,
89+ {
90+ text : '核心概念' ,
91+ items : [
92+ { text : '賬戶抽象' , link : '/zh/guide/concepts/account-abstraction' } ,
93+ { text : 'SuperPaymaster (AOA+)' , link : '/zh/guide/concepts/superpaymaster' } ,
94+ { text : 'EOA Rainbow Bridge' , link : '/zh/guide/concepts/rainbow-bridge' } ,
95+ { text : '聲譽系統' , link : '/zh/guide/concepts/reputation' }
96+ ]
97+ } ,
98+ {
99+ text : '应用场景' ,
100+ items : [
101+ { text : '社区管理' , link : '/zh/guide/use-cases/community-management' } ,
102+ { text : 'Gasless 交易' , link : '/zh/guide/use-cases/gasless-transactions' } ,
103+ { text : 'Operator 質押' , link : '/zh/guide/use-cases/operator-staking' } ,
104+ { text : '自建協議' , link : '/zh/guide/use-cases/yop' }
105+ ]
106+ }
107+ ]
108+
109+ const apiSidebar : DefaultTheme . SidebarItem [ ] = [
110+ {
111+ text : 'Getting Started' ,
112+ items : [
113+ { text : 'Overview' , link : '/api/' } ,
114+ { text : 'Installation' , link : '/api/@aastar/sdk#installation' } ,
115+ { text : 'Quick Start' , link : '/api/@aastar/sdk#usage' }
116+ ]
117+ } ,
118+ {
119+ text : '@aastar/sdk (Meta Package)' ,
120+ items : [
121+ { text : 'Overview' , link : '/api/@aastar/sdk' } ,
122+ { text : 'Node.js Tools' , link : '/api/@aastar/sdk/node' }
123+ ]
124+ } ,
125+ {
126+ text : 'Core Modules' ,
127+ collapsed : false ,
128+ items : [
129+ { text : '@aastar/community' , link : '/api/@aastar/community' } ,
130+ { text : '@aastar/operator' , link : '/api/@aastar/operator' } ,
131+ { text : '@aastar/enduser' , link : '/api/@aastar/enduser' } ,
132+ { text : '@aastar/core' , link : '/api/@aastar/core' } ,
133+ { text : '@aastar/account' , link : '/api/@aastar/account' } ,
134+ { text : '@aastar/paymaster' , link : '/api/@aastar/paymaster' } ,
135+ { text : '@aastar/tokens' , link : '/api/@aastar/tokens' } ,
136+ { text : '@aastar/identity' , link : '/api/@aastar/identity' } ,
137+ { text : '@aastar/analytics' , link : '/api/@aastar/analytics' } ,
138+ { text : '@aastar/dapp' , link : '/api/@aastar/dapp' }
139+ ]
140+ } ,
141+ {
142+ text : 'Examples' ,
143+ items : [
144+ { text : 'SDK Handbooks' , link : '/api/@aastar/sdk#core-scenarios' }
145+ ]
146+ }
147+ ]
148+
149+ const examplesSidebar : DefaultTheme . SidebarItem [ ] = [
150+ {
151+ text : 'Complete Examples' ,
152+ items : [
153+ { text : 'Overview' , link : '/examples/' } ,
154+ { text : 'Operator Flow' , link : '/examples/operator-flow' } ,
155+ { text : 'Community Flow' , link : '/examples/community-flow' } ,
156+ { text : 'End User Flow' , link : '/examples/enduser-flow' } ,
157+ { text : 'L3 Complete Lifecycle' , link : '/guide/docs/L3_Complete_Demo_Walkthrough' } ,
158+ { text : 'Multi-Chain Setup' , link : '/examples/multi-chain' }
159+ ]
160+ }
161+ ]
162+
163+ const ARCHIVED_VERSION = '/0.16.23'
2164
3165export default defineConfig ( {
4166 title : 'AAStar SDK' ,
5167 description : 'Build Your Own Protocol with Account Abstraction' ,
6-
168+
7169 lang : 'en' ,
8- ignoreDeadLinks : true ,
170+ ignoreDeadLinks : true ,
9171 lastUpdated : true ,
10172 vite : {
11173 plugins : [
@@ -52,159 +214,40 @@ export default defineConfig({
52214 themeConfig : {
53215 logo : '/aastar-logo.png' ,
54216 lastUpdatedText : 'Last Updated' ,
55-
217+
56218 // Enable right sidebar (TOC)
57219 outline : {
58220 level : [ 2 , 3 ] ,
59221 label : 'On this page'
60222 } ,
61-
223+
62224 nav : [
63225 { text : 'Guide' , link : '/guide/getting-started' } ,
64226 { text : 'API' , link : '/api/' } ,
65227 { text : 'Examples' , link : '/examples/' } ,
66228 { text : 'Deployments' , link : '/guide/deployments/' } ,
67- { text : 'History' , link : '/changelog' }
229+ { text : 'History' , link : '/changelog' } ,
230+ {
231+ text : 'v0.20.x (latest)' ,
232+ items : [
233+ { text : 'v0.20.x (latest)' , link : '/' } ,
234+ { text : 'v0.16.23' , link : '/0.16.23/' }
235+ ]
236+ }
68237 ] ,
69238
70239 sidebar : {
71- '/guide/' : [
72- {
73- text : 'Introduction' ,
74- items : [
75- { text : 'Getting Started' , link : '/guide/getting-started' } ,
76- { text : 'Installation' , link : '/guide/installation' } ,
77- { text : 'Quick Start' , link : '/guide/quick-start' }
78- ]
79- } ,
80- {
81- text : 'Core Concepts' ,
82- items : [
83- { text : 'Account Abstraction' , link : '/guide/concepts/account-abstraction' } ,
84- { text : 'SuperPaymaster (AOA+)' , link : '/guide/concepts/superpaymaster' } ,
85- { text : 'EOA Rainbow Bridge' , link : '/guide/concepts/rainbow-bridge' } ,
86- { text : 'Reputation System' , link : '/guide/concepts/reputation' }
87- ]
88- } ,
89- {
90- text : 'Use Cases' ,
91- items : [
92- { text : 'Community Management' , link : '/guide/use-cases/community-management' } ,
93- { text : 'Gasless Transactions' , link : '/guide/use-cases/gasless-transactions' } ,
94- { text : 'Operator Staking' , link : '/guide/use-cases/operator-staking' } ,
95- { text : 'Build Your Own Protocol' , link : '/guide/use-cases/yop' }
96- ]
97- } ,
98- {
99- text : 'Deployments' ,
100- items : [
101- { text : 'Overview (Optimism Default)' , link : '/guide/deployments/' } ,
102- { text : 'Optimism Contracts' , link : '/guide/deployments/verify.optimism.contracts' } ,
103- { text : 'OP-Sepolia Contracts' , link : '/guide/deployments/verify.op-sepolia.contracts' } ,
104- { text : 'Sepolia Contracts' , link : '/guide/deployments/verify.sepolia.contracts' }
105- ]
106- } ,
107- {
108- text : 'Operations' ,
109- items : [
110- { text : 'Configuration Sync' , link : '/guide/docs/Configuration_Sync' } ,
111- { text : 'Gasless Tester Guide' , link : '/guide/docs/TESTER_GUIDE_GASLESS' } ,
112- { text : 'Account Initialization (CN)' , link : '/guide/docs/Account_Initialization_Guide_CN' } ,
113- { text : 'Stage3 Analysis' , link : '/guide/docs/SDK_STAGE3_ANALYSIS' }
114- ]
115- } ,
116- {
117- text : 'Lifecycle API (L3)' ,
118- items : [
119- { text : 'Developer Guide' , link : '/guide/docs/L3_Lifecycle_Developer_Guide' } ,
120- { text : 'Complete Demo Walkthrough' , link : '/guide/docs/L3_Complete_Demo_Walkthrough' } ,
121- { text : 'Patterns Design' , link : '/guide/docs/L3_Lifecycle_Patterns_Design' }
122- ]
123- }
124- ] ,
125-
126- '/zh/guide/' : [
127- {
128- text : '快速入门' ,
129- items : [
130- { text : '开始使用' , link : '/zh/guide/getting-started' } ,
131- { text : '安裝' , link : '/zh/guide/installation' } ,
132- { text : '快速開始' , link : '/zh/guide/quick-start' }
133- ]
134- } ,
135- {
136- text : '核心概念' ,
137- items : [
138- { text : '賬戶抽象' , link : '/zh/guide/concepts/account-abstraction' } ,
139- { text : 'SuperPaymaster (AOA+)' , link : '/zh/guide/concepts/superpaymaster' } ,
140- { text : 'EOA Rainbow Bridge' , link : '/zh/guide/concepts/rainbow-bridge' } ,
141- { text : '聲譽系統' , link : '/zh/guide/concepts/reputation' }
142- ]
143- } ,
144- {
145- text : '应用场景' ,
146- items : [
147- { text : '社区管理' , link : '/zh/guide/use-cases/community-management' } ,
148- { text : 'Gasless 交易' , link : '/zh/guide/use-cases/gasless-transactions' } ,
149- { text : 'Operator 質押' , link : '/zh/guide/use-cases/operator-staking' } ,
150- { text : '自建協議' , link : '/zh/guide/use-cases/yop' }
151- ]
152- }
153- ] ,
154-
155- '/api/' : [
156- {
157- text : 'Getting Started' ,
158- items : [
159- { text : 'Overview' , link : '/api/' } ,
160- { text : 'Installation' , link : '/api/@aastar/sdk#installation' } ,
161- { text : 'Quick Start' , link : '/api/@aastar/sdk#usage' }
162- ]
163- } ,
164- {
165- text : '@aastar/sdk (Meta Package)' ,
166- items : [
167- { text : 'Overview' , link : '/api/@aastar/sdk' } ,
168- { text : 'Node.js Tools' , link : '/api/@aastar/sdk/node' }
169- ]
170- } ,
171- {
172- text : 'Core Modules' ,
173- collapsed : false ,
174- items : [
175- { text : '@aastar/community' , link : '/api/@aastar/community' } ,
176- { text : '@aastar/operator' , link : '/api/@aastar/operator' } ,
177- { text : '@aastar/enduser' , link : '/api/@aastar/enduser' } ,
178- { text : '@aastar/core' , link : '/api/@aastar/core' } ,
179- { text : '@aastar/account' , link : '/api/@aastar/account' } ,
180- { text : '@aastar/paymaster' , link : '/api/@aastar/paymaster' } ,
181- { text : '@aastar/tokens' , link : '/api/@aastar/tokens' } ,
182- { text : '@aastar/identity' , link : '/api/@aastar/identity' } ,
183- { text : '@aastar/analytics' , link : '/api/@aastar/analytics' } ,
184- { text : '@aastar/dapp' , link : '/api/@aastar/dapp' }
185- ]
186- } ,
187- {
188- text : 'Examples' ,
189- items : [
190- { text : 'SDK Handbooks' , link : '/api/@aastar/sdk#core-scenarios' }
191- ]
192- }
193- ] ,
194-
195- '/examples/' : [
196- {
197- text : 'Complete Examples' ,
198- items : [
199- { text : 'Overview' , link : '/examples/' } ,
200- { text : 'Operator Flow' , link : '/examples/operator-flow' } ,
201- { text : 'Community Flow' , link : '/examples/community-flow' } ,
202- { text : 'End User Flow' , link : '/examples/enduser-flow' } ,
203- { text : 'L3 Complete Lifecycle' , link : '/guide/docs/L3_Complete_Demo_Walkthrough' } ,
204- { text : 'Multi-Chain Setup' , link : '/examples/multi-chain' }
205- ]
206- }
207- ]
240+ '/guide/' : guideSidebar ,
241+ '/zh/guide/' : zhGuideSidebar ,
242+ '/api/' : apiSidebar ,
243+ '/examples/' : examplesSidebar ,
244+
245+ // Mirrored sidebars for the frozen archived version (v0.16.23).
246+ // Links are auto-prefixed with the version path via prefixSidebar().
247+ '/0.16.23/guide/' : prefixSidebar ( guideSidebar , ARCHIVED_VERSION ) ,
248+ '/0.16.23/api/' : prefixSidebar ( apiSidebar , ARCHIVED_VERSION ) ,
249+ '/0.16.23/examples/' : prefixSidebar ( examplesSidebar , ARCHIVED_VERSION ) ,
250+ '/0.16.23/zh/guide/' : prefixSidebar ( zhGuideSidebar , ARCHIVED_VERSION )
208251 } ,
209252
210253 socialLinks : [
@@ -213,7 +256,7 @@ export default defineConfig({
213256 ] ,
214257
215258 footer : {
216- message : 'Released under the MIT License.' ,
259+ message : 'Released under the Apache-2.0 License.' ,
217260 copyright : 'Copyright © 2023-present AAStar Community'
218261 } ,
219262
0 commit comments