avacore1337 / OneLife

My Vue/WASM/Rust idle game
https://avacore1337.github.io/OneLife/
MIT License
1 stars 2 forks source link

justfile #22

Closed dimitrilw closed 1 year ago

dimitrilw commented 1 year ago

Another item that I do not know if you will like or not: adding a justfile.

I always liked the idea of npm-scripts, but the actual behavior is quirky. Granted: there are not (yet) any npm-scripts inside package.json that contain any characters or behaviors that will trigger weird behaviors & artifacts, but it's a thing. So I moved from old-school Makefile (no fun) to justfile (very intuitive & powerful). I've also used pyinvoke, Taskfile, Magefile, and others that I'm forgetting; but I have personal preference for justfile -- it's just sooooo clean & easy. 😄

Thoughts...?

dimitrilw commented 1 year ago

Made a justfile. Assuming the just program is installed, then typing just at prompt gives list of scripts. And just SCRIPT executes it. Pic shows just test-js tier_0, which expands to: WASM_BINDGEN_TEST_TIMEOUT=60 wasm-pack test --node -- --test tier_0

Pic has arrows to commands I entered into terminal.

image

Thoughts...?

dimitrilw commented 1 year ago

Adjusted recipe test-js to use param name TEST instead of TESTS and have default value of ALL instead of an empty string -- more clear.

image
avacore1337 commented 1 year ago

Looks way nicer than make files. As long as it's not the only alternative I'm all for it 👍

dimitrilw commented 1 year ago

Awesome! I'll put in a PR so others can use my justfile, too.

PR #24 closes this issue.

dimitrilw commented 1 year ago

For reference, the just.systems docs (also ref'd in readme) are excellent. This cheat-sheet is solid, too.

And sorry for ping, but want to ensure you see this note, @avacore1337 . ...should you ever choose to use just in your other efforts (work/personal), then these are solid refs.

Oh, and I'm not using this feature in the OneLife justfile (yet), but the ability to hold something like this:

hello-world:
    #!/usr/bin/env python3
    print('Hello from python!')

....game changer.

Ref: just docs :: writing recipes in other languages