From b2114bf6d4d79bd2f47fdb0239e9ef984f5f5c42 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:01:08 +0000 Subject: [PATCH 1/3] chore: clarify prepare scoping terminology in comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace "inherited" with "scoped" — prepare providers are scoped to the directory where they are defined, not inherited from parent directories. Co-Authored-By: Claude Opus 4.6 --- src/prepare/engine.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/prepare/engine.rs b/src/prepare/engine.rs index 0829d06677..ff3885eba5 100644 --- a/src/prepare/engine.rs +++ b/src/prepare/engine.rs @@ -84,8 +84,8 @@ impl PrepareEngine { /// Discover all applicable prepare providers for the current project /// /// Each config file's prepare providers are scoped to that config file's directory. - /// Prepare configs are NOT inherited from parent directories - a `[prepare.pnpm]` - /// defined in a root mise.toml only runs from the root, not from subdirectories. + /// Prepare configs are scoped to the directory where they are defined - a `[prepare.pnpm]` + /// in a root mise.toml only applies when running from that root, not from subdirectories. fn discover_providers(config: &Config) -> Result>> { let project_root = config .project_root @@ -99,7 +99,7 @@ impl PrepareEngine { // Process each config file's prepare config independently, using that // config file's directory as the project root for its providers. // Only include config files that belong to the current project root - // (not inherited from parent directories). + // (skip config files from parent directories). for cf in config.config_files.values() { let Some(prepare_config) = cf.prepare_config() else { continue; From c0956f1c9e3cc36c36899b839ed95869a9c73a0a Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:07:18 +0000 Subject: [PATCH 2/3] docs: replace "inherit" terminology with "layering" and "available from parent" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Config from parent directories isn't "inherited" — it's standard config layering where parent configs contribute to the resolved config. Tasks from parent dirs are simply available, not inherited. Using "inherit" created confusion about which features should propagate across dirs (e.g., why tasks do but prepare providers don't). Co-Authored-By: Claude Opus 4.6 --- docs/architecture.md | 2 +- docs/configuration.md | 2 +- docs/shell-aliases.md | 2 +- docs/tasks/architecture.md | 8 ++++---- docs/tasks/monorepo.md | 26 +++++++++++++------------- docs/tasks/task-configuration.md | 2 +- docs/tasks/templates.md | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index f138fa5412..b80631c427 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -178,7 +178,7 @@ Helpers for working with environment variables: - `EnvDiff` - Tracks and applies environment changes - `EnvDirective` - Configuration-based environment variable management - `PathEnv` - Intelligent PATH manipulation with precedence rules -- Context-aware resolution with inheritance +- Context-aware resolution with config layering For environment setup and configuration, see [Environment Documentation](environments/). diff --git a/docs/configuration.md b/docs/configuration.md index cd4ca2b00a..9bd8cfc7fa 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -286,7 +286,7 @@ experimental_monorepo_root = true When enabled: - Tasks in subdirectories are available with namespaced paths (e.g., `//projects/frontend:build`) -- Subdirectory tasks inherit tools from parent configs +- Subdirectory tasks use tools from parent configs - Tasks are only loaded when needed (e.g., when running them, or with `mise tasks ls --all`) - All descendant config files are **implicitly trusted** when the root is trusted - Eliminates the need to individually trust each subdirectory's configuration diff --git a/docs/shell-aliases.md b/docs/shell-aliases.md index 83c7ae08b1..4f123f3f35 100644 --- a/docs/shell-aliases.md +++ b/docs/shell-aliases.md @@ -47,7 +47,7 @@ $ cd ~ ## Hierarchy -Like other mise config, shell aliases are inherited from parent directories. A child directory can override a parent's alias: +Like other mise config, shell aliases from parent directories are available in child directories. A child directory can override a parent's alias: ```toml # ~/projects/mise.toml diff --git a/docs/tasks/architecture.md b/docs/tasks/architecture.md index b8b364f8ad..6d36540650 100644 --- a/docs/tasks/architecture.md +++ b/docs/tasks/architecture.md @@ -119,7 +119,7 @@ mise discovers tasks from multiple sources in this order: 1. **File tasks**: Executable files in task directories 2. **TOML tasks**: Defined in `mise.toml` files -3. **Inherited tasks**: From parent directories +3. **Parent directory tasks**: Available from parent directories ### Task Resolution Process @@ -131,9 +131,9 @@ When you run `mise run build`, mise: 4. **Validates graph** (checks for circular dependencies) 5. **Executes in dependency order** with parallelism -### Task Inheritance +### Task Resolution Across Directories -Tasks are inherited from parent directories but can be overridden: +Tasks from parent directories are available in subdirectories and can be overridden: ``` project/ @@ -142,7 +142,7 @@ project/ └── mise.toml # overrides: test, adds: bundle ``` -In `frontend/`, you have access to: `lint` (inherited), `test` (overridden), `build` (inherited), `bundle` (local). +In `frontend/`, you have access to: `lint` (from parent), `test` (overridden), `build` (from parent), `bundle` (local). ## Advanced Dependency Features diff --git a/docs/tasks/monorepo.md b/docs/tasks/monorepo.md index 11124c6a12..0996f75ec6 100644 --- a/docs/tasks/monorepo.md +++ b/docs/tasks/monorepo.md @@ -15,7 +15,7 @@ The directory containing a `mise.toml` file is called the **config_root**. In mo - **Consistent execution**: Run tasks from any location in the monorepo using the mise config that would be set if called from the task's directory - **Clear task namespacing**: Tasks are prefixed with their location from the monorepo root - **Pattern-based execution**: Use wildcards to run tasks across multiple projects -- **Tool and environment inheritance**: Subdirectory tasks inherit tools and environment variables from parent configs, but can also define their own in their config_root +- **Tool and environment layering**: Subdirectory tasks use tools and environment variables from parent configs, but can also define their own in their config_root - **Automatic trust propagation**: When the monorepo root is trusted, all descendant configs are automatically trusted ## Configuration @@ -29,7 +29,7 @@ Add `experimental_monorepo_root = true` to your root `mise.toml`: experimental_monorepo_root = true [tools] -# Tools defined here are inherited by all subdirectories +# Tools defined here apply to all subdirectories node = "20" ``` @@ -175,26 +175,26 @@ mise '//...:test*' mise //.../frontend:build ``` -## Tool and Environment Inheritance +## Tool and Environment Layering -Subdirectory tasks automatically inherit tools and environment variables from parent config files in the hierarchy. However, each subdirectory can also define its own tools and environment variables in its config_root. This allows you to: +Subdirectory tasks automatically use tools and environment variables from parent config files in the hierarchy. However, each subdirectory can also define its own tools and environment variables in its config_root. This allows you to: 1. Define common tools and environment at the monorepo root 2. Override tools or environment in specific subdirectories 3. Add additional tools or environment in subdirectories -### Inheritance Example +### Layering Example ```toml # /myproject/mise.toml experimental_monorepo_root = true [tools] -node = "20" # Inherited by all subdirectories -python = "3.12" # Inherited by all subdirectories +node = "20" # Available to all subdirectories +python = "3.12" # Available to all subdirectories [env] -LOG_LEVEL = "info" # Inherited by all subdirectories +LOG_LEVEL = "info" # Available to all subdirectories ``` ```toml @@ -212,13 +212,13 @@ run = "npm run build" # Uses node 18 and LOG_LEVEL=debug ```toml # /myproject/projects/backend/mise.toml -# No tools or env section - inherits node 20, python 3.12, and LOG_LEVEL=info from root +# No tools or env section - uses node 20, python 3.12, and LOG_LEVEL=info from root [tasks.build] run = "npm run build" # Uses node 20 and LOG_LEVEL=info from root ``` -### Inheritance Rules +### Layering Rules 1. **Base toolset and environment**: Tasks start with tools and environment from all global config files (including parent configs in the hierarchy) 2. **Subdirectory override**: Tools and environment defined in the subdirectory's config file are merged on top, allowing overrides @@ -320,7 +320,7 @@ Only override tools in subdirectories when they genuinely need different version # /myproject/legacy-app/mise.toml [tools] node = "14" # Override only for legacy app -# python and go inherited from root +# python and go from root ``` ### 3. Use Descriptive Task Names @@ -368,7 +368,7 @@ The monorepo ecosystem offers many excellent tools, each with different strength ### Simple Task Runners -**Taskfile** and **Just** are fantastic for single-project task automation. They're lightweight and easy to set up, but they weren't designed with monorepos in mind. While you can have multiple Taskfiles/Justfiles in a repo, they don't provide unified task discovery, cross-project wildcards, or automatic tool/environment inheritance across projects. +**Taskfile** and **Just** are fantastic for single-project task automation. They're lightweight and easy to set up, but they weren't designed with monorepos in mind. While you can have multiple Taskfiles/Justfiles in a repo, they don't provide unified task discovery, cross-project wildcards, or automatic tool/environment layering across projects. **mise's advantage:** Automatic task discovery across the entire monorepo with a unified namespace and powerful wildcard patterns. @@ -416,7 +416,7 @@ mise's Monorepo Tasks aims to hit the sweet spot between simplicity and power: | Unified task discovery | ❌ | ✅ | ✅ | ✅ | | Wildcard patterns | ❌ | ⚠️ | ✅ | ✅ | | Tool version management | ❌ | ❌ | ⚠️ | ✅ | -| Environment inheritance | ❌ | ⚠️ | ❌ | ✅ | +| Environment layering | ❌ | ⚠️ | ❌ | ✅ | | Minimal setup | ✅ | ⚠️ | ❌ | ✅ | | Task caching | ❌ | ✅ | ✅ | ❌ | diff --git a/docs/tasks/task-configuration.md b/docs/tasks/task-configuration.md index 20c7d392c5..f4fb62f774 100644 --- a/docs/tasks/task-configuration.md +++ b/docs/tasks/task-configuration.md @@ -580,7 +580,7 @@ mise supports monorepo-style task organization with target path syntax. Enable i For complete documentation on monorepo tasks including: - Task path syntax and wildcards -- Tool inheritance from parent configs +- Tool layering from parent configs - Performance tuning - Best practices and troubleshooting diff --git a/docs/tasks/templates.md b/docs/tasks/templates.md index 515e1077c1..833b685ce4 100644 --- a/docs/tasks/templates.md +++ b/docs/tasks/templates.md @@ -62,7 +62,7 @@ When a task extends a template, fields are merged according to these rules: | `dir` | Local overrides; defaults to config_root if not in template | | `sources`, `outputs` | Local overrides completely | | `description`, `shell`, `timeout`, etc. | Local overrides template (if set) | -| `quiet`, `hide`, `raw` | Not inherited (must be set explicitly in task) | +| `quiet`, `hide`, `raw` | Not carried over (must be set explicitly in task) | ### Example: Deep Merge for Tools From aeedbba4f6ebb8fa437fd916f9a2cf3b5a87ebdc Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:21:24 +0000 Subject: [PATCH 3/3] chore: address PR review feedback on comment clarity Co-Authored-By: Claude Opus 4.6 --- src/prepare/engine.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/prepare/engine.rs b/src/prepare/engine.rs index ff3885eba5..57b2a4368d 100644 --- a/src/prepare/engine.rs +++ b/src/prepare/engine.rs @@ -84,8 +84,8 @@ impl PrepareEngine { /// Discover all applicable prepare providers for the current project /// /// Each config file's prepare providers are scoped to that config file's directory. - /// Prepare configs are scoped to the directory where they are defined - a `[prepare.pnpm]` - /// in a root mise.toml only applies when running from that root, not from subdirectories. + /// For example, a `[prepare.pnpm]` defined in the root `mise.toml` only applies when + /// running from the root directory, not from subdirectories. fn discover_providers(config: &Config) -> Result>> { let project_root = config .project_root @@ -99,7 +99,7 @@ impl PrepareEngine { // Process each config file's prepare config independently, using that // config file's directory as the project root for its providers. // Only include config files that belong to the current project root - // (skip config files from parent directories). + // (skip config files outside the current project root, e.g. from parent directories). for cf in config.config_files.values() { let Some(prepare_config) = cf.prepare_config() else { continue;