Skip to content
Source
Sign inSign up
TanStack/intent

perf: share the filesystem cache across validate and repair #340

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/340/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

Showing 4 changed files with 82 additions and 49 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 0 deletions.changeset/validate-share-fs-cache.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/intent': patch
+---
+​
+Make `intent validate` and `intent repair` reuse their per-run filesystem cache across project-context resolution, workspace discovery, and `package.json` reads instead of repeating those walks and reads within a single run; behavior does not change.
9 additions and 5 deletionspackages/intent/src/commands/repair.tsModified
View file
@@ -23,15 +23,19 @@
) {
if (options.patch && (options.write || options.json))
fail('Cannot combine --patch with --write or --json')
- const context = resolveProjectContext({ cwd: process.cwd() })
+ const fsCache = createIntentFsCache()
+ const { findSkillFiles } = fsCache
+ const context = resolveProjectContext({ cwd: process.cwd(), fsCache })
const root = context.workspaceRoot ?? context.packageRoot ?? context.cwd
- const { findSkillFiles } = createIntentFsCache()
const directories =
dir === undefined
- ? collectDefaultSkillsDirs(context, findSkillFiles)
+ ? collectDefaultSkillsDirs(context, findSkillFiles, fsCache)
: [
- resolveProjectContext({ cwd: process.cwd(), targetPath: dir })
- .targetSkillsDir ?? resolve(dir),
+ resolveProjectContext({
+ cwd: process.cwd(),
+ targetPath: dir,
+ fsCache,
+ }).targetSkillsDir ?? resolve(dir),