diff --git a/src/config-utl/extract-known-violations.mjs b/src/config-utl/extract-known-violations.mjs index b741b9733..01d40402c 100644 --- a/src/config-utl/extract-known-violations.mjs +++ b/src/config-utl/extract-known-violations.mjs @@ -20,8 +20,9 @@ import makeAbsolute from "./make-absolute.mjs"; * @returns {IViolation} */ function makeForwardCompatible(pKnownViolation) { + let lReturnValue = pKnownViolation; if (Boolean(pKnownViolation.cycle)) { - return { + lReturnValue = { ...pKnownViolation, cycle: pKnownViolation.cycle.map((pModule) => { if (Boolean(pModule.name)) { @@ -34,7 +35,21 @@ function makeForwardCompatible(pKnownViolation) { }), }; } - return pKnownViolation; + if (Boolean(pKnownViolation.via)) { + lReturnValue = { + ...pKnownViolation, + via: pKnownViolation.via.map((pModule) => { + if (Boolean(pModule.name)) { + return pModule; + } + return { + name: pModule, + dependencyTypes: [], + }; + }), + }; + } + return lReturnValue; } export default async function extractKnownViolations(pKnownViolationsFileName) { diff --git a/src/enrich/derive/reachable.mjs b/src/enrich/derive/reachable.mjs index fba70704f..5fd6e8030 100644 --- a/src/enrich/derive/reachable.mjs +++ b/src/enrich/derive/reachable.mjs @@ -34,19 +34,18 @@ function mergeReachableProperties(pModule, pRule, pPath, pModuleFrom) { const lIndexExistingReachable = lReachables.findIndex( (pReachable) => pReachable.asDefinedInRule === pRule.name, ); - const lIsReachable = pPath.length > 1; + const lIsReachable = pPath.length > 0; if (lIndexExistingReachable > -1) { lReachables[lIndexExistingReachable].value = lReachables[lIndexExistingReachable].value || lIsReachable; return lReachables; - } else { - return lReachables.concat({ - value: lIsReachable, - asDefinedInRule: pRule.name, - matchedFrom: pModuleFrom, - }); } + return lReachables.concat({ + value: lIsReachable, + asDefinedInRule: pRule.name, + matchedFrom: pModuleFrom, + }); } function mergeReachesProperties(pFromModule, pToModule, pRule, pPath) { @@ -63,12 +62,11 @@ function mergeReachesProperties(pFromModule, pToModule, pRule, pPath) { via: pPath, }); return lReaches; - } else { - return lReaches.concat({ - asDefinedInRule: pRule.name, - modules: [{ source: pToModule.source, via: pPath }], - }); } + return lReaches.concat({ + asDefinedInRule: pRule.name, + modules: [{ source: pToModule.source, via: pPath }], + }); } function shouldAddReaches(pRule, pModule) { diff --git a/src/graph-utl/indexed-module-graph.mjs b/src/graph-utl/indexed-module-graph.mjs index ff19c3597..698ab3001 100644 --- a/src/graph-utl/indexed-module-graph.mjs +++ b/src/graph-utl/indexed-module-graph.mjs @@ -139,38 +139,6 @@ export default class IndexedModuleGraph { return lReturnValue; } - /** - * @param {string} pFrom - * @param {string} pTo - * @param {Set} pVisited - * @returns {string[]} - */ - getPath(pFrom, pTo, pVisited = new Set()) { - let lReturnValue = []; - const lFromNode = this.findVertexByName(pFrom); - - pVisited.add(pFrom); - - if (lFromNode) { - const lDirectUnvisitedDependencies = lFromNode.dependencies - .filter((pDependency) => !pVisited.has(pDependency.name)) - .map((pDependency) => pDependency.name); - if (lDirectUnvisitedDependencies.includes(pTo)) { - lReturnValue = [pFrom, pTo]; - } else { - for (const lFrom of lDirectUnvisitedDependencies) { - let lCandidatePath = this.getPath(lFrom, pTo, pVisited); - // eslint-disable-next-line max-depth - if (lCandidatePath.length > 0) { - lReturnValue = [pFrom].concat(lCandidatePath); - break; - } - } - } - } - return lReturnValue; - } - /** * * @param {IEdge} pEdge @@ -185,6 +153,42 @@ export default class IndexedModuleGraph { return lReturnValue; } + /** + * @param {string} pFrom + * @param {string} pTo + * @param {Set} pVisited + * @returns {Array} + */ + getPath(pFrom, pTo, pVisited = new Set()) { + const lFromNode = this.findVertexByName(pFrom); + + pVisited.add(pFrom); + + if (!lFromNode) { + return []; + } + + const lDirectUnvisitedDependencies = lFromNode.dependencies + .filter((pDependency) => !pVisited.has(pDependency.name)) + .map(this.#geldEdge); + const lFoundDependency = lDirectUnvisitedDependencies.find( + (pDependency) => pDependency.name === pTo, + ); + + if (lFoundDependency) { + return [lFoundDependency]; + } + + for (const lNewFrom of lDirectUnvisitedDependencies) { + let lCandidatePath = this.getPath(lNewFrom.name, pTo, pVisited); + + if (lCandidatePath.length > 0) { + return [lNewFrom].concat(lCandidatePath); + } + } + return []; + } + /** * Returns the first non-zero length path from pInitialSource to pInitialSource * Returns the empty array if there is no such path diff --git a/src/report/anon/index.mjs b/src/report/anon/index.mjs index f593ae1b1..44e552a25 100644 --- a/src/report/anon/index.mjs +++ b/src/report/anon/index.mjs @@ -9,10 +9,14 @@ function anonymizePathArray(pPathArray, pWordList) { return (pPathArray || []).map((pPath) => anonymizePath(pPath, pWordList)); } -function anonymizeCycleArray(pCycleArray, pWordList, pAttribute = "name") { - return (pCycleArray || []).map((pCycle) => ({ - ...pCycle, - [pAttribute]: anonymizePath(pCycle.name, pWordList), +function anonymizeMiniDependencyArray( + pMiniDependencyArray, + pWordList, + pAttribute = "name", +) { + return (pMiniDependencyArray || []).map((pMiniDependency) => ({ + ...pMiniDependency, + [pAttribute]: anonymizePath(pMiniDependency.name, pWordList), })); } @@ -21,7 +25,7 @@ function anonymizeDependencies(pDependencies, pWordList) { ...pDependency, resolved: anonymizePath(pDependency.resolved, pWordList), module: anonymizePath(pDependency.module, pWordList), - cycle: anonymizeCycleArray(pDependency.cycle, pWordList), + cycle: anonymizeMiniDependencyArray(pDependency.cycle, pWordList), })); } @@ -29,7 +33,7 @@ function anonymizeReachesModule(pWordList) { return (pModule) => ({ ...pModule, source: anonymizePath(pModule.source, pWordList), - via: anonymizePathArray(pModule.via, pWordList), + via: anonymizeMiniDependencyArray(pModule.via, pWordList), }); } @@ -85,7 +89,7 @@ function anonymizeFolders(pFolders, pWordList) { name: anonymizePath(pDependency.name, pWordList), }; if (lReturnDependencies.cycle) { - lReturnDependencies.cycle = anonymizeCycleArray( + lReturnDependencies.cycle = anonymizeMiniDependencyArray( pDependency.cycle, pWordList, ); @@ -109,10 +113,13 @@ function anonymizeViolations(pViolations, pWordList) { ...pViolation, from: anonymizePath(pViolation.from, pWordList), to: anonymizePath(pViolation.to, pWordList), - cycle: anonymizeCycleArray(pViolation.cycle, pWordList), + cycle: anonymizeMiniDependencyArray(pViolation.cycle, pWordList), }; if (pViolation.via) { - lReturnValue.via = anonymizePathArray(pViolation.via, pWordList); + lReturnValue.via = anonymizeMiniDependencyArray( + pViolation.via, + pWordList, + ); } return lReturnValue; }); diff --git a/src/report/azure-devops.mjs b/src/report/azure-devops.mjs index f2cddf69c..bf48f5a9d 100644 --- a/src/report/azure-devops.mjs +++ b/src/report/azure-devops.mjs @@ -52,9 +52,9 @@ function formatCycleViolation(pViolation) { * @returns {string} */ function formatReachabilityViolation(pViolation) { - return `${pViolation.from} -> ${pViolation.to} (via ${pViolation.via.join( - " -> ", - )})`; + return `${pViolation.from} -> ${pViolation.to} (via ${pViolation.via + .map(({ name }) => name) + .join(" -> ")})`; } /** diff --git a/src/report/error-html/utl.mjs b/src/report/error-html/utl.mjs index 5c8e65e90..07365ed5b 100644 --- a/src/report/error-html/utl.mjs +++ b/src/report/error-html/utl.mjs @@ -34,7 +34,9 @@ function formatCycleTo(pViolation) { } function formatReachabilityTo(pViolation) { - return `${pViolation.to}
${pViolation.via.join(" →
")}`; + return `${pViolation.to}
${pViolation.via + .map(({ name }) => name) + .join(" →
")}`; } function formatDependencyTo(pViolation) { diff --git a/src/report/error.mjs b/src/report/error.mjs index 868de5287..30e25f74f 100644 --- a/src/report/error.mjs +++ b/src/report/error.mjs @@ -17,19 +17,12 @@ const SEVERITY2CHALK = new Map([ const EXTRA_PATH_INFORMATION_INDENT = 6; -function formatExtraCycleInformation(pCycle) { +function formatMiniDependency(pMiniDependency) { return EOL.concat( wrapAndIndent( - pCycle.map(({ name }) => name).join(` ${figures.arrowRight} ${EOL}`), - EXTRA_PATH_INFORMATION_INDENT, - ), - ); -} - -function formatExtraPathInformation(pExtra) { - return EOL.concat( - wrapAndIndent( - pExtra.join(` ${figures.arrowRight} ${EOL}`), + pMiniDependency + .map(({ name }) => name) + .join(` ${figures.arrowRight} ${EOL}`), EXTRA_PATH_INFORMATION_INDENT, ), ); @@ -48,13 +41,13 @@ function formatDependencyViolation(pViolation) { function formatCycleViolation(pViolation) { return `${chalk.bold(pViolation.from)} ${ figures.arrowRight - } ${formatExtraCycleInformation(pViolation.cycle)}`; + } ${formatMiniDependency(pViolation.cycle)}`; } function formatReachabilityViolation(pViolation) { return `${chalk.bold(pViolation.from)} ${figures.arrowRight} ${chalk.bold( pViolation.to, - )}${formatExtraPathInformation(pViolation.via)}`; + )}${formatMiniDependency(pViolation.via)}`; } function formatInstabilityViolation(pViolation) { diff --git a/src/report/teamcity.mjs b/src/report/teamcity.mjs index a4013a884..5997c0241 100644 --- a/src/report/teamcity.mjs +++ b/src/report/teamcity.mjs @@ -81,9 +81,9 @@ function formatCycleViolation(pViolation) { } function formatReachabilityViolation(pViolation) { - return `${formatDependencyViolation(pViolation)} ${pViolation.via.join( - " -> ", - )}`; + return `${formatDependencyViolation(pViolation)} ${pViolation.via + .map(({ name }) => name) + .join(" -> ")}`; } function formatInstabilityViolation(pViolation) { diff --git a/src/schema/baseline-violations.schema.json b/src/schema/baseline-violations.schema.json index 9ffd32d91..11eaa0300 100644 --- a/src/schema/baseline-violations.schema.json +++ b/src/schema/baseline-violations.schema.json @@ -25,7 +25,7 @@ }, "via": { "type": "array", - "items": { "type": "string" }, + "items": { "$ref": "#/definitions/MiniDependency" }, "description": "The path from the from to the to if the violation is transitive" }, "metrics": { diff --git a/src/schema/baseline-violations.schema.mjs b/src/schema/baseline-violations.schema.mjs index 3de7b5782..8bf8f723f 100644 --- a/src/schema/baseline-violations.schema.mjs +++ b/src/schema/baseline-violations.schema.mjs @@ -1 +1 @@ -/* generated - don't edit */export default {"title":"dependency-cruiser baseline ('known errors') format","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://dependency-cruiser.js.org/schema/baseline-violations.schema.json","$ref":"#/definitions/ViolationsType","definitions":{"ViolationsType":{"type":"array","items":{"$ref":"#/definitions/ViolationType"}},"ViolationType":{"type":"object","required":["from","to","rule"],"additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"$ref":"#/definitions/ViolationTypeType"},"rule":{"$ref":"#/definitions/RuleSummaryType"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"via":{"type":"array","items":{"type":"string"}},"metrics":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}},"to":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}}}},"comment":{"type":"string"}}},"RuleSummaryType":{"type":"object","required":["name","severity"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"}}},"SeverityType":{"type":"string","enum":["error","warn","info","ignore"]},"ViolationTypeType":{"type":"string","enum":["dependency","module","reachability","cycle","instability","folder"]},"MiniDependency":{"type":"object","required":["name","dependencyTypes"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"DependencyTypeType":{"type":"string","enum":["aliased-subpath-import","aliased-tsconfig-base-url","aliased-tsconfig-paths","aliased-tsconfig","aliased-webpack","aliased-workspace","aliased","amd-define","amd-require","amd-exotic-require","core","deprecated","dynamic-import","exotic-require","export","import-equals","import","local","localmodule","npm-bundled","npm-dev","npm-no-pkg","npm-optional","npm-peer","npm-unknown","npm","pre-compilation-only","require","triple-slash-amd-dependency","triple-slash-directive","triple-slash-file-reference","triple-slash-type-reference","type-import","type-only","undetermined","unknown"]}}} \ No newline at end of file +/* generated - don't edit */export default {"title":"dependency-cruiser baseline ('known errors') format","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://dependency-cruiser.js.org/schema/baseline-violations.schema.json","$ref":"#/definitions/ViolationsType","definitions":{"ViolationsType":{"type":"array","items":{"$ref":"#/definitions/ViolationType"}},"ViolationType":{"type":"object","required":["from","to","rule"],"additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"$ref":"#/definitions/ViolationTypeType"},"rule":{"$ref":"#/definitions/RuleSummaryType"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"via":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"metrics":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}},"to":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}}}},"comment":{"type":"string"}}},"RuleSummaryType":{"type":"object","required":["name","severity"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"}}},"SeverityType":{"type":"string","enum":["error","warn","info","ignore"]},"ViolationTypeType":{"type":"string","enum":["dependency","module","reachability","cycle","instability","folder"]},"MiniDependency":{"type":"object","required":["name","dependencyTypes"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"DependencyTypeType":{"type":"string","enum":["aliased-subpath-import","aliased-tsconfig-base-url","aliased-tsconfig-paths","aliased-tsconfig","aliased-webpack","aliased-workspace","aliased","amd-define","amd-require","amd-exotic-require","core","deprecated","dynamic-import","exotic-require","export","import-equals","import","local","localmodule","npm-bundled","npm-dev","npm-no-pkg","npm-optional","npm-peer","npm-unknown","npm","pre-compilation-only","require","triple-slash-amd-dependency","triple-slash-directive","triple-slash-file-reference","triple-slash-type-reference","type-import","type-only","undetermined","unknown"]}}} \ No newline at end of file diff --git a/src/schema/configuration.schema.json b/src/schema/configuration.schema.json index 00b6aa710..a75494a46 100644 --- a/src/schema/configuration.schema.json +++ b/src/schema/configuration.schema.json @@ -1040,7 +1040,7 @@ }, "via": { "type": "array", - "items": { "type": "string" }, + "items": { "$ref": "#/definitions/MiniDependency" }, "description": "The path from the from to the to if the violation is transitive" }, "metrics": { diff --git a/src/schema/configuration.schema.mjs b/src/schema/configuration.schema.mjs index cd6515866..9fa1bcaee 100644 --- a/src/schema/configuration.schema.mjs +++ b/src/schema/configuration.schema.mjs @@ -1 +1 @@ -/* generated - don't edit */export default {"title":"dependency-cruiser configuration","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://dependency-cruiser.js.org/schema/configuration.schema.json","type":"object","additionalProperties":false,"properties":{"$schema":{"type":"string"},"forbidden":{"type":"array","items":{"$ref":"#/definitions/ForbiddenRuleType"}},"allowed":{"type":"array","items":{"$ref":"#/definitions/AllowedRuleType"}},"allowedSeverity":{"$ref":"#/definitions/SeverityType"},"required":{"type":"array","items":{"$ref":"#/definitions/RequiredRuleType"}},"options":{"$ref":"#/definitions/OptionsType"},"extends":{"$ref":"#/definitions/ExtendsType"}},"definitions":{"RuleSetType":{"type":"object","additionalProperties":false,"properties":{"forbidden":{"type":"array","items":{"$ref":"#/definitions/ForbiddenRuleType"}},"allowed":{"type":"array","items":{"$ref":"#/definitions/AllowedRuleType"}},"allowedSeverity":{"$ref":"#/definitions/SeverityType"},"required":{"type":"array","items":{"$ref":"#/definitions/RequiredRuleType"}}}},"AllowedRuleType":{"oneOf":[{"$ref":"#/definitions/RegularAllowedRuleType"},{"$ref":"#/definitions/ReachabilityAllowedRuleType"}]},"RegularAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"ReachabilityAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"ForbiddenRuleType":{"oneOf":[{"$ref":"#/definitions/RegularForbiddenRuleType"},{"$ref":"#/definitions/ReachabilityForbiddenRuleType"},{"$ref":"#/definitions/DependentsForbiddenRuleType"}]},"RegularForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"DependentsForbiddenRuleType":{"type":"object","required":["module","from"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/DependentsModuleRestrictionType"},"from":{"$ref":"#/definitions/DependentsFromRestrictionType"}}},"ReachabilityForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"RequiredRuleType":{"type":"object","required":["module","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/RequiredModuleRestrictionType"},"to":{"$ref":"#/definitions/RequiredToRestrictionType"}}},"MiniDependencyRestrictionType":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}}]},"FromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"orphan":{"type":"boolean"}}},"ReachabilityFromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ToRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"couldNotResolve":{"type":"boolean"},"circular":{"type":"boolean"},"dynamic":{"type":"boolean"},"exoticallyRequired":{"type":"boolean"},"exoticRequire":{"$ref":"#/definitions/REAsStringsType"},"exoticRequireNot":{"$ref":"#/definitions/REAsStringsType"},"preCompilationOnly":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"moreThanOneDependencyType":{"type":"boolean"},"license":{"$ref":"#/definitions/REAsStringsType"},"licenseNot":{"$ref":"#/definitions/REAsStringsType"},"via":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaOnly":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"viaSomeNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"moreUnstable":{"type":"boolean"}}},"DependentsModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"numberOfDependentsLessThan":{"type":"integer","minimum":0,"maximum":100},"numberOfDependentsMoreThan":{"type":"integer","minimum":0,"maximum":100}}},"DependentsFromRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ReachabilityToRestrictionType":{"required":["reachable"],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"reachable":{"type":"boolean"}}},"RequiredModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"RequiredToRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"DependencyTypeType":{"type":"string","enum":["aliased-subpath-import","aliased-tsconfig-base-url","aliased-tsconfig-paths","aliased-tsconfig","aliased-webpack","aliased-workspace","aliased","amd-define","amd-require","amd-exotic-require","core","deprecated","dynamic-import","exotic-require","export","import-equals","import","local","localmodule","npm-bundled","npm-dev","npm-no-pkg","npm-optional","npm-peer","npm-unknown","npm","pre-compilation-only","require","triple-slash-amd-dependency","triple-slash-directive","triple-slash-file-reference","triple-slash-type-reference","type-import","type-only","undetermined","unknown"]},"REAsStringsType":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"SeverityType":{"type":"string","enum":["error","warn","info","ignore"]},"OptionsType":{"type":"object","additionalProperties":false,"properties":{"doNotFollow":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundDoNotFollowType"}]},"exclude":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundExcludeType"}]},"includeOnly":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundIncludeOnlyType"}]},"focus":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundFocusType"}]},"reaches":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundReachesType"}]},"highlight":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundHighlightType"}]},"knownViolations":{"$ref":"#/definitions/ViolationsType"},"collapse":{"oneOf":[{"type":"string"},{"type":"integer","minimum":1,"maximum":9}]},"maxDepth":{"type":"integer","minimum":0,"maximum":99},"moduleSystems":{"$ref":"#/definitions/ModuleSystemsType"},"prefix":{"type":"string"},"preserveSymlinks":{"type":"boolean"},"combinedDependencies":{"type":"boolean"},"tsConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"tsPreCompilationDeps":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["specify"]}]},"extraExtensionsToScan":{"type":"array","items":{"type":"string"}},"externalModuleResolutionStrategy":{"type":"string","enum":["node_modules","yarn-pnp"]},"builtInModules":{"type":"object","additionalProperties":false,"properties":{"override":{"type":"array","items":{"type":"string"}},"add":{"type":"array","items":{"type":"string"}}}},"forceDeriveDependents":{"type":"boolean"},"webpackConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"},"env":{"oneOf":[{"type":"object"},{"type":"string"}]},"arguments":{"type":"object"}}},"enhancedResolveOptions":{"type":"object","additionalProperties":false,"properties":{"exportsFields":{"type":"array","items":{"type":"string"}},"conditionNames":{"type":"array","items":{"type":"string"}},"extensions":{"type":"array","items":{"type":"string"}},"mainFields":{"type":"array","items":{"type":"string"}},"mainFiles":{"type":"array"},"aliasFields":{"type":"array","items":{"type":"string"}},"cachedInputFileSystem":{"type":"object","additionalProperties":false,"properties":{"cacheDuration":{"type":"integer","minimum":0,"maximum":1800000}}}}},"babelConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"parser":{"type":"string","enum":["acorn","swc","tsc"]},"exoticRequireStrings":{"type":"array","items":{"type":"string"}},"reporterOptions":{"$ref":"#/definitions/ReporterOptionsType"},"progress":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["cli-feedback","performance-log","ndjson","none"]},"maximumLevel":{"type":"number","enum":[-1,40,50,60,70,80,99]}}},"metrics":{"type":"boolean"},"baseDir":{"type":"string"},"cache":{"oneOf":[{"type":"boolean"},{"deprecated":true,"type":"string"},{"$ref":"#/definitions/CacheOptionsType"}]}}},"ModuleSystemType":{"type":"string","enum":["cjs","es6","amd","tsd"]},"ModuleSystemsType":{"type":"array","items":{"$ref":"#/definitions/ModuleSystemType"}},"CompoundExcludeType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dynamic":{"type":"boolean"}}},"CompoundDoNotFollowType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"CompoundIncludeOnlyType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundFocusType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"depth":{"type":"number","minimum":1,"maximum":4}}},"CompoundReachesType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundHighlightType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"ReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"anon":{"$ref":"#/definitions/AnonReporterOptionsType"},"archi":{"$ref":"#/definitions/DotReporterOptionsType"},"dot":{"$ref":"#/definitions/DotReporterOptionsType"},"ddot":{"$ref":"#/definitions/DotReporterOptionsType"},"flat":{"$ref":"#/definitions/DotReporterOptionsType"},"markdown":{"$ref":"#/definitions/MarkdownReporterOptionsType"},"metrics":{"$ref":"#/definitions/MetricsReporterOptionsType"},"mermaid":{"$ref":"#/definitions/MermaidReporterOptionsType"},"text":{"$ref":"#/definitions/TextReporterOptionsType"}}},"AnonReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"wordlist":{"type":"array","items":{"type":"string"}}}},"MetricsReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"orderBy":{"type":"string","enum":["instability","moduleCount","afferentCouplings","efferentCouplings","name"]},"hideModules":{"type":"boolean"},"hideFolders":{"type":"boolean"}}},"MarkdownReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"showTitle":{"type":"boolean"},"title":{"type":"string"},"showSummary":{"type":"boolean"},"showSummaryHeader":{"type":"boolean"},"summaryHeader":{"type":"string"},"showStatsSummary":{"type":"boolean"},"showRulesSummary":{"type":"boolean"},"includeIgnoredInSummary":{"type":"boolean"},"showDetails":{"type":"boolean"},"includeIgnoredInDetails":{"type":"boolean"},"showDetailsHeader":{"type":"boolean"},"detailsHeader":{"type":"string"},"collapseDetails":{"type":"boolean"},"collapsedMessage":{"type":"string"},"noViolationsMessage":{"type":"string"},"showFooter":{"type":"boolean"}}},"MermaidReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"minify":{"type":"boolean"}}},"TextReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"highlightFocused":{"type":"boolean"}}},"DotReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"collapsePattern":{"$ref":"#/definitions/REAsStringsType"},"filters":{"$ref":"#/definitions/ReporterFiltersType"},"showMetrics":{"type":"boolean"},"theme":{"$ref":"#/definitions/DotThemeType"}}},"DotThemeType":{"type":"object","additionalProperties":false,"properties":{"replace":{"type":"boolean"},"graph":{"type":"object"},"node":{"type":"object"},"edge":{"type":"object"},"modules":{"$ref":"#/definitions/DotThemeArrayType"},"dependencies":{"$ref":"#/definitions/DotThemeArrayType"}}},"DotThemeArrayType":{"type":"array","items":{"$ref":"#/definitions/DotThemeEntryType"}},"DotThemeEntryType":{"type":"object","additionalProperties":false,"properties":{"criteria":{"type":"object"},"attributes":{"type":"object"}}},"ReporterFiltersType":{"type":"object","additionalProperties":false,"properties":{"exclude":{"$ref":"#/definitions/CompoundExcludeType"},"includeOnly":{"$ref":"#/definitions/CompoundIncludeOnlyType"},"focus":{"$ref":"#/definitions/CompoundFocusType"},"reaches":{"$ref":"#/definitions/CompoundReachesType"}}},"ViolationsType":{"type":"array","items":{"$ref":"#/definitions/ViolationType"}},"ViolationType":{"type":"object","required":["from","to","rule"],"additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"$ref":"#/definitions/ViolationTypeType"},"rule":{"$ref":"#/definitions/RuleSummaryType"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"via":{"type":"array","items":{"type":"string"}},"metrics":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}},"to":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}}}},"comment":{"type":"string"}}},"RuleSummaryType":{"type":"object","required":["name","severity"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"}}},"ViolationTypeType":{"type":"string","enum":["dependency","module","reachability","cycle","instability","folder"]},"MiniDependency":{"type":"object","required":["name","dependencyTypes"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"CacheOptionsType":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string"},"strategy":{"$ref":"#/definitions/CacheStrategyType"},"compress":{"type":"boolean","default":false}}},"CacheStrategyType":{"type":"string","enum":["metadata","content"]},"ExtendsType":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}} \ No newline at end of file +/* generated - don't edit */export default {"title":"dependency-cruiser configuration","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://dependency-cruiser.js.org/schema/configuration.schema.json","type":"object","additionalProperties":false,"properties":{"$schema":{"type":"string"},"forbidden":{"type":"array","items":{"$ref":"#/definitions/ForbiddenRuleType"}},"allowed":{"type":"array","items":{"$ref":"#/definitions/AllowedRuleType"}},"allowedSeverity":{"$ref":"#/definitions/SeverityType"},"required":{"type":"array","items":{"$ref":"#/definitions/RequiredRuleType"}},"options":{"$ref":"#/definitions/OptionsType"},"extends":{"$ref":"#/definitions/ExtendsType"}},"definitions":{"RuleSetType":{"type":"object","additionalProperties":false,"properties":{"forbidden":{"type":"array","items":{"$ref":"#/definitions/ForbiddenRuleType"}},"allowed":{"type":"array","items":{"$ref":"#/definitions/AllowedRuleType"}},"allowedSeverity":{"$ref":"#/definitions/SeverityType"},"required":{"type":"array","items":{"$ref":"#/definitions/RequiredRuleType"}}}},"AllowedRuleType":{"oneOf":[{"$ref":"#/definitions/RegularAllowedRuleType"},{"$ref":"#/definitions/ReachabilityAllowedRuleType"}]},"RegularAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"ReachabilityAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"ForbiddenRuleType":{"oneOf":[{"$ref":"#/definitions/RegularForbiddenRuleType"},{"$ref":"#/definitions/ReachabilityForbiddenRuleType"},{"$ref":"#/definitions/DependentsForbiddenRuleType"}]},"RegularForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"DependentsForbiddenRuleType":{"type":"object","required":["module","from"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/DependentsModuleRestrictionType"},"from":{"$ref":"#/definitions/DependentsFromRestrictionType"}}},"ReachabilityForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"RequiredRuleType":{"type":"object","required":["module","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/RequiredModuleRestrictionType"},"to":{"$ref":"#/definitions/RequiredToRestrictionType"}}},"MiniDependencyRestrictionType":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}}]},"FromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"orphan":{"type":"boolean"}}},"ReachabilityFromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ToRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"couldNotResolve":{"type":"boolean"},"circular":{"type":"boolean"},"dynamic":{"type":"boolean"},"exoticallyRequired":{"type":"boolean"},"exoticRequire":{"$ref":"#/definitions/REAsStringsType"},"exoticRequireNot":{"$ref":"#/definitions/REAsStringsType"},"preCompilationOnly":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"moreThanOneDependencyType":{"type":"boolean"},"license":{"$ref":"#/definitions/REAsStringsType"},"licenseNot":{"$ref":"#/definitions/REAsStringsType"},"via":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaOnly":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"viaSomeNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"moreUnstable":{"type":"boolean"}}},"DependentsModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"numberOfDependentsLessThan":{"type":"integer","minimum":0,"maximum":100},"numberOfDependentsMoreThan":{"type":"integer","minimum":0,"maximum":100}}},"DependentsFromRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ReachabilityToRestrictionType":{"required":["reachable"],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"reachable":{"type":"boolean"}}},"RequiredModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"RequiredToRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"DependencyTypeType":{"type":"string","enum":["aliased-subpath-import","aliased-tsconfig-base-url","aliased-tsconfig-paths","aliased-tsconfig","aliased-webpack","aliased-workspace","aliased","amd-define","amd-require","amd-exotic-require","core","deprecated","dynamic-import","exotic-require","export","import-equals","import","local","localmodule","npm-bundled","npm-dev","npm-no-pkg","npm-optional","npm-peer","npm-unknown","npm","pre-compilation-only","require","triple-slash-amd-dependency","triple-slash-directive","triple-slash-file-reference","triple-slash-type-reference","type-import","type-only","undetermined","unknown"]},"REAsStringsType":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"SeverityType":{"type":"string","enum":["error","warn","info","ignore"]},"OptionsType":{"type":"object","additionalProperties":false,"properties":{"doNotFollow":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundDoNotFollowType"}]},"exclude":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundExcludeType"}]},"includeOnly":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundIncludeOnlyType"}]},"focus":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundFocusType"}]},"reaches":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundReachesType"}]},"highlight":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundHighlightType"}]},"knownViolations":{"$ref":"#/definitions/ViolationsType"},"collapse":{"oneOf":[{"type":"string"},{"type":"integer","minimum":1,"maximum":9}]},"maxDepth":{"type":"integer","minimum":0,"maximum":99},"moduleSystems":{"$ref":"#/definitions/ModuleSystemsType"},"prefix":{"type":"string"},"preserveSymlinks":{"type":"boolean"},"combinedDependencies":{"type":"boolean"},"tsConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"tsPreCompilationDeps":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["specify"]}]},"extraExtensionsToScan":{"type":"array","items":{"type":"string"}},"externalModuleResolutionStrategy":{"type":"string","enum":["node_modules","yarn-pnp"]},"builtInModules":{"type":"object","additionalProperties":false,"properties":{"override":{"type":"array","items":{"type":"string"}},"add":{"type":"array","items":{"type":"string"}}}},"forceDeriveDependents":{"type":"boolean"},"webpackConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"},"env":{"oneOf":[{"type":"object"},{"type":"string"}]},"arguments":{"type":"object"}}},"enhancedResolveOptions":{"type":"object","additionalProperties":false,"properties":{"exportsFields":{"type":"array","items":{"type":"string"}},"conditionNames":{"type":"array","items":{"type":"string"}},"extensions":{"type":"array","items":{"type":"string"}},"mainFields":{"type":"array","items":{"type":"string"}},"mainFiles":{"type":"array"},"aliasFields":{"type":"array","items":{"type":"string"}},"cachedInputFileSystem":{"type":"object","additionalProperties":false,"properties":{"cacheDuration":{"type":"integer","minimum":0,"maximum":1800000}}}}},"babelConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"parser":{"type":"string","enum":["acorn","swc","tsc"]},"exoticRequireStrings":{"type":"array","items":{"type":"string"}},"reporterOptions":{"$ref":"#/definitions/ReporterOptionsType"},"progress":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["cli-feedback","performance-log","ndjson","none"]},"maximumLevel":{"type":"number","enum":[-1,40,50,60,70,80,99]}}},"metrics":{"type":"boolean"},"baseDir":{"type":"string"},"cache":{"oneOf":[{"type":"boolean"},{"deprecated":true,"type":"string"},{"$ref":"#/definitions/CacheOptionsType"}]}}},"ModuleSystemType":{"type":"string","enum":["cjs","es6","amd","tsd"]},"ModuleSystemsType":{"type":"array","items":{"$ref":"#/definitions/ModuleSystemType"}},"CompoundExcludeType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dynamic":{"type":"boolean"}}},"CompoundDoNotFollowType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"CompoundIncludeOnlyType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundFocusType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"depth":{"type":"number","minimum":1,"maximum":4}}},"CompoundReachesType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundHighlightType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"ReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"anon":{"$ref":"#/definitions/AnonReporterOptionsType"},"archi":{"$ref":"#/definitions/DotReporterOptionsType"},"dot":{"$ref":"#/definitions/DotReporterOptionsType"},"ddot":{"$ref":"#/definitions/DotReporterOptionsType"},"flat":{"$ref":"#/definitions/DotReporterOptionsType"},"markdown":{"$ref":"#/definitions/MarkdownReporterOptionsType"},"metrics":{"$ref":"#/definitions/MetricsReporterOptionsType"},"mermaid":{"$ref":"#/definitions/MermaidReporterOptionsType"},"text":{"$ref":"#/definitions/TextReporterOptionsType"}}},"AnonReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"wordlist":{"type":"array","items":{"type":"string"}}}},"MetricsReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"orderBy":{"type":"string","enum":["instability","moduleCount","afferentCouplings","efferentCouplings","name"]},"hideModules":{"type":"boolean"},"hideFolders":{"type":"boolean"}}},"MarkdownReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"showTitle":{"type":"boolean"},"title":{"type":"string"},"showSummary":{"type":"boolean"},"showSummaryHeader":{"type":"boolean"},"summaryHeader":{"type":"string"},"showStatsSummary":{"type":"boolean"},"showRulesSummary":{"type":"boolean"},"includeIgnoredInSummary":{"type":"boolean"},"showDetails":{"type":"boolean"},"includeIgnoredInDetails":{"type":"boolean"},"showDetailsHeader":{"type":"boolean"},"detailsHeader":{"type":"string"},"collapseDetails":{"type":"boolean"},"collapsedMessage":{"type":"string"},"noViolationsMessage":{"type":"string"},"showFooter":{"type":"boolean"}}},"MermaidReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"minify":{"type":"boolean"}}},"TextReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"highlightFocused":{"type":"boolean"}}},"DotReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"collapsePattern":{"$ref":"#/definitions/REAsStringsType"},"filters":{"$ref":"#/definitions/ReporterFiltersType"},"showMetrics":{"type":"boolean"},"theme":{"$ref":"#/definitions/DotThemeType"}}},"DotThemeType":{"type":"object","additionalProperties":false,"properties":{"replace":{"type":"boolean"},"graph":{"type":"object"},"node":{"type":"object"},"edge":{"type":"object"},"modules":{"$ref":"#/definitions/DotThemeArrayType"},"dependencies":{"$ref":"#/definitions/DotThemeArrayType"}}},"DotThemeArrayType":{"type":"array","items":{"$ref":"#/definitions/DotThemeEntryType"}},"DotThemeEntryType":{"type":"object","additionalProperties":false,"properties":{"criteria":{"type":"object"},"attributes":{"type":"object"}}},"ReporterFiltersType":{"type":"object","additionalProperties":false,"properties":{"exclude":{"$ref":"#/definitions/CompoundExcludeType"},"includeOnly":{"$ref":"#/definitions/CompoundIncludeOnlyType"},"focus":{"$ref":"#/definitions/CompoundFocusType"},"reaches":{"$ref":"#/definitions/CompoundReachesType"}}},"ViolationsType":{"type":"array","items":{"$ref":"#/definitions/ViolationType"}},"ViolationType":{"type":"object","required":["from","to","rule"],"additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"$ref":"#/definitions/ViolationTypeType"},"rule":{"$ref":"#/definitions/RuleSummaryType"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"via":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"metrics":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}},"to":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}}}},"comment":{"type":"string"}}},"RuleSummaryType":{"type":"object","required":["name","severity"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"}}},"ViolationTypeType":{"type":"string","enum":["dependency","module","reachability","cycle","instability","folder"]},"MiniDependency":{"type":"object","required":["name","dependencyTypes"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"CacheOptionsType":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string"},"strategy":{"$ref":"#/definitions/CacheStrategyType"},"compress":{"type":"boolean","default":false}}},"CacheStrategyType":{"type":"string","enum":["metadata","content"]},"ExtendsType":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}} \ No newline at end of file diff --git a/src/schema/cruise-result.schema.json b/src/schema/cruise-result.schema.json index eba594917..2960dfff4 100644 --- a/src/schema/cruise-result.schema.json +++ b/src/schema/cruise-result.schema.json @@ -144,7 +144,7 @@ "via": { "type": "array", "description": "The path along which the 'to' module is reachable from this one.", - "items": { "type": "string" } + "items": { "$ref": "#/definitions/MiniDependency" } } } }, @@ -488,7 +488,7 @@ }, "via": { "type": "array", - "items": { "type": "string" }, + "items": { "$ref": "#/definitions/MiniDependency" }, "description": "The path from the from to the to if the violation is transitive" }, "metrics": { diff --git a/src/schema/cruise-result.schema.mjs b/src/schema/cruise-result.schema.mjs index ea74b300f..99c0018af 100644 --- a/src/schema/cruise-result.schema.mjs +++ b/src/schema/cruise-result.schema.mjs @@ -1 +1 @@ -/* generated - don't edit */export default {"title":"dependency-cruiser output format","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://dependency-cruiser.js.org/schema/cruise-result.schema.json","type":"object","required":["summary","modules"],"additionalProperties":false,"properties":{"modules":{"$ref":"#/definitions/ModulesType"},"folders":{"$ref":"#/definitions/FoldersType"},"summary":{"$ref":"#/definitions/SummaryType"},"revisionData":{"$ref":"#/definitions/RevisionDataType"}},"definitions":{"ModulesType":{"type":"array","items":{"$ref":"#/definitions/ModuleType"}},"ModuleType":{"type":"object","required":["source","dependencies","valid"],"additionalProperties":false,"properties":{"source":{"type":"string"},"valid":{"type":"boolean"},"dependencies":{"$ref":"#/definitions/DependenciesType"},"dependents":{"type":"array","items":{"type":"string"}},"followable":{"type":"boolean"},"matchesDoNotFollow":{"type":"boolean"},"matchesFocus":{"type":"boolean"},"matchesReaches":{"type":"boolean"},"matchesHighlight":{"type":"boolean"},"coreModule":{"type":"boolean"},"couldNotResolve":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"license":{"type":"string"},"orphan":{"type":"boolean"},"reachable":{"type":"array","items":{"$ref":"#/definitions/ReachableType"}},"reaches":{"type":"array","items":{"$ref":"#/definitions/ReachesType"}},"rules":{"type":"array","items":{"$ref":"#/definitions/RuleSummaryType"}},"consolidated":{"type":"boolean"},"instability":{"type":"number"},"checksum":{"type":"string"}}},"ReachableType":{"type":"object","required":["value","asDefinedInRule","matchedFrom"],"additionalProperties":false,"properties":{"value":{"type":"boolean"},"asDefinedInRule":{"type":"string"},"matchedFrom":{"type":"string"}}},"ReachesType":{"type":"object","required":["modules","asDefinedInRule"],"additionalProperties":false,"properties":{"modules":{"type":"array","items":{"type":"object","required":["source","via"],"additionalProperties":false,"properties":{"source":{"type":"string"},"via":{"type":"array","items":{"type":"string"}}}}},"asDefinedInRule":{"type":"string"}}},"DependenciesType":{"type":"array","items":{"$ref":"#/definitions/DependencyType"}},"DependencyType":{"type":"object","required":["circular","coreModule","couldNotResolve","dependencyTypes","exoticallyRequired","dynamic","followable","module","moduleSystem","resolved","valid"],"additionalProperties":false,"properties":{"module":{"type":"string"},"protocol":{"type":"string","enum":["data:","file:","node:"]},"mimeType":{"type":"string"},"resolved":{"type":"string"},"coreModule":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"license":{"type":"string"},"followable":{"type":"boolean"},"dynamic":{"type":"boolean"},"exoticallyRequired":{"type":"boolean"},"exoticRequire":{"type":"string"},"matchesDoNotFollow":{"type":"boolean"},"couldNotResolve":{"type":"boolean"},"preCompilationOnly":{"type":"boolean"},"typeOnly":{"type":"boolean"},"circular":{"type":"boolean"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"moduleSystem":{"$ref":"#/definitions/ModuleSystemType"},"valid":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/definitions/RuleSummaryType"}},"instability":{"type":"number"}}},"DependencyTypeType":{"type":"string","enum":["aliased-subpath-import","aliased-tsconfig-base-url","aliased-tsconfig-paths","aliased-tsconfig","aliased-webpack","aliased-workspace","aliased","amd-define","amd-require","amd-exotic-require","core","deprecated","dynamic-import","exotic-require","export","import-equals","import","local","localmodule","npm-bundled","npm-dev","npm-no-pkg","npm-optional","npm-peer","npm-unknown","npm","pre-compilation-only","require","triple-slash-amd-dependency","triple-slash-directive","triple-slash-file-reference","triple-slash-type-reference","type-import","type-only","undetermined","unknown"]},"ModuleSystemType":{"type":"string","enum":["cjs","es6","amd","tsd"]},"RuleSummaryType":{"type":"object","required":["name","severity"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"}}},"SeverityType":{"type":"string","enum":["error","warn","info","ignore"]},"MiniDependency":{"type":"object","required":["name","dependencyTypes"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"FoldersType":{"type":"array","items":{"$ref":"#/definitions/FolderType"}},"FolderType":{"type":"object","required":["name","moduleCount"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependents":{"type":"array","items":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string"}}}},"dependencies":{"type":"array","items":{"type":"object","required":["name","valid","circular"],"additionalProperties":false,"properties":{"name":{"type":"string"},"instability":{"type":"number"},"valid":{"type":"boolean"},"circular":{"type":"boolean"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"rules":{"type":"array","items":{"$ref":"#/definitions/RuleSummaryType"}}}}},"moduleCount":{"type":"number"},"afferentCouplings":{"type":"number"},"efferentCouplings":{"type":"number"},"instability":{"type":"number"}}},"SummaryType":{"type":"object","required":["violations","error","warn","info","totalCruised","optionsUsed"],"additionalProperties":false,"properties":{"violations":{"$ref":"#/definitions/ViolationsType"},"error":{"type":"number"},"warn":{"type":"number"},"info":{"type":"number"},"ignore":{"type":"number"},"totalCruised":{"type":"number"},"totalDependenciesCruised":{"type":"number"},"ruleSetUsed":{"$ref":"#/definitions/RuleSetType"},"optionsUsed":{"$ref":"#/definitions/OptionsUsedType"}}},"ViolationsType":{"type":"array","items":{"$ref":"#/definitions/ViolationType"}},"ViolationType":{"type":"object","required":["from","to","rule"],"additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"$ref":"#/definitions/ViolationTypeType"},"rule":{"$ref":"#/definitions/RuleSummaryType"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"via":{"type":"array","items":{"type":"string"}},"metrics":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}},"to":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}}}},"comment":{"type":"string"}}},"ViolationTypeType":{"type":"string","enum":["dependency","module","reachability","cycle","instability","folder"]},"RuleSetType":{"type":"object","additionalProperties":false,"properties":{"forbidden":{"type":"array","items":{"$ref":"#/definitions/ForbiddenRuleType"}},"allowed":{"type":"array","items":{"$ref":"#/definitions/AllowedRuleType"}},"allowedSeverity":{"$ref":"#/definitions/SeverityType"},"required":{"type":"array","items":{"$ref":"#/definitions/RequiredRuleType"}}}},"AllowedRuleType":{"oneOf":[{"$ref":"#/definitions/RegularAllowedRuleType"},{"$ref":"#/definitions/ReachabilityAllowedRuleType"}]},"RegularAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"ReachabilityAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"ForbiddenRuleType":{"oneOf":[{"$ref":"#/definitions/RegularForbiddenRuleType"},{"$ref":"#/definitions/ReachabilityForbiddenRuleType"},{"$ref":"#/definitions/DependentsForbiddenRuleType"}]},"RegularForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"DependentsForbiddenRuleType":{"type":"object","required":["module","from"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/DependentsModuleRestrictionType"},"from":{"$ref":"#/definitions/DependentsFromRestrictionType"}}},"ReachabilityForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"RequiredRuleType":{"type":"object","required":["module","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/RequiredModuleRestrictionType"},"to":{"$ref":"#/definitions/RequiredToRestrictionType"}}},"MiniDependencyRestrictionType":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}}]},"FromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"orphan":{"type":"boolean"}}},"ReachabilityFromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ToRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"couldNotResolve":{"type":"boolean"},"circular":{"type":"boolean"},"dynamic":{"type":"boolean"},"exoticallyRequired":{"type":"boolean"},"exoticRequire":{"$ref":"#/definitions/REAsStringsType"},"exoticRequireNot":{"$ref":"#/definitions/REAsStringsType"},"preCompilationOnly":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"moreThanOneDependencyType":{"type":"boolean"},"license":{"$ref":"#/definitions/REAsStringsType"},"licenseNot":{"$ref":"#/definitions/REAsStringsType"},"via":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaOnly":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"viaSomeNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"moreUnstable":{"type":"boolean"}}},"DependentsModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"numberOfDependentsLessThan":{"type":"integer","minimum":0,"maximum":100},"numberOfDependentsMoreThan":{"type":"integer","minimum":0,"maximum":100}}},"DependentsFromRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ReachabilityToRestrictionType":{"required":["reachable"],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"reachable":{"type":"boolean"}}},"RequiredModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"RequiredToRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"REAsStringsType":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"OptionsUsedType":{"type":"object","additionalProperties":false,"properties":{"doNotFollow":{"$ref":"#/definitions/CompoundDoNotFollowType"},"exclude":{"$ref":"#/definitions/CompoundExcludeType"},"includeOnly":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundIncludeOnlyType"}]},"focus":{"$ref":"#/definitions/CompoundFocusType"},"reaches":{"$ref":"#/definitions/CompoundReachesType"},"highlight":{"$ref":"#/definitions/CompoundHighlightType"},"knownViolations":{"$ref":"#/definitions/ViolationsType"},"collapse":{"type":"string"},"maxDepth":{"type":"integer","minimum":0,"maximum":99},"moduleSystems":{"$ref":"#/definitions/ModuleSystemsType"},"prefix":{"type":"string"},"preserveSymlinks":{"type":"boolean"},"combinedDependencies":{"type":"boolean"},"tsConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"tsPreCompilationDeps":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["specify"]}]},"extraExtensionsToScan":{"type":"array","items":{"type":"string"}},"externalModuleResolutionStrategy":{"type":"string","enum":["node_modules","yarn-pnp"]},"builtInModules":{"type":"object","additionalProperties":false,"properties":{"override":{"type":"array","items":{"type":"string"}},"add":{"type":"array","items":{"type":"string"}}}},"forceDeriveDependents":{"type":"boolean"},"webpackConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"},"env":{"oneOf":[{"type":"object"},{"type":"string"}]},"arguments":{"type":"object"}}},"enhancedResolveOptions":{"type":"object","additionalProperties":false,"properties":{"exportsFields":{"type":"array","items":{"type":"string"}},"conditionNames":{"type":"array","items":{"type":"string"}},"extensions":{"type":"array","items":{"type":"string"}},"mainFields":{"type":"array","items":{"type":"string"}},"mainFiles":{"type":"array"},"aliasFields":{"type":"array","items":{"type":"string"}},"cachedInputFileSystem":{"type":"object","additionalProperties":false,"properties":{"cacheDuration":{"type":"integer","minimum":0,"maximum":1800000}}}}},"babelConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"parser":{"type":"string","enum":["acorn","swc","tsc"]},"exoticRequireStrings":{"type":"array","items":{"type":"string"}},"reporterOptions":{"$ref":"#/definitions/ReporterOptionsType"},"progress":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["cli-feedback","performance-log","ndjson","none"]},"maximumLevel":{"type":"number","enum":[-1,40,50,60,70,80,99]}}},"metrics":{"type":"boolean"},"baseDir":{"type":"string"},"cache":{"oneOf":[{"type":"boolean","enum":[false]},{"$ref":"#/definitions/CacheOptionsType"}]},"args":{"type":"string"},"rulesFile":{"type":"string"},"outputTo":{"type":"string"},"outputType":{"$ref":"#/definitions/OutputType"}}},"ModuleSystemsType":{"type":"array","items":{"$ref":"#/definitions/ModuleSystemType"}},"OutputType":{"oneOf":[{"type":"string","enum":["json","html","dot","ddot","cdot","archi","fdot","flat","csv","err","err-long","err-html","teamcity","anon","text","metrics","markdown","mermaid","d2","null"]},{"type":"string","pattern":"^plugin:[^:]+$"}]},"CompoundExcludeType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dynamic":{"type":"boolean"}}},"CompoundDoNotFollowType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"CompoundIncludeOnlyType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundFocusType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"depth":{"type":"number","minimum":1,"maximum":4}}},"CompoundReachesType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundHighlightType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"ReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"anon":{"$ref":"#/definitions/AnonReporterOptionsType"},"archi":{"$ref":"#/definitions/DotReporterOptionsType"},"dot":{"$ref":"#/definitions/DotReporterOptionsType"},"ddot":{"$ref":"#/definitions/DotReporterOptionsType"},"flat":{"$ref":"#/definitions/DotReporterOptionsType"},"markdown":{"$ref":"#/definitions/MarkdownReporterOptionsType"},"metrics":{"$ref":"#/definitions/MetricsReporterOptionsType"},"mermaid":{"$ref":"#/definitions/MermaidReporterOptionsType"},"text":{"$ref":"#/definitions/TextReporterOptionsType"}}},"AnonReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"wordlist":{"type":"array","items":{"type":"string"}}}},"MetricsReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"orderBy":{"type":"string","enum":["instability","moduleCount","afferentCouplings","efferentCouplings","name"]},"hideModules":{"type":"boolean"},"hideFolders":{"type":"boolean"}}},"MarkdownReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"showTitle":{"type":"boolean"},"title":{"type":"string"},"showSummary":{"type":"boolean"},"showSummaryHeader":{"type":"boolean"},"summaryHeader":{"type":"string"},"showStatsSummary":{"type":"boolean"},"showRulesSummary":{"type":"boolean"},"includeIgnoredInSummary":{"type":"boolean"},"showDetails":{"type":"boolean"},"includeIgnoredInDetails":{"type":"boolean"},"showDetailsHeader":{"type":"boolean"},"detailsHeader":{"type":"string"},"collapseDetails":{"type":"boolean"},"collapsedMessage":{"type":"string"},"noViolationsMessage":{"type":"string"},"showFooter":{"type":"boolean"}}},"MermaidReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"minify":{"type":"boolean"}}},"TextReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"highlightFocused":{"type":"boolean"}}},"DotReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"collapsePattern":{"$ref":"#/definitions/REAsStringsType"},"filters":{"$ref":"#/definitions/ReporterFiltersType"},"showMetrics":{"type":"boolean"},"theme":{"$ref":"#/definitions/DotThemeType"}}},"DotThemeType":{"type":"object","additionalProperties":false,"properties":{"replace":{"type":"boolean"},"graph":{"type":"object"},"node":{"type":"object"},"edge":{"type":"object"},"modules":{"$ref":"#/definitions/DotThemeArrayType"},"dependencies":{"$ref":"#/definitions/DotThemeArrayType"}}},"DotThemeArrayType":{"type":"array","items":{"$ref":"#/definitions/DotThemeEntryType"}},"DotThemeEntryType":{"type":"object","additionalProperties":false,"properties":{"criteria":{"type":"object"},"attributes":{"type":"object"}}},"ReporterFiltersType":{"type":"object","additionalProperties":false,"properties":{"exclude":{"$ref":"#/definitions/CompoundExcludeType"},"includeOnly":{"$ref":"#/definitions/CompoundIncludeOnlyType"},"focus":{"$ref":"#/definitions/CompoundFocusType"},"reaches":{"$ref":"#/definitions/CompoundReachesType"}}},"CacheOptionsType":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string"},"strategy":{"$ref":"#/definitions/CacheStrategyType"},"compress":{"type":"boolean","default":false}}},"CacheStrategyType":{"type":"string","enum":["metadata","content"]},"RevisionDataType":{"type":"object","required":["SHA1","changes"],"properties":{"cacheFormatVersion":{"type":"number"},"SHA1":{"type":"string"},"changes":{"type":"array","items":{"type":"object","required":["name","changeType"],"properties":{"name":{"type":"string"},"changeType":{"type":"string","enum":["added","copied","deleted","modified","renamed","type changed","unmerged","pairing broken","unknown","unmodified","untracked","ignored"]},"oldName":{"type":"string"},"checksum":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"rulesFile":{"type":"string"}}}}}}}} \ No newline at end of file +/* generated - don't edit */export default {"title":"dependency-cruiser output format","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://dependency-cruiser.js.org/schema/cruise-result.schema.json","type":"object","required":["summary","modules"],"additionalProperties":false,"properties":{"modules":{"$ref":"#/definitions/ModulesType"},"folders":{"$ref":"#/definitions/FoldersType"},"summary":{"$ref":"#/definitions/SummaryType"},"revisionData":{"$ref":"#/definitions/RevisionDataType"}},"definitions":{"ModulesType":{"type":"array","items":{"$ref":"#/definitions/ModuleType"}},"ModuleType":{"type":"object","required":["source","dependencies","valid"],"additionalProperties":false,"properties":{"source":{"type":"string"},"valid":{"type":"boolean"},"dependencies":{"$ref":"#/definitions/DependenciesType"},"dependents":{"type":"array","items":{"type":"string"}},"followable":{"type":"boolean"},"matchesDoNotFollow":{"type":"boolean"},"matchesFocus":{"type":"boolean"},"matchesReaches":{"type":"boolean"},"matchesHighlight":{"type":"boolean"},"coreModule":{"type":"boolean"},"couldNotResolve":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"license":{"type":"string"},"orphan":{"type":"boolean"},"reachable":{"type":"array","items":{"$ref":"#/definitions/ReachableType"}},"reaches":{"type":"array","items":{"$ref":"#/definitions/ReachesType"}},"rules":{"type":"array","items":{"$ref":"#/definitions/RuleSummaryType"}},"consolidated":{"type":"boolean"},"instability":{"type":"number"},"checksum":{"type":"string"}}},"ReachableType":{"type":"object","required":["value","asDefinedInRule","matchedFrom"],"additionalProperties":false,"properties":{"value":{"type":"boolean"},"asDefinedInRule":{"type":"string"},"matchedFrom":{"type":"string"}}},"ReachesType":{"type":"object","required":["modules","asDefinedInRule"],"additionalProperties":false,"properties":{"modules":{"type":"array","items":{"type":"object","required":["source","via"],"additionalProperties":false,"properties":{"source":{"type":"string"},"via":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}}}}},"asDefinedInRule":{"type":"string"}}},"DependenciesType":{"type":"array","items":{"$ref":"#/definitions/DependencyType"}},"DependencyType":{"type":"object","required":["circular","coreModule","couldNotResolve","dependencyTypes","exoticallyRequired","dynamic","followable","module","moduleSystem","resolved","valid"],"additionalProperties":false,"properties":{"module":{"type":"string"},"protocol":{"type":"string","enum":["data:","file:","node:"]},"mimeType":{"type":"string"},"resolved":{"type":"string"},"coreModule":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"license":{"type":"string"},"followable":{"type":"boolean"},"dynamic":{"type":"boolean"},"exoticallyRequired":{"type":"boolean"},"exoticRequire":{"type":"string"},"matchesDoNotFollow":{"type":"boolean"},"couldNotResolve":{"type":"boolean"},"preCompilationOnly":{"type":"boolean"},"typeOnly":{"type":"boolean"},"circular":{"type":"boolean"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"moduleSystem":{"$ref":"#/definitions/ModuleSystemType"},"valid":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/definitions/RuleSummaryType"}},"instability":{"type":"number"}}},"DependencyTypeType":{"type":"string","enum":["aliased-subpath-import","aliased-tsconfig-base-url","aliased-tsconfig-paths","aliased-tsconfig","aliased-webpack","aliased-workspace","aliased","amd-define","amd-require","amd-exotic-require","core","deprecated","dynamic-import","exotic-require","export","import-equals","import","local","localmodule","npm-bundled","npm-dev","npm-no-pkg","npm-optional","npm-peer","npm-unknown","npm","pre-compilation-only","require","triple-slash-amd-dependency","triple-slash-directive","triple-slash-file-reference","triple-slash-type-reference","type-import","type-only","undetermined","unknown"]},"ModuleSystemType":{"type":"string","enum":["cjs","es6","amd","tsd"]},"RuleSummaryType":{"type":"object","required":["name","severity"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"}}},"SeverityType":{"type":"string","enum":["error","warn","info","ignore"]},"MiniDependency":{"type":"object","required":["name","dependencyTypes"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"FoldersType":{"type":"array","items":{"$ref":"#/definitions/FolderType"}},"FolderType":{"type":"object","required":["name","moduleCount"],"additionalProperties":false,"properties":{"name":{"type":"string"},"dependents":{"type":"array","items":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string"}}}},"dependencies":{"type":"array","items":{"type":"object","required":["name","valid","circular"],"additionalProperties":false,"properties":{"name":{"type":"string"},"instability":{"type":"number"},"valid":{"type":"boolean"},"circular":{"type":"boolean"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"rules":{"type":"array","items":{"$ref":"#/definitions/RuleSummaryType"}}}}},"moduleCount":{"type":"number"},"afferentCouplings":{"type":"number"},"efferentCouplings":{"type":"number"},"instability":{"type":"number"}}},"SummaryType":{"type":"object","required":["violations","error","warn","info","totalCruised","optionsUsed"],"additionalProperties":false,"properties":{"violations":{"$ref":"#/definitions/ViolationsType"},"error":{"type":"number"},"warn":{"type":"number"},"info":{"type":"number"},"ignore":{"type":"number"},"totalCruised":{"type":"number"},"totalDependenciesCruised":{"type":"number"},"ruleSetUsed":{"$ref":"#/definitions/RuleSetType"},"optionsUsed":{"$ref":"#/definitions/OptionsUsedType"}}},"ViolationsType":{"type":"array","items":{"$ref":"#/definitions/ViolationType"}},"ViolationType":{"type":"object","required":["from","to","rule"],"additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"$ref":"#/definitions/ViolationTypeType"},"rule":{"$ref":"#/definitions/RuleSummaryType"},"cycle":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"via":{"type":"array","items":{"$ref":"#/definitions/MiniDependency"}},"metrics":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}},"to":{"type":"object","required":["instability"],"additionalProperties":false,"properties":{"instability":{"type":"number"}}}}},"comment":{"type":"string"}}},"ViolationTypeType":{"type":"string","enum":["dependency","module","reachability","cycle","instability","folder"]},"RuleSetType":{"type":"object","additionalProperties":false,"properties":{"forbidden":{"type":"array","items":{"$ref":"#/definitions/ForbiddenRuleType"}},"allowed":{"type":"array","items":{"$ref":"#/definitions/AllowedRuleType"}},"allowedSeverity":{"$ref":"#/definitions/SeverityType"},"required":{"type":"array","items":{"$ref":"#/definitions/RequiredRuleType"}}}},"AllowedRuleType":{"oneOf":[{"$ref":"#/definitions/RegularAllowedRuleType"},{"$ref":"#/definitions/ReachabilityAllowedRuleType"}]},"RegularAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"ReachabilityAllowedRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"comment":{"type":"string"},"scope":{"type":"string","enum":["module","folder"]},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"ForbiddenRuleType":{"oneOf":[{"$ref":"#/definitions/RegularForbiddenRuleType"},{"$ref":"#/definitions/ReachabilityForbiddenRuleType"},{"$ref":"#/definitions/DependentsForbiddenRuleType"}]},"RegularForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/FromRestrictionType"},"to":{"$ref":"#/definitions/ToRestrictionType"}}},"DependentsForbiddenRuleType":{"type":"object","required":["module","from"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/DependentsModuleRestrictionType"},"from":{"$ref":"#/definitions/DependentsFromRestrictionType"}}},"ReachabilityForbiddenRuleType":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"from":{"$ref":"#/definitions/ReachabilityFromRestrictionType"},"to":{"$ref":"#/definitions/ReachabilityToRestrictionType"}}},"RequiredRuleType":{"type":"object","required":["module","to"],"additionalProperties":false,"properties":{"name":{"type":"string"},"severity":{"$ref":"#/definitions/SeverityType"},"scope":{"type":"string","enum":["module","folder"]},"comment":{"type":"string"},"module":{"$ref":"#/definitions/RequiredModuleRestrictionType"},"to":{"$ref":"#/definitions/RequiredToRestrictionType"}}},"MiniDependencyRestrictionType":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}}]},"FromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"orphan":{"type":"boolean"}}},"ReachabilityFromRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ToRestrictionType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"couldNotResolve":{"type":"boolean"},"circular":{"type":"boolean"},"dynamic":{"type":"boolean"},"exoticallyRequired":{"type":"boolean"},"exoticRequire":{"$ref":"#/definitions/REAsStringsType"},"exoticRequireNot":{"$ref":"#/definitions/REAsStringsType"},"preCompilationOnly":{"type":"boolean"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"dependencyTypesNot":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}},"moreThanOneDependencyType":{"type":"boolean"},"license":{"$ref":"#/definitions/REAsStringsType"},"licenseNot":{"$ref":"#/definitions/REAsStringsType"},"via":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaOnly":{"$ref":"#/definitions/MiniDependencyRestrictionType"},"viaNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"viaSomeNot":{"deprecated":true,"$ref":"#/definitions/REAsStringsType"},"moreUnstable":{"type":"boolean"}}},"DependentsModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"numberOfDependentsLessThan":{"type":"integer","minimum":0,"maximum":100},"numberOfDependentsMoreThan":{"type":"integer","minimum":0,"maximum":100}}},"DependentsFromRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"ReachabilityToRestrictionType":{"required":["reachable"],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"},"reachable":{"type":"boolean"}}},"RequiredModuleRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"pathNot":{"$ref":"#/definitions/REAsStringsType"}}},"RequiredToRestrictionType":{"required":[],"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"REAsStringsType":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"OptionsUsedType":{"type":"object","additionalProperties":false,"properties":{"doNotFollow":{"$ref":"#/definitions/CompoundDoNotFollowType"},"exclude":{"$ref":"#/definitions/CompoundExcludeType"},"includeOnly":{"oneOf":[{"$ref":"#/definitions/REAsStringsType"},{"$ref":"#/definitions/CompoundIncludeOnlyType"}]},"focus":{"$ref":"#/definitions/CompoundFocusType"},"reaches":{"$ref":"#/definitions/CompoundReachesType"},"highlight":{"$ref":"#/definitions/CompoundHighlightType"},"knownViolations":{"$ref":"#/definitions/ViolationsType"},"collapse":{"type":"string"},"maxDepth":{"type":"integer","minimum":0,"maximum":99},"moduleSystems":{"$ref":"#/definitions/ModuleSystemsType"},"prefix":{"type":"string"},"preserveSymlinks":{"type":"boolean"},"combinedDependencies":{"type":"boolean"},"tsConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"tsPreCompilationDeps":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["specify"]}]},"extraExtensionsToScan":{"type":"array","items":{"type":"string"}},"externalModuleResolutionStrategy":{"type":"string","enum":["node_modules","yarn-pnp"]},"builtInModules":{"type":"object","additionalProperties":false,"properties":{"override":{"type":"array","items":{"type":"string"}},"add":{"type":"array","items":{"type":"string"}}}},"forceDeriveDependents":{"type":"boolean"},"webpackConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"},"env":{"oneOf":[{"type":"object"},{"type":"string"}]},"arguments":{"type":"object"}}},"enhancedResolveOptions":{"type":"object","additionalProperties":false,"properties":{"exportsFields":{"type":"array","items":{"type":"string"}},"conditionNames":{"type":"array","items":{"type":"string"}},"extensions":{"type":"array","items":{"type":"string"}},"mainFields":{"type":"array","items":{"type":"string"}},"mainFiles":{"type":"array"},"aliasFields":{"type":"array","items":{"type":"string"}},"cachedInputFileSystem":{"type":"object","additionalProperties":false,"properties":{"cacheDuration":{"type":"integer","minimum":0,"maximum":1800000}}}}},"babelConfig":{"type":"object","additionalProperties":false,"properties":{"fileName":{"type":"string"}}},"parser":{"type":"string","enum":["acorn","swc","tsc"]},"exoticRequireStrings":{"type":"array","items":{"type":"string"}},"reporterOptions":{"$ref":"#/definitions/ReporterOptionsType"},"progress":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["cli-feedback","performance-log","ndjson","none"]},"maximumLevel":{"type":"number","enum":[-1,40,50,60,70,80,99]}}},"metrics":{"type":"boolean"},"baseDir":{"type":"string"},"cache":{"oneOf":[{"type":"boolean","enum":[false]},{"$ref":"#/definitions/CacheOptionsType"}]},"args":{"type":"string"},"rulesFile":{"type":"string"},"outputTo":{"type":"string"},"outputType":{"$ref":"#/definitions/OutputType"}}},"ModuleSystemsType":{"type":"array","items":{"$ref":"#/definitions/ModuleSystemType"}},"OutputType":{"oneOf":[{"type":"string","enum":["json","html","dot","ddot","cdot","archi","fdot","flat","csv","err","err-long","err-html","teamcity","anon","text","metrics","markdown","mermaid","d2","null"]},{"type":"string","pattern":"^plugin:[^:]+$"}]},"CompoundExcludeType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dynamic":{"type":"boolean"}}},"CompoundDoNotFollowType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"dependencyTypes":{"type":"array","items":{"$ref":"#/definitions/DependencyTypeType"}}}},"CompoundIncludeOnlyType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundFocusType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"},"depth":{"type":"number","minimum":1,"maximum":4}}},"CompoundReachesType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"CompoundHighlightType":{"type":"object","additionalProperties":false,"properties":{"path":{"$ref":"#/definitions/REAsStringsType"}}},"ReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"anon":{"$ref":"#/definitions/AnonReporterOptionsType"},"archi":{"$ref":"#/definitions/DotReporterOptionsType"},"dot":{"$ref":"#/definitions/DotReporterOptionsType"},"ddot":{"$ref":"#/definitions/DotReporterOptionsType"},"flat":{"$ref":"#/definitions/DotReporterOptionsType"},"markdown":{"$ref":"#/definitions/MarkdownReporterOptionsType"},"metrics":{"$ref":"#/definitions/MetricsReporterOptionsType"},"mermaid":{"$ref":"#/definitions/MermaidReporterOptionsType"},"text":{"$ref":"#/definitions/TextReporterOptionsType"}}},"AnonReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"wordlist":{"type":"array","items":{"type":"string"}}}},"MetricsReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"orderBy":{"type":"string","enum":["instability","moduleCount","afferentCouplings","efferentCouplings","name"]},"hideModules":{"type":"boolean"},"hideFolders":{"type":"boolean"}}},"MarkdownReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"showTitle":{"type":"boolean"},"title":{"type":"string"},"showSummary":{"type":"boolean"},"showSummaryHeader":{"type":"boolean"},"summaryHeader":{"type":"string"},"showStatsSummary":{"type":"boolean"},"showRulesSummary":{"type":"boolean"},"includeIgnoredInSummary":{"type":"boolean"},"showDetails":{"type":"boolean"},"includeIgnoredInDetails":{"type":"boolean"},"showDetailsHeader":{"type":"boolean"},"detailsHeader":{"type":"string"},"collapseDetails":{"type":"boolean"},"collapsedMessage":{"type":"string"},"noViolationsMessage":{"type":"string"},"showFooter":{"type":"boolean"}}},"MermaidReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"minify":{"type":"boolean"}}},"TextReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"highlightFocused":{"type":"boolean"}}},"DotReporterOptionsType":{"type":"object","additionalProperties":false,"properties":{"collapsePattern":{"$ref":"#/definitions/REAsStringsType"},"filters":{"$ref":"#/definitions/ReporterFiltersType"},"showMetrics":{"type":"boolean"},"theme":{"$ref":"#/definitions/DotThemeType"}}},"DotThemeType":{"type":"object","additionalProperties":false,"properties":{"replace":{"type":"boolean"},"graph":{"type":"object"},"node":{"type":"object"},"edge":{"type":"object"},"modules":{"$ref":"#/definitions/DotThemeArrayType"},"dependencies":{"$ref":"#/definitions/DotThemeArrayType"}}},"DotThemeArrayType":{"type":"array","items":{"$ref":"#/definitions/DotThemeEntryType"}},"DotThemeEntryType":{"type":"object","additionalProperties":false,"properties":{"criteria":{"type":"object"},"attributes":{"type":"object"}}},"ReporterFiltersType":{"type":"object","additionalProperties":false,"properties":{"exclude":{"$ref":"#/definitions/CompoundExcludeType"},"includeOnly":{"$ref":"#/definitions/CompoundIncludeOnlyType"},"focus":{"$ref":"#/definitions/CompoundFocusType"},"reaches":{"$ref":"#/definitions/CompoundReachesType"}}},"CacheOptionsType":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string"},"strategy":{"$ref":"#/definitions/CacheStrategyType"},"compress":{"type":"boolean","default":false}}},"CacheStrategyType":{"type":"string","enum":["metadata","content"]},"RevisionDataType":{"type":"object","required":["SHA1","changes"],"properties":{"cacheFormatVersion":{"type":"number"},"SHA1":{"type":"string"},"changes":{"type":"array","items":{"type":"object","required":["name","changeType"],"properties":{"name":{"type":"string"},"changeType":{"type":"string","enum":["added","copied","deleted","modified","renamed","type changed","unmerged","pairing broken","unknown","unmodified","untracked","ignored"]},"oldName":{"type":"string"},"checksum":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"rulesFile":{"type":"string"}}}}}}}} \ No newline at end of file diff --git a/test/config-utl/__mocks__/known-violations/known-violations-with-vias-in-new-format.json b/test/config-utl/__mocks__/known-violations/known-violations-with-vias-in-new-format.json new file mode 100644 index 000000000..a41d0972b --- /dev/null +++ b/test/config-utl/__mocks__/known-violations/known-violations-with-vias-in-new-format.json @@ -0,0 +1,30 @@ +[ + { + "from": "src/foo/index.js", + "to": "src/utl/quux.js", + "rule": { + "severity": "error", + "name": "utl-not-reachable-from-extract" + }, + "via": [ + { "name": "src/foo/index.js", "dependencyTypes": [] }, + { "name": "src/foo/quuz.js", "dependencyTypes": [] }, + { "name": "src/utl/quux.js", "dependencyTypes": [] } + ], + "cycle": [] + }, + { + "from": "src/foo/index.js", + "to": "src/utl/grault.js", + "rule": { + "severity": "error", + "name": "utl-not-reachable-from-extract" + }, + "via": [ + { "name": "src/foo/index.js", "dependencyTypes": [] }, + { "name": "src/foo/corge.js", "dependencyTypes": [] }, + { "name": "src/utl/grault.js", "dependencyTypes": [] } + ], + "cycle": [] + } +] diff --git a/test/config-utl/__mocks__/known-violations/known-violations-with-vias-in-old-format.json b/test/config-utl/__mocks__/known-violations/known-violations-with-vias-in-old-format.json new file mode 100644 index 000000000..e3cc1ac31 --- /dev/null +++ b/test/config-utl/__mocks__/known-violations/known-violations-with-vias-in-old-format.json @@ -0,0 +1,22 @@ +[ + { + "from": "src/foo/index.js", + "to": "src/utl/quux.js", + "rule": { + "severity": "error", + "name": "utl-not-reachable-from-extract" + }, + "via": ["src/foo/index.js", "src/foo/quuz.js", "src/utl/quux.js"], + "cycle": [] + }, + { + "from": "src/foo/index.js", + "to": "src/utl/grault.js", + "rule": { + "severity": "error", + "name": "utl-not-reachable-from-extract" + }, + "via": ["src/foo/index.js", "src/foo/corge.js", "src/utl/grault.js"], + "cycle": [] + } +] diff --git a/test/config-utl/extract-known-violations.spec.mjs b/test/config-utl/extract-known-violations.spec.mjs index 53f6f11a4..f7d3cd1d5 100644 --- a/test/config-utl/extract-known-violations.spec.mjs +++ b/test/config-utl/extract-known-violations.spec.mjs @@ -56,7 +56,7 @@ describe("[I] config-utl/extractKnownViolations", () => { ]); }); - it("Makes a forward compatible version of the known violations", async () => { + it("Makes a forward compatible version of the known violations (cycles)", async () => { process.chdir("./test/config-utl/__mocks__/known-violations"); deepEqual( await extractKnownViolations( @@ -112,6 +112,45 @@ describe("[I] config-utl/extractKnownViolations", () => { ); }); + it("Makes a forward compatible version of the known violations (via)", async () => { + process.chdir("./test/config-utl/__mocks__/known-violations"); + deepEqual( + await extractKnownViolations( + "known-violations-with-vias-in-old-format.json", + ), + [ + { + from: "src/foo/index.js", + to: "src/utl/quux.js", + rule: { + severity: "error", + name: "utl-not-reachable-from-extract", + }, + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/quuz.js", dependencyTypes: [] }, + { name: "src/utl/quux.js", dependencyTypes: [] }, + ], + cycle: [], + }, + { + from: "src/foo/index.js", + to: "src/utl/grault.js", + rule: { + severity: "error", + name: "utl-not-reachable-from-extract", + }, + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/corge.js", dependencyTypes: [] }, + { name: "src/utl/grault.js", dependencyTypes: [] }, + ], + cycle: [], + }, + ], + ); + }); + it("Leaves new format cycles alone", async () => { process.chdir("./test/config-utl/__mocks__/known-violations"); deepEqual( @@ -167,4 +206,43 @@ describe("[I] config-utl/extractKnownViolations", () => { ], ); }); + + it("Leaves new format vias alone", async () => { + process.chdir("./test/config-utl/__mocks__/known-violations"); + deepEqual( + await extractKnownViolations( + "known-violations-with-vias-in-new-format.json", + ), + [ + { + from: "src/foo/index.js", + to: "src/utl/quux.js", + rule: { + severity: "error", + name: "utl-not-reachable-from-extract", + }, + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/quuz.js", dependencyTypes: [] }, + { name: "src/utl/quux.js", dependencyTypes: [] }, + ], + cycle: [], + }, + { + from: "src/foo/index.js", + to: "src/utl/grault.js", + rule: { + severity: "error", + name: "utl-not-reachable-from-extract", + }, + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/corge.js", dependencyTypes: [] }, + { name: "src/utl/grault.js", dependencyTypes: [] }, + ], + cycle: [], + }, + ], + ); + }); }); diff --git a/test/enrich/derive/reachable.spec.mjs b/test/enrich/derive/reachable.spec.mjs index 7d25755ea..b36177c59 100644 --- a/test/enrich/derive/reachable.spec.mjs +++ b/test/enrich/derive/reachable.spec.mjs @@ -61,6 +61,7 @@ const GRAPH_TWO = [ dependencies: [], }, ]; + const ANNOTATED_GRAPH_FOR_HAJOO = [ { source: "./src/index.js", @@ -138,7 +139,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { }, ], }; - const lAnnotatedGraphForHajooAllowed = [ + const lExpected = [ { source: "./src/index.js", dependencies: [ @@ -153,9 +154,8 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { { source: "./src/hajoo.js", via: [ - "./src/index.js", - "./src/intermediate.js", - "./src/hajoo.js", + { name: "./src/intermediate.js", dependencyTypes: [] }, + { name: "./src/hajoo.js", dependencyTypes: [] }, ], }, ], @@ -178,7 +178,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { modules: [ { source: "./src/hajoo.js", - via: ["./src/intermediate.js", "./src/hajoo.js"], + via: [{ name: "./src/hajoo.js", dependencyTypes: [] }], }, ], }, @@ -198,7 +198,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { ]; deepEqual( addReachability(GRAPH, normalize(lForbiddenReachabilityRuleSetHajoo)), - lAnnotatedGraphForHajooAllowed, + lExpected, ); }); @@ -211,7 +211,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { }, ], }; - const lAnnotatedGraphForHajooAllowed = [ + const lExpected = [ { source: "./src/index.js", dependencies: [ @@ -226,9 +226,8 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { { source: "./src/hajoo.js", via: [ - "./src/index.js", - "./src/intermediate.js", - "./src/hajoo.js", + { name: "./src/intermediate.js", dependencyTypes: [] }, + { name: "./src/hajoo.js", dependencyTypes: [] }, ], }, ], @@ -251,7 +250,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { modules: [ { source: "./src/hajoo.js", - via: ["./src/intermediate.js", "./src/hajoo.js"], + via: [{ name: "./src/hajoo.js", dependencyTypes: [] }], }, ], }, @@ -271,7 +270,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { ]; deepEqual( addReachability(GRAPH, normalize(lForbiddenReachabilityRuleSetHajoo)), - lAnnotatedGraphForHajooAllowed, + lExpected, ); }); @@ -284,7 +283,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { }, ], }; - const lAnnotatedGraphForHajooAllowed = [ + const lExpected = [ { source: "./src/index.js", dependencies: [ @@ -302,14 +301,13 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { { source: "./src/hajoo.js", via: [ - "./src/index.js", - "./src/intermediate.js", - "./src/hajoo.js", + { name: "./src/intermediate.js", dependencyTypes: [] }, + { name: "./src/hajoo.js", dependencyTypes: [] }, ], }, { source: "./src/hajee.js", - via: ["./src/index.js", "./src/hajee.js"], + via: [{ name: "./src/hajee.js", dependencyTypes: [] }], }, ], }, @@ -331,14 +329,13 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { modules: [ { source: "./src/hajoo.js", - via: ["./src/intermediate.js", "./src/hajoo.js"], + via: [{ name: "./src/hajoo.js", dependencyTypes: [] }], }, { source: "./src/hajee.js", via: [ - "./src/intermediate.js", - "./src/index.js", - "./src/hajee.js", + { name: "./src/index.js", dependencyTypes: [] }, + { name: "./src/hajee.js", dependencyTypes: [] }, ], }, ], @@ -370,7 +367,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { ]; deepEqual( addReachability(GRAPH_TWO, normalize(lForbiddenReachabilityRuleSetHajoo)), - lAnnotatedGraphForHajooAllowed, + lExpected, ); }); @@ -820,7 +817,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { modules: [ { source: "./src/index.js", - via: ["./src/intermediate.js", "./src/index.js"], + via: [{ name: "./src/index.js", dependencyTypes: [] }], }, ], }, @@ -829,7 +826,7 @@ describe("[U] enrich/derive/reachable/index - reachability detection", () => { modules: [ { source: "./src/hajoo.js", - via: ["./src/intermediate.js", "./src/hajoo.js"], + via: [{ name: "./src/hajoo.js", dependencyTypes: [] }], }, ], }, diff --git a/test/graph-utl/indexed-module-graph.spec.mjs b/test/graph-utl/indexed-module-graph.spec.mjs index 3b9f5594a..53d008b3b 100644 --- a/test/graph-utl/indexed-module-graph.spec.mjs +++ b/test/graph-utl/indexed-module-graph.spec.mjs @@ -226,7 +226,9 @@ describe("[U] graph-utl/indexed-module-graph - findTransitiveDependencies", () = describe("[U] graph-utl/indexed-module-graph - getPath", () => { it("does not explode when passed an empty graph", () => { deepEqual( - new IndexedModuleGraph([]).getPath("./src/index.js", "./src/hajoo.js"), + new IndexedModuleGraph([]) + .getPath("./src/index.js", "./src/hajoo.js") + .map(({ name }) => name), [], ); }); @@ -240,10 +242,9 @@ describe("[U] graph-utl/indexed-module-graph - getPath", () => { ]; deepEqual( - new IndexedModuleGraph(lGraph).getPath( - "./src/index.js", - "./src/hajoo.js", - ), + new IndexedModuleGraph(lGraph) + .getPath("./src/index.js", "./src/hajoo.js") + .map(({ name }) => name), [], ); }); @@ -261,11 +262,10 @@ describe("[U] graph-utl/indexed-module-graph - getPath", () => { ]; deepEqual( - new IndexedModuleGraph(lGraph).getPath( - "./src/index.js", - "./src/hajoo.js", - ), - ["./src/index.js", "./src/hajoo.js"], + new IndexedModuleGraph(lGraph) + .getPath("./src/index.js", "./src/hajoo.js") + .map(({ name }) => name), + ["./src/hajoo.js"], ); }); @@ -282,10 +282,9 @@ describe("[U] graph-utl/indexed-module-graph - getPath", () => { ]; deepEqual( - new IndexedModuleGraph(lGraph).getPath( - "./src/index.js", - "./src/index.js", - ), + new IndexedModuleGraph(lGraph) + .getPath("./src/index.js", "./src/index.js") + .map(({ name }) => name), [], ); }); @@ -303,10 +302,9 @@ describe("[U] graph-utl/indexed-module-graph - getPath", () => { ]; deepEqual( - new IndexedModuleGraph(lGraph).getPath( - "./src/index.js", - "./src/hajoo.js", - ), + new IndexedModuleGraph(lGraph) + .getPath("./src/index.js", "./src/hajoo.js") + .map(({ name }) => name), [], ); }); @@ -332,11 +330,10 @@ describe("[U] graph-utl/indexed-module-graph - getPath", () => { ]; deepEqual( - new IndexedModuleGraph(lGraph).getPath( - "./src/index.js", - "./src/hajoo.js", - ), - ["./src/index.js", "./src/intermediate.js", "./src/hajoo.js"], + new IndexedModuleGraph(lGraph) + .getPath("./src/index.js", "./src/hajoo.js") + .map(({ name }) => name), + ["./src/intermediate.js", "./src/hajoo.js"], ); }); @@ -397,11 +394,10 @@ describe("[U] graph-utl/indexed-module-graph - getPath", () => { ]; deepEqual( - new IndexedModuleGraph(lGraph).getPath( - "./src/index.js", - "./src/hajoo.js", - ), - ["./src/index.js", "./src/intermediate.js", "./src/hajoo.js"], + new IndexedModuleGraph(lGraph) + .getPath("./src/index.js", "./src/hajoo.js") + .map(({ name }) => name), + ["./src/intermediate.js", "./src/hajoo.js"], ); }); }); diff --git a/test/main/main.cruise.reachable-integration.spec.mjs b/test/main/main.cruise.reachable-integration.spec.mjs index 92ac0723e..f67495422 100644 --- a/test/main/main.cruise.reachable-integration.spec.mjs +++ b/test/main/main.cruise.reachable-integration.spec.mjs @@ -38,9 +38,14 @@ describe("[E] main.cruise - reachable integration", () => { name: "no-db-access-from-schemas", }, via: [ - "src/schema-declarations/naughty.info.js", - "src/utilities/plumbing.js", - "src/db/admin.js", + { + name: "src/utilities/plumbing.js", + dependencyTypes: ["local", "require"], + }, + { + name: "src/db/admin.js", + dependencyTypes: ["local", "require"], + }, ], }, { diff --git a/test/report/anon/__fixtures__/reaches-report.mjs b/test/report/anon/__fixtures__/reaches-report.mjs index 222d2f722..38305e64b 100644 --- a/test/report/anon/__fixtures__/reaches-report.mjs +++ b/test/report/anon/__fixtures__/reaches-report.mjs @@ -162,14 +162,18 @@ export default { modules: [ { source: "src/utl/quux.js", - via: ["src/foo/index.js", "src/foo/quuz.js", "src/utl/quux.js"], + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/quuz.js", dependencyTypes: [] }, + { name: "src/utl/quux.js", dependencyTypes: [] }, + ], }, { source: "src/utl/grault.js", via: [ - "src/foo/index.js", - "src/foo/corge.js", - "src/utl/grault.js", + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/corge.js", dependencyTypes: [] }, + { name: "src/utl/grault.js", dependencyTypes: [] }, ], }, ], @@ -237,7 +241,11 @@ export default { severity: "error", name: "utl-not-reachable-from-extract", }, - via: ["src/foo/index.js", "src/foo/quuz.js", "src/utl/quux.js"], + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/quuz.js", dependencyTypes: [] }, + { name: "src/utl/quux.js", dependencyTypes: [] }, + ], cycle: [], }, { @@ -247,7 +255,11 @@ export default { severity: "error", name: "utl-not-reachable-from-extract", }, - via: ["src/foo/index.js", "src/foo/corge.js", "src/utl/grault.js"], + via: [ + { name: "src/foo/index.js", dependencyTypes: [] }, + { name: "src/foo/corge.js", dependencyTypes: [] }, + { name: "src/utl/grault.js", dependencyTypes: [] }, + ], cycle: [], }, { diff --git a/test/report/anon/__mocks__/reaches-report.mjs b/test/report/anon/__mocks__/reaches-report.mjs index fd75f00f5..f19203ddd 100644 --- a/test/report/anon/__mocks__/reaches-report.mjs +++ b/test/report/anon/__mocks__/reaches-report.mjs @@ -157,17 +157,20 @@ export default { { source: "src/utl/array-util.js", via: [ - "src/extract/index.js", - "src/extract/get-dependencies.js", - "src/utl/array-util.js", + { name: "src/extract/index.js", dependencyTypes: [] }, + { + name: "src/extract/get-dependencies.js", + dependencyTypes: [], + }, + { name: "src/utl/array-util.js", dependencyTypes: [] }, ], }, { source: "src/utl/find-rule-by-name.js", via: [ - "src/extract/index.js", - "src/extract/summarize.js", - "src/utl/find-rule-by-name.js", + { name: "src/extract/index.js", dependencyTypes: [] }, + { name: "src/extract/summarize.js", dependencyTypes: [] }, + { name: "src/utl/find-rule-by-name.js", dependencyTypes: [] }, ], }, ], @@ -235,9 +238,9 @@ export default { name: "utl-not-reachable-from-extract", }, via: [ - "src/extract/index.js", - "src/extract/get-dependencies.js", - "src/utl/array-util.js", + { name: "src/extract/index.js", dependencyTypes: [] }, + { name: "src/extract/get-dependencies.js", dependencyTypes: [] }, + { name: "src/utl/array-util.js", dependencyTypes: [] }, ], }, { @@ -248,9 +251,9 @@ export default { name: "utl-not-reachable-from-extract", }, via: [ - "src/extract/index.js", - "src/extract/summarize.js", - "src/utl/find-rule-by-name.js", + { name: "src/extract/index.js", dependencyTypes: [] }, + { name: "src/extract/summarize.js", dependencyTypes: [] }, + { name: "src/utl/find-rule-by-name.js", dependencyTypes: [] }, ], }, { diff --git a/test/report/azure-devops/__mocks__/via-deps.mjs b/test/report/azure-devops/__mocks__/via-deps.mjs index 9fe7ac105..ccc934667 100644 --- a/test/report/azure-devops/__mocks__/via-deps.mjs +++ b/test/report/azure-devops/__mocks__/via-deps.mjs @@ -203,7 +203,10 @@ export default { severity: "error", name: "some-via-rule", }, - via: ["via-one", "via-another"], + via: [ + { name: "via-one", dependencyTypes: [] }, + { name: "via-another", dependencyTypes: [] }, + ], }, { type: "reachability", @@ -213,7 +216,10 @@ export default { severity: "error", name: "some-via-rule", }, - via: ["via-one", "via-another"], + via: [ + { name: "via-one", dependencyTypes: [] }, + { name: "via-another", dependencyTypes: [] }, + ], }, { type: "module", diff --git a/test/report/error-html/__mocks__/via-deps.mjs b/test/report/error-html/__mocks__/via-deps.mjs new file mode 100644 index 000000000..32133445d --- /dev/null +++ b/test/report/error-html/__mocks__/via-deps.mjs @@ -0,0 +1,280 @@ +export default { + modules: [ + { + source: "src/extract/add-validations.js", + dependencies: [], + orphan: false, + valid: true, + }, + { + source: "src/extract/clear-caches.js", + dependencies: [], + orphan: false, + valid: true, + }, + { + source: "src/extract/gather-initial-sources.js", + dependencies: [], + orphan: false, + valid: true, + }, + { + source: "src/extract/get-dependencies.js", + dependencies: [ + { + resolved: "src/utl/array-util.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "../utl/array-util", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + ], + orphan: false, + valid: true, + }, + { + source: "src/utl/array-util.js", + dependencies: [], + orphan: false, + reachable: [ + { + value: true, + asDefinedInRule: "some-via-rule", + }, + ], + valid: false, + rules: [ + { + severity: "error", + name: "some-via-rule", + }, + ], + }, + { + source: "src/extract/index.js", + dependencies: [ + { + resolved: "src/extract/add-validations.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "./add-validations", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + { + resolved: "src/extract/clear-caches.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "./clear-caches", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + { + resolved: "src/extract/gather-initial-sources.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "./gather-initial-sources", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + { + resolved: "src/extract/get-dependencies.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "./get-dependencies", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + { + resolved: "src/extract/summarize.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "./summarize", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + ], + orphan: false, + reaches: [ + { + asDefinedInRule: "some-via-rule", + modules: [ + { + source: "src/utl/array-util.js", + }, + { + source: "src/utl/find-rule-by-name.js", + }, + ], + }, + ], + valid: false, + rules: [ + { + severity: "error", + name: "some-via-rule", + }, + ], + }, + { + source: "src/extract/summarize.js", + dependencies: [ + { + resolved: "src/utl/find-rule-by-name.js", + coreModule: false, + followable: true, + couldNotResolve: false, + dependencyTypes: ["local"], + module: "../utl/find-rule-by-name", + moduleSystem: "cjs", + dynamic: false, + exoticallyRequired: false, + matchesDoNotFollow: false, + circular: false, + valid: true, + }, + ], + orphan: false, + valid: true, + }, + { + source: "src/utl/find-rule-by-name.js", + dependencies: [], + orphan: false, + reachable: [ + { + value: true, + asDefinedInRule: "some-via-rule", + }, + ], + valid: false, + rules: [ + { + severity: "error", + name: "some-via-rule", + }, + ], + }, + ], + summary: { + violations: [ + { + type: "reachability", + from: "src/extract/index.js", + to: "src/utl/array-util.js", + rule: { + severity: "error", + name: "some-via-rule", + }, + via: [ + { name: "via-one", dependencyTypes: [] }, + { name: "via-two", dependencyTypes: [] }, + ], + }, + { + type: "reachability", + from: "src/extract/index.js", + to: "src/utl/find-rule-by-name.js", + rule: { + severity: "error", + name: "some-via-rule", + }, + via: [ + { name: "via-one", dependencyTypes: [] }, + { name: "via-two", dependencyTypes: [] }, + ], + }, + { + type: "module", + from: "src/utl/array-util.js", + to: "src/utl/array-util.js", + rule: { + severity: "error", + name: "some-via-rule", + }, + }, + { + type: "module", + from: "src/utl/find-rule-by-name.js", + to: "src/utl/find-rule-by-name.js", + rule: { + severity: "error", + name: "some-via-rule", + }, + }, + ], + error: 4, + warn: 0, + info: 0, + totalCruised: 8, + totalDependenciesCruised: 7, + optionsUsed: { + combinedDependencies: false, + exclude: { + path: "^src/extract/[^/]+/[^.]+\\.js$", + }, + externalModuleResolutionStrategy: "node_modules", + includeOnly: "^src/(utl|extract/[^.]+\\.js$)", + moduleSystems: ["amd", "cjs", "es6"], + outputTo: "-", + outputType: "json", + preserveSymlinks: false, + rulesFile: "tmp-reachable.js", + tsPreCompilationDeps: false, + exoticRequireStrings: [], + args: "src", + }, + ruleSetUsed: { + forbidden: [ + { + name: "some-via-rule", + severity: "error", + from: { + path: "^src/extract/index\\.js$", + }, + to: { + path: "^src/utl", + reachable: true, + }, + }, + ], + }, + }, +}; diff --git a/test/report/error-html/error-html.spec.mjs b/test/report/error-html/error-html.spec.mjs index f455d1b21..dbb7a8cf6 100644 --- a/test/report/error-html/error-html.spec.mjs +++ b/test/report/error-html/error-html.spec.mjs @@ -3,6 +3,7 @@ import everythingFineResult from "./__mocks__/everything-fine.mjs"; import validationMoreThanOnce from "./__mocks__/violation-more-than-once.mjs"; import validationMoreThanOnceWithAnIgnore from "./__mocks__/violation-more-than-once-with-an-ignore.mjs"; import orphansCyclesMetrics from "./__mocks__/orphans-cycles-metrics.mjs"; +import viaDeps from "./__mocks__/via-deps.mjs"; import errorHTML from "#report/error-html/index.mjs"; describe("[I] report/error-html", () => { @@ -82,4 +83,19 @@ describe("[I] report/error-html", () => { /src\/extract\/transpile\/index\.js<\/a> \(I: 33%\)<\/span><\/td>[^<]*src\/extract\/transpile\/meta.js \(I: 80%\)<\/span>/, ); }); + + it("report nicely on via's", () => { + const lResult = errorHTML(viaDeps); + + doesNotMatch(lResult.output, new RegExp(lOkeliDokelyKey)); + doesNotMatch(lResult.output, new RegExp(lOkeliDokelyHeader)); + + // vias as vias in the 'to' column: + match( + lResult.output, + /src\/utl\/find-rule-by-name\.jsvia-one →via-two<\/td>/, + ); + // vias as vias in the 'to' column: + // match(lResult.output, /via-one →via-two/); + }); }); diff --git a/test/report/error-html/utl.spec.mjs b/test/report/error-html/utl.spec.mjs index 6db00bf91..a43be2d06 100644 --- a/test/report/error-html/utl.spec.mjs +++ b/test/report/error-html/utl.spec.mjs @@ -180,7 +180,12 @@ describe("[U] report/error-html/utl", () => { it("determineTo - via violation", () => { const lInputViolation = { type: "reachability", - via: ["thing/a", "b", "thingy/bingy/c", "a"], + via: [ + { name: "thing/a", dependencyTypes: [] }, + { name: "b", dependencyTypes: [] }, + { name: "thingy/bingy/c", dependencyTypes: [] }, + { name: "a", dependencyTypes: [] }, + ], from: "a", to: "thing/a", }; diff --git a/test/report/error/__mocks__/via-deps.mjs b/test/report/error/__mocks__/via-deps.mjs index 0025a72c6..41a7cdf53 100644 --- a/test/report/error/__mocks__/via-deps.mjs +++ b/test/report/error/__mocks__/via-deps.mjs @@ -203,7 +203,7 @@ export default { severity: "error", name: "some-via-rule", }, - via: ["(via via)"], + via: [{ name: "(via via)", dependencyTypes: [] }], }, { type: "reachability", @@ -213,7 +213,7 @@ export default { severity: "error", name: "some-via-rule", }, - via: ["(via via)"], + via: [{ name: "(via via)", dependencyTypes: [] }], }, { type: "module", diff --git a/test/report/teamcity/__mocks__/via-deps.mjs b/test/report/teamcity/__mocks__/via-deps.mjs index 0025a72c6..41a7cdf53 100644 --- a/test/report/teamcity/__mocks__/via-deps.mjs +++ b/test/report/teamcity/__mocks__/via-deps.mjs @@ -203,7 +203,7 @@ export default { severity: "error", name: "some-via-rule", }, - via: ["(via via)"], + via: [{ name: "(via via)", dependencyTypes: [] }], }, { type: "reachability", @@ -213,7 +213,7 @@ export default { severity: "error", name: "some-via-rule", }, - via: ["(via via)"], + via: [{ name: "(via via)", dependencyTypes: [] }], }, { type: "module", diff --git a/tools/schema/modules.mjs b/tools/schema/modules.mjs index 67e9590d6..e1327b3ed 100644 --- a/tools/schema/modules.mjs +++ b/tools/schema/modules.mjs @@ -1,6 +1,7 @@ import dependencies from "./dependencies.mjs"; import dependencyType from "./dependency-type.mjs"; import ruleSummary from "./rule-summary.mjs"; +import miniDependency from "./mini-dependency-type.mjs"; export default { definitions: { @@ -193,7 +194,7 @@ export default { type: "array", description: "The path along which the 'to' module is reachable from this one.", - items: { type: "string" }, + items: { $ref: "#/definitions/MiniDependency" }, }, }, }, @@ -210,5 +211,6 @@ export default { ...dependencies.definitions, ...ruleSummary.definitions, ...dependencyType.definitions, + ...miniDependency.definitions, }, }; diff --git a/tools/schema/violations.mjs b/tools/schema/violations.mjs index 2b9641f6a..bd4caa85c 100644 --- a/tools/schema/violations.mjs +++ b/tools/schema/violations.mjs @@ -32,7 +32,7 @@ export default { }, via: { type: "array", - items: { type: "string" }, + items: { $ref: "#/definitions/MiniDependency" }, description: "The path from the from to the to if the violation is transitive", }, diff --git a/types/cruise-result.d.mts b/types/cruise-result.d.mts index 2dbb49fd5..2045f6e6e 100644 --- a/types/cruise-result.d.mts +++ b/types/cruise-result.d.mts @@ -301,7 +301,7 @@ export interface IReachesModule { /** * The path along which the 'to' module is reachable from this one. */ - via: string[]; + via: IMiniDependency[]; } export interface IReaches { diff --git a/types/violations.d.mts b/types/violations.d.mts index bcee21319..996a70698 100644 --- a/types/violations.d.mts +++ b/types/violations.d.mts @@ -34,7 +34,7 @@ export interface IViolation { /** * The path from the from to the to if the violation is transitive */ - via?: string[]; + via?: IMiniDependency[]; /** * metrics - when the violation pertains to a violation of a metrics * principle