-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow shared nested addons to be properly discovered. #3335
Conversation
/cc @lukemelia could you review? (since you championed the initial AddonDiscovery extraction) |
}; | ||
``` | ||
|
||
This should *not* pose a problem for the vast majority of addon's. |
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.
nit: remove the apostrophe
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.
Good catch, updated.
38e072c
to
9a8b2c5
Compare
Looks good to me. Thanks @rwjblue! |
ac2f6c7
to
f5fb943
Compare
There are some acceptance test failures that I am working through... |
Prior to these changes we always assumed that an addon was at the current package's (could be either the project or another addon) `node_modules/<addon-name>` path. This is true in many cases, but not all. Specifically, with more recent versions of NPM a package that is shared by a nested child package and an ancestor package will be deduped and used from that parent directory. Simple example: * Package A * Depends on Package B * Depends on Package C * Package C depends on Package B The folder structure in this case for more recent versions of NPM (2.0.0+) would be: ``` package-a/node_modules/package-b/* package-a/node_modules/package-c/* ``` But our prior logic expected: ``` package-a/node_modules/package-b/* package-a/node_modules/package-c/* package-a/node_modules/package-c/node_modules/package-b/* ``` --- This PR ensures that we use the `resolve` package (which follows the [documented node resolution strategy](http://nodejs.org/api/modules.html#modules_all_together)) to determine the path to a given addon. **Please note** that this PR also removes the ability to have an addon without any node-land JS (previously it was possible to have only a `package.json` and `vendor/` folder for example). I am not aware of this being relied upon, but it is documented as a breaking change in the changelog for 0.2.0.
f5fb943
to
dfd2e0e
Compare
Just confirmed that this fixes the demo repo (https://github.com/alvincrespo/test-new-app) provided by @alvincrespo in #3240. |
Allow shared nested addons to be properly discovered.
🍻 |
Prior to these changes we always assumed that an addon was at the current package's (could be either the project or another addon)
node_modules/<addon-name>
path. This is true in many cases, but not all. Specifically, with more recent versions of NPM a package that is shared by a nested child package and an ancestor package will be deduped and used from that parent directory.Simple example:
The folder structure in this case for more recent versions of NPM (2.0.0+) would be:
But our prior logic expected:
This PR ensures that we use the
resolve
package (which follows the documented node resolution strategy) to determine the path to a given addon.Please note that this PR also removes the ability to have an addon without any node-land JS (previously it was possible to have only a
package.json
andvendor/
folder for example). I am not aware of this being relied upon, but it is documented as a breaking change in the changelog for 0.2.0.Closes #3240.