{"action":"created","comment":{"url":"https://api.github.com/repos/serverless/components/pulls/comments/183407055","pull_request_review_id":114398185,"id":183407055,"diff_hunk":"@@ -0,0 +1,34 @@\n+const path = require('path')\n+const semverRegex = require('semver-regex')\n+\n+const { fileExists, readFile } = require('../fs')\n+const pack = require('../pack')\n+\n+module.exports = async (options) => {\n+  const validFormats = [ 'zip', 'tar' ]\n+  const format = options.format || 'zip'\n+  const slsYmlFilePath = path.join(process.cwd(), 'serverless.yml')\n+  if (!await fileExists(slsYmlFilePath)) {\n+    throw new Error('The package command can only be run inside a component directory')\n+  }\n+\n+  const slsYml = await readFile(slsYmlFilePath)\n+\n+  if (!semverRegex().test(slsYml.version)) {\n+    throw new Error('Please provide a valid version for your component')\n+  }\n+\n+  if (!options.path) {\n+    throw new Error('Please provide an output path for the package with the --path option')\n+  }\n+\n+  if (!validFormats.includes(format)) {\n+    throw new Error('Please provide a valid format. Either a \"zip\" or a \"tar\"')","path":"src/utils/components/packageComponent.js","position":26,"original_position":26,"commit_id":"5f14f071fabf25692599ae93b31efea157a4a4e8","original_commit_id":"5f14f071fabf25692599ae93b31efea157a4a4e8","user":{"login":"eahefnawy","id":2312463,"avatar_url":"https://avatars1.githubusercontent.com/u/2312463?v=4","gravatar_id":"","url":"https://api.github.com/users/eahefnawy","html_url":"https://github.com/eahefnawy","followers_url":"https://api.github.com/users/eahefnawy/followers","following_url":"https://api.github.com/users/eahefnawy/following{/other_user}","gists_url":"https://api.github.com/users/eahefnawy/gists{/gist_id}","starred_url":"https://api.github.com/users/eahefnawy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eahefnawy/subscriptions","organizations_url":"https://api.github.com/users/eahefnawy/orgs","repos_url":"https://api.github.com/users/eahefnawy/repos","events_url":"https://api.github.com/users/eahefnawy/events{/privacy}","received_events_url":"https://api.github.com/users/eahefnawy/received_events","type":"User","site_admin":false},"body":"hmmm disagreed. This option is called `format` not `extension`. Also, an extra dot is a little more friction.","created_at":"2018-04-23T14:06:07Z","updated_at":"2018-04-23T14:06:07Z","html_url":"https://github.com/serverless/components/pull/164#discussion_r183407055","pull_request_url":"https://api.github.com/repos/serverless/components/pulls/164","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/serverless/components/pulls/comments/183407055"},"html":{"href":"https://github.com/serverless/components/pull/164#discussion_r183407055"},"pull_request":{"href":"https://api.github.com/repos/serverless/components/pulls/164"}},"in_reply_to_id":183297536},"pull_request":{"url":"https://api.github.com/repos/serverless/components/pulls/164","id":183029991,"html_url":"https://github.com/serverless/components/pull/164","diff_url":"https://github.com/serverless/components/pull/164.diff","patch_url":"https://github.com/serverless/components/pull/164.patch","issue_url":"https://api.github.com/repos/serverless/components/issues/164","number":164,"state":"open","locked":false,"title":"Added package command","user":{"login":"eahefnawy","id":2312463,"avatar_url":"https://avatars1.githubusercontent.com/u/2312463?v=4","gravatar_id":"","url":"https://api.github.com/users/eahefnawy","html_url":"https://github.com/eahefnawy","followers_url":"https://api.github.com/users/eahefnawy/followers","following_url":"https://api.github.com/users/eahefnawy/following{/other_user}","gists_url":"https://api.github.com/users/eahefnawy/gists{/gist_id}","starred_url":"https://api.github.com/users/eahefnawy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eahefnawy/subscriptions","organizations_url":"https://api.github.com/users/eahefnawy/orgs","repos_url":"https://api.github.com/users/eahefnawy/repos","events_url":"https://api.github.com/users/eahefnawy/events{/privacy}","received_events_url":"https://api.github.com/users/eahefnawy/received_events","type":"User","site_admin":false},"body":"From within the basic example directory, run the following:\r\n\r\n```\r\ncomponents package --path ./\r\n```\r\n\r\n```\r\ncomponents package --path ./ --format tar\r\n```","created_at":"2018-04-20T11:05:54Z","updated_at":"2018-04-23T14:06:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d350eeacfbb7d24907aa304f0fa9b441e0c697a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"brianneisler","id":1471972,"avatar_url":"https://avatars1.githubusercontent.com/u/1471972?v=4","gravatar_id":"","url":"https://api.github.com/users/brianneisler","html_url":"https://github.com/brianneisler","followers_url":"https://api.github.com/users/brianneisler/followers","following_url":"https://api.github.com/users/brianneisler/following{/other_user}","gists_url":"https://api.github.com/users/brianneisler/gists{/gist_id}","starred_url":"https://api.github.com/users/brianneisler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianneisler/subscriptions","organizations_url":"https://api.github.com/users/brianneisler/orgs","repos_url":"https://api.github.com/users/brianneisler/repos","events_url":"https://api.github.com/users/brianneisler/events{/privacy}","received_events_url":"https://api.github.com/users/brianneisler/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/serverless/components/pulls/164/commits","review_comments_url":"https://api.github.com/repos/serverless/components/pulls/164/comments","review_comment_url":"https://api.github.com/repos/serverless/components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serverless/components/issues/164/comments","statuses_url":"https://api.github.com/repos/serverless/components/statuses/5f14f071fabf25692599ae93b31efea157a4a4e8","head":{"label":"serverless:package-command","ref":"package-command","sha":"5f14f071fabf25692599ae93b31efea157a4a4e8","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":117983079,"name":"components","full_name":"serverless/components","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/components","description":"An easier way to build applications with cloud services. –","fork":false,"url":"https://api.github.com/repos/serverless/components","forks_url":"https://api.github.com/repos/serverless/components/forks","keys_url":"https://api.github.com/repos/serverless/components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/components/teams","hooks_url":"https://api.github.com/repos/serverless/components/hooks","issue_events_url":"https://api.github.com/repos/serverless/components/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/components/events","assignees_url":"https://api.github.com/repos/serverless/components/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/components/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/components/tags","blobs_url":"https://api.github.com/repos/serverless/components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/components/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/components/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/components/languages","stargazers_url":"https://api.github.com/repos/serverless/components/stargazers","contributors_url":"https://api.github.com/repos/serverless/components/contributors","subscribers_url":"https://api.github.com/repos/serverless/components/subscribers","subscription_url":"https://api.github.com/repos/serverless/components/subscription","commits_url":"https://api.github.com/repos/serverless/components/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/components/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/components/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/components/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/components/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/components/merges","archive_url":"https://api.github.com/repos/serverless/components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/components/downloads","issues_url":"https://api.github.com/repos/serverless/components/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/components/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/components/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/components/labels{/name}","releases_url":"https://api.github.com/repos/serverless/components/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/components/deployments","created_at":"2018-01-18T12:57:56Z","updated_at":"2018-04-23T08:39:09Z","pushed_at":"2018-04-23T07:55:50Z","git_url":"git://github.com/serverless/components.git","ssh_url":"git@github.com:serverless/components.git","clone_url":"https://github.com/serverless/components.git","svn_url":"https://github.com/serverless/components","homepage":"https://www.serverless.com","size":7919,"stargazers_count":54,"watchers_count":54,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":15,"watchers":54,"default_branch":"master"}},"base":{"label":"serverless:master","ref":"master","sha":"bab012cbf4b0919ac49b97feafed33da6f5ac2ae","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":117983079,"name":"components","full_name":"serverless/components","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/components","description":"An easier way to build applications with cloud services. –","fork":false,"url":"https://api.github.com/repos/serverless/components","forks_url":"https://api.github.com/repos/serverless/components/forks","keys_url":"https://api.github.com/repos/serverless/components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/components/teams","hooks_url":"https://api.github.com/repos/serverless/components/hooks","issue_events_url":"https://api.github.com/repos/serverless/components/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/components/events","assignees_url":"https://api.github.com/repos/serverless/components/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/components/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/components/tags","blobs_url":"https://api.github.com/repos/serverless/components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/components/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/components/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/components/languages","stargazers_url":"https://api.github.com/repos/serverless/components/stargazers","contributors_url":"https://api.github.com/repos/serverless/components/contributors","subscribers_url":"https://api.github.com/repos/serverless/components/subscribers","subscription_url":"https://api.github.com/repos/serverless/components/subscription","commits_url":"https://api.github.com/repos/serverless/components/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/components/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/components/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/components/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/components/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/components/merges","archive_url":"https://api.github.com/repos/serverless/components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/components/downloads","issues_url":"https://api.github.com/repos/serverless/components/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/components/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/components/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/components/labels{/name}","releases_url":"https://api.github.com/repos/serverless/components/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/components/deployments","created_at":"2018-01-18T12:57:56Z","updated_at":"2018-04-23T08:39:09Z","pushed_at":"2018-04-23T07:55:50Z","git_url":"git://github.com/serverless/components.git","ssh_url":"git@github.com:serverless/components.git","clone_url":"https://github.com/serverless/components.git","svn_url":"https://github.com/serverless/components","homepage":"https://www.serverless.com","size":7919,"stargazers_count":54,"watchers_count":54,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":15,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serverless/components/pulls/164"},"html":{"href":"https://github.com/serverless/components/pull/164"},"issue":{"href":"https://api.github.com/repos/serverless/components/issues/164"},"comments":{"href":"https://api.github.com/repos/serverless/components/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/serverless/components/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/serverless/components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serverless/components/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/serverless/components/statuses/5f14f071fabf25692599ae93b31efea157a4a4e8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"eahefnawy"}}