github-release-notes icon indicating copy to clipboard operation
github-release-notes copied to clipboard

feat: support rc file from npm package

Open donaldshen opened this issue 6 years ago • 1 comments

Why

Sometimes we want to share the same .grenrc.js among many projects, and manage it using npm package, just like what prettier did. This is a job finishing pr #230 .

How

  1. treat gren as npm package name if it does not start with 'http'
  2. use npm's api to get the latest package version a. use require(child_process).spawnSync so that async operation could act like sync operation in main process
  3. use jsdelivr to get the config file

Test

  • Every broken test instances have been changed or removed;
  • We have made this change in this fork, and using it among our projects such as el-data-table, just works

donaldshen avatar Dec 27 '19 08:12 donaldshen

@donaldshen that's great! thanks.

The only thing is that we should probably have a mock for the remote configuration or at least a @gren/recommended sort of thing that at this point we should have.

alexcanessa avatar Jan 02 '20 14:01 alexcanessa