generated from atomicpages/ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72d11a2
commit 9d3104b
Showing
7 changed files
with
6,467 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
on: [push, pull_request] | ||
name: Build PR & Push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: npm install, lint, and build | ||
run: | | ||
npm i | ||
npm run lint | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [released] | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: npm install | ||
run: npm i | ||
- name: publish | ||
run: npm publish pkg/ | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,6 @@ dist | |
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# pika | ||
pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,54 @@ | ||
# My Typescript Template | ||
# Docusaurus Plugin `react-docgen-typescript` | ||
|
||
A small template that I use to build node typescript-based projects. | ||
A Docusaurus 2.x plugin that help generate and consume auto-generated docs from `react-docgen-typescript`. | ||
|
||
## Stack | ||
## Installation | ||
|
||
* `typescript` | ||
* `@pika/pack` | ||
* `eslint` | ||
* `prettier` | ||
Grab from NPM and install along with `react-docgen-typescript`: | ||
|
||
```sh | ||
npm i docusaurus-plugin-react-docgen-typescript react-docgen-typescript # or | ||
yarn add docusaurus-plugin-react-docgen-typescript react-docgen-typescript | ||
``` | ||
|
||
## Usage | ||
|
||
Inside your `docusaurus.config.js` add to the `plugins` field and configure with the `src` option with full glob support :+1:. | ||
|
||
```js | ||
module.exports = { | ||
// ... | ||
plugins: [ | ||
[ | ||
'docusaurus-plugin-react-docgen-typescript', | ||
{ | ||
// pass in a single string or an array of strings | ||
src: ['path/to/**/*.tsx', '!path/to/**/*test.*'], | ||
global: true, | ||
parserOptions: { | ||
propFilter: (prop, component) => { | ||
if (prop.parent) { | ||
return !prop.parent.fileName.includes('@types/react'); | ||
} | ||
|
||
return true; | ||
}, | ||
}, | ||
}, | ||
], | ||
], | ||
}; | ||
``` | ||
|
||
Any pattern supported by [`fast-glob`](https://github.com/mrmlnc/fast-glob) is allowed here (including negations). | ||
|
||
## Options | ||
|
||
| Name | Type | Required | Description | | ||
| ----------------- | ---------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `src` | `string` \| `string[]` | Yes | Tell `react-docgen` where to look for source files. | | ||
| `global` | `boolean` | No | Store results so they're [globally accessible](https://v2.docusaurus.io/docs/docusaurus-core#useplugindatapluginname-string-pluginid-string) in docusaurus | | ||
| `route` | [`RouteConfig`](https://v2.docusaurus.io/docs/lifecycle-apis#actions) | No | Makes docgen results accessible at the specified URL. Note `modules` cannot be overridden. | | ||
| `tsConfig` | `string` | No | Specify the path to your custom tsconfig file (note that in most cases the default config is sufficient) | | ||
| `compilerOptions` | `CompilerOptions` | No | Pass custom ts compiler options in lieu of of a custom `tsConfig` | | ||
| `parserOptions` | [`ParserOptions`](https://github.com/styleguidist/react-docgen-typescript#options) | No | Options passed to `react-docgen-typescript` | |
Oops, something went wrong.