sezna / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
MIT License
1.43k stars 93 forks source link

feat: support .npsrc file for cli config #198

Closed effervescentia closed 5 years ago

effervescentia commented 5 years ago

What:

Adding support for a .npsrc or .npsrc.json configuration file to provide the require and config options to nps.

Why:

To simplify setups which require a preloaded module such as @babel/register especially when used with nps-utils.

Before and After

Screenshot 2019-06-16 at 5 05 54 PM

How:

Used find-up to search for a .npsrc or .npsrc.json file, parse it, filter out unwanted keys, then pass the result to yargs.config() to use as the default config when parsing process.argv.

Checklist:

codecov[bot] commented 5 years ago

Codecov Report

Merging #198 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #198   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines         389    397    +8     
  Branches       94     96    +2     
=====================================
+ Hits          389    397    +8
Impacted Files Coverage Δ
src/bin-utils/parser.js 100% <100%> (ø) :arrow_up:
src/bin-utils/index.js 100% <100%> (ø) :arrow_up:

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 a0c961a...470448f. Read the comment docs.

effervescentia commented 5 years ago

@danecando @florianloechle @kevjin sorry to put you on blast, but you were the last 3 to make contributions to this project. Could I bother one of you to take a look and sign off on my changes?

effervescentia commented 5 years ago

@kentcdodds how do you want to move forward with this? Is there someone you can reach out to review this? If not, what should we do to proceed?

kentcdodds commented 5 years ago

Would you be willing to take over maintenance of this project? That would involve me transferring the repository and npm package to you and separating myself completely from nps. I just don't have the bandwidth to maintain it anymore :-(

sezna commented 5 years ago

This looks good to me, and I think it is a good addition.

cursedcoder commented 4 years ago

Would be nice to update https://github.com/sezna/nps/issues/215