Skip to content

Commit 5e11662

Browse files
authored
Use Docusaurus in favor of readthedocs.io (rjsf-team#3419)
1 parent a3dd2e4 commit 5e11662

Some content is hidden

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

62 files changed

+22099
-235
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
required: true
1414
- label: I understand that providing a [SSCCE](http://sscce.org/) example is tremendously useful to the maintainers.
1515
required: true
16-
- label: I have read the [documentation](https://react-jsonschema-form.readthedocs.io/)
16+
- label: I have read the [documentation](https://rjsf-team.github.io/react-jsonschema-form/docs)
1717
required: true
1818
- label: Ideally, I'm providing a [sample JSFiddle](https://jsfiddle.net/n1k0/f2y3fq7L/6/) or a [shared playground link](https://rjsf-team.github.io/react-jsonschema-form/) demonstrating the issue.
1919
required: false

.github/workflows/ci.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,74 @@ jobs:
1919
uses: actions/setup-node@v3
2020
with:
2121
node-version: ${{ matrix.node-version }}
22+
cache: 'npm'
23+
cache-dependency-path: 'packages/**/package-lock.json'
2224
- run: npm ci
2325
- run: npm run lint
2426
- run: npm run cs-check
2527

2628
- name: Build with Netlify badge
27-
if: github.ref != 'refs/heads/main'
29+
if: github.ref != 'refs/heads/main' && matrix.node-version != '14.x'
2830
run: npm run build
2931
env:
3032
VITE_SHOW_NETLIFY_BADGE: true
3133
NODE_OPTIONS: --max_old_space_size=4096
34+
3235
- name: Build
33-
if: github.ref == 'refs/heads/main'
36+
if: github.ref == 'refs/heads/main' && matrix.node-version != '14.x'
3437
run: npm run build
3538
env:
3639
NODE_OPTIONS: --max_old_space_size=4096
3740

41+
# Docusaurus doesn't support Node 14. These tasks can be removed once Node 14 is EOL (May 2023)
42+
- name: Build with Netlify badge (no docs)
43+
if: github.ref != 'refs/heads/main' && matrix.node-version == '14.x'
44+
run: npx nx run-many --target=build --exclude=docs
45+
env:
46+
VITE_SHOW_NETLIFY_BADGE: true
47+
NODE_OPTIONS: --max_old_space_size=4096
48+
- name: Build (no docs)
49+
if: github.ref == 'refs/heads/main' && matrix.node-version == '14.x'
50+
run: npx nx run-many --target=build --exclude=docs
51+
env:
52+
NODE_OPTIONS: --max_old_space_size=4096
53+
3854
- if: matrix.node-version == '18.x'
3955
uses: actions/upload-artifact@v3
4056
with:
41-
name: dist
57+
name: playground
4258
path: packages/playground/dist
59+
- if: matrix.node-version == '18.x'
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: docs
63+
path: packages/docs/build
4364
- run: npm test
44-
45-
deploy_playground:
65+
deploy_playground_and_docs:
4666
runs-on: ubuntu-latest
4767
if: github.ref == 'refs/heads/main'
48-
name: Deploy playground to GitHub Pages
68+
name: Deploy playground and docs to GitHub Pages
4969
needs: [build]
5070
steps:
51-
- name: Download built files
71+
- name: Download built playground
5272
uses: actions/download-artifact@v3
5373
with:
54-
name: dist
74+
name: playground
5575
path: dist
56-
- name: Deploy playground
76+
- name: Download built docs
77+
uses: actions/download-artifact@v3
78+
with:
79+
name: docs
80+
path: dist/docs
81+
- name: Deploy playground + docs to GitHub Pages
5782
uses: crazy-max/ghaction-github-pages@v3.1.0
5883
with:
5984
keep_history: true
6085
target_branch: gh-pages
6186
build_dir: dist
6287
env:
6388
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
89+
# NOTE: The following workflow is deprecated. The docs are new deployed to GitHub pages above.
6590
docs:
6691
runs-on: ubuntu-latest
6792
steps:

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
uses: actions/setup-node@v3
1414
with:
1515
node-version: 18.x
16+
cache: 'npm'
17+
cache-dependency-path: 'packages/**/package-lock.json'
1618
- run: npm ci
1719
- run: npm run build
1820
env:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ should change the heading of the (upcoming) version to include a major version b
2121
- Added the `idPrefix`, `idSeparator` and `rawErrors` optional props to `FieldProps` since they were missing
2222

2323
## Dev / docs / playground
24+
- Migrated latest documentation to Docusaurus, which is deployed to GitHub Pages.
25+
- Updated readthedocs.io documentation site to guide users to the new docs site.
26+
- Updated links in documentation and package README files to point to new site.
2427
- Updated the `custom-widgets-field` documentation for the new `FieldProps`
2528

2629
# 5.0.1

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<p align="center">
1313
A simple <a href="http://facebook.github.io/react/">React</a> component capable of using <a href="http://json-schema.org/">JSON Schema</a> to declaratively build and customize web forms.
1414
<br />
15-
<a href="https://react-jsonschema-form.readthedocs.io/en/stable/"><strong>Explore the docs »</strong></a>
15+
<a href="https://rjsf-team.github.io/react-jsonschema-form/docs/"><strong>Explore the docs »</strong></a>
1616
<br />
1717
<br />
1818
<a href="https://rjsf-team.github.io/react-jsonschema-form/">View Playground</a>
@@ -38,15 +38,15 @@
3838

3939
## Documentation
4040

41-
Read our [documentation](https://react-jsonschema-form.readthedocs.io/en/latest/) on Read the Docs.
41+
Read our [documentation](https://rjsf-team.github.io/react-jsonschema-form/docs), powered by [Docusaurus](https://docusaurus.io/).
4242

4343
## Live Playground
4444

45-
A [live playground](https://rjsf-team.github.io/react-jsonschema-form/) is hosted on gh-pages.
45+
A [live playground](https://rjsf-team.github.io/react-jsonschema-form/) is hosted on GitHub Pages.
4646

4747
## Contributing
4848

49-
Read our [contributors' guide](https://react-jsonschema-form.readthedocs.io/en/latest/contributing/) to get started.
49+
Read our [contributors' guide](https://rjsf-team.github.io/react-jsonschema-form/docs/contributing) to get started.
5050

5151
## Credits
5252

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# docs (DEPRECATED)
2+
3+
[The react-jsonschema-form documentation has been moved here](../packages/docs)

docs/index.md

Lines changed: 2 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,5 @@
11
# react-jsonschema-form
22

3-
![Build Status](https://github.com/rjsf-team/react-jsonschema-form/workflows/CI/badge.svg)
3+
The react-jsonschema-form docs have been moved [here](https://rjsf-team.github.io/react-jsonschema-form/docs).
44

5-
A simple [React](https://reactjs.org/) component capable of building HTML forms out of a [JSON schema](http://json-schema.org/).
6-
7-
A [live playground](https://rjsf-team.github.io/react-jsonschema-form/) is hosted on GitHub Pages:
8-
9-
<a target="_blank" href="https://rjsf-team.github.io/react-jsonschema-form/"><img alt="Playground" src="https://i.imgur.com/M8ZCES5.gif" /></a>
10-
11-
## Philosophy
12-
13-
react-jsonschema-form is meant to automatically generate a React form based on a [JSON Schema](http://json-schema.org/). If you want to generate a form for any data, sight unseen, simply given a JSON schema, react-jsonschema-form may be for you. If you have _a priori_ knowledge of your data and want a toolkit for generating forms for it, you might look elsewhere.
14-
15-
react-jsonschema-form also comes with tools such as `uiSchema` and other form props to customize the look and feel of the form beyond the default themes.
16-
17-
## Installation
18-
19-
First install the dependencies from npm, along with a validator implementation (such as `@rjsf/validator-ajv8`):
20-
21-
```bash
22-
$ npm install @rjsf/core @rjsf/utils @rjsf/validator-ajv8 --save
23-
```
24-
25-
Then import the dependencies as follows:
26-
27-
```js
28-
import validator from "@rjsf/validator-ajv8";
29-
import Form from "@rjsf/core";
30-
```
31-
32-
Our latest version requires React 16+. You can also install `react-jsonschema-form` (the 1.x version) which works with React 15+.
33-
34-
### As a script served from a CDN
35-
36-
```html
37-
<script src="https://unpkg.com/@rjsf/core/dist/core.cjs.production.min.js"></script>
38-
```
39-
40-
Source maps are available at [this url](https://unpkg.com/@rjsf/core/dist/core.cjs.production.min.js.map).
41-
42-
> Note: The CDN version **does not** embed `react` or `react-dom`. If you want other distributions (i.e. umd, esm), look [here](https://unpkg.com/@rjsf/core/dist/) for all releases
43-
44-
You'll also need to alias the default export property to use the Form component:
45-
46-
```js
47-
const Form = JSONSchemaForm.default;
48-
// or
49-
const {default: Form} = JSONSchemaForm;
50-
```
51-
52-
## Usage
53-
54-
```tsx
55-
import { RJSFSchema } from "@rjsf/utils";
56-
import validator from "@rjsf/validator-ajv8";
57-
58-
const schema: RJSFSchema = {
59-
title: "Todo",
60-
type: "object",
61-
required: ["title"],
62-
properties: {
63-
title: {type: "string", title: "Title", default: "A new task"},
64-
done: {type: "boolean", title: "Done?", default: false}
65-
}
66-
};
67-
68-
const log = (type) => console.log.bind(console, type);
69-
70-
render((
71-
<Form schema={schema}
72-
validator={validator}
73-
onChange={log("changed")}
74-
onSubmit={log("submitted")}
75-
onError={log("errors")} />
76-
), document.getElementById("app"));
77-
```
78-
79-
80-
## Theming
81-
82-
For more information on what themes we support, see [Using Themes](usage/themes).
83-
84-
85-
<!--
86-
87-
disabled until https://github.com/rjsf-team/react-jsonschema-form/issues/1584 is resolved
88-
89-
## Useful samples
90-
91-
- Custom field template: <https://jsfiddle.net/hdp1kgn6/1/>
92-
- Multi-step wizard: <https://jsfiddle.net/sn4bnw9h/1/>
93-
- Using classNames with uiSchema: <https://jsfiddle.net/gfwp25we/1/>
94-
- Conditional fields: <https://jsfiddle.net/69z2wepo/88541/>
95-
- Advanced conditional fields: <https://jsfiddle.net/cowbellerina/zbfh96b1/>
96-
- Use radio list for enums: <https://jsfiddle.net/f2y3fq7L/2/>
97-
- Reading file input data: <https://jsfiddle.net/f9vcb6pL/1/>
98-
- Custom errors messages with transformErrors: <https://jsfiddle.net/revolunet/5r3swnr4/>
99-
- 2 columns form with CSS and FieldTemplate: <https://jsfiddle.net/n1k0/bw0ffnz4/1/>
100-
- Validate and submit form from external control: <https://jsfiddle.net/spacebaboon/g5a1re63/>
101-
- Custom component for Help text with `ui:help`: <https://codesandbox.io/s/14pqx97xl7/>
102-
- Collapsing / Showing and Hiding individual fields: <https://codesandbox.io/s/examplereactjsonschemaformcollapsefieldtemplate-t41dn>
103-
104-
-->
105-
106-
## License
107-
108-
Apache 2
109-
110-
111-
## Credits
112-
113-
| <img style="height: 100px !important" src="https://avatars1.githubusercontent.com/u/1066228?s=200&v=4"> | <img style="height: 100px !important" src="https://user-images.githubusercontent.com/1689183/51487090-4ea04f80-1d57-11e9-9a91-79b7ef8d2013.png"></a> | <img style="height: 100px !important" src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" /> |
114-
|---|---|---|
115-
|This project initially started as a [mozilla-services](https://github.com/mozilla-services) project. |Testing is powered by [BrowserStack](https://www.browserstack.com/).|Deploy Previews are provided by [Netlify](https://www.netlify.com).|
116-
117-
## Who uses react-jsonschema-form?
118-
119-
- ...
120-
121-
Add your own company / organization by making a [pull request](https://github.com/rjsf-team/react-jsonschema-form/pulls).
5+
We are in the process of migrating our versioned documentation. For documentation prior to version 5.0.0, please select the version in the bottom-right corner of this page.

mkdocs.yml

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,7 @@ extra_javascript: [main.js]
66

77
nav:
88
- Introduction: index.md
9-
- Quickstart: quickstart.md
10-
- Contributing: contributing.md
11-
- JSON schema:
12-
- Single fields: usage/single.md
13-
- Objects: usage/objects.md
14-
- Arrays: usage/arrays.md
15-
- Definitions: usage/definitions.md
16-
- Dependencies: usage/dependencies.md
17-
- oneOf / anyOf / allOf: usage/oneof.md
18-
- Usage:
19-
- Widgets: usage/widgets.md
20-
- Themes: usage/themes.md
21-
- Validation: usage/validation.md
22-
- Advanced Customization:
23-
- Custom Widgets and Fields: advanced-customization/custom-widgets-fields.md
24-
- Custom Templates: advanced-customization/custom-templates.md
25-
- Custom Themes: advanced-customization/custom-themes.md
26-
- Other Internals: advanced-customization/internals.md
27-
- Typescript Support: advanced-customization/typescript.md
28-
- API Reference:
29-
- General uiSchema Reference: api-reference/uiSchema.md
30-
- semantic-ui uiSchema Reference: api-reference/themes/semantic-ui/uiSchema.md
31-
- chakra-ui uiSchema Reference: api-reference/themes/chakra-ui/uiSchema.md
32-
- "&lt;Form /&gt; props": api-reference/form-props.md
33-
- Utility functions: api-reference/utility-functions.md
34-
- Migration Guides:
35-
- 5.x Migration: 5.x upgrade guide.md
36-
- 4.x Migration: 4.x upgrade guide.md
37-
- 3.x Migration: 3.x upgrade guide.md
38-
- 2.x Migration: 2.x upgrade guide.md
9+
3910

4011
markdown_extensions:
4112
- toc:

packages/antd/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<p align="center">
1616
Ant Design theme, fields and widgets for <a href="https://github.com/rjsf-team/react-jsonschema-form/"><code>react-jsonschema-form</code></a>.
1717
<br />
18-
<a href="https://react-jsonschema-form.readthedocs.io/en/stable/"><strong>Explore the docs »</strong></a>
18+
<a href="https://rjsf-team.github.io/react-jsonschema-form/docs/"><strong>Explore the docs »</strong></a>
1919
<br />
2020
<br />
2121
<a href="https://rjsf-team.github.io/react-jsonschema-form/">View Playground</a>
@@ -100,7 +100,7 @@ See the general [open issues](https://github.com/rjsf-team/react-jsonschema-form
100100

101101
## Contributing
102102

103-
Read our [contributors' guide](https://react-jsonschema-form.readthedocs.io/en/stable/contributing/) to get started.
103+
Read our [contributors' guide](https://rjsf-team.github.io/react-jsonschema-form/docs/contributing/) to get started.
104104

105105
<!-- CONTACT -->
106106

packages/bootstrap-4/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<p align="center">
1111
Bootstrap-4 theme, fields and widgets for <a href="https://github.com/mozilla-services/react-jsonschema-form/"><code>react-jsonschema-form</code></a>.
1212
<br />
13-
<a href="https://react-jsonschema-form.readthedocs.io/en/stable/"><strong>Explore the docs »</strong></a>
13+
<a href="https://rjsf-team.github.io/react-jsonschema-form/docs/"><strong>Explore the docs »</strong></a>
1414
<br />
1515
<br />
1616
<a href="https://rjsf-team.github.io/react-jsonschema-form/">View Playground</a>
@@ -86,7 +86,7 @@ const Form = withTheme(Bootstrap4Theme);
8686

8787
## Contributing
8888

89-
Read our [contributors' guide](https://react-jsonschema-form.readthedocs.io/en/stable/contributing/) to get started.
89+
Read our [contributors' guide](https://rjsf-team.github.io/react-jsonschema-form/docs/contributing/) to get started.
9090

9191
<!-- CONTACT -->
9292

0 commit comments

Comments
 (0)