Post bard review.
This commit is contained in:
parent
bb84054fe7
commit
aa7043fd1c
|
|
@ -2,15 +2,14 @@
|
||||||
title: "Quick Review of Just"
|
title: "Quick Review of Just"
|
||||||
author: "James Pace"
|
author: "James Pace"
|
||||||
date: "2024/01/10"
|
date: "2024/01/10"
|
||||||
draft: true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[Just](https://just.systems/man/en/) is a command runner that operates kind of like make,
|
[Just](https://just.systems/man/en/) is a command runner that operates kind of like make.
|
||||||
if make was a command runner, not a build tool.
|
|
||||||
|
|
||||||
When you call `just <thing>`, just looks for a `Justfile` in a parent directory, and does
|
Just lets you define tasks in a simple, human-readable file called a Justfile.
|
||||||
whatever is under the `<thing>` entry in the file, where "things under" includes running a set
|
To run a task, simply call `just <task_name>`. Just will automatically find the
|
||||||
of bash commands or running a script that can be written inline.
|
Justfile in the nearest parent directory and execute the commands defined for that
|
||||||
|
task.
|
||||||
|
|
||||||
For example, given the `Justfile`:
|
For example, given the `Justfile`:
|
||||||
|
|
||||||
|
|
@ -25,18 +24,15 @@ test:
|
||||||
the command `just test` will call `cargo test --features log` in the current terminal window.
|
the command `just test` will call `cargo test --features log` in the current terminal window.
|
||||||
|
|
||||||
Compared to `make`, `just`:
|
Compared to `make`, `just`:
|
||||||
1. Doesn't require `.PHONY` targets for targets that don't produce any files.
|
1. Eliminates the need for manual .PHONY target creation, saving you time and reducing
|
||||||
2. Can be called below the directory the `Justfile` is in, and still find the `Justfile`
|
clutter in Justfiles compared to Makefiles.
|
||||||
|
2. Can be called below the directory the `Justfile` is in and still find the `Justfile`
|
||||||
in the parent directory.
|
in the parent directory.
|
||||||
|
|
||||||
In my recent development where I was doing development calling wasm written in rust in a
|
In my recent development where I was calling wasm written in rust in a
|
||||||
web app, I found `just` particularly useful.
|
web app, I found `just` particularly useful.
|
||||||
Building the app took multiple commands, one command for compiling the rust part and
|
Building the app took multiple commands, one command for compiling the rust part and
|
||||||
a second command to bundle the JavaScript.
|
a second command to bundle the JavaScript.
|
||||||
Combining things under a single `just` target was nice.
|
|
||||||
|
|
||||||
I considered just using `make` for this application, but:
|
Combining things under a single `just` target was nice and lead to quicker
|
||||||
|
iterations.
|
||||||
1. Having to add .PHONY targets adds line noise that adds up.
|
|
||||||
2. I found being able to call `just` from any subdirectory really
|
|
||||||
convenient.
|
|
||||||
Loading…
Reference in New Issue