1.6.8 • Published 5 years ago

@fuselab/react-gen v1.6.8

Weekly downloads
15
License
ISC
Repository
-
Last release
5 years ago

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

5 years ago

1.6.7

6 years ago

1.6.6

6 years ago

1.6.5

6 years ago

1.6.4

6 years ago

1.6.3

6 years ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago