Skip to content

Commit 4387078

Browse files
committed
feat - upgrade react-docgen-typescript
- Adding new CLI flags for new options - Bumping peer dependency version new flag support - Punting lockfile - Fixing verbose flag output issues
1 parent 8d89379 commit 4387078

File tree

5 files changed

+50
-6733
lines changed

5 files changed

+50
-6733
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,20 @@ npx react-ts-docgen ./src/**/* -o ./out/doclet/files.json
3838
Any custom options that you want to pass to `react-docgen-typescript` can be done through options:
3939

4040
```bash
41+
React Docgen Typescript Options:
4142
--config Path to your tsconfig.json. By default the
4243
script will look in the current working
4344
directory to find the tsconfig [string]
4445
--skip-props-without-doc Skip props without doc
45-
[boolean] [default: true]
46+
[boolean] [default: false]
4647
--skip-props-with-name Skip the specified list of props without
4748
doc [array]
48-
--skip-components-with-name Skip the [array]
49+
--skip-components-with-name Skip the components with the specified
50+
name [array]
51+
--extract-values-from-union Convert unions to docgen enum format
52+
[boolean]
53+
--remove-undefined-from-optional If set, types with optional will not
54+
display "| undefined" in the type[boolean]
4955
--extract-literal-values-from-enum Convert enums and unions to docgen enum
5056
format [boolean] [default: false]
5157
--save-value-as-string Save default value props as strings

bin/react-ts-docgen.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const argv = require('yargs')
2424
requiresArg: true,
2525
nargs: 1,
2626
},
27+
quiet: {
28+
alias: 'q',
29+
describe: 'Suppress all console output except errors',
30+
boolean: true,
31+
},
2732
'out-file': {
2833
alias: 'o',
2934
describe: 'Concatenate all JSON files into one to the specified file',
@@ -38,6 +43,7 @@ const argv = require('yargs')
3843
},
3944
verbose: {
4045
describe: 'Log everything',
46+
boolean: true,
4147
},
4248
extension: {
4349
alias: 'x',
@@ -56,7 +62,7 @@ const argv = require('yargs')
5662
'skip-props-without-doc': {
5763
describe: 'Skip props without doc',
5864
group: 'React Docgen Typescript Options:',
59-
default: true,
65+
default: false,
6066
boolean: true,
6167
},
6268
'skip-props-with-name': {
@@ -65,10 +71,20 @@ const argv = require('yargs')
6571
array: 'skipPropsWithName',
6672
},
6773
'skip-components-with-name': {
68-
describe: 'Skip the ',
74+
describe: 'Skip the components with the specified name',
6975
group: 'React Docgen Typescript Options:',
7076
array: 'skipComponentsWithName',
7177
},
78+
'extract-values-from-union': {
79+
group: 'React Docgen Typescript Options:',
80+
describe: 'Convert unions to docgen enum format',
81+
boolean: true,
82+
},
83+
'remove-undefined-from-optional': {
84+
group: 'React Docgen Typescript Options:',
85+
describe: 'If set, types with optional will not display "| undefined" in the type',
86+
boolean: true,
87+
},
7288
'extract-literal-values-from-enum': {
7389
describe: 'Convert enums and unions to docgen enum format',
7490
group: 'React Docgen Typescript Options:',

0 commit comments

Comments
 (0)