Star

Created With

linkConfig

The dotfile configuration is how Progen knows about the project, where it's templates are, mapping of templates names and outputs and more.

To get started, create a file called .progenrc. Although it does not matter where this file is you must execute all Progen cli commands in the directory this file is in so for this guide we'll assume it is at the root of your project. It must have the following properties:

linktemplates

This is a relative path from current working directory to the directory where the templates are. It can be anywhere in the project but in this documentation we'll assume it is .progen/templates.

linkfilenameSeparator (Optional)

This is a character to separate parts of your file's name. For example if your filename is page.view.js then your filenameSeparator is '.'. This is useful to group related files by their name. This means that if you have a page template which is made out of 3 files,

Page
1page.view.js

2page.types.js

3page.spec.js

You can call Progen with -w page -n home and all 3 files will be copied, and the result will be

Filename Separator
1home.view.js

2home.types.js

3home.spec.js

Or if you want a module instead pass the -m arg, like so -w page -n home -m and Progen will create a directory with the name passed while keeping the suffixes for files copied.

Filename Separator
1home/

2 view.js

3 types.js

4 spec.js

linkOutput

This is a key/value mapping of filename and path. The output of a file is picked by how close it matches the template filename. Output keys can overlap to give some files in a group a different output path. For example, let's assume want all your type files in a type directory. Given the following templates:

Page
1page.view.js

2page.spec.js

3page.types.js

You can have the following output configuration:

.progenrc
1{

2 "output": {

3 "page": "./pages",

4 "page.type": "./types",

5 }

6}

The result will be:

Result
1/pages

2 page.view.js

3 page.spec.js

4/types

5 page.types.js

linkExample Config File

.progenrc
1{

2 "templates": "TEMPLATES_PATH",

3 "filenameSeparator": "FILENAME_SEPARATOR_CHAR", /* --> This is optional. */

4 "output": {

5 "FILENAME_KEY": "RELATIVE_PATH"

6 }

7}

ConfigtemplatesfilenameSeparator (Optional)OutputExample Config File

Current Version: 0.0.0



Home Quick Start Config Templates CLI