Skip to content

feature(template/just): ✨ respect justfile modules#481

Merged
stevearc merged 1 commit intostevearc:masterfrom
AlphaNecron:master
Dec 27, 2025
Merged

feature(template/just): ✨ respect justfile modules#481
stevearc merged 1 commit intostevearc:masterfrom
AlphaNecron:master

Conversation

@AlphaNecron
Copy link
Contributor

https://just.systems/man/en/modules1190.html
just does support modules. This PR makes just template provider traverse through modules and include their recipes.

However, this PR is not done imo. If the parent justfile is read, all of its children should/must be ignored (I haven't implemented this). Current behavior simply gets the nearest justfile instead of the root justfile, and template provider doesn't provide a way to manage global state to store something like a justfile registry.

Given this tree:

# let this be /
- justfile # this should import crates/foo/justfile (the file itself should have no recipes)
- crates
-- foo
--- justfile # this file has a recipe named bar and should be ignored
--- baz

Currently (with this PR), if PWD is /, things work; overseer should show just foo::bar. However, when PWD is / and user navigates deeper (eg foo or baz) through neo-tree (or similar plugins), /justfile isn't read; instead, /crates/foo/justfile is. This might be awkward to run tasks as it literally defeats the whole point of modules...

I'm looking for a way to deal with this.

@github-actions github-actions bot requested a review from stevearc December 23, 2025 17:16
@stevearc
Copy link
Owner

This looks fine to me. To solve the issue of only finding a single justfile, you could look into passing a specific search directory using the capability added in #480. Thanks for the PR!

@stevearc stevearc merged commit 0181f28 into stevearc:master Dec 27, 2025
6 of 7 checks passed
@stevearc
Copy link
Owner

I think I've managed to get the behavior that you're looking for in 4acd767

@AlphaNecron
Copy link
Contributor Author

Ah ty <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants