{"action":"created","comment":{"url":"https://api.github.com/repos/gohugoio/hugo/pulls/comments/282734832","pull_request_review_id":235905686,"id":282734832,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4MjczNDgzMg==","diff_hunk":"@@ -0,0 +1,69 @@\n+---\n+title: TranspileJS\n+description: Hugo Pipes can process JS files with Babel.\n+date: 2019-03-21\n+publishdate: 2019-03-21\n+lastmod: 2019-03-21\n+categories: [asset management]\n+keywords: []\n+menu:\n+  docs:\n+    parent: \"pipes\"\n+    weight: 75\n+weight: 75\n+sections_weight: 75\n+draft: false\n+---\n+\n+Any JavaScript resource file can be transpiled to another JavaScript version using `resources.TranspileJS` which takes for argument the resource object and a slice of options listed below. TranspileJS uses the [babel cli](https://babeljs.io/docs/en/babel-cli).\n+\n+\n+{{% note %}}\n+Hugo Pipe's TranspileJS requires the `@babel/cli` and `@babel/core` JavaScript packages to be installed in the environment (`npm install -g @babel/cli @babel/core`) along with any Babel plugin(s) or preset(s) used (e.g., `npm install -g @babel/preset-env`).","path":"docs/content/en/hugo-pipes/transpilejs.md","position":22,"original_position":22,"commit_id":"99165ef803f69fea84e173c1d7b69a85b0f51dcc","original_commit_id":"99165ef803f69fea84e173c1d7b69a85b0f51dcc","user":{"login":"danez","id":231804,"node_id":"MDQ6VXNlcjIzMTgwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/231804?v=4","gravatar_id":"","url":"https://api.github.com/users/danez","html_url":"https://github.com/danez","followers_url":"https://api.github.com/users/danez/followers","following_url":"https://api.github.com/users/danez/following{/other_user}","gists_url":"https://api.github.com/users/danez/gists{/gist_id}","starred_url":"https://api.github.com/users/danez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danez/subscriptions","organizations_url":"https://api.github.com/users/danez/orgs","repos_url":"https://api.github.com/users/danez/repos","events_url":"https://api.github.com/users/danez/events{/privacy}","received_events_url":"https://api.github.com/users/danez/received_events","type":"User","site_admin":false},"body":"I saw the same line in the `postcss` docs, but not sure if this makes sense here (but same applies for postcss). I would never recommend installing this globally and always recommend to install it locally in the project folder (which works btw.). Otherwise if multiple users work on the same repo, they might have different versions. Same if you deploy your website with some service I doubt they all have it installed and if so who knows which version.\r\n\r\nBut also not sure what the difference is between snap package and whatever this refers to. I use mac and netlify, so do I use snap?","created_at":"2019-05-10T03:21:18Z","updated_at":"2019-05-10T03:23:08Z","html_url":"https://github.com/gohugoio/hugo/pull/5772#discussion_r282734832","pull_request_url":"https://api.github.com/repos/gohugoio/hugo/pulls/5772","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/gohugoio/hugo/pulls/comments/282734832"},"html":{"href":"https://github.com/gohugoio/hugo/pull/5772#discussion_r282734832"},"pull_request":{"href":"https://api.github.com/repos/gohugoio/hugo/pulls/5772"}}},"pull_request":{"url":"https://api.github.com/repos/gohugoio/hugo/pulls/5772","id":263266436,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYzMjY2NDM2","html_url":"https://github.com/gohugoio/hugo/pull/5772","diff_url":"https://github.com/gohugoio/hugo/pull/5772.diff","patch_url":"https://github.com/gohugoio/hugo/pull/5772.patch","issue_url":"https://api.github.com/repos/gohugoio/hugo/issues/5772","number":5772,"state":"open","locked":false,"title":"resources: Add JavaScript transpiling solution","user":{"login":"hmmmmniek","id":17322217,"node_id":"MDQ6VXNlcjE3MzIyMjE3","avatar_url":"https://avatars0.githubusercontent.com/u/17322217?v=4","gravatar_id":"","url":"https://api.github.com/users/hmmmmniek","html_url":"https://github.com/hmmmmniek","followers_url":"https://api.github.com/users/hmmmmniek/followers","following_url":"https://api.github.com/users/hmmmmniek/following{/other_user}","gists_url":"https://api.github.com/users/hmmmmniek/gists{/gist_id}","starred_url":"https://api.github.com/users/hmmmmniek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmmmmniek/subscriptions","organizations_url":"https://api.github.com/users/hmmmmniek/orgs","repos_url":"https://api.github.com/users/hmmmmniek/repos","events_url":"https://api.github.com/users/hmmmmniek/events{/privacy}","received_events_url":"https://api.github.com/users/hmmmmniek/received_events","type":"User","site_admin":false},"body":"Add a new pipe called TranspileJS which uses the Babel cli. This makes it possible for users to write ES6 JavaScript code and transpile it to ES5 during website generation so that the code still works with older browser versions.\r\n\r\nIn the original issue i wrote that i planned on using a JavaScript interpreter. However I noticed that PostCSS uses a CLI to do its processing, and I realized that there is a Babel CLI as well. So I simply implemented this functionality in almost the exact same way that PostCSS is implemented.\r\n\r\nThe contributing guidelines tell me that I have to include test cases, which makes sense, however I am not sure where the correct place is in the project to do this.\r\n\r\nSee #5764\r\n","created_at":"2019-03-21T14:47:32Z","updated_at":"2019-05-10T03:23:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0886f96c048118644c8f3aa9312a47207225a4de","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gohugoio/hugo/pulls/5772/commits","review_comments_url":"https://api.github.com/repos/gohugoio/hugo/pulls/5772/comments","review_comment_url":"https://api.github.com/repos/gohugoio/hugo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gohugoio/hugo/issues/5772/comments","statuses_url":"https://api.github.com/repos/gohugoio/hugo/statuses/99165ef803f69fea84e173c1d7b69a85b0f51dcc","head":{"label":"hmmmmniek:transpilejs","ref":"transpilejs","sha":"99165ef803f69fea84e173c1d7b69a85b0f51dcc","user":{"login":"hmmmmniek","id":17322217,"node_id":"MDQ6VXNlcjE3MzIyMjE3","avatar_url":"https://avatars0.githubusercontent.com/u/17322217?v=4","gravatar_id":"","url":"https://api.github.com/users/hmmmmniek","html_url":"https://github.com/hmmmmniek","followers_url":"https://api.github.com/users/hmmmmniek/followers","following_url":"https://api.github.com/users/hmmmmniek/following{/other_user}","gists_url":"https://api.github.com/users/hmmmmniek/gists{/gist_id}","starred_url":"https://api.github.com/users/hmmmmniek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmmmmniek/subscriptions","organizations_url":"https://api.github.com/users/hmmmmniek/orgs","repos_url":"https://api.github.com/users/hmmmmniek/repos","events_url":"https://api.github.com/users/hmmmmniek/events{/privacy}","received_events_url":"https://api.github.com/users/hmmmmniek/received_events","type":"User","site_admin":false},"repo":{"id":176945099,"node_id":"MDEwOlJlcG9zaXRvcnkxNzY5NDUwOTk=","name":"hugo","full_name":"hmmmmniek/hugo","private":false,"owner":{"login":"hmmmmniek","id":17322217,"node_id":"MDQ6VXNlcjE3MzIyMjE3","avatar_url":"https://avatars0.githubusercontent.com/u/17322217?v=4","gravatar_id":"","url":"https://api.github.com/users/hmmmmniek","html_url":"https://github.com/hmmmmniek","followers_url":"https://api.github.com/users/hmmmmniek/followers","following_url":"https://api.github.com/users/hmmmmniek/following{/other_user}","gists_url":"https://api.github.com/users/hmmmmniek/gists{/gist_id}","starred_url":"https://api.github.com/users/hmmmmniek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmmmmniek/subscriptions","organizations_url":"https://api.github.com/users/hmmmmniek/orgs","repos_url":"https://api.github.com/users/hmmmmniek/repos","events_url":"https://api.github.com/users/hmmmmniek/events{/privacy}","received_events_url":"https://api.github.com/users/hmmmmniek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hmmmmniek/hugo","description":"The world’s fastest framework for building websites.","fork":true,"url":"https://api.github.com/repos/hmmmmniek/hugo","forks_url":"https://api.github.com/repos/hmmmmniek/hugo/forks","keys_url":"https://api.github.com/repos/hmmmmniek/hugo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmmmmniek/hugo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmmmmniek/hugo/teams","hooks_url":"https://api.github.com/repos/hmmmmniek/hugo/hooks","issue_events_url":"https://api.github.com/repos/hmmmmniek/hugo/issues/events{/number}","events_url":"https://api.github.com/repos/hmmmmniek/hugo/events","assignees_url":"https://api.github.com/repos/hmmmmniek/hugo/assignees{/user}","branches_url":"https://api.github.com/repos/hmmmmniek/hugo/branches{/branch}","tags_url":"https://api.github.com/repos/hmmmmniek/hugo/tags","blobs_url":"https://api.github.com/repos/hmmmmniek/hugo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmmmmniek/hugo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmmmmniek/hugo/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmmmmniek/hugo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmmmmniek/hugo/statuses/{sha}","languages_url":"https://api.github.com/repos/hmmmmniek/hugo/languages","stargazers_url":"https://api.github.com/repos/hmmmmniek/hugo/stargazers","contributors_url":"https://api.github.com/repos/hmmmmniek/hugo/contributors","subscribers_url":"https://api.github.com/repos/hmmmmniek/hugo/subscribers","subscription_url":"https://api.github.com/repos/hmmmmniek/hugo/subscription","commits_url":"https://api.github.com/repos/hmmmmniek/hugo/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmmmmniek/hugo/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmmmmniek/hugo/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmmmmniek/hugo/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmmmmniek/hugo/contents/{+path}","compare_url":"https://api.github.com/repos/hmmmmniek/hugo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmmmmniek/hugo/merges","archive_url":"https://api.github.com/repos/hmmmmniek/hugo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmmmmniek/hugo/downloads","issues_url":"https://api.github.com/repos/hmmmmniek/hugo/issues{/number}","pulls_url":"https://api.github.com/repos/hmmmmniek/hugo/pulls{/number}","milestones_url":"https://api.github.com/repos/hmmmmniek/hugo/milestones{/number}","notifications_url":"https://api.github.com/repos/hmmmmniek/hugo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmmmmniek/hugo/labels{/name}","releases_url":"https://api.github.com/repos/hmmmmniek/hugo/releases{/id}","deployments_url":"https://api.github.com/repos/hmmmmniek/hugo/deployments","created_at":"2019-03-21T12:58:49Z","updated_at":"2019-03-21T12:58:53Z","pushed_at":"2019-03-25T13:02:55Z","git_url":"git://github.com/hmmmmniek/hugo.git","ssh_url":"git@github.com:hmmmmniek/hugo.git","clone_url":"https://github.com/hmmmmniek/hugo.git","svn_url":"https://github.com/hmmmmniek/hugo","homepage":"https://gohugo.io","size":64969,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":"master"}},"base":{"label":"gohugoio:master","ref":"master","sha":"44f5c1c14cb1f42cc5f01739c289e9cfc83602af","user":{"login":"gohugoio","id":29385237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mzg1MjM3","avatar_url":"https://avatars2.githubusercontent.com/u/29385237?v=4","gravatar_id":"","url":"https://api.github.com/users/gohugoio","html_url":"https://github.com/gohugoio","followers_url":"https://api.github.com/users/gohugoio/followers","following_url":"https://api.github.com/users/gohugoio/following{/other_user}","gists_url":"https://api.github.com/users/gohugoio/gists{/gist_id}","starred_url":"https://api.github.com/users/gohugoio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gohugoio/subscriptions","organizations_url":"https://api.github.com/users/gohugoio/orgs","repos_url":"https://api.github.com/users/gohugoio/repos","events_url":"https://api.github.com/users/gohugoio/events{/privacy}","received_events_url":"https://api.github.com/users/gohugoio/received_events","type":"Organization","site_admin":false},"repo":{"id":11180687,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE4MDY4Nw==","name":"hugo","full_name":"gohugoio/hugo","private":false,"owner":{"login":"gohugoio","id":29385237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mzg1MjM3","avatar_url":"https://avatars2.githubusercontent.com/u/29385237?v=4","gravatar_id":"","url":"https://api.github.com/users/gohugoio","html_url":"https://github.com/gohugoio","followers_url":"https://api.github.com/users/gohugoio/followers","following_url":"https://api.github.com/users/gohugoio/following{/other_user}","gists_url":"https://api.github.com/users/gohugoio/gists{/gist_id}","starred_url":"https://api.github.com/users/gohugoio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gohugoio/subscriptions","organizations_url":"https://api.github.com/users/gohugoio/orgs","repos_url":"https://api.github.com/users/gohugoio/repos","events_url":"https://api.github.com/users/gohugoio/events{/privacy}","received_events_url":"https://api.github.com/users/gohugoio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/gohugoio/hugo","description":"The world’s fastest framework for building websites.","fork":false,"url":"https://api.github.com/repos/gohugoio/hugo","forks_url":"https://api.github.com/repos/gohugoio/hugo/forks","keys_url":"https://api.github.com/repos/gohugoio/hugo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gohugoio/hugo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gohugoio/hugo/teams","hooks_url":"https://api.github.com/repos/gohugoio/hugo/hooks","issue_events_url":"https://api.github.com/repos/gohugoio/hugo/issues/events{/number}","events_url":"https://api.github.com/repos/gohugoio/hugo/events","assignees_url":"https://api.github.com/repos/gohugoio/hugo/assignees{/user}","branches_url":"https://api.github.com/repos/gohugoio/hugo/branches{/branch}","tags_url":"https://api.github.com/repos/gohugoio/hugo/tags","blobs_url":"https://api.github.com/repos/gohugoio/hugo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gohugoio/hugo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gohugoio/hugo/git/refs{/sha}","trees_url":"https://api.github.com/repos/gohugoio/hugo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gohugoio/hugo/statuses/{sha}","languages_url":"https://api.github.com/repos/gohugoio/hugo/languages","stargazers_url":"https://api.github.com/repos/gohugoio/hugo/stargazers","contributors_url":"https://api.github.com/repos/gohugoio/hugo/contributors","subscribers_url":"https://api.github.com/repos/gohugoio/hugo/subscribers","subscription_url":"https://api.github.com/repos/gohugoio/hugo/subscription","commits_url":"https://api.github.com/repos/gohugoio/hugo/commits{/sha}","git_commits_url":"https://api.github.com/repos/gohugoio/hugo/git/commits{/sha}","comments_url":"https://api.github.com/repos/gohugoio/hugo/comments{/number}","issue_comment_url":"https://api.github.com/repos/gohugoio/hugo/issues/comments{/number}","contents_url":"https://api.github.com/repos/gohugoio/hugo/contents/{+path}","compare_url":"https://api.github.com/repos/gohugoio/hugo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gohugoio/hugo/merges","archive_url":"https://api.github.com/repos/gohugoio/hugo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gohugoio/hugo/downloads","issues_url":"https://api.github.com/repos/gohugoio/hugo/issues{/number}","pulls_url":"https://api.github.com/repos/gohugoio/hugo/pulls{/number}","milestones_url":"https://api.github.com/repos/gohugoio/hugo/milestones{/number}","notifications_url":"https://api.github.com/repos/gohugoio/hugo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gohugoio/hugo/labels{/name}","releases_url":"https://api.github.com/repos/gohugoio/hugo/releases{/id}","deployments_url":"https://api.github.com/repos/gohugoio/hugo/deployments","created_at":"2013-07-04T15:26:26Z","updated_at":"2019-05-10T03:12:24Z","pushed_at":"2019-05-09T20:11:24Z","git_url":"git://github.com/gohugoio/hugo.git","ssh_url":"git@github.com:gohugoio/hugo.git","clone_url":"https://github.com/gohugoio/hugo.git","svn_url":"https://github.com/gohugoio/hugo","homepage":"https://gohugo.io","size":71431,"stargazers_count":34934,"watchers_count":34934,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3929,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":345,"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":3929,"open_issues":345,"watchers":34934,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gohugoio/hugo/pulls/5772"},"html":{"href":"https://github.com/gohugoio/hugo/pull/5772"},"issue":{"href":"https://api.github.com/repos/gohugoio/hugo/issues/5772"},"comments":{"href":"https://api.github.com/repos/gohugoio/hugo/issues/5772/comments"},"review_comments":{"href":"https://api.github.com/repos/gohugoio/hugo/pulls/5772/comments"},"review_comment":{"href":"https://api.github.com/repos/gohugoio/hugo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gohugoio/hugo/pulls/5772/commits"},"statuses":{"href":"https://api.github.com/repos/gohugoio/hugo/statuses/99165ef803f69fea84e173c1d7b69a85b0f51dcc"}},"author_association":"NONE"}}
{"actor":{"display_login":"danez"}}