3.2.13 • Published 3 years ago

file-gen-cli v3.2.13

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Build Status CodeFactor npm version BCH compliance License: MIT

Speed up with

Logo

A CLI that generate files for your application

Getting started

  • install globaly with

    npm i file-gen-cli@latest -g

  • Add a folder to hold your templates and gencli.json files

    files templates examples here see bellow for gencli configuration here

  • Register your cli config with

    file-gen-cli register

  • Use your cli with

    file-gen-cli myCliName

  • List clis with

    `file-gen-cli list tag1 ...

  • Deduce templates from a folder

    file-gen-cli deduce <instanceName> [<prefix> <instanceNamePlural>]

How it works

When you use the register parameters, file-gen-cli will lookup in the folder it's being executed for a gencli.json file. It will then save in the cloud this config associeted with the cliName parameters. It will then look each file configs of each entity configs then will look for each of the templates files name in the folder it's being executed. It will then store those file in the cloud associated with the cli name.

You can rewrite the config the same way

When the register is done, and you use file-gen-cli with you cli name as parameter, it will then generate the files.

File gen cli use an heroku hosted server app to manage the configs, see how it works here https://github.com/guignol1981/file-gen-cli-server

Documentation (gencli.json)

General config

Paramdefinitiondefaultrequiredpossible values
cliNamename of your clitruea string with no spaces
descriptiondesc of your config (for public list)true
tokena jwt to generate new configtruecontact me to get a token
fileNameCasethe case of the files namekebabfalsekebab, camel, pascal, constant, snake
folderNameCasethe case of the folders namekebabfalsekebab, camel, pascal, constant, snake
entityConfigsan array of entity configstruesee Entity config bellow

Entity config

Paramdefinitiondefaultrequiredpossible values
namethe entity nametrue
prefixthe entity prefix that can occur in different files templatefalse
fileConfigsan array of file configstrue
singularOnlyif there is only singular name occurence in templatesfalsefalse
flatdetermine if the cli should create a folder for the instancefalsefalse

File config

Paramdefinitiondefaultrequiredpossible values
namethe file name (the * symbole is replaced by the entity instance name)true
templatethe template name for the file (no template will generate an empty file)false
pathpath to create the file relative to the instance path./false

Templates

keywords (* = supported cases)replaced with
{{SINGULAR_*}}instance name with specified case
{{PLURAL_*}}instance plural name with specified case
{{PREFIXEDSINGULAR*}}instance prefixed name with specified case
{{PREFIXEDPLURAL*}}instance prefixed plural name with specified case

Supported Cases

CAMEL, CAPITAL, CONSTANT, DOT, HEADER, NO, KEBAB (deprecate, use PARAM) PARAM, PASCAL, PATH, SENTENCE, SNAKE,

TODO (feel free to help)

  • Convert to Typescript

Contributing

  • Feel free to suggest features, submit issues or update the documentation!

Contributors

  • Contribute and add your name here!

License

  • Copyright (c) 2019 Vincent Guillemette (github: guignol1981) Licensed under the MIT license.
3.2.2

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.2.6

3 years ago

3.2.5

3 years ago

3.2.4

3 years ago

3.2.9

3 years ago

3.2.8

3 years ago

3.2.7

3 years ago

3.2.13

3 years ago

3.2.12

3 years ago

3.2.11

3 years ago

3.2.10

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.12

3 years ago

3.0.13

3 years ago

3.0.10

3 years ago

3.0.11

3 years ago

3.0.16

3 years ago

3.0.8

3 years ago

3.0.17

3 years ago

3.0.7

3 years ago

3.0.14

3 years ago

3.0.15

3 years ago

3.0.9

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.0

3 years ago

1.2.23

3 years ago

1.2.24

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.18

3 years ago

1.2.19

3 years ago

1.2.20

3 years ago

1.2.21

3 years ago

1.2.22

3 years ago

1.2.16

3 years ago

1.2.17

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.5

3 years ago

1.2.9

3 years ago

1.2.12

3 years ago

1.2.13

3 years ago

1.2.11

3 years ago

1.2.14

3 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago