Skip to content

Commit 9fcf1a0

Browse files
authoredJun 14, 2024··
Update npm dependencies and add docusaurus-json-schema-plugin (#49)
* Update npm dependencies and add docusaurus-json-schema-plugin * Show CodeRabbit config schema from a file
1 parent 26743c0 commit 9fcf1a0

File tree

9 files changed

+834
-312
lines changed

9 files changed

+834
-312
lines changed
 

‎docs/guides/configure-coderabbit.md

Lines changed: 0 additions & 256 deletions
This file was deleted.

‎docs/guides/configure-coderabbit.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Configure CodeRabbit
3+
sidebar_label: Configure CodeRabbit
4+
description:
5+
CodeRabbit offers various configuration options to tailor the reviews to your
6+
specific requirements. Configuration can be made using one of the below
7+
options.
8+
sidebar_position: 2
9+
---
10+
11+
import SchemaViewer from "@site/src/components/SchemaViewer";
12+
13+
CodeRabbit offers various configuration options to tailor the reviews to your
14+
requirements. Configuration can be made using one of the below options, in order
15+
of precedence:
16+
17+
1. Configure using CodeRabbit YAML file
18+
2. Configure using CodeRabbit UI for each repository
19+
3. Configure using CodeRabbit UI for the organization
20+
21+
In this guide, we will cover the configuration using a YAML file.
22+
23+
## Configure CodeRabbit using a YAML File
24+
25+
You can add a `.coderabbit.yaml` configuration file to the root of your
26+
repositories. Below is a sample YAML file that can be used as a starting point
27+
and changed as needed:
28+
29+
<SchemaViewer />
30+
31+
Refer:
32+
[CodeRabbit Configuration Schema](https://coderabbit.ai/integrations/schema.v2.json).
33+
34+
Please note that code reviews commence with new pull requests or incremental
35+
commits to existing pull requests once the CodeRabbit app is installed. Should
36+
you have any questions or require assistance, our support team is here to help.

‎docs/guides/review-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 3
99
---
1010

1111
The guide explains how to add custom review instructions for the entire project.
12-
Also, see the guide on how to [configure CodeRabbit](./configure-coderabbit.md).
12+
Also, see the guide on how to [configure CodeRabbit](./configure-coderabbit.mdx).
1313

1414
### Path-based instructions {#path-based}
1515

‎docusaurus.config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ const config: Config = {
111111
],
112112
],
113113

114+
themes: ["docusaurus-json-schema-plugin"],
115+
114116
scripts: [
115117
"https://buttons.github.io/buttons.js",
116118
"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js",
@@ -167,9 +169,6 @@ const config: Config = {
167169

168170
// Optional: path for search page that enabled by default (`false` to disable it)
169171
searchPagePath: "search",
170-
171-
// Optional: whether the insights feature is enabled or not on Docsearch (`false` by default)
172-
insights: false,
173172
},
174173
} satisfies Preset.ThemeConfig,
175174
};

‎package-lock.json

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,54 @@
11
{
2-
"name": "coderabbit-docs",
3-
"version": "0.0.0",
4-
"private": true,
5-
"scripts": {
6-
"docusaurus": "docusaurus",
7-
"start": "docusaurus start",
8-
"build": "docusaurus build",
9-
"swizzle": "docusaurus swizzle",
10-
"deploy": "docusaurus deploy",
11-
"clear": "docusaurus clear",
12-
"serve": "docusaurus serve",
13-
"write-translations": "docusaurus write-translations",
14-
"write-heading-ids": "docusaurus write-heading-ids",
15-
"typecheck": "tsc"
16-
},
17-
"dependencies": {
18-
"@docusaurus/core": "^3.1.1",
19-
"@docusaurus/plugin-client-redirects": "^3.1.1",
20-
"@docusaurus/plugin-content-blog": "^3.1.1",
21-
"@docusaurus/preset-classic": "^3.1.1",
22-
"@mdx-js/react": "^3.0.0",
23-
"autoprefixer": "^10.4.16",
24-
"clsx": "^2.0.0",
25-
"disqus-react": "^1.1.5",
26-
"postcss": "^8.4.32",
27-
"prism-react-renderer": "^2.3.0",
28-
"react": "^18.0.0",
29-
"react-dom": "^18.0.0",
30-
"tailwindcss": "^3.4.0"
31-
},
32-
"devDependencies": {
33-
"@docusaurus/module-type-aliases": "^3.1.1",
34-
"@docusaurus/tsconfig": "^3.1.1",
35-
"@docusaurus/types": "^3.1.1",
36-
"typescript": "~5.2.2"
37-
},
38-
"browserslist": {
39-
"production": [
40-
">0.5%",
41-
"not dead",
42-
"not op_mini all"
43-
],
44-
"development": [
45-
"last 3 chrome version",
46-
"last 3 firefox version",
47-
"last 5 safari version"
48-
]
49-
},
50-
"engines": {
51-
"node": ">=18.0"
52-
}
2+
"name": "coderabbit-docs",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"docusaurus": "docusaurus",
7+
"start": "docusaurus start",
8+
"build": "docusaurus build",
9+
"swizzle": "docusaurus swizzle",
10+
"deploy": "docusaurus deploy",
11+
"clear": "docusaurus clear",
12+
"serve": "docusaurus serve",
13+
"write-translations": "docusaurus write-translations",
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"typecheck": "tsc"
16+
},
17+
"dependencies": {
18+
"@docusaurus/core": "^3.1.1",
19+
"@docusaurus/plugin-client-redirects": "^3.1.1",
20+
"@docusaurus/plugin-content-blog": "^3.1.1",
21+
"@docusaurus/preset-classic": "^3.1.1",
22+
"@mdx-js/react": "^3.0.0",
23+
"autoprefixer": "^10.4.16",
24+
"clsx": "^2.0.0",
25+
"disqus-react": "^1.1.5",
26+
"docusaurus-json-schema-plugin": "^1.12.1",
27+
"postcss": "^8.4.32",
28+
"prism-react-renderer": "^2.3.0",
29+
"react": "^18.0.0",
30+
"react-dom": "^18.0.0",
31+
"tailwindcss": "^3.4.0"
32+
},
33+
"devDependencies": {
34+
"@docusaurus/module-type-aliases": "^3.1.1",
35+
"@docusaurus/tsconfig": "^3.1.1",
36+
"@docusaurus/types": "^3.1.1",
37+
"typescript": "~5.2.2"
38+
},
39+
"browserslist": {
40+
"production": [
41+
">0.5%",
42+
"not dead",
43+
"not op_mini all"
44+
],
45+
"development": [
46+
"last 3 chrome version",
47+
"last 3 firefox version",
48+
"last 5 safari version"
49+
]
50+
},
51+
"engines": {
52+
"node": ">=18.0"
53+
}
5354
}

‎src/components/SchemaViewer.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Schema from "@site/static/schema/schema.v2.json";
2+
import JSONSchemaViewer from "@theme/JSONSchemaViewer";
3+
4+
export default function Viewer(): JSX.Element {
5+
return <JSONSchemaViewer schema={Schema.definitions.schema} />;
6+
}

‎static/schema/schema.v2.json

Lines changed: 584 additions & 0 deletions
Large diffs are not rendered by default.

‎tsconfig.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
// This file is not used in compilation. It is here just for a nice editor experience.
33
"extends": "@docusaurus/tsconfig",
44
"compilerOptions": {
5-
"baseUrl": "."
5+
"baseUrl": ".",
6+
"resolveJsonModule": true,
7+
// Extending "@tsconfig/docusaurus/tsconfig.json".types with "docusaurus-json-schema-plugin"
8+
"types": [
9+
"node",
10+
"@docusaurus/module-type-aliases",
11+
"@docusaurus/theme-classic",
12+
"docusaurus-json-schema-plugin"
13+
]
614
}
715
}

0 commit comments

Comments
 (0)
Please sign in to comment.