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
Fixes Project#hasDependencies to only check for dependencies instead … #7414
Fixes Project#hasDependencies to only check for dependencies instead … #7414
Conversation
In general, this isn't something that ember-cli expects to happen out of the box. Notice how all deps added to newly generated apps are
We should update this.resolveSync(`${depName}/package`); This will avoid the issue above because absolutely every package has to have a |
lib/models/project.js
Outdated
@@ -132,7 +132,8 @@ class Project { | |||
// Blueprint tests set this flag. | |||
return true; | |||
} | |||
for (let depName in this.dependencies()) { | |||
const excludeDevDeps = true; | |||
for (let depName in this.dependencies(this.pkg, excludeDevDeps)) { | |||
try { | |||
this.resolveSync(depName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tweak this to use the /package
thing I mentioned in another comment? I think that is the only real blocker for this PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give that a go. Thanks
FWIW, this is why CI is failing. As written in this PR ATM |
Sounds good. My use case is a bit different since not everything on our mono-repo is an ember app/addon, but I think the check for package should address both. I'll test it and update it. |
5931280
to
367e06b
Compare
That worked. I'll wait for the tests before getting too excited, but it worked fine on my local setup. I think this addresses both scenarios and it's a cleaner solution. |
This looks good to me now. 👍 |
lib/models/project.js
Outdated
@@ -134,7 +134,7 @@ class Project { | |||
} | |||
for (let depName in this.dependencies()) { | |||
try { | |||
this.resolveSync(depName); | |||
this.resolveSync(depName + '/package.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The manual string concat here is failing linting / CI:
not ok 10 eslint should have no errors in lib
Error: Code did not pass lint rules
lib/models/project.js
137:26 error Unexpected string concatenation prefer-template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I saw the failure yesterday, but I didn't get a chance to push a fix. It should be good now.
Some tests failed locally, but I'm not sure if those are related, I'll keep an eye on travis.
…t contain a entry point Every dependecny should have a package.json so we check for that instead
367e06b
to
e0d4618
Compare
Thank you! |
…of all dependencies
cc: @rwjblue @ef4
Not sure if this is the best solution, but I see two problems with the current implementation:
yarn --prod
I won't have the devDependencies, which may show up first when runningthis.dependencies()
@types/node
. I'm not sure how to fix this problem. All of our types are devDependencies, so this indirectly fixed it, but my guess is that there might be other packages that might be valid as a "dependency" that can't be resolved.