Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-docgen-typescript-plugin

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-docgen-typescript-plugin

A webpack plugin to inject react typescript docgen information.

  • 0.4.2-canary.9.7536c0f.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
366K
increased by12.89%
Maintainers
1
Weekly downloads
 
Created
Source

react-docgen-typescript-plugin

A webpack plugin to inject react typescript docgen information

Install

npm install --save-dev react-docgen-typescript-plugin
# or
yarn add -D react-docgen-typescript-plugin

Usage

NOTE: The TypeScript compiler options allowSyntheticDefaultImports and esModuleInterop will make react-docgen-typescript-plugin a lot harder! Turn them off for faster build times.

const ReactDocgenTypescriptPlugin = require("react-docgen-typescript-plugin");

module.exports = {
  plugins: [
    // Will default to loading your root tsconfig.json
    new ReactDocgenTypescriptPlugin(),
    // or with a specific tsconfig
    new ReactDocgenTypescriptPlugin({ tsconfigPath: "./tsconfig.dev.json" }),
    // or with compiler options
    new ReactDocgenTypescriptPlugin({ compilerOptions: { jsx: ts.JsxEmit.Preserve } }),
  ],
};

Options

This plugins support all parser options from react-docgen-typescript and all of the following options

OptionTypeDescriptionDefault
tsconfigPathstringSpecify the location of the tsconfig.json to use.null
compilerOptionsobjectSpecify compiler options. Cannot be used with tsconfigPathnull
docgenCollectionNamestring or nullSpecify the docgen collection name to use. All docgen information will be collected into this global object. Set to null to disable.STORYBOOK_REACT_CLASSES
setDisplayNamebooleanSet the components' display name. If you want to set display names yourself or are using another plugin to do this, you should disable this option.true
typePropNamestringSpecify the name of the property for docgen info prop type.type
excludeglob[]Glob patterns to ignore and not generate docgen information for. (Great for ignoring large icon libraries)[]
includeglob[]Glob patterns to generate docgen information for['/.tsx']

Debugging

If you want to see how this plugins is including and excluding modules set the DEBUG environment variable.

  • DEBUG=docgen:* - All logs
  • DEBUG=docgen:include - Included modules
  • DEBUG=docgen:exclude - Excluded modules
DEBUG=docgen:* npm run storybook

Prior Art

Keywords

FAQs

Package last updated on 16 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc