BaseCase/testdouble-chai

Remove required `peerDependency` on test double

Closed this issue · 8 comments

I know that testdouble-chai requires testdouble, but there are instances where you may not actually need it as a peer dependency. For example, I'm using testdouble-chai in Ember through ember-cli-testdouble and ember-cli-testdouble-chai. Because the wrapper packages provide the libraries, NPM does not consider them peer dependencies, even though I have both. Is is possible to remove the explicit peer dependency? I can't shrinkwrap my package because of this issue.

What version of npm are you using? npm3 stopped installing peerdeps automatically, instead dropping to warnings. I can't imagine they'd have made them warnings for install but errors for shrinkwrap.

NPM 3.10.3. That's what's frustrating -- installing it without the peer dependency works fine, but shrink-wrapping fails.

Hey, @alexlafroscia! I know basically nothing about shrinkwrap. Does this seem like a bug on their part that the apparent missing peerDep causes a failure? I'm fine with removing the line here if that's the only way to get it to work, though if it's a bug in the tool that will get resolved, I'd rather leave our peerDep in.

I think it's a bug insofar as npm-shrinkwrap is just horribly broken. (Especially in npm2; npm3 not so much). https://github.com/npm/npm/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20peer%20shrinkwrap, half of which are duplicates of this exact issue. Judging by that, 1) it's a problem with npm-shrinkwrap 2) it's existed for a long while and hasn't been fixed. 3) it probably won't get fixed anytime soon.

As much as it sucks to be adjusting for a broken tool, it seems like the right thing in this case. :(

Although I just had a thought... @alexlafroscia npm-shrinkwrap shouldn't be shrinkwrapping dev dependencies. Do you (accidentally or otherwise) have testdouble-chai listed as a prod dep?

For our app, we shrinkwrap dev dependencies explicitly so that the whole team's dev environment is in sync. So, I don't have it as a prod dependency, but it's still part of the shrinkwrap.

@alexlafroscia Alrighty, I removed the peerDep. Give 0.5.0 a shot, hopefully shrinkwrap behaves more nicely!