0.9.9 • Published 2 years ago

lr-module-gen v0.9.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

lr-module-gen readme

Installation

npm/yarn

npm i -g lr-module-gen
# or #
yarn global add lr-module-gen

from sources

# install nodejs + yarn if not yet
# add yarn bin dir to your PATH, like that (add next line to your .zshrc or .bashrc)
export PATH=$HOME/.yarn/bin:$PATH
# git clone this repo
yarn
yarn run run # will compile cli
yarn link
# to uninstall 
yarn unlink

to recompile cli run:

yarn build

First steps (just to figure out how it works)

  1. mkdir & cd to new empty project directory
  2. Call lr-module-gen init && lr-module-gen init template-sample
  3. All project info will be placed in .lr.module.gen & simple templates inside templates directory
  4. To generate module call lr-module-gen gen or lr-module-gen gen module

Questions & Answers

  • How to use git config parameters inside templates?

This case not supported now, if you need some specific shell variables you can use js in your .lr.module.gen file.\ For example like this one:

const execSync = require('child_process').execSync

module.exports = {
    "generatorOutputPaths": {
        "sources": "./src",
        "tests": "./tests"
    },
    "predefinedVariables": {
        "copyright": {
            "value": "Template copyright",
            "editable": false
        },
        "author": {
            value: (new String(execSync('git config --global user.name'))).trim(),
            editable: false
        }
    },
    "templatesPaths": {
        "module": "templates/module",
        "serviceTemplate": "templates/service"
    }
}

Known bugs

  • none, feel free to submit if you find any 🐞

External templates check points

  • info.js && .lr.module.gen inside template directory included as simple js file, with rw permissions, all templates should be checked & verified by user
0.9.7

2 years ago

0.9.9

2 years ago

0.9.6

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.5

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago