Skip to content

Commit

Permalink
feat(main|cache|enrich): normalize the option, put it in the summary …
Browse files Browse the repository at this point in the history
…and take it into account in cache dirty algorithm
  • Loading branch information
sverweij committed Jan 4, 2025
1 parent e007b8d commit 1344527
Show file tree
Hide file tree
Showing 37 changed files with 99 additions and 108 deletions.
1 change: 1 addition & 0 deletions src/cache/options-compatible.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export function optionsAreCompatible(pOldOptions, pNewOptions) {
pOldOptions.combinedDependencies === pNewOptions.combinedDependencies &&
pOldOptions.experimentalStats === pNewOptions.experimentalStats &&
pOldOptions.detectJSDocImports === pNewOptions.detectJSDocImports &&
pOldOptions.skipAnalysisNotInRules === pNewOptions.skipAnalysisNotInRules &&
metricsIsCompatible(pOldOptions.metrics, pNewOptions.metrics) &&
// includeOnly suffers from a backwards compatibility disease
includeOnlyIsCompatible(pOldOptions.includeOnly, pNewOptions.includeOnly) &&
Expand Down
1 change: 1 addition & 0 deletions src/enrich/summarize/summarize-options.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const SHAREABLE_OPTIONS = [
"reaches",
"reporterOptions",
"rulesFile",
"skipAnalysisNotInRules",
"tsConfig",
"tsPreCompilationDeps",
"webpackConfig",
Expand Down
1 change: 1 addition & 0 deletions src/main/options/defaults.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default {
maxDepth: 0,
moduleSystems: ["es6", "cjs", "tsd", "amd"],
detectJSDocImports: false,
skipAnalysisNotInRules: false,
tsPreCompilationDeps: false,
preserveSymlinks: false,
combinedDependencies: false,
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/alternate-basedir/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"outputTo": "test/cli/__output__/alternate-basedir.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"args": "src"
},
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/babel/babel-es6-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"outputTo": "test/cli/__output__/babel-es6-result.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"webpackConfig": {
"fileName": "test/cli/__fixtures__/babel/es6/webpack-cache-bust.config.js"
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/babel/babel-ts-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
"outputTo": "test/cli/__output__/babel-ts-result.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"webpackConfig": {
"fileName": "test/cli/__fixtures__/babel/ts/webpack-cache-bust.config.js"
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/cjs.dir.filtered.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
"outputTo": "test/cli/__output__/cjs.dir.filtered.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"args": "test/cli/__fixtures__/cjs"
}
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/cjs.dir.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@
"outputTo": "test/cli/__output__/cjs.dir.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"exoticRequireStrings": [],
"args": "test/cli/__fixtures__/cjs"
Expand Down
3 changes: 2 additions & 1 deletion test/cli/__fixtures__/cjs.dir.stdout.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@
"combinedDependencies": false,
"detectJSDocImports": false,
"exoticRequireStrings": [],
"externalModuleResolutionStrategy": "node_modules"
"externalModuleResolutionStrategy": "node_modules",
"skipAnalysisNotInRules": false
}
}
}
1 change: 1 addition & 0 deletions test/cli/__fixtures__/cjs.file.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
"outputTo": "test/cli/__output__/cjs.file.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"exoticRequireStrings": [],
"args": "test/cli/__fixtures__/cjs/root_one.js"
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/dynamic-import-nok.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"outputTo": "test/cli/__output__/dynamic-import-nok.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsConfig": {
"fileName": "test/cli/__fixtures__/typescriptconfig/cli-dynamic-imports/tsconfig.error_on_compile_dynamic_imports.json"
},
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/dynamic-import-ok.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"outputTo": "test/cli/__output__/dynamic-import-ok.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsConfig": {
"fileName": "test/cli/__fixtures__/typescriptconfig/cli-dynamic-imports/tsconfig.compile_dynamic_imports.json"
},
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/empty.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"tsPreCompilationDeps": false,
"combinedDependencies": false,
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"externalModuleResolutionStrategy": "node_modules"
}
}
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/jsdoc-import-tags/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"outputType": "json",
"parser": "tsc",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"rulesFile": "dependency-cruiser-config.mjs",
"tsPreCompilationDeps": false,
"args": "src/index.mjs"
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/multiple-in-one-go.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
"outputTo": "test/cli/__output__/multiple-in-one-go.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"exoticRequireStrings": [],
"args": "test/cli/__fixtures__/cjs/sub test/cli/__fixtures__/duplicate-subs/sub/more-in-sub.js test/cli/__fixtures__/unresolvable-in-sub"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9287,6 +9287,7 @@
"prefix": "https://github.com/sverweij/dependency-cruiser/blob/develop/",
"preserveSymlinks": false,
"rulesFile": ".dependency-cruiser.json",
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": true,
"exoticRequireStrings": ["tryRequire", "requireJSON"],
"reporterOptions": {
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/typescript-path-resolution.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"outputTo": "test/cli/__output__/typescript-path-resolution.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"tsConfig": {
"fileName": "test/cli/__fixtures__/typescriptconfig/cli-config-with-path/tsconfig.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"outputType": "json",
"preserveSymlinks": false,
"rulesFile": "test/cli/__fixtures__/webpackconfig/aliassy/dependency-cruiser-json-with-webpack-config.json",
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"webpackConfig": {
"fileName": "test/cli/__fixtures__/webpackconfig/aliassy/webpack.regularexport.config.js"
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/webpack-config-alias.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"outputTo": "test/cli/__output__/webpack-config-alias.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"webpackConfig": {
"fileName": "test/cli/__fixtures__/webpackconfig/aliassy/webpack.regularexport.config.js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
"outputType": "json",
"preserveSymlinks": false,
"rulesFile": ".dependency-cruiser.js",
"skipAnalysisNotInRules": false,
"tsConfig": {
"fileName": "tsconfig.json"
},
Expand Down
1 change: 1 addition & 0 deletions test/cli/__fixtures__/workspaces-mono-repo/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
"outputTo": "test/cli/__output__/workspaces-mono-repo.json",
"outputType": "json",
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"args": "apps"
},
Expand Down
15 changes: 8 additions & 7 deletions test/main/__fixtures__/jsx-as-object.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"moduleSystem": "cjs",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["local", "require"],
"resolved": "test/main/__mocks__/jsx/jsx.jsx",
"coreModule": false,
"followable": true,
"couldNotResolve": false,
"dependencyTypes": ["local", "require"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -30,11 +30,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "components/pay-method-choice",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -44,11 +44,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "components/product-detail",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -58,11 +58,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "products",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -72,11 +72,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "react",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -86,11 +86,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "tracking",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -100,11 +100,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "utils",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand Down Expand Up @@ -203,6 +203,7 @@
"metrics": false,
"moduleSystems": ["es6", "cjs", "tsd", "amd"],
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"args": "test/main/__mocks__/jsx"
},
Expand Down
15 changes: 8 additions & 7 deletions test/main/__fixtures__/jsx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"moduleSystem": "cjs",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["local", "require"],
"resolved": "test/main/__mocks__/jsx/jsx.jsx",
"coreModule": false,
"followable": true,
"couldNotResolve": false,
"dependencyTypes": ["local", "require"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -30,11 +30,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "components/pay-method-choice",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -44,11 +44,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "components/product-detail",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -58,11 +58,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "products",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -72,11 +72,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "react",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -86,11 +86,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "tracking",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand All @@ -100,11 +100,11 @@
"moduleSystem": "es6",
"dynamic": false,
"exoticallyRequired": false,
"dependencyTypes": ["unknown"],
"resolved": "utils",
"coreModule": false,
"followable": false,
"couldNotResolve": true,
"dependencyTypes": ["unknown"],
"matchesDoNotFollow": false,
"circular": false,
"valid": true
Expand Down Expand Up @@ -203,6 +203,7 @@
"metrics": false,
"moduleSystems": ["es6", "cjs", "tsd", "amd"],
"preserveSymlinks": false,
"skipAnalysisNotInRules": false,
"tsPreCompilationDeps": false,
"args": "test/main/__mocks__/jsx"
}
Expand Down
Loading

0 comments on commit 1344527

Please sign in to comment.