-
Notifications
You must be signed in to change notification settings - Fork 3k
npm start
defaults don't match npm init -y
defaults
#10313
Comments
A. breaks the alignment of |
Probably |
I feel pretty fine with the way it is right now, and it actually feels pretty good for libraries that have both an API and a server (which is more common than you'd think) -- I do think that we could definitely put more effort into making people aware of this dichotomy so they can take advantage of it more. |
Example: kmanion/senpai#3, and I think they had a pretty good reaction to it once it was clarified.
|
There's a consensus about what the defaults should be, and at the same time there's very little chance that the CLI team is going to have the cycles to get to this within the next 6-12 months, so I'm going to close this for now. Anyone interested in patching this behavior (hint hint @ashleygwilliams) should be aware that the defaulting behavior that points to |
npm init -y
setsmain
asindex.js
in thepackage.json
npm start
assumes aserver.js
there's an implicit assumption in my head, that
npm start
will assumemain
.these should probably tell a coherent story?
so maybe:
A.
npm init -y
should set main toserver.js
B.
npm start
looks for aindex.js
C.
npm start
looks for something by default, but will letmain
override itnot sure what i prefer. i usually have a
server.js
in the root that consumes someindex.js
in asrc
orapp
directory , so A matches how i dev, but i wonder if we shouldn't do some research or thinking on what we think is the most reasonable default. C is by far the best one IMO, but requires more work that touches more things.p.s. this was discovered while working on the docs: https://github.com/npm/docs/pull/436
The text was updated successfully, but these errors were encountered: