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

Option to ignore some dependencies #63

Closed
sindresorhus opened this issue Dec 29, 2014 · 10 comments
Closed

Option to ignore some dependencies #63

sindresorhus opened this issue Dec 29, 2014 · 10 comments

Comments

@sindresorhus
Copy link

I run David on all my modules once in a while and there are some commonly used dependencies that are outdated but that I don't care about updating, like e.g. Mocha. Would be useful if David had an ignore option where I could ignore dependencies I don't care about.

FGRibreau added a commit to FGRibreau/check-build that referenced this issue Feb 18, 2015
It will be removed (the update will be transparent for our users) once David will support this feature natively (see issue [alanshaw/david#63.
@FGRibreau
Copy link

👍

@rpominov
Copy link

👍 I think it would be even better if such dependencies could be specified in a file, say .david-lock or something.

@rpominov
Copy link

I've implemented something quick to use in our project:
741614a...rpominov:722f8d9

Here is our pakage.json as an usage example:

{
  ...
  "scripts": {
    "check-updates": "david || true",
    "update-deps": "david u || true"
  },
  "dependencies": {
    ...
  },
  "devDependencies": {
    "david": "rpominov/david#722f8d9546f6944e0b91b71239fdc3320a2870e6"
    ...
  },
  "davidIgnore": [
    "david",
    "react-redux",
    "stats-webpack-plugin"
  ]
}

We run npm run check-updates to see what needs to be updated, and npm run update-deps for actual update. And put into davidIgnore packages that we don't want to update yet for some reasons.

It works fine for us, but not sure if it's good for a PR. I can make a PR, if this makes sense.

@shellscape
Copy link

👍 much needed improvement. We have several modules that we'd like to stick with older versions and we'd like not to see a reminder that they're out of date.

@alanshaw
Copy link
Owner

You can now do this with v6.3.0 of david (https://github.com/alanshaw/david#ignore-dependencies).

Enjoy, and let me know if you have any feedback :)

@sindresorhus
Copy link
Author

@alanshaw I was really looking for a command-line flag, as I want to ignore some dependencies from all packages and I don't want to have to add it to every single package.json. Should I open a new issue?

@alanshaw
Copy link
Owner

Just FYI when calling getDependencies or getUpdatedDependencies programmatically you can pass it as an option:

david.getUpdatedDependencies(pkg, {ignore: ['async']}, (err, deps) => console.log(deps))

...but yes a command line arg would probably also be useful!

@sindresorhus
Copy link
Author

Alright: #82

@rpominov
Copy link

That great! Thank you!

@shellscape
Copy link

👍 thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants