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
treat gren as npm package name if it does not start with 'http'
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
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
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.
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
gren
as npm package name if it does not start with 'http'require(child_process).spawnSync
so that async operation could act like sync operation in main processTest