{"action":"created","issue":{"url":"https://api.github.com/repos/developit/preact-cli/issues/445","repository_url":"https://api.github.com/repos/developit/preact-cli","labels_url":"https://api.github.com/repos/developit/preact-cli/issues/445/labels{/name}","comments_url":"https://api.github.com/repos/developit/preact-cli/issues/445/comments","events_url":"https://api.github.com/repos/developit/preact-cli/issues/445/events","html_url":"https://github.com/developit/preact-cli/pull/445","id":284024973,"number":445,"title":"[WIP] Rework CLI; Simplify tests","user":{"login":"lukeed","id":5855893,"avatar_url":"https://avatars1.githubusercontent.com/u/5855893?v=4","gravatar_id":"","url":"https://api.github.com/users/lukeed","html_url":"https://github.com/lukeed","followers_url":"https://api.github.com/users/lukeed/followers","following_url":"https://api.github.com/users/lukeed/following{/other_user}","gists_url":"https://api.github.com/users/lukeed/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeed/subscriptions","organizations_url":"https://api.github.com/users/lukeed/orgs","repos_url":"https://api.github.com/users/lukeed/repos","events_url":"https://api.github.com/users/lukeed/events{/privacy}","received_events_url":"https://api.github.com/users/lukeed/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-12-21T22:40:53Z","updated_at":"2018-04-09T04:56:36Z","closed_at":"2018-04-09T04:56:36Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/developit/preact-cli/pulls/445","html_url":"https://github.com/developit/preact-cli/pull/445","diff_url":"https://github.com/developit/preact-cli/pull/445.diff","patch_url":"https://github.com/developit/preact-cli/pull/445.patch"},"body":"We've known for a while that our tests are/can be problematic. For a while (it was my fault 😞), they were completely broken & that stalled development pretty significantly.\r\n\r\nThis PR aims to: \r\n  1. Make tests faster & simpler by \r\n    a. removing as many spawned processes as possible\r\n    b. removing (all) `npm install`s \r\n    c. having fewer moving parts\r\n  2. Make the CLI itself faster\r\n    _I was waiting upwards of 2s per `preact *` command_\r\n\r\n\r\n## Results\r\n\r\n1. The `preact build` tests complete in less than `30s` on Node v6, down from `6m`!\r\n2. All commands export their handlers directly, which means tests can use them directly.\r\n  _AKA: easier debugging & no more silent test errors!_ :tada:\r\n3. Average `preact *` command interaction is `0.5s` on my machine, down from `1.9s`\r\n\r\n## Changes\r\n\r\n- Only display flags that the developer can use to _change_ the output.\r\n\r\n   IMO, it's pointless to show `--prerender  (default true)` & then ***not*** show them that `--no-prerender` is how to get rid of it. We've had questions about this a few times.\r\n\r\n- Currently, there's no more \"interactive mode\" if dev does not provide all required arguments.\r\n\r\n    > Sade will exit with an \"Insufficient arguments\" error, but I may add a different approach for optional (`[repo]` vs `<repo>`) arguments.\r\n\r\n- Currently no Preact logo in the CLI header. TBH, this never rendered correctly for me, but I can get it back in.\r\n\r\n\r\n## TODO\r\n\r\n- [ ] Add `--no-*` flags to the CLI output\r\n- [ ] Re-include the Preact logo/header\r\n- [x] Finish \"Insufficient args\" error\r\n- [ ] Final tests pruning / pass\r\n\r\n---\r\n\r\n## Update\r\n\r\n* Required Node 8.x as minimum (native async)\r\n* _ALL_ tests complete in less than 30 seconds 🎉\r\n* Entire TravisCI suite [takes 2 minutes](https://travis-ci.org/developit/preact-cli/jobs/348976802)\r\n* Removed serve command 👋 (will be its own package)\r\n* Pass custom HTTPS certs into watch via webpack-style CLI flags\r\n    ```\r\n    $ preact watch --https --key <foo> --cert <bar>\r\n    ```"},"comment":{"url":"https://api.github.com/repos/developit/preact-cli/issues/comments/379631484","html_url":"https://github.com/developit/preact-cli/pull/445#issuecomment-379631484","issue_url":"https://api.github.com/repos/developit/preact-cli/issues/445","id":379631484,"user":{"login":"lukeed","id":5855893,"avatar_url":"https://avatars1.githubusercontent.com/u/5855893?v=4","gravatar_id":"","url":"https://api.github.com/users/lukeed","html_url":"https://github.com/lukeed","followers_url":"https://api.github.com/users/lukeed/followers","following_url":"https://api.github.com/users/lukeed/following{/other_user}","gists_url":"https://api.github.com/users/lukeed/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeed/subscriptions","organizations_url":"https://api.github.com/users/lukeed/orgs","repos_url":"https://api.github.com/users/lukeed/repos","events_url":"https://api.github.com/users/lukeed/events{/privacy}","received_events_url":"https://api.github.com/users/lukeed/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T04:56:36Z","updated_at":"2018-04-09T04:56:36Z","author_association":"COLLABORATOR","body":"Closing this in favor of the `next` branch, which is now available on npm under the `next` tag 🎉 \r\n\r\n```\r\nnpm install --save-dev preact-cli@next\r\n```\r\n\r\nThere's a preliminary summary of this PR on the [pre-release notes](https://github.com/developit/preact-cli/releases/tag/v3.0.0-next.1)."}}
{"actor":{"display_login":"lukeed"}}