I see the reasoning behind your approach, but – at least for a production-ready project – it feels a bit hack-y to me!
An alternative organizational method might be to move your NPM script definitions in to their own dedicated shell files within a build/ directory. This way, you can organize your script files without having to pepper your package.json with unnecessary entries. Though it won't give you the pretty npm run section headers you demonstrated (obviously), the directory structure gives you a similar kind of at-a-glance legibility. And using dedicate shell scripts will definitely simplify long-term package maintenance...
Hey! I'm YCMJason, a Software Engineer in London 👨💻. Love diving into tech puzzles and sharing them! 🧩
All views expressed here are my own opinions, so please take them with a pinch of salt! 🧂
I definitely agree with you. A build/ directory is definitely better for production projects.
But, I think this is a hack that wouldn't really hurt to add. It is not at all contradictory to having build/. And the good thing about it is the pretty npm run that will give a nicer guidelines to, maybe new developers who wants to find out the building instructions available.
I see the reasoning behind your approach, but – at least for a production-ready project – it feels a bit hack-y to me!
An alternative organizational method might be to move your NPM script definitions in to their own dedicated shell files within a
build/
directory. This way, you can organize your script files without having to pepper yourpackage.json
with unnecessary entries. Though it won't give you the prettynpm run
section headers you demonstrated (obviously), the directory structure gives you a similar kind of at-a-glance legibility. And using dedicate shell scripts will definitely simplify long-term package maintenance...Anyway, just my two-cents; thanks for thinking!
I definitely agree with you. A
build/
directory is definitely better for production projects.But, I think this is a hack that wouldn't really hurt to add. It is not at all contradictory to having
build/
. And the good thing about it is the prettynpm run
that will give a nicer guidelines to, maybe new developers who wants to find out the building instructions available.true enough. especially re: those “new developers who want to find... instructions”, a file system abstraction is probably suboptimal!