Kind: Class
Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/detectors/nextjs-detector.ts
Next.js Detector
Methods
| Method | Signature | Returns |
|---|---|---|
detectPages | detectPages(entities: Entity[]) | DetectedNextJSPage[] |
detectAPIRoutes | detectAPIRoutes(entities: Entity[]) | DetectedNextJSAPIRoute[] |
getPageSummary | getPageSummary(page: DetectedNextJSPage) | string |
Where it refuses work
NextJSDetectorstops the work with an early return when/\/app\/.*\/page\.(tsx?|jsx?)$/.test(lowerPath).NextJSDetectorstops the work with an early return when/\/pages\/(?!api\/|_).*\.(tsx?|jsx?)$/.test(lowerPath).NextJSDetectorstops the work with an early return when/\/app\/api\/.*\/route\.(ts|js)$/.test(lowerPath).NextJSDetectorstops the work with an early return when/\/pages\/api\/.*\.(ts|js)$/.test(lowerPath).NextJSDetectorstops the work with an early return whenmethods.length === 0.NextJSDetectorstops the work with an early return when/['"]use client['"]/.test(code).
Was this page helpful?