{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/np/pulls/comments/82526976","pull_request_review_id":3429227,"id":82526976,"diff_hunk":"@@ -0,0 +1,106 @@\n+'use strict';\n+const execa = require('execa');\n+const inquirer = require('inquirer');\n+const readPkgUp = require('read-pkg-up');\n+const version = require('./version');\n+\n+module.exports = options => {\n+\tconst pkg = readPkgUp.sync().pkg;\n+\n+\tconst prompts = [\n+\t\t{\n+\t\t\ttype: 'list',\n+\t\t\tname: 'version',\n+\t\t\tmessage: 'Select semver increment or specify new version',\n+\t\t\tchoices: version.SEMVER_INCREMENTS.concat([\n+\t\t\t\tnew inquirer.Separator(),\n+\t\t\t\t{\n+\t\t\t\t\tname: 'Other (specify)',\n+\t\t\t\t\tvalue: null\n+\t\t\t\t}\n+\t\t\t]),\n+\t\t\tfilter(input) {\n+\t\t\t\treturn version.isValidVersionInput(input) ? version.getNewVersion(pkg.version, input) : input;\n+\t\t\t}\n+\t\t},\n+\t\t{\n+\t\t\ttype: 'input',\n+\t\t\tname: 'version',\n+\t\t\tmessage: 'Version',\n+\t\t\twhen(answers) {\n+\t\t\t\treturn !answers.version;\n+\t\t\t},\n+\t\t\tfilter(input) {\n+\t\t\t\t// filter runs before validate that's why we have to check for valid version before we transform them\n+\t\t\t\treturn version.isValidVersionInput(input) ? version.getNewVersion(pkg.version, input) : input;\n+\t\t\t},\n+\t\t\tvalidate(input) {\n+\t\t\t\tif (!version.isValidVersionInput(input)) {\n+\t\t\t\t\treturn 'Please specify a valid semver, e.g. 1.2.3. See http://semver.org/';\n+\t\t\t\t} else if (!version.isVersionGreater(pkg.version, input)) {\n+\t\t\t\t\treturn `Version must be greater than ${pkg.version}`;\n+\t\t\t\t}\n+\t\t\t\treturn true;\n+\t\t\t}\n+\t\t},\n+\t\t{\n+\t\t\ttype: 'list',\n+\t\t\tname: 'tag',\n+\t\t\tmessage: 'How should this pre-release version be tagged in NPM?',\n+\t\t\twhen(answers) {\n+\t\t\t\treturn !pkg.private && version.isPrereleaseVersion(answers.version) && !options.tag;\n+\t\t\t},\n+\t\t\tchoices() {\n+\t\t\t\treturn execa.stdout('npm', ['dist-tag', 'ls'])\n+\t\t\t\t\t.then(stdout => {\n+\t\t\t\t\t\tconst existingPreleaseTags = stdout.split('\\n')\n+\t\t\t\t\t\t\t.map(line => line.split(':')[0].replace(/^\\s|\\s$/, ''))\n+\t\t\t\t\t\t\t.filter(line => line)","path":"lib/interactiveui.js","position":58,"original_position":58,"commit_id":"d9582ec2259179d7f14bc38ce3af9b5e4c33f5a3","original_commit_id":"d9582ec2259179d7f14bc38ce3af9b5e4c33f5a3","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"body":"This doesn't do anything.","created_at":"2016-10-09T17:25:37Z","updated_at":"2016-10-09T17:32:10Z","html_url":"https://github.com/sindresorhus/np/pull/97#discussion_r82526976","pull_request_url":"https://api.github.com/repos/sindresorhus/np/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/np/pulls/comments/82526976"},"html":{"href":"https://github.com/sindresorhus/np/pull/97#discussion_r82526976"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/np/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/np/pulls/97","id":88586704,"html_url":"https://github.com/sindresorhus/np/pull/97","diff_url":"https://github.com/sindresorhus/np/pull/97.diff","patch_url":"https://github.com/sindresorhus/np/pull/97.patch","issue_url":"https://api.github.com/repos/sindresorhus/np/issues/97","number":97,"state":"open","locked":false,"title":"interactive ui when no version is provided","user":{"login":"zinserjan","id":8046231,"avatar_url":"https://avatars.githubusercontent.com/u/8046231?v=3","gravatar_id":"","url":"https://api.github.com/users/zinserjan","html_url":"https://github.com/zinserjan","followers_url":"https://api.github.com/users/zinserjan/followers","following_url":"https://api.github.com/users/zinserjan/following{/other_user}","gists_url":"https://api.github.com/users/zinserjan/gists{/gist_id}","starred_url":"https://api.github.com/users/zinserjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zinserjan/subscriptions","organizations_url":"https://api.github.com/users/zinserjan/orgs","repos_url":"https://api.github.com/users/zinserjan/repos","events_url":"https://api.github.com/users/zinserjan/events{/privacy}","received_events_url":"https://api.github.com/users/zinserjan/received_events","type":"User","site_admin":false},"body":"This PR adds a interactive ui when np runs without arguments as suggested in #52.\r\n\r\nfeatures:\r\n* choose increment type (e.g. patch) or specify own version (e.g. 0.1.3)\r\n* choose NPM dist-tag for pre-releases (except private package)\r\n  * user can choose from a list of already existing tags for this package or\r\n   * specifiy a custom tag except latest\r\n* show info about which version you're going from and to.\r\n* user have to confirm the release to prevent accidental publishing of wrong versions\r\n\r\n\r\n","created_at":"2016-10-09T16:49:29Z","updated_at":"2016-10-09T17:32:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b0798f46f86881c3e597133c6eef287aa778ecd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/np/pulls/97/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/np/pulls/97/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/np/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/np/issues/97/comments","statuses_url":"https://api.github.com/repos/sindresorhus/np/statuses/d9582ec2259179d7f14bc38ce3af9b5e4c33f5a3","head":{"label":"zinserjan:interactive-ui","ref":"interactive-ui","sha":"d9582ec2259179d7f14bc38ce3af9b5e4c33f5a3","user":{"login":"zinserjan","id":8046231,"avatar_url":"https://avatars.githubusercontent.com/u/8046231?v=3","gravatar_id":"","url":"https://api.github.com/users/zinserjan","html_url":"https://github.com/zinserjan","followers_url":"https://api.github.com/users/zinserjan/followers","following_url":"https://api.github.com/users/zinserjan/following{/other_user}","gists_url":"https://api.github.com/users/zinserjan/gists{/gist_id}","starred_url":"https://api.github.com/users/zinserjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zinserjan/subscriptions","organizations_url":"https://api.github.com/users/zinserjan/orgs","repos_url":"https://api.github.com/users/zinserjan/repos","events_url":"https://api.github.com/users/zinserjan/events{/privacy}","received_events_url":"https://api.github.com/users/zinserjan/received_events","type":"User","site_admin":false},"repo":{"id":70337811,"name":"np","full_name":"zinserjan/np","owner":{"login":"zinserjan","id":8046231,"avatar_url":"https://avatars.githubusercontent.com/u/8046231?v=3","gravatar_id":"","url":"https://api.github.com/users/zinserjan","html_url":"https://github.com/zinserjan","followers_url":"https://api.github.com/users/zinserjan/followers","following_url":"https://api.github.com/users/zinserjan/following{/other_user}","gists_url":"https://api.github.com/users/zinserjan/gists{/gist_id}","starred_url":"https://api.github.com/users/zinserjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zinserjan/subscriptions","organizations_url":"https://api.github.com/users/zinserjan/orgs","repos_url":"https://api.github.com/users/zinserjan/repos","events_url":"https://api.github.com/users/zinserjan/events{/privacy}","received_events_url":"https://api.github.com/users/zinserjan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zinserjan/np","description":"A better `npm publish`","fork":true,"url":"https://api.github.com/repos/zinserjan/np","forks_url":"https://api.github.com/repos/zinserjan/np/forks","keys_url":"https://api.github.com/repos/zinserjan/np/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zinserjan/np/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zinserjan/np/teams","hooks_url":"https://api.github.com/repos/zinserjan/np/hooks","issue_events_url":"https://api.github.com/repos/zinserjan/np/issues/events{/number}","events_url":"https://api.github.com/repos/zinserjan/np/events","assignees_url":"https://api.github.com/repos/zinserjan/np/assignees{/user}","branches_url":"https://api.github.com/repos/zinserjan/np/branches{/branch}","tags_url":"https://api.github.com/repos/zinserjan/np/tags","blobs_url":"https://api.github.com/repos/zinserjan/np/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zinserjan/np/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zinserjan/np/git/refs{/sha}","trees_url":"https://api.github.com/repos/zinserjan/np/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zinserjan/np/statuses/{sha}","languages_url":"https://api.github.com/repos/zinserjan/np/languages","stargazers_url":"https://api.github.com/repos/zinserjan/np/stargazers","contributors_url":"https://api.github.com/repos/zinserjan/np/contributors","subscribers_url":"https://api.github.com/repos/zinserjan/np/subscribers","subscription_url":"https://api.github.com/repos/zinserjan/np/subscription","commits_url":"https://api.github.com/repos/zinserjan/np/commits{/sha}","git_commits_url":"https://api.github.com/repos/zinserjan/np/git/commits{/sha}","comments_url":"https://api.github.com/repos/zinserjan/np/comments{/number}","issue_comment_url":"https://api.github.com/repos/zinserjan/np/issues/comments{/number}","contents_url":"https://api.github.com/repos/zinserjan/np/contents/{+path}","compare_url":"https://api.github.com/repos/zinserjan/np/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zinserjan/np/merges","archive_url":"https://api.github.com/repos/zinserjan/np/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zinserjan/np/downloads","issues_url":"https://api.github.com/repos/zinserjan/np/issues{/number}","pulls_url":"https://api.github.com/repos/zinserjan/np/pulls{/number}","milestones_url":"https://api.github.com/repos/zinserjan/np/milestones{/number}","notifications_url":"https://api.github.com/repos/zinserjan/np/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zinserjan/np/labels{/name}","releases_url":"https://api.github.com/repos/zinserjan/np/releases{/id}","deployments_url":"https://api.github.com/repos/zinserjan/np/deployments","created_at":"2016-10-08T14:48:59Z","updated_at":"2016-10-08T14:49:00Z","pushed_at":"2016-10-09T15:58:58Z","git_url":"git://github.com/zinserjan/np.git","ssh_url":"git@github.com:zinserjan/np.git","clone_url":"https://github.com/zinserjan/np.git","svn_url":"https://github.com/zinserjan/np","homepage":null,"size":463,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"40bb91f109437229c62a1233b4332d8b16a53bb6","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":40806530,"name":"np","full_name":"sindresorhus/np","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/np","description":"A better `npm publish`","fork":false,"url":"https://api.github.com/repos/sindresorhus/np","forks_url":"https://api.github.com/repos/sindresorhus/np/forks","keys_url":"https://api.github.com/repos/sindresorhus/np/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/np/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/np/teams","hooks_url":"https://api.github.com/repos/sindresorhus/np/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/np/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/np/events","assignees_url":"https://api.github.com/repos/sindresorhus/np/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/np/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/np/tags","blobs_url":"https://api.github.com/repos/sindresorhus/np/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/np/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/np/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/np/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/np/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/np/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/np/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/np/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/np/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/np/subscription","commits_url":"https://api.github.com/repos/sindresorhus/np/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/np/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/np/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/np/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/np/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/np/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/np/merges","archive_url":"https://api.github.com/repos/sindresorhus/np/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/np/downloads","issues_url":"https://api.github.com/repos/sindresorhus/np/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/np/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/np/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/np/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/np/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/np/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/np/deployments","created_at":"2015-08-16T09:06:06Z","updated_at":"2016-10-09T03:16:27Z","pushed_at":"2016-10-09T16:49:29Z","git_url":"git://github.com/sindresorhus/np.git","ssh_url":"git@github.com:sindresorhus/np.git","clone_url":"https://github.com/sindresorhus/np.git","svn_url":"https://github.com/sindresorhus/np","homepage":null,"size":490,"stargazers_count":1477,"watchers_count":1477,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":20,"forks":46,"open_issues":20,"watchers":1477,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/np/pulls/97"},"html":{"href":"https://github.com/sindresorhus/np/pull/97"},"issue":{"href":"https://api.github.com/repos/sindresorhus/np/issues/97"},"comments":{"href":"https://api.github.com/repos/sindresorhus/np/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/np/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/np/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/np/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/np/statuses/d9582ec2259179d7f14bc38ce3af9b5e4c33f5a3"}}}}
{"actor":{"display_login":"sindresorhus"}}