You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently elm-tooling-cli is awesome to install pre-built executables but cannot be used to install other elm tools such as elm-test or elm-review because they require npm + dependencies. But there is at least one tool called vercel/ncc (and maybe others) able to take an npm executable and to compile it down into a single JS file or a few files (like a main + assets + workers) with all its dependencies brought in such that you can execute the main index.js file with:
node path/to/index.js
I've mentioned this already in the past, but I'm opening an issue for real now since elm-test is about to become free of the elm-json dependency, meaning it could be added solo in a elm-tooling.json and work even if elm-json is not there.
Concretely, the testing I've done is the following:
ncc build --minify lib/elm-test.js generates a dist/ directory with a few files, including a main dist/index.js, and a total size of 692Kb
Prepend the shebang line #!/usr/bin/env node to the file dist/index.js and make it executable
Add a link to that dist/index.js file in a PATH directory, and call it elm-test-ncc
Call elm-test-ncc from anywhere I'd call elm-test
The strategy above would only work for linux and mac, but I'm confident we could make something equivalent in windows. When compressed, that dist/ directory is 203kb. The small size of the compressed archive also means that installing elm-test via elm-tooling would be super fast.
Using ncc would not be required to fit the requirements, just being 0 dependency so that a simple node call is enough to execute the program.
The text was updated successfully, but these errors were encountered:
Currently elm-tooling-cli is awesome to install pre-built executables but cannot be used to install other elm tools such as elm-test or elm-review because they require npm + dependencies. But there is at least one tool called vercel/ncc (and maybe others) able to take an npm executable and to compile it down into a single JS file or a few files (like a main + assets + workers) with all its dependencies brought in such that you can execute the main
index.js
file with:I've mentioned this already in the past, but I'm opening an issue for real now since
elm-test
is about to become free of the elm-json dependency, meaning it could be added solo in aelm-tooling.json
and work even ifelm-json
is not there.Concretely, the testing I've done is the following:
ncc build --minify lib/elm-test.js
generates adist/
directory with a few files, including a maindist/index.js
, and a total size of 692Kb#!/usr/bin/env node
to the filedist/index.js
and make it executabledist/index.js
file in a PATH directory, and call itelm-test-ncc
elm-test-ncc
from anywhere I'd callelm-test
The strategy above would only work for linux and mac, but I'm confident we could make something equivalent in windows. When compressed, that
dist/
directory is 203kb. The small size of the compressed archive also means that installing elm-test via elm-tooling would be super fast.Using ncc would not be required to fit the requirements, just being 0 dependency so that a simple node call is enough to execute the program.
The text was updated successfully, but these errors were encountered: