{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/comments/239270065","pull_request_review_id":182014357,"id":239270065,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTI3MDA2NQ==","diff_hunk":"@@ -0,0 +1,126 @@\n+## NodeJS - NPM Lambda Builder\n+\n+### Scope\n+\n+This package is an effort to port the Claudia.JS packager to a library that can\n+be used to handle the dependency resolution portion of packaging NodeJS code\n+for use in AWS Lambda. The scope for this builder is to take an existing\n+directory containing customer code, including a valid `package.json` manifest\n+specifying third-party dependencies. The builder will use NPM to include\n+production dependencies and exclude test resources in a way that makes them\n+deployable to AWS Lambda.\n+\n+### Challenges\n+\n+NPM normally stores all dependencies in a `node_modules` subdirectory. It\n+supports several dependency categories, such as development dependencies\n+(usually third-party build utilities and test resources), optional dependencies\n+(usually required for local execution but already available on the production\n+environment, or peer-dependencies for optional third-party packages) and\n+production dependencies (normally the minimum required for correct execution).\n+All these dependency types are mixed in the same directory.\n+\n+To speed up Lambda startup time and optimise usage costs, the correct thing to\n+do in most cases is just to package up production dependencies. During development \n+work we can expect that the local `node_modules` directory contains all the \n+various dependency types, and NPM does not provide a way to directly identify\n+just the ones relevant for production. To identify production dependencies, \n+this packager needs to copy the source to a clean temporary directory and re-run\n+dependency installation there.\n+  \n+It's reasonable to expect that some developers will not carefully separate","path":"aws_lambda_builders/workflows/nodejs_npm/DESIGN.md","position":31,"original_position":31,"commit_id":"6863067023cbf28d5b4dfc68061a8f6ca41654b3","original_commit_id":"6863067023cbf28d5b4dfc68061a8f6ca41654b3","user":{"login":"gojko","id":38767,"node_id":"MDQ6VXNlcjM4NzY3","avatar_url":"https://avatars1.githubusercontent.com/u/38767?v=4","gravatar_id":"","url":"https://api.github.com/users/gojko","html_url":"https://github.com/gojko","followers_url":"https://api.github.com/users/gojko/followers","following_url":"https://api.github.com/users/gojko/following{/other_user}","gists_url":"https://api.github.com/users/gojko/gists{/gist_id}","starred_url":"https://api.github.com/users/gojko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gojko/subscriptions","organizations_url":"https://api.github.com/users/gojko/orgs","repos_url":"https://api.github.com/users/gojko/repos","events_url":"https://api.github.com/users/gojko/events{/privacy}","received_events_url":"https://api.github.com/users/gojko/received_events","type":"User","site_admin":false},"body":"I guess the option Sanath and I discussed is more to do with optional dependencies than dev dependencies, so I'll clarify that in the design doc. \r\n\r\nNPM has the concept of optional dependencies, very frequently used for excluding aws-sdk for from the deployment package, but leaving it as a non-dev dependency for small lambdas. AWS SDK is already available on the Lambda VM, so this makes deployment significantly faster for single-file lambdas, for example. I dislike this because it's not 100% clear what version of the API gets used, but people do this frequently enough that we should handle it in some way. the proposal was to use an env var to override NPM arguments. ","created_at":"2018-12-05T22:56:14Z","updated_at":"2018-12-05T22:56:14Z","html_url":"https://github.com/awslabs/aws-lambda-builders/pull/44#discussion_r239270065","pull_request_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/comments/239270065"},"html":{"href":"https://github.com/awslabs/aws-lambda-builders/pull/44#discussion_r239270065"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44"}},"in_reply_to_id":239213765},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44","id":235189734,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MTg5NzM0","html_url":"https://github.com/awslabs/aws-lambda-builders/pull/44","diff_url":"https://github.com/awslabs/aws-lambda-builders/pull/44.diff","patch_url":"https://github.com/awslabs/aws-lambda-builders/pull/44.patch","issue_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues/44","number":44,"state":"open","locked":false,"title":"[WIP] support for building nodejs_npm functions","user":{"login":"gojko","id":38767,"node_id":"MDQ6VXNlcjM4NzY3","avatar_url":"https://avatars1.githubusercontent.com/u/38767?v=4","gravatar_id":"","url":"https://api.github.com/users/gojko","html_url":"https://github.com/gojko","followers_url":"https://api.github.com/users/gojko/followers","following_url":"https://api.github.com/users/gojko/following{/other_user}","gists_url":"https://api.github.com/users/gojko/gists{/gist_id}","starred_url":"https://api.github.com/users/gojko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gojko/subscriptions","organizations_url":"https://api.github.com/users/gojko/orgs","repos_url":"https://api.github.com/users/gojko/repos","events_url":"https://api.github.com/users/gojko/events{/privacy}","received_events_url":"https://api.github.com/users/gojko/received_events","type":"User","site_admin":false},"body":"\r\n\r\n*Description of changes:* Initial support for building nodejs_npm, for early code review. This does not yet support building projects with local dependencies.\r\n\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-12-01T12:09:03Z","updated_at":"2018-12-05T22:56:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8004851fa8318e1e73c08deb4a2c846f5505a47c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues/44/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/statuses/6863067023cbf28d5b4dfc68061a8f6ca41654b3","head":{"label":"gojko:master","ref":"master","sha":"6863067023cbf28d5b4dfc68061a8f6ca41654b3","user":{"login":"gojko","id":38767,"node_id":"MDQ6VXNlcjM4NzY3","avatar_url":"https://avatars1.githubusercontent.com/u/38767?v=4","gravatar_id":"","url":"https://api.github.com/users/gojko","html_url":"https://github.com/gojko","followers_url":"https://api.github.com/users/gojko/followers","following_url":"https://api.github.com/users/gojko/following{/other_user}","gists_url":"https://api.github.com/users/gojko/gists{/gist_id}","starred_url":"https://api.github.com/users/gojko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gojko/subscriptions","organizations_url":"https://api.github.com/users/gojko/orgs","repos_url":"https://api.github.com/users/gojko/repos","events_url":"https://api.github.com/users/gojko/events{/privacy}","received_events_url":"https://api.github.com/users/gojko/received_events","type":"User","site_admin":false},"repo":{"id":159737196,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk3MzcxOTY=","name":"aws-lambda-builders","full_name":"gojko/aws-lambda-builders","private":false,"owner":{"login":"gojko","id":38767,"node_id":"MDQ6VXNlcjM4NzY3","avatar_url":"https://avatars1.githubusercontent.com/u/38767?v=4","gravatar_id":"","url":"https://api.github.com/users/gojko","html_url":"https://github.com/gojko","followers_url":"https://api.github.com/users/gojko/followers","following_url":"https://api.github.com/users/gojko/following{/other_user}","gists_url":"https://api.github.com/users/gojko/gists{/gist_id}","starred_url":"https://api.github.com/users/gojko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gojko/subscriptions","organizations_url":"https://api.github.com/users/gojko/orgs","repos_url":"https://api.github.com/users/gojko/repos","events_url":"https://api.github.com/users/gojko/events{/privacy}","received_events_url":"https://api.github.com/users/gojko/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gojko/aws-lambda-builders","description":"Python library to compile, build & package AWS Lambda functions for several runtimes & framework","fork":true,"url":"https://api.github.com/repos/gojko/aws-lambda-builders","forks_url":"https://api.github.com/repos/gojko/aws-lambda-builders/forks","keys_url":"https://api.github.com/repos/gojko/aws-lambda-builders/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gojko/aws-lambda-builders/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gojko/aws-lambda-builders/teams","hooks_url":"https://api.github.com/repos/gojko/aws-lambda-builders/hooks","issue_events_url":"https://api.github.com/repos/gojko/aws-lambda-builders/issues/events{/number}","events_url":"https://api.github.com/repos/gojko/aws-lambda-builders/events","assignees_url":"https://api.github.com/repos/gojko/aws-lambda-builders/assignees{/user}","branches_url":"https://api.github.com/repos/gojko/aws-lambda-builders/branches{/branch}","tags_url":"https://api.github.com/repos/gojko/aws-lambda-builders/tags","blobs_url":"https://api.github.com/repos/gojko/aws-lambda-builders/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gojko/aws-lambda-builders/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gojko/aws-lambda-builders/git/refs{/sha}","trees_url":"https://api.github.com/repos/gojko/aws-lambda-builders/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gojko/aws-lambda-builders/statuses/{sha}","languages_url":"https://api.github.com/repos/gojko/aws-lambda-builders/languages","stargazers_url":"https://api.github.com/repos/gojko/aws-lambda-builders/stargazers","contributors_url":"https://api.github.com/repos/gojko/aws-lambda-builders/contributors","subscribers_url":"https://api.github.com/repos/gojko/aws-lambda-builders/subscribers","subscription_url":"https://api.github.com/repos/gojko/aws-lambda-builders/subscription","commits_url":"https://api.github.com/repos/gojko/aws-lambda-builders/commits{/sha}","git_commits_url":"https://api.github.com/repos/gojko/aws-lambda-builders/git/commits{/sha}","comments_url":"https://api.github.com/repos/gojko/aws-lambda-builders/comments{/number}","issue_comment_url":"https://api.github.com/repos/gojko/aws-lambda-builders/issues/comments{/number}","contents_url":"https://api.github.com/repos/gojko/aws-lambda-builders/contents/{+path}","compare_url":"https://api.github.com/repos/gojko/aws-lambda-builders/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gojko/aws-lambda-builders/merges","archive_url":"https://api.github.com/repos/gojko/aws-lambda-builders/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gojko/aws-lambda-builders/downloads","issues_url":"https://api.github.com/repos/gojko/aws-lambda-builders/issues{/number}","pulls_url":"https://api.github.com/repos/gojko/aws-lambda-builders/pulls{/number}","milestones_url":"https://api.github.com/repos/gojko/aws-lambda-builders/milestones{/number}","notifications_url":"https://api.github.com/repos/gojko/aws-lambda-builders/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gojko/aws-lambda-builders/labels{/name}","releases_url":"https://api.github.com/repos/gojko/aws-lambda-builders/releases{/id}","deployments_url":"https://api.github.com/repos/gojko/aws-lambda-builders/deployments","created_at":"2018-11-29T22:47:13Z","updated_at":"2018-11-29T22:47:15Z","pushed_at":"2018-12-05T16:46:25Z","git_url":"git://github.com/gojko/aws-lambda-builders.git","ssh_url":"git@github.com:gojko/aws-lambda-builders.git","clone_url":"https://github.com/gojko/aws-lambda-builders.git","svn_url":"https://github.com/gojko/aws-lambda-builders","homepage":"","size":162,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"awslabs:develop","ref":"develop","sha":"3744cea731403fc5d5aad36c4f60d9512231fd78","user":{"login":"awslabs","id":3299148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyOTkxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":156287142,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYyODcxNDI=","name":"aws-lambda-builders","full_name":"awslabs/aws-lambda-builders","private":false,"owner":{"login":"awslabs","id":3299148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyOTkxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/awslabs/aws-lambda-builders","description":"Python library to compile, build & package AWS Lambda functions for several runtimes & framework","fork":false,"url":"https://api.github.com/repos/awslabs/aws-lambda-builders","forks_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/forks","keys_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/events","assignees_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/merges","archive_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-lambda-builders/deployments","created_at":"2018-11-05T21:42:39Z","updated_at":"2018-12-05T22:40:22Z","pushed_at":"2018-12-05T20:00:14Z","git_url":"git://github.com/awslabs/aws-lambda-builders.git","ssh_url":"git@github.com:awslabs/aws-lambda-builders.git","clone_url":"https://github.com/awslabs/aws-lambda-builders.git","svn_url":"https://github.com/awslabs/aws-lambda-builders","homepage":"","size":116,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":10,"open_issues":14,"watchers":24,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44"},"html":{"href":"https://github.com/awslabs/aws-lambda-builders/pull/44"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues/44"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-lambda-builders/statuses/6863067023cbf28d5b4dfc68061a8f6ca41654b3"}},"author_association":"NONE"}}
{"actor":{"display_login":"gojko"}}