Conversation
|
This probably does need a re-evaluation in light of the node 20 behavior. I don't think it's the best idea to have a value set that the user can't control at least through config. (This comment touches on that, correctly I think). It's been quite awhile since I looked under the hood on this repo. Would this PR allow npm to pass this in as a defined value (again, not from a prompt but from the |
|
I'm not quite familiar with the |
|
These are the configs that npm can set, starting at https://docs.npmjs.com/cli/v10/using-npm/config#init-author-email. The tracking issue for adding the new config is at npm/statusboard#654 |
|
I'm adding this to the npm 11 roadmap along with the config changes. |
|
@benmccann Thank you so much for your contribution here and helping us get started on this work. Unfortunately, the implementation needs to happen in the If you'd like to checkout my revision it's here #313 |
I've read through several issues in both
npm/cliandnpm/rfcsand there seems to be universal agreement that adding"type": "commonjs"would be an improvement as it's better to explicit than implicit both for understandability and to improve performance by eliminating the need to go down detection code paths.Several people have also suggested prompting for the
typefield and that is much more controversial and has been decided against, so I have not done that.References
npm/rfcs#75 (comment)
From https://nodejs.org/en/blog/release/v20.10.0:
https://publint.dev/ and the
publintpackage also validate that thetypefield is present and warn package authors if it is not. It would be best to create apackage.jsonwithout warnings out of the box: https://github.com/bluwy/publint/blob/master/site/rules.md#use_type