Skip to content

feat: cacheScripts in root config#138

Merged
branchseer merged 10 commits intomainfrom
feat_tasks_-_run_with_cacheScripts_
Feb 5, 2026
Merged

feat: cacheScripts in root config#138
branchseer merged 10 commits intomainfrom
feat_tasks_-_run_with_cacheScripts_

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Feb 5, 2026

TL;DR

  • Disabled cache for package.json scripts by default
  • Added a new cacheScripts option to enable caching for package.json scripts.

What changed?

  • Added a new cacheScripts option that can be set in the workspace root's config file to enable caching for all package.json scripts
  • Renamed TypeScript type definitions from task-config.ts to run-config.ts with updated structure
  • Modified the workspace loader to always add the root package even when it doesn't have a package.json
  • Updated all test fixtures to use the new file name and configuration format

Why make this change?

We don't want to cache scripts by default.

branchseer and others added 7 commits February 5, 2026 09:39
- Merge UserConfigFile and UserConfigTasks into single UserRunConfig struct
- Add cacheScripts field (Option<bool>, currently unused)
- Rename config file from vite.config.json to vite-task.json
- Rename task-config.ts to run-config.ts
- Update TypeScript definition to export RunConfig type
- Update all test fixtures and snapshots

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change UserConfigLoader::load_user_config_file to return
anyhow::Result<Option<UserRunConfig>> instead of anyhow::Result<UserRunConfig>.
Returns None when config file doesn't exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add `cacheScripts` field to enable cache for all package.json scripts
- Validate that cacheScripts can only be set in workspace root config
- Add CacheScriptsInNonRootPackage error for invalid usage
- Refactor load() into two passes to extract and validate cacheScripts
- Add test fixtures for cacheScripts behavior
- Add cacheScripts: true to existing fixtures to maintain behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add cache-scripts-error-non-root fixture to verify error message
- Update plan snapshot test runner to handle task graph load errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, if a workspace root (with pnpm-workspace.yaml) had no
package.json, the root vite-task.json was silently ignored. This change
ensures a root package node is always added to the package graph, using
PackageJson::default() when no package.json exists.

This enables workspace-level config (like cacheScripts) and root-level
tasks without requiring a root package.json.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

branchseer commented Feb 5, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer changed the title feat: unify UserConfigFile and UserConfigTasks into UserRunConfig feat: cacheScripts in root config Feb 5, 2026
@branchseer branchseer marked this pull request as ready for review February 5, 2026 02:59
branchseer and others added 3 commits February 5, 2026 11:00
Debug formatting escapes backslashes on Windows, breaking the path
replacement in snapshot tests. Switch to Display formatting via a new
Display impl on AbsolutePath.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@branchseer branchseer merged commit 5ea9649 into main Feb 5, 2026
7 checks passed
@branchseer branchseer deleted the feat_tasks_-_run_with_cacheScripts_ branch February 5, 2026 05:07
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