diff --git a/docusaurus.config.js b/docusaurus.config.js deleted file mode 100644 index 9d6aa4ae..00000000 --- a/docusaurus.config.js +++ /dev/null @@ -1,268 +0,0 @@ -// @ts-check -// Note: type annotations allow type checking and IDEs autocompletion - -const { themes } = require('prism-react-renderer') -const lightCodeTheme = themes.github -const darkCodeTheme = themes.dracula - -/** @type {import('@docusaurus/types').Config} */ -const config = { - title: "Fuse Documentation", - url: "https://docs.fuse.io", - baseUrl: "/", - onBrokenLinks: 'log', - onBrokenMarkdownLinks: 'warn', - favicon: "img/logo.svg", - staticDirectories: ["static"], - - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. - organizationName: "fuse", // Usually your GitHub org/user name. - projectName: "docusaurus", // Usually your repo name. - - // Even if you don't use internalization, you can use this field to set useful - // metadata like html lang. For example, if your site is Chinese, you may want - // to replace "en" with "zh-Hans". - i18n: { - defaultLocale: "en", - locales: ["en"], - }, - - presets: [ - [ - "classic", - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ - docs: { - sidebarPath: require.resolve("./sidebars.js"), - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - // exclude: ['**/developers/*/*README.md'], - // docLayoutComponent: "@theme/DocPage", - docItemComponent: "@theme/ApiItem", - }, - gtag: { - trackingID: "G-ZQQQ9Q88VY", - anonymizeIP: true, - }, - blog: { - blogTitle: "Changelog", - blogSidebarTitle: "Recent Changes", - postsPerPage: "ALL", - routeBasePath: "/changelog", - showReadingTime: true, - readingTime: ({ content, frontMatter, defaultReadingTime }) => - defaultReadingTime({ content, options: { wordsPerMinute: 300 } }), - }, - theme: { - customCss: require.resolve("./src/css/custom.css"), - }, - }), - ], - ], - - themeConfig: - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - - ({ - prism: { - additionalLanguages: ["dart", "solidity"], - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - }, - colorMode: { - defaultMode: "light", - disableSwitch: true, - respectPrefersColorScheme: false, - }, - // Replace with your project's social card - image: "img/docusaurus-social-card.jpg", - - algolia: { - // The application ID provided by Algolia - appId: "NPQ4ZLHJEE", - - // Public API key: it is safe to commit it - apiKey: "634a56f04a07683a37e4462981e0a754", - - indexName: "fuseio", - - // Optional: see doc section below - contextualSearch: true, - - // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. - externalUrlRegex: "external\\.com|domain\\.com", - - // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs - - // Optional: Algolia search parameters - searchParameters: {}, - - // Optional: path for search page that enabled by default (`false` to disable it) - searchPagePath: "search", - - //... other Algolia params - }, - navbar: { - logo: { - alt: "Fuse_logo", - src: "img/fuse-logo.svg", - }, - - items: [ - { - type: "docSidebar", - sidebarId: "apiSidebar", - label: "API References", - position: "right", - }, - { - to: "https://discord.com/invite/jpPMeSZ", - label: "Support", - position: "right", - className: "navbar--discord-logo", - }, - { - href: "https://discord.com/invite/jpPMeSZ", - position: "right", - className: "navbar--discord-link", - }, - { - type: "search", - position: "right", - }, - { - type: "docSidebar", - sidebarId: "basicsSidebar", - position: "left", - label: "Basics", - }, - { - type: "doc", - docId: "developers/Quick-Start", - position: "left", - label: "Developers", - }, - { - type: "docSidebar", - sidebarId: "validatorsSidebar", - position: "left", - label: "Validators", - }, - { - type: "docSidebar", - sidebarId: "tutorialsSidebar", - position: "left", - label: "Tutorials", - }, - // {to: '/changelog', label: 'Changelog', position: 'left'} - ], - }, - footer: { - style: "light", - links: [ - { - title: "Getting Started", - items: [ - { label: "Fuse Network", to: "https://www.fuse.io/network" }, - { - label: "Mobile Stack", - to: "https://www.fuse.io/mobile", - }, - { - label: "Voltage Finance", - to: "https://voltage.finance/", - }, - ], - }, - { - title: "Under the hood", - items: [ - { - label: "Explorer", - to: "https://explorer.fuse.io/", - }, - { - label: "Documentation", - to: "https://docs.fuse.io/", - }, - { - label: "Staking", - to: "https://staking.fuse.io/", - }, - { - label: "Governance", - to: "https://forum.fuse.io/", - }, - { - label: "Service Status", - to: "https://status.fuse.io/", - }, - ], - }, - { - title: "General", - items: [ - { - label: "Brand kits", - to: "https://uploads-ssl.webflow.com/63a6d0820bd1f472b4150067/63f758e4017a399398360f78_Brand%20kit.pdf", - }, - { - label: "Jobs", - to: "https://fuse.freshteam.com/jobs", - }, - ], - }, - ], - copyright: `© ${new Date().getFullYear()} Fuse. All Rights Reserved`, - }, - }), - plugins: [ - [ - "docusaurus-plugin-yandex-metrica", - { - counterID: "94018505", - webvisor: true, - }, - ], - [ - "docusaurus-plugin-openapi-docs", - { - id: "api", - docsPluginId: "api", // e.g. "classic" or the plugin-content-docs id - config: { - notificationApi: { - specPath: "api-references/fuse-notification-api.yaml", - outputDir: "docs/notification-api", - sidebarOptions: { - groupPathsBy: "tag", - categoryLinkSource: "tag", - }, - }, - smartWalletApi: { - specPath: "api-references/fuse-smart-wallets-api.yaml", - outputDir: "docs/smart-wallets-api", - sidebarOptions: { - groupPathsBy: "tag", - categoryLinkSource: "tag", - }, - }, - tradeApi: { - specPath: "api-references/trade-api.yaml", - outputDir: "docs/trade-api", - sidebarOptions: { - groupPathsBy: "tag", - categoryLinkSource: "tag", - }, - }, - }, - }, - ], - ], - themes: ["docusaurus-theme-openapi-docs"], - customFields: { - happyReactToken: "c56b4364-23fd-41f1-8f5b-3ebe7f31d082", - }, -}; - -module.exports = config; diff --git a/docusaurus.config.ts b/docusaurus.config.ts new file mode 100644 index 00000000..57c036b3 --- /dev/null +++ b/docusaurus.config.ts @@ -0,0 +1,243 @@ +import { themes as prismThemes } from 'prism-react-renderer'; +import type { Config } from '@docusaurus/types'; + +const config: Config = { + title: "Fuse Documentation", + url: "https://docs.fuse.io", + baseUrl: "/", + onBrokenLinks: 'log', + onBrokenMarkdownLinks: 'warn', + favicon: "img/logo.svg", + staticDirectories: ["static"], + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: "fuse", // Usually your GitHub org/user name. + projectName: "fuse-docs", // Usually your repo name. + // Even if you don't use internalization, you can use this field to set useful + // metadata like html lang. For example, if your site is Chinese, you may want + // to replace "en" with "zh-Hans". + i18n: { + defaultLocale: "en", + locales: ["en"], + }, + presets: [ + [ + "classic", + { + docs: { + sidebarPath: require.resolve("./sidebars.js"), + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + // exclude: ['**/developers/*/*README.md'], + docItemComponent: "@theme/ApiItem", + }, + gtag: { + trackingID: "G-ZQQQ9Q88VY", + anonymizeIP: true, + }, + blog: { + blogTitle: "Changelog", + blogSidebarTitle: "Recent Changes", + postsPerPage: "ALL", + routeBasePath: "/changelog", + showReadingTime: true, + readingTime: ({ content, frontMatter, defaultReadingTime }) => + defaultReadingTime({ content, options: { wordsPerMinute: 300 } }), + }, + theme: { + customCss: require.resolve("./src/css/custom.css"), + }, + }, + ], + ], + themeConfig: { + prism: { + additionalLanguages: ["dart", "solidity"], + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + colorMode: { + defaultMode: "light", + disableSwitch: true, + respectPrefersColorScheme: false, + }, + // Replace with your project's social card + image: "img/docusaurus-social-card.jpg", + algolia: { + // The application ID provided by Algolia + appId: "NPQ4ZLHJEE", + // Public API key: it is safe to commit it + apiKey: "634a56f04a07683a37e4462981e0a754", + indexName: "fuseio", + // Optional: see doc section below + contextualSearch: true, + // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. + externalUrlRegex: "external\\.com|domain\\.com", + // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs + // Optional: Algolia search parameters + searchParameters: {}, + // Optional: path for search page that enabled by default (`false` to disable it) + searchPagePath: "search", + //... other Algolia params + }, + navbar: { + logo: { + alt: "Fuse_logo", + src: "img/fuse-logo.svg", + }, + items: [ + { + type: "docSidebar", + sidebarId: "apiSidebar", + label: "API References", + position: "right", + }, + { + to: "https://discord.com/invite/jpPMeSZ", + label: "Support", + position: "right", + className: "navbar--discord-logo", + }, + { + href: "https://discord.com/invite/jpPMeSZ", + position: "right", + className: "navbar--discord-link", + }, + { + type: "search", + position: "right", + }, + { + type: "docSidebar", + sidebarId: "basicsSidebar", + position: "left", + label: "Basics", + }, + { + type: "doc", + docId: "developers/Quick-Start", + position: "left", + label: "Developers", + }, + { + type: "docSidebar", + sidebarId: "validatorsSidebar", + position: "left", + label: "Validators", + }, + { + type: "docSidebar", + sidebarId: "tutorialsSidebar", + position: "left", + label: "Tutorials", + }, + ], + }, + footer: { + style: "light", + links: [ + { + title: "Getting Started", + items: [ + { label: "Fuse Network", to: "https://www.fuse.io/network" }, + { + label: "Mobile Stack", + to: "https://www.fuse.io/mobile", + }, + { + label: "Voltage Finance", + to: "https://voltage.finance/", + }, + ], + }, + { + title: "Under the hood", + items: [ + { + label: "Explorer", + to: "https://explorer.fuse.io/", + }, + { + label: "Documentation", + to: "https://docs.fuse.io/", + }, + { + label: "Staking", + to: "https://staking.fuse.io/", + }, + { + label: "Governance", + to: "https://forum.fuse.io/", + }, + { + label: "Service Status", + to: "https://status.fuse.io/", + }, + ], + }, + { + title: "General", + items: [ + { + label: "Brand kits", + to: "https://uploads-ssl.webflow.com/63a6d0820bd1f472b4150067/63f758e4017a399398360f78_Brand%20kit.pdf", + }, + { + label: "Jobs", + to: "https://fuse.freshteam.com/jobs", + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} Fuse. All Rights Reserved`, + }, + }, + plugins: [ + [ + "docusaurus-plugin-yandex-metrica", + { + counterID: "94018505", + webvisor: true, + }, + ], + [ + "docusaurus-plugin-openapi-docs", + { + id: "api", + docsPluginId: "api", // e.g. "classic" or the plugin-content-docs id + config: { + notificationApi: { + specPath: "api-references/fuse-notification-api.yaml", + outputDir: "docs/notification-api", + sidebarOptions: { + groupPathsBy: "tag", + categoryLinkSource: "tag", + }, + }, + smartWalletApi: { + specPath: "api-references/fuse-smart-wallets-api.yaml", + outputDir: "docs/smart-wallets-api", + sidebarOptions: { + groupPathsBy: "tag", + categoryLinkSource: "tag", + }, + }, + tradeApi: { + specPath: "api-references/trade-api.yaml", + outputDir: "docs/trade-api", + sidebarOptions: { + groupPathsBy: "tag", + categoryLinkSource: "tag", + }, + }, + }, + }, + ], + ], + themes: ["docusaurus-theme-openapi-docs"], + customFields: { + happyReactToken: "c56b4364-23fd-41f1-8f5b-3ebe7f31d082", + }, +}; + +module.exports = config; diff --git a/package.json b/package.json index 952a6de0..e590dd4f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ "title": "^3.5.3" }, "devDependencies": { - "@docusaurus/module-type-aliases": "^3.1.0" + "@docusaurus/module-type-aliases": "3.1.0", + "@docusaurus/tsconfig": "3.1.0", + "@docusaurus/types": "3.1.0", + "typescript": "~5.2.2" }, "browserslist": { "production": [ @@ -48,4 +51,4 @@ "last 1 safari version" ] } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..9b76ec0a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + // This file is not used in compilation. It is here just for a nice editor experience. + "extends": "@docusaurus/tsconfig", + "compilerOptions": { + "baseUrl": "." + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 11d79338..11918fb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1584,7 +1584,7 @@ vfile "^6.0.1" webpack "^5.88.1" -"@docusaurus/module-type-aliases@3.1.0", "@docusaurus/module-type-aliases@^3.1.0": +"@docusaurus/module-type-aliases@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@docusaurus/module-type-aliases/-/module-type-aliases-3.1.0.tgz#f3451702f143557bfde0502287713a08086a0415" integrity sha512-XUl7Z4PWlKg4l6KF05JQ3iDHQxnPxbQUqTNKvviHyuHdlalOFv6qeDAm7IbzyQPJD5VA6y4dpRbTWSqP9ClwPg== @@ -1823,6 +1823,11 @@ fs-extra "^11.1.1" tslib "^2.6.0" +"@docusaurus/tsconfig@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@docusaurus/tsconfig/-/tsconfig-3.1.0.tgz#ab6936a72b5a52904f37c0ef7d65c6d6aa6ab46d" + integrity sha512-PE6fSuj5gJy5sNC1OO+bYAU1/xZH5YqddGjhrNu3/T7OAUroqkMZfVl13Tz70CjYB8no4OWcraqSkObAeNdIcQ== + "@docusaurus/types@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@docusaurus/types/-/types-3.1.0.tgz#1dbb60ea38e98ba869f8d7ea2323e4460f05ab65" @@ -14525,6 +14530,11 @@ typescript@^4.6.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typescript@~5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" + integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== + ua-parser-js@^1.0.35: version "1.0.37" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.37.tgz#b5dc7b163a5c1f0c510b08446aed4da92c46373f"