MCPcopy Create free account
hub / github.com/TanStack/db / findExamplePackageJsons

Function findExamplePackageJsons

scripts/update-example-deps.ts:59–90  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

57
58// Find all package.json files in examples directory recursively
59function findExamplePackageJsons(dir: string): Array<string> {
60 const results: Array<string> = []
61
62 // Directories to skip (build artifacts, dependencies, etc.)
63 const skipDirs = new Set([
64 `node_modules`,
65 `.output`,
66 `dist`,
67 `build`,
68 `.next`,
69 `.nuxt`,
70 ])
71
72 for (const entry of readdirSync(dir)) {
73 const fullPath = join(dir, entry)
74
75 if (skipDirs.has(entry)) continue
76
77 try {
78 const stat = statSync(fullPath)
79 if (stat.isDirectory()) {
80 results.push(...findExamplePackageJsons(fullPath))
81 } else if (entry === `package.json`) {
82 results.push(fullPath)
83 }
84 } catch {
85 // Skip files we can't stat
86 }
87 }
88
89 return results
90}
91
92// Update dependencies in a package.json file
93function updateDependencies(

Callers 1

mainFunction · 0.85

Calls 2

joinFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected