generator-trybonsai
v0.6.1
Published
Bonsai official app generators
Downloads
10
Maintainers
Readme
generator-trybonsai
Bonsai React component generator powered by Yeomaan
The trybonsai:component
generator creates a React component directory with a Jest test file, Storybook story file and a simple Typescript base React component to speed up creating of new React components.
Installation
First, install Yeoman and generator-trybonsai using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-trybonsai
Usage
Generate a new React component folder:
yo trybonsai:component
# or specify a name directly:
yo trybonsai:component MyComponent
This will create a component directory at src/components/MyComponent
with the following structure:
src/
components/
MyComponent/
index.ts
MyComponent.tsx
MyComponent.test.tsx
MyComponent.stories.tsx
You can optionally pass a path to place the component wherever you want:
yo trybonsai:component web/components/Foo
License
MIT © Bonsai, Inc.