Skip to content

feat: Introduce new CLI #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
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.
9 changes: 9 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"react-docgen": "6.0.0-alpha.3",
"@react-docgen/cli": "1.0.0-alpha.0"
},
"changesets": []
}
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