Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqu committed Jan 24, 2021
2 parents 64d8361 + a5c421a commit 3cb264d
Show file tree
Hide file tree
Showing 30 changed files with 2,148 additions and 400 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.18.0
- image: circleci/node:15

jobs:
build_and_test:
Expand Down
10 changes: 0 additions & 10 deletions .npmignore

This file was deleted.

40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Zeplin CLI](https://github.com/zeplin/cli) plugin to generate descriptions and code snippets for React components.

Zeplin CLI React Plugin uses [react-docgen](https://github.com/reactjs/react-docgen) and [react-docgen-typescript](https://github.com/styleguidist/react-docgen-typescript) to analyze and collect information from React components. For more details about the supported formats, see `react-docgen` [guidelines](https://github.com/reactjs/react-docgen#guidelines-for-default-resolvers-and-handlers) and `react-docgen-typescript` [examples](https://github.com/styleguidist/react-docgen-typescript#example).

## Installation

Install the plugin using npm.
Expand All @@ -18,10 +20,46 @@ Run CLI `connect` command using the plugin.
zeplin connect -p @zeplin/cli-connect-react-plugin
```

Zeplin CLI React Plugin uses [react-docgen](https://github.com/reactjs/react-docgen) to analyze and collect information from React components. For more details about the supported formats, see `react-docgen` [guidelines](https://github.com/reactjs/react-docgen#guidelines-for-default-resolvers-and-handlers).
### Using react-docgen-typescript for Typescript components

You can choose to use either `react-docgen` or `react-docgen-typescript` for TypeScript in your plugin configurations.

```jsonc
{
...
"plugins" : [{
"name": "@zeplin/cli-connect-react-plugin",
"config": {
"tsDocgen": "react-docgen-typescript", // Default: "react-docgen"
"tsConfigPath": "/path/to/tsconfig.json" // Default: "./tsconfig.json"
}
}],
...
}
```

### Using react-docgen resolvers

You can set which built-in `react-docgen` resolver to use.

```jsonc
{
...
"plugins" : [{
"name": "@zeplin/cli-connect-react-plugin",
"config": {
// Default: "findAllExportedComponentDefinitions"
"reactDocgenResolver": "findExportedComponentDefinition",
}
}],
...
}
```

## About Connected Components

[Connected Components](https://blog.zeplin.io/introducing-connected-components-components-in-design-and-code-in-harmony-aa894ed5bd95) in Zeplin lets you access components in your codebase directly on designs in Zeplin, with links to Storybook, GitHub and any other source of documentation based on your workflow. 🧩

Check [Zeplin Connected Components Documentation](https://zpl.io/connected-components-docs) for getting started.

[Zeplin CLI](https://github.com/zeplin/cli) uses plugins like this one to analyze component source code and publishes a high-level overview to be displayed in Zeplin.
Loading

0 comments on commit 3cb264d

Please sign in to comment.