-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install elm-json using elm-tooling (#480)
This PR uses [elm-tooling](https://github.com/lydell/elm-tooling.json/tree/main/cli) to install elm-json instead of the elm-json npm package. Look at this size improvement: | Version | Size | | ---------------- | ----: | | 0.19.1-revision3 | 19 MB | | 0.19.1-revision4 | 18 MB | | master | 17 MB | | This PR | 2 MB | Size was measured by running `du -sh node_modules` after installing node-test-runner (and nothing else) on MacOS. The elm-json binary itself around 2 MB on MacOS. The huge space drop comes from not depending on `binwrap` anymore. It has some pretty have dependencies. Benefits of using elm-tooling: - Faster installs. Fewer npm dependencies to install. elm-test users often use elm-test as well – once both use elm-tooling there won’t be a double elm-json download on each `npm install`. And if the user uses elm-tooling to install elm and elm-format as well, all three tools are downloaded in parallel. [Similar PR for elm-review.](jfmengels/node-elm-review#28) - Less disk space wasted: Less dependencies in node_modules, and no copy of elm-json in every project. - Security. elm-tooling uses sha256 to verify that it downloads what it expects. The only noticeable difference is _when_ the elm-json executable is transferred from the Internet to the user’s machine. - Previously, it happened during `npm install`. Unless you use [ignore-scripts](https://docs.npmjs.com/using-npm/config#ignore-scripts) – then it happened the first time `elm-json` was executed. Now, it happens right before `elm-json` is about to be executed. Unless the user already downloaded elm-json to `~/.elm/elm-tooling/` before. - Given that node-test-runner executes both elm and elm-json, which both can make network requests, I think it’s fine to also execute elm-tooling’s `getExectuable` function which also can make network requests. node-test-runner continues to work offline once all needed things exist on the user’s machine. - binwrap uses the [request](https://github.com/request/request) module, while elm-tooling uses curl if available, otherwise wget and finally Node.js’ [https](https://nodejs.org/api/https.html) module. If the user used [request’s environment variables for proxies](https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables), that should probably just work since [curl seems to use the same environment variables](https://ec.haxx.se/usingcurl/usingcurl-proxies#proxy-environment-variables). But there might be some little difference. Either way, both curl and wget also support config files that lets the user alter how they work as needed, which is a good thing. - Previously, the elm-json binary was downloaded to `./node_modules/elm-json/unpacked-bin/`. Now it’s downloaded to `~/.elm/elm-tooling/elm-json/0.2.8/`. Elm and elm-json write to `~/.elm` too, so it should be fine. (elm-tooling supports `ELM_HOME` and Windows.) The plan now is to: - Try to transfer `elm-tooling` to the [@elm-tooling](https://github.com/elm-tooling/) org so I don’t become a single point of failure. - Release elm-tooling 1.0.0. It works on Linux, macOS and Windows, has 100% test coverage, has been tested by a couple of people on Discord (Dillon Kearns even put it in his [elm-pages-starter](https://github.com/dillonkearns/elm-pages-starter) template) and I haven’t found any improvements to make in a month. - Merge this PR and [the one for elm-review](jfmengels/node-elm-review#28). - Announce `elm-tooling` in Slack and Discourse. So far I haven’t talked much about it, waiting for these two PRs to be made.
- Loading branch information
Showing
11 changed files
with
288 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"tools": { | ||
"elm": "0.19.1", | ||
"elm-format": "0.8.4", | ||
"elm-json": "0.2.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.