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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: fail build if peerDep is missing? #96

Open
samselikoff opened this issue Feb 5, 2019 · 7 comments
Open

Idea: fail build if peerDep is missing? #96

samselikoff opened this issue Feb 5, 2019 · 7 comments

Comments

@samselikoff
Copy link

馃憢 Hey there! I wanted to open an issue to discuss adding peerDependencies support to ember-cli-dependency-checker.

I've gone around a few times with folks like @ef4 and @Turbo87 about the best way for addons to specify their dependencies. It seems peerDependencies is semantically often what we want, but it's currently not really used or enforced by existing tooling.

If ember-cli-dependency-checker failed builds if a peer dependency were missing, it would encourage addon authors to start using them more, and might make everyone's lives a little easier.

What do you think? Has there been priori discussion around this? I'm just learning about these issues, but often get recommended to consider using peerDependencies even though it's not currently enforced anywhere. If this addon supported it, I think myself and others would be more incentivized to use it.

@Turbo87
Copy link
Contributor

Turbo87 commented Feb 6, 2019

in theory that sounds like a good idea, though in general I'm a little worried about it due to the other issues that peer dependencies have.

one example is ESLint plugins and ember-cli-eslint: the plugins usually declare an eslint peer dependency, but since the Ember app only has a dependency on ember-cli-eslint (which depends on broccoli-lint-eslint which depends on eslint) yarn will show warnings during yarn install. I'm worried that we'll run into similar issues 馃

@samselikoff
Copy link
Author

I see.

Would it be possible to inspect the "final graph" (if there is such a thing) to check for the presence of eslint?

@Turbo87
Copy link
Contributor

Turbo87 commented Feb 6, 2019

yes, but you might actually end up with several different versions if a subsubsubsubsubdependency misbehaves and has eslint as an actual dependency.

@quaertym
Copy link
Owner

quaertym commented Feb 6, 2019

We can only warn instead of failing build.

@Turbo87
Copy link
Contributor

Turbo87 commented Feb 6, 2019

@quaertym true, but yarn and npm already do that, so I'm not sure where the benefit would be

@rwjblue
Copy link
Collaborator

rwjblue commented Feb 6, 2019

One benefit is that npm and yarn only warn once upon install, whereas this addon would warn upon each invocation of ember...

@rwjblue
Copy link
Collaborator

rwjblue commented Feb 6, 2019

Also, see ember-cli/rfcs#112 for some background context here. I still need to dust off that RFC and re-submit it to emberjs/rfcs though...

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

No branches or pull requests

4 participants