Skip to content

Exclude dev deps from being auto-added to deps and vice versa #61

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

Merged
merged 2 commits into from
Mar 7, 2017

Conversation

addaleax
Copy link
Contributor

@addaleax addaleax commented Apr 8, 2016

Do not add folders from node_modules/ which are present in the existing package.json’s devDependencies field to the dependencies field of the newly generated package.json, and vice versa.

Fixes: npm/npm#12260

@zkat
Copy link
Contributor

zkat commented May 18, 2016

Hey, @addaleax -- could you add some tests to this? It looks great so far! Thank you for the patch and your patience. I know it takes us a while to roll onto stuff, specially in dependencies.

Do not add folders from node_modules/ which are present in the
existing package.json’s `devDependencies` field to the
`dependencies` field of the newly generated package.json,
and vice versa.

Fixes: npm/npm#12260
@addaleax
Copy link
Contributor Author

@zkat Sorry it took me so long, your comment somehow got lost in my inbox – I don’t think there were any existing tests for this functionality present at all (I guess that’s why I didn’t add anything back when I made this PR?).

Anyway, I’ve added a test file that should check reading in dependencies + checks that something already present as a regular dependency is not added to devDependencies. I know it’s quite rudimentary, so let me know what you’d like to see changed/added/etc.

Have a nice day!

@jokeyrhyme
Copy link

I came across this too, documented my findings here: jokeyrhyme/node-init.js#96

Copy link
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch, @addaleax!

@zkat zkat merged commit 1f89041 into npm:master Mar 7, 2017
@addaleax addaleax deleted the fix-npm-12260 branch March 7, 2017 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants