Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: add preferDev field to package.json #272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Ginden
Copy link

@Ginden Ginden commented Nov 3, 2020

Certain packages are used almost exclusively for development. Eg. typescript, tslint etc. It's usually a mistake to add them as normal dependencies.

I suggest to add field "preferDev": boolean (with default false) to package.json. User can't install preferDev package as production package without specifying --save-prod flag.

References

npm/cli#1337

@ruyadorno ruyadorno added the Agenda will be discussed at the Open RFC call label Nov 4, 2020
@ljharb
Copy link
Contributor

ljharb commented Nov 4, 2020

eslint presumably would preferDev, but it’s a runtime dep in standard, for example. I’m not sure package authors have sufficient context to know whether their package needs to be dev or prod.

@darcyclarke darcyclarke added the semver:minor new backwards-compatible feature label Nov 4, 2020
@wesleytodd
Copy link

If this goes the direction of a warning, I would think you only show it on explicit package installs:

npm i eslint --save-prod

and not:

npm i

@isaacs
Copy link
Contributor

isaacs commented Nov 25, 2020

My comments on this are essentially the same as my comments on preferPeer, for all the same reasons.

@darcyclarke darcyclarke removed the Agenda will be discussed at the Open RFC call label Nov 25, 2020
@RilDev
Copy link

RilDev commented Dec 4, 2020

Also making sure that is appears as the default install suggestion on NPM would be convenient!

npm-change-default-install-recomendation

Using the format npm i [package-name] -D for example.

Reddit: How To Change The Default Install Suggestion On NPM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor new backwards-compatible feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants