Skip to content

Commit a630be3

Browse files
authored
Merge pull request #52 from nickgros/docusaurus
2 parents 592cd21 + bcf5397 commit a630be3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+21958
-68
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,59 @@ jobs:
2424
- run: npm run cs-check
2525

2626
- name: Build with Netlify badge
27-
if: github.ref != 'refs/heads/main'
27+
if: github.ref != 'refs/heads/main' && matrix.node-version != '14.x'
2828
run: npm run build
2929
env:
3030
VITE_SHOW_NETLIFY_BADGE: true
3131
NODE_OPTIONS: --max_old_space_size=4096
32+
3233
- name: Build
33-
if: github.ref == 'refs/heads/main'
34+
if: github.ref == 'refs/heads/main' && matrix.node-version != '14.x'
3435
run: npm run build
3536
env:
3637
NODE_OPTIONS: --max_old_space_size=4096
3738

39+
# Docusaurus doesn't support Node 14. These tasks can be removed once Node 14 is EOL (May 2023)
40+
- name: Build with Netlify badge (no docs)
41+
if: github.ref != 'refs/heads/main' && matrix.node-version == '14.x'
42+
run: npx nx run-many --target=build --exclude=docs
43+
env:
44+
VITE_SHOW_NETLIFY_BADGE: true
45+
NODE_OPTIONS: --max_old_space_size=4096
46+
- name: Build (no docs)
47+
if: github.ref == 'refs/heads/main' && matrix.node-version == '14.x'
48+
run: npx nx run-many --target=build --exclude=docs
49+
env:
50+
NODE_OPTIONS: --max_old_space_size=4096
51+
3852
- if: matrix.node-version == '18.x'
3953
uses: actions/upload-artifact@v3
4054
with:
41-
name: dist
55+
name: playground
4256
path: packages/playground/dist
57+
- if: matrix.node-version == '18.x'
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: docs
61+
path: packages/docs/build
4362
- run: npm test
44-
45-
deploy_playground:
63+
deploy_playground_and_docs:
4664
runs-on: ubuntu-latest
4765
if: github.ref == 'refs/heads/main'
48-
name: Deploy playground to GitHub Pages
66+
name: Deploy playground and docs to GitHub Pages
4967
needs: [build]
5068
steps:
51-
- name: Download built files
69+
- name: Download built playground
5270
uses: actions/download-artifact@v3
5371
with:
5472
name: dist
5573
path: dist
56-
- name: Deploy playground
74+
- name: Download built docs
75+
uses: actions/download-artifact@v3
76+
with:
77+
name: docs
78+
path: dist/docs
79+
- name: Deploy playground + docs to GitHub Pages
5780
uses: crazy-max/ghaction-github-pages@v3.1.0
5881
with:
5982
keep_history: true
@@ -62,7 +85,7 @@ jobs:
6285
env:
6386
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6487

65-
docs:
88+
old_docs:
6689
runs-on: ubuntu-latest
6790
steps:
6891
- uses: actions/checkout@v3

packages/docs/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

packages/docs/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

packages/docs/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/advanced-customization/custom-templates.md renamed to packages/docs/docs/advanced-customization/custom-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ render((
976976

977977
The `SubmitButton` is already very customizable via the `UISchemaSubmitButtonOptions` capabilities in the `uiSchema` but it can also be fully customized as you see fit.
978978
> NOTE: However you choose to implement this, making it something other than a `submit` type `button` may result in the `Form` not submitting when pressed.
979-
> You could also choose to provide your own submit button as the [children prop](https://react-jsonschema-form.readthedocs.io/en/stable/api-reference/form-props#children) of the `Form` should you so choose.
979+
> You could also choose to provide your own submit button as the [children prop](../api-reference/form-props#children) of the `Form` should you so choose.
980980
981981
```tsx
982982
import React from "react";
File renamed without changes.
File renamed without changes.

docs/advanced-customization/internals.md renamed to packages/docs/docs/advanced-customization/internals.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Miscellaneous internals of react-jsonschema-form are listed here.
44

55
## JSON Schema supporting status
66

7-
This component follows [JSON Schema](http://json-schema.org/documentation.html) specs. We currently support JSON Schema-07 by default, but we also support other JSON schema versions through the [custom schema validation](https://react-jsonschema-form.readthedocs.io/en/stable/validation/#custom-schema-validation) feature. Due to the limitation of form widgets, there are some exceptions as follows:
7+
This component follows [JSON Schema](http://json-schema.org/documentation.html) specs. We currently support JSON Schema-07 by default, but we also support other JSON schema versions through the [custom schema validation](../usage/validation#custom-meta-schema-validation) feature. Due to the limitation of form widgets, there are some exceptions as follows:
88

99
* `additionalItems` keyword for arrays
1010

@@ -14,15 +14,15 @@ This component follows [JSON Schema](http://json-schema.org/documentation.html)
1414

1515
The `anyOf` and `oneOf` keywords are supported; however, properties declared inside the `anyOf/oneOf` should not overlap with properties "outside" of the `anyOf/oneOf`.
1616

17-
You can also use `oneOf` with [schema dependencies](https://react-jsonschema-form.readthedocs.io/en/docs/usage/dependencies/#schema-dependencies) to dynamically add schema properties based on input data.
17+
You can also use `oneOf` with [schema dependencies](../usage/dependencies#schema-dependencies) to dynamically add schema properties based on input data.
1818

1919
The `allOf` keyword is supported; it uses [json-schema-merge-allof](https://github.com/mokkabonna/json-schema-merge-allof) to merge subschemas to render the final combined schema in the form. When these subschemas are incompatible, though (or if the library has an error merging it), the `allOf` keyword is dropped from the schema.
2020

21-
* `"additionalProperties":false` produces incorrect schemas when used with [schema dependencies](https://react-jsonschema-form.readthedocs.io/en/docs/usage/dependencies/#schema-dependencies). This library does not remove extra properties, which causes validation to fail. It is recommended to avoid setting `"additionalProperties":false` when you use schema dependencies. See [#848](https://github.com/rjsf-team/react-jsonschema-form/issues/848) [#902](https://github.com/rjsf-team/rjsf-team/issues/902) [#992](https://github.com/rjsf-team/rjsf-team/issues/992)
21+
* `"additionalProperties":false` produces incorrect schemas when used with [schema dependencies](../usage/dependencies#schema-dependencies). This library does not remove extra properties, which causes validation to fail. It is recommended to avoid setting `"additionalProperties":false` when you use schema dependencies. See [#848](https://github.com/rjsf-team/react-jsonschema-form/issues/848) [#902](https://github.com/rjsf-team/rjsf-team/issues/902) [#992](https://github.com/rjsf-team/rjsf-team/issues/992)
2222

2323
## Handling of schema defaults
2424

25-
This library automatically fills default values defined in the [JSON Schema](http://json-schema.org/documentation.html) as initial values in your form. This also works for complex structures in the schema. If a field has a default defined, it should always appear as default value in form. This also works when using [schema dependencies](https://react-jsonschema-form.readthedocs.io/en/docs/usage/dependencies/#schema-dependencies).
25+
This library automatically fills default values defined in the [JSON Schema](http://json-schema.org/documentation.html) as initial values in your form. This also works for complex structures in the schema. If a field has a default defined, it should always appear as default value in form. This also works when using [schema dependencies](../usage/dependencies/#schema-dependencies).
2626

2727
Since there is a complex interaction between any supplied original form data and any injected defaults, this library tries to do the injection in a way which keeps the original intention of the original form data.
2828

File renamed without changes.

docs/api-reference/form-props.md renamed to packages/docs/docs/api-reference/form-props.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: <Form /> Props
3+
---
4+
15
# &lt;Form /> props
26

37
## acceptcharset
@@ -26,7 +30,7 @@ The value of this prop will be passed to the `class` [HTML attribute on the form
2630

2731
You can provide custom buttons to your form via the `Form` component's `children`. If no children are provided, by default a `Submit` button will be rendered.
2832

29-
For other ways to modify the default `Submit` button, see both the [Submit Button Options](../uiSchema.md#submitbuttonoptions) and the [SubmitButton Template](../../advanced-customization/custom-templates.md#submitbutton) documentation.
33+
For other ways to modify the default `Submit` button, see both the [Submit Button Options](./uiSchema.md#submitbuttonoptions) and the [SubmitButton Template](../advanced-customization/custom-templates.md#submitbutton) documentation.
3034

3135
```tsx
3236
import { RJSFSchema } from "@rjsf/utils";

0 commit comments

Comments
 (0)