{"action":"created","comment":{"url":"https://api.github.com/repos/labaneilers/hashly/pulls/comments/48994146","id":48994146,"diff_hunk":"@@ -143,31 +146,48 @@ var processEntry = function (fullPath, baseDir, targetDir, data) {\n         return;\r\n     }\r\n \r\n-    // Apply filters to exclude files if specified\r\n-    if (_options.shouldBeExcluded) {\r\n-        if (_options.shouldBeExcluded(fullPath)) {\r\n-            return;\r\n-        }\r\n+    // Ignore map files, we check each css and js file for accompaning map file\r\n+    if (ext === \".map\") {\r\n+        return;\r\n     }\r\n \r\n     try {\r\n         if (_options.isPassthrough && _options.isPassthrough(fullPath)) {\r\n-            \r\n             // Passthrough means to simply copy file to the destination path, without labeling it with a hashcode or \r\n             // including in the manifest.\r\n             var relativePath = path.relative(baseDir, fullPath);\r\n             var targetPath = path.join(targetDir, relativePath);\r\n             fsutil.copySync(fullPath, targetPath);\r\n             return null;\r\n-        }\r\n-        else {\r\n-            \r\n-            var entry = createAndAugmentManifestEntry(fullPath, baseDir, targetDir, data);\r\n+        } else {\r\n+            // Improve map files to have the hashed filepath in their source (instead of unhashed filepath) - useful for debugging\r\n+            // Note: assuming map files are in the same dir as js/css file and they end with .map\r\n+            var mapFullPath = fullPath + \".map\";\r\n+            var transformedText = null,\r\n+                hashCode = null;\r\n+            if (_options.processMap && fsutil.existsSync(mapFullPath)) {\r\n+                var mapEntry = createAndAugmentManifestEntry(mapFullPath, baseDir, targetDir, data);\r\n+                fsutil.copySync(mapFullPath, mapEntry.hashedPathPhysical);\r\n+                if (_options.logger) {\r\n+                    _options.logger(mapFullPath + \" > \" + mapEntry.hashedPathPhysical);\r\n+                }\r\n+                // The sourcemap filename has changed, so update the minified js/css file and replace unhashed filename with hashed one\r\n+                // This is done to support zero downtime deployment when two different releases are out at once\r","path":"lib/hashly.js","position":177,"original_position":177,"commit_id":"74dbe0316e8a9a03c3726c896ef940591ec28531","original_commit_id":"74dbe0316e8a9a03c3726c896ef940591ec28531","user":{"login":"labaneilers","id":1165221,"avatar_url":"https://avatars.githubusercontent.com/u/1165221?v=3","gravatar_id":"","url":"https://api.github.com/users/labaneilers","html_url":"https://github.com/labaneilers","followers_url":"https://api.github.com/users/labaneilers/followers","following_url":"https://api.github.com/users/labaneilers/following{/other_user}","gists_url":"https://api.github.com/users/labaneilers/gists{/gist_id}","starred_url":"https://api.github.com/users/labaneilers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/labaneilers/subscriptions","organizations_url":"https://api.github.com/users/labaneilers/orgs","repos_url":"https://api.github.com/users/labaneilers/repos","events_url":"https://api.github.com/users/labaneilers/events{/privacy}","received_events_url":"https://api.github.com/users/labaneilers/received_events","type":"User","site_admin":false},"body":"This comment seems strangely general to be applied to this line- the whole point of hashly is to support zero-downtime deployments.","created_at":"2016-01-06T18:57:56Z","updated_at":"2016-01-06T18:57:56Z","html_url":"https://github.com/labaneilers/hashly/pull/26#discussion_r48994146","pull_request_url":"https://api.github.com/repos/labaneilers/hashly/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/labaneilers/hashly/pulls/comments/48994146"},"html":{"href":"https://github.com/labaneilers/hashly/pull/26#discussion_r48994146"},"pull_request":{"href":"https://api.github.com/repos/labaneilers/hashly/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/labaneilers/hashly/pulls/26","id":54881238,"html_url":"https://github.com/labaneilers/hashly/pull/26","diff_url":"https://github.com/labaneilers/hashly/pull/26.diff","patch_url":"https://github.com/labaneilers/hashly/pull/26.patch","issue_url":"https://api.github.com/repos/labaneilers/hashly/issues/26","number":26,"state":"open","locked":false,"title":"adds sourcemap support","user":{"login":"hsingh23","id":1136514,"avatar_url":"https://avatars.githubusercontent.com/u/1136514?v=3","gravatar_id":"","url":"https://api.github.com/users/hsingh23","html_url":"https://github.com/hsingh23","followers_url":"https://api.github.com/users/hsingh23/followers","following_url":"https://api.github.com/users/hsingh23/following{/other_user}","gists_url":"https://api.github.com/users/hsingh23/gists{/gist_id}","starred_url":"https://api.github.com/users/hsingh23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsingh23/subscriptions","organizations_url":"https://api.github.com/users/hsingh23/orgs","repos_url":"https://api.github.com/users/hsingh23/repos","events_url":"https://api.github.com/users/hsingh23/events{/privacy}","received_events_url":"https://api.github.com/users/hsingh23/received_events","type":"User","site_admin":false},"body":"Merged all my commits into a single commit that adds sourcemaps","created_at":"2015-12-31T21:31:35Z","updated_at":"2016-01-06T18:57:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"970c62164c9186ba9707d9c67d85b250ede7c01e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/labaneilers/hashly/pulls/26/commits","review_comments_url":"https://api.github.com/repos/labaneilers/hashly/pulls/26/comments","review_comment_url":"https://api.github.com/repos/labaneilers/hashly/pulls/comments{/number}","comments_url":"https://api.github.com/repos/labaneilers/hashly/issues/26/comments","statuses_url":"https://api.github.com/repos/labaneilers/hashly/statuses/74dbe0316e8a9a03c3726c896ef940591ec28531","head":{"label":"hsingh23:master","ref":"master","sha":"74dbe0316e8a9a03c3726c896ef940591ec28531","user":{"login":"hsingh23","id":1136514,"avatar_url":"https://avatars.githubusercontent.com/u/1136514?v=3","gravatar_id":"","url":"https://api.github.com/users/hsingh23","html_url":"https://github.com/hsingh23","followers_url":"https://api.github.com/users/hsingh23/followers","following_url":"https://api.github.com/users/hsingh23/following{/other_user}","gists_url":"https://api.github.com/users/hsingh23/gists{/gist_id}","starred_url":"https://api.github.com/users/hsingh23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsingh23/subscriptions","organizations_url":"https://api.github.com/users/hsingh23/orgs","repos_url":"https://api.github.com/users/hsingh23/repos","events_url":"https://api.github.com/users/hsingh23/events{/privacy}","received_events_url":"https://api.github.com/users/hsingh23/received_events","type":"User","site_admin":false},"repo":{"id":48862620,"name":"hashly","full_name":"hsingh23/hashly","owner":{"login":"hsingh23","id":1136514,"avatar_url":"https://avatars.githubusercontent.com/u/1136514?v=3","gravatar_id":"","url":"https://api.github.com/users/hsingh23","html_url":"https://github.com/hsingh23","followers_url":"https://api.github.com/users/hsingh23/followers","following_url":"https://api.github.com/users/hsingh23/following{/other_user}","gists_url":"https://api.github.com/users/hsingh23/gists{/gist_id}","starred_url":"https://api.github.com/users/hsingh23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsingh23/subscriptions","organizations_url":"https://api.github.com/users/hsingh23/orgs","repos_url":"https://api.github.com/users/hsingh23/repos","events_url":"https://api.github.com/users/hsingh23/events{/privacy}","received_events_url":"https://api.github.com/users/hsingh23/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hsingh23/hashly","description":"Generates hashed file names for cache busting along with image size data in a manifest file ","fork":true,"url":"https://api.github.com/repos/hsingh23/hashly","forks_url":"https://api.github.com/repos/hsingh23/hashly/forks","keys_url":"https://api.github.com/repos/hsingh23/hashly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hsingh23/hashly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hsingh23/hashly/teams","hooks_url":"https://api.github.com/repos/hsingh23/hashly/hooks","issue_events_url":"https://api.github.com/repos/hsingh23/hashly/issues/events{/number}","events_url":"https://api.github.com/repos/hsingh23/hashly/events","assignees_url":"https://api.github.com/repos/hsingh23/hashly/assignees{/user}","branches_url":"https://api.github.com/repos/hsingh23/hashly/branches{/branch}","tags_url":"https://api.github.com/repos/hsingh23/hashly/tags","blobs_url":"https://api.github.com/repos/hsingh23/hashly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hsingh23/hashly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hsingh23/hashly/git/refs{/sha}","trees_url":"https://api.github.com/repos/hsingh23/hashly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hsingh23/hashly/statuses/{sha}","languages_url":"https://api.github.com/repos/hsingh23/hashly/languages","stargazers_url":"https://api.github.com/repos/hsingh23/hashly/stargazers","contributors_url":"https://api.github.com/repos/hsingh23/hashly/contributors","subscribers_url":"https://api.github.com/repos/hsingh23/hashly/subscribers","subscription_url":"https://api.github.com/repos/hsingh23/hashly/subscription","commits_url":"https://api.github.com/repos/hsingh23/hashly/commits{/sha}","git_commits_url":"https://api.github.com/repos/hsingh23/hashly/git/commits{/sha}","comments_url":"https://api.github.com/repos/hsingh23/hashly/comments{/number}","issue_comment_url":"https://api.github.com/repos/hsingh23/hashly/issues/comments{/number}","contents_url":"https://api.github.com/repos/hsingh23/hashly/contents/{+path}","compare_url":"https://api.github.com/repos/hsingh23/hashly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hsingh23/hashly/merges","archive_url":"https://api.github.com/repos/hsingh23/hashly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hsingh23/hashly/downloads","issues_url":"https://api.github.com/repos/hsingh23/hashly/issues{/number}","pulls_url":"https://api.github.com/repos/hsingh23/hashly/pulls{/number}","milestones_url":"https://api.github.com/repos/hsingh23/hashly/milestones{/number}","notifications_url":"https://api.github.com/repos/hsingh23/hashly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hsingh23/hashly/labels{/name}","releases_url":"https://api.github.com/repos/hsingh23/hashly/releases{/id}","created_at":"2015-12-31T21:22:52Z","updated_at":"2015-12-31T21:22:53Z","pushed_at":"2016-01-06T17:00:48Z","git_url":"git://github.com/hsingh23/hashly.git","ssh_url":"git@github.com:hsingh23/hashly.git","clone_url":"https://github.com/hsingh23/hashly.git","svn_url":"https://github.com/hsingh23/hashly","homepage":null,"size":717,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"labaneilers:master","ref":"master","sha":"08608338d0e0191c234643091ec6650d266de488","user":{"login":"labaneilers","id":1165221,"avatar_url":"https://avatars.githubusercontent.com/u/1165221?v=3","gravatar_id":"","url":"https://api.github.com/users/labaneilers","html_url":"https://github.com/labaneilers","followers_url":"https://api.github.com/users/labaneilers/followers","following_url":"https://api.github.com/users/labaneilers/following{/other_user}","gists_url":"https://api.github.com/users/labaneilers/gists{/gist_id}","starred_url":"https://api.github.com/users/labaneilers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/labaneilers/subscriptions","organizations_url":"https://api.github.com/users/labaneilers/orgs","repos_url":"https://api.github.com/users/labaneilers/repos","events_url":"https://api.github.com/users/labaneilers/events{/privacy}","received_events_url":"https://api.github.com/users/labaneilers/received_events","type":"User","site_admin":false},"repo":{"id":18250128,"name":"hashly","full_name":"labaneilers/hashly","owner":{"login":"labaneilers","id":1165221,"avatar_url":"https://avatars.githubusercontent.com/u/1165221?v=3","gravatar_id":"","url":"https://api.github.com/users/labaneilers","html_url":"https://github.com/labaneilers","followers_url":"https://api.github.com/users/labaneilers/followers","following_url":"https://api.github.com/users/labaneilers/following{/other_user}","gists_url":"https://api.github.com/users/labaneilers/gists{/gist_id}","starred_url":"https://api.github.com/users/labaneilers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/labaneilers/subscriptions","organizations_url":"https://api.github.com/users/labaneilers/orgs","repos_url":"https://api.github.com/users/labaneilers/repos","events_url":"https://api.github.com/users/labaneilers/events{/privacy}","received_events_url":"https://api.github.com/users/labaneilers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/labaneilers/hashly","description":"Generates hashed file names for cache busting along with image size data in a manifest file ","fork":false,"url":"https://api.github.com/repos/labaneilers/hashly","forks_url":"https://api.github.com/repos/labaneilers/hashly/forks","keys_url":"https://api.github.com/repos/labaneilers/hashly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/labaneilers/hashly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/labaneilers/hashly/teams","hooks_url":"https://api.github.com/repos/labaneilers/hashly/hooks","issue_events_url":"https://api.github.com/repos/labaneilers/hashly/issues/events{/number}","events_url":"https://api.github.com/repos/labaneilers/hashly/events","assignees_url":"https://api.github.com/repos/labaneilers/hashly/assignees{/user}","branches_url":"https://api.github.com/repos/labaneilers/hashly/branches{/branch}","tags_url":"https://api.github.com/repos/labaneilers/hashly/tags","blobs_url":"https://api.github.com/repos/labaneilers/hashly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/labaneilers/hashly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/labaneilers/hashly/git/refs{/sha}","trees_url":"https://api.github.com/repos/labaneilers/hashly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/labaneilers/hashly/statuses/{sha}","languages_url":"https://api.github.com/repos/labaneilers/hashly/languages","stargazers_url":"https://api.github.com/repos/labaneilers/hashly/stargazers","contributors_url":"https://api.github.com/repos/labaneilers/hashly/contributors","subscribers_url":"https://api.github.com/repos/labaneilers/hashly/subscribers","subscription_url":"https://api.github.com/repos/labaneilers/hashly/subscription","commits_url":"https://api.github.com/repos/labaneilers/hashly/commits{/sha}","git_commits_url":"https://api.github.com/repos/labaneilers/hashly/git/commits{/sha}","comments_url":"https://api.github.com/repos/labaneilers/hashly/comments{/number}","issue_comment_url":"https://api.github.com/repos/labaneilers/hashly/issues/comments{/number}","contents_url":"https://api.github.com/repos/labaneilers/hashly/contents/{+path}","compare_url":"https://api.github.com/repos/labaneilers/hashly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/labaneilers/hashly/merges","archive_url":"https://api.github.com/repos/labaneilers/hashly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/labaneilers/hashly/downloads","issues_url":"https://api.github.com/repos/labaneilers/hashly/issues{/number}","pulls_url":"https://api.github.com/repos/labaneilers/hashly/pulls{/number}","milestones_url":"https://api.github.com/repos/labaneilers/hashly/milestones{/number}","notifications_url":"https://api.github.com/repos/labaneilers/hashly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/labaneilers/hashly/labels{/name}","releases_url":"https://api.github.com/repos/labaneilers/hashly/releases{/id}","created_at":"2014-03-29T20:29:15Z","updated_at":"2015-03-24T13:08:17Z","pushed_at":"2016-01-06T17:00:49Z","git_url":"git://github.com/labaneilers/hashly.git","ssh_url":"git@github.com:labaneilers/hashly.git","clone_url":"https://github.com/labaneilers/hashly.git","svn_url":"https://github.com/labaneilers/hashly","homepage":null,"size":1257,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/labaneilers/hashly/pulls/26"},"html":{"href":"https://github.com/labaneilers/hashly/pull/26"},"issue":{"href":"https://api.github.com/repos/labaneilers/hashly/issues/26"},"comments":{"href":"https://api.github.com/repos/labaneilers/hashly/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/labaneilers/hashly/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/labaneilers/hashly/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/labaneilers/hashly/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/labaneilers/hashly/statuses/74dbe0316e8a9a03c3726c896ef940591ec28531"}}}}