code gen tool for react.js in typescript
npm install @fuselab/react-genbash
npm install -g @fuselab/react-gen
`
Basic usage
The new sub command has built-in templates to support common usage scenarios of bootstrapping React-redux app.
$3
`bash
fuse-gen new -k app -a [appName]
answer prompts about the configuration of the your app
`
$3
`bash
cd {appRoot}\components
fuse-gen new -k component -a .
specify the name of your component
`
$3
`bash
cd {appRoot}\actions
fuse-gen new -k action -a .
answer prompts about the actions to be created
`
$3
`bash
fuse-gen new -k cli -a .
`
Advanced usage
The add sub command allows you use custom templates to
`bash
fuse-gen add --source [file|folder] --target [file|folder]
`
Create template
1. Create template folder structure. Use {{name}} to place variable entity in your template file content.
1. Also use {{name}} in file and folder names to change the generated file names
$3
`bash
\component
\{{component}}.tsx
\index.ts
\{{component}}Classes.tx
`
{{component}}.tsx
`typescript
export interface {{Component}}Attributes {
id: string;
}
export interface {{Component}}Actiosn {
save(): void;
}
export type {{Component}}Props = {{Component}}Attributes & {{Component}}Actions;
export class {{Component}} extends ReactCompoent<{{Component}}Props> {
}
``