Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
547 lines (534 loc) · 16 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
547 lines (534 loc) · 16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
// Use the GitLab-specific flag (not generic CI) so we only skip build-time
// work in the memory-constrained lint:build job, never in the actual
// production deploy, which may run on a different CI provider that also
// sets CI=true.
const isGitlabCI = process.env.GITLAB_CI === "true";
const config: Config = {
title: "Flare Developer Hub",
tagline: "Official documentation for Flare.",
favicon: "/img/favicon.ico",
url: "https://dev.flare.network",
baseUrl: "/",
organizationName: "flare-foundation",
projectName: "developer-hub",
onBrokenAnchors: "throw",
onDuplicateRoutes: "throw",
onBrokenLinks: "throw",
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownImages: "throw",
onBrokenMarkdownLinks: "throw",
},
},
trailingSlash: false,
i18n: {
defaultLocale: "en",
locales: ["en"],
localeConfigs: {
en: { htmlLang: "en" },
},
},
headTags: [
{
tagName: "meta",
attributes: {
name: "google-site-verification",
content: "S7ko-mhGTnZdYIIAcKUa-IsjtF8x-0wvleX2uDUg0NU",
},
},
{
tagName: "meta",
attributes: {
property: "og:type",
content: "website",
},
},
{
tagName: "link",
attributes: {
rel: "preload",
href: "/fonts/Satoshi/Satoshi-Variable.woff2",
as: "font",
type: "font/woff2",
crossorigin: "anonymous",
},
},
{
tagName: "script",
attributes: {
type: "application/ld+json",
},
innerHTML: JSON.stringify({
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://flare.network/#organization",
name: "Flare Ecosystems Limited",
alternateName: ["Flare", "Flare Network", "Flare Foundation"],
url: "https://flare.network/",
logo: "https://dev.flare.network/img/ui/flare-icon.light.svg",
email: "info@flare.network",
sameAs: [
"https://github.com/flare-foundation",
"https://x.com/FlareNetworks",
"https://t.me/FlareNetwork",
],
contactPoint: [
{
"@type": "ContactPoint",
contactType: "customer support",
email: "info@flare.network",
url: "https://flare.network/resources/technical-support",
},
],
address: {
"@type": "PostalAddress",
streetAddress: "Commerce House, Wickhams Cay 1, P.O. Box 3140",
addressLocality: "Road Town",
addressRegion: "Tortola",
postalCode: "VG 1110",
addressCountry: "VG",
},
},
{
"@type": "WebSite",
"@id": "https://dev.flare.network/#website",
name: "Flare Developer Hub",
url: "https://dev.flare.network/",
description:
"Official documentation for Flare: tutorials, SDKs, API docs, and AI agent tools.",
publisher: { "@id": "https://flare.network/#organization" },
},
{
"@type": "SoftwareApplication",
"@id": "https://dev.flare.network/#software",
name: "Flare Developer Hub",
applicationCategory: "DeveloperApplication",
operatingSystem: "Web",
url: "https://dev.flare.network/",
description:
"Developer documentation, MCP tools, and Data Availability OpenAPI for building on Flare.",
provider: { "@id": "https://flare.network/#organization" },
},
],
}),
},
],
// Experimental features in preparation for Docusaurus v4 upgrade
// rspack is disabled currently due to bundling performance issues
future: {
v4: true,
experimental_faster: {
swcJsLoader: true,
swcJsMinimizer: true,
swcHtmlMinimizer: true,
lightningCssMinimizer: true,
rspackBundler: false,
rspackPersistentCache: false,
// Worker threads / cross-compiler cache raise peak RSS; keep them off in CI.
ssgWorkerThreads: process.env.CI !== "true",
mdxCrossCompilerCache: process.env.CI !== "true",
},
},
presets: [
[
"classic",
{
docs: {
sidebarPath: "./sidebars.ts",
routeBasePath: "/",
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
editUrl:
"https://github.com/flare-foundation/developer-hub/edit/main",
onInlineTags: "throw",
},
blog: false,
theme: {
customCss: "./src/css/custom.css",
},
gtag: {
trackingID: "G-E6JBVK9HQX",
anonymizeIP: true,
},
googleTagManager: {
containerId: "GTM-WX2D2TR",
},
sitemap: {
lastmod: "date",
ignorePatterns: ["/tags/**", "/**/*.pdf"],
},
} satisfies Preset.Options,
],
],
themeConfig: {
image: "img/flare-developer-hub.png",
colorMode: {
defaultMode: "light",
respectPrefersColorScheme: true,
},
docs: {
sidebar: {
autoCollapseCategories: false,
},
},
navbar: {
title: "Developer Hub",
hideOnScroll: false,
logo: {
alt: "Flare Icon",
src: "img/ui/flare-icon.light.svg",
srcDark: "img/ui/flare-icon.dark.svg",
width: 32,
height: 32,
},
items: [
{
to: "/developers",
label: "Developers",
position: "left",
},
{
href: "https://github.com/flare-foundation/developer-hub",
className: "header-github-link",
"aria-label": "GitHub repository",
position: "right",
},
],
},
footer: {
style: "light",
logo: {
alt: "Flare Logo",
src: "img/ui/footer-logo.light.svg",
srcDark: "img/ui/footer-logo.dark.svg",
href: "https://flare.network/",
width: 405,
height: 35.25,
target: "_blank",
},
links: [
{
title: "Flare",
items: [
{
label: "Support",
href: "https://flare.network/resources/technical-support",
},
{
label: "Brand Kit",
href: "https://flare.network/media",
},
{
label: "Terms & Conditions",
href: "https://flare.network/privacy-policy/",
},
{
label: "UK Disclaimer",
href: "https://flare.network/uk-disclaimer",
},
],
},
{
title: "Resources",
items: [
{
label: "Whitepapers",
to: "/support/whitepapers",
},
{
label: "Audits",
to: "/support/audits",
},
{
label: "FAQs",
to: "/support/faqs",
},
{
label: "FLR",
to: "/support/flr",
},
],
},
{
title: "Explore",
items: [
{
label: "Flare Explorer",
href: "https://flare-explorer.flare.network",
},
{
label: "Systems Explorer",
href: "https://flare-systems-explorer.flare.network",
},
{
label: "Bug Bounty",
href: "https://immunefi.com/bug-bounty/flarenetwork/information/",
},
{
label: "Grants",
href: "https://flare.network/grants",
},
],
},
{
title: "Governance",
items: [
{
label: "Flare Portal",
href: "https://portal.flare.network/",
},
{
label: "Governance Proposals",
href: "https://proposals.flare.network",
},
],
},
],
copyright: `© Flare ${new Date().getFullYear()}`,
},
prism: {
additionalLanguages: ["solidity", "bash", "json", "toml", "diff"],
theme: prismThemes.oneDark,
darkTheme: prismThemes.oneDark,
},
mermaid: {
theme: { light: "neutral", dark: "dark" },
},
} satisfies Preset.ThemeConfig,
themes: [
"@docusaurus/theme-mermaid",
// Building the local search index is memory-heavy and unnecessary for
// lint:build, which only verifies the site compiles.
...(isGitlabCI
? []
: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
language: ["en"],
indexDocs: true,
indexPages: true,
indexBlog: false,
hashed: true,
docsRouteBasePath: "/",
},
],
]),
],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css",
type: "text/css",
integrity:
"sha384-5TcZemv2l/9On385z///+d7MSYlvIEw9FuZTIdZ14vJLqWphw7e7ZPuOiCHJcFCP",
crossorigin: "anonymous",
},
],
plugins: [
require.resolve("./webpack.config.js"),
"docusaurus-plugin-mermaid-pan-zoom",
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
from: "/fassets/direct-minting",
to: "/fassets/minting",
},
{
from: "/fassets/troubleshooting/direct-minting-troubleshooting",
to: "/fassets/troubleshooting/minting-troubleshooting",
},
{
from: "/fassets/developer-guides/fassets-direct-minting",
to: "/fassets/developer-guides/fassets-mint",
},
{
from: "/fassets/developer-guides/fassets-direct-minting-tag",
to: "/fassets/developer-guides/fassets-mint-tag",
},
{
from: "/fassets/developer-guides/fassets-direct-minting-limits",
to: "/fassets/developer-guides/fassets-mint-limits",
},
{
from: "/fassets/developer-guides/fassets-direct-minting-tag-transfer",
to: "/fassets/developer-guides/fassets-mint-tag-transfer",
},
],
},
],
[
"docusaurus-plugin-copy-page-button",
{
mcpServer: {
name: "Flare DevHub MCP Server",
url: "https://dev.flare.network/mcp",
},
},
],
[
"docusaurus-plugin-llms",
{
title: "Flare Developer Hub",
description: "Official documentation for Flare.",
// scope
docsDir: "docs",
// URLs: we use routeBasePath "/" so docs are at root, not /docs
pathTransformation: {
ignorePaths: ["docs"],
},
// outputs
generateLLMsTxt: true,
generateLLMsFullTxt: true,
llmsTxtFilename: "llms.txt",
llmsFullTxtFilename: "llms-full.txt",
// curation
includeOrder: [
"1-intro.mdx",
"developers.mdx",
"about.mdx",
"contact.mdx",
"privacy.mdx",
"**/network/**/*.mdx",
"**/network/**/*.md",
"**/ftso/**/*.mdx",
"**/ftso/**/*.md",
"**/fdc/**/*.mdx",
"**/fdc/**/*.md",
"**/fassets/**/*.mdx",
"**/fassets/**/*.md",
"**/fxrp/**/*.mdx",
"**/fxrp/**/*.md",
"**/smart-accounts/**/*.mdx",
"**/smart-accounts/**/*.md",
"**/fcc/**/*.mdx",
"**/fcc/**/*.md",
"**/run-node/**/*.mdx",
"**/run-node/**/*.md",
"**/support/**/*.mdx",
"**/support/**/*.md",
],
ignoreFiles: [
"**/node_modules/**",
"**/.git/**",
"**/.docusaurus/**",
"**/build/**",
"**/*.txt",
],
includeUnmatchedLast: false,
// cleaning
excludeImports: true,
removeDuplicateHeadings: true,
// consolidate bundles for better retrieval
// no file larger than 250k tokens
customLLMFiles: [
{
filename: "llms-network.txt",
includePatterns: ["**/network/**/*.mdx", "**/network/**/*.md"],
fullContent: true,
title: "Network Documentation",
description:
"Flare Network concepts, integration guides, SDKs, and API/Solidity references",
},
{
filename: "llms-ftso.txt",
includePatterns: ["**/ftso/**/*.mdx", "**/ftso/**/*.md"],
fullContent: true,
title: "FTSO Documentation",
description:
"Flare Time Series Oracle (FTSO) concepts, integration guides, and API/Solidity references",
},
{
filename: "llms-fdc.txt",
includePatterns: ["**/fdc/**/*.mdx", "**/fdc/**/*.md"],
fullContent: true,
title: "FDC Documentation",
description:
"Flare Data Connector (FDC) concepts, integration guides, and API/Solidity references",
},
{
filename: "llms-fassets.txt",
includePatterns: ["**/fassets/**/*.mdx", "**/fassets/**/*.md"],
fullContent: true,
title: "FAssets Documentation",
description:
"FAssets concepts, integration guides, and API/Solidity references",
},
{
filename: "llms-fxrp.txt",
includePatterns: ["**/fxrp/**/*.mdx", "**/fxrp/**/*.md"],
fullContent: true,
title: "FXRP Documentation",
description:
"FXRP utility on Flare, including Firelight/Upshift vaults, OFT auto-mint/redeem, and token interactions",
},
{
filename: "llms-smart-accounts.txt",
includePatterns: [
"**/smart-accounts/**/*.mdx",
"**/smart-accounts/**/*.md",
],
fullContent: true,
title: "Flare Smart Accounts Documentation",
description:
"Account abstraction for XRPL users interacting with Flare, including the MasterAccountController, custom instructions, and CLI guides",
},
{
filename: "llms-fcc.txt",
includePatterns: ["**/fcc/**/*.mdx", "**/fcc/**/*.md"],
fullContent: true,
title: "Flare Confidential Compute Documentation",
description:
"Flare Confidential Compute (FCC) concepts and integration guides using Trusted Execution Environments",
},
{
filename: "llms-node-operators.txt",
includePatterns: ["**/run-node/**/*.mdx", "**/run-node/**/*.md"],
fullContent: true,
title: "Flare Node Documentation",
description: "Runbooks and guides for Flare node operators",
},
{
filename: "llms-reference.txt",
includePatterns: [
"**/solidity-reference/**/*.mdx",
"**/solidity-reference/**/*.md",
"**/reference/**/*.mdx",
"**/reference/**/*.md",
],
fullContent: true,
title: "API and Solidity Reference (All Modules)",
description:
"Consolidated interfaces and API references across Network, FTSO, FDC and FAssets.",
},
],
},
],
[
"docusaurus-plugin-mcp-server",
{
server: {
name: "Flare DevHub MCP Server",
version: "1.0.0",
},
},
],
],
scripts: [
// Defer cookie script loading until after page load
{
src: "/js/cookie-loader.js",
defer: true,
},
],
};
export default config;