@archest/jest 1.0.1
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.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +162 -0
- package/dist/index.mjs.map +1 -0
- package/dist/matchers/index.d.ts +23 -0
- package/dist/matchers/models.d.ts +201 -0
- package/node_modules/@archest/core/dist/classes/classCheckExtendClass.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/classCheckHaveMaxCyclomaticComplexity.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/classCheckHaveModifier.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/classCheckHaveNameMatchingFileName.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/classCheckImplementInterface.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/classCheckMatchNamePattern.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/classCheckResideInFolder.d.ts +3 -0
- package/node_modules/@archest/core/dist/classes/locateClasses.d.ts +5 -0
- package/node_modules/@archest/core/dist/classes/types.d.ts +25 -0
- package/node_modules/@archest/core/dist/dto.d.ts +78 -0
- package/node_modules/@archest/core/dist/files/checkDependOnExternalModule.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/checkDependOnFilesInFolder.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/fileCheckBeFreeOfCycles.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/fileCheckHaveMaxCyclomaticComplexity.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/fileCheckHaveMaxExportedFunctions.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/fileCheckHaveMinMaintainabilityIndex.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/fileCheckMatchNamePattern.d.ts +3 -0
- package/node_modules/@archest/core/dist/files/getFileDependencies.d.ts +2 -0
- package/node_modules/@archest/core/dist/files/locateFiles.d.ts +4 -0
- package/node_modules/@archest/core/dist/files/types.d.ts +17 -0
- package/node_modules/@archest/core/dist/functions/functionCheckHaveExplicitReturnType.d.ts +3 -0
- package/node_modules/@archest/core/dist/functions/functionCheckHaveMaxCyclomaticComplexity.d.ts +3 -0
- package/node_modules/@archest/core/dist/functions/functionCheckHaveMinMaintainabilityIndex.d.ts +3 -0
- package/node_modules/@archest/core/dist/functions/functionCheckHaveModifier.d.ts +3 -0
- package/node_modules/@archest/core/dist/functions/functionCheckHaveNameMatchingFileName.d.ts +3 -0
- package/node_modules/@archest/core/dist/functions/functionCheckMatchNamePattern.d.ts +3 -0
- package/node_modules/@archest/core/dist/functions/locateFunctions.d.ts +5 -0
- package/node_modules/@archest/core/dist/functions/types.d.ts +19 -0
- package/node_modules/@archest/core/dist/index.d.ts +43 -0
- package/node_modules/@archest/core/dist/index.js +14 -0
- package/node_modules/@archest/core/dist/index.js.map +1 -0
- package/node_modules/@archest/core/dist/index.mjs +607 -0
- package/node_modules/@archest/core/dist/index.mjs.map +1 -0
- package/node_modules/@archest/core/dist/layers/checkLayeredArchitecture.d.ts +3 -0
- package/node_modules/@archest/core/dist/layers/createLayeredArchitecture.d.ts +3 -0
- package/node_modules/@archest/core/dist/layers/getLayerDependencies.d.ts +2 -0
- package/node_modules/@archest/core/dist/layers/layer.d.ts +2 -0
- package/node_modules/@archest/core/dist/layers/layerShouldNotBeAccessedByAnyLayer.d.ts +2 -0
- package/node_modules/@archest/core/dist/layers/layerShouldOnlyBeAccessedBy.d.ts +2 -0
- package/node_modules/@archest/core/dist/layers/types.d.ts +8 -0
- package/node_modules/@archest/core/dist/metrics/calculateCyclomaticComplexity.d.ts +2 -0
- package/node_modules/@archest/core/dist/metrics/calculateMaintainabilityIndex.d.ts +2 -0
- package/node_modules/@archest/core/dist/project/parseProject.d.ts +55 -0
- package/node_modules/@archest/core/dist/properties/locateProperties.d.ts +5 -0
- package/node_modules/@archest/core/dist/properties/propertyCheckBeReadonly.d.ts +3 -0
- package/node_modules/@archest/core/dist/properties/types.d.ts +17 -0
- package/node_modules/@archest/core/dist/shared/sharedCheckHaveMaxCyclomaticComplexity.d.ts +1 -0
- package/node_modules/@archest/core/dist/shared/sharedCheckHaveMinMaintainabilityIndex.d.ts +1 -0
- package/node_modules/@archest/core/dist/shared/sharedCheckHaveModifier.d.ts +7 -0
- package/node_modules/@archest/core/dist/shared/sharedCheckHaveNameMatchingFileName.d.ts +3 -0
- package/node_modules/@archest/core/dist/shared/sharedCheckMatchNamePattern.d.ts +1 -0
- package/node_modules/@archest/core/dist/slices/locateSlices.d.ts +3 -0
- package/node_modules/@archest/core/dist/slices/sliceCheckBeFreeOfCycles.d.ts +3 -0
- package/node_modules/@archest/core/dist/slices/sliceCheckHaveMaxDistanceFromMainSequence.d.ts +3 -0
- package/node_modules/@archest/core/dist/slices/types.d.ts +8 -0
- package/node_modules/@archest/core/dist/types.d.ts +11 -0
- package/node_modules/@archest/core/dist/utils/ruleBuilder.d.ts +6 -0
- package/node_modules/@archest/core/package.json +49 -0
- package/node_modules/@archest/core-rust/core-rust.darwin-arm64.node +0 -0
- package/node_modules/@archest/core-rust/index.d.ts +16 -0
- package/node_modules/@archest/core-rust/index.js +316 -0
- package/node_modules/@archest/core-rust/package.json +34 -0
- package/package.json +56 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/classes/classCheckExtendClass.ts","../src/utils/ruleBuilder.ts","../src/shared/sharedCheckHaveMaxCyclomaticComplexity.ts","../src/classes/classCheckHaveMaxCyclomaticComplexity.ts","../src/shared/sharedCheckHaveModifier.ts","../src/classes/classCheckHaveModifier.ts","../src/shared/sharedCheckHaveNameMatchingFileName.ts","../src/classes/classCheckHaveNameMatchingFileName.ts","../src/classes/classCheckImplementInterface.ts","../src/shared/sharedCheckMatchNamePattern.ts","../src/classes/classCheckMatchNamePattern.ts","../src/classes/classCheckResideInFolder.ts","../src/classes/locateClasses.ts","../src/files/checkDependOnExternalModule.ts","../src/files/getFileDependencies.ts","../src/files/checkDependOnFilesInFolder.ts","../src/files/fileCheckBeFreeOfCycles.ts","../src/files/fileCheckHaveMaxCyclomaticComplexity.ts","../src/files/fileCheckHaveMaxExportedFunctions.ts","../src/shared/sharedCheckHaveMinMaintainabilityIndex.ts","../src/files/fileCheckHaveMinMaintainabilityIndex.ts","../src/files/fileCheckMatchNamePattern.ts","../src/files/locateFiles.ts","../src/functions/functionCheckHaveExplicitReturnType.ts","../src/functions/functionCheckHaveMaxCyclomaticComplexity.ts","../src/functions/functionCheckHaveMinMaintainabilityIndex.ts","../src/functions/functionCheckHaveModifier.ts","../src/functions/functionCheckHaveNameMatchingFileName.ts","../src/functions/functionCheckMatchNamePattern.ts","../src/functions/locateFunctions.ts","../src/layers/checkLayeredArchitecture.ts","../src/layers/createLayeredArchitecture.ts","../src/layers/layer.ts","../src/layers/getLayerDependencies.ts","../src/layers/layerShouldNotBeAccessedByAnyLayer.ts","../src/layers/layerShouldOnlyBeAccessedBy.ts","../src/properties/locateProperties.ts","../src/slices/locateSlices.ts","../src/project/parseProject.ts","../src/properties/propertyCheckBeReadonly.ts","../src/slices/sliceCheckBeFreeOfCycles.ts","../src/slices/sliceCheckHaveMaxDistanceFromMainSequence.ts","../src/testUtils.ts"],"sourcesContent":["import type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckExtendClass(\n locator: ClassLocatorData,\n className: string,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n for (const c of locator.classes) {\n const name = c.name || 'Anonymous';\n let matches = false;\n if (c.extends === className) {\n matches = true;\n }\n if (isNot && matches) {\n violations.push(`Class ${name} extends ${className}, but it shouldn't.`);\n } else if (!isNot && !matches) {\n violations.push(\n `Class ${name} does not extend ${className}, but it should.`,\n );\n }\n }\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import type { RuleResult } from '../types';\n\nexport function ruleBuilder<T>(\n items: T[],\n isNot: boolean,\n evaluate: (item: T) => {\n passes: boolean;\n failMessage: string;\n failNotMessage: string;\n },\n): RuleResult {\n const violations: string[] = [];\n\n for (const item of items) {\n const { passes, failMessage, failNotMessage } = evaluate(item);\n\n if (isNot && passes) {\n if (failNotMessage) violations.push(failNotMessage);\n } else if (!isNot && !passes) {\n if (failMessage) violations.push(failMessage);\n }\n }\n\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import { ruleBuilder } from '../utils/ruleBuilder';\n\nexport function sharedCheckHaveMaxCyclomaticComplexity<T>(\n items: T[],\n getName: (item: T) => string | undefined | null,\n getComplexity: (item: T) => number,\n label: string,\n max: number,\n isNot: boolean,\n) {\n return ruleBuilder(items, isNot, (item) => {\n const name = getName(item);\n const complexity = getComplexity(item);\n const exceeds = complexity > max;\n const desc = `${label} ${name || 'Anonymous'}`;\n\n return {\n passes: !exceeds,\n failMessage: `${desc} has a total cyclomatic complexity of ${complexity}, which exceeds the maximum of ${max}.`,\n failNotMessage: `${desc} has a total cyclomatic complexity of ${complexity}, which exceeds the maximum of ${max}, but it shouldn't.`,\n };\n });\n}\n","import { sharedCheckHaveMaxCyclomaticComplexity } from '../shared/sharedCheckHaveMaxCyclomaticComplexity';\nimport type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckHaveMaxCyclomaticComplexity(\n locator: ClassLocatorData,\n max: number,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveMaxCyclomaticComplexity(\n locator.classes,\n (c) => c.name,\n (c) => c.cyclomatic_complexity || 0,\n 'Class',\n max,\n isNot,\n );\n}\n","import { ruleBuilder } from '../utils/ruleBuilder';\n\nexport function sharedCheckHaveModifier<\n T extends {\n is_exported?: boolean;\n is_default?: boolean;\n is_abstract?: boolean;\n is_async?: boolean;\n is_readonly?: boolean;\n },\n>(\n items: T[],\n getName: (item: T) => string | null | undefined,\n label: string,\n modifierStr: string,\n isNot: boolean,\n) {\n return ruleBuilder(items, isNot, (item) => {\n const name = getName(item);\n let passes = false;\n switch (modifierStr) {\n case 'export':\n passes = !!item.is_exported;\n break;\n case 'default':\n passes = !!item.is_default;\n break;\n case 'abstract':\n passes = !!item.is_abstract;\n break;\n case 'async':\n passes = !!item.is_async;\n break;\n case 'readonly':\n passes = !!item.is_readonly;\n break;\n default:\n throw new Error(`Modifier ${modifierStr} is not fully supported.`);\n }\n\n const desc = `${label} ${name || 'Anonymous'}`;\n\n return {\n passes,\n failMessage: `${desc} does not have modifier ${modifierStr}, but it should.`,\n failNotMessage: `${desc} has modifier ${modifierStr}, but it shouldn't.`,\n };\n });\n}\n","import { sharedCheckHaveModifier } from '../shared/sharedCheckHaveModifier';\nimport type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckHaveModifier(\n locator: ClassLocatorData,\n modifierStr: string,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveModifier(\n locator.classes,\n (c) => c.name,\n 'Class',\n modifierStr,\n isNot,\n );\n}\n","import * as path from 'node:path';\nimport { ruleBuilder } from '../utils/ruleBuilder';\n\nexport function sharedCheckHaveNameMatchingFileName<\n T extends { _filePath: string },\n>(\n items: T[],\n getName: (item: T) => string | null | undefined,\n label: string,\n isNot: boolean,\n) {\n return ruleBuilder(items, isNot, (item) => {\n const name = getName(item);\n\n if (!item._filePath) {\n return { passes: true, failMessage: '', failNotMessage: '' };\n }\n\n const basename = path.basename(\n item._filePath,\n path.extname(item._filePath),\n );\n const passes = name === basename;\n const desc = `${label} ${name || 'Anonymous'}`;\n\n return {\n passes,\n failMessage: `${desc} does not have a name matching its filename ${basename}, but it should.`,\n failNotMessage: `${desc} has a name matching its filename ${basename}, but it shouldn't.`,\n };\n });\n}\n","import { sharedCheckHaveNameMatchingFileName } from '../shared/sharedCheckHaveNameMatchingFileName';\nimport type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckHaveNameMatchingFileName(\n locator: ClassLocatorData,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveNameMatchingFileName(\n locator.classes,\n (c) => c.name,\n 'Class',\n isNot,\n );\n}\n","import type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckImplementInterface(\n locator: ClassLocatorData,\n interfaceName: string,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n for (const c of locator.classes) {\n const name = c.name || 'Anonymous';\n let matches = false;\n if (c.implements.includes(interfaceName)) {\n matches = true;\n }\n if (isNot && matches) {\n violations.push(\n `Class ${name} implements ${interfaceName}, but it shouldn't.`,\n );\n } else if (!isNot && !matches) {\n violations.push(\n `Class ${name} does not implement ${interfaceName}, but it should.`,\n );\n }\n }\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import { ruleBuilder } from '../utils/ruleBuilder';\n\nexport function sharedCheckMatchNamePattern<T>(\n items: T[],\n getName: (item: T) => string | undefined | null,\n label: string,\n pattern: string | RegExp,\n isNot: boolean,\n) {\n const regex = typeof pattern === 'string' ? new RegExp(pattern) : pattern;\n\n return ruleBuilder(items, isNot, (item) => {\n const name = getName(item);\n const passes = name ? regex.test(name) : false;\n const desc = `${label} ${name || 'Anonymous'}`;\n return {\n passes,\n failMessage: `${desc} does not match pattern ${pattern}, but it should.`,\n failNotMessage: `${desc} matches pattern ${pattern}, but it shouldn't.`,\n };\n });\n}\n","import { sharedCheckMatchNamePattern } from '../shared/sharedCheckMatchNamePattern';\nimport type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckMatchNamePattern(\n locator: ClassLocatorData,\n pattern: string | RegExp,\n isNot: boolean,\n): RuleResult {\n return sharedCheckMatchNamePattern(\n locator.classes,\n (c) => c.name,\n 'Class',\n pattern,\n isNot,\n );\n}\n","import type { RuleResult } from '../types';\nimport type { ClassLocatorData } from './types';\n\nexport function classCheckResideInFolder(\n locator: ClassLocatorData,\n targetFolder: string,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n for (const c of locator.classes) {\n const className = c.name || 'Anonymous Class';\n const filePath = c._filePath;\n const inTargetFolder =\n filePath.includes(`/${targetFolder}/`) ||\n filePath.includes(`\\\\${targetFolder}\\\\`);\n\n if (isNot && inTargetFolder) {\n violations.push(\n `Class ${className} resides in ${targetFolder}, but it shouldn't.`,\n );\n } else if (!isNot && !inTargetFolder) {\n violations.push(\n `Class ${className} does not reside in ${targetFolder}, but it should.`,\n );\n }\n }\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import type { ClassData, ProjectData } from '../dto';\nimport type { ClassLocatorData, ClassQueryOptions } from './types';\n\nexport function locateClasses(\n classes: (ClassData & { _filePath: string })[],\n projectData: ProjectData,\n options?: ClassQueryOptions,\n): ClassLocatorData {\n let filtered = classes;\n\n if (options?.inFolder) {\n filtered = filtered.filter((c) => {\n return (\n c._filePath.includes(`/${options.inFolder}/`) ||\n c._filePath.includes(`\\\\${options.inFolder}\\\\`)\n );\n });\n }\n if (options?.matchNamePattern) {\n const regex =\n typeof options.matchNamePattern === 'string'\n ? new RegExp(options.matchNamePattern)\n : options.matchNamePattern;\n filtered = filtered.filter((c) => {\n return c.name && regex.test(c.name);\n });\n }\n if (options?.withDecorator) {\n filtered = filtered.filter((c) => {\n return c.decorators.includes(options.withDecorator!);\n });\n }\n if (options?.extending) {\n filtered = filtered.filter((c) => {\n return c.extends === options.extending;\n });\n }\n if (options?.implementing) {\n filtered = filtered.filter((c) => {\n return c.implements.includes(options.implementing!);\n });\n }\n if (options?.havingModifier) {\n filtered = filtered.filter((c) => {\n switch (options.havingModifier) {\n case 'export':\n return c.is_exported;\n case 'default':\n return c.is_default;\n case 'abstract':\n return c.is_abstract;\n default:\n throw new Error(\n `Modifier ${options.havingModifier} is not fully supported.`,\n );\n }\n });\n }\n\n return {\n type: 'ClassLocator',\n classes: filtered,\n projectData,\n };\n}\n","import type { RuleResult } from '../types';\nimport type { FileLocatorData } from './types';\n\nexport function checkDependOnExternalModule(\n locator: FileLocatorData,\n moduleName: string | RegExp,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n\n const regex =\n typeof moduleName === 'string' ? new RegExp(moduleName) : moduleName;\n\n for (const file of locator.files) {\n const deps = file.external_dependencies || [];\n const dependsOnModule = deps.some((dep) => regex.test(dep));\n\n if (isNot && dependsOnModule) {\n violations.push(\n `${file.path} incorrectly depends on external module '${moduleName}'`,\n );\n } else if (!isNot && !dependsOnModule) {\n violations.push(\n `${file.path} does not depend on external module '${moduleName}'`,\n );\n }\n }\n\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import type { FileData, ProjectData } from '../dto';\n\nexport function getFileDependencies(\n sourceFile: FileData,\n projectData: ProjectData,\n): string[] {\n return sourceFile.dependencies || [];\n}\n","import type { RuleResult } from '../types';\nimport { getFileDependencies } from './getFileDependencies';\nimport type { FileLocatorData } from './types';\n\nexport function checkDependOnFilesInFolder(\n locator: FileLocatorData,\n targetFolder: string,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n\n for (const file of locator.files) {\n const dependencies = getFileDependencies(file, locator.projectData);\n\n const dependsOnTarget = dependencies.some(\n (depPath) =>\n depPath.includes(`/${targetFolder}/`) ||\n depPath.includes(`\\\\${targetFolder}\\\\`),\n );\n\n if (isNot && dependsOnTarget) {\n violations.push(\n `File ${file.path} depends on files in ${targetFolder}, but it shouldn't.`,\n );\n } else if (!isNot && !dependsOnTarget) {\n violations.push(\n `File ${file.path} does not depend on files in ${targetFolder}, but it should.`,\n );\n }\n }\n\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import type { RuleResult } from '../types';\nimport { getFileDependencies } from './getFileDependencies';\nimport type { FileLocatorData } from './types';\n\nexport function fileCheckBeFreeOfCycles(\n locator: FileLocatorData,\n isNot: boolean,\n): RuleResult {\n const targetFiles = locator.files.map((f) => f.path);\n\n const archestProject = locator.archestProject;\n if (!archestProject) {\n // Fallback for mocked tests or if registry is missing\n return {\n pass: true,\n message: () => 'Mock pass: archestProject not in registry',\n };\n }\n\n const result = archestProject.checkFileCycles(targetFiles, !!isNot);\n\n return {\n pass: result.pass,\n message: () => result.message,\n };\n}\n","import { sharedCheckHaveMaxCyclomaticComplexity } from '../shared/sharedCheckHaveMaxCyclomaticComplexity';\nimport type { RuleResult } from '../types';\nimport type { FileLocatorData } from './types';\n\nexport function fileCheckHaveMaxCyclomaticComplexity(\n locator: FileLocatorData,\n max: number,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveMaxCyclomaticComplexity(\n locator.files,\n (f) => f.path,\n (file) => {\n let complexity = 0;\n for (const func of file.functions) {\n complexity += func.cyclomatic_complexity || 0;\n }\n for (const cls of file.classes) {\n complexity += cls.cyclomatic_complexity || 0;\n }\n return complexity;\n },\n 'File',\n max,\n isNot,\n );\n}\n","import type { RuleResult } from '../types';\nimport type { FileLocatorData } from './types';\n\nexport function fileCheckHaveMaxExportedFunctions(\n locator: FileLocatorData,\n max: number,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n for (const file of locator.files) {\n const exportedFuncCount = file.functions.filter(\n (f) => f.is_exported,\n ).length;\n\n const exceeds = exportedFuncCount > max;\n\n if (isNot && exceeds) {\n violations.push(\n `File ${file.path} has ${exportedFuncCount} exported functions, which exceeds the maximum of ${max}, but it shouldn't.`,\n );\n } else if (!isNot && exceeds) {\n violations.push(\n `File ${file.path} has ${exportedFuncCount} exported functions, which exceeds the maximum of ${max}.`,\n );\n }\n }\n return {\n pass: isNot ? violations.length > 0 : violations.length === 0,\n message: () =>\n violations.join('\\n') ||\n (isNot\n ? 'Expected some files to exceed maximum exported functions, but none did.'\n : ''),\n };\n}\n","import { ruleBuilder } from '../utils/ruleBuilder';\n\nexport function sharedCheckHaveMinMaintainabilityIndex<T>(\n items: T[],\n getName: (item: T) => string | undefined | null,\n getMi: (item: T) => number,\n label: string,\n min: number,\n isNot: boolean,\n) {\n return ruleBuilder(items, isNot, (item) => {\n const name = getName(item);\n const mi = getMi(item);\n const fallsBelow = mi < min;\n const desc = `${label} ${name || 'Anonymous'}`;\n\n return {\n passes: !fallsBelow,\n failMessage: `${desc} has a maintainability index of ${mi.toFixed(2)}, which falls below the minimum of ${min}.`,\n failNotMessage: `${desc} has a maintainability index of ${mi.toFixed(2)}, which falls below the minimum of ${min}, but it shouldn't.`,\n };\n });\n}\n","import { sharedCheckHaveMinMaintainabilityIndex } from '../shared/sharedCheckHaveMinMaintainabilityIndex';\nimport type { RuleResult } from '../types';\nimport type { FileLocatorData } from './types';\n\nexport function fileCheckHaveMinMaintainabilityIndex(\n locator: FileLocatorData,\n min: number,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveMinMaintainabilityIndex(\n locator.files,\n (f) => f.path,\n (file) => {\n if (file.functions.length > 0) {\n return file.functions[0].maintainability_index || 100;\n }\n return 100;\n },\n 'File',\n min,\n isNot,\n );\n}\n","import { sharedCheckMatchNamePattern } from '../shared/sharedCheckMatchNamePattern';\nimport type { RuleResult } from '../types';\nimport type { FileLocatorData } from './types';\n\nexport function fileCheckMatchNamePattern(\n locator: FileLocatorData,\n pattern: string | RegExp,\n isNot: boolean,\n): RuleResult {\n return sharedCheckMatchNamePattern(\n locator.files,\n (f) => f.path,\n 'File',\n pattern,\n isNot,\n );\n}\n","import type { ArchestProject } from '@archest/core-rust';\nimport type { FileData, ProjectData } from '../dto';\nimport type { FileLocatorData, FileQueryOptions } from './types';\n\nexport function locateFiles(\n sourceFiles: FileData[],\n projectData: ProjectData,\n archestProject?: ArchestProject,\n options?: FileQueryOptions,\n): FileLocatorData {\n let filtered = sourceFiles;\n\n if (options?.inFolder) {\n filtered = filtered.filter(\n (file) =>\n file.path.includes(`/${options.inFolder}/`) ||\n file.path.includes(`\\\\${options.inFolder}\\\\`),\n );\n }\n if (options?.matchNamePattern) {\n const regex =\n typeof options.matchNamePattern === 'string'\n ? new RegExp(options.matchNamePattern)\n : options.matchNamePattern;\n filtered = filtered.filter((file) => regex.test(file.path));\n }\n\n const result: FileLocatorData = {\n type: 'FileLocator',\n files: filtered,\n projectData,\n };\n\n if (archestProject) {\n Object.defineProperty(result, 'archestProject', {\n value: archestProject,\n enumerable: false,\n });\n }\n\n return result;\n}\n","import type { RuleResult } from '../types';\nimport type { FunctionLocatorData } from './types';\n\nexport function functionCheckHaveExplicitReturnType(\n locator: FunctionLocatorData,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n for (const f of locator.functions) {\n const name = f.name || 'Anonymous Function';\n const hasType = f.has_explicit_return_type;\n\n if (isNot && hasType) {\n violations.push(\n `Function ${name} has an explicit return type, but it shouldn't.`,\n );\n } else if (!isNot && !hasType) {\n violations.push(\n `Function ${name} does not have an explicit return type, but it should.`,\n );\n }\n }\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import { sharedCheckHaveMaxCyclomaticComplexity } from '../shared/sharedCheckHaveMaxCyclomaticComplexity';\nimport type { RuleResult } from '../types';\nimport type { FunctionLocatorData } from './types';\n\nexport function functionCheckHaveMaxCyclomaticComplexity(\n locator: FunctionLocatorData,\n max: number,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveMaxCyclomaticComplexity(\n locator.functions,\n (f) => f.name,\n (f) => f.cyclomatic_complexity || 0,\n 'Function',\n max,\n isNot,\n );\n}\n","import { sharedCheckHaveMinMaintainabilityIndex } from '../shared/sharedCheckHaveMinMaintainabilityIndex';\nimport type { RuleResult } from '../types';\nimport type { FunctionLocatorData } from './types';\n\nexport function functionCheckHaveMinMaintainabilityIndex(\n locator: FunctionLocatorData,\n min: number,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveMinMaintainabilityIndex(\n locator.functions,\n (f) => f.name,\n (f) => f.maintainability_index || 100,\n 'Function',\n min,\n isNot,\n );\n}\n","import { sharedCheckHaveModifier } from '../shared/sharedCheckHaveModifier';\nimport type { RuleResult } from '../types';\nimport type { FunctionLocatorData } from './types';\n\nexport function functionCheckHaveModifier(\n locator: FunctionLocatorData,\n modifierStr: string,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveModifier(\n locator.functions,\n (f) => f.name,\n 'Function',\n modifierStr,\n isNot,\n );\n}\n","import { sharedCheckHaveNameMatchingFileName } from '../shared/sharedCheckHaveNameMatchingFileName';\nimport type { RuleResult } from '../types';\nimport type { FunctionLocatorData } from './types';\n\nexport function functionCheckHaveNameMatchingFileName(\n locator: FunctionLocatorData,\n isNot: boolean,\n): RuleResult {\n return sharedCheckHaveNameMatchingFileName(\n locator.functions,\n (f) => f.name,\n 'Function',\n isNot,\n );\n}\n","import { sharedCheckMatchNamePattern } from '../shared/sharedCheckMatchNamePattern';\nimport type { RuleResult } from '../types';\nimport type { FunctionLocatorData } from './types';\n\nexport function functionCheckMatchNamePattern(\n locator: FunctionLocatorData,\n pattern: string | RegExp,\n isNot: boolean,\n): RuleResult {\n return sharedCheckMatchNamePattern(\n locator.functions,\n (f) => f.name,\n 'Function',\n pattern,\n isNot,\n );\n}\n","import type { FunctionData, ProjectData } from '../dto';\nimport type { FunctionLocatorData, FunctionQueryOptions } from './types';\n\nexport function locateFunctions(\n functions: (FunctionData & { _filePath: string })[],\n projectData: ProjectData,\n options?: FunctionQueryOptions,\n): FunctionLocatorData {\n let filtered = functions;\n\n if (options?.inFolder) {\n filtered = filtered.filter((f) => {\n return (\n f._filePath.includes(`/${options.inFolder}/`) ||\n f._filePath.includes(`\\\\${options.inFolder}\\\\`)\n );\n });\n }\n\n if (options?.matchNamePattern) {\n const regex =\n typeof options.matchNamePattern === 'string'\n ? new RegExp(options.matchNamePattern)\n : options.matchNamePattern;\n filtered = filtered.filter((f) => {\n return f.name && regex.test(f.name);\n });\n }\n\n if (options?.isTopLevel) {\n filtered = filtered.filter((f) => f.is_top_level);\n }\n\n return {\n type: 'FunctionLocator',\n functions: filtered,\n projectData,\n };\n}\n","import type { RuleResult } from '../types';\nimport type { LayeredArchitectureData } from './types';\n\nexport function checkLayeredArchitecture(\n data: LayeredArchitectureData,\n): RuleResult {\n const violations: string[] = [];\n for (const assertion of data.assertions) {\n violations.push(...assertion(data.files));\n }\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import type { FileData, ProjectData } from '../dto';\nimport type { LayeredArchitectureData } from './types';\n\nexport function createLayeredArchitecture(\n files: FileData[],\n projectData: ProjectData,\n): LayeredArchitectureData {\n return {\n type: 'LayeredArchitecture',\n files,\n layers: new Map<string, string>(),\n assertions: [],\n projectData,\n };\n}\n","import type { LayeredArchitectureData } from './types';\n\nexport function layer(\n data: LayeredArchitectureData,\n name: string,\n folderPattern: string,\n): LayeredArchitectureData {\n data.layers.set(name, folderPattern);\n return data;\n}\n","import type { FileData, ProjectData } from '../dto';\n\nexport function getLayerDependencies(\n sourceFile: FileData,\n projectData: ProjectData,\n): string[] {\n return sourceFile.dependencies || [];\n}\n","import { getLayerDependencies } from './getLayerDependencies';\nimport type { LayeredArchitectureData } from './types';\n\nexport function layerShouldNotBeAccessedByAnyLayer(\n data: LayeredArchitectureData,\n targetLayer: string,\n): LayeredArchitectureData {\n if (!data.layers.has(targetLayer)) {\n throw new Error(`Layer ${targetLayer} is not defined`);\n }\n\n data.assertions.push((files) => {\n const violations: string[] = [];\n // biome-ignore lint/style/noNonNullAssertion: Safe map lookup\n const targetPattern = data.layers.get(targetLayer)!;\n\n for (const file of files) {\n const filePath = file.path;\n if (\n !filePath.includes(`/${targetPattern}/`) &&\n !filePath.includes(`\\\\${targetPattern}\\\\`)\n ) {\n const dependencies = getLayerDependencies(file, data.projectData);\n const importsTarget = dependencies.some(\n (dep) =>\n dep.includes(`/${targetPattern}/`) ||\n dep.includes(`\\\\${targetPattern}\\\\`),\n );\n if (importsTarget) {\n violations.push(\n `File ${filePath} accesses layer ${targetLayer} but it shouldn't.`,\n );\n }\n }\n }\n return violations;\n });\n\n return data;\n}\n","import { getLayerDependencies } from './getLayerDependencies';\nimport type { LayeredArchitectureData } from './types';\n\nexport function layerShouldOnlyBeAccessedBy(\n data: LayeredArchitectureData,\n targetLayer: string,\n allowedLayers: string[],\n): LayeredArchitectureData {\n if (!data.layers.has(targetLayer)) {\n throw new Error(`Layer ${targetLayer} is not defined`);\n }\n\n data.assertions.push((files) => {\n const violations: string[] = [];\n // biome-ignore lint/style/noNonNullAssertion: Safe map lookup\n const targetPattern = data.layers.get(targetLayer)!;\n // biome-ignore lint/style/noNonNullAssertion: Safe map lookup\n const allowedPatterns = allowedLayers.map((l) => data.layers.get(l)!);\n\n for (const file of files) {\n const filePath = file.path;\n const isInAllowedLayer = allowedPatterns.some(\n (p) => filePath.includes(`/${p}/`) || filePath.includes(`\\\\${p}\\\\`),\n );\n\n if (\n !filePath.includes(`/${targetPattern}/`) &&\n !filePath.includes(`\\\\${targetPattern}\\\\`) &&\n !isInAllowedLayer\n ) {\n const dependencies = getLayerDependencies(file, data.projectData);\n const importsTarget = dependencies.some(\n (dep) =>\n dep.includes(`/${targetPattern}/`) ||\n dep.includes(`\\\\${targetPattern}\\\\`),\n );\n if (importsTarget) {\n violations.push(\n `File ${filePath} accesses layer ${targetLayer} but only ${allowedLayers.join(', ')} are allowed.`,\n );\n }\n }\n }\n return violations;\n });\n\n return data;\n}\n","import type { ProjectData, PropertyData } from '../dto';\nimport type { PropertyLocatorData, PropertyQueryOptions } from './types';\n\nexport function locateProperties(\n properties: (PropertyData & { _filePath: string })[],\n projectData: ProjectData,\n options?: PropertyQueryOptions,\n): PropertyLocatorData {\n let filtered = properties;\n\n if (options?.inFolder) {\n filtered = filtered.filter((p) => {\n return (\n p._filePath.includes(`/${options.inFolder}/`) ||\n p._filePath.includes(`\\\\${options.inFolder}\\\\`)\n );\n });\n }\n\n if (options?.matchNamePattern) {\n const regex =\n typeof options.matchNamePattern === 'string'\n ? new RegExp(options.matchNamePattern)\n : options.matchNamePattern;\n filtered = filtered.filter((p) => {\n return regex.test(p.name);\n });\n }\n\n return {\n type: 'PropertyLocator',\n properties: filtered,\n projectData,\n };\n}\n","import type { FileData, ProjectData } from '../dto';\nimport type { SliceLocatorData } from './types';\n\nexport function locateSlices(\n sourceFiles: FileData[],\n projectData: ProjectData,\n pattern: string,\n): SliceLocatorData {\n const escaped = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regexStr = escaped.replace(/\\*/g, '([^/\\\\\\\\]+)');\n const slicePattern = new RegExp(regexStr);\n\n const sliceIds = new Set<string>();\n const sliceFiles = new Map<string, FileData[]>();\n\n for (const sf of sourceFiles) {\n const match = sf.path.match(slicePattern);\n if (match?.[1]) {\n const sliceId = match[1];\n sliceIds.add(sliceId);\n if (!sliceFiles.has(sliceId)) {\n sliceFiles.set(sliceId, []);\n }\n sliceFiles.get(sliceId)?.push(sf);\n }\n }\n\n return {\n type: 'SliceLocator',\n slicePattern,\n sliceIds,\n sliceFiles,\n projectData,\n };\n}\n","import { dirname } from 'node:path';\nimport { ArchestProject } from '@archest/core-rust';\nimport * as ts from 'typescript';\nimport { locateClasses } from '../classes/locateClasses';\nimport type { ClassQueryOptions } from '../classes/types';\nimport type { ProjectData } from '../dto';\nimport { locateFiles } from '../files/locateFiles';\nimport type { FileQueryOptions } from '../files/types';\nimport { locateFunctions } from '../functions/locateFunctions';\nimport type { FunctionQueryOptions } from '../functions/types';\nimport { checkLayeredArchitecture } from '../layers/checkLayeredArchitecture';\nimport { createLayeredArchitecture } from '../layers/createLayeredArchitecture';\nimport { layer } from '../layers/layer';\nimport { layerShouldNotBeAccessedByAnyLayer } from '../layers/layerShouldNotBeAccessedByAnyLayer';\nimport { layerShouldOnlyBeAccessedBy } from '../layers/layerShouldOnlyBeAccessedBy';\nimport { locateProperties } from '../properties/locateProperties';\nimport type { PropertyQueryOptions } from '../properties/types';\nimport { locateSlices } from '../slices/locateSlices';\n\n/**\n * Options to configure how the project is parsed and analyzed.\n */\nexport interface ParseProjectOptions {\n /**\n * An optional absolute path to a specific tsconfig.json file.\n * If omitted, Archest will attempt to find the nearest tsconfig.json in the current working directory.\n */\n tsConfigFilePath?: string;\n /** An array of glob patterns specifying which files to include in the AST parsing. Overrides the tsconfig.json `include` array. */\n include?: string[];\n /** An array of glob patterns specifying which files to exclude from the AST parsing. Overrides the tsconfig.json `exclude` array. */\n exclude?: string[];\n}\n\n/**\n * The primary entry point for Archest. Parses a TypeScript or JavaScript project into a searchable\n * Abstract Syntax Tree (AST) using the high-performance native Rust engine.\n *\n * @param options - Optional configuration for locating the tsconfig and filtering files.\n * @returns A fluent API object containing Locators used to query the project's architecture.\n *\n * @example\n * ```typescript\n * import { parseProject } from '@archest/vitest';\n *\n * const project = parseProject({\n * include: ['src/domain/**\\/*.ts'],\n * exclude: ['**\\/*.test.ts']\n * });\n *\n * const domainFiles = project.getFiles();\n * ```\n */\nexport function parseProject(options: ParseProjectOptions = {}) {\n const configPath =\n options.tsConfigFilePath ||\n ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'tsconfig.json');\n\n if (!configPath) {\n throw new Error('Could not find tsconfig.json');\n }\n\n const projectDir = dirname(configPath);\n\n const configFile = ts.readConfigFile(configPath, ts.sys.readFile);\n if (options.include) configFile.config.include = options.include;\n if (options.exclude) configFile.config.exclude = options.exclude;\n\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n projectDir,\n undefined,\n configPath,\n undefined,\n [\n {\n extension: '.vue',\n isMixedContent: true,\n scriptKind: ts.ScriptKind.TS,\n },\n {\n extension: '.svelte',\n isMixedContent: true,\n scriptKind: ts.ScriptKind.TS,\n },\n ],\n );\n\n const archestProject = ArchestProject.parse(parsedCommandLine.fileNames);\n const projectData: ProjectData = JSON.parse(archestProject.getProjectData());\n\n return {\n projectData,\n getFiles: (queryOptions?: FileQueryOptions) => {\n return locateFiles(\n projectData.files,\n projectData,\n archestProject,\n queryOptions,\n );\n },\n\n getClasses: (queryOptions?: ClassQueryOptions) => {\n const allClasses = projectData.files.flatMap((f) =>\n f.classes.map((c) => ({ ...c, _filePath: f.path })),\n );\n return locateClasses(allClasses, projectData, queryOptions);\n },\n\n layeredArchitecture: () => {\n let data = createLayeredArchitecture(projectData.files, projectData);\n const api = {\n layer: (name: string, folderPattern: string) => {\n data = layer(data, name, folderPattern);\n return api;\n },\n whereLayer: (name: string) => {\n return {\n shouldNotBeAccessedByAnyLayer: () => {\n data = layerShouldNotBeAccessedByAnyLayer(data, name);\n return api;\n },\n shouldOnlyBeAccessedBy: (...allowedLayers: string[]) => {\n data = layerShouldOnlyBeAccessedBy(data, name, allowedLayers);\n return api;\n },\n };\n },\n check: () => checkLayeredArchitecture(data),\n get data() {\n return data;\n },\n };\n return api;\n },\n\n getFunctions: (queryOptions?: FunctionQueryOptions) => {\n const allFunctions = projectData.files.flatMap((f) =>\n f.functions.map((fn) => ({ ...fn, _filePath: f.path })),\n );\n return locateFunctions(allFunctions, projectData, queryOptions);\n },\n\n getProperties: (queryOptions?: PropertyQueryOptions) => {\n const allProperties = projectData.files.flatMap((f) =>\n f.properties.map((p) => ({ ...p, _filePath: f.path })),\n );\n return locateProperties(allProperties, projectData, queryOptions);\n },\n\n getSlices: (pattern: string) => {\n return locateSlices(projectData.files, projectData, pattern);\n },\n };\n}\n","import type { RuleResult } from '../types';\nimport type { PropertyLocatorData } from './types';\n\nexport function propertyCheckBeReadonly(\n locator: PropertyLocatorData,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n for (const p of locator.properties) {\n const name = p.name || 'Anonymous Property';\n const matches = p.is_readonly;\n\n if (isNot && matches) {\n violations.push(`Property ${name} is readonly, but it shouldn't be.`);\n } else if (!isNot && !matches) {\n violations.push(`Property ${name} is not readonly, but it should be.`);\n }\n }\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n}\n","import type { RuleResult } from '../types';\nimport type { SliceLocatorData } from './types';\n\nexport function sliceCheckBeFreeOfCycles(\n locator: SliceLocatorData,\n isNot: boolean,\n): RuleResult {\n const graph: Map<string, Set<string>> = new Map();\n for (const slice of locator.sliceIds) {\n graph.set(slice, new Set());\n }\n\n for (const [sliceId, files] of locator.sliceFiles.entries()) {\n for (const sf of files) {\n if (!sf.dependencies) continue;\n for (const importPath of sf.dependencies) {\n const targetMatch = importPath.match(locator.slicePattern);\n if (targetMatch?.[1]) {\n const targetSlice = targetMatch[1];\n if (targetSlice !== sliceId && locator.sliceIds.has(targetSlice)) {\n graph.get(sliceId)?.add(targetSlice);\n }\n }\n }\n }\n }\n\n const visited = new Set<string>();\n const recursionStack = new Set<string>();\n const violations: string[] = [];\n\n const dfs = (node: string, path: string[]): boolean => {\n visited.add(node);\n recursionStack.add(node);\n\n for (const neighbor of graph.get(node) || []) {\n if (!visited.has(neighbor)) {\n if (dfs(neighbor, [...path, neighbor])) return true;\n } else if (recursionStack.has(neighbor)) {\n violations.push(\n `Cycle detected between slices: ${path.join(' -> ')} -> ${neighbor}`,\n );\n return true;\n }\n }\n\n recursionStack.delete(node);\n return false;\n };\n\n for (const slice of locator.sliceIds) {\n if (!visited.has(slice)) {\n dfs(slice, [slice]);\n }\n }\n\n if (isNot) {\n return {\n pass: violations.length > 0,\n message: () =>\n violations.length > 0\n ? ''\n : 'Expected cycles between slices but found none.',\n };\n } else {\n return {\n pass: violations.length === 0,\n message: () => violations.join('\\n'),\n };\n }\n}\n","import type { RuleResult } from '../types';\nimport type { SliceLocatorData } from './types';\n\nexport function sliceCheckHaveMaxDistanceFromMainSequence(\n locator: SliceLocatorData,\n max: number,\n isNot: boolean,\n): RuleResult {\n const violations: string[] = [];\n\n const ceMap = new Map<string, Set<string>>(); // Slices this slice depends on\n const caMap = new Map<string, Set<string>>(); // Slices depending on this slice\n\n for (const slice of locator.sliceIds) {\n ceMap.set(slice, new Set());\n caMap.set(slice, new Set());\n }\n\n for (const [sliceId, files] of locator.sliceFiles.entries()) {\n for (const sf of files) {\n if (!sf.dependencies) continue;\n for (const importPath of sf.dependencies) {\n const targetMatch = importPath.match(locator.slicePattern);\n if (targetMatch?.[1]) {\n const targetSlice = targetMatch[1];\n if (targetSlice !== sliceId && locator.sliceIds.has(targetSlice)) {\n ceMap.get(sliceId)?.add(targetSlice);\n caMap.get(targetSlice)?.add(sliceId);\n }\n }\n }\n }\n }\n\n for (const sliceId of locator.sliceIds) {\n const ce = ceMap.get(sliceId)?.size || 0;\n const ca = caMap.get(sliceId)?.size || 0;\n\n // biome-ignore lint/style/noNonNullAssertion: Safe map lookup\n const files = locator.sliceFiles.get(sliceId)!;\n let na = 0; // abstract classes + interfaces\n let nc = 0; // all classes + interfaces\n\n for (const sf of files) {\n for (const c of sf.classes) {\n nc++;\n if (c.is_abstract) {\n na++;\n }\n }\n }\n\n const I = ce + ca === 0 ? 0 : ce / (ca + ce);\n const A = nc === 0 ? 0 : na / nc;\n\n const D = Math.abs(A + I - 1);\n const exceeds = D > max;\n\n if (isNot && exceeds) {\n violations.push(\n `Slice ${sliceId} has a Distance from the Main Sequence of ${D.toFixed(2)}, which exceeds the maximum of ${max}, but it shouldn't.`,\n );\n } else if (!isNot && exceeds) {\n violations.push(\n `Slice ${sliceId} has a Distance from the Main Sequence of ${D.toFixed(2)}, which exceeds the maximum of ${max}.`,\n );\n }\n }\n\n return {\n pass: isNot ? violations.length > 0 : violations.length === 0,\n message: () =>\n violations.join('\\n') ||\n (isNot\n ? 'Expected some slices to exceed maximum distance from main sequence, but none did.'\n : ''),\n };\n}\n","import { ArchestProject } from '@archest/core-rust';\nimport * as ts from 'typescript';\n\nimport type {\n ClassData,\n FileData,\n FunctionData,\n ProjectData,\n PropertyData,\n} from './dto';\n\nexport function createSourceFile(\n code: string,\n fileName = 'test.ts',\n): ts.SourceFile {\n return ts.createSourceFile(fileName, code, ts.ScriptTarget.Latest, true);\n}\n\nexport function createMockProgram(sourceFiles: ts.SourceFile[]): ProjectData {\n return {\n files: sourceFiles.map((sf) => ({\n path: sf.fileName,\n classes: getClasses(sf),\n functions: getFunctions(sf),\n properties: getProperties(sf),\n })),\n };\n}\n\nexport function createMockArchestProject(\n projectData: ProjectData,\n): ArchestProject {\n return ArchestProject.parseMock(JSON.stringify(projectData));\n}\n\nexport function getClasses(\n sourceFile: ts.SourceFile,\n): (ClassData & { _filePath: string })[] {\n const classes: (ClassData & { _filePath: string })[] = [];\n ts.forEachChild(sourceFile, (node) => {\n if (ts.isClassDeclaration(node)) {\n let extendsName: string | null = null;\n const implementsNames: string[] = [];\n if (node.heritageClauses) {\n for (const clause of node.heritageClauses) {\n if (clause.token === ts.SyntaxKind.ExtendsKeyword) {\n for (const t of clause.types) {\n if (ts.isIdentifier(t.expression))\n extendsName = t.expression.text;\n }\n }\n if (clause.token === ts.SyntaxKind.ImplementsKeyword) {\n for (const t of clause.types) {\n if (ts.isIdentifier(t.expression))\n implementsNames.push(t.expression.text);\n }\n }\n }\n }\n\n const decorators: string[] = [];\n if (ts.canHaveDecorators(node)) {\n const decs = ts.getDecorators(node);\n if (decs) {\n for (const d of decs) {\n if (ts.isIdentifier(d.expression))\n decorators.push(d.expression.text);\n else if (\n ts.isCallExpression(d.expression) &&\n ts.isIdentifier(d.expression.expression)\n )\n decorators.push(d.expression.expression.text);\n }\n }\n }\n\n classes.push({\n name: node.name?.text || null,\n is_exported: ts.canHaveModifiers(node)\n ? ts\n .getModifiers(node)\n ?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword) || false\n : false,\n is_default: ts.canHaveModifiers(node)\n ? ts\n .getModifiers(node)\n ?.some((m) => m.kind === ts.SyntaxKind.DefaultKeyword) || false\n : false,\n is_abstract: ts.canHaveModifiers(node)\n ? ts\n .getModifiers(node)\n ?.some((m) => m.kind === ts.SyntaxKind.AbstractKeyword) || false\n : false,\n extends: extendsName,\n implements: implementsNames,\n decorators,\n _filePath: sourceFile.fileName,\n });\n }\n });\n return classes;\n}\n\nexport function getFunctions(\n sourceFile: ts.SourceFile,\n): (FunctionData & { _filePath: string })[] {\n const functions: (FunctionData & { _filePath: string })[] = [];\n ts.forEachChild(sourceFile, (node) => {\n if (\n ts.isFunctionDeclaration(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isArrowFunction(node)\n ) {\n let name: string | null = null;\n if (ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node)) {\n name = node.name?.getText() || null;\n }\n\n functions.push({\n name,\n is_exported: ts.canHaveModifiers(node)\n ? ts\n .getModifiers(node)\n ?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword) || false\n : false,\n is_async: ts.canHaveModifiers(node)\n ? ts\n .getModifiers(node)\n ?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword) || false\n : false,\n is_top_level: true,\n has_explicit_return_type: !!(node as any).type,\n _filePath: sourceFile.fileName,\n });\n }\n });\n return functions;\n}\n\nexport function getProperties(\n sourceFile: ts.SourceFile,\n): (PropertyData & { _filePath: string })[] {\n const properties: (PropertyData & { _filePath: string })[] = [];\n ts.forEachChild(sourceFile, (node) => {\n if (ts.isClassDeclaration(node)) {\n node.members.forEach((member) => {\n if (ts.isPropertyDeclaration(member)) {\n properties.push({\n name: member.name.getText(),\n is_readonly: ts.canHaveModifiers(member)\n ? ts\n .getModifiers(member)\n ?.some((m) => m.kind === ts.SyntaxKind.ReadonlyKeyword) ||\n false\n : false,\n _filePath: sourceFile.fileName,\n });\n }\n });\n }\n });\n return properties;\n}\n"],"mappings":";;;;;AAGA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAuB,EAAE;AAC/B,MAAK,IAAM,KAAK,EAAQ,SAAS;EAC/B,IAAM,IAAO,EAAE,QAAQ,aACnB,IAAU;AAId,EAHI,EAAE,YAAY,MAChB,IAAU,KAER,KAAS,IACX,EAAW,KAAK,SAAS,EAAK,WAAW,EAAU,qBAAqB,GAC/D,CAAC,KAAS,CAAC,KACpB,EAAW,KACT,SAAS,EAAK,mBAAmB,EAAU,kBAC5C;;AAGL,QAAO;EACL,MAAM,EAAW,WAAW;EAC5B,eAAe,EAAW,KAAK,KAAK;EACrC;;;;ACxBH,SAAgB,EACd,GACA,GACA,GAKY;CACZ,IAAM,IAAuB,EAAE;AAE/B,MAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,EAAE,WAAQ,gBAAa,sBAAmB,EAAS,EAAK;AAE9D,EAAI,KAAS,IACP,KAAgB,EAAW,KAA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1C,IAAM,IAAsD,EAAE;AA8B9D,QA7BA,EAAG,aAAa,IAAa,MAAS;AACpC,MACE,EAAG,sBAAsB,EAAK,IAC9B,EAAG,oBAAoB,EAAK,IAC5B,EAAG,gBAAgB,EAAK,EACxB;GACA,IAAI,IAAsB;AAK1B,IAJI,EAAG,sBAAsB,EAAK,IAAI,EAAG,oBAAoB,EAAK,MAChE,IAAO,EAAK,MAAM,SAAS,IAAI,OAGjC,EAAU,KAAK;IACb;IACA,aAAa,EAAG,iBAAiB,EAAK,IAClC,EACG,aAAa,EAAK,EACjB,MAAM,MAAM,EAAE,SAAS,EAAG,WAAW,cAAc,IACvD;IACJ,UAAU,EAAG,iBAAiB,EAAK,IAC/B,EACG,aAAa,EAAK,EACjB,MAAM,MAAM,EAAE,SAAS,EAAG,WAAW,aAAa,IACtD;IACJ,cAAc;IACd,0BAA0B,CAAC,CAAE,EAAa;IAC1C,WAAW,EAAW;IACvB,CAAC;;GAEJ,EACK;;AAGT,SAAgB,EACd,GAC0C;CAC1C,IAAM,IAAuD,EAAE;AAmB/D,QAlBA,EAAG,aAAa,IAAa,MAAS;AACpC,EAAI,EAAG,mBAAmB,EAAK,IAC7B,EAAK,QAAQ,SAAS,MAAW;AAC/B,GAAI,EAAG,sBAAsB,EAAO,IAClC,EAAW,KAAK;IACd,MAAM,EAAO,KAAK,SAAS;IAC3B,aAAa,EAAG,iBAAiB,EAAO,IACpC,EACG,aAAa,EAAO,EACnB,MAAM,MAAM,EAAE,SAAS,EAAG,WAAW,gBAAgB,IAEzD;IACJ,WAAW,EAAW;IACvB,CAAC;IAEJ;GAEJ,EACK"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ClassQueryOptions } from '../classes/types';
|
|
2
|
+
import { ProjectData } from '../dto';
|
|
3
|
+
import { FileQueryOptions } from '../files/types';
|
|
4
|
+
import { FunctionQueryOptions } from '../functions/types';
|
|
5
|
+
import { PropertyQueryOptions } from '../properties/types';
|
|
6
|
+
/**
|
|
7
|
+
* Options to configure how the project is parsed and analyzed.
|
|
8
|
+
*/
|
|
9
|
+
export interface ParseProjectOptions {
|
|
10
|
+
/**
|
|
11
|
+
* An optional absolute path to a specific tsconfig.json file.
|
|
12
|
+
* If omitted, Archest will attempt to find the nearest tsconfig.json in the current working directory.
|
|
13
|
+
*/
|
|
14
|
+
tsConfigFilePath?: string;
|
|
15
|
+
/** An array of glob patterns specifying which files to include in the AST parsing. Overrides the tsconfig.json `include` array. */
|
|
16
|
+
include?: string[];
|
|
17
|
+
/** An array of glob patterns specifying which files to exclude from the AST parsing. Overrides the tsconfig.json `exclude` array. */
|
|
18
|
+
exclude?: string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The primary entry point for Archest. Parses a TypeScript or JavaScript project into a searchable
|
|
22
|
+
* Abstract Syntax Tree (AST) using the high-performance native Rust engine.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration for locating the tsconfig and filtering files.
|
|
25
|
+
* @returns A fluent API object containing Locators used to query the project's architecture.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { parseProject } from '@archest/vitest';
|
|
30
|
+
*
|
|
31
|
+
* const project = parseProject({
|
|
32
|
+
* include: ['src/domain/**\/*.ts'],
|
|
33
|
+
* exclude: ['**\/*.test.ts']
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* const domainFiles = project.getFiles();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseProject(options?: ParseProjectOptions): {
|
|
40
|
+
projectData: ProjectData;
|
|
41
|
+
getFiles: (queryOptions?: FileQueryOptions) => import('../files/types').FileLocatorData;
|
|
42
|
+
getClasses: (queryOptions?: ClassQueryOptions) => import('../classes/types').ClassLocatorData;
|
|
43
|
+
layeredArchitecture: () => {
|
|
44
|
+
layer: (name: string, folderPattern: string) => /*elided*/ any;
|
|
45
|
+
whereLayer: (name: string) => {
|
|
46
|
+
shouldNotBeAccessedByAnyLayer: () => /*elided*/ any;
|
|
47
|
+
shouldOnlyBeAccessedBy: (...allowedLayers: string[]) => /*elided*/ any;
|
|
48
|
+
};
|
|
49
|
+
check: () => import('..').RuleResult;
|
|
50
|
+
readonly data: import('..').LayeredArchitectureData;
|
|
51
|
+
};
|
|
52
|
+
getFunctions: (queryOptions?: FunctionQueryOptions) => import('../functions/types').FunctionLocatorData;
|
|
53
|
+
getProperties: (queryOptions?: PropertyQueryOptions) => import('../properties/types').PropertyLocatorData;
|
|
54
|
+
getSlices: (pattern: string) => import('..').SliceLocatorData;
|
|
55
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ProjectData, PropertyData } from '../dto';
|
|
2
|
+
import { PropertyLocatorData, PropertyQueryOptions } from './types';
|
|
3
|
+
export declare function locateProperties(properties: (PropertyData & {
|
|
4
|
+
_filePath: string;
|
|
5
|
+
})[], projectData: ProjectData, options?: PropertyQueryOptions): PropertyLocatorData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProjectData, PropertyData } from '../dto';
|
|
2
|
+
export interface PropertyLocatorData {
|
|
3
|
+
type: 'PropertyLocator';
|
|
4
|
+
properties: (PropertyData & {
|
|
5
|
+
_filePath: string;
|
|
6
|
+
})[];
|
|
7
|
+
projectData: ProjectData;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Options to filter class properties or interface members when querying the AST via `getProperties()`.
|
|
11
|
+
*/
|
|
12
|
+
export interface PropertyQueryOptions {
|
|
13
|
+
/** Filters properties to only include those residing in a specific folder path. */
|
|
14
|
+
inFolder?: string;
|
|
15
|
+
/** Filters properties by a string or RegExp matching their name. */
|
|
16
|
+
matchNamePattern?: string | RegExp;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sharedCheckHaveMaxCyclomaticComplexity<T>(items: T[], getName: (item: T) => string | undefined | null, getComplexity: (item: T) => number, label: string, max: number, isNot: boolean): import('..').RuleResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sharedCheckHaveMinMaintainabilityIndex<T>(items: T[], getName: (item: T) => string | undefined | null, getMi: (item: T) => number, label: string, min: number, isNot: boolean): import('..').RuleResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function sharedCheckHaveModifier<T extends {
|
|
2
|
+
is_exported?: boolean;
|
|
3
|
+
is_default?: boolean;
|
|
4
|
+
is_abstract?: boolean;
|
|
5
|
+
is_async?: boolean;
|
|
6
|
+
is_readonly?: boolean;
|
|
7
|
+
}>(items: T[], getName: (item: T) => string | null | undefined, label: string, modifierStr: string, isNot: boolean): import('..').RuleResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sharedCheckMatchNamePattern<T>(items: T[], getName: (item: T) => string | undefined | null, label: string, pattern: string | RegExp, isNot: boolean): import('..').RuleResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ClassLocatorData } from './classes/types';
|
|
2
|
+
import { FileLocatorData } from './files/types';
|
|
3
|
+
import { FunctionLocatorData } from './functions/types';
|
|
4
|
+
import { LayeredArchitectureData } from './layers/types';
|
|
5
|
+
import { PropertyLocatorData } from './properties/types';
|
|
6
|
+
import { SliceLocatorData } from './slices/types';
|
|
7
|
+
export interface RuleResult {
|
|
8
|
+
pass: boolean;
|
|
9
|
+
message: () => string;
|
|
10
|
+
}
|
|
11
|
+
export type LocatorData = FileLocatorData | ClassLocatorData | FunctionLocatorData | PropertyLocatorData | SliceLocatorData | LayeredArchitectureData;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@archest/core",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/hinterdupfinger/archest.git"
|
|
7
|
+
},
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/hinterdupfinger/archest/issues"
|
|
10
|
+
},
|
|
11
|
+
"description": "Core architecture unit test logic for Archest",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"require": "./dist/index.js",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "vite build",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:watch": "vitest"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"architecture",
|
|
32
|
+
"testing",
|
|
33
|
+
"typescript"
|
|
34
|
+
],
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^25.6.0",
|
|
39
|
+
"vite": "^8.0.10",
|
|
40
|
+
"vite-plugin-dts": "^5.0.0",
|
|
41
|
+
"vitest": "^4.1.5"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"typescript": "^5.x || ^6.x"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@archest/core-rust": "workspace:*"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
export interface NapiRuleResult {
|
|
7
|
+
pass: boolean
|
|
8
|
+
message: string
|
|
9
|
+
}
|
|
10
|
+
export declare function parseProjectRust(files: Array<string>): string
|
|
11
|
+
export declare class ArchestProject {
|
|
12
|
+
static parse(files: Array<string>): ArchestProject
|
|
13
|
+
static parseMock(projectDataJson: string): ArchestProject
|
|
14
|
+
getProjectData(): string
|
|
15
|
+
checkFileCycles(locatorFiles: Array<string>, isNot: boolean): NapiRuleResult
|
|
16
|
+
}
|