Open ryan-roemer opened 8 years ago
This is easy to do with plain old npm as well:
"scripts": {
"check": "npm run lint && npm run test",
"lint": "echo OK",
"test": "npm run check"
}
...but perhaps a little easier with Builder since you're not looking at the full list of tasks when you edit package.json
. I'm inclined to just add a word of caution to the docs instead of figuring out a technical solution.
I'm inclined to just add a word of caution to the docs instead of figuring out a technical solution.
It might be interesting to come up with a tool that checks for these kinds of infinite loops in scripts
that'd work for builder
or npm
.
An easy footgun with the existing https://github.com/FormidableLabs/builder-react-component/blob/master/package.json is if in:
and then run:
and watch an infinite loop of the same task...
The
lint
command works just fine, butbuilder run test
in the archetype hits the ROOTtest
task recursively firing up everything again, and again, and again, ...TASK: Research a way to detect and deal with:
npm:test
really be something worth ofnpm test
in ROOT and remove archetypetest
commands.test
be an example of overriding commands./cc @coopy @chaseadamsio