Skip to content

Commit 3b28f6e

Browse files
committed
feat: Introduce new CLI
1 parent 8cb8f28 commit 3b28f6e

File tree

56 files changed

+1547
-723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1547
-723
lines changed

.changeset/mighty-shrimps-shout.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@react-docgen/cli': major
3+
---
4+
5+
Introducing the new CLI package `@react-docgen/cli` which was extracted from `react-docgen` and is a complete rewrite.
6+
Compared to the old CLI these are some of the major differences:
7+
8+
- Does not support input via stdin anymore
9+
- The path argument is now a glob
10+
- `-x, --extension` was removed in favor of globs
11+
- `-e, --exclude` was removed
12+
- `-i, --ignore` now accepts a glob
13+
- `--handler` added
14+
- `--importer` added
15+
- `--failOnWarning` added
16+
17+
Check out https://react-docgen.dev/cli for the documentation.

.changeset/rare-taxis-divide.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'react-docgen': major
3+
---
4+
5+
The CLi was removed from `react-docgen` into its own package `@react-docgen/cli`.
6+
7+
Check out https://react-docgen.dev/cli for the documentation.

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
dist
2-
node_modules/
1+
dist/
2+
**/node_modules/*
3+
!**/__fixtures__/**/node_modules/*
34
.idea/
45
coverage/
56
yarn-error.log

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"packages/react-docgen": "6.0.0-alpha.3",
3-
"packages/react-docgen-cli": "6.0.0-alpha.3"
3+
"packages/react-docgen-cli": "1.0.0-alpha.0"
44
}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"fix": "eslint . --ext .js,.ts --fix --report-unused-disable-directives",
1212
"test": "yarn build && vitest run",
1313
"test:dev": "vitest",
14+
"g:tsc": "cd $INIT_CWD && rimraf dist/ && tsc",
1415
"website:build": "yarn workspace website run build",
1516
"website:start": "yarn workspace website run start"
1617
},
@@ -27,9 +28,11 @@
2728
"@typescript-eslint/eslint-plugin": "5.46.0",
2829
"@typescript-eslint/parser": "5.46.0",
2930
"@vitest/coverage-c8": "0.25.6",
31+
"cpy": "9.0.1",
3032
"eslint": "8.29.0",
3133
"eslint-config-prettier": "8.5.0",
3234
"eslint-plugin-prettier": "4.2.1",
35+
"execa": "6.1.0",
3336
"prettier": "2.8.1",
3437
"rimraf": "3.0.2",
3538
"tempy": "3.0.0",

packages/react-docgen-cli/package.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-docgen/cli",
3-
"version": "6.0.0-alpha.3",
3+
"version": "1.0.0-alpha.0",
44
"description": "A CLI and toolkit to extract information from React components for documentation generation.",
55
"repository": "reactjs/react-docgen",
66
"type": "module",
@@ -14,7 +14,7 @@
1414
"node": ">=14.17.0"
1515
},
1616
"scripts": {
17-
"build": "echo 'done'",
17+
"build": "yarn g:tsc",
1818
"watch": "echo 'done'"
1919
},
2020
"keywords": [
@@ -27,7 +27,14 @@
2727
},
2828
"license": "MIT",
2929
"dependencies": {
30-
"commander": "9.4.1",
31-
"react-docgen": "6.0.0-alpha.3"
30+
"chalk": "^5.1.2",
31+
"commander": "^9.4.1",
32+
"debug": "^4.3.4",
33+
"fast-glob": "^3.2.12",
34+
"react-docgen": "6.0.0-alpha.3",
35+
"slash": "^5.0.0"
36+
},
37+
"devDependencies": {
38+
"@types/debug": "4.1.7"
3239
}
3340
}

packages/react-docgen-cli/src/__tests__/__fixtures__/Component.js

-29
This file was deleted.

packages/react-docgen-cli/src/__tests__/__fixtures__/customResolver.js

-17
This file was deleted.

0 commit comments

Comments
 (0)