Refactor cache configuration from cacheScripts to flexible cache option#191
Merged
branchseer merged 3 commits intomainfrom Mar 4, 2026
Merged
Refactor cache configuration from cacheScripts to flexible cache option#191branchseer merged 3 commits intomainfrom
branchseer merged 3 commits intomainfrom
Conversation
…ks}` in root config
Replace the root-level `cacheScripts: boolean` field with a richer `cache`
field that supports both boolean shorthand and detailed object form:
- `cache: true` = `{ scripts: true, tasks: true }`
- `cache: false` = `{ scripts: false, tasks: false }`
- Default (omitted) = `{ scripts: false, tasks: true }`
- `cache.scripts` controls caching for package.json scripts (same as old `cacheScripts`)
- `cache.tasks` is a global kill switch: when false, disables cache on ALL tasks
even those with explicit `cache: true`; when true (default), respects each
task's own `cache` setting without force-enabling tasks with `cache: false`
https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
fengmk2
approved these changes
Mar 4, 2026
branchseer
pushed a commit
that referenced
this pull request
Mar 4, 2026
The cache configuration refactor in #191 added UserGlobalCacheConfig but didn't regenerate run-config.ts, causing the typescript_generation test to fail in CI. https://claude.ai/code/session_014eMPQ1Mw6EQpPkjkk1onsQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the simple boolean
cacheScriptsconfiguration option with a more flexiblecacheconfiguration that supports both boolean and detailed object formats, enabling independent control over caching for package.json scripts and task entries.Key Changes
New
UserGlobalCacheConfigenum: Replacescache_scripts: boolwith a flexible configuration that accepts:true/false(boolean shorthand){ scripts?: bool, tasks?: bool }(detailed configuration)New
ResolvedGlobalCacheConfigstruct: Provides a resolution mechanism with sensible defaults:scripts: defaults tofalsetasks: defaults totrueConfiguration field rename:
UserRunConfig.cache_scripts→UserRunConfig.cacheError message update:
TaskGraphLoadError::CacheScriptsInNonRootPackage→TaskGraphLoadError::CacheInNonRootPackageTypeScript types: Generated
UserGlobalCacheConfigtype inrun-config.tswith comprehensive documentationTest fixtures: Added two new test fixtures demonstrating the new configuration:
cache-true-no-force-enable: Shows howcache: truewith individual taskcache: falseoverrides workcache-tasks-disabled: Shows howcache: { tasks: false }disables all task caching while respecting individual task settingsTest coverage: Added comprehensive unit tests for all configuration variants (boolean true/false, detailed with various field combinations, defaults, and error cases)
Migration: Updated all existing test fixtures from
cacheScriptstocacheformatImplementation Details
The resolution logic ensures backward compatibility while providing more granular control:
cacheis omitted, defaults to{ scripts: false, tasks: true }trueexpands to{ scripts: true, tasks: true }falseexpands to{ scripts: false, tasks: false }https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah