suhaotian / use-one-templates

templates generator for use-one https://github.com/suhaotian/use-one

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useOne templates

This is templates generator for use-one

Install

yarn

yarn add plop use-one-templates -D

npm

npm install plop use-one-templates --save-dev

Add command to scripts

"scripts": {
  "use-one": "USE_ONE_BASE_PATH=src/states/ plop --plopfile node_modules/use-one-templates/plopfile.js",
}

USE_ONE_BASE_PATH default is src/states/, default will generator files at the src/states/ directory.

Useage

Let's create one count/userInfo/authInfo state

yarn

yarn use-one count true     # generate single file
yarn use-one userInfo false # generate a folder
yarn use-one authInfo false # generate a folder

npm

npm run use-one count true     # generate single file
npm run use-one userInfo false # generate a folder
npm run use-one authInfo false # generate a folder

generator output:

src
└── states
    ├── authInfo
    │   ├── actions.ts
    │   ├── index.ts
    │   ├── selectors.ts
    │   ├── types.ts
    │   └── utils.ts
    ├── count.ts
    └── userInfo
        ├── actions.ts
        ├── index.ts
        ├── selectors.ts
        ├── types.ts
        └── utils.ts

3 directories, 11 files

About

templates generator for use-one https://github.com/suhaotian/use-one


Languages

Language:Handlebars 52.1%Language:JavaScript 47.9%