Skip to content
Source
Sign inSign up
TanStack/intent

perf: skip redundant filesystem probes during discovery and load path rewriting #344

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

Showing 5 changed files with 15 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
5 additions and 0 deletions.changeset/cut-discovery-fs-probes.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/intent': patch
+---
+​
+Skip redundant filesystem probes when scanning packages and rewriting skill load paths during `intent list` and `intent load`; behavior does not change.
6 additions and 1 deletionpackages/intent/src/discovery/register.tsModified
View file
@@ -42,10 +42,12 @@
​
export function createPackageRegistrar(opts: CreatePackageRegistrarOptions) {
const attemptedPackageRoots = new Set<string>()
+ const attemptedRawDirs = new Set<string>()
const scannedNodeModulesDirs = new Set<string>()
​
function shouldAttemptPackageRoot(dirPath: string): boolean {
const key = opts.getFsIdentity(dirPath)
+ attemptedRawDirs.add(key)
if (attemptedPackageRoots.has(key)) return false
attemptedPackageRoots.add(key)
return true
@@ -80,11 +82,14 @@
fallbackName: string,
source: IntentPackage['source'] = 'local',
): boolean {
- if (!shouldAttemptPackageRoot(dirPath)) return false
+ if (attemptedRawDirs.has(dirPath)) return false
+ attemptedRawDirs.add(dirPath)
​