Git Product home page Git Product logo

lr-module-gen's Introduction

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

lr-module-gen's People

Contributors

1is10 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.