Skip to content

Commit e05219b

Browse files
committed
Revert "chore: update lockfiles and readme"
This reverts commit 1d35f30.
1 parent 1d35f30 commit e05219b

File tree

3 files changed

+1378
-1541
lines changed

3 files changed

+1378
-1541
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ guidelines in order to be analyzable (see below for more info).
1313
1414
## Install
1515

16-
Install the module using `yarn` or `npm`:
16+
Install the module with yarn or npm:
1717

18-
```sh
18+
```
1919
yarn add react-docgen --dev
20-
# or
20+
```
21+
22+
```
2123
npm install --save-dev react-docgen
2224
```
2325

@@ -28,7 +30,7 @@ a single file, multiple files or an input stream. We are trying to make the
2830
executable as versatile as possible so that it can be integrated into many
2931
workflows.
3032

31-
```console
33+
```
3234
Usage: react-docgen [path]... [options]
3335
3436
path A component file or directory. If no path is provided it reads from stdin.
@@ -64,8 +66,8 @@ it will fallback to a default configuration, enabling all [syntax extension](htt
6466
The tool can be used programmatically to extract component information and customize the extraction process:
6567

6668
```js
67-
const reactDocs = require('react-docgen');
68-
const componentInfo = reactDocs.parse(src);
69+
var reactDocs = require('react-docgen');
70+
var componentInfo = reactDocs.parse(src);
6971
```
7072

7173
As with the CLI, this will look for the exported component created through `React.createClass` or a class definition in the provided source. The whole process of analyzing the source code is separated into two parts:
@@ -132,7 +134,7 @@ supported options head over to the [babel website](https://babeljs.io/docs/en/ba
132134
The resolver's task is to extract those parts from the source code which the handlers can analyze. For example, the `findExportedComponentDefinition` resolver inspects the AST to find
133135

134136
```js
135-
const Component = React.createClass(<def>);
137+
var Component = React.createClass(<def>);
136138
module.exports = Component;
137139

138140
// or
@@ -155,7 +157,7 @@ Handlers do the actual work and extract the desired information from the result
155157

156158
For example, while the `propTypesHandler` expects the prop types definition to be an ObjectExpression and be available as `propTypes` in the component definition, most of the work is actually performed by the `getPropType` utility function.
157159

158-
> There are some community created handlers available. Have a look at the wiki for a list: <https://github.com/reactjs/react-docgen/wiki>
160+
> There are some community created handlers available. Have a look at the wiki for a list: https://github.com/reactjs/react-docgen/wiki
159161
160162
## Guidelines for default resolvers and handlers
161163

@@ -368,18 +370,18 @@ we are getting this output:
368370
369371
Here is a list of all the available types and its result structure.
370372
371-
| Name | Examples | Result |
372-
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
373-
| Simple | `let x: string;`<br />`let x: number;`<br />`let x: boolean;`<br />`let x: any;`<br />`let x: void;`<br />`let x: Object;`<br />`let x: String;`<br />`let x: MyClass;` | `{ "name": "<type>" }` |
374-
| Literals | `let x: 'foo';`<br />`let x: 1;`<br />`let x: true;` | `{ "name": "literal", "value": "<rawvalue>" }` |
375-
| Typed Classes | `let x: Array<foo>;`<br />`let x: Class<foo>;`<br />`let x: MyClass<bar>;` | `{ "name": "<type>", "elements": [{ <element-type> }, ...] }` |
373+
| Name | Examples | Result |
374+
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
375+
| Simple | `let x: string;`<br />`let x: number;`<br />`let x: boolean;`<br />`let x: any;`<br />`let x: void;`<br />`let x: Object;`<br />`let x: String;`<br />`let x: MyClass;` | `{ "name": "<type>" }` |
376+
| Literals | `let x: 'foo';`<br />`let x: 1;`<br />`let x: true;` | `{ "name": "literal", "value": "<rawvalue>" }` |
377+
| Typed Classes | `let x: Array<foo>;`<br />`let x: Class<foo>;`<br />`let x: MyClass<bar>;` | `{ "name": "<type>", "elements": [{ <element-type> }, ...] }` |
376378
| Object Signature | `let x: { foo: string, bar?: mixed };`<br />`let x: { [key: string]: string, foo: number };` | `{ "name": "signature", "type": "object", "raw": "<raw-signature>", "signature": { "properties": [{ "key": "<property-name>"\|{ <property-key-type> }, "value": { <property-type>, "required": <true/false> } }, ...] } }` |
377-
| Function Signature | `let x: (x: string) => void;` | `{ "name": "signature", "type": "function", "raw": "<raw-signature>", "signature": { "arguments": [{ "name": "<argument-name>", "type": { <argument-type> } }, ...], "return": { <return-type> } } }` |
379+
| Function Signature | `let x: (x: string) => void;` | `{ "name": "signature", "type": "function", "raw": "<raw-signature>", "signature": { "arguments": [{ "name": "<argument-name>", "type": { <argument-type> } }, ...], "return": { <return-type> } } }` |
378380
| Callable-Object/Function-Object Signature | `let x: { (x: string): void, prop: string };` | `{ "name": "signature", "type": "object", "raw": "<raw-signature>", "signature": { "properties": [{ "key": "<property-name>"\|{ <property-key-type> }, "value": { <property-type>, "required": <true/false> } }, ...], "constructor": { <function-signature> } } }` |
379-
| Tuple | `let x: [foo, "value", number];` | `{ "name": "tuple", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
380-
| Union | `let x: number \| string;` | `{ "name": "union", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
381-
| Intersect | `let x: number & string;` | `{ "name": "intersect", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
382-
| Nullable modifier | `let x: ?number;` | `{ "name": "number", "nullable": true }` |
381+
| Tuple | `let x: [foo, "value", number];` | `{ "name": "tuple", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
382+
| Union | `let x: number \| string;` | `{ "name": "union", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
383+
| Intersect | `let x: number & string;` | `{ "name": "intersect", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
384+
| Nullable modifier | `let x: ?number;` | `{ "name": "number", "nullable": true }` |
383385

384386
## Result data structure
385387

0 commit comments

Comments
 (0)