-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Reusable and Modular Justfiles in Monorepos (Namespaces) #2215
Comments
Not sure what the ultimate syntax should look like, but having a way of overriding variables in imported modules seems reasonable to me. Maybe something like: import 'app2/justfile' with APP_NAME = "app-name-1" |
I am thinking about import 'app1/justfile' with <func1>,<func2> ?
import 'app1/justfile' with {
APP_NAME="?"
}
# chaining
import 'app1/justfile' with [
custom_vars{
APP_NAME="?"
},
renamed_recipes{
build=build_app1
},
prefixed_vars{
`APP1_`
},
future_idea{
key=value,
key2=value2
},
]
|
It looks a bit too complicated, it's better to work with modules and passing env vars explicitly but I'm still afraid that in a large nested structure I will accidentally overwrite the variables of a recipe that I don't want |
Originally posted in issue tracking mod, but I feel like it doesn't really belong there.
I am thinking about creating a reusable justfile that can work as a standalone file but can also be copied and imported where needed. For example, environment variables in each justfile represent a standalone application (created with a template) in subdirectories (like a monorepo). The main justfile at the root should be able to build all of them, but independently they should work as standalone applications. However, the root justfile should be able to modify the variables (it should also work for recipes) before building (e.g., to give them different names).
Imagine these justfiles created with a template (which anyone can provide with their frameworks, etc.) and placed in different subdirectories within a monorepo:
In my opinion, this would allow the redistribution of applications with justfiles, which could create interesting reusable build processes. Keep in mind that the examples I gave were made up quickly.
The text was updated successfully, but these errors were encountered: