{"action":"created","comment":{"url":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments/170985678","pull_request_review_id":99759143,"id":170985678,"diff_hunk":"@@ -41,10 +43,33 @@ function resolvePackages(pkg) {\n \n \tlet packageLocations = [];\n \n+\tfunction invokeGeneratorIfReady() {\n+\t\tif (packageLocations.length === pkg.length)\n+\t\t\treturn creator(packageLocations);\n+\t}\n+\n \tpkg.forEach(addon => {\n+\t\t// Resolve paths to modules on local filesystem\n+\t\tif (fs.existsSync(addon)) {\n+\t\t\tlet absolutePath = addon;\n+\n+\t\t\ttry {\n+\t\t\t\tabsolutePath = path.resolve(process.cwd(), addon);\n+\t\t\t\trequire.resolve(absolutePath);\n+\t\t\t\tpackageLocations.push(absolutePath);\n+\t\t\t} catch (err) {\n+\t\t\t\tconsole.log(`Cannot find a valid npm module at ${absolutePath}.`);","path":"lib/utils/resolve-packages.js","position":34,"original_position":34,"commit_id":"5798ed6501545b3ee06034464cd6bf34de2c7b01","original_commit_id":"5798ed6501545b3ee06034464cd6bf34de2c7b01","user":{"login":"dylanonelson","id":10565771,"avatar_url":"https://avatars3.githubusercontent.com/u/10565771?v=4","gravatar_id":"","url":"https://api.github.com/users/dylanonelson","html_url":"https://github.com/dylanonelson","followers_url":"https://api.github.com/users/dylanonelson/followers","following_url":"https://api.github.com/users/dylanonelson/following{/other_user}","gists_url":"https://api.github.com/users/dylanonelson/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanonelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanonelson/subscriptions","organizations_url":"https://api.github.com/users/dylanonelson/orgs","repos_url":"https://api.github.com/users/dylanonelson/repos","events_url":"https://api.github.com/users/dylanonelson/events{/privacy}","received_events_url":"https://api.github.com/users/dylanonelson/received_events","type":"User","site_admin":false},"body":"Good point—I think that's just a mistake on my part. I will use the code in the `catch` below to log the error and exit the process if we can't resolve the package.","created_at":"2018-02-27T16:38:19Z","updated_at":"2018-02-27T16:38:20Z","html_url":"https://github.com/webpack/webpack-cli/pull/265#discussion_r170985678","pull_request_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/265","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments/170985678"},"html":{"href":"https://github.com/webpack/webpack-cli/pull/265#discussion_r170985678"},"pull_request":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/265"}},"in_reply_to_id":170851814},"pull_request":{"url":"https://api.github.com/repos/webpack/webpack-cli/pulls/265","id":168493175,"html_url":"https://github.com/webpack/webpack-cli/pull/265","diff_url":"https://github.com/webpack/webpack-cli/pull/265.diff","patch_url":"https://github.com/webpack/webpack-cli/pull/265.patch","issue_url":"https://api.github.com/repos/webpack/webpack-cli/issues/265","number":265,"state":"open","locked":false,"title":"misc(generator): Allow local paths to generators","user":{"login":"dylanonelson","id":10565771,"avatar_url":"https://avatars3.githubusercontent.com/u/10565771?v=4","gravatar_id":"","url":"https://api.github.com/users/dylanonelson","html_url":"https://github.com/dylanonelson","followers_url":"https://api.github.com/users/dylanonelson/followers","following_url":"https://api.github.com/users/dylanonelson/following{/other_user}","gists_url":"https://api.github.com/users/dylanonelson/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanonelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanonelson/subscriptions","organizations_url":"https://api.github.com/users/dylanonelson/orgs","repos_url":"https://api.github.com/users/dylanonelson/repos","events_url":"https://api.github.com/users/dylanonelson/events{/privacy}","received_events_url":"https://api.github.com/users/dylanonelson/received_events","type":"User","site_admin":false},"body":"This is a first attempt at fixing #262. I'd like some feedback on this approach before I add tests and hunt down the corresponding documentation. Thanks!\r\n\r\n**What kind of change does this PR introduce?**\r\nfeature\r\n\r\n**Did you add tests for your changes?**\r\nNot yet! Would like some feedback on this approach before I write tests.\r\n\r\n**If relevant, did you update the documentation?**\r\nI removed a line from `SCAFFOLDING.md`, but there are probably other places where the documentation needs updating.\r\n\r\n**Summary**\r\nFixes #262. Allows users to pass a relative path to the `init` command so that they can compose generator packages not published to npm.\r\n\r\n**Does this PR introduce a breaking change?**\r\nNo.\r\n\r\n**Other information**\r\n- The current implementation treats the package name as a potential relative path by default. It does not validate that the path starts with `./` or `../`.\r\n- It assumes that the user‘s local generator packages are ready for `require`ing—i.e., that they have all their dependencies installed. It does not link them globally.","created_at":"2018-02-12T03:10:52Z","updated_at":"2018-02-27T16:38:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8da0baefee333210184d4364352356f2f3bd3eeb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":796805016,"url":"https://api.github.com/repos/webpack/webpack-cli/labels/PR:%20CI-ok","name":"PR: CI-ok","color":"0e8a16","default":false},{"id":796805034,"url":"https://api.github.com/repos/webpack/webpack-cli/labels/PR:%20unreviewed","name":"PR: unreviewed","color":"afd8f7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/265/commits","review_comments_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/265/comments","review_comment_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webpack/webpack-cli/issues/265/comments","statuses_url":"https://api.github.com/repos/webpack/webpack-cli/statuses/5798ed6501545b3ee06034464cd6bf34de2c7b01","head":{"label":"dylanonelson:allow-init-paths","ref":"allow-init-paths","sha":"5798ed6501545b3ee06034464cd6bf34de2c7b01","user":{"login":"dylanonelson","id":10565771,"avatar_url":"https://avatars3.githubusercontent.com/u/10565771?v=4","gravatar_id":"","url":"https://api.github.com/users/dylanonelson","html_url":"https://github.com/dylanonelson","followers_url":"https://api.github.com/users/dylanonelson/followers","following_url":"https://api.github.com/users/dylanonelson/following{/other_user}","gists_url":"https://api.github.com/users/dylanonelson/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanonelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanonelson/subscriptions","organizations_url":"https://api.github.com/users/dylanonelson/orgs","repos_url":"https://api.github.com/users/dylanonelson/repos","events_url":"https://api.github.com/users/dylanonelson/events{/privacy}","received_events_url":"https://api.github.com/users/dylanonelson/received_events","type":"User","site_admin":false},"repo":{"id":117887955,"name":"webpack-cli","full_name":"dylanonelson/webpack-cli","owner":{"login":"dylanonelson","id":10565771,"avatar_url":"https://avatars3.githubusercontent.com/u/10565771?v=4","gravatar_id":"","url":"https://api.github.com/users/dylanonelson","html_url":"https://github.com/dylanonelson","followers_url":"https://api.github.com/users/dylanonelson/followers","following_url":"https://api.github.com/users/dylanonelson/following{/other_user}","gists_url":"https://api.github.com/users/dylanonelson/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanonelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanonelson/subscriptions","organizations_url":"https://api.github.com/users/dylanonelson/orgs","repos_url":"https://api.github.com/users/dylanonelson/repos","events_url":"https://api.github.com/users/dylanonelson/events{/privacy}","received_events_url":"https://api.github.com/users/dylanonelson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dylanonelson/webpack-cli","description":"Webpack's Command Line Interface","fork":true,"url":"https://api.github.com/repos/dylanonelson/webpack-cli","forks_url":"https://api.github.com/repos/dylanonelson/webpack-cli/forks","keys_url":"https://api.github.com/repos/dylanonelson/webpack-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dylanonelson/webpack-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dylanonelson/webpack-cli/teams","hooks_url":"https://api.github.com/repos/dylanonelson/webpack-cli/hooks","issue_events_url":"https://api.github.com/repos/dylanonelson/webpack-cli/issues/events{/number}","events_url":"https://api.github.com/repos/dylanonelson/webpack-cli/events","assignees_url":"https://api.github.com/repos/dylanonelson/webpack-cli/assignees{/user}","branches_url":"https://api.github.com/repos/dylanonelson/webpack-cli/branches{/branch}","tags_url":"https://api.github.com/repos/dylanonelson/webpack-cli/tags","blobs_url":"https://api.github.com/repos/dylanonelson/webpack-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dylanonelson/webpack-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dylanonelson/webpack-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dylanonelson/webpack-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dylanonelson/webpack-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dylanonelson/webpack-cli/languages","stargazers_url":"https://api.github.com/repos/dylanonelson/webpack-cli/stargazers","contributors_url":"https://api.github.com/repos/dylanonelson/webpack-cli/contributors","subscribers_url":"https://api.github.com/repos/dylanonelson/webpack-cli/subscribers","subscription_url":"https://api.github.com/repos/dylanonelson/webpack-cli/subscription","commits_url":"https://api.github.com/repos/dylanonelson/webpack-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dylanonelson/webpack-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dylanonelson/webpack-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dylanonelson/webpack-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dylanonelson/webpack-cli/contents/{+path}","compare_url":"https://api.github.com/repos/dylanonelson/webpack-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dylanonelson/webpack-cli/merges","archive_url":"https://api.github.com/repos/dylanonelson/webpack-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dylanonelson/webpack-cli/downloads","issues_url":"https://api.github.com/repos/dylanonelson/webpack-cli/issues{/number}","pulls_url":"https://api.github.com/repos/dylanonelson/webpack-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dylanonelson/webpack-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dylanonelson/webpack-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dylanonelson/webpack-cli/labels{/name}","releases_url":"https://api.github.com/repos/dylanonelson/webpack-cli/releases{/id}","deployments_url":"https://api.github.com/repos/dylanonelson/webpack-cli/deployments","created_at":"2018-01-17T20:18:16Z","updated_at":"2018-01-17T20:18:18Z","pushed_at":"2018-02-26T22:38:21Z","git_url":"git://github.com/dylanonelson/webpack-cli.git","ssh_url":"git@github.com:dylanonelson/webpack-cli.git","clone_url":"https://github.com/dylanonelson/webpack-cli.git","svn_url":"https://github.com/dylanonelson/webpack-cli","homepage":"https://webpack.js.org/api/cli/","size":1934,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"webpack:master","ref":"master","sha":"ef7df35d8f526aac659714d476af4c1cdb69f8af","user":{"login":"webpack","id":2105791,"avatar_url":"https://avatars2.githubusercontent.com/u/2105791?v=4","gravatar_id":"","url":"https://api.github.com/users/webpack","html_url":"https://github.com/webpack","followers_url":"https://api.github.com/users/webpack/followers","following_url":"https://api.github.com/users/webpack/following{/other_user}","gists_url":"https://api.github.com/users/webpack/gists{/gist_id}","starred_url":"https://api.github.com/users/webpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webpack/subscriptions","organizations_url":"https://api.github.com/users/webpack/orgs","repos_url":"https://api.github.com/users/webpack/repos","events_url":"https://api.github.com/users/webpack/events{/privacy}","received_events_url":"https://api.github.com/users/webpack/received_events","type":"Organization","site_admin":false},"repo":{"id":76603199,"name":"webpack-cli","full_name":"webpack/webpack-cli","owner":{"login":"webpack","id":2105791,"avatar_url":"https://avatars2.githubusercontent.com/u/2105791?v=4","gravatar_id":"","url":"https://api.github.com/users/webpack","html_url":"https://github.com/webpack","followers_url":"https://api.github.com/users/webpack/followers","following_url":"https://api.github.com/users/webpack/following{/other_user}","gists_url":"https://api.github.com/users/webpack/gists{/gist_id}","starred_url":"https://api.github.com/users/webpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webpack/subscriptions","organizations_url":"https://api.github.com/users/webpack/orgs","repos_url":"https://api.github.com/users/webpack/repos","events_url":"https://api.github.com/users/webpack/events{/privacy}","received_events_url":"https://api.github.com/users/webpack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webpack/webpack-cli","description":"Webpack's Command Line Interface","fork":false,"url":"https://api.github.com/repos/webpack/webpack-cli","forks_url":"https://api.github.com/repos/webpack/webpack-cli/forks","keys_url":"https://api.github.com/repos/webpack/webpack-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webpack/webpack-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webpack/webpack-cli/teams","hooks_url":"https://api.github.com/repos/webpack/webpack-cli/hooks","issue_events_url":"https://api.github.com/repos/webpack/webpack-cli/issues/events{/number}","events_url":"https://api.github.com/repos/webpack/webpack-cli/events","assignees_url":"https://api.github.com/repos/webpack/webpack-cli/assignees{/user}","branches_url":"https://api.github.com/repos/webpack/webpack-cli/branches{/branch}","tags_url":"https://api.github.com/repos/webpack/webpack-cli/tags","blobs_url":"https://api.github.com/repos/webpack/webpack-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webpack/webpack-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webpack/webpack-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/webpack/webpack-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webpack/webpack-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/webpack/webpack-cli/languages","stargazers_url":"https://api.github.com/repos/webpack/webpack-cli/stargazers","contributors_url":"https://api.github.com/repos/webpack/webpack-cli/contributors","subscribers_url":"https://api.github.com/repos/webpack/webpack-cli/subscribers","subscription_url":"https://api.github.com/repos/webpack/webpack-cli/subscription","commits_url":"https://api.github.com/repos/webpack/webpack-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/webpack/webpack-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/webpack/webpack-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/webpack/webpack-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/webpack/webpack-cli/contents/{+path}","compare_url":"https://api.github.com/repos/webpack/webpack-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webpack/webpack-cli/merges","archive_url":"https://api.github.com/repos/webpack/webpack-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webpack/webpack-cli/downloads","issues_url":"https://api.github.com/repos/webpack/webpack-cli/issues{/number}","pulls_url":"https://api.github.com/repos/webpack/webpack-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/webpack/webpack-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/webpack/webpack-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webpack/webpack-cli/labels{/name}","releases_url":"https://api.github.com/repos/webpack/webpack-cli/releases{/id}","deployments_url":"https://api.github.com/repos/webpack/webpack-cli/deployments","created_at":"2016-12-15T23:05:08Z","updated_at":"2018-02-27T13:12:05Z","pushed_at":"2018-02-27T11:00:27Z","git_url":"git://github.com/webpack/webpack-cli.git","ssh_url":"git@github.com:webpack/webpack-cli.git","clone_url":"https://github.com/webpack/webpack-cli.git","svn_url":"https://github.com/webpack/webpack-cli","homepage":"https://webpack.js.org/api/cli/","size":1901,"stargazers_count":656,"watchers_count":656,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":81,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":81,"open_issues":41,"watchers":656,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/265"},"html":{"href":"https://github.com/webpack/webpack-cli/pull/265"},"issue":{"href":"https://api.github.com/repos/webpack/webpack-cli/issues/265"},"comments":{"href":"https://api.github.com/repos/webpack/webpack-cli/issues/265/comments"},"review_comments":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/265/comments"},"review_comment":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/265/commits"},"statuses":{"href":"https://api.github.com/repos/webpack/webpack-cli/statuses/5798ed6501545b3ee06034464cd6bf34de2c7b01"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dylanonelson"}}