Skip to content

Commit

Permalink
Bump to Docusaurus 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Jan 8, 2024
1 parent b8b24ec commit defb295
Show file tree
Hide file tree
Showing 14 changed files with 287 additions and 282 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ accordingly.

While all markdown files inside `docs` are compiled, not all files may be
reachable via sidebars directly. Each top-level chapter defines own
sidebar structure inside their `sidebarChapterName.js` file.
sidebar structure inside their `sidebarChapterName.ts` file.

Nouns, adjectives and verbs in the titles should be capitalized.

Expand Down Expand Up @@ -174,7 +174,7 @@ To define the region in the referenced file put `#region some-region-name` and

When you move, rename or delete previously published content, make sure that
**any previously valid URL will always point to the new valid location**. Set
up redirects in `redirects.js` accordingly and leave the pull request
up redirects in `redirects.ts` accordingly and leave the pull request
number in the comment which added this redirection for future reference, if
major rewrite is to happen and the developers would need more context around
the redirection.
Expand Down
29 changes: 16 additions & 13 deletions docusaurus.config.js → docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

import {editLinkUrl as editUrlFunction} from './src/editUrl';
import crossRepoLinksPlugin from './src/remark/cross-repo-links';
import codeBlockSnippetsPlugin from './src/remark/code-block-snippets';
import {redirectsOptions} from './redirects';
import {sidebars} from './sidebars';

/** @type {import('@docusaurus/types').Config} */
const config = {
const config: Config = {
title: 'Oasis Documentation',
tagline: '',
url: process.env.URL ?? 'https://docs.oasis.io',
Expand All @@ -19,11 +19,15 @@ const config = {
projectName: 'docs', // Usually your repo name.
deploymentBranch: 'gh-pages',

i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
{
docs: {
breadcrumbs: false,
editUrl: editUrlFunction,
Expand All @@ -43,13 +47,13 @@ const config = {
],
routeBasePath: '/',
showLastUpdateTime: true,
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: './sidebars.ts',
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
} satisfies Preset.Options,
],
],
plugins: [
Expand All @@ -67,7 +71,7 @@ const config = {
},
[
'@docusaurus/plugin-client-redirects',
require('./redirects.js'),
redirectsOptions,
],
],
themes: [
Expand All @@ -80,8 +84,7 @@ const config = {
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
{
navbar: {
title: 'Oasis Docs',
logo: {
Expand Down Expand Up @@ -238,7 +241,7 @@ Apache 2.0</a>. Built with &#x2665; and Docusaurus.</p>`,
colorMode: {
respectPrefersColorScheme: true,
},
}),
} satisfies Preset.ThemeConfig,
};

module.exports = config;
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "docs-oasis-dev",
"name": "docs-oasis-io",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -14,15 +14,16 @@
"test": "jest src",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"blc": "linkinator http://localhost:3000 --config linkinator.config.json",
"lint-markdown": "markdownlint-cli2 'docs/**/*.md' 'docs/**/*.mdx'",
"fmt-markdown": "markdownlint-cli2-fix 'docs/**/*.md' 'docs/**/*.mdx'"
},
"dependencies": {
"@docusaurus/core": "^3.0.1",
"@docusaurus/plugin-client-redirects": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@docusaurus/remark-plugin-npm2yarn": "^3.0.1",
"@docusaurus/core": "^3.1.0",
"@docusaurus/plugin-client-redirects": "^3.1.0",
"@docusaurus/preset-classic": "^3.1.0",
"@docusaurus/remark-plugin-npm2yarn": "^3.1.0",
"@easyops-cn/docusaurus-search-local": "^0.40.1",
"@mdx-js/react": "^3.0.0",
"@mermaid-js/mermaid-cli": "^10.6.1",
Expand Down Expand Up @@ -51,6 +52,13 @@
"devDependencies": {
"@types/plotly.js-basic-dist": "^1.54.4",
"@types/react-plotly.js": "^2.6.3",
"jest": "^29.7.0"
"@docusaurus/module-type-aliases": "^3.1.0",
"@docusaurus/tsconfig": "^3.1.0",
"@docusaurus/types": "^3.1.0",
"jest": "^29.7.0",
"typescript": "~5.2.2"
},
"engines": {
"node": ">=18.0"
}
}
7 changes: 2 additions & 5 deletions redirects.js → redirects.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import PluginOptions from '@docusaurus/plugin-client-redirects';

/** @type {import('@docusaurus/plugin-client-redirects').PluginOptions} */
const redirectsOptions = {
export const redirectsOptions: PluginOptions = {
redirects: [
// Write down PR responsible for the removal of a page next to the "from" redirect.
// TODO: Add fragments (anchors) in "to" URLs once https://github.com/facebook/docusaurus/issues/6845 is implemented. Since then, put the fragment name in the comment.
Expand Down Expand Up @@ -270,5 +269,3 @@ const redirectsOptions = {
return undefined;
},
};

module.exports = redirectsOptions
7 changes: 2 additions & 5 deletions sidebarAdrs.js → sidebarAdrs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarAdrs: SidebarsConfig = {
adrs: [
{
type: 'category',
Expand All @@ -20,5 +19,3 @@ const sidebars = {
}
],
};

module.exports = sidebars;
7 changes: 2 additions & 5 deletions sidebarCore.js → sidebarCore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarCore: SidebarsConfig = {
oasisCore: [
{
type: 'doc',
Expand Down Expand Up @@ -174,5 +173,3 @@ const sidebars = {
},
],
};

module.exports = sidebars;
7 changes: 2 additions & 5 deletions sidebarDapp.js → sidebarDapp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarDapp: SidebarsConfig = {
developers: [
{
type: 'doc',
Expand Down Expand Up @@ -84,5 +83,3 @@ const sidebars = {
},
],
};

module.exports = sidebars;
7 changes: 2 additions & 5 deletions sidebarGeneral.js → sidebarGeneral.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarGeneral: SidebarsConfig = {
general: [
{
type: 'doc',
Expand Down Expand Up @@ -87,5 +86,3 @@ const sidebars = {
},
],
};

module.exports = sidebars;
7 changes: 2 additions & 5 deletions sidebarGetInvolved.js → sidebarGetInvolved.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarGetInvolved: SidebarsConfig = {
getInvolved: [
'get-involved/README',
{
Expand Down Expand Up @@ -48,5 +47,3 @@ const sidebars = {
'get-involved/token-delivery-and-kyc',
],
};

module.exports = sidebars;
7 changes: 2 additions & 5 deletions sidebarNode.js → sidebarNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarNode: SidebarsConfig = {
operators: [
{
type: 'doc',
Expand Down Expand Up @@ -134,5 +133,3 @@ const sidebars = {
},
],
};

module.exports = sidebars;
7 changes: 2 additions & 5 deletions sidebarParatime.js → sidebarParatime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
export const sidebarParaTime: SidebarsConfig = {
paratime: [
{
type: 'doc',
Expand Down Expand Up @@ -29,5 +28,3 @@ const sidebars = {
},
],
};

module.exports = sidebars;
14 changes: 0 additions & 14 deletions sidebars.js

This file was deleted.

21 changes: 21 additions & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {SidebarsConfig} from '@docusaurus/plugin-content-docs';

import {sidebarAdrs} from './sidebarAdrs';
import {sidebarCore} from './sidebarCore';
import {sidebarDapp} from './sidebarDapp';
import {sidebarGeneral} from './sidebarGeneral';
import {sidebarGetInvolved} from './sidebarGetInvolved';
import {sidebarNode} from './sidebarNode';
import {sidebarParaTime} from './sidebarParatime';

const sidebars: SidebarsConfig = {
...sidebarAdrs,
...sidebarCore,
...sidebarDapp,
...sidebarGeneral,
...sidebarGetInvolved,
...sidebarNode,
...sidebarParaTime,
};

export default sidebars;
Loading

0 comments on commit defb295

Please sign in to comment.