MCPcopy
hub / github.com/vercel/next.js / parseLernaConfig

Function parseLernaConfig

packages/next-codemod/lib/agents-md.ts:471–482  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

469}
470
471function parseLernaConfig(filePath: string): string[] {
472 try {
473 const content = fs.readFileSync(filePath, 'utf-8')
474 const config = JSON.parse(content)
475 if (Array.isArray(config.packages)) {
476 return config.packages
477 }
478 return ['packages/*']
479 } catch {
480 return []
481 }
482}
483
484function parseNxWorkspace(cwd: string, packageJsonPath: string): string[] {
485 if (fs.existsSync(packageJsonPath)) {

Callers 1

detectWorkspaceFunction · 0.85

Calls 3

readFileSyncMethod · 0.80
isArrayMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected