Skip to content

Commit 6d52cfc

Browse files
Aditya-eddySonichigonehagup
authored andcommitted
refactor: upgrading Docusaurus to v3 (#374)
* upgrading to v3 Signed-off-by: Aditya-eddy <[email protected]> * correcting the mdx Signed-off-by: Aditya-eddy <[email protected]> * removing remark plugins Signed-off-by: Aditya-eddy <[email protected]> * correcting some files Signed-off-by: Aditya-eddy <[email protected]> * adding the commented code Signed-off-by: Aditya-eddy <[email protected]> * removing the plugin Signed-off-by: Aditya-eddy <[email protected]> * trying nodejs version 18 Signed-off-by: Aditya-eddy <[email protected]> * errors Signed-off-by: Aditya-eddy <[email protected]> * resolving anchors Signed-off-by: Aditya-eddy <[email protected]> * swizzling the heading component Signed-off-by: Aditya-eddy <[email protected]> --------- Signed-off-by: Aditya-eddy <[email protected]> Co-authored-by: Animesh Pathak <[email protected]> Co-authored-by: Neha Gupta <[email protected]>
1 parent 30b49a0 commit 6d52cfc

File tree

26 files changed

+3847
-2740
lines changed

26 files changed

+3847
-2740
lines changed

.github/workflows/build_and_check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Node.js
1919
uses: actions/setup-node@v2
2020
with:
21-
node-version: 16.14
21+
node-version: 18.0.0
2222

2323
- name: Install Yarn
2424
run: npm install -g yarn

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1212
jobs:
1313
# This workflow contains a single job called "build"
14-
build:
14+
build:
1515
# The type of runner that the job will run on
1616
runs-on: ubuntu-latest
1717
env:

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The command starts a local development server and opens a browser window.
3535

3636
<br/>
3737

38-
2. Clone the repository with the following command. Replace the <GITHUB_USERNAME> with your username
38+
2. Clone the repository with the following command. Replace the {'<'}GITHUB_USERNAME{'>'} with your username
3939

4040
```sh
4141
git clone https://github.com/<GITHUB_USERNAME>/docs.git

README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@ Repository for the Keploy documentation website.
1414

1515
<p align="center">
1616
<a href="https://github.com/keploy/docs" alt="GitHub contributors">
17-
<img src="https://img.shields.io/github/contributors/keploy/docs.svg" /><a>
17+
<img src="https://img.shields.io/github/contributors/keploy/docs.svg" />
18+
</a>
1819
<a href="https://github.com/keploy/docs" alt="GitHub issues by-label">
19-
<img src="https://img.shields.io/github/issues/keploy/docs" /></a>
20+
<img src="https://img.shields.io/github/issues/keploy/docs" />
21+
</a>
2022
<a href="https://keploy.slack.com/" alt="Slack">
21-
<img src="https://img.shields.io/badge/[email protected]?logo=slack" /></a>
23+
<img src="https://img.shields.io/badge/[email protected]?logo=slack" />
24+
</a>
2225
<a href="https://twitter.com/Keployio" alt="Twitter Follow">
23-
<img src="https://img.shields.io/twitter/follow/keploy.svg?label=Follow&style=social" /></a>
26+
<img src="https://img.shields.io/twitter/follow/keploy.svg?label=Follow&style=social" />
27+
</a>
2428
<a href="https://github.com/keploy/docs" alt="License">
25-
<img src="https://img.shields.io/github/license/keploy/docs.svg" /></a>
29+
<img src="https://img.shields.io/github/license/keploy/docs.svg" />
30+
</a>
2631
</p>
2732

2833
[Keploy](https://keploy.io) is a no-code testing platform that generates tests from API calls.
@@ -75,7 +80,7 @@ The command starts a local development server and opens a browser window.
7580

7681
<br/>
7782

78-
2. Clone the repository with the following command. Replace the <GITHUB_USERNAME> with your username
83+
2. Clone the repository with the following command. Replace the {'<'}GITHUB_USERNAME{'>'} with your username
7984

8085
```sh
8186
git clone https://github.com/<GITHUB_USERNAME>/docs.git

docusaurus.config.js

+6-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ts-check
2+
3+
import {themes as prismThemes} from "prism-react-renderer";
24
const path = require("path");
3-
const visit = require("unist-util-visit");
5+
import {visit} from "unist-util-visit";
46
const FontPreloadPlugin = require("webpack-font-preload-plugin");
57

68
/** @type {import('@docusaurus/types').DocusaurusConfig} */
@@ -100,9 +102,9 @@ module.exports = {
100102
content: `⭐️ If you like Keploy, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/keploy/keploy">GitHub</a> and follow us on <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/keployio">Twitter</a> ❤️ `,
101103
},
102104
prism: {
103-
theme: require("prism-react-renderer/themes/vsLight"),
104-
darkTheme: require("prism-react-renderer/themes/dracula"),
105-
additionalLanguages: ["java", "ruby", "php"],
105+
theme: prismThemes.vsLight,
106+
darkTheme: prismThemes.dracula,
107+
additionalLanguages: ["java", "ruby", "php", "bash"],
106108
},
107109
// hideableSidebar: true,
108110
navbar: {
@@ -245,25 +247,6 @@ module.exports = {
245247
},
246248
{},
247249
],
248-
[
249-
require("remark-typescript-tools").transpileCodeblocks,
250-
{
251-
compilerSettings: {
252-
tsconfig: path.join(
253-
__dirname,
254-
"docs",
255-
"typescript",
256-
"tsconfig.json"
257-
),
258-
externalResolutions: {},
259-
},
260-
fileExtensions: [".md", ".mdx"],
261-
// remark-typescript-tools automatically running prettier with a custom config that doesn't
262-
// line up with ours. This disables any post processing, including the default prettier step.
263-
postProcessTs: (files) => files,
264-
postProcessTranspiledJs: (files) => files,
265-
},
266-
],
267250
[
268251
() =>
269252
function removeTSNoCheck(tree) {

package.json

+17-13
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,35 @@
1919
"**/*": "prettier --write --ignore-unknown"
2020
},
2121
"dependencies": {
22-
"@docusaurus/core": "^2.4.1",
23-
"@docusaurus/plugin-sitemap": "^2.4.1",
24-
"@docusaurus/preset-classic": "^2.0.0-beta.16",
25-
"@mdx-js/react": "^1.5.8",
26-
"clsx": "^1.1.1",
22+
"@docusaurus/core": "^3.2.1",
23+
"@docusaurus/plugin-sitemap": "^3.2.1",
24+
"@docusaurus/preset-classic": "^3.2.1",
25+
"@mdx-js/react": "^3.0.0",
26+
"clsx": "^2.0.0",
2727
"lint": "^0.8.19",
28-
"react": "^17.0.2",
29-
"react-dom": "^17.0.2",
28+
"react": "^18.2.0",
29+
"react-dom": "^18.2.0",
3030
"react-player": "^2.6.0",
31+
"prism-react-renderer": "^2.1.0",
3132
"remark-typescript-tools": "1.0.9",
32-
"typescript": "4.x",
33+
"typescript": "5",
3334
"uuid": "^8.3.2",
3435
"webpack-font-preload-plugin": "^1.5.0"
3536
},
3637
"browserslist": {
3738
"production": [
38-
">0.2%",
39+
">0.5%",
3940
"not dead",
4041
"not op_mini all"
4142
],
4243
"development": [
43-
"last 1 chrome version",
44-
"last 1 firefox version",
45-
"last 1 safari version"
44+
"last 3 chrome version",
45+
"last 3 firefox version",
46+
"last 5 safari version"
4647
]
4748
},
4849
"devDependencies": {
49-
"@docusaurus/plugin-client-redirects": "^2.4.1",
50+
"@docusaurus/plugin-client-redirects": "^3.2.1",
5051
"@tailwindcss/typography": "^0.5.0",
5152
"autoprefixer": "^10.4.0",
5253
"docusaurus": "^1.14.7",
@@ -61,5 +62,8 @@
6162
"prettier": "^2.5.1",
6263
"prettier-plugin-tailwindcss": "^0.1.4",
6364
"tailwindcss": "^3.0.1"
65+
},
66+
"engines": {
67+
"node":">=18.0"
6468
}
6569
}

src/theme/BlogLayout/index.js

-40
This file was deleted.

0 commit comments

Comments
 (0)