diff --git a/README.md b/README.md index d68acfe..a06478a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Add propType doc to react classes ## Installation ```sh -$ npm install @kadira/babel-plugin-react-docgen +$ npm install babel-plugin-react-docgen ``` ## Usage @@ -16,21 +16,21 @@ $ npm install @kadira/babel-plugin-react-docgen ```json { - "plugins": ["@kadira/babel-plugin-react-docgen"] + "plugins": ["babel-plugin-react-docgen"] } ``` ### Via CLI ```sh -$ babel --plugins @kadira/babel-plugin-react-docgen script.js +$ babel --plugins babel-plugin-react-docgen script.js ``` ### Via Node API ```javascript require("babel-core").transform("code", { - plugins: ["@kadira/babel-plugin-react-docgen"] + plugins: ["babel-plugin-react-docgen"] }); ``` @@ -38,4 +38,7 @@ require("babel-core").transform("code", { * React class information is avalable via `.__docgenInfo` as a JSON parsabel string. * This plugin uses `react-docgen` under the hood, so every [limitation](https://github.com/reactjs/react-docgen#guidelines-for-default-resolvers-and-handlers) it has, applies. -* Only works classes extended from `React.Component` with a `render()` method. `React.createClass` and stateless components are not supported yet. +* If you need a global object with all the react component docs, set plugin options like this in `.babelrc` (replace with variable name you want) +``` +"plugins":[["babel-plugin-react-docgen", {"DOC_GEN_GLOBAL": ""}]] +``` diff --git a/package.json b/package.json index 0a3d4d9..f3b9209 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.0", + "version": "1.2.0", "name": "@kadira/babel-plugin-react-docgen", "description": "Add propType doc to react classes", "repository": "https://github.com/kadirahq/babel-plugin-react-docgen",