0.9.9 • Published 2 years ago
lr-module-gen v0.9.9
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)
- mkdir & cd to new empty project directory
- Call
lr-module-gen init
&&lr-module-gen init template-sample
- All project info will be placed in
.lr.module.gen
& simple templates insidetemplates
directory - To generate module call
lr-module-gen gen
orlr-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