Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rthor/cra-generate
Scaffold a React component.
https://github.com/rthor/cra-generate
cli create-react-app react scaffold
Last synced: 9 days ago
JSON representation
Scaffold a React component.
- Host: GitHub
- URL: https://github.com/rthor/cra-generate
- Owner: rthor
- Created: 2017-01-08T21:36:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-13T11:03:26.000Z (about 6 years ago)
- Last Synced: 2024-10-13T08:54:26.464Z (26 days ago)
- Topics: cli, create-react-app, react, scaffold
- Language: JavaScript
- Homepage:
- Size: 95.7 KB
- Stars: 81
- Watchers: 4
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- -awesome-create-react-app - CRA Generate: Scaffold a React Component - Scaffold a React component. (Tools)
- awesome-create-react-app - CRA Generate: Scaffold a React Component - Scaffold a React component. (Tools)
README
# React Component Generator
Scaffold a React component for Create React App.
```bash
Usage: cra-generate [options]Options:
-h, --help output usage information
-V, --version output the version number
-f, --functional create a functional component
-t, --type-check [system] add @flow comment to script files
-c, --css-extension [extension] changes the extension of generated css files
-d, --directory [dir] specify a directory for the component
--test [type] either "jest" or "none"
--no-semi remove semicolons
```If a `.flowconfig` is present, a `// @flow` comment is prepended to all script files.
Project specific settings can be added to the `package.json` file under the `craGenerate` key. Eg
```json
"craGenerate": {
"fileFormat": "paramCase",
"cssExtension": "scss",
"directory": "widgets"
}
```| option | type | default | description |
|-----------------|---------|-------------|----------------------------------------------------------------------------------|
| directory | `string` | "components" | Where, relative to the `./src/` directory, the component should be. |
| fileFormat | `string` | "pascalCase" | One of: camelCase, constantCase, headerCase, paramCase, pascalCase or snakeCase. |
| componentFormat | `string` | "pascalCase" | One of: camelCase, constantCase, headerCase, paramCase, pascalCase or snakeCase. |
| typeCheck | `undefined|string` | `undefined` | Can be set explicitly to "flow". |
| cssExtension | `string` | "css" | File extensions, with or without a dot. |
| semi | `true|false` | `true` | Should script files be terminated with a semicolon. |
| test | `false|string` | "jest" | Only jest for now. Can be skipped with false. |## License
MIT