Skip to content

Commit 3e9c2f7

Browse files
committed
feat(:sparkles:) Adding support for global storage
1 parent ab0a4d6 commit 3e9c2f7

File tree

7 files changed

+6475
-42
lines changed

7 files changed

+6475
-42
lines changed

.github/actions/on_push.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on: [push, pull_request]
2+
name: Build PR & Push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
node-version: [12.x, 14.x]
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Use Node.js ${{ matrix.node-version }}
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: ${{ matrix.node-version }}
15+
- name: npm install, lint, and build
16+
run: |
17+
npm i
18+
npm run lint
19+
npm run build

.github/actions/on_release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [released]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- uses: actions/setup-node@v1
11+
with:
12+
node-version: 12
13+
registry-url: https://registry.npmjs.org/
14+
- name: npm install
15+
run: npm i
16+
- name: publish
17+
run: npm publish
18+
env:
19+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,28 @@ module.exports = {
2121
[
2222
'docusaurus-plugin-react-docgen',
2323
{
24-
// pass in a single string or an array
25-
src: [
26-
'path/to/**/*.tsx',
27-
'!path/to/**/*test.*',
28-
]
29-
}
30-
]
31-
]
32-
}
24+
// pass in a single string or an array of strings
25+
src: ['path/to/**/*.tsx', '!path/to/**/*test.*'],
26+
route: {
27+
path: '/docs/api',
28+
component: require.resolve('./src/components/MyDataHandler.js'),
29+
exact: true,
30+
},
31+
},
32+
],
33+
],
34+
};
3335
```
3436

3537
Any pattern supported by [`fast-glob`](https://github.com/mrmlnc/fast-glob) is allowed here (including negations)
38+
39+
## Options
40+
41+
| Name | Type | Required | Description |
42+
| --------------- | ---------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
43+
| `src` | `string` \| `string[]` | Yes | Tell `react-docgen` where to ook for source files. Use relative, absolute, and/or globbing syntax |
44+
| `global` | `boolean` | No | Store results so they're [globally accessible](https://v2.docusaurus.io/docs/docusaurus-core#useplugindatapluginname-string-pluginid-string) in docusaurus |
45+
| `route` | [`RouteConfig`](https://v2.docusaurus.io/docs/lifecycle-apis#actions) | No | Makes docgen results accessible at the specified URL. Note `modules` cannot be overridden. |
46+
| `docgen` | [docgen config](https://github.com/reactjs/react-docgen#source) | No | Pass custom resolvers and handlers to `react-docgen` |
47+
| `parserOptions` | [babel parser options](https://github.com/reactjs/react-docgen#-parseroptions) | No | Pass custom options to `@babel/parser` |
48+
| `babel` | [docgen options](https://github.com/reactjs/react-docgen#-babelrc-babelrcroots-root-rootmode-configfile-envname) | No | Pass specific options to `@babel/parse` that aids in resolving the correct babel config file |

0 commit comments

Comments
 (0)