Skip to content

Commit 4974837

Browse files
github-actions[bot]danez
authored andcommitted
Publish new versions (alpha)
1 parent 4cbae17 commit 4974837

File tree

6 files changed

+165
-7
lines changed

6 files changed

+165
-7
lines changed

.changeset/pre.json

+33-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,38 @@
33
"tag": "alpha",
44
"initialVersions": {
55
"react-docgen": "6.0.0-alpha.3",
6-
"@react-docgen/cli": "1.0.0-alpha.0"
6+
"@react-docgen/cli": "1.0.0-alpha.0",
7+
"@react-docgen-internal/website": "0.0.0",
8+
"@react-docgen-internal/playground": "0.0.0"
79
},
8-
"changesets": []
10+
"changesets": [
11+
"bright-rivers-swim",
12+
"clean-cooks-attend",
13+
"giant-apricots-compete",
14+
"great-rice-rush",
15+
"grumpy-falcons-rhyme",
16+
"grumpy-hotels-admire",
17+
"honest-boxes-behave",
18+
"honest-boxes-copy",
19+
"late-cats-design",
20+
"loud-spiders-divide",
21+
"many-ligers-kneel",
22+
"mean-glasses-chew",
23+
"mighty-kids-report",
24+
"mighty-shrimps-shout",
25+
"nervous-humans-shave",
26+
"nine-vans-bow",
27+
"rare-taxis-divide",
28+
"rotten-mugs-walk",
29+
"selfish-ducks-mate",
30+
"silent-swans-melt",
31+
"silly-ears-search",
32+
"smart-eagles-shop",
33+
"smart-waves-refuse",
34+
"strong-horses-build",
35+
"strong-pillows-visit",
36+
"tricky-shoes-check",
37+
"twelve-trainers-tap",
38+
"weak-numbers-bow"
39+
]
940
}
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# @react-docgen/cli
2+
3+
## 1.0.0-alpha.1
4+
5+
### Major Changes
6+
7+
- 3b28f6e: Introducing the new CLI package `@react-docgen/cli` which was extracted from `react-docgen` and is a complete rewrite.
8+
Compared to the old CLI these are some of the major differences:
9+
10+
- Does not support input via stdin anymore
11+
- The path argument is now a glob
12+
- `-x, --extension` was removed in favor of globs
13+
- `-e, --exclude` was removed
14+
- `-i, --ignore` now accepts a glob
15+
- `--handler` added
16+
- `--importer` added
17+
- `--failOnWarning` added
18+
19+
Check out https://react-docgen.dev/docs/getting-started/cli for the documentation.
20+
21+
### Patch Changes
22+
23+
- Updated dependencies [96d6e9e]
24+
- Updated dependencies [96d6e9e]
25+
- Updated dependencies [96d6e9e]
26+
- Updated dependencies [96d6e9e]
27+
- Updated dependencies [96d6e9e]
28+
- Updated dependencies [96d6e9e]
29+
- Updated dependencies [96d6e9e]
30+
- Updated dependencies [caae6bf]
31+
- Updated dependencies [96d6e9e]
32+
- Updated dependencies [96d6e9e]
33+
- Updated dependencies [96d6e9e]
34+
- Updated dependencies [96d6e9e]
35+
- Updated dependencies [96d6e9e]
36+
- Updated dependencies [96d6e9e]
37+
- Updated dependencies [96d6e9e]
38+
- Updated dependencies [3b28f6e]
39+
- Updated dependencies [96d6e9e]
40+
- Updated dependencies [96d6e9e]
41+
- Updated dependencies [96d6e9e]
42+
- Updated dependencies [96d6e9e]
43+
- Updated dependencies [96d6e9e]
44+
- Updated dependencies [96d6e9e]
45+
- Updated dependencies [96d6e9e]
46+
- Updated dependencies [96d6e9e]
47+
- Updated dependencies [96d6e9e]
48+
- Updated dependencies [d4c27d4]
49+
- Updated dependencies [96d6e9e]
50+

packages/react-docgen-cli/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-docgen/cli",
3-
"version": "1.0.0-alpha.0",
3+
"version": "1.0.0-alpha.1",
44
"description": "A CLI to extract information from React components for documentation generation.",
55
"repository": "reactjs/react-docgen",
66
"type": "module",
@@ -30,7 +30,7 @@
3030
"commander": "9.4.1",
3131
"debug": "4.3.4",
3232
"fast-glob": "3.2.12",
33-
"react-docgen": "6.0.0-alpha.3",
33+
"react-docgen": "6.0.0-alpha.4",
3434
"slash": "5.0.0"
3535
},
3636
"devDependencies": {

packages/react-docgen/CHANGELOG.md

+77
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,82 @@
11
# Changelog
22

3+
## 6.0.0-alpha.4
4+
5+
### Major Changes
6+
7+
- 96d6e9e: Rename `flowTypeHandler` to `codeTypeHandler` because it handles Flow and TypeScript
8+
- 96d6e9e: Simplify `resolveObjectValuesToArray` and remove type handling. None of the code that was handling types was actually used.
9+
- caae6bf: The return values of `resolveObjectValuesToArray` are now in the order they are defined in the source code.
10+
- 96d6e9e: Migrate react-docgen to ES modules. Please read [this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
11+
- 3b28f6e: The CLI was removed from `react-docgen` into its own package `@react-docgen/cli`.
12+
13+
Check out https://react-docgen.dev/cli for the documentation.
14+
15+
- 96d6e9e: Main `parse` API was changed
16+
17+
The main API changed and now includes only 2 arguments.
18+
19+
```diff
20+
-parse(src, resolver, handlers, importer, options)
21+
+parse(src, { resolver, handlers, importer, ... })
22+
```
23+
24+
- 96d6e9e: Renamed some of the main exports for clarity.
25+
26+
Renamed `handlers` to `builtinHandlers`
27+
Renamed `resolver` to `builtinResolvers`
28+
Renamed `importers` to `builtinImporters`
29+
30+
- 96d6e9e: Migrated to babel toolchain
31+
32+
This is one of the big changes in this new version of react-docgen. It made the code a lot more robust
33+
because there are now finally working TypeScript types for the ASTs.
34+
35+
Another benefit from this change that react-docgen is now a lot faster. 🚀 In some
36+
tests an improvement of nearly 50% was seen in comparison to version 5.
37+
38+
- d4c27d4: Improve performance of file system importer.
39+
40+
The file system importer now also caches resolving of files in addition to parsing files.
41+
If the importer is used in an environment where files do change at runtime (like a watch
42+
command) then the caches will need to be cleared on every file change.
43+
44+
- 96d6e9e: Changed the minimum Node.js version to 14.17.0
45+
46+
### Minor Changes
47+
48+
- 96d6e9e: Add support for `.cts` and `.mts` extension when using typescript
49+
- 96d6e9e: Treat functions returning `React.Children.map` as components
50+
- 96d6e9e: Improve performance by creating all visitors only once
51+
- 96d6e9e: Support all possible kinds of functions in the `displayNameHandler`
52+
- 96d6e9e: Support all literal types in typescript
53+
- 96d6e9e: Support flow qualified type names
54+
- 96d6e9e: Support class and function declarations without identifier
55+
- 96d6e9e: Support resolving of destructurings in `resolveToValue`
56+
- 96d6e9e: Improve performance drastically by making changes to AST traversal
57+
58+
Visitors are now pre-exploded and are cached in the module scope instead of creating them on every call.
59+
This change brought the benchmark from 170ops/s to 225ops/sec
60+
61+
- 96d6e9e: Add codes to errors to be able to easily detect them
62+
63+
There is a new export `ERROR_CODES` that contains all possible error codes.
64+
The two errors that have codes right now are:
65+
66+
- `MISSING_DEFINITION`: No component found in file
67+
- `MULTIPLE_DEFINITIONS`: Multiple components found in one files
68+
69+
- 96d6e9e: Support handling `useImperativeHandle` correctly
70+
71+
### Patch Changes
72+
73+
- 96d6e9e: Handle `React.forwardRef` calls without a function
74+
- 96d6e9e: Handle some edge cases in resolveToValue
75+
- 96d6e9e: Remove trailing commas and semicolons from raw values in the documentation
76+
- 96d6e9e: Parse jsdoc comments for TypeScript structs
77+
- 96d6e9e: Correctly handle ObjectProperties in `isReactComponentMethod`
78+
- 96d6e9e: Add support for TSAsExpressions when trying to stringify expressions
79+
380
## [6.0.0-alpha.3](https://github.com/reactjs/react-docgen/compare/v6.0.0-alpha.2...v6.0.0-alpha.3) (2022-06-13)
481

582
### Bug Fixes

packages/react-docgen/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-docgen",
3-
"version": "6.0.0-alpha.3",
3+
"version": "6.0.0-alpha.4",
44
"description": "A library to extract information from React components for documentation generation.",
55
"repository": "reactjs/react-docgen",
66
"type": "module",

yarn.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ __metadata:
23622362
commander: 9.4.1
23632363
debug: 4.3.4
23642364
fast-glob: 3.2.12
2365-
react-docgen: 6.0.0-alpha.3
2365+
react-docgen: 6.0.0-alpha.4
23662366
slash: 5.0.0
23672367
bin:
23682368
react-docgen: dist/cli.js
@@ -9779,7 +9779,7 @@ __metadata:
97799779
languageName: node
97809780
linkType: hard
97819781

9782-
"[email protected].3, react-docgen@workspace:packages/react-docgen":
9782+
"[email protected].4, react-docgen@workspace:packages/react-docgen":
97839783
version: 0.0.0-use.local
97849784
resolution: "react-docgen@workspace:packages/react-docgen"
97859785
dependencies:

0 commit comments

Comments
 (0)