{"action":"created","issue":{"url":"https://api.github.com/repos/zowe/imperative/issues/33","repository_url":"https://api.github.com/repos/zowe/imperative","labels_url":"https://api.github.com/repos/zowe/imperative/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/zowe/imperative/issues/33/comments","events_url":"https://api.github.com/repos/zowe/imperative/issues/33/events","html_url":"https://github.com/zowe/imperative/issues/33","id":366808541,"node_id":"MDU6SXNzdWUzNjY4MDg1NDE=","number":33,"title":"Using pkg to create a binary breaks plugins","user":{"login":"tucker01","id":37446232,"node_id":"MDQ6VXNlcjM3NDQ2MjMy","avatar_url":"https://avatars1.githubusercontent.com/u/37446232?v=4","gravatar_id":"","url":"https://api.github.com/users/tucker01","html_url":"https://github.com/tucker01","followers_url":"https://api.github.com/users/tucker01/followers","following_url":"https://api.github.com/users/tucker01/following{/other_user}","gists_url":"https://api.github.com/users/tucker01/gists{/gist_id}","starred_url":"https://api.github.com/users/tucker01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tucker01/subscriptions","organizations_url":"https://api.github.com/users/tucker01/orgs","repos_url":"https://api.github.com/users/tucker01/repos","events_url":"https://api.github.com/users/tucker01/events{/privacy}","received_events_url":"https://api.github.com/users/tucker01/received_events","type":"User","site_admin":false},"labels":[{"id":1023233890,"node_id":"MDU6TGFiZWwxMDIzMjMzODkw","url":"https://api.github.com/repos/zowe/imperative/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1047934641,"node_id":"MDU6TGFiZWwxMDQ3OTM0NjQx","url":"https://api.github.com/repos/zowe/imperative/labels/plugins","name":"plugins","color":"346e99","default":false}],"state":"open","locked":false,"assignee":{"login":"AHumanFromCA","id":37381232,"node_id":"MDQ6VXNlcjM3MzgxMjMy","avatar_url":"https://avatars1.githubusercontent.com/u/37381232?v=4","gravatar_id":"","url":"https://api.github.com/users/AHumanFromCA","html_url":"https://github.com/AHumanFromCA","followers_url":"https://api.github.com/users/AHumanFromCA/followers","following_url":"https://api.github.com/users/AHumanFromCA/following{/other_user}","gists_url":"https://api.github.com/users/AHumanFromCA/gists{/gist_id}","starred_url":"https://api.github.com/users/AHumanFromCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AHumanFromCA/subscriptions","organizations_url":"https://api.github.com/users/AHumanFromCA/orgs","repos_url":"https://api.github.com/users/AHumanFromCA/repos","events_url":"https://api.github.com/users/AHumanFromCA/events{/privacy}","received_events_url":"https://api.github.com/users/AHumanFromCA/received_events","type":"User","site_admin":false},"assignees":[{"login":"AHumanFromCA","id":37381232,"node_id":"MDQ6VXNlcjM3MzgxMjMy","avatar_url":"https://avatars1.githubusercontent.com/u/37381232?v=4","gravatar_id":"","url":"https://api.github.com/users/AHumanFromCA","html_url":"https://github.com/AHumanFromCA","followers_url":"https://api.github.com/users/AHumanFromCA/followers","following_url":"https://api.github.com/users/AHumanFromCA/following{/other_user}","gists_url":"https://api.github.com/users/AHumanFromCA/gists{/gist_id}","starred_url":"https://api.github.com/users/AHumanFromCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AHumanFromCA/subscriptions","organizations_url":"https://api.github.com/users/AHumanFromCA/orgs","repos_url":"https://api.github.com/users/AHumanFromCA/repos","events_url":"https://api.github.com/users/AHumanFromCA/events{/privacy}","received_events_url":"https://api.github.com/users/AHumanFromCA/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/zowe/imperative/milestones/2","html_url":"https://github.com/zowe/imperative/milestone/2","labels_url":"https://api.github.com/repos/zowe/imperative/milestones/2/labels","id":3730168,"node_id":"MDk6TWlsZXN0b25lMzczMDE2OA==","number":2,"title":"Developer","description":"","creator":{"login":"JTonda","id":35578141,"node_id":"MDQ6VXNlcjM1NTc4MTQx","avatar_url":"https://avatars0.githubusercontent.com/u/35578141?v=4","gravatar_id":"","url":"https://api.github.com/users/JTonda","html_url":"https://github.com/JTonda","followers_url":"https://api.github.com/users/JTonda/followers","following_url":"https://api.github.com/users/JTonda/following{/other_user}","gists_url":"https://api.github.com/users/JTonda/gists{/gist_id}","starred_url":"https://api.github.com/users/JTonda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JTonda/subscriptions","organizations_url":"https://api.github.com/users/JTonda/orgs","repos_url":"https://api.github.com/users/JTonda/repos","events_url":"https://api.github.com/users/JTonda/events{/privacy}","received_events_url":"https://api.github.com/users/JTonda/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":3,"state":"open","created_at":"2018-10-11T11:49:51Z","updated_at":"2018-10-18T19:24:50Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2018-10-04T14:08:12Z","updated_at":"2018-10-18T20:35:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If you use the `pkg` tool to create a binary executable for an imperative based CLI, plugins will no longer function correctly. They will install, but cannot be executed. \r\n\r\nIn summary, a symbolic link to the imperative package is created with `../snapshot/...` and the filesystem/node cannot resolve the link. \r\n\r\nThe plugins will install fine, but any command will fail with \"cannot find module imperative`.\r\n\r\nSome investigation was done regarding module resolution in plugins. It turns out, if you use the absolute path (as dictated within the binary) in your plugins requires/imports, node will resolve imperative just fine and the plugin will function properly. In other words, if you change the import statements in the plugin to use an absolute path (at least on windows) of something like `C:\\\\snapshot\\node_modules\\...` it \"works\". \r\n\r\nA possible solution (which could eliminate the need for peerDependencies, the symlink, and admin privileges during plugin install) is to use a `require` hook to inject the correct path when imperative (and/or the base CLI) is required by a plugin. VSCode does something [similar](https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/api/node/extHost.api.impl.ts). "},"comment":{"url":"https://api.github.com/repos/zowe/imperative/issues/comments/431153009","html_url":"https://github.com/zowe/imperative/issues/33#issuecomment-431153009","issue_url":"https://api.github.com/repos/zowe/imperative/issues/33","id":431153009,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTE1MzAwOQ==","user":{"login":"AHumanFromCA","id":37381232,"node_id":"MDQ6VXNlcjM3MzgxMjMy","avatar_url":"https://avatars1.githubusercontent.com/u/37381232?v=4","gravatar_id":"","url":"https://api.github.com/users/AHumanFromCA","html_url":"https://github.com/AHumanFromCA","followers_url":"https://api.github.com/users/AHumanFromCA/followers","following_url":"https://api.github.com/users/AHumanFromCA/following{/other_user}","gists_url":"https://api.github.com/users/AHumanFromCA/gists{/gist_id}","starred_url":"https://api.github.com/users/AHumanFromCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AHumanFromCA/subscriptions","organizations_url":"https://api.github.com/users/AHumanFromCA/orgs","repos_url":"https://api.github.com/users/AHumanFromCA/repos","events_url":"https://api.github.com/users/AHumanFromCA/events{/privacy}","received_events_url":"https://api.github.com/users/AHumanFromCA/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T20:35:40Z","updated_at":"2018-10-18T20:35:40Z","author_association":"CONTRIBUTOR","body":"In commit 9b0c2feadc9cf135d512e0bcd00c8ace8b22c4aa, I guarded against submodule imports to the host package. Due to some internals of npm and how submodule imports work, I can't think of a way to safely allow a submodule import to the host package. With that in mind, I explicitly throw an error if this condition occurs so we can investigate this later if we want. "}}
{"actor":{"display_login":"AHumanFromCA"}}