MozillaFoundation / mofo-standards

Mozilla Foundation – Engineering Guidebook
6 stars 2 forks source link

Define npm scripts #19

Open alanmoo opened 7 years ago

alanmoo commented 7 years ago

Obviously we've got start, but what about development scripts? npm run dev?

gvn commented 7 years ago

By "development script", do you mean running a local build?

alanmoo commented 7 years ago

Yup, scripts for use during local development. I feel like we should have at least one standard one across projects which perhaps runs an install and watches files when run.

gvn commented 7 years ago

Usually that's already covered by start.

I'd standardize start as containing:

gvn commented 7 years ago

Proposed standard naming:

alanmoo commented 7 years ago

I'm still not sure I love npm i being a part of start- it often slows things down. If we started using yarn, I could see that as it's pretty fast to validate existing packages are installed properly. Though I feel like I've run into this issue before.

Also, would server then be the command to run the project as it will run in production? Basically start without the watch tasks? I feel like we should go the other way where start works as production, but then a dev task sprinkles in some extra usefulness (like watch).

gvn commented 7 years ago

I'm still not sure I love npm i being a part of start- it often slows things down.

Oh, I thought you liked it because you asked for it on Science. I'm fine not having npm i as part of start, but I don't find it problematic either. I'm not generally re-running start repeatedly. yarn is a good reason to leave it out if people want to use it.

Also, would server then be the command to run the project as it will run in production?

I like to do either:

I feel like we should go the other way where start works as production, but then a dev task sprinkles in some extra usefulness (like watch).

That's the opposite of the convention that we've been using on most projects.