0.6.0 • Published 2 years ago

@rebase-agency/generate-react-cli v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@rebase-agency/generate-react-cli

version License

CLI for generating React component files. To help speed up productivity in React projects and stop copying, pasting, and renaming files each time you want to create a new component. This tool create components with ts

Installation

npm install -g @rebase-agency/generate-react-cli

Usage

npx generate-react [options] <component> [path]

Generate Components

npx generate-react Box ./src/components

This command will create a folder with your component name in the specified path (e.g. src/components) directory, and its corresponding files.

Example of the component files structure:

|-- /src
    |-- /components
        |-- /Box
            |-- Box.tsx
            |-- Box.module.css
            |-- index.ts

Example of the Storybook with option -s component files structure:

|-- /Box
    |-- Box.tsx
    |-- Box.module.css
    |-- Docs.mdx
    |-- Box.stories.tsx
    |-- README.md
    |-- index.ts

Options

Generate public export file

This command will create a index.ts file with export yours components in the specified path (e.g. src/components) directory. The command overwrites the index.ts file.

npx generate-react export ./src/components

Example

For example, you have ./src/components with the following component folders:

|-- /src
    |-- /components
        |-- /Box
        |-- /Button
        |-- /Card
        |-- /Modal

Then the export command will generate a file index.ts with the following content:

export { Box } from "./Box";
export { Button } from "./Button";
export { Card } from "./Card";
export { Modal } from "./Modal";

License

@rebase-agency/generate-react-cli is an open source software licensed as MIT.

0.6.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago