Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: storybookjs/babel-plugin-react-docgen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4b10e9ba43f560ef6c753f0df496e3e5db8d93a5
Choose a base ref
...
head repository: storybookjs/babel-plugin-react-docgen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: be192312625af551e3ce587a3aefb13b5b10f3ca
Choose a head ref

Commits on Jun 15, 2018

  1. Copy the full SHA
    007c3aa View commit details

Commits on Jun 17, 2018

  1. Merge pull request #52 from lawliet29/master

    Fix isExported to also detect export declarations
    wuweiweiwu authored Jun 17, 2018
    Copy the full SHA
    28bad09 View commit details
  2. Copy the full SHA
    b1fe1c6 View commit details
  3. Copy the full SHA
    8415292 View commit details
  4. Copy the full SHA
    b971f8a View commit details
  5. Copy the full SHA
    b8cfb20 View commit details
  6. Copy the full SHA
    0b5c6ac View commit details
  7. Copy the full SHA
    a5d4502 View commit details
  8. refactor imports

    danielduan committed Jun 17, 2018
    Copy the full SHA
    4945bac View commit details
  9. update changelog

    danielduan committed Jun 17, 2018
    Copy the full SHA
    13570a1 View commit details
  10. 2.0.0-rc.0

    danielduan committed Jun 17, 2018
    Copy the full SHA
    12a8a35 View commit details
  11. update tests

    danielduan committed Jun 17, 2018
    Copy the full SHA
    1824fb1 View commit details
  12. upgrade package deps

    danielduan committed Jun 17, 2018
    Copy the full SHA
    d465e77 View commit details
  13. Remove redundancy with react-docgen.

    Output docs under actual component name--not a different displayName.
    Output component docs based on react-docgen resolvers (multiple components supported).
    clehnert-psl authored and danielduan committed Jun 17, 2018
    Copy the full SHA
    ee247fe View commit details
  14. Update tests' expected doc prop order to accomodate default order of …

    …react-docgen handlers.
    
    Ignore macos directory files when testing.
    clehnert-psl authored and danielduan committed Jun 17, 2018
    Copy the full SHA
    8b097f4 View commit details
  15. Copy the full SHA
    a33195a View commit details
  16. fix test

    danielduan committed Jun 17, 2018
    Copy the full SHA
    d87efe4 View commit details
  17. add test in #48

    danielduan committed Jun 17, 2018
    Copy the full SHA
    caee408 View commit details
  18. Copy the full SHA
    3063068 View commit details
  19. new beta of docgen

    danielduan committed Jun 17, 2018
    Copy the full SHA
    22b9cee View commit details
  20. 2.0.0-rc.1

    danielduan committed Jun 17, 2018
    Copy the full SHA
    90b2af0 View commit details

Commits on Aug 14, 2018

  1. Fix crash on name

    onigoetz authored and danielduan committed Aug 14, 2018
    Copy the full SHA
    228e267 View commit details

Commits on Sep 6, 2018

  1. Copy the full SHA
    0781d56 View commit details
  2. update tests for babel 7

    danielduan committed Sep 6, 2018
    Copy the full SHA
    85b7dc0 View commit details
  3. uninstalled babel?

    danielduan committed Sep 6, 2018
    Copy the full SHA
    4f3feec View commit details
  4. upgrade to babel 7 rc

    danielduan committed Sep 6, 2018
    Copy the full SHA
    b84aa2f View commit details
  5. 2.0.0-babel7.0

    danielduan committed Sep 6, 2018
    Copy the full SHA
    f0aa6fd View commit details
  6. Copy the full SHA
    d9d0f6e View commit details
  7. update test

    danielduan committed Sep 6, 2018
    Copy the full SHA
    21d6dd8 View commit details
  8. 2.0 release changes

    danielduan authored Sep 6, 2018
    Copy the full SHA
    a653d53 View commit details

Commits on Jan 29, 2019

  1. 2.0.0

    danielduan committed Jan 29, 2019
    Copy the full SHA
    a8d843a View commit details
  2. Copy the full SHA
    1558ddb View commit details
  3. 2.0.1

    danielduan committed Jan 29, 2019
    Copy the full SHA
    9ad9aba View commit details
  4. Update CHANGELOG.md

    danielduan authored Jan 29, 2019
    Copy the full SHA
    7aea361 View commit details
  5. Update CHANGELOG.md

    danielduan authored Jan 29, 2019
    Copy the full SHA
    cb50e72 View commit details
  6. Copy the full SHA
    453b3df View commit details
  7. 2.0.2

    danielduan committed Jan 29, 2019
    Copy the full SHA
    fa17079 View commit details

Commits on Mar 27, 2019

  1. Add forward ref support

    lflpowell authored and danielduan committed Mar 27, 2019
    Copy the full SHA
    9f86139 View commit details
  2. Copy the full SHA
    9c44c9f View commit details
  3. 3.0.0

    danielduan committed Mar 27, 2019
    Copy the full SHA
    9eaecf7 View commit details
  4. 3.0 update changelog

    danielduan committed Mar 27, 2019
    Copy the full SHA
    041e7f0 View commit details

Commits on Apr 16, 2019

  1. Copy the full SHA
    0c974d1 View commit details
  2. fix tests

    danielduan committed Apr 16, 2019
    Copy the full SHA
    69a3b36 View commit details
  3. add to handlers to doc

    danielduan committed Apr 16, 2019
    Copy the full SHA
    e69d989 View commit details
  4. update package lock file

    danielduan committed Apr 16, 2019
    Copy the full SHA
    f0b95d6 View commit details
  5. update changelog

    danielduan committed Apr 16, 2019
    Copy the full SHA
    c57d0b0 View commit details

Commits on Aug 28, 2019

  1. Bump mixin-deep from 1.3.1 to 1.3.2

    Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
    - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
    - [Commits](jonschlinkert/mixin-deep@1.3.1...1.3.2)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Aug 28, 2019
    Copy the full SHA
    400c558 View commit details

Commits on Sep 1, 2019

  1. Bump mixin-deep from 1.3.1 to 1.3.2 (#73)

    Bump mixin-deep from 1.3.1 to 1.3.2
    
    Co-authored-by: null <49699333+dependabot[bot]@users.noreply.github.com>
    ndelangen and dependabot[bot] authored Sep 1, 2019
    Copy the full SHA
    b45dc4e View commit details

Commits on Oct 23, 2019

  1. Upgrade dependencies

    stof authored and danielduan committed Oct 23, 2019
    Copy the full SHA
    d5eb989 View commit details
  2. Fix test for the new babel version

    stof authored and danielduan committed Oct 23, 2019
    Copy the full SHA
    b61f0d4 View commit details
Showing with 7,888 additions and 4,942 deletions.
  1. +3 −1 .babelrc
  2. +3 −1 .gitignore
  3. +7 −0 .prettierrc
  4. +51 −0 CHANGELOG.md
  5. +8 −7 README.md
  6. +5 −0 jest.config.js
  7. +0 −3,021 package-lock.json
  8. +23 −13 package.json
  9. +64 −0 src/actualNameHandler.js
  10. +98 −193 src/index.js
  11. +0 −35 src/isReactComponentClass.js
  12. +0 −102 src/isStatelessComponent.js
  13. +4 −0 src/relativePath.js
  14. +0 −325 test/fixtures/case1/expected.js
  15. +7 −1 test/fixtures/case1/{actual.js → input.js}
  16. +477 −0 test/fixtures/case1/output.js
  17. +0 −74 test/fixtures/case2/expected.js
  18. 0 test/fixtures/case2/{actual.js → input.js}
  19. +86 −0 test/fixtures/case2/output.js
  20. +0 −82 test/fixtures/case3/expected.js
  21. 0 test/fixtures/case3/{actual.js → input.js}
  22. +81 −0 test/fixtures/case3/output.js
  23. +0 −83 test/fixtures/case4/expected.js
  24. 0 test/fixtures/case4/{actual.js → input.js}
  25. +81 −0 test/fixtures/case4/output.js
  26. +0 −55 test/fixtures/case5/expected.js
  27. 0 test/fixtures/case5/{actual.js → input.js}
  28. +55 −0 test/fixtures/case5/output.js
  29. +0 −72 test/fixtures/case6/expected.js
  30. 0 test/fixtures/case6/{actual.js → input.js}
  31. +89 −0 test/fixtures/case6/output.js
  32. +0 −56 test/fixtures/case7/expected.js
  33. 0 test/fixtures/case7/{actual.js → input.js}
  34. +54 −0 test/fixtures/case7/output.js
  35. +0 −82 test/fixtures/case8/expected.js
  36. 0 test/fixtures/case8/{actual.js → input.js}
  37. +93 −0 test/fixtures/case8/output.js
  38. +0 −48 test/fixtures/case9/expected.js
  39. 0 test/fixtures/case9/{actual.js → input.js}
  40. +64 −0 test/fixtures/case9/output.js
  41. +0 −68 test/fixtures/createReactClass/expected.js
  42. 0 test/fixtures/createReactClass/{actual.js → input.js}
  43. +64 −0 test/fixtures/createReactClass/output.js
  44. +38 −0 test/fixtures/differentName/input.js
  45. +115 −0 test/fixtures/differentName/output.js
  46. +0 −55 test/fixtures/example-module-exports/expected.js
  47. 0 test/fixtures/example-module-exports/{actual.js → input.js}
  48. +48 −0 test/fixtures/example-module-exports/output.js
  49. +0 −82 test/fixtures/example/expected.js
  50. 0 test/fixtures/example/{actual.js → input.js}
  51. +87 −0 test/fixtures/example/output.js
  52. +18 −0 test/fixtures/exportedDeclaration/input.js
  53. +72 −0 test/fixtures/exportedDeclaration/output.js
  54. +0 −82 test/fixtures/flowType/expected.js
  55. +4 −0 test/fixtures/flowType/{actual.js → input.js}
  56. +121 −0 test/fixtures/flowType/output.js
  57. +26 −0 test/fixtures/flowTypeNotWorking/input.js
  58. +44 −0 test/fixtures/flowTypeNotWorking/output.js
  59. +32 −0 test/fixtures/forwardRef/input.js
  60. +88 −0 test/fixtures/forwardRef/output.js
  61. +0 −57 test/fixtures/functionDeclaration/expected.js
  62. 0 test/fixtures/functionDeclaration/{actual.js → input.js}
  63. +55 −0 test/fixtures/functionDeclaration/output.js
  64. +24 −0 test/fixtures/hoc-function/input.js
  65. +69 −0 test/fixtures/hoc-function/output.js
  66. +0 −86 test/fixtures/hoc-multiple/expected.js
  67. +11 −0 test/fixtures/hoc-multiple/{actual.js → input.js}
  68. +158 −0 test/fixtures/hoc-multiple/output.js
  69. +0 −86 test/fixtures/hoc/expected.js
  70. 0 test/fixtures/hoc/{actual.js → input.js}
  71. +108 −0 test/fixtures/hoc/output.js
  72. +38 −0 test/fixtures/multiple-exports/input.js
  73. +137 −0 test/fixtures/multiple-exports/output.js
  74. +81 −0 test/fixtures/multipleExports2/input.js
  75. +277 −0 test/fixtures/multipleExports2/output.js
  76. +0 −65 test/fixtures/reactCreateClass/expected.js
  77. 0 test/fixtures/reactCreateClass/{actual.js → input.js}
  78. +61 −0 test/fixtures/reactCreateClass/output.js
  79. +0 −70 test/fixtures/reactCreateElement/expected.js
  80. 0 test/fixtures/reactCreateElement/{actual.js → input.js}
  81. +77 −0 test/fixtures/reactCreateElement/output.js
  82. +21 −0 test/fixtures/with-custom-handlers/input.js
  83. +88 −0 test/fixtures/with-custom-handlers/output.js
  84. +0 −40 test/index.js
  85. +45 −0 test/index.test.js
  86. +4,528 −0 yarn.lock
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"presets": ["env", "stage-0"]
"presets": [
"@babel/env",
]
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
*.log
lib
*.DS_Store
*.DS_Store
.vscode
.cache
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"tabWidth": 2,
"bracketSpacing": true,
"trailingComma": "es5",
"singleQuote": true
}
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# ChangeLog

### v4.0.0
03-01-2020

Breaking changes:
* Upgrade to `react-docgen@5.0.0`

Maintenance:
* Overhaul tests to use jest instead of mocha

### v3.1.0
16-04-2019

New Features:
* Add support for custom React Docgen handlers #64, #65

### v3.0.0
27-03-2019

Breaking changes:
* Upgrade to `react-docgen@4.1.0`

Bug fixes:
* Fixes #67 where `forwardRef` wrapped components are not detected
* Upgrade to `lodash@4.17.10` to fix security vulnerability

### v2.0.2
29-01-2019

* Fixes #62 where `recast` is not in the right dependency tree

### v2.0.1
29-01-2019

* Updated to use release version of `react-docgen@^3.0.0`

### v2.0.0

Breaking changes:
* Use `findAllExportedComponentDefinitions` by default to generate info for named exports
* Default to not remove method info and changed `.babelrc` key to `removeMethods`

Bug fixes:
* Fix for named export using incorrect local name in `export default ComponentName`
[PR38](https://github.com/storybooks/babel-plugin-react-docgen/pull/38)
* Relies on `react-docgen` for more React component detection functionalities
[PR54](https://github.com/storybooks/babel-plugin-react-docgen/pull/54)
* Fix crash on `name`
[PR58](https://github.com/storybooks/babel-plugin-react-docgen/pull/58)
* Upgraded to Babel 7 and react-docgen 3.0-rc.1
[PR59](https://github.com/storybooks/babel-plugin-react-docgen/pull/59)

### v1.9.0
04-April-2018

15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -87,24 +87,25 @@ Use it inside your `.babelrc`

| option | description | default |
| --- | --- | --- |
| resolver | [react-docgen](https://github.com/reactjs/react-docgen) has 3 built in resolvers which may be used. Resolvers define how/what the doc generator will inspect. You may inspect the existing resolvers in [react-docgen/tree/master/src/resolver](https://github.com/reactjs/react-docgen/tree/master/src/resolver). | ```"findExportedComponentDefinition"``` |
| includeMethods | by default this plugin will remove method information about react components since it should not be needed in most cases | ```false``` |
| resolver | [react-docgen](https://github.com/reactjs/react-docgen) has 3 built in resolvers which may be used. Resolvers define how/what the doc generator will inspect. You may inspect the existing resolvers in [react-docgen/tree/master/src/resolver](https://github.com/reactjs/react-docgen/tree/master/src/resolver). | ```"findAllExportedComponentDefinition"``` |
| removeMethods | optionally remove docgen information about methods | ```false``` |

## Collect All Docgen Info

Sometimes, it's a pretty good idea to collect all of the docgen info into a collection. Then you could use that to render style guide or similar.

So, we allow you to collect all the docgen info into a global collection. To do that, add following config to when loading this babel plugin:

```json
```js
{
"plugins":[
[
"babel-plugin-react-docgen",
{
"babel-plugin-react-docgen",
{
"DOC_GEN_COLLECTION_NAME": "MY_REACT_DOCS",
"resolver": "findAllExportedComponentDefinitions", // optional (default: undefined)
"includeMethods": true // optional (default: false)
"resolver": "findAllComponentDefinitions", // optional (default: findAllExportedComponentDefinitions)
"removeMethods": true, // optional (default: false)
"handlers:": ["react-docgen-deprecation-handler"] // optional array of custom handlers (use the string name of the package in the array)
}
]
]
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
cacheDirectory: ".cache/jest",
clearMocks: true,
roots: ["test"]
};
Loading