| ▲ | Cthulhu_ 5 hours ago | |
The main downside to putting scripts into package.json (or NX's project.json) is that you have to wrap it in JSON. Which is fine for simple commands, but when you start adding stuff like quotes or multi-command commands it starts to get a bit busy. I quite like make or just as a task runner, since the syntax / indentation / etc overhead is a lot lower. I haven't yet tried to introduce it in any JS based projects though, because it adds yet another tool. | ||
| ▲ | forty 3 hours ago | parent | next [-] | |
I put any sufficiently complex command to scripts/<command>.sh and keep the package json as light as possible. One very big upside I have to use package.json is that we use pnpm which has very sophisticated way of targeting packages with --filter (like "run tests from packages that had modification compared to master and all their transitively dependents packages" which is often exactly what you want to do) | ||
| ▲ | cgfjtynzdrfht 5 hours ago | parent | prev [-] | |
[dead] | ||