@webpieces/dev-config 0.2.85 → 0.2.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/architecture/executors/diff-utils.d.ts +24 -0
  2. package/architecture/executors/diff-utils.js +119 -0
  3. package/architecture/executors/diff-utils.js.map +1 -0
  4. package/architecture/executors/diff-utils.ts +127 -0
  5. package/architecture/executors/validate-code/executor.js +44 -0
  6. package/architecture/executors/validate-code/executor.js.map +1 -1
  7. package/architecture/executors/validate-code/executor.ts +49 -0
  8. package/architecture/executors/validate-code/schema.json +1 -9
  9. package/architecture/executors/validate-no-inline-types/executor.d.ts +2 -2
  10. package/architecture/executors/validate-no-inline-types/executor.js +3 -3
  11. package/architecture/executors/validate-no-inline-types/executor.js.map +1 -1
  12. package/architecture/executors/validate-no-inline-types/executor.ts +4 -4
  13. package/architecture/executors/validate-no-inline-types/schema.json +2 -2
  14. package/architecture/executors/validate-prisma-converters/executor.d.ts +4 -3
  15. package/architecture/executors/validate-prisma-converters/executor.js +122 -3
  16. package/architecture/executors/validate-prisma-converters/executor.js.map +1 -1
  17. package/architecture/executors/validate-prisma-converters/executor.ts +170 -4
  18. package/architecture/executors/validate-prisma-converters/schema.json +2 -2
  19. package/architecture/executors/validate-return-types/executor.d.ts +2 -2
  20. package/architecture/executors/validate-return-types/executor.js +3 -3
  21. package/architecture/executors/validate-return-types/executor.js.map +1 -1
  22. package/architecture/executors/validate-return-types/executor.ts +4 -4
  23. package/architecture/executors/validate-return-types/schema.json +2 -2
  24. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/dev-config/architecture/executors/validate-prisma-converters/executor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;;AAojBH,8BAsCC;;AAvlBD,iDAAyC;AACzC,+CAAyB;AACzB,mDAA6B;A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CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,uBAAuB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEjE,MAAM,IAAI,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IAExC,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,IAAI,CAAC;IACtD,OAAO,oBAAoB,CAAC,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACxG,CAAC","sourcesContent":["/**\n * Validate Prisma Converters Executor\n *\n * Validates that Prisma converter methods follow a scalable pattern:\n * methods returning XxxDto (where XxxDbo exists in schema.prisma) must\n * accept that exact XxxDbo as the first parameter. This keeps single-table\n * converters clean and forces join converters to compose them.\n *\n * ============================================================================\n * RULES\n * ============================================================================\n *\n * 1. First param must be exact Dbo:\n * If method returns XxxDto and XxxDbo exists in schema.prisma,\n * the first parameter must be of type XxxDbo.\n *\n * 2. Extra params must be booleans:\n * Additional parameters beyond the Dbo are allowed but must be boolean\n * (used for filtering payloads / security info).\n *\n * 3. No async converters:\n * Methods returning Promise<XxxDto> are flagged — converters should be\n * pure data mapping, no async work.\n *\n * 4. No standalone functions:\n * Standalone functions in converter files are flagged — must be class\n * methods so the converter class can be injected (dependency tree tracing).\n *\n * 5. Dto creation outside converters directory:\n * Files outside the configured convertersPath that create `new XxxDto(...)`\n * where XxxDbo exists in schema.prisma are flagged — Dto instances tied to\n * a Dbo must only be created via a converter class.\n *\n * ============================================================================\n * SKIP CONDITIONS\n * ============================================================================\n * - Methods with @deprecated decorator or JSDoc tag\n * - Lines with: // webpieces-disable prisma-converter -- [reason]\n *\n * ============================================================================\n * MODES\n * ============================================================================\n * - OFF: Skip validation entirely\n * - MODIFIED_FILES: Validate converter files that were modified in the diff\n */\n\nimport type { ExecutorContext } from '@nx/devkit';\nimport { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nexport type PrismaConverterMode = 'OFF' | 'MODIFIED_FILES';\n\nexport interface ValidatePrismaConvertersOptions {\n mode?: PrismaConverterMode;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface ExecutorResult {\n success: boolean;\n}\n\ninterface PrismaConverterViolation {\n file: string;\n line: number;\n message: string;\n}\n\ninterface UnwrapResult {\n inner: string;\n isAsync: boolean;\n}\n\ninterface FileContext {\n filePath: string;\n fileLines: string[];\n sourceFile: ts.SourceFile;\n prismaModels: Set<string>;\n disableAllowed: boolean;\n}\n\n/**\n * Auto-detect the base branch by finding the merge-base with origin/main.\n */\nfunction detectBase(workspaceRoot: string): string | null {\n try {\n const mergeBase = execSync('git merge-base HEAD origin/main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n try {\n const mergeBase = execSync('git merge-base HEAD main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n // Ignore\n }\n }\n return null;\n}\n\n/**\n * Get changed TypeScript files between base and head (or working tree if head not specified).\n */\n// webpieces-disable max-lines-new-methods -- Git command handling with untracked files requires multiple code paths\nfunction getChangedTypeScriptFiles(workspaceRoot: string, base: string, head?: string): string[] {\n try {\n const diffTarget = head ? `${base} ${head}` : base;\n const output = execSync(`git diff --name-only ${diffTarget} -- '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const changedFiles = output\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n\n if (!head) {\n try {\n const untrackedOutput = execSync(`git ls-files --others --exclude-standard '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const untrackedFiles = untrackedOutput\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n const allFiles = new Set([...changedFiles, ...untrackedFiles]);\n return Array.from(allFiles);\n } catch {\n return changedFiles;\n }\n }\n\n return changedFiles;\n } catch {\n return [];\n }\n}\n\n/**\n * Parse schema.prisma to extract all model names into a Set.\n */\nfunction parsePrismaModels(schemaPath: string): Set<string> {\n const models = new Set<string>();\n\n if (!fs.existsSync(schemaPath)) {\n return models;\n }\n\n const content = fs.readFileSync(schemaPath, 'utf-8');\n const regex = /^model\\s+(\\w+)\\s*\\{/gm;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(content)) !== null) {\n models.add(match[1]);\n }\n\n return models;\n}\n\n/**\n * Derive the expected Dbo name from a return type ending in Dto.\n * \"XxxDto\" -> \"XxxDbo\". Returns null if name doesn't end with Dto.\n */\nfunction deriveExpectedDboName(returnType: string): string | null {\n if (!returnType.endsWith('Dto')) return null;\n return returnType.slice(0, -3) + 'Dbo';\n}\n\n/**\n * Check if a line has a webpieces-disable comment for prisma-converter.\n */\nfunction hasDisableComment(lines: string[], lineNumber: number): boolean {\n const startCheck = Math.max(0, lineNumber - 5);\n for (let i = lineNumber - 2; i >= startCheck; i--) {\n const line = lines[i]?.trim() ?? '';\n if (line.startsWith('function ') || line.startsWith('class ') || line.endsWith('}')) {\n break;\n }\n if (line.includes('webpieces-disable') && line.includes('prisma-converter')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Check if a method/function node has a @deprecated decorator.\n */\nfunction hasDeprecatedDecorator(node: ts.MethodDeclaration | ts.FunctionDeclaration): boolean {\n const modifiers = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;\n if (!modifiers) return false;\n\n for (const decorator of modifiers) {\n const expr = decorator.expression;\n // @deprecated or @deprecated()\n if (ts.isIdentifier(expr) && expr.text === 'deprecated') return true;\n if (ts.isCallExpression(expr) && ts.isIdentifier(expr.expression) && expr.expression.text === 'deprecated') {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Check if a node has @deprecated in its JSDoc comments.\n */\nfunction hasDeprecatedJsDoc(node: ts.Node): boolean {\n const jsDocs = ts.getJSDocTags(node);\n for (const tag of jsDocs) {\n if (tag.tagName.text === 'deprecated') return true;\n }\n return false;\n}\n\n/**\n * Check if a method is deprecated via decorator or JSDoc.\n */\nfunction isDeprecated(node: ts.MethodDeclaration | ts.FunctionDeclaration): boolean {\n return hasDeprecatedDecorator(node) || hasDeprecatedJsDoc(node);\n}\n\n/**\n * Extract the text of a type node, stripping whitespace.\n */\nfunction getTypeText(typeNode: ts.TypeNode, sourceFile: ts.SourceFile): string {\n return typeNode.getText(sourceFile).trim();\n}\n\n/**\n * Unwrap Promise<T> to get T. Returns the inner type text if wrapped, otherwise returns as-is.\n */\nfunction unwrapPromise(typeText: string): UnwrapResult {\n const promiseMatch = typeText.match(/^Promise\\s*<\\s*(.+)\\s*>$/);\n if (promiseMatch) {\n return { inner: promiseMatch[1].trim(), isAsync: true };\n }\n return { inner: typeText, isAsync: false };\n}\n\n/**\n * Check a standalone function declaration in a converter file and return a violation if applicable.\n */\nfunction checkStandaloneFunction(\n node: ts.FunctionDeclaration,\n ctx: FileContext\n): PrismaConverterViolation | null {\n if (!node.name) return null;\n\n const startPos = node.getStart(ctx.sourceFile);\n const pos = ctx.sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if ((ctx.disableAllowed && hasDisableComment(ctx.fileLines, line)) || isDeprecated(node)) return null;\n\n return {\n file: ctx.filePath,\n line,\n message: `Standalone function \"${node.name.text}\" found in converter file. ` +\n 'Move to a converter class so it can be injected via DI.',\n };\n}\n\n/**\n * Validate the parameters of a converter method that returns a Dto with a matching Dbo.\n */\nfunction checkMethodParams(\n node: ts.MethodDeclaration,\n innerType: string,\n expectedDbo: string,\n ctx: FileContext,\n line: number\n): PrismaConverterViolation[] {\n const violations: PrismaConverterViolation[] = [];\n const params = node.parameters;\n\n if (params.length === 0) {\n violations.push({\n file: ctx.filePath,\n line,\n message: `Method returns \"${innerType}\" but has no parameters. ` +\n `First parameter must be of type \"${expectedDbo}\".`,\n });\n return violations;\n }\n\n const firstParam = params[0];\n if (firstParam.type) {\n const firstParamType = getTypeText(firstParam.type, ctx.sourceFile);\n if (firstParamType !== expectedDbo) {\n violations.push({\n file: ctx.filePath,\n line,\n message: `Method returns \"${innerType}\" but first parameter is \"${firstParamType}\". ` +\n `First parameter must be of type \"${expectedDbo}\".`,\n });\n }\n }\n\n for (let i = 1; i < params.length; i++) {\n const param = params[i];\n if (param.type) {\n const paramType = getTypeText(param.type, ctx.sourceFile);\n if (paramType !== 'boolean') {\n const paramName = param.name.getText(ctx.sourceFile);\n violations.push({\n file: ctx.filePath,\n line,\n message: `Extra parameter \"${paramName}\" has type \"${paramType}\" but must be \"boolean\". ` +\n 'Additional converter parameters are only for boolean flags (payload filtering / security).',\n });\n }\n }\n }\n\n return violations;\n}\n\n/**\n * Check a class method declaration for converter pattern violations.\n */\nfunction checkConverterMethod(\n node: ts.MethodDeclaration,\n ctx: FileContext\n): PrismaConverterViolation[] {\n if (!node.name || !node.type) return [];\n\n const startPos = node.getStart(ctx.sourceFile);\n const pos = ctx.sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if ((ctx.disableAllowed && hasDisableComment(ctx.fileLines, line)) || isDeprecated(node)) return [];\n\n const returnTypeText = getTypeText(node.type, ctx.sourceFile);\n const { inner: innerType, isAsync } = unwrapPromise(returnTypeText);\n const expectedDbo = deriveExpectedDboName(innerType);\n\n if (!expectedDbo || !ctx.prismaModels.has(expectedDbo)) return [];\n\n if (isAsync) {\n return [{\n file: ctx.filePath,\n line,\n message: `Async converter method returning \"Promise<${innerType}>\" found. ` +\n 'Converters should be pure data mapping with no async work. Remove async/Promise.',\n }];\n }\n\n return checkMethodParams(node, innerType, expectedDbo, ctx, line);\n}\n\n/**\n * Find converter method violations in a single file.\n * Checks class methods for proper Dbo parameter patterns and flags standalone functions.\n */\nfunction findConverterViolationsInFile(\n filePath: string,\n workspaceRoot: string,\n prismaModels: Set<string>,\n disableAllowed: boolean\n): PrismaConverterViolation[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const ctx: FileContext = {\n filePath,\n fileLines: content.split('\\n'),\n sourceFile: ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true),\n prismaModels,\n disableAllowed,\n };\n\n const violations: PrismaConverterViolation[] = [];\n\n function visitNode(node: ts.Node): void {\n if (ts.isFunctionDeclaration(node)) {\n const violation = checkStandaloneFunction(node, ctx);\n if (violation) violations.push(violation);\n }\n\n if (ts.isMethodDeclaration(node)) {\n violations.push(...checkConverterMethod(node, ctx));\n }\n\n ts.forEachChild(node, visitNode);\n }\n\n visitNode(ctx.sourceFile);\n return violations;\n}\n\n/**\n * Find violations in non-converter files: creating `new XxxDto(...)` where XxxDbo exists in prisma.\n * These Dto instances must only be created inside converter classes.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal for new-expression detection with prisma model matching\nfunction findDtoCreationOutsideConverters(\n filePath: string,\n workspaceRoot: string,\n prismaModels: Set<string>,\n convertersPaths: string[],\n disableAllowed: boolean\n): PrismaConverterViolation[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const fileLines = content.split('\\n');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const violations: PrismaConverterViolation[] = [];\n\n function visitNode(node: ts.Node): void {\n // Detect `new XxxDto(...)` expressions\n if (ts.isNewExpression(node) && ts.isIdentifier(node.expression)) {\n const className = node.expression.text;\n const expectedDbo = deriveExpectedDboName(className);\n\n if (expectedDbo && prismaModels.has(expectedDbo)) {\n const startPos = node.getStart(sourceFile);\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if (!disableAllowed || !hasDisableComment(fileLines, line)) {\n const dirs = convertersPaths.map((p) => `\"${p}\"`).join(', ');\n violations.push({\n file: filePath,\n line,\n message: `\"${className}\" can only be created from its Dbo using a converter in one of these directories: ${dirs}. ` +\n 'Move this Dto construction into a converter class method.',\n });\n }\n }\n }\n\n ts.forEachChild(node, visitNode);\n }\n\n visitNode(sourceFile);\n return violations;\n}\n\n/**\n * Report violations to console.\n */\nfunction reportViolations(violations: PrismaConverterViolation[], mode: PrismaConverterMode): void {\n console.error('');\n console.error('❌ Prisma converter violations found!');\n console.error('');\n console.error('📚 Converter methods returning XxxDto (where XxxDbo exists in schema.prisma)');\n console.error(' must accept XxxDbo as the first parameter. This keeps single-table');\n console.error(' converters clean and forces join converters to compose them.');\n console.error('');\n console.error(' GOOD: convertUserDbo(userDbo: UserDbo): UserDto { }');\n console.error(' GOOD: convertVersionDbo(version: VersionDbo, partial?: boolean): VersionDto { }');\n console.error(' GOOD: convertToJoinDto(item: SomeJoinType): CourseJoinDto { } // no matching JoinDbo');\n console.error('');\n console.error(' BAD: async convertUser(dbo: UserDbo): Promise<UserDto> { } // no async');\n console.error(' BAD: convertCourse(course: CourseWithMeta): CourseDto { } // wrong first param');\n console.error(' BAD: convertUser(dbo: UserDbo, name: string): UserDto { } // extra non-boolean');\n console.error(' BAD: export function convertSession(s: SessionDbo): SessionDto // standalone function');\n console.error('');\n\n for (const v of violations) {\n console.error(` ❌ ${v.file}:${v.line}`);\n console.error(` ${v.message}`);\n }\n console.error('');\n\n console.error(' Escape hatch (use sparingly):');\n console.error(' // webpieces-disable prisma-converter -- [your reason]');\n console.error('');\n console.error(` Current mode: ${mode}`);\n console.error('');\n}\n\n/**\n * Resolve git base ref from env vars or auto-detection.\n */\nfunction resolveBase(workspaceRoot: string): string | undefined {\n const envBase = process.env['NX_BASE'];\n if (envBase) return envBase;\n return detectBase(workspaceRoot) ?? undefined;\n}\n\n/**\n * Collect all violations from converter and non-converter files.\n */\nfunction collectAllViolations(\n changedFiles: string[],\n convertersPaths: string[],\n workspaceRoot: string,\n prismaModels: Set<string>,\n disableAllowed: boolean\n): PrismaConverterViolation[] {\n const converterFiles = changedFiles.filter((f) =>\n convertersPaths.some((cp) => f.startsWith(cp))\n );\n const nonConverterFiles = changedFiles.filter((f) =>\n !convertersPaths.some((cp) => f.startsWith(cp))\n );\n\n const allViolations: PrismaConverterViolation[] = [];\n\n if (converterFiles.length > 0) {\n console.log(`📂 Checking ${converterFiles.length} converter file(s)...`);\n for (const file of converterFiles) {\n allViolations.push(...findConverterViolationsInFile(file, workspaceRoot, prismaModels, disableAllowed));\n }\n }\n\n if (nonConverterFiles.length > 0) {\n console.log(`📂 Checking ${nonConverterFiles.length} non-converter file(s) for Dto creation...`);\n for (const file of nonConverterFiles) {\n allViolations.push(...findDtoCreationOutsideConverters(file, workspaceRoot, prismaModels, convertersPaths, disableAllowed));\n }\n }\n\n return allViolations;\n}\n\n/**\n * Run validation after early-exit checks have passed.\n */\nfunction validateChangedFiles(\n workspaceRoot: string,\n schemaPath: string,\n convertersPaths: string[],\n base: string,\n mode: PrismaConverterMode,\n disableAllowed: boolean\n): ExecutorResult {\n const head = process.env['NX_HEAD'];\n\n console.log(` Base: ${base}`);\n console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);\n console.log('');\n\n const fullSchemaPath = path.join(workspaceRoot, schemaPath);\n const prismaModels = parsePrismaModels(fullSchemaPath);\n\n if (prismaModels.size === 0) {\n console.log('⏭️ No models found in schema.prisma');\n console.log('');\n return { success: true };\n }\n\n console.log(` Found ${prismaModels.size} model(s) in schema.prisma`);\n\n const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);\n\n if (changedFiles.length === 0) {\n console.log('✅ No TypeScript files changed');\n return { success: true };\n }\n\n const allViolations = collectAllViolations(changedFiles, convertersPaths, workspaceRoot, prismaModels, disableAllowed);\n\n if (allViolations.length === 0) {\n console.log('✅ All converter patterns are valid');\n return { success: true };\n }\n\n reportViolations(allViolations, mode);\n return { success: false };\n}\n\n/**\n * Resolve mode considering ignoreModifiedUntilEpoch override.\n * When active, downgrades to OFF. When expired, logs a warning.\n */\nfunction resolvePrismaConverterMode(\n normalMode: PrismaConverterMode,\n epoch: number | undefined\n): PrismaConverterMode {\n if (epoch === undefined || normalMode === 'OFF') {\n return normalMode;\n }\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n const expiresDate = new Date(epoch * 1000).toISOString().split('T')[0];\n console.log(`\\n⏭️ Skipping prisma-converter validation (ignoreModifiedUntilEpoch active, expires: ${expiresDate})`);\n console.log('');\n return 'OFF';\n }\n const expiresDate = new Date(epoch * 1000).toISOString().split('T')[0];\n console.log(`\\n⚠️ prismaConverter.ignoreModifiedUntilEpoch (${epoch}) has expired (${expiresDate}). Remove it from nx.json. Using normal mode: ${normalMode}\\n`);\n return normalMode;\n}\n\nexport default async function runExecutor(\n options: ValidatePrismaConvertersOptions,\n context: ExecutorContext\n): Promise<ExecutorResult> {\n const workspaceRoot = context.root;\n const mode = resolvePrismaConverterMode(options.mode ?? 'OFF', options.ignoreModifiedUntilEpoch);\n\n if (mode === 'OFF') {\n console.log('\\n⏭️ Skipping prisma-converter validation (mode: OFF)');\n console.log('');\n return { success: true };\n }\n\n const schemaPath = options.schemaPath;\n const convertersPaths = options.convertersPaths ?? [];\n\n if (!schemaPath || convertersPaths.length === 0) {\n const reason = !schemaPath ? 'no schemaPath configured' : 'no convertersPaths configured';\n console.log(`\\n⏭️ Skipping prisma-converter validation (${reason})`);\n console.log('');\n return { success: true };\n }\n\n console.log('\\n📏 Validating Prisma Converters\\n');\n console.log(` Mode: ${mode}`);\n console.log(` Schema: ${schemaPath}`);\n console.log(` Converter paths: ${convertersPaths.join(', ')}`);\n\n const base = resolveBase(workspaceRoot);\n\n if (!base) {\n console.log('\\n⏭️ Skipping prisma-converter validation (could not detect base branch)');\n console.log('');\n return { success: true };\n }\n\n const disableAllowed = options.disableAllowed ?? true;\n return validateChangedFiles(workspaceRoot, schemaPath, convertersPaths, base, mode, disableAllowed);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/dev-config/architecture/executors/validate-prisma-converters/executor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;;AAytBH,8BAsCC;;AA5vBD,iDAAyC;AACzC,+CAAyB;AACzB,mDAA6B;AAC7B,uDAAiC;AACjC,8CAAmH;AAmCnH;;GAEG;AACH,SAAS,UAAU,CAAC,aAAqB;IACrC,IAAI,CAAC;QACD,MAAM,SAAS,GAAG,IAAA,wBAAQ,EAAC,iCAAiC,EAAE;YAC1D,GAAG,EAAE,aAAa;YAClB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC,CAAC,IAAI,EAAE,CAAC;QAEV,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,IAAI,CAAC;YACD,MAAM,SAAS,GAAG,IAAA,wBAAQ,EAAC,0BAA0B,EAAE;gBACnD,GAAG,E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tD,OAAO,oBAAoB,CAAC,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACxG,CAAC","sourcesContent":["/**\n * Validate Prisma Converters Executor\n *\n * Validates that Prisma converter methods follow a scalable pattern:\n * methods returning XxxDto (where XxxDbo exists in schema.prisma) must\n * accept that exact XxxDbo as the first parameter. This keeps single-table\n * converters clean and forces join converters to compose them.\n *\n * ============================================================================\n * RULES\n * ============================================================================\n *\n * 1. First param must be exact Dbo:\n * If method returns XxxDto and XxxDbo exists in schema.prisma,\n * the first parameter must be of type XxxDbo.\n *\n * 2. Extra params must be booleans:\n * Additional parameters beyond the Dbo are allowed but must be boolean\n * (used for filtering payloads / security info).\n *\n * 3. No async converters:\n * Methods returning Promise<XxxDto> are flagged — converters should be\n * pure data mapping, no async work.\n *\n * 4. No standalone functions:\n * Standalone functions in converter files are flagged — must be class\n * methods so the converter class can be injected (dependency tree tracing).\n *\n * 5. Dto creation outside converters directory:\n * Files outside the configured convertersPath that create `new XxxDto(...)`\n * where XxxDbo exists in schema.prisma are flagged — Dto instances tied to\n * a Dbo must only be created via a converter class.\n *\n * ============================================================================\n * SKIP CONDITIONS\n * ============================================================================\n * - Methods with @deprecated decorator or JSDoc tag\n * - Lines with: // webpieces-disable prisma-converter -- [reason]\n *\n * ============================================================================\n * MODES\n * ============================================================================\n * - OFF: Skip validation entirely\n * - MODIFIED_METHOD_AND_CODE: Validate new/modified methods in converters + changed lines in non-converters\n * - MODIFIED_FILES: Validate all methods in modified files\n */\n\nimport type { ExecutorContext } from '@nx/devkit';\nimport { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\nimport { getFileDiff, getChangedLineNumbers, findNewMethodSignaturesInDiff, isNewOrModified } from '../diff-utils';\n\nexport type PrismaConverterMode = 'OFF' | 'MODIFIED_METHOD_AND_CODE' | 'MODIFIED_FILES';\n\nexport interface ValidatePrismaConvertersOptions {\n mode?: PrismaConverterMode;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface ExecutorResult {\n success: boolean;\n}\n\ninterface PrismaConverterViolation {\n file: string;\n line: number;\n message: string;\n}\n\ninterface UnwrapResult {\n inner: string;\n isAsync: boolean;\n}\n\ninterface FileContext {\n filePath: string;\n fileLines: string[];\n sourceFile: ts.SourceFile;\n prismaModels: Set<string>;\n disableAllowed: boolean;\n}\n\n/**\n * Auto-detect the base branch by finding the merge-base with origin/main.\n */\nfunction detectBase(workspaceRoot: string): string | null {\n try {\n const mergeBase = execSync('git merge-base HEAD origin/main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n try {\n const mergeBase = execSync('git merge-base HEAD main', {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n\n if (mergeBase) {\n return mergeBase;\n }\n } catch {\n // Ignore\n }\n }\n return null;\n}\n\n/**\n * Get changed TypeScript files between base and head (or working tree if head not specified).\n */\n// webpieces-disable max-lines-new-methods -- Git command handling with untracked files requires multiple code paths\nfunction getChangedTypeScriptFiles(workspaceRoot: string, base: string, head?: string): string[] {\n try {\n const diffTarget = head ? `${base} ${head}` : base;\n const output = execSync(`git diff --name-only ${diffTarget} -- '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const changedFiles = output\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n\n if (!head) {\n try {\n const untrackedOutput = execSync(`git ls-files --others --exclude-standard '*.ts' '*.tsx'`, {\n cwd: workspaceRoot,\n encoding: 'utf-8',\n });\n const untrackedFiles = untrackedOutput\n .trim()\n .split('\\n')\n .filter((f) => f && !f.includes('.spec.ts') && !f.includes('.test.ts'));\n const allFiles = new Set([...changedFiles, ...untrackedFiles]);\n return Array.from(allFiles);\n } catch {\n return changedFiles;\n }\n }\n\n return changedFiles;\n } catch {\n return [];\n }\n}\n\n/**\n * Parse schema.prisma to extract all model names into a Set.\n */\nfunction parsePrismaModels(schemaPath: string): Set<string> {\n const models = new Set<string>();\n\n if (!fs.existsSync(schemaPath)) {\n return models;\n }\n\n const content = fs.readFileSync(schemaPath, 'utf-8');\n const regex = /^model\\s+(\\w+)\\s*\\{/gm;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(content)) !== null) {\n models.add(match[1]);\n }\n\n return models;\n}\n\n/**\n * Derive the expected Dbo name from a return type ending in Dto.\n * \"XxxDto\" -> \"XxxDbo\". Returns null if name doesn't end with Dto.\n */\nfunction deriveExpectedDboName(returnType: string): string | null {\n if (!returnType.endsWith('Dto')) return null;\n return returnType.slice(0, -3) + 'Dbo';\n}\n\n/**\n * Check if a line has a webpieces-disable comment for prisma-converter.\n */\nfunction hasDisableComment(lines: string[], lineNumber: number): boolean {\n const startCheck = Math.max(0, lineNumber - 5);\n for (let i = lineNumber - 2; i >= startCheck; i--) {\n const line = lines[i]?.trim() ?? '';\n if (line.startsWith('function ') || line.startsWith('class ') || line.endsWith('}')) {\n break;\n }\n if (line.includes('webpieces-disable') && line.includes('prisma-converter')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Check if a method/function node has a @deprecated decorator.\n */\nfunction hasDeprecatedDecorator(node: ts.MethodDeclaration | ts.FunctionDeclaration): boolean {\n const modifiers = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;\n if (!modifiers) return false;\n\n for (const decorator of modifiers) {\n const expr = decorator.expression;\n // @deprecated or @deprecated()\n if (ts.isIdentifier(expr) && expr.text === 'deprecated') return true;\n if (ts.isCallExpression(expr) && ts.isIdentifier(expr.expression) && expr.expression.text === 'deprecated') {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Check if a node has @deprecated in its JSDoc comments.\n */\nfunction hasDeprecatedJsDoc(node: ts.Node): boolean {\n const jsDocs = ts.getJSDocTags(node);\n for (const tag of jsDocs) {\n if (tag.tagName.text === 'deprecated') return true;\n }\n return false;\n}\n\n/**\n * Check if a method is deprecated via decorator or JSDoc.\n */\nfunction isDeprecated(node: ts.MethodDeclaration | ts.FunctionDeclaration): boolean {\n return hasDeprecatedDecorator(node) || hasDeprecatedJsDoc(node);\n}\n\n/**\n * Extract the text of a type node, stripping whitespace.\n */\nfunction getTypeText(typeNode: ts.TypeNode, sourceFile: ts.SourceFile): string {\n return typeNode.getText(sourceFile).trim();\n}\n\n/**\n * Unwrap Promise<T> to get T. Returns the inner type text if wrapped, otherwise returns as-is.\n */\nfunction unwrapPromise(typeText: string): UnwrapResult {\n const promiseMatch = typeText.match(/^Promise\\s*<\\s*(.+)\\s*>$/);\n if (promiseMatch) {\n return { inner: promiseMatch[1].trim(), isAsync: true };\n }\n return { inner: typeText, isAsync: false };\n}\n\n/**\n * Check a standalone function declaration in a converter file and return a violation if applicable.\n */\nfunction checkStandaloneFunction(\n node: ts.FunctionDeclaration,\n ctx: FileContext\n): PrismaConverterViolation | null {\n if (!node.name) return null;\n\n const startPos = node.getStart(ctx.sourceFile);\n const pos = ctx.sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if ((ctx.disableAllowed && hasDisableComment(ctx.fileLines, line)) || isDeprecated(node)) return null;\n\n return {\n file: ctx.filePath,\n line,\n message: `Standalone function \"${node.name.text}\" found in converter file. ` +\n 'Move to a converter class so it can be injected via DI.',\n };\n}\n\n/**\n * Validate the parameters of a converter method that returns a Dto with a matching Dbo.\n */\nfunction checkMethodParams(\n node: ts.MethodDeclaration,\n innerType: string,\n expectedDbo: string,\n ctx: FileContext,\n line: number\n): PrismaConverterViolation[] {\n const violations: PrismaConverterViolation[] = [];\n const params = node.parameters;\n\n if (params.length === 0) {\n violations.push({\n file: ctx.filePath,\n line,\n message: `Method returns \"${innerType}\" but has no parameters. ` +\n `First parameter must be of type \"${expectedDbo}\".`,\n });\n return violations;\n }\n\n const firstParam = params[0];\n if (firstParam.type) {\n const firstParamType = getTypeText(firstParam.type, ctx.sourceFile);\n if (firstParamType !== expectedDbo) {\n violations.push({\n file: ctx.filePath,\n line,\n message: `Method returns \"${innerType}\" but first parameter is \"${firstParamType}\". ` +\n `First parameter must be of type \"${expectedDbo}\".`,\n });\n }\n }\n\n for (let i = 1; i < params.length; i++) {\n const param = params[i];\n if (param.type) {\n const paramType = getTypeText(param.type, ctx.sourceFile);\n if (paramType !== 'boolean') {\n const paramName = param.name.getText(ctx.sourceFile);\n violations.push({\n file: ctx.filePath,\n line,\n message: `Extra parameter \"${paramName}\" has type \"${paramType}\" but must be \"boolean\". ` +\n 'Additional converter parameters are only for boolean flags (payload filtering / security).',\n });\n }\n }\n }\n\n return violations;\n}\n\n/**\n * Check a class method declaration for converter pattern violations.\n */\nfunction checkConverterMethod(\n node: ts.MethodDeclaration,\n ctx: FileContext\n): PrismaConverterViolation[] {\n if (!node.name || !node.type) return [];\n\n const startPos = node.getStart(ctx.sourceFile);\n const pos = ctx.sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if ((ctx.disableAllowed && hasDisableComment(ctx.fileLines, line)) || isDeprecated(node)) return [];\n\n const returnTypeText = getTypeText(node.type, ctx.sourceFile);\n const { inner: innerType, isAsync } = unwrapPromise(returnTypeText);\n const expectedDbo = deriveExpectedDboName(innerType);\n\n if (!expectedDbo || !ctx.prismaModels.has(expectedDbo)) return [];\n\n if (isAsync) {\n return [{\n file: ctx.filePath,\n line,\n message: `Async converter method returning \"Promise<${innerType}>\" found. ` +\n 'Converters should be pure data mapping with no async work. Remove async/Promise.',\n }];\n }\n\n return checkMethodParams(node, innerType, expectedDbo, ctx, line);\n}\n\n/**\n * Find converter method violations in a single file.\n * Checks class methods for proper Dbo parameter patterns and flags standalone functions.\n */\nfunction findConverterViolationsInFile(\n filePath: string,\n workspaceRoot: string,\n prismaModels: Set<string>,\n disableAllowed: boolean\n): PrismaConverterViolation[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const ctx: FileContext = {\n filePath,\n fileLines: content.split('\\n'),\n sourceFile: ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true),\n prismaModels,\n disableAllowed,\n };\n\n const violations: PrismaConverterViolation[] = [];\n\n function visitNode(node: ts.Node): void {\n if (ts.isFunctionDeclaration(node)) {\n const violation = checkStandaloneFunction(node, ctx);\n if (violation) violations.push(violation);\n }\n\n if (ts.isMethodDeclaration(node)) {\n violations.push(...checkConverterMethod(node, ctx));\n }\n\n ts.forEachChild(node, visitNode);\n }\n\n visitNode(ctx.sourceFile);\n return violations;\n}\n\n/**\n * Find violations in non-converter files: creating `new XxxDto(...)` where XxxDbo exists in prisma.\n * These Dto instances must only be created inside converter classes.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal for new-expression detection with prisma model matching\nfunction findDtoCreationOutsideConverters(\n filePath: string,\n workspaceRoot: string,\n prismaModels: Set<string>,\n convertersPaths: string[],\n disableAllowed: boolean\n): PrismaConverterViolation[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const fileLines = content.split('\\n');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const violations: PrismaConverterViolation[] = [];\n\n function visitNode(node: ts.Node): void {\n // Detect `new XxxDto(...)` expressions\n if (ts.isNewExpression(node) && ts.isIdentifier(node.expression)) {\n const className = node.expression.text;\n const expectedDbo = deriveExpectedDboName(className);\n\n if (expectedDbo && prismaModels.has(expectedDbo)) {\n const startPos = node.getStart(sourceFile);\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if (!disableAllowed || !hasDisableComment(fileLines, line)) {\n const dirs = convertersPaths.map((p) => `\"${p}\"`).join(', ');\n violations.push({\n file: filePath,\n line,\n message: `\"${className}\" can only be created from its Dbo using a converter in one of these directories: ${dirs}. ` +\n 'Move this Dto construction into a converter class method.',\n });\n }\n }\n }\n\n ts.forEachChild(node, visitNode);\n }\n\n visitNode(sourceFile);\n return violations;\n}\n\n/**\n * Find converter violations only for new/modified methods (MODIFIED_METHOD_AND_CODE mode).\n * For converter files: only check methods/functions that are new or have changed lines in their range.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal with method boundary filtering for new/modified detection\nfunction findConverterViolationsForModifiedMethods(\n filePath: string,\n workspaceRoot: string,\n prismaModels: Set<string>,\n disableAllowed: boolean,\n changedLines: Set<number>,\n newMethodNames: Set<string>\n): PrismaConverterViolation[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const ctx: FileContext = {\n filePath,\n fileLines: content.split('\\n'),\n sourceFile: ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true),\n prismaModels,\n disableAllowed,\n };\n\n const violations: PrismaConverterViolation[] = [];\n\n function visitNode(node: ts.Node): void {\n if (ts.isFunctionDeclaration(node) && node.name) {\n const start = ctx.sourceFile.getLineAndCharacterOfPosition(node.getStart(ctx.sourceFile));\n const end = ctx.sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n if (isNewOrModified(node.name.text, start.line + 1, end.line + 1, changedLines, newMethodNames)) {\n const violation = checkStandaloneFunction(node, ctx);\n if (violation) violations.push(violation);\n }\n }\n\n if (ts.isMethodDeclaration(node) && node.name) {\n const start = ctx.sourceFile.getLineAndCharacterOfPosition(node.getStart(ctx.sourceFile));\n const end = ctx.sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n const methodName = node.name.getText(ctx.sourceFile);\n if (isNewOrModified(methodName, start.line + 1, end.line + 1, changedLines, newMethodNames)) {\n violations.push(...checkConverterMethod(node, ctx));\n }\n }\n\n ts.forEachChild(node, visitNode);\n }\n\n visitNode(ctx.sourceFile);\n return violations;\n}\n\n/**\n * Find Dto creation violations only on changed lines (MODIFIED_METHOD_AND_CODE mode).\n * For non-converter files: only flag `new XxxDto(...)` on changed lines in the diff.\n */\n// webpieces-disable max-lines-new-methods -- AST traversal for new-expression detection with changed-line filtering\nfunction findDtoCreationOnChangedLines(\n filePath: string,\n workspaceRoot: string,\n prismaModels: Set<string>,\n convertersPaths: string[],\n disableAllowed: boolean,\n changedLines: Set<number>\n): PrismaConverterViolation[] {\n const fullPath = path.join(workspaceRoot, filePath);\n if (!fs.existsSync(fullPath)) return [];\n\n const content = fs.readFileSync(fullPath, 'utf-8');\n const fileLines = content.split('\\n');\n const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);\n\n const violations: PrismaConverterViolation[] = [];\n\n function visitNode(node: ts.Node): void {\n if (ts.isNewExpression(node) && ts.isIdentifier(node.expression)) {\n const className = node.expression.text;\n const expectedDbo = deriveExpectedDboName(className);\n\n if (expectedDbo && prismaModels.has(expectedDbo)) {\n const startPos = node.getStart(sourceFile);\n const pos = sourceFile.getLineAndCharacterOfPosition(startPos);\n const line = pos.line + 1;\n\n if (changedLines.has(line) && (!disableAllowed || !hasDisableComment(fileLines, line))) {\n const dirs = convertersPaths.map((p) => `\"${p}\"`).join(', ');\n violations.push({\n file: filePath,\n line,\n message: `\"${className}\" can only be created from its Dbo using a converter in one of these directories: ${dirs}. ` +\n 'Move this Dto construction into a converter class method.',\n });\n }\n }\n }\n\n ts.forEachChild(node, visitNode);\n }\n\n visitNode(sourceFile);\n return violations;\n}\n\n/**\n * Collect violations for MODIFIED_METHOD_AND_CODE mode.\n * Converter files: method-level — only check new/modified methods.\n * Non-converter files: line-level — only flag new XxxDto() on changed lines.\n */\n// webpieces-disable max-lines-new-methods -- File classification and diff-based violation collection\nfunction collectViolationsForModifiedMethodAndCode(\n changedFiles: string[],\n convertersPaths: string[],\n workspaceRoot: string,\n prismaModels: Set<string>,\n disableAllowed: boolean,\n base: string,\n head: string | undefined\n): PrismaConverterViolation[] {\n const converterFiles = changedFiles.filter((f) =>\n convertersPaths.some((cp) => f.startsWith(cp))\n );\n const nonConverterFiles = changedFiles.filter((f) =>\n !convertersPaths.some((cp) => f.startsWith(cp))\n );\n\n const allViolations: PrismaConverterViolation[] = [];\n\n if (converterFiles.length > 0) {\n console.log(`📂 Checking ${converterFiles.length} converter file(s) (new/modified methods only)...`);\n for (const file of converterFiles) {\n const diff = getFileDiff(workspaceRoot, file, base, head);\n const changedLines = getChangedLineNumbers(diff);\n const newMethodNames = findNewMethodSignaturesInDiff(diff);\n if (changedLines.size === 0 && newMethodNames.size === 0) continue;\n allViolations.push(...findConverterViolationsForModifiedMethods(\n file, workspaceRoot, prismaModels, disableAllowed, changedLines, newMethodNames\n ));\n }\n }\n\n if (nonConverterFiles.length > 0) {\n console.log(`📂 Checking ${nonConverterFiles.length} non-converter file(s) for Dto creation (changed lines only)...`);\n for (const file of nonConverterFiles) {\n const diff = getFileDiff(workspaceRoot, file, base, head);\n const changedLines = getChangedLineNumbers(diff);\n if (changedLines.size === 0) continue;\n allViolations.push(...findDtoCreationOnChangedLines(\n file, workspaceRoot, prismaModels, convertersPaths, disableAllowed, changedLines\n ));\n }\n }\n\n return allViolations;\n}\n\n/**\n * Report violations to console.\n */\nfunction reportViolations(violations: PrismaConverterViolation[], mode: PrismaConverterMode): void {\n console.error('');\n console.error('❌ Prisma converter violations found!');\n console.error('');\n console.error('📚 Converter methods returning XxxDto (where XxxDbo exists in schema.prisma)');\n console.error(' must accept XxxDbo as the first parameter. This keeps single-table');\n console.error(' converters clean and forces join converters to compose them.');\n console.error('');\n console.error(' GOOD: convertUserDbo(userDbo: UserDbo): UserDto { }');\n console.error(' GOOD: convertVersionDbo(version: VersionDbo, partial?: boolean): VersionDto { }');\n console.error(' GOOD: convertToJoinDto(item: SomeJoinType): CourseJoinDto { } // no matching JoinDbo');\n console.error('');\n console.error(' BAD: async convertUser(dbo: UserDbo): Promise<UserDto> { } // no async');\n console.error(' BAD: convertCourse(course: CourseWithMeta): CourseDto { } // wrong first param');\n console.error(' BAD: convertUser(dbo: UserDbo, name: string): UserDto { } // extra non-boolean');\n console.error(' BAD: export function convertSession(s: SessionDbo): SessionDto // standalone function');\n console.error('');\n\n for (const v of violations) {\n console.error(` ❌ ${v.file}:${v.line}`);\n console.error(` ${v.message}`);\n }\n console.error('');\n\n console.error(' Escape hatch (use sparingly):');\n console.error(' // webpieces-disable prisma-converter -- [your reason]');\n console.error('');\n console.error(` Current mode: ${mode}`);\n console.error('');\n}\n\n/**\n * Resolve git base ref from env vars or auto-detection.\n */\nfunction resolveBase(workspaceRoot: string): string | undefined {\n const envBase = process.env['NX_BASE'];\n if (envBase) return envBase;\n return detectBase(workspaceRoot) ?? undefined;\n}\n\n/**\n * Collect all violations from converter and non-converter files.\n */\nfunction collectAllViolations(\n changedFiles: string[],\n convertersPaths: string[],\n workspaceRoot: string,\n prismaModels: Set<string>,\n disableAllowed: boolean\n): PrismaConverterViolation[] {\n const converterFiles = changedFiles.filter((f) =>\n convertersPaths.some((cp) => f.startsWith(cp))\n );\n const nonConverterFiles = changedFiles.filter((f) =>\n !convertersPaths.some((cp) => f.startsWith(cp))\n );\n\n const allViolations: PrismaConverterViolation[] = [];\n\n if (converterFiles.length > 0) {\n console.log(`📂 Checking ${converterFiles.length} converter file(s)...`);\n for (const file of converterFiles) {\n allViolations.push(...findConverterViolationsInFile(file, workspaceRoot, prismaModels, disableAllowed));\n }\n }\n\n if (nonConverterFiles.length > 0) {\n console.log(`📂 Checking ${nonConverterFiles.length} non-converter file(s) for Dto creation...`);\n for (const file of nonConverterFiles) {\n allViolations.push(...findDtoCreationOutsideConverters(file, workspaceRoot, prismaModels, convertersPaths, disableAllowed));\n }\n }\n\n return allViolations;\n}\n\n/**\n * Run validation after early-exit checks have passed.\n */\nfunction validateChangedFiles(\n workspaceRoot: string,\n schemaPath: string,\n convertersPaths: string[],\n base: string,\n mode: PrismaConverterMode,\n disableAllowed: boolean\n): ExecutorResult {\n const head = process.env['NX_HEAD'];\n\n console.log(` Base: ${base}`);\n console.log(` Head: ${head ?? 'working tree (includes uncommitted changes)'}`);\n console.log('');\n\n const fullSchemaPath = path.join(workspaceRoot, schemaPath);\n const prismaModels = parsePrismaModels(fullSchemaPath);\n\n if (prismaModels.size === 0) {\n console.log('⏭️ No models found in schema.prisma');\n console.log('');\n return { success: true };\n }\n\n console.log(` Found ${prismaModels.size} model(s) in schema.prisma`);\n\n const changedFiles = getChangedTypeScriptFiles(workspaceRoot, base, head);\n\n if (changedFiles.length === 0) {\n console.log('✅ No TypeScript files changed');\n return { success: true };\n }\n\n let allViolations: PrismaConverterViolation[];\n\n if (mode === 'MODIFIED_METHOD_AND_CODE') {\n allViolations = collectViolationsForModifiedMethodAndCode(\n changedFiles, convertersPaths, workspaceRoot, prismaModels, disableAllowed, base, head\n );\n } else {\n allViolations = collectAllViolations(changedFiles, convertersPaths, workspaceRoot, prismaModels, disableAllowed);\n }\n\n if (allViolations.length === 0) {\n console.log('✅ All converter patterns are valid');\n return { success: true };\n }\n\n reportViolations(allViolations, mode);\n return { success: false };\n}\n\n/**\n * Resolve mode considering ignoreModifiedUntilEpoch override.\n * When active, downgrades to OFF. When expired, logs a warning.\n */\nfunction resolvePrismaConverterMode(\n normalMode: PrismaConverterMode,\n epoch: number | undefined\n): PrismaConverterMode {\n if (epoch === undefined || normalMode === 'OFF') {\n return normalMode;\n }\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n const expiresDate = new Date(epoch * 1000).toISOString().split('T')[0];\n console.log(`\\n⏭️ Skipping prisma-converter validation (ignoreModifiedUntilEpoch active, expires: ${expiresDate})`);\n console.log('');\n return 'OFF';\n }\n const expiresDate = new Date(epoch * 1000).toISOString().split('T')[0];\n console.log(`\\n⚠️ prismaConverter.ignoreModifiedUntilEpoch (${epoch}) has expired (${expiresDate}). Remove it from nx.json. Using normal mode: ${normalMode}\\n`);\n return normalMode;\n}\n\nexport default async function runExecutor(\n options: ValidatePrismaConvertersOptions,\n context: ExecutorContext\n): Promise<ExecutorResult> {\n const workspaceRoot = context.root;\n const mode = resolvePrismaConverterMode(options.mode ?? 'OFF', options.ignoreModifiedUntilEpoch);\n\n if (mode === 'OFF') {\n console.log('\\n⏭️ Skipping prisma-converter validation (mode: OFF)');\n console.log('');\n return { success: true };\n }\n\n const schemaPath = options.schemaPath;\n const convertersPaths = options.convertersPaths ?? [];\n\n if (!schemaPath || convertersPaths.length === 0) {\n const reason = !schemaPath ? 'no schemaPath configured' : 'no convertersPaths configured';\n console.log(`\\n⏭️ Skipping prisma-converter validation (${reason})`);\n console.log('');\n return { success: true };\n }\n\n console.log('\\n📏 Validating Prisma Converters\\n');\n console.log(` Mode: ${mode}`);\n console.log(` Schema: ${schemaPath}`);\n console.log(` Converter paths: ${convertersPaths.join(', ')}`);\n\n const base = resolveBase(workspaceRoot);\n\n if (!base) {\n console.log('\\n⏭️ Skipping prisma-converter validation (could not detect base branch)');\n console.log('');\n return { success: true };\n }\n\n const disableAllowed = options.disableAllowed ?? true;\n return validateChangedFiles(workspaceRoot, schemaPath, convertersPaths, base, mode, disableAllowed);\n}\n"]}
@@ -40,8 +40,9 @@
40
40
  * ============================================================================
41
41
  * MODES
42
42
  * ============================================================================
43
- * - OFF: Skip validation entirely
44
- * - MODIFIED_FILES: Validate converter files that were modified in the diff
43
+ * - OFF: Skip validation entirely
44
+ * - MODIFIED_METHOD_AND_CODE: Validate new/modified methods in converters + changed lines in non-converters
45
+ * - MODIFIED_FILES: Validate all methods in modified files
45
46
  */
46
47
 
47
48
  import type { ExecutorContext } from '@nx/devkit';
@@ -49,8 +50,9 @@ import { execSync } from 'child_process';
49
50
  import * as fs from 'fs';
50
51
  import * as path from 'path';
51
52
  import * as ts from 'typescript';
53
+ import { getFileDiff, getChangedLineNumbers, findNewMethodSignaturesInDiff, isNewOrModified } from '../diff-utils';
52
54
 
53
- export type PrismaConverterMode = 'OFF' | 'MODIFIED_FILES';
55
+ export type PrismaConverterMode = 'OFF' | 'MODIFIED_METHOD_AND_CODE' | 'MODIFIED_FILES';
54
56
 
55
57
  export interface ValidatePrismaConvertersOptions {
56
58
  mode?: PrismaConverterMode;
@@ -458,6 +460,162 @@ function findDtoCreationOutsideConverters(
458
460
  return violations;
459
461
  }
460
462
 
463
+ /**
464
+ * Find converter violations only for new/modified methods (MODIFIED_METHOD_AND_CODE mode).
465
+ * For converter files: only check methods/functions that are new or have changed lines in their range.
466
+ */
467
+ // webpieces-disable max-lines-new-methods -- AST traversal with method boundary filtering for new/modified detection
468
+ function findConverterViolationsForModifiedMethods(
469
+ filePath: string,
470
+ workspaceRoot: string,
471
+ prismaModels: Set<string>,
472
+ disableAllowed: boolean,
473
+ changedLines: Set<number>,
474
+ newMethodNames: Set<string>
475
+ ): PrismaConverterViolation[] {
476
+ const fullPath = path.join(workspaceRoot, filePath);
477
+ if (!fs.existsSync(fullPath)) return [];
478
+
479
+ const content = fs.readFileSync(fullPath, 'utf-8');
480
+ const ctx: FileContext = {
481
+ filePath,
482
+ fileLines: content.split('\n'),
483
+ sourceFile: ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true),
484
+ prismaModels,
485
+ disableAllowed,
486
+ };
487
+
488
+ const violations: PrismaConverterViolation[] = [];
489
+
490
+ function visitNode(node: ts.Node): void {
491
+ if (ts.isFunctionDeclaration(node) && node.name) {
492
+ const start = ctx.sourceFile.getLineAndCharacterOfPosition(node.getStart(ctx.sourceFile));
493
+ const end = ctx.sourceFile.getLineAndCharacterOfPosition(node.getEnd());
494
+ if (isNewOrModified(node.name.text, start.line + 1, end.line + 1, changedLines, newMethodNames)) {
495
+ const violation = checkStandaloneFunction(node, ctx);
496
+ if (violation) violations.push(violation);
497
+ }
498
+ }
499
+
500
+ if (ts.isMethodDeclaration(node) && node.name) {
501
+ const start = ctx.sourceFile.getLineAndCharacterOfPosition(node.getStart(ctx.sourceFile));
502
+ const end = ctx.sourceFile.getLineAndCharacterOfPosition(node.getEnd());
503
+ const methodName = node.name.getText(ctx.sourceFile);
504
+ if (isNewOrModified(methodName, start.line + 1, end.line + 1, changedLines, newMethodNames)) {
505
+ violations.push(...checkConverterMethod(node, ctx));
506
+ }
507
+ }
508
+
509
+ ts.forEachChild(node, visitNode);
510
+ }
511
+
512
+ visitNode(ctx.sourceFile);
513
+ return violations;
514
+ }
515
+
516
+ /**
517
+ * Find Dto creation violations only on changed lines (MODIFIED_METHOD_AND_CODE mode).
518
+ * For non-converter files: only flag `new XxxDto(...)` on changed lines in the diff.
519
+ */
520
+ // webpieces-disable max-lines-new-methods -- AST traversal for new-expression detection with changed-line filtering
521
+ function findDtoCreationOnChangedLines(
522
+ filePath: string,
523
+ workspaceRoot: string,
524
+ prismaModels: Set<string>,
525
+ convertersPaths: string[],
526
+ disableAllowed: boolean,
527
+ changedLines: Set<number>
528
+ ): PrismaConverterViolation[] {
529
+ const fullPath = path.join(workspaceRoot, filePath);
530
+ if (!fs.existsSync(fullPath)) return [];
531
+
532
+ const content = fs.readFileSync(fullPath, 'utf-8');
533
+ const fileLines = content.split('\n');
534
+ const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
535
+
536
+ const violations: PrismaConverterViolation[] = [];
537
+
538
+ function visitNode(node: ts.Node): void {
539
+ if (ts.isNewExpression(node) && ts.isIdentifier(node.expression)) {
540
+ const className = node.expression.text;
541
+ const expectedDbo = deriveExpectedDboName(className);
542
+
543
+ if (expectedDbo && prismaModels.has(expectedDbo)) {
544
+ const startPos = node.getStart(sourceFile);
545
+ const pos = sourceFile.getLineAndCharacterOfPosition(startPos);
546
+ const line = pos.line + 1;
547
+
548
+ if (changedLines.has(line) && (!disableAllowed || !hasDisableComment(fileLines, line))) {
549
+ const dirs = convertersPaths.map((p) => `"${p}"`).join(', ');
550
+ violations.push({
551
+ file: filePath,
552
+ line,
553
+ message: `"${className}" can only be created from its Dbo using a converter in one of these directories: ${dirs}. ` +
554
+ 'Move this Dto construction into a converter class method.',
555
+ });
556
+ }
557
+ }
558
+ }
559
+
560
+ ts.forEachChild(node, visitNode);
561
+ }
562
+
563
+ visitNode(sourceFile);
564
+ return violations;
565
+ }
566
+
567
+ /**
568
+ * Collect violations for MODIFIED_METHOD_AND_CODE mode.
569
+ * Converter files: method-level — only check new/modified methods.
570
+ * Non-converter files: line-level — only flag new XxxDto() on changed lines.
571
+ */
572
+ // webpieces-disable max-lines-new-methods -- File classification and diff-based violation collection
573
+ function collectViolationsForModifiedMethodAndCode(
574
+ changedFiles: string[],
575
+ convertersPaths: string[],
576
+ workspaceRoot: string,
577
+ prismaModels: Set<string>,
578
+ disableAllowed: boolean,
579
+ base: string,
580
+ head: string | undefined
581
+ ): PrismaConverterViolation[] {
582
+ const converterFiles = changedFiles.filter((f) =>
583
+ convertersPaths.some((cp) => f.startsWith(cp))
584
+ );
585
+ const nonConverterFiles = changedFiles.filter((f) =>
586
+ !convertersPaths.some((cp) => f.startsWith(cp))
587
+ );
588
+
589
+ const allViolations: PrismaConverterViolation[] = [];
590
+
591
+ if (converterFiles.length > 0) {
592
+ console.log(`📂 Checking ${converterFiles.length} converter file(s) (new/modified methods only)...`);
593
+ for (const file of converterFiles) {
594
+ const diff = getFileDiff(workspaceRoot, file, base, head);
595
+ const changedLines = getChangedLineNumbers(diff);
596
+ const newMethodNames = findNewMethodSignaturesInDiff(diff);
597
+ if (changedLines.size === 0 && newMethodNames.size === 0) continue;
598
+ allViolations.push(...findConverterViolationsForModifiedMethods(
599
+ file, workspaceRoot, prismaModels, disableAllowed, changedLines, newMethodNames
600
+ ));
601
+ }
602
+ }
603
+
604
+ if (nonConverterFiles.length > 0) {
605
+ console.log(`📂 Checking ${nonConverterFiles.length} non-converter file(s) for Dto creation (changed lines only)...`);
606
+ for (const file of nonConverterFiles) {
607
+ const diff = getFileDiff(workspaceRoot, file, base, head);
608
+ const changedLines = getChangedLineNumbers(diff);
609
+ if (changedLines.size === 0) continue;
610
+ allViolations.push(...findDtoCreationOnChangedLines(
611
+ file, workspaceRoot, prismaModels, convertersPaths, disableAllowed, changedLines
612
+ ));
613
+ }
614
+ }
615
+
616
+ return allViolations;
617
+ }
618
+
461
619
  /**
462
620
  * Report violations to console.
463
621
  */
@@ -572,7 +730,15 @@ function validateChangedFiles(
572
730
  return { success: true };
573
731
  }
574
732
 
575
- const allViolations = collectAllViolations(changedFiles, convertersPaths, workspaceRoot, prismaModels, disableAllowed);
733
+ let allViolations: PrismaConverterViolation[];
734
+
735
+ if (mode === 'MODIFIED_METHOD_AND_CODE') {
736
+ allViolations = collectViolationsForModifiedMethodAndCode(
737
+ changedFiles, convertersPaths, workspaceRoot, prismaModels, disableAllowed, base, head
738
+ );
739
+ } else {
740
+ allViolations = collectAllViolations(changedFiles, convertersPaths, workspaceRoot, prismaModels, disableAllowed);
741
+ }
576
742
 
577
743
  if (allViolations.length === 0) {
578
744
  console.log('✅ All converter patterns are valid');
@@ -6,8 +6,8 @@
6
6
  "properties": {
7
7
  "mode": {
8
8
  "type": "string",
9
- "enum": ["OFF", "MODIFIED_FILES"],
10
- "description": "OFF: skip validation. MODIFIED_FILES: validate converter files that were modified in the diff.",
9
+ "enum": ["OFF", "MODIFIED_METHOD_AND_CODE", "MODIFIED_FILES"],
10
+ "description": "OFF: skip validation. MODIFIED_METHOD_AND_CODE: validate methods that are new or have changed lines. MODIFIED_FILES: validate all methods in modified files.",
11
11
  "default": "OFF"
12
12
  },
13
13
  "schemaPath": {
@@ -11,13 +11,13 @@
11
11
  * Modes:
12
12
  * - OFF: Skip validation entirely
13
13
  * - NEW_METHODS: Only validate new methods (detected via git diff)
14
- * - MODIFIED_AND_NEW_METHODS: Validate new methods + methods with changes in their line range
14
+ * - NEW_AND_MODIFIED_METHODS: Validate new methods + methods with changes in their line range
15
15
  * - MODIFIED_FILES: Validate all methods in modified files
16
16
  *
17
17
  * Escape hatch: Add webpieces-disable require-return-type comment with justification
18
18
  */
19
19
  import type { ExecutorContext } from '@nx/devkit';
20
- export type ReturnTypeMode = 'OFF' | 'NEW_METHODS' | 'MODIFIED_AND_NEW_METHODS' | 'MODIFIED_FILES';
20
+ export type ReturnTypeMode = 'OFF' | 'NEW_METHODS' | 'NEW_AND_MODIFIED_METHODS' | 'MODIFIED_FILES';
21
21
  export interface ValidateReturnTypesOptions {
22
22
  mode?: ReturnTypeMode;
23
23
  disableAllowed?: boolean;
@@ -12,7 +12,7 @@
12
12
  * Modes:
13
13
  * - OFF: Skip validation entirely
14
14
  * - NEW_METHODS: Only validate new methods (detected via git diff)
15
- * - MODIFIED_AND_NEW_METHODS: Validate new methods + methods with changes in their line range
15
+ * - NEW_AND_MODIFIED_METHODS: Validate new methods + methods with changes in their line range
16
16
  * - MODIFIED_FILES: Validate all methods in modified files
17
17
  *
18
18
  * Escape hatch: Add webpieces-disable require-return-type comment with justification
@@ -266,7 +266,7 @@ function findViolationsForNewMethods(workspaceRoot, changedFiles, base, head, di
266
266
  return violations;
267
267
  }
268
268
  /**
269
- * Find NEW methods AND methods with changes (MODIFIED_AND_NEW_METHODS mode).
269
+ * Find NEW methods AND methods with changes (NEW_AND_MODIFIED_METHODS mode).
270
270
  */
271
271
  // webpieces-disable max-lines-new-methods -- Combines new method detection with change detection
272
272
  function findViolationsForModifiedAndNewMethods(workspaceRoot, changedFiles, base, head, disableAllowed) {
@@ -425,7 +425,7 @@ async function runExecutor(options, context) {
425
425
  if (mode === 'NEW_METHODS') {
426
426
  violations = findViolationsForNewMethods(workspaceRoot, changedFiles, base, head, disableAllowed);
427
427
  }
428
- else if (mode === 'MODIFIED_AND_NEW_METHODS') {
428
+ else if (mode === 'NEW_AND_MODIFIED_METHODS') {
429
429
  violations = findViolationsForModifiedAndNewMethods(workspaceRoot, changedFiles, base, head, disableAllowed);
430
430
  }
431
431
  else if (mode === 'MODIFIED_FILES') {