| 57 | |
| 58 | // Find all package.json files in examples directory recursively |
| 59 | function 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 |
| 93 | function updateDependencies( |