micro-analytics / micro-analytics-cli

Public analytics as a Node.js microservice. No sysadmin experience required! 📈
MIT License
734 stars 39 forks source link

Refactor cli to not exec npm start #52

Closed relekang closed 7 years ago

relekang commented 7 years ago

This will make the output a bit nicer and after the reason refactoring for realtime it is not necessary to call micro.

It will use uncompiled sources if there is async await support.

Before

~/dev/ma/micro-analytics(master) » ./cli.js --help

> micro-analytics-cli@2.0.1 start /Users/rolf/dev/ma/micro-analytics
> node dist/index.js "/Users/rolf/.nvm/versions/node/v7.7.2/bin/node" "/Users/rolf/dev/ma/micro-analytics/cli.js" "--help"

  Usage: micro-analytics [options] [command]

  Commands:

    help  Display help

  Options:

    -a, --adapter [value]  Database adapter used (defaults to "flat-file-db")
    -h, --help             Output usage information
    -H, --host [value]     Host to listen on (defaults to "0.0.0.0")
    -p, --port <n>         Port to listen on (defaults to 3000)
    -v, --version          Output the version number

After:

~/dev/ma/micro-analytics(refactor-cli) » ./cli.js --help

  Usage: micro-analytics [options] [command]

  Commands:

    help  Display help

  Options:

    -a, --adapter [value]  Database adapter used (defaults to "flat-file-db")
    -h, --help             Output usage information
    -H, --host [value]     Host to listen on (defaults to "0.0.0.0")
    -p, --port <n>         Port to listen on (defaults to 3000)
    -v, --version          Output the version number

Also, but not visible here the help screen now has nice colors 🙃

codecov-io commented 7 years ago

Codecov Report

Merging #52 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #52   +/-   ##
=======================================
  Coverage   71.13%   71.13%           
=======================================
  Files           6        6           
  Lines          97       97           
  Branches       20       20           
=======================================
  Hits           69       69           
  Misses         28       28

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ddcf371...d6c618d. Read the comment docs.