{"action":"created","issue":{"url":"https://api.github.com/repos/hypothesis/browser-extension/issues/1","repository_url":"https://api.github.com/repos/hypothesis/browser-extension","labels_url":"https://api.github.com/repos/hypothesis/browser-extension/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/hypothesis/browser-extension/issues/1/comments","events_url":"https://api.github.com/repos/hypothesis/browser-extension/issues/1/events","html_url":"https://github.com/hypothesis/browser-extension/pull/1","id":166636111,"number":1,"title":"Add build toolchain for browser extensions","user":{"login":"nickstenning","id":3602,"avatar_url":"https://avatars.githubusercontent.com/u/3602?v=3","gravatar_id":"","url":"https://api.github.com/users/nickstenning","html_url":"https://github.com/nickstenning","followers_url":"https://api.github.com/users/nickstenning/followers","following_url":"https://api.github.com/users/nickstenning/following{/other_user}","gists_url":"https://api.github.com/users/nickstenning/gists{/gist_id}","starred_url":"https://api.github.com/users/nickstenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickstenning/subscriptions","organizations_url":"https://api.github.com/users/nickstenning/orgs","repos_url":"https://api.github.com/users/nickstenning/repos","events_url":"https://api.github.com/users/nickstenning/events{/privacy}","received_events_url":"https://api.github.com/users/nickstenning/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-20T17:22:55Z","updated_at":"2016-07-21T13:00:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hypothesis/browser-extension/pulls/1","html_url":"https://github.com/hypothesis/browser-extension/pull/1","diff_url":"https://github.com/hypothesis/browser-extension/pull/1.diff","patch_url":"https://github.com/hypothesis/browser-extension/pull/1.patch"},"body":"This PR makes it possible to build both Chrome and Firefox extensions using simple JSON settings files as the basis for different build configurations.\r\n\r\nThe basic approach is as follows:\r\n\r\n- Import (copy and paste) a few utility modules from `h` which the extension depended on\r\n- Add a `package.json` with the build dependencies of the extension\r\n- Make the tests pass (run `npm test`)\r\n- Move the browserified extension bundle into `src/common/`\r\n- Convert `manifest.json.jinja2` into a mustache template\r\n- Add mustache versions of `app.html` and `embed.js`\r\n- Get tests and extension builds running on Travis\r\n\r\nObviously there's more to do here -- we need to add a README, for one -- but I figure we should get this merged and move on.\r\n\r\nFor now, if you want to test the built extensions locally, you'll need to ensure you're running the latest version of the client. Something like the following should do it:\r\n\r\n```\r\ngit clone git@github.com:hypothesis/browser-extension\r\ncd browser-extension\r\ngit checkout build\r\nnpm install\r\nnpm link hypothesis\r\nmake\r\n```\r\n\r\nAt that point you should be able to load `build/` in Chrome as an unpacked extension. By default the extension will be built as a production Chrome extension. To build a production Firefox extension, you'd do:\r\n\r\n```\r\nmake SETTINGS_FILE=settings/firefox-prod.json clean extension\r\n```"},"comment":{"url":"https://api.github.com/repos/hypothesis/browser-extension/issues/comments/234245744","html_url":"https://github.com/hypothesis/browser-extension/pull/1#issuecomment-234245744","issue_url":"https://api.github.com/repos/hypothesis/browser-extension/issues/1","id":234245744,"user":{"login":"robertknight","id":2458,"avatar_url":"https://avatars.githubusercontent.com/u/2458?v=3","gravatar_id":"","url":"https://api.github.com/users/robertknight","html_url":"https://github.com/robertknight","followers_url":"https://api.github.com/users/robertknight/followers","following_url":"https://api.github.com/users/robertknight/following{/other_user}","gists_url":"https://api.github.com/users/robertknight/gists{/gist_id}","starred_url":"https://api.github.com/users/robertknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertknight/subscriptions","organizations_url":"https://api.github.com/users/robertknight/orgs","repos_url":"https://api.github.com/users/robertknight/repos","events_url":"https://api.github.com/users/robertknight/events{/privacy}","received_events_url":"https://api.github.com/users/robertknight/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T13:00:02Z","updated_at":"2016-07-21T13:00:02Z","body":"> https://github.com/hypothesis/h/tree/master/tests 🤔\r\n\r\nRight, I was still looking at the front-end tests in `h` which are still organized in the previous way.\r\n\r\n> In short: this was a deliberate decision to bring these tests in line with the tests in the h repository.\r\n> I'd suggest we think about making similar changes to the client repo in due course.\r\n\r\nThanks for the explanation. So far it has been quite convenient having the tests live close to the source in the tree but I see your point.\r\n\r\n> There's really no need for file extensions (that's what a shebang is for)\r\n\r\nOne advantage is that tools which only use very dumb (ie. filename-based) language detection can still recognize the language. eg. ESLint just looks at file extensions when deciding what to process and my editor shows different icons depending on the source file type. Neither super-critical but worth three extra chars in the filename IMO.\r\n\r\n> tools is more clearly about development tooling rather than scripts which could be JavaScript.\r\n\r\nAgreed"}}
{"actor":{"display_login":"robertknight"}}