Skip to content

Commit

Permalink
feat: Introduce new CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Dec 10, 2022
1 parent 8cb8f28 commit 3b28f6e
Show file tree
Hide file tree
Showing 56 changed files with 1,547 additions and 723 deletions.
17 changes: 17 additions & 0 deletions .changeset/mighty-shrimps-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@react-docgen/cli': major
---

Introducing the new CLI package `@react-docgen/cli` which was extracted from `react-docgen` and is a complete rewrite.
Compared to the old CLI these are some of the major differences:

- Does not support input via stdin anymore
- The path argument is now a glob
- `-x, --extension` was removed in favor of globs
- `-e, --exclude` was removed
- `-i, --ignore` now accepts a glob
- `--handler` added
- `--importer` added
- `--failOnWarning` added

Check out https://react-docgen.dev/cli for the documentation.
7 changes: 7 additions & 0 deletions .changeset/rare-taxis-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'react-docgen': major
---

The CLi was removed from `react-docgen` into its own package `@react-docgen/cli`.

Check out https://react-docgen.dev/cli for the documentation.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dist
node_modules/
dist/
**/node_modules/*
!**/__fixtures__/**/node_modules/*
.idea/
coverage/
yarn-error.log
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packages/react-docgen": "6.0.0-alpha.3",
"packages/react-docgen-cli": "6.0.0-alpha.3"
"packages/react-docgen-cli": "1.0.0-alpha.0"
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"fix": "eslint . --ext .js,.ts --fix --report-unused-disable-directives",
"test": "yarn build && vitest run",
"test:dev": "vitest",
"g:tsc": "cd $INIT_CWD && rimraf dist/ && tsc",
"website:build": "yarn workspace website run build",
"website:start": "yarn workspace website run start"
},
Expand All @@ -27,9 +28,11 @@
"@typescript-eslint/eslint-plugin": "5.46.0",
"@typescript-eslint/parser": "5.46.0",
"@vitest/coverage-c8": "0.25.6",
"cpy": "9.0.1",
"eslint": "8.29.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
"execa": "6.1.0",
"prettier": "2.8.1",
"rimraf": "3.0.2",
"tempy": "3.0.0",
Expand Down
15 changes: 11 additions & 4 deletions packages/react-docgen-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-docgen/cli",
"version": "6.0.0-alpha.3",
"version": "1.0.0-alpha.0",
"description": "A CLI and toolkit to extract information from React components for documentation generation.",
"repository": "reactjs/react-docgen",
"type": "module",
Expand All @@ -14,7 +14,7 @@
"node": ">=14.17.0"
},
"scripts": {
"build": "echo 'done'",
"build": "yarn g:tsc",
"watch": "echo 'done'"
},
"keywords": [
Expand All @@ -27,7 +27,14 @@
},
"license": "MIT",
"dependencies": {
"commander": "9.4.1",
"react-docgen": "6.0.0-alpha.3"
"chalk": "^5.1.2",
"commander": "^9.4.1",
"debug": "^4.3.4",
"fast-glob": "^3.2.12",
"react-docgen": "6.0.0-alpha.3",
"slash": "^5.0.0"
},
"devDependencies": {
"@types/debug": "4.1.7"
}
}
29 changes: 0 additions & 29 deletions packages/react-docgen-cli/src/__tests__/__fixtures__/Component.js

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3b28f6e

Please sign in to comment.