[DAEMON-220] Plugin: Add support for loading plugins installed as a scoped npm package
GitHub Issue | n/a |
Type | Improvement |
Priority | None |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2018-02-16T16:02:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Appc Daemon 1.1.0 |
Components | appcd-plugin |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Chris Barber |
Created | 2018-01-12T16:42:45.000+0000 |
Updated | 2018-02-16T16:02:09.000+0000 |
Description
Description
DAEMON-215 introduced the global node_modules directory into the plugin lookup, however currently scoped packages are not supported, this is because a scoped package is contained in a directory where the name is the scope e.g @foo/bar is installed in /usr/local/lib/node_modules/@foo/bar. This appears to be because the node_modules dir is seen as a PluginsDirScheme, but we need to load the scoped packages as a NestedPluginsDirScheme. We should maybe check for any directories that start with '@' and then load directories under there rather than trying to load @foo as a plugin
Comments
JSON Source
https://github.com/appcelerator/appc-daemon/pull/273
I slightly improved version that supports scoped packages being added and removed. https://github.com/appcelerator/appc-daemon/pull/276