@fuselab/react-gen

1.6.8 • Public • Published

General purpose code generator from template

fuse-gen is a general purpose template based code generator

Get started

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.

Create starter React-redux-uifabric app

fuse-gen new -k app -a [appName]
# answer prompts about the configuration of the your app

Create new redux component

cd {appRoot}\components
fuse-gen new -k component -a .
# specify the name of your component

create new redux action

cd {appRoot}\actions
fuse-gen new -k action -a .
# answer prompts about the actions to be created

create new yargs based cli

fuse-gen new -k cli -a .

Advanced usage

The add sub command allows you use custom templates to

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.
  2. Also use {{name}} in file and folder names to change the generated file names

example

\component
   \{{component}}.tsx
   \index.ts
   \{{component}}Classes.tx

{{component}}.tsx

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> {
}

Readme

Keywords

none

Package Sidebar

Install

npm i @fuselab/react-gen

Weekly Downloads

0

Version

1.6.8

License

ISC

Unpacked Size

201 kB

Total Files

103

Last publish

Collaborators

  • botframework
  • sgellock
  • cwhitten