From ee5dd3de3a7923224ea8c0cd031fabfebe6d67e7 Mon Sep 17 00:00:00 2001 From: Sander Verweij Date: Sun, 23 Feb 2020 21:56:53 +0100 Subject: [PATCH] refactor(*): standardize on kebab case file names (#267) - also introduce some rules from the eslint-plugin-unicorn along with the one that enforces kebab-case file names --- .dependency-cruiser.json | 22 +- .gitignore | 1 + Makefile | 2 +- bin/depcruise-fmt.js | 6 +- bin/dependency-cruise.js | 6 +- configs/eslint-config.json | 52 +- doc/assets/theming/bare.svg | 178 +- doc/assets/theming/base.svg | 180 +- doc/assets/theming/engineering.svg | 186 +- doc/assets/theming/vertical.svg | 178 +- .../dependency-cruiser-dir-graph.svg | 590 ++--- ...ependency-cruiser-without-node_modules.svg | 2356 ++++++++--------- doc/rules-reference.md | 2 +- docs/dependency-cruiser-dependency-graph.html | 2320 ++++++++-------- docs/dependency-cruiser-dir-graph.html | 578 ++-- package.json | 9 +- .../index.js | 8 +- .../merge-configs.js} | 0 .../read-config.js} | 2 +- ...{formatMetaInfo.js => format-meta-info.js} | 0 src/cli/format.js | 4 +- ...ResolveConfig.js => get-resolve-config.js} | 2 +- src/cli/index.js | 16 +- .../config.js.template.hbs | 0 .../config.js.template.js | 0 .../create-config-file.js} | 8 +- .../get-user-input.js} | 0 .../{initConfig => init-config}/helpers.js | 4 +- src/cli/{initConfig => init-config}/index.js | 4 +- ...rmalizeOptions.js => normalize-options.js} | 4 +- .../{parseTSConfig.js => parse-ts-config.js} | 0 src/cli/utl/io.js | 5 +- .../utl/{makeAbsolute.js => make-absolute.js} | 0 ...xistence.js => validate-file-existence.js} | 4 +- ...alidateNodeEnv.js => validate-node-env.js} | 0 .../{addValidations.js => add-validations.js} | 0 ...xtract-AMD-deps.js => extract-amd-deps.js} | 2 +- ...t-commonJS-deps.js => extract-cjs-deps.js} | 0 ...xtract-ES6-deps.js => extract-es6-deps.js} | 0 src/extract/clear-caches.js | 17 + src/extract/clearCaches.js | 17 - .../circular/{getCycle.js => get-cycle.js} | 0 src/extract/derive/circular/index.js | 2 +- src/extract/derive/orphan/index.js | 2 +- .../orphan/{isOrphan.js => is-orphan.js} | 0 src/extract/derive/reachable/index.js | 2 +- .../{isReachable.js => is-reachable.js} | 0 ...alSources.js => gather-initial-sources.js} | 2 +- .../{extract.js => get-dependencies.js} | 27 +- src/extract/index.js | 47 +- ...oJavascriptAST.js => to-javascript-ast.js} | 4 +- ...oTypescriptAST.js => to-typescript-ast.js} | 0 ...Types.js => determine-dependency-types.js} | 6 +- src/extract/resolve/index.js | 12 +- src/extract/resolve/{isCore.js => is-core.js} | 0 .../{isFollowable.js => is-followable.js} | 2 +- ...duleName.js => is-relative-module-name.js} | 0 ...ocalNpmHelpers.js => local-npm-helpers.js} | 4 +- .../index.js | 12 +- .../merge-packages.js} | 0 .../{resolve-AMD.js => resolve-amd.js} | 10 +- .../{resolve-commonJS.js => resolve-cjs.js} | 12 +- src/extract/resolve/resolve-helpers.js | 2 +- src/extract/resolve/resolve.js | 4 +- src/extract/summarize.js | 2 +- .../{coffeeWrap.js => coffeescript-wrap.js} | 0 .../{javaScriptWrap.js => javascript-wrap.js} | 0 ...ale.md => jsx-implementation-rationale.md} | 2 +- .../{liveScriptWrap.js => livescript-wrap.js} | 0 src/extract/transpile/meta.js | 16 +- .../{typeScriptWrap.js => typescript-wrap.js} | 0 .../{vueWrap.js => vue-template-wrap.js} | 0 ...Ness.js => detect-pre-compilation-ness.js} | 0 .../utl/{getExtension.js => get-extension.js} | 0 .../utl/{pathToPosix.js => path-to-posix.js} | 0 ...ipQueryParams.js => strip-query-params.js} | 0 .../normalize.js | 0 src/main/index.js | 8 +- src/main/options/normalize.js | 2 +- src/main/options/validate.js | 8 +- .../normalize.js | 0 src/main/{ruleSet => rule-set}/normalize.js | 0 src/main/{ruleSet => rule-set}/validate.js | 0 ...thElement.js => anonymize-path-element.js} | 2 +- .../{anonymizePath.js => anonymize-path.js} | 2 +- src/report/anon/index.js | 2 +- .../{randomString.js => random-string.js} | 0 src/report/csv/index.js | 2 +- .../{defaultTheme.json => default-theme.json} | 0 src/report/dot/index.js | 4 +- ...CustomLevel.js => prepare-custom-level.js} | 2 +- ...FolderLevel.js => prepare-folder-level.js} | 2 +- src/report/dot/theming.js | 2 +- src/report/err.js | 2 +- src/report/html/index.js | 2 +- .../utl/{compareRules.js => compare-rules.js} | 0 ....js => consolidate-module-dependencies.js} | 2 +- ...idateModules.js => consolidate-modules.js} | 2 +- ...teToFolder.js => consolidate-to-folder.js} | 4 +- ...ToPattern.js => consolidate-to-pattern.js} | 4 +- ...=> dependency-to-incidence-transformer.js} | 0 src/schema/README.md | 2 +- src/utl/{arrayUtil.js => array-util.js} | 0 ...findRuleByName.js => find-rule-by-name.js} | 0 src/validate/index.js | 4 +- ...duleOnlyRule.js => is-module-only-rule.js} | 0 ...ndencyRule.js => match-dependency-rule.js} | 2 +- ...atchModuleRule.js => match-module-rule.js} | 2 +- src/validate/matches.js | 2 +- .../index.spec.js | 4 +- .../merge-rule-sets.spec.js} | 2 +- .../mocks/extends/base-for-base.js | 0 .../mocks/extends/base-for-extends.js | 0 .../mocks/extends/circular-one.js | 0 .../mocks/extends/circular-two.js | 0 .../extending-array-with-one-member.json | 0 .../extending-array-with-two-members.json | 0 .../extending-array-with-zero-members.json | 0 .../extends/extending-from-node-modules.json | 0 .../mocks/extends/extending.json | 0 .../mocks/extends/merged-array-1.json | 0 .../mocks/extends/merged-array-2.json | 0 .../mocks/extends/merged.json | 0 .../base-from-node-modules/index.js | 0 .../base-from-node-modules/package.json | 0 .../extends/second-base-for-extends.json | 0 .../mocks/rules.sub-not-allowed-error.json | 0 ...leteDammit.utl.js => delete-dammit.utl.js} | 2 +- ...aInfo.spec.js => format-meta-info.spec.js} | 2 +- test/cli/format.spec.js | 2 +- ...fig.spec.js => get-resolve-config.spec.js} | 2 +- test/cli/index.spec.js | 4 +- .../create-config.spec.js} | 10 +- .../helpers.spec.js | 4 +- .../{initConfig => init-config}/index.spec.js | 6 +- ...ions.spec.js => normalize-options.spec.js} | 10 +- ...Config.spec.js => parse-ts-config.spec.js} | 4 +- test/cli/utl/io.spec.js | 12 +- ...Absolute.spec.js => make-absolute.spec.js} | 2 +- ...pec.js => validate-file-existence.spec.js} | 2 +- ...eEnv.spec.js => validate-node-env.spec.js} | 2 +- ...port.md => all-shapes-of-import-export.md} | 0 .../ast-extractors/extract-amd-deps.spec.js | 4 +- ...-deps.spec.js => extract-cjs-deps.spec.js} | 6 +- ...-deps.spec.js => extract-es6-deps.spec.js} | 4 +- .../ast-extractors/extract-typescript.utl.js | 2 +- .../{getCycle.spec.js => get-cycle.spec.js} | 2 +- .../{isOrphan.spec.js => is-orphan.spec.js} | 2 +- test/extract/derive/reachable/index.spec.js | 2 +- ...Reachable.spec.js => is-reachable.spec.js} | 2 +- ...spec.js => gather-initial-sources.spec.js} | 4 +- ...tract.spec.js => get-dependencies.spec.js} | 56 +- test/extract/index.cachebusting.spec.js | 2 +- test/extract/index.donotfollow.spec.js | 2 +- test/extract/index.exclude.spec.js | 2 +- test/extract/index.maxdepth.spec.js | 2 +- test/extract/index.reachable.spec.js | 4 +- test/extract/index.spec.js | 2 +- ....js => determine-dependency-types.spec.js} | 2 +- test/extract/resolve/index.spec.js | 4 +- .../{isCore.spec.js => is-core.spec.js} | 2 +- ...pec.js => is-relative-module-name.spec.js} | 2 +- ...pers.spec.js => local-npm-helpers.spec.js} | 2 +- .../amok-prevention-bogus-sub/.keepalive | 0 .../amok-prevention-non-exist/.keepalive | 0 .../fixtures/no-package-json-here/.keepalive | 0 .../package-json-in-here/package.json | 0 .../two-level-package-jsons/package.json | 0 .../packages/subthing/package.json | 0 .../index.spec.js | 20 +- .../merge-packages.spec.js} | 4 +- ...Wrap.spec.js => coffeescript-wrap.spec.js} | 6 +- ...ptWrap.spec.js => javascript-wrap.spec.js} | 2 +- ...ptWrap.spec.js => livescript-wrap.spec.js} | 2 +- test/extract/transpile/meta.spec.js | 4 +- ...ptWrap.spec.js => typescript-wrap.spec.js} | 4 +- ...Wrap.spec.js => vue-template-wrap.spec.js} | 2 +- ....js => compare.dependencies-equal.spec.js} | 0 ...js => detect-pre-compilation-ness.spec.js} | 2 +- ...xtension.spec.js => get-extension.spec.js} | 2 +- ...hToPosix.spec.js => path-to-posix.spec.js} | 2 +- ...ams.spec.js => strip-query-params.spec.js} | 2 +- .../normalize.spec.js | 8 +- test/main/options/validate.spec.js | 8 +- .../normalize.spec.js | 4 +- .../{ruleSet => rule-set}/normalize.spec.js | 4 +- .../{ruleSet => rule-set}/validate.spec.js | 6 +- ...spec.js => anonymize-path-element.spec.js} | 2 +- ...izePath.spec.js => anonymize-path.spec.js} | 4 +- test/report/anon/anonymize.spec.js | 2 +- ...omString.spec.js => random-string.spec.js} | 2 +- .../index.spec.js | 2 +- .../mocks/dependency-cruiser-2020-01-25.dot | 0 .../mocks/dependency-cruiser-2020-01-25.json | 0 .../mocks/orphans.dot | 0 .../mocks/orphans.json | 0 .../mocks/rxjs.dot | 0 .../mocks/rxjs.json | 0 ...tColoring.spec.js => dot-coloring.spec.js} | 0 .../folder-level.spec.js} | 2 +- .../mocks/dependency-cruiser-2019-01-14.dot | 0 .../mocks/dependency-cruiser-2019-01-14.json | 0 .../mocks/orphans.dot | 0 .../mocks/orphans.json | 0 .../mocks/rxjs.dot | 0 .../mocks/rxjs.json | 0 .../bareTheme.json | 0 .../index.spec.js | 4 +- .../mocks/bunch-of-modules-default-theme.dot | 0 .../mocks/bunch-of-modules.dot | 0 .../mocks/bunch-of-modules.json | 0 .../mocks/clusterless-default-theme.dot | 0 .../mocks/clusterless.dot | 0 .../mocks/clusterless.json | 0 .../do-not-follow-deps-default-theme.dot | 0 .../mocks/do-not-follow-deps.dot | 0 .../mocks/do-not-follow-deps.json | 0 .../es6-unresolvable-deps-default-theme.dot | 0 .../mocks/es6-unresolvable-deps.dot | 0 .../mocks/es6-unresolvable-deps.json | 0 .../mocks/orphan-deps-default-theme.dot | 0 .../mocks/orphan-deps.dot | 0 .../mocks/orphan-deps.json | 0 .../mocks/prefix-non-uri-default-theme.dot | 0 .../mocks/prefix-non-uri.dot | 0 .../mocks/prefix-non-uri.json | 0 .../mocks/prefix-uri-default-theme.dot | 0 .../mocks/prefix-uri.dot | 0 .../mocks/prefix-uri.json | 0 .../mocks/circular-deps-teamcity-format.txt | 8 +- .../mocks/module-errors-teamcity-format.txt | 20 +- ...areRules.spec.js => compare-rules.spec.js} | 2 +- ....spec.js => consolidate-to-folder.spec.js} | 2 +- ...spec.js => consolidate-to-pattern.spec.js} | 2 +- ...pendency-to-incidence-transformer.spec.js} | 2 +- ...Name.spec.js => find-rule-by-name.spec.js} | 2 +- ...e.spec.js => index.exotic-require.spec.js} | 0 ....js => index.pre-compilation-only.spec.js} | 0 test/validate/readruleset.utl.js | 4 +- types/dependency-cruiser.d.ts | 2 +- types/options.d.ts | 2 +- 241 files changed, 3729 insertions(+), 3594 deletions(-) rename src/cli/{compileConfig => compile-config}/index.js (88%) rename src/cli/{compileConfig/mergeConfigs.js => compile-config/merge-configs.js} (100%) rename src/cli/{compileConfig/readConfig.js => compile-config/read-config.js} (85%) rename src/cli/{formatMetaInfo.js => format-meta-info.js} (100%) rename src/cli/{getResolveConfig.js => get-resolve-config.js} (95%) rename src/cli/{initConfig => init-config}/config.js.template.hbs (100%) rename src/cli/{initConfig => init-config}/config.js.template.js (100%) rename src/cli/{initConfig/createConfigFile.js => init-config/create-config-file.js} (90%) rename src/cli/{initConfig/getUserInput.js => init-config/get-user-input.js} (100%) rename src/cli/{initConfig => init-config}/helpers.js (94%) rename src/cli/{initConfig => init-config}/index.js (92%) rename src/cli/{normalizeOptions.js => normalize-options.js} (97%) rename src/cli/{parseTSConfig.js => parse-ts-config.js} (100%) rename src/cli/utl/{makeAbsolute.js => make-absolute.js} (100%) rename src/cli/utl/{validateFileExistence.js => validate-file-existence.js} (52%) rename src/cli/{validateNodeEnv.js => validate-node-env.js} (100%) rename src/extract/{addValidations.js => add-validations.js} (100%) rename src/extract/ast-extractors/{extract-AMD-deps.js => extract-amd-deps.js} (96%) rename src/extract/ast-extractors/{extract-commonJS-deps.js => extract-cjs-deps.js} (100%) rename src/extract/ast-extractors/{extract-ES6-deps.js => extract-es6-deps.js} (100%) create mode 100644 src/extract/clear-caches.js delete mode 100644 src/extract/clearCaches.js rename src/extract/derive/circular/{getCycle.js => get-cycle.js} (100%) rename src/extract/derive/orphan/{isOrphan.js => is-orphan.js} (100%) rename src/extract/derive/reachable/{isReachable.js => is-reachable.js} (100%) rename src/extract/{gatherInitialSources.js => gather-initial-sources.js} (98%) rename src/extract/{extract.js => get-dependencies.js} (87%) rename src/extract/parse/{toJavascriptAST.js => to-javascript-ast.js} (95%) rename src/extract/parse/{toTypescriptAST.js => to-typescript-ast.js} (100%) rename src/extract/resolve/{determineDependencyTypes.js => determine-dependency-types.js} (97%) rename src/extract/resolve/{isCore.js => is-core.js} (100%) rename src/extract/resolve/{isFollowable.js => is-followable.js} (96%) rename src/extract/resolve/{isRelativeModuleName.js => is-relative-module-name.js} (100%) rename src/extract/resolve/{localNpmHelpers.js => local-npm-helpers.js} (98%) rename src/extract/resolve/{readPackageDeps => read-package-deps}/index.js (95%) rename src/extract/resolve/{readPackageDeps/mergePackages.js => read-package-deps/merge-packages.js} (100%) rename src/extract/resolve/{resolve-AMD.js => resolve-amd.js} (86%) rename src/extract/resolve/{resolve-commonJS.js => resolve-cjs.js} (81%) rename src/extract/transpile/{coffeeWrap.js => coffeescript-wrap.js} (100%) rename src/extract/transpile/{javaScriptWrap.js => javascript-wrap.js} (100%) rename src/extract/transpile/{jsxImplementationRationale.md => jsx-implementation-rationale.md} (98%) rename src/extract/transpile/{liveScriptWrap.js => livescript-wrap.js} (100%) rename src/extract/transpile/{typeScriptWrap.js => typescript-wrap.js} (100%) rename src/extract/transpile/{vueWrap.js => vue-template-wrap.js} (100%) rename src/extract/utl/{detectPreCompilationNess.js => detect-pre-compilation-ness.js} (100%) rename src/extract/utl/{getExtension.js => get-extension.js} (100%) rename src/extract/utl/{pathToPosix.js => path-to-posix.js} (100%) rename src/extract/utl/{stripQueryParams.js => strip-query-params.js} (100%) rename src/main/{filesAndDirs => files-and-dirs}/normalize.js (100%) rename src/main/{resolveOptions => resolve-options}/normalize.js (100%) rename src/main/{ruleSet => rule-set}/normalize.js (100%) rename src/main/{ruleSet => rule-set}/validate.js (100%) rename src/report/anon/{anonymizePathElement.js => anonymize-path-element.js} (97%) rename src/report/anon/{anonymizePath.js => anonymize-path.js} (95%) rename src/report/anon/{randomString.js => random-string.js} (100%) rename src/report/dot/{defaultTheme.json => default-theme.json} (100%) rename src/report/dot/{prepareCustomLevel.js => prepare-custom-level.js} (90%) rename src/report/dot/{prepareFolderLevel.js => prepare-folder-level.js} (86%) rename src/report/utl/{compareRules.js => compare-rules.js} (100%) rename src/report/utl/{consolidateModuleDependencies.js => consolidate-module-dependencies.js} (96%) rename src/report/utl/{consolidateModules.js => consolidate-modules.js} (96%) rename src/report/utl/{consolidateToFolder.js => consolidate-to-folder.js} (77%) rename src/report/utl/{consolidateToPattern.js => consolidate-to-pattern.js} (86%) rename src/report/utl/{dependencyToIncidenceTransformer.js => dependency-to-incidence-transformer.js} (100%) rename src/utl/{arrayUtil.js => array-util.js} (100%) rename src/utl/{findRuleByName.js => find-rule-by-name.js} (100%) rename src/validate/{isModuleOnlyRule.js => is-module-only-rule.js} (100%) rename src/validate/{matchDependencyRule.js => match-dependency-rule.js} (97%) rename src/validate/{matchModuleRule.js => match-module-rule.js} (95%) rename test/cli/{compileConfig => compile-config}/index.spec.js (96%) rename test/cli/{compileConfig/mergeRuleSets.spec.js => compile-config/merge-rule-sets.spec.js} (99%) rename test/cli/{compileConfig => compile-config}/mocks/extends/base-for-base.js (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/base-for-extends.js (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/circular-one.js (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/circular-two.js (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/extending-array-with-one-member.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/extending-array-with-two-members.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/extending-array-with-zero-members.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/extending-from-node-modules.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/extending.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/merged-array-1.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/merged-array-2.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/merged.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/node_modules/base-from-node-modules/index.js (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/node_modules/base-from-node-modules/package.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/extends/second-base-for-extends.json (100%) rename test/cli/{compileConfig => compile-config}/mocks/rules.sub-not-allowed-error.json (100%) rename test/cli/{deleteDammit.utl.js => delete-dammit.utl.js} (87%) rename test/cli/{formatMetaInfo.spec.js => format-meta-info.spec.js} (83%) rename test/cli/{getResolveConfig.spec.js => get-resolve-config.spec.js} (97%) rename test/cli/{initConfig/createConfig.spec.js => init-config/create-config.spec.js} (95%) rename test/cli/{initConfig => init-config}/helpers.spec.js (92%) rename test/cli/{initConfig => init-config}/index.spec.js (96%) rename test/cli/{normalizeOptions.spec.js => normalize-options.spec.js} (96%) rename test/cli/{parseTSConfig.spec.js => parse-ts-config.spec.js} (97%) rename test/cli/utl/{makeAbsolute.spec.js => make-absolute.spec.js} (86%) rename test/cli/utl/{validateFileExistence.spec.js => validate-file-existence.spec.js} (96%) rename test/cli/{validateNodeEnv.spec.js => validate-node-env.spec.js} (95%) rename test/extract/ast-extractors/{allShapesOfImportExport.md => all-shapes-of-import-export.md} (100%) rename test/extract/ast-extractors/{extract-commonjs-deps.spec.js => extract-cjs-deps.spec.js} (94%) rename test/extract/ast-extractors/{extract-ES6-deps.spec.js => extract-es6-deps.spec.js} (95%) rename test/extract/derive/circular/{getCycle.spec.js => get-cycle.spec.js} (99%) rename test/extract/derive/orphan/{isOrphan.spec.js => is-orphan.spec.js} (98%) rename test/extract/derive/reachable/{isReachable.spec.js => is-reachable.spec.js} (99%) rename test/extract/{gatherInitialSources.spec.js => gather-initial-sources.spec.js} (98%) rename test/extract/{extract.spec.js => get-dependencies.spec.js} (87%) rename test/extract/resolve/{determineDependencyTypes.spec.js => determine-dependency-types.spec.js} (99%) rename test/extract/resolve/{isCore.spec.js => is-core.spec.js} (91%) rename test/extract/resolve/{isRelativeModuleName.spec.js => is-relative-module-name.spec.js} (98%) rename test/extract/resolve/{localNpmHelpers.spec.js => local-npm-helpers.spec.js} (99%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/fixtures/amok-prevention-bogus-sub/.keepalive (100%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/fixtures/amok-prevention-non-exist/.keepalive (100%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/fixtures/no-package-json-here/.keepalive (100%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/fixtures/package-json-in-here/package.json (100%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/fixtures/two-level-package-jsons/package.json (100%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/fixtures/two-level-package-jsons/packages/subthing/package.json (100%) rename test/extract/resolve/{readPackageDeps => read-package-deps}/index.spec.js (84%) rename test/extract/resolve/{readPackageDeps/mergePackages.spec.js => read-package-deps/merge-packages.spec.js} (95%) rename test/extract/transpile/{coffeeWrap.spec.js => coffeescript-wrap.spec.js} (91%) rename test/extract/transpile/{javascriptWrap.spec.js => javascript-wrap.spec.js} (91%) rename test/extract/transpile/{liveScriptWrap.spec.js => livescript-wrap.spec.js} (74%) rename test/extract/transpile/{typeScriptWrap.spec.js => typescript-wrap.spec.js} (87%) rename test/extract/transpile/{vueWrap.spec.js => vue-template-wrap.spec.js} (94%) rename test/extract/utl/{compare.dependenciesEqual.spec.js => compare.dependencies-equal.spec.js} (100%) rename test/extract/utl/{detectPreCompilationNess.spec.js => detect-pre-compilation-ness.spec.js} (97%) rename test/extract/utl/{getExtension.spec.js => get-extension.spec.js} (89%) rename test/extract/utl/{pathToPosix.spec.js => path-to-posix.spec.js} (95%) rename test/extract/utl/{stripQueryParams.spec.js => strip-query-params.spec.js} (97%) rename test/main/{filesAndDirs => files-and-dirs}/normalize.spec.js (82%) rename test/main/{resolveOptions => resolve-options}/normalize.spec.js (98%) rename test/main/{ruleSet => rule-set}/normalize.spec.js (96%) rename test/main/{ruleSet => rule-set}/validate.spec.js (95%) rename test/report/anon/{anonymizePathElement.spec.js => anonymize-path-element.spec.js} (98%) rename test/report/anon/{anonymizePath.spec.js => anonymize-path.spec.js} (97%) rename test/report/anon/{randomString.spec.js => random-string.spec.js} (94%) rename test/report/dot/{customLevel => custom-level}/index.spec.js (96%) rename test/report/dot/{customLevel => custom-level}/mocks/dependency-cruiser-2020-01-25.dot (100%) rename test/report/dot/{customLevel => custom-level}/mocks/dependency-cruiser-2020-01-25.json (100%) rename test/report/dot/{customLevel => custom-level}/mocks/orphans.dot (100%) rename test/report/dot/{customLevel => custom-level}/mocks/orphans.json (100%) rename test/report/dot/{customLevel => custom-level}/mocks/rxjs.dot (100%) rename test/report/dot/{customLevel => custom-level}/mocks/rxjs.json (100%) rename test/report/dot/{dotColoring.spec.js => dot-coloring.spec.js} (100%) rename test/report/dot/{folderLevel/folderLevel.spec.js => folder-level/folder-level.spec.js} (96%) rename test/report/dot/{folderLevel => folder-level}/mocks/dependency-cruiser-2019-01-14.dot (100%) rename test/report/dot/{folderLevel => folder-level}/mocks/dependency-cruiser-2019-01-14.json (100%) rename test/report/dot/{folderLevel => folder-level}/mocks/orphans.dot (100%) rename test/report/dot/{folderLevel => folder-level}/mocks/orphans.json (100%) rename test/report/dot/{folderLevel => folder-level}/mocks/rxjs.dot (100%) rename test/report/dot/{folderLevel => folder-level}/mocks/rxjs.json (100%) rename test/report/dot/{moduleLevel => module-level}/bareTheme.json (100%) rename test/report/dot/{moduleLevel => module-level}/index.spec.js (98%) rename test/report/dot/{moduleLevel => module-level}/mocks/bunch-of-modules-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/bunch-of-modules.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/bunch-of-modules.json (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/clusterless-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/clusterless.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/clusterless.json (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/do-not-follow-deps-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/do-not-follow-deps.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/do-not-follow-deps.json (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/es6-unresolvable-deps-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/es6-unresolvable-deps.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/es6-unresolvable-deps.json (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/orphan-deps-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/orphan-deps.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/orphan-deps.json (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/prefix-non-uri-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/prefix-non-uri.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/prefix-non-uri.json (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/prefix-uri-default-theme.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/prefix-uri.dot (100%) rename test/report/dot/{moduleLevel => module-level}/mocks/prefix-uri.json (100%) rename test/report/utl/{compareRules.spec.js => compare-rules.spec.js} (94%) rename test/report/utl/{consolidateToFolder.spec.js => consolidate-to-folder.spec.js} (98%) rename test/report/utl/{consolidateToPattern.spec.js => consolidate-to-pattern.spec.js} (99%) rename test/report/utl/{dependencyToIncidenceTransformer.spec.js => dependency-to-incidence-transformer.spec.js} (91%) rename test/utl/{findRuleByName.spec.js => find-rule-by-name.spec.js} (94%) rename test/validate/{index.exoticRequire.spec.js => index.exotic-require.spec.js} (100%) rename test/validate/{index.preCompilationOnly.spec.js => index.pre-compilation-only.spec.js} (100%) diff --git a/.dependency-cruiser.json b/.dependency-cruiser.json index dbcfb8081..6ac23d257 100644 --- a/.dependency-cruiser.json +++ b/.dependency-cruiser.json @@ -16,12 +16,21 @@ "severity": "error", "from": { "path": "(^src/cli/)", - "pathNot": "^(src/cli/compileConfig/index\\.js)$" + "pathNot": "^(src/cli/compile-config/index\\.js)$" }, "to": { "pathNot": "^src/main/|^node_modules|^fs$|^path$|$1|^package.json$" } }, + { + "name": "cli-to-main-only-warn", + "comment": "This cli module depends on something not in the public interface - which means it either doesn't belong in cli, or the main public interface needs to be expanded (this warn-only rule is a temporary exception for the compileConfig depending on the resolver).", + "severity": "warn", + "from": { "path": "^(src/cli/compile-config/index\\.js)$" }, + "to": { + "pathNot": "$1|^src/(cli|main)|^node_modules|^(fs|path|package.json)$" + } + }, { "name": "report-stays-in-report", "comment": "This reporting module depends directly on a non-reporting one that is not a utility. That is odd as reporting modules should only read dependency cruiser output json.", @@ -45,15 +54,6 @@ "exoticallyRequired": false } }, - { - "name": "cli-to-main-only-warn", - "comment": "This cli module depends on something not in the public interface - which means it either doesn't belong in cli, or the main public interface needs to be expanded (this warn-only rule is a temporary exception for the compileConfig depending on the resolver).", - "severity": "warn", - "from": { "path": "^(src/cli/compileConfig/index\\.js)$" }, - "to": { - "pathNot": "$1|^src/(cli|main)|^node_modules|^(fs|path|package.json)$" - } - }, { "name": "bin-to-cli-only", "comment": "This module in the bin/ folder depends on something not in the cli interface. This means it either contains code that doesn't belong in bin/, or the thing it depends upon should be put in the cli interface. ", @@ -66,7 +66,7 @@ "comment": "This module depends on a the node 'fs' module, and it resides in a spot where that is not allowed.", "severity": "error", "from": { - "pathNot": "^src/(extract/parse|extract/resolve|extract/gatherInitialSources\\.js|cli)|^test|^utl" + "pathNot": "^src/(extract/parse|extract/resolve|extract/gather-initial-sources\\.js|cli)|^test|^utl" }, "to": { "path": "^fs$" } }, diff --git a/.gitignore b/.gitignore index 383efdfbc..753103911 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .project .settings/* .vscode +.idea # metrics results .nyc_output diff --git a/Makefile b/Makefile index 4899fcb40..89af8807c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .SUFFIXES: .js .css .html NODE=node RM=rm -f -GENERATED_SOURCES=src/cli/initConfig/config.js.template.js \ +GENERATED_SOURCES=src/cli/init-config/config.js.template.js \ src/report/csv/csv.template.js \ src/report/dot/dot.template.js \ src/report/html/html.template.js \ diff --git a/bin/depcruise-fmt.js b/bin/depcruise-fmt.js index 639a97041..1e6f175b1 100755 --- a/bin/depcruise-fmt.js +++ b/bin/depcruise-fmt.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -const validateNodeEnv = require("../src/cli/validateNodeEnv"); +const validateNodeEnv = require("../src/cli/validate-node-env"); function formatError(pError) { process.stderr.write(pError.message); @@ -42,6 +42,6 @@ try { } else { program.help(); } -} catch (e) { - formatError(e); +} catch (pError) { + formatError(pError); } diff --git a/bin/dependency-cruise.js b/bin/dependency-cruise.js index e0e8856bf..879b2ad79 100755 --- a/bin/dependency-cruise.js +++ b/bin/dependency-cruise.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -const validateNodeEnv = require("../src/cli/validateNodeEnv"); +const validateNodeEnv = require("../src/cli/validate-node-env"); try { validateNodeEnv(); @@ -90,7 +90,7 @@ try { } else { program.help(); } -} catch (e) { - process.stderr.write(e.message); +} catch (pError) { + process.stderr.write(pError.message); process.exitCode = 1; } diff --git a/configs/eslint-config.json b/configs/eslint-config.json index 41928665a..1a51582b1 100644 --- a/configs/eslint-config.json +++ b/configs/eslint-config.json @@ -1,5 +1,5 @@ { - "plugins": ["security", "mocha", "node", "import"], + "plugins": ["security", "mocha", "node", "import", "unicorn"], "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", @@ -281,6 +281,54 @@ "import/no-named-export": "error", "import/no-anonymous-default-export": "error", "import/group-exports": "off", - "dynamic-import-chunkname": "off" + "dynamic-import-chunkname": "off", + + "unicorn/better-regex": "off", + "unicorn/catch-error-name": ["error", { "name": "pError" }], + "unicorn/consistent-function-scoping": "off", + "unicorn/custom-error-definition": "off", + "unicorn/error-message": "error", + "unicorn/escape-case": "error", + "unicorn/expiring-todo-comments": "error", + "unicorn/explicit-length-check": "error", + "unicorn/filename-case": ["error", { "case": "kebabCase" }], + "unicorn/import-index": "off", + "unicorn/new-for-builtins": "off", // conflicts with security/detect-non-literal-regexp, apparently + "unicorn/no-abusive-eslint-disable": "error", + "unicorn/no-array-instanceof": "error", + "unicorn/no-console-spaces": "error", + "unicorn/no-fn-reference-in-iterator": "off", + "unicorn/no-for-loop": "error", + "unicorn/no-hex-escape": "error", + "unicorn/no-keyword-prefix": "off", + "no-nested-ternary": "off", + "unicorn/no-nested-ternary": "error", + "unicorn/no-new-buffer": "error", + "unicorn/no-process-exit": "error", + "unicorn/no-unreadable-array-destructuring": "error", + "unicorn/no-unsafe-regex": "error", + "unicorn/no-unused-properties": "off", + "unicorn/no-zero-fractions": "error", + "unicorn/number-literal-case": "error", + "unicorn/prefer-add-event-listener": "error", + "unicorn/prefer-dataset": "error", + "unicorn/prefer-event-key": "error", + "unicorn/prefer-flat-map": "error", + "unicorn/prefer-includes": "error", + "unicorn/prefer-modern-dom-apis": "error", + "unicorn/prefer-negative-index": "error", + "unicorn/prefer-node-append": "error", + "unicorn/prefer-node-remove": "error", + "unicorn/prefer-query-selector": "error", + "unicorn/prefer-reflect-apply": "error", + "unicorn/prefer-replace-all": "off", + "unicorn/prefer-spread": "error", + "unicorn/prefer-starts-ends-with": "error", + "unicorn/prefer-string-slice": "error", + "unicorn/prefer-text-content": "error", + "unicorn/prefer-trim-start-end": "error", + "unicorn/prefer-type-error": "off", + "unicorn/prevent-abbreviations": "off", + "unicorn/throw-new-error": "error" } } diff --git a/doc/assets/theming/bare.svg b/doc/assets/theming/bare.svg index e9923fad3..ac477960d 100644 --- a/doc/assets/theming/bare.svg +++ b/doc/assets/theming/bare.svg @@ -4,140 +4,160 @@ - + dependency-cruiser output - + cluster_src - -src + +src cluster_src/main - -main + +main -cluster_src/main/options - -options +cluster_src/main/files-and-dirs + +files-and-dirs -cluster_src/main/resolveOptions - -resolveOptions +cluster_src/main/options + +options -cluster_src/main/ruleSet - -ruleSet +cluster_src/main/resolve-options + +resolve-options - + +cluster_src/main/rule-set + +rule-set + + -src/main/index.js - - -index.js +src/main/files-and-dirs/normalize.js + + +normalize.js - + -src/main/options/normalize.js - - -normalize.js +src/main/index.js + + +index.js - + -src/main/index.js->src/main/options/normalize.js - - +src/main/index.js->src/main/files-and-dirs/normalize.js + + - + -src/main/options/validate.js - - -validate.js +src/main/options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/options/validate.js - - +src/main/index.js->src/main/options/normalize.js + + - + -src/main/resolveOptions/normalize.js - - -normalize.js +src/main/options/validate.js + + +validate.js - + -src/main/index.js->src/main/resolveOptions/normalize.js - - +src/main/index.js->src/main/options/validate.js + + - + -src/main/ruleSet/normalize.js - - -normalize.js +src/main/resolve-options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/normalize.js - - +src/main/index.js->src/main/resolve-options/normalize.js + + - + -src/main/ruleSet/validate.js - - -validate.js +src/main/rule-set/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/validate.js - - +src/main/index.js->src/main/rule-set/normalize.js + + - + -src/main/options/defaults.json - - -defaults.json +src/main/rule-set/validate.js + + +validate.js - + -src/main/options/normalize.js->src/main/options/defaults.json - - +src/main/index.js->src/main/rule-set/validate.js + + + + + +src/main/options/defaults.json + + +defaults.json + + - + -src/main/ruleSet/validate.js->src/main/options/validate.js - - +src/main/options/normalize.js->src/main/options/defaults.json + + + + + +src/main/rule-set/validate.js->src/main/options/validate.js + + diff --git a/doc/assets/theming/base.svg b/doc/assets/theming/base.svg index 9e1497a48..e235a5729 100644 --- a/doc/assets/theming/base.svg +++ b/doc/assets/theming/base.svg @@ -4,140 +4,160 @@ - - + + dependency-cruiser output - + cluster_src - -src + +src cluster_src/main - -main + +main -cluster_src/main/options - -options +cluster_src/main/files-and-dirs + +files-and-dirs -cluster_src/main/resolveOptions - -resolveOptions +cluster_src/main/options + +options -cluster_src/main/ruleSet - -ruleSet +cluster_src/main/resolve-options + +resolve-options - + +cluster_src/main/rule-set + +rule-set + + -src/main/index.js - - -index.js +src/main/files-and-dirs/normalize.js + + +normalize.js - + -src/main/options/normalize.js - - -normalize.js +src/main/index.js + + +index.js - + -src/main/index.js->src/main/options/normalize.js - - +src/main/index.js->src/main/files-and-dirs/normalize.js + + - + -src/main/options/validate.js - - -validate.js +src/main/options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/options/validate.js - - +src/main/index.js->src/main/options/normalize.js + + - + -src/main/resolveOptions/normalize.js - - -normalize.js +src/main/options/validate.js + + +validate.js - + -src/main/index.js->src/main/resolveOptions/normalize.js - - +src/main/index.js->src/main/options/validate.js + + - + -src/main/ruleSet/normalize.js - - -normalize.js +src/main/resolve-options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/normalize.js - - +src/main/index.js->src/main/resolve-options/normalize.js + + - + -src/main/ruleSet/validate.js - - -validate.js +src/main/rule-set/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/validate.js - - +src/main/index.js->src/main/rule-set/normalize.js + + - + -src/main/options/defaults.json - - -defaults.json +src/main/rule-set/validate.js + + +validate.js - + -src/main/options/normalize.js->src/main/options/defaults.json - - +src/main/index.js->src/main/rule-set/validate.js + + + + + +src/main/options/defaults.json + + +defaults.json + + - + -src/main/ruleSet/validate.js->src/main/options/validate.js - - +src/main/options/normalize.js->src/main/options/defaults.json + + + + + +src/main/rule-set/validate.js->src/main/options/validate.js + + diff --git a/doc/assets/theming/engineering.svg b/doc/assets/theming/engineering.svg index d3a9be42e..3cc2f56cc 100644 --- a/doc/assets/theming/engineering.svg +++ b/doc/assets/theming/engineering.svg @@ -4,148 +4,168 @@ - - + + dependency-cruiser output - + cluster_src - -src + +src cluster_src/main - -main + +main -cluster_src/main/options - -options +cluster_src/main/files-and-dirs + +files-and-dirs -cluster_src/main/resolveOptions - -resolveOptions +cluster_src/main/options + +options -cluster_src/main/ruleSet - -ruleSet +cluster_src/main/resolve-options + +resolve-options - + +cluster_src/main/rule-set + +rule-set + + -src/main/index.js - - -index.js +src/main/files-and-dirs/normalize.js + + +normalize.js - + -src/main/options/normalize.js - - -normalize.js +src/main/index.js + + +index.js - + -src/main/index.js->src/main/options/normalize.js - - +src/main/index.js->src/main/files-and-dirs/normalize.js + + - + -src/main/options/validate.js - - -validate.js +src/main/options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/options/validate.js - - +src/main/index.js->src/main/options/normalize.js + + - + -src/main/resolveOptions/normalize.js - - -normalize.js +src/main/options/validate.js + + +validate.js - + -src/main/index.js->src/main/resolveOptions/normalize.js - - +src/main/index.js->src/main/options/validate.js + + - + -src/main/ruleSet/normalize.js - - -normalize.js +src/main/resolve-options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/normalize.js - - +src/main/index.js->src/main/resolve-options/normalize.js + + - + -src/main/ruleSet/validate.js - - -validate.js +src/main/rule-set/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/validate.js - - +src/main/index.js->src/main/rule-set/normalize.js + + - + +src/main/rule-set/validate.js + + +validate.js + + + + + +src/main/index.js->src/main/rule-set/validate.js + + + + + src/main/options/defaults.json - + - + - - -defaults.json + + +defaults.json - -src/main/options/normalize.js->src/main/options/defaults.json - - - - - -src/main/ruleSet/validate.js->src/main/options/validate.js - - +src/main/options/normalize.js->src/main/options/defaults.json + + + + + + +src/main/rule-set/validate.js->src/main/options/validate.js + + diff --git a/doc/assets/theming/vertical.svg b/doc/assets/theming/vertical.svg index e01dc2c72..99f45fff1 100644 --- a/doc/assets/theming/vertical.svg +++ b/doc/assets/theming/vertical.svg @@ -4,140 +4,160 @@ - + dependency-cruiser output - + cluster_src - -src + +src cluster_src/main - -main + +main -cluster_src/main/options - -options +cluster_src/main/files-and-dirs + +files-and-dirs -cluster_src/main/resolveOptions - -resolveOptions +cluster_src/main/options + +options -cluster_src/main/ruleSet - -ruleSet +cluster_src/main/resolve-options + +resolve-options - + +cluster_src/main/rule-set + +rule-set + + -src/main/index.js - - -index.js +src/main/files-and-dirs/normalize.js + + +normalize.js - + -src/main/options/normalize.js - - -normalize.js +src/main/index.js + + +index.js - + -src/main/index.js->src/main/options/normalize.js - - +src/main/index.js->src/main/files-and-dirs/normalize.js + + - + -src/main/options/validate.js - - -validate.js +src/main/options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/options/validate.js - - +src/main/index.js->src/main/options/normalize.js + + - + -src/main/resolveOptions/normalize.js - - -normalize.js +src/main/options/validate.js + + +validate.js - + -src/main/index.js->src/main/resolveOptions/normalize.js - - +src/main/index.js->src/main/options/validate.js + + - + -src/main/ruleSet/normalize.js - - -normalize.js +src/main/resolve-options/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/normalize.js - - +src/main/index.js->src/main/resolve-options/normalize.js + + - + -src/main/ruleSet/validate.js - - -validate.js +src/main/rule-set/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/validate.js - - +src/main/index.js->src/main/rule-set/normalize.js + + - + -src/main/options/defaults.json - - -defaults.json +src/main/rule-set/validate.js + + +validate.js - + -src/main/options/normalize.js->src/main/options/defaults.json - - +src/main/index.js->src/main/rule-set/validate.js + + + + + +src/main/options/defaults.json + + +defaults.json + + - + -src/main/ruleSet/validate.js->src/main/options/validate.js - - +src/main/options/normalize.js->src/main/options/defaults.json + + + + + +src/main/rule-set/validate.js->src/main/options/validate.js + + diff --git a/doc/real-world-samples/dependency-cruiser-dir-graph.svg b/doc/real-world-samples/dependency-cruiser-dir-graph.svg index cd867e221..943ae81f7 100644 --- a/doc/real-world-samples/dependency-cruiser-dir-graph.svg +++ b/doc/real-world-samples/dependency-cruiser-dir-graph.svg @@ -4,55 +4,55 @@ - + dependency-cruiser output - + cluster_src - -src + +src - -cluster_src/report - -report + +cluster_src/cli + +cli cluster_src/extract - -extract + +extract cluster_src/extract/derive - -derive + +derive cluster_src/extract/resolve - -resolve + +resolve cluster_src/main - -main + +main - -cluster_src/cli - -cli + +cluster_src/report + +report bin - - - - -bin + + + + +bin @@ -60,388 +60,394 @@ bin->src/cli - - + + src/cli/tools - - - - -tools + + + + +tools bin->src/cli/tools - - + + src/cli->src/main - - + + src/cli/utl - - - - -utl + + + + +utl src/cli->src/cli/utl - - + + - + -src/cli/compileConfig - - - - - -compileConfig +src/cli/compile-config + + + + + +compile-config - + -src/cli->src/cli/compileConfig - - +src/cli->src/cli/compile-config + + - + -src/cli/initConfig - - - - - -initConfig +src/cli/init-config + + + + + +init-config - + -src/cli->src/cli/initConfig - - +src/cli->src/cli/init-config + + - + -src/main/resolveOptions - - - - - -resolveOptions +src/main/resolve-options + + + + + +resolve-options - + -src/main->src/main/resolveOptions - - +src/main->src/main/resolve-options + + src/main->src/extract - - + + - + src/extract/transpile - - - - - -transpile + + + + + +transpile src/main->src/extract/transpile - - + + src/main->src/report - - + + src/schema - - - - -schema + + + + +schema src/main->src/schema - - + + - + -src/main/filesAndDirs - - - - - -filesAndDirs +src/main/files-and-dirs + + + + + +files-and-dirs - + -src/main->src/main/filesAndDirs - - +src/main->src/main/files-and-dirs + + src/main/options - - - - -options + + + + +options src/main->src/main/options - - + + - + -src/main/ruleSet - - - - - -ruleSet +src/main/rule-set + + + + + +rule-set - + -src/main->src/main/ruleSet - - +src/main->src/main/rule-set + + - + -src/cli/compileConfig->src/extract/resolve +src/cli/compile-config->src/extract/resolve - - + + -cli-to-main-only-warn +cli-to-main-only-warn - + -src/cli/compileConfig->src/main/resolveOptions - - +src/cli/compile-config->src/main/resolve-options + + - + -src/cli/initConfig->src/cli - - +src/cli/init-config->src/cli + + src/extract/utl - - - - -utl + + + + +utl src/extract/resolve->src/extract/utl - - + + - + -src/extract/resolve/readPackageDeps - - - - - -readPackageDeps +src/extract/resolve/read-package-deps + + + + + +read-package-deps - + -src/extract/resolve->src/extract/resolve/readPackageDeps - - +src/extract/resolve->src/extract/resolve/read-package-deps + + - + -src/main/resolveOptions->src/extract/transpile - - +src/main/resolve-options->src/extract/transpile + + src/extract->src/extract/resolve - - + + src/extract/derive/circular - - - - -circular + + + + +circular src/extract->src/extract/derive/circular - - + + src/extract/derive/orphan - - - - -orphan + + + + +orphan src/extract->src/extract/derive/orphan - - + + src/extract/derive/reachable - - - - -reachable + + + + +reachable src/extract->src/extract/derive/reachable - - + + src/extract->src/extract/utl - - + + src/validate - - - - -validate + + + + +validate src/extract->src/validate - - + + src/extract/parse - - - - -parse + + + + +parse src/extract->src/extract/parse - - + + - + -src/extract->src/extract/resolve/readPackageDeps - - +src/extract->src/extract/resolve/read-package-deps + + + + + +src/extract->src/extract/transpile + + - + src/utl - + @@ -451,197 +457,191 @@ - + src/extract->src/utl - - + + - + src/extract/ast-extractors - - - - - -ast-extractors + + + + + +ast-extractors - -src/extract->src/extract/ast-extractors - - - - -src/extract->src/extract/transpile - - +src/extract->src/extract/ast-extractors + + src/validate->src/utl - - + + src/extract/parse->src/extract/utl - - + + src/extract/parse->src/extract/transpile - - + + src/report->src/utl - - + + src/report/anon - - - - -anon + + + + +anon src/report->src/report/anon - - + + src/report/csv - - - - -csv + + + + +csv src/report->src/report/csv - - + + src/report/dot - - - - -dot + + + + +dot src/report->src/report/dot - - + + src/report/err-html - - - - -err-html + + + + +err-html src/report->src/report/err-html - - + + src/report/html - - - - -html + + + + +html src/report->src/report/html - - + + src/main/options->src/report - - + + - + -src/main/ruleSet->src/schema - - +src/main/rule-set->src/schema + + - + -src/main/ruleSet->src/main/options - - +src/main/rule-set->src/main/options + + src/report/utl - - - - -utl + + + + +utl src/report/csv->src/report/utl - - + + src/report/dot->src/report/utl - - + + src/report/html->src/report/utl - - + + diff --git a/doc/real-world-samples/dependency-cruiser-without-node_modules.svg b/doc/real-world-samples/dependency-cruiser-without-node_modules.svg index 3e452529a..2ac02ecb5 100644 --- a/doc/real-world-samples/dependency-cruiser-without-node_modules.svg +++ b/doc/real-world-samples/dependency-cruiser-without-node_modules.svg @@ -4,182 +4,182 @@ - - + + dependency-cruiser output - + cluster_bin - -bin + +bin cluster_src - -src + +src cluster_src/cli - -cli + +cli -cluster_src/cli/compileConfig - -compileConfig +cluster_src/cli/compile-config + +compile-config -cluster_src/cli/initConfig - -initConfig +cluster_src/cli/init-config + +init-config cluster_src/cli/tools - -tools + +tools cluster_src/cli/utl - -utl + +utl + + +cluster_src/extract + +extract + + +cluster_src/extract/ast-extractors + +ast-extractors + + +cluster_src/extract/derive + +derive + + +cluster_src/extract/derive/circular + +circular + + +cluster_src/extract/derive/orphan + +orphan + + +cluster_src/extract/derive/reachable + +reachable + + +cluster_src/extract/parse + +parse + + +cluster_src/extract/resolve + +resolve + + +cluster_src/extract/resolve/read-package-deps + +read-package-deps + + +cluster_src/extract/transpile + +transpile + + +cluster_src/extract/utl + +utl cluster_src/main - -main + +main -cluster_src/main/filesAndDirs - -filesAndDirs +cluster_src/main/files-and-dirs + +files-and-dirs cluster_src/main/options - -options + +options -cluster_src/main/resolveOptions - -resolveOptions +cluster_src/main/resolve-options + +resolve-options -cluster_src/main/ruleSet - -ruleSet +cluster_src/main/rule-set + +rule-set cluster_src/report - -report + +report cluster_src/report/anon - -anon + +anon cluster_src/report/csv - -csv + +csv cluster_src/report/dot - -dot + +dot cluster_src/report/err-html - -err-html + +err-html cluster_src/report/html - -html + +html cluster_src/report/utl - -utl + +utl cluster_src/schema - -schema + +schema cluster_src/utl - -utl + +utl cluster_src/validate - -validate - - -cluster_src/extract - -extract - - -cluster_src/extract/derive - -derive - - -cluster_src/extract/derive/circular - -circular - - -cluster_src/extract/derive/orphan - -orphan - - -cluster_src/extract/derive/reachable - -reachable - - -cluster_src/extract/transpile - -transpile - - -cluster_src/extract/utl - -utl - - -cluster_src/extract/ast-extractors - -ast-extractors - - -cluster_src/extract/parse - -parse - - -cluster_src/extract/resolve - -resolve - - -cluster_src/extract/resolve/readPackageDeps - -readPackageDeps + +validate bin/depcruise-fmt.js - -depcruise-fmt.js + +depcruise-fmt.js @@ -187,212 +187,212 @@ src/cli/format.js - -format.js + +format.js bin/depcruise-fmt.js->src/cli/format.js - - + + - + -src/cli/validateNodeEnv.js - - -validateNodeEnv.js +src/cli/validate-node-env.js + + +validate-node-env.js - + -bin/depcruise-fmt.js->src/cli/validateNodeEnv.js - - +bin/depcruise-fmt.js->src/cli/validate-node-env.js + + - + src/main/index.js - - -index.js + + +index.js - + src/cli/format.js->src/main/index.js - - + + - - -src/cli/normalizeOptions.js - - -normalizeOptions.js + + +src/cli/normalize-options.js + + +normalize-options.js - - -src/cli/format.js->src/cli/normalizeOptions.js - - + + +src/cli/format.js->src/cli/normalize-options.js + + - + src/cli/utl/io.js - - -io.js + + +io.js - + src/cli/format.js->src/cli/utl/io.js - - + + - - -src/cli/utl/validateFileExistence.js - - -validateFileExistence.js + + +src/cli/utl/validate-file-existence.js + + +validate-file-existence.js - - -src/cli/format.js->src/cli/utl/validateFileExistence.js - - + + +src/cli/format.js->src/cli/utl/validate-file-existence.js + + bin/dependency-cruise.js - -dependency-cruise.js + +dependency-cruise.js - + -bin/dependency-cruise.js->src/cli/validateNodeEnv.js - - +bin/dependency-cruise.js->src/cli/validate-node-env.js + + src/cli/index.js - -index.js + +index.js bin/dependency-cruise.js->src/cli/index.js - - + + + + + +src/cli/format-meta-info.js + + +format-meta-info.js + + + + + +src/cli/index.js->src/cli/format-meta-info.js + + src/cli/index.js->src/main/index.js - - + + - + -src/cli/index.js->src/cli/normalizeOptions.js - - +src/cli/index.js->src/cli/normalize-options.js + + src/cli/index.js->src/cli/utl/io.js - - + + - + -src/cli/index.js->src/cli/utl/validateFileExistence.js - - - - - -src/cli/formatMetaInfo.js - - -formatMetaInfo.js - +src/cli/index.js->src/cli/utl/validate-file-existence.js + + - - - -src/cli/index.js->src/cli/formatMetaInfo.js - - - - + -src/cli/getResolveConfig.js - - -getResolveConfig.js +src/cli/get-resolve-config.js + + +get-resolve-config.js - + -src/cli/index.js->src/cli/getResolveConfig.js - - +src/cli/index.js->src/cli/get-resolve-config.js + + - + -src/cli/initConfig/index.js - - -index.js +src/cli/init-config/index.js + + +index.js - + -src/cli/index.js->src/cli/initConfig/index.js - - +src/cli/index.js->src/cli/init-config/index.js + + - + -src/cli/parseTSConfig.js - - -parseTSConfig.js +src/cli/parse-ts-config.js + + +parse-ts-config.js - + -src/cli/index.js->src/cli/parseTSConfig.js - - +src/cli/index.js->src/cli/parse-ts-config.js + + bin/wrap-stream-in-html.js - -wrap-stream-in-html.js + +wrap-stream-in-html.js @@ -400,23 +400,23 @@ src/cli/tools/wrap-stream-in-html.js - -wrap-stream-in-html.js + +wrap-stream-in-html.js bin/wrap-stream-in-html.js->src/cli/tools/wrap-stream-in-html.js - - + + - + -src/cli/compileConfig/index.js - - -index.js +src/cli/compile-config/index.js + + +index.js @@ -424,377 +424,377 @@ src/extract/resolve/resolve.js - -resolve.js + +resolve.js - + -src/cli/compileConfig/index.js->src/extract/resolve/resolve.js +src/cli/compile-config/index.js->src/extract/resolve/resolve.js - - + + -cli-to-main-only-warn +cli-to-main-only-warn - + -src/main/resolveOptions/normalize.js - - -normalize.js +src/main/resolve-options/normalize.js + + +normalize.js - + -src/cli/compileConfig/index.js->src/main/resolveOptions/normalize.js - - +src/cli/compile-config/index.js->src/main/resolve-options/normalize.js + + - + -src/cli/compileConfig/mergeConfigs.js - - -mergeConfigs.js +src/cli/compile-config/merge-configs.js + + +merge-configs.js - + -src/cli/compileConfig/index.js->src/cli/compileConfig/mergeConfigs.js - - +src/cli/compile-config/index.js->src/cli/compile-config/merge-configs.js + + - + -src/cli/compileConfig/readConfig.js - - -readConfig.js +src/cli/compile-config/read-config.js + + +read-config.js - + -src/cli/compileConfig/index.js->src/cli/compileConfig/readConfig.js - - +src/cli/compile-config/index.js->src/cli/compile-config/read-config.js + + - - -src/extract/utl/pathToPosix.js - - -pathToPosix.js + + +src/extract/utl/path-to-posix.js + + +path-to-posix.js - + -src/extract/resolve/resolve.js->src/extract/utl/pathToPosix.js - - +src/extract/resolve/resolve.js->src/extract/utl/path-to-posix.js + + - + -src/extract/utl/stripQueryParams.js - - -stripQueryParams.js +src/extract/utl/strip-query-params.js + + +strip-query-params.js - + -src/extract/resolve/resolve.js->src/extract/utl/stripQueryParams.js - - +src/extract/resolve/resolve.js->src/extract/utl/strip-query-params.js + + - + src/extract/transpile/meta.js - - -meta.js + + +meta.js - + -src/main/resolveOptions/normalize.js->src/extract/transpile/meta.js - - +src/main/resolve-options/normalize.js->src/extract/transpile/meta.js + + src/cli/defaults.json - - -defaults.json + + +defaults.json - + + +src/cli/format-meta-info.js->src/main/index.js + + + + -src/main/index.js->src/main/resolveOptions/normalize.js - - +src/main/index.js->src/main/resolve-options/normalize.js + + src/main/index.js->src/extract/transpile/meta.js - - + + src/extract/index.js - -index.js + +index.js src/main/index.js->src/extract/index.js - - + + - + -src/main/filesAndDirs/normalize.js - - -normalize.js +src/main/files-and-dirs/normalize.js + + +normalize.js - + -src/main/index.js->src/main/filesAndDirs/normalize.js - - +src/main/index.js->src/main/files-and-dirs/normalize.js + + src/report/index.js - -index.js + +index.js src/main/index.js->src/report/index.js - - + + src/schema/cruise-result.schema.json - - -cruise-result.schema.json + + +cruise-result.schema.json src/main/index.js->src/schema/cruise-result.schema.json - - + + src/main/options/normalize.js - -normalize.js + +normalize.js src/main/index.js->src/main/options/normalize.js - - + + src/main/options/validate.js - -validate.js + +validate.js src/main/index.js->src/main/options/validate.js - - + + - + -src/main/ruleSet/normalize.js - - -normalize.js +src/main/rule-set/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/normalize.js - - +src/main/index.js->src/main/rule-set/normalize.js + + - + -src/main/ruleSet/validate.js - - -validate.js +src/main/rule-set/validate.js + + +validate.js - + -src/main/index.js->src/main/ruleSet/validate.js - - +src/main/index.js->src/main/rule-set/validate.js + + - + -src/cli/normalizeOptions.js->src/cli/compileConfig/index.js - - +src/cli/normalize-options.js->src/cli/compile-config/index.js + + - + -src/cli/normalizeOptions.js->src/cli/defaults.json - - - - - -src/cli/formatMetaInfo.js->src/main/index.js - - +src/cli/normalize-options.js->src/cli/defaults.json + + - + -src/cli/utl/makeAbsolute.js - - -makeAbsolute.js +src/cli/utl/make-absolute.js + + +make-absolute.js - + -src/cli/getResolveConfig.js->src/cli/utl/makeAbsolute.js - - +src/cli/get-resolve-config.js->src/cli/utl/make-absolute.js + + - + -src/cli/initConfig/index.js->src/cli/defaults.json - - +src/cli/init-config/index.js->src/cli/defaults.json + + - + -src/cli/initConfig/createConfigFile.js - - -createConfigFile.js +src/cli/init-config/create-config-file.js + + +create-config-file.js - + -src/cli/initConfig/index.js->src/cli/initConfig/createConfigFile.js - - +src/cli/init-config/index.js->src/cli/init-config/create-config-file.js + + - + -src/cli/initConfig/helpers.js - - -helpers.js +src/cli/init-config/helpers.js + + +helpers.js - + -src/cli/initConfig/index.js->src/cli/initConfig/helpers.js - - +src/cli/init-config/index.js->src/cli/init-config/helpers.js + + - + -src/cli/initConfig/getUserInput.js - - -getUserInput.js +src/cli/init-config/get-user-input.js + + +get-user-input.js - + -src/cli/initConfig/index.js->src/cli/initConfig/getUserInput.js - - +src/cli/init-config/index.js->src/cli/init-config/get-user-input.js + + - + -src/cli/initConfig/config.js.template.js - - -config.js.template.js +src/cli/init-config/config.js.template.js + + +config.js.template.js - + -src/cli/initConfig/createConfigFile.js->src/cli/initConfig/config.js.template.js - - +src/cli/init-config/create-config-file.js->src/cli/init-config/config.js.template.js + + - + -src/cli/initConfig/createConfigFile.js->src/cli/initConfig/helpers.js - - +src/cli/init-config/create-config-file.js->src/cli/init-config/helpers.js + + - + -src/cli/initConfig/getUserInput.js->src/cli/defaults.json - - +src/cli/init-config/get-user-input.js->src/cli/defaults.json + + - + -src/cli/initConfig/getUserInput.js->src/cli/initConfig/helpers.js - - +src/cli/init-config/get-user-input.js->src/cli/init-config/helpers.js + + - + -src/extract/addValidations.js - - -addValidations.js +src/extract/add-validations.js + + +add-validations.js @@ -802,350 +802,350 @@ src/validate/index.js - -index.js + +index.js - + -src/extract/addValidations.js->src/validate/index.js - - +src/extract/add-validations.js->src/validate/index.js + + - + -src/validate/matchDependencyRule.js - - -matchDependencyRule.js +src/validate/match-dependency-rule.js + + +match-dependency-rule.js - + -src/validate/index.js->src/validate/matchDependencyRule.js - - +src/validate/index.js->src/validate/match-dependency-rule.js + + - + -src/validate/matchModuleRule.js - - -matchModuleRule.js +src/validate/match-module-rule.js + + +match-module-rule.js - + -src/validate/index.js->src/validate/matchModuleRule.js - - +src/validate/index.js->src/validate/match-module-rule.js + + src/extract/ast-extractors/estree-helpers.js - -estree-helpers.js + +estree-helpers.js - + -src/extract/ast-extractors/extract-AMD-deps.js - - -extract-AMD-deps.js +src/extract/ast-extractors/extract-amd-deps.js + + +extract-amd-deps.js - + -src/extract/ast-extractors/extract-AMD-deps.js->src/extract/ast-extractors/estree-helpers.js - - +src/extract/ast-extractors/extract-amd-deps.js->src/extract/ast-extractors/estree-helpers.js + + - + -src/extract/ast-extractors/extract-commonJS-deps.js - - -extract-commonJS-deps.js +src/extract/ast-extractors/extract-cjs-deps.js + + +extract-cjs-deps.js - + -src/extract/ast-extractors/extract-AMD-deps.js->src/extract/ast-extractors/extract-commonJS-deps.js - - +src/extract/ast-extractors/extract-amd-deps.js->src/extract/ast-extractors/extract-cjs-deps.js + + - - -src/extract/ast-extractors/extract-commonJS-deps.js->src/extract/ast-extractors/estree-helpers.js - - + + +src/extract/ast-extractors/extract-cjs-deps.js->src/extract/ast-extractors/estree-helpers.js + + - + -src/extract/ast-extractors/extract-ES6-deps.js - - -extract-ES6-deps.js +src/extract/ast-extractors/extract-es6-deps.js + + +extract-es6-deps.js - - -src/extract/ast-extractors/extract-ES6-deps.js->src/extract/ast-extractors/estree-helpers.js - - + + +src/extract/ast-extractors/extract-es6-deps.js->src/extract/ast-extractors/estree-helpers.js + + src/extract/ast-extractors/extract-typescript-deps.js - -extract-typescript-deps.js + +extract-typescript-deps.js - + -src/extract/clearCaches.js - - -clearCaches.js +src/extract/clear-caches.js + + +clear-caches.js - + -src/extract/clearCaches.js->src/extract/resolve/resolve.js - - +src/extract/clear-caches.js->src/extract/resolve/resolve.js + + - + -src/extract/derive/reachable/isReachable.js - - -isReachable.js +src/extract/derive/reachable/is-reachable.js + + +is-reachable.js - + -src/extract/clearCaches.js->src/extract/derive/reachable/isReachable.js - - +src/extract/clear-caches.js->src/extract/derive/reachable/is-reachable.js + + - + -src/extract/parse/toJavascriptAST.js - - -toJavascriptAST.js +src/extract/parse/to-javascript-ast.js + + +to-javascript-ast.js - + -src/extract/clearCaches.js->src/extract/parse/toJavascriptAST.js - - +src/extract/clear-caches.js->src/extract/parse/to-javascript-ast.js + + - + -src/extract/parse/toTypescriptAST.js - - -toTypescriptAST.js +src/extract/parse/to-typescript-ast.js + + +to-typescript-ast.js - + -src/extract/clearCaches.js->src/extract/parse/toTypescriptAST.js - - +src/extract/clear-caches.js->src/extract/parse/to-typescript-ast.js + + - + -src/extract/resolve/localNpmHelpers.js - - -localNpmHelpers.js +src/extract/resolve/local-npm-helpers.js + + +local-npm-helpers.js - + -src/extract/clearCaches.js->src/extract/resolve/localNpmHelpers.js - - +src/extract/clear-caches.js->src/extract/resolve/local-npm-helpers.js + + - + -src/extract/resolve/readPackageDeps/index.js - - -index.js +src/extract/resolve/read-package-deps/index.js + + +index.js - + -src/extract/clearCaches.js->src/extract/resolve/readPackageDeps/index.js - - +src/extract/clear-caches.js->src/extract/resolve/read-package-deps/index.js + + - + -src/extract/resolve/resolve-AMD.js - - -resolve-AMD.js +src/extract/resolve/resolve-amd.js + + +resolve-amd.js - + -src/extract/clearCaches.js->src/extract/resolve/resolve-AMD.js - - +src/extract/clear-caches.js->src/extract/resolve/resolve-amd.js + + src/extract/transpile/index.js - -index.js + +index.js - + -src/extract/parse/toJavascriptAST.js->src/extract/transpile/index.js - - +src/extract/parse/to-javascript-ast.js->src/extract/transpile/index.js + + - + -src/extract/utl/getExtension.js - - -getExtension.js +src/extract/utl/get-extension.js + + +get-extension.js - + -src/extract/parse/toJavascriptAST.js->src/extract/utl/getExtension.js - - +src/extract/parse/to-javascript-ast.js->src/extract/utl/get-extension.js + + - + -src/extract/resolve/localNpmHelpers.js->src/extract/resolve/resolve.js - - +src/extract/resolve/local-npm-helpers.js->src/extract/resolve/resolve.js + + - + -src/extract/resolve/isRelativeModuleName.js - - -isRelativeModuleName.js +src/extract/resolve/is-relative-module-name.js + + +is-relative-module-name.js - + -src/extract/resolve/localNpmHelpers.js->src/extract/resolve/isRelativeModuleName.js - - +src/extract/resolve/local-npm-helpers.js->src/extract/resolve/is-relative-module-name.js + + - + -src/extract/resolve/readPackageDeps/mergePackages.js - - -mergePackages.js +src/extract/resolve/read-package-deps/merge-packages.js + + +merge-packages.js - + -src/extract/resolve/readPackageDeps/index.js->src/extract/resolve/readPackageDeps/mergePackages.js - - +src/extract/resolve/read-package-deps/index.js->src/extract/resolve/read-package-deps/merge-packages.js + + - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/readPackageDeps/index.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/read-package-deps/index.js + + - + -src/extract/resolve/resolve-AMD.js->src/extract/utl/pathToPosix.js - - +src/extract/resolve/resolve-amd.js->src/extract/utl/path-to-posix.js + + - + -src/extract/resolve/determineDependencyTypes.js - - -determineDependencyTypes.js +src/extract/resolve/determine-dependency-types.js + + +determine-dependency-types.js - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/determineDependencyTypes.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/determine-dependency-types.js + + - + -src/extract/resolve/isCore.js - - -isCore.js +src/extract/resolve/is-core.js + + +is-core.js - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/isCore.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/is-core.js + + src/extract/resolve/resolve-helpers.js - -resolve-helpers.js + +resolve-helpers.js - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/resolve-helpers.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/resolve-helpers.js + + - + -src/extract/derive/circular/getCycle.js - - -getCycle.js +src/extract/derive/circular/get-cycle.js + + +get-cycle.js @@ -1153,722 +1153,722 @@ src/extract/derive/circular/index.js - -index.js + +index.js - + -src/extract/derive/circular/index.js->src/extract/derive/circular/getCycle.js - - +src/extract/derive/circular/index.js->src/extract/derive/circular/get-cycle.js + + src/extract/derive/orphan/index.js - -index.js + +index.js - + -src/extract/derive/orphan/isOrphan.js - - -isOrphan.js +src/extract/derive/orphan/is-orphan.js + + +is-orphan.js - + -src/extract/derive/orphan/index.js->src/extract/derive/orphan/isOrphan.js - - +src/extract/derive/orphan/index.js->src/extract/derive/orphan/is-orphan.js + + src/extract/derive/reachable/index.js - -index.js + +index.js - + -src/extract/derive/reachable/index.js->src/extract/derive/reachable/isReachable.js - - +src/extract/derive/reachable/index.js->src/extract/derive/reachable/is-reachable.js + + - + -src/extract/extract.js - - -extract.js +src/extract/gather-initial-sources.js + + +gather-initial-sources.js - - -src/extract/extract.js->src/extract/ast-extractors/extract-AMD-deps.js - - - - - -src/extract/extract.js->src/extract/ast-extractors/extract-commonJS-deps.js - - + + +src/extract/gather-initial-sources.js->src/extract/transpile/meta.js + + - - -src/extract/extract.js->src/extract/ast-extractors/extract-ES6-deps.js - - + + +src/extract/gather-initial-sources.js->src/extract/utl/path-to-posix.js + + - - -src/extract/extract.js->src/extract/ast-extractors/extract-typescript-deps.js - - + + +src/extract/transpile/coffeescript-wrap.js + + +coffeescript-wrap.js + - - -src/extract/extract.js->src/extract/parse/toJavascriptAST.js - - - - -src/extract/extract.js->src/extract/parse/toTypescriptAST.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/coffeescript-wrap.js + + - - -src/utl/arrayUtil.js - - -arrayUtil.js + + +src/extract/transpile/javascript-wrap.js + + +javascript-wrap.js - - -src/extract/extract.js->src/utl/arrayUtil.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/javascript-wrap.js + + - - -src/extract/resolve/index.js - - -index.js + + +src/extract/transpile/livescript-wrap.js + + +livescript-wrap.js - - -src/extract/extract.js->src/extract/resolve/index.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/livescript-wrap.js + + - - -src/extract/utl/detectPreCompilationNess.js - - -detectPreCompilationNess.js + + +src/extract/transpile/typescript-wrap.js + + +typescript-wrap.js - - -src/extract/extract.js->src/extract/utl/detectPreCompilationNess.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/typescript-wrap.js + + - - -src/extract/resolve/index.js->src/extract/resolve/resolve-AMD.js - - + + +src/extract/transpile/vue-template-wrap.js + + +vue-template-wrap.js + - - -src/extract/resolve/index.js->src/extract/utl/pathToPosix.js - - - - -src/extract/resolve/index.js->src/extract/resolve/isRelativeModuleName.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/vue-template-wrap.js + + - - -src/extract/resolve/resolve-commonJS.js - - -resolve-commonJS.js + + +src/extract/get-dependencies.js + + +get-dependencies.js - - -src/extract/resolve/index.js->src/extract/resolve/resolve-commonJS.js - - + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-amd-deps.js + + - - -src/extract/utl/compare.js - - -compare.js - + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-cjs-deps.js + + + + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-es6-deps.js + + + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-typescript-deps.js + + - - -src/extract/utl/detectPreCompilationNess.js->src/extract/utl/compare.js - - + + +src/extract/get-dependencies.js->src/extract/parse/to-javascript-ast.js + + + + + +src/extract/get-dependencies.js->src/extract/parse/to-typescript-ast.js + + - + -src/extract/gatherInitialSources.js - - -gatherInitialSources.js +src/utl/array-util.js + + +array-util.js - - -src/extract/gatherInitialSources.js->src/extract/transpile/meta.js - - - - - -src/extract/gatherInitialSources.js->src/extract/utl/pathToPosix.js - - + + +src/extract/get-dependencies.js->src/utl/array-util.js + + - - -src/extract/transpile/coffeeWrap.js - - -coffeeWrap.js + + +src/extract/resolve/index.js + + +index.js - - -src/extract/transpile/meta.js->src/extract/transpile/coffeeWrap.js - - + + +src/extract/get-dependencies.js->src/extract/resolve/index.js + + - - -src/extract/transpile/javaScriptWrap.js - - -javaScriptWrap.js + + +src/extract/utl/detect-pre-compilation-ness.js + + +detect-pre-compilation-ness.js - - -src/extract/transpile/meta.js->src/extract/transpile/javaScriptWrap.js - - + + +src/extract/get-dependencies.js->src/extract/utl/detect-pre-compilation-ness.js + + - - -src/extract/transpile/liveScriptWrap.js - - -liveScriptWrap.js - + + +src/extract/resolve/index.js->src/extract/resolve/resolve-amd.js + + + + +src/extract/resolve/index.js->src/extract/utl/path-to-posix.js + + - - -src/extract/transpile/meta.js->src/extract/transpile/liveScriptWrap.js - - + + +src/extract/resolve/index.js->src/extract/resolve/is-relative-module-name.js + + - - -src/extract/transpile/typeScriptWrap.js - - -typeScriptWrap.js + + +src/extract/resolve/resolve-cjs.js + + +resolve-cjs.js - - -src/extract/transpile/meta.js->src/extract/transpile/typeScriptWrap.js - - + + +src/extract/resolve/index.js->src/extract/resolve/resolve-cjs.js + + - - -src/extract/transpile/vueWrap.js - - -vueWrap.js + + +src/extract/utl/compare.js + + +compare.js - - -src/extract/transpile/meta.js->src/extract/transpile/vueWrap.js - - + + +src/extract/utl/detect-pre-compilation-ness.js->src/extract/utl/compare.js + + - + -src/extract/index.js->src/extract/addValidations.js - - +src/extract/index.js->src/extract/add-validations.js + + - + -src/extract/index.js->src/extract/clearCaches.js - - +src/extract/index.js->src/extract/clear-caches.js + + src/extract/index.js->src/extract/derive/circular/index.js - - + + src/extract/index.js->src/extract/derive/orphan/index.js - - + + src/extract/index.js->src/extract/derive/reachable/index.js - - + + - + -src/extract/index.js->src/extract/extract.js - - - - - -src/extract/index.js->src/extract/gatherInitialSources.js - - +src/extract/index.js->src/extract/gather-initial-sources.js + + - + -src/extract/index.js->src/extract/utl/pathToPosix.js - - +src/extract/index.js->src/extract/utl/path-to-posix.js + + + + + +src/extract/index.js->src/extract/get-dependencies.js + + src/extract/summarize.js - -summarize.js + +summarize.js src/extract/index.js->src/extract/summarize.js - - + + - + -src/utl/findRuleByName.js - - -findRuleByName.js +src/utl/find-rule-by-name.js + + +find-rule-by-name.js - + -src/extract/summarize.js->src/utl/findRuleByName.js - - +src/extract/summarize.js->src/utl/find-rule-by-name.js + + src/extract/summarize.js->src/extract/utl/compare.js - - + + src/extract/transpile/index.js->src/extract/transpile/meta.js - - + + - + -src/extract/resolve/determineDependencyTypes.js->src/extract/resolve/localNpmHelpers.js - - +src/extract/resolve/determine-dependency-types.js->src/extract/resolve/local-npm-helpers.js + + - + -src/extract/resolve/determineDependencyTypes.js->src/extract/resolve/isCore.js - - +src/extract/resolve/determine-dependency-types.js->src/extract/resolve/is-core.js + + - + -src/extract/resolve/determineDependencyTypes.js->src/extract/resolve/isRelativeModuleName.js - - +src/extract/resolve/determine-dependency-types.js->src/extract/resolve/is-relative-module-name.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/resolve.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/resolve.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/readPackageDeps/index.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/read-package-deps/index.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/utl/pathToPosix.js - - +src/extract/resolve/resolve-cjs.js->src/extract/utl/path-to-posix.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/determineDependencyTypes.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/determine-dependency-types.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/isCore.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/is-core.js + + - + -src/extract/resolve/isFollowable.js - - -isFollowable.js +src/extract/resolve/is-followable.js + + +is-followable.js - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/isFollowable.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/is-followable.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/resolve-helpers.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/resolve-helpers.js + + - + -src/extract/resolve/isFollowable.js->src/extract/utl/getExtension.js - - +src/extract/resolve/is-followable.js->src/extract/utl/get-extension.js + + - + -src/extract/resolve/resolve-helpers.js->src/extract/resolve/localNpmHelpers.js - - +src/extract/resolve/resolve-helpers.js->src/extract/resolve/local-npm-helpers.js + + src/report/anon/index.js - -index.js + +index.js src/report/index.js->src/report/anon/index.js - - + + src/report/csv/index.js - -index.js + +index.js src/report/index.js->src/report/csv/index.js - - + + src/report/dot/index.js - -index.js + +index.js src/report/index.js->src/report/dot/index.js - - + + src/report/err-html/index.js - -index.js + +index.js src/report/index.js->src/report/err-html/index.js - - + + src/report/err.js - -err.js + +err.js src/report/index.js->src/report/err.js - - + + src/report/html/index.js - -index.js + +index.js src/report/index.js->src/report/html/index.js - - + + src/report/identity.js - -identity.js + +identity.js src/report/index.js->src/report/identity.js - - + + src/report/json.js - -json.js + +json.js src/report/index.js->src/report/json.js - - + + src/report/teamcity.js - -teamcity.js + +teamcity.js src/report/index.js->src/report/teamcity.js - - + + src/main/options/defaults.json - - -defaults.json + + +defaults.json src/main/options/normalize.js->src/main/options/defaults.json - - + + src/main/options/validate.js->src/report/index.js - - + + - + -src/main/ruleSet/validate.js->src/main/options/validate.js - - +src/main/rule-set/validate.js->src/main/options/validate.js + + src/schema/configuration.schema.json - - -configuration.schema.json + + +configuration.schema.json - + -src/main/ruleSet/validate.js->src/schema/configuration.schema.json - - +src/main/rule-set/validate.js->src/schema/configuration.schema.json + + - + -src/report/anon/anonymizePath.js - - -anonymizePath.js +src/report/anon/anonymize-path-element.js + + +anonymize-path-element.js - + -src/report/anon/anonymizePathElement.js - - -anonymizePathElement.js +src/report/anon/random-string.js + + +random-string.js - + -src/report/anon/anonymizePath.js->src/report/anon/anonymizePathElement.js - - +src/report/anon/anonymize-path-element.js->src/report/anon/random-string.js + + - + -src/report/anon/randomString.js - - -randomString.js +src/report/anon/anonymize-path.js + + +anonymize-path.js - + -src/report/anon/anonymizePathElement.js->src/report/anon/randomString.js - - +src/report/anon/anonymize-path.js->src/report/anon/anonymize-path-element.js + + - + -src/report/anon/index.js->src/report/anon/anonymizePath.js - - +src/report/anon/index.js->src/report/anon/anonymize-path.js + + src/report/csv/csv.template.js - -csv.template.js + +csv.template.js src/report/csv/index.js->src/report/csv/csv.template.js - - + + - + -src/report/utl/dependencyToIncidenceTransformer.js - - -dependencyToIncidenceTransformer.js +src/report/utl/dependency-to-incidence-transformer.js + + +dependency-to-incidence-transformer.js - + -src/report/csv/index.js->src/report/utl/dependencyToIncidenceTransformer.js - - +src/report/csv/index.js->src/report/utl/dependency-to-incidence-transformer.js + + - + -src/report/dot/defaultTheme.json - - - -defaultTheme.json +src/report/dot/default-theme.json + + + +default-theme.json @@ -1876,298 +1876,298 @@ src/report/dot/dot.template.js - -dot.template.js + +dot.template.js src/report/dot/index.js->src/report/dot/dot.template.js - - + + src/report/dot/module-utl.js - -module-utl.js + +module-utl.js src/report/dot/index.js->src/report/dot/module-utl.js - - + + - + -src/report/dot/prepareCustomLevel.js - - -prepareCustomLevel.js +src/report/dot/prepare-custom-level.js + + +prepare-custom-level.js - + -src/report/dot/index.js->src/report/dot/prepareCustomLevel.js - - +src/report/dot/index.js->src/report/dot/prepare-custom-level.js + + - + -src/report/dot/prepareFolderLevel.js - - -prepareFolderLevel.js +src/report/dot/prepare-folder-level.js + + +prepare-folder-level.js - + -src/report/dot/index.js->src/report/dot/prepareFolderLevel.js - - +src/report/dot/index.js->src/report/dot/prepare-folder-level.js + + src/report/dot/theming.js - -theming.js + +theming.js src/report/dot/index.js->src/report/dot/theming.js - - + + src/report/dot/module-utl.js->src/report/dot/theming.js - - + + - + -src/report/dot/prepareCustomLevel.js->src/report/dot/module-utl.js - - +src/report/dot/prepare-custom-level.js->src/report/dot/module-utl.js + + - + -src/report/utl/consolidateToPattern.js - - -consolidateToPattern.js +src/report/utl/consolidate-to-pattern.js + + +consolidate-to-pattern.js - + -src/report/dot/prepareCustomLevel.js->src/report/utl/consolidateToPattern.js - - +src/report/dot/prepare-custom-level.js->src/report/utl/consolidate-to-pattern.js + + - + -src/report/dot/prepareFolderLevel.js->src/report/dot/module-utl.js - - +src/report/dot/prepare-folder-level.js->src/report/dot/module-utl.js + + - + -src/report/utl/consolidateToFolder.js - - -consolidateToFolder.js +src/report/utl/consolidate-to-folder.js + + +consolidate-to-folder.js - + -src/report/dot/prepareFolderLevel.js->src/report/utl/consolidateToFolder.js - - +src/report/dot/prepare-folder-level.js->src/report/utl/consolidate-to-folder.js + + - + -src/report/dot/theming.js->src/report/dot/defaultTheme.json - - +src/report/dot/theming.js->src/report/dot/default-theme.json + + - + -src/report/utl/consolidateModuleDependencies.js - - -consolidateModuleDependencies.js +src/report/utl/consolidate-module-dependencies.js + + +consolidate-module-dependencies.js - + -src/report/utl/consolidateToPattern.js->src/report/utl/consolidateModuleDependencies.js - - +src/report/utl/consolidate-to-pattern.js->src/report/utl/consolidate-module-dependencies.js + + - + -src/report/utl/consolidateModules.js - - -consolidateModules.js +src/report/utl/consolidate-modules.js + + +consolidate-modules.js - + -src/report/utl/consolidateToPattern.js->src/report/utl/consolidateModules.js - - +src/report/utl/consolidate-to-pattern.js->src/report/utl/consolidate-modules.js + + - + -src/report/utl/consolidateToFolder.js->src/report/utl/consolidateModuleDependencies.js - - +src/report/utl/consolidate-to-folder.js->src/report/utl/consolidate-module-dependencies.js + + - + -src/report/utl/consolidateToFolder.js->src/report/utl/consolidateModules.js - - +src/report/utl/consolidate-to-folder.js->src/report/utl/consolidate-modules.js + + src/report/err-html/err-html.template.js - -err-html.template.js + +err-html.template.js src/report/err-html/index.js->src/report/err-html/err-html.template.js - - + + src/report/err-html/utl.js - -utl.js + +utl.js src/report/err-html/index.js->src/report/err-html/utl.js - - + + - + -src/report/err.js->src/utl/findRuleByName.js - - +src/report/err.js->src/utl/find-rule-by-name.js + + src/report/html/html.template.js - -html.template.js + +html.template.js - + -src/report/html/index.js->src/report/utl/dependencyToIncidenceTransformer.js - - +src/report/html/index.js->src/report/utl/dependency-to-incidence-transformer.js + + src/report/html/index.js->src/report/html/html.template.js - - + + - + -src/report/utl/compareRules.js - - -compareRules.js +src/report/utl/compare-rules.js + + +compare-rules.js - + -src/report/utl/consolidateModuleDependencies.js->src/report/utl/compareRules.js - - +src/report/utl/consolidate-module-dependencies.js->src/report/utl/compare-rules.js + + - + -src/report/utl/consolidateModules.js->src/report/utl/compareRules.js - - +src/report/utl/consolidate-modules.js->src/report/utl/compare-rules.js + + - + -src/validate/isModuleOnlyRule.js - - -isModuleOnlyRule.js +src/validate/is-module-only-rule.js + + +is-module-only-rule.js - + -src/validate/matchDependencyRule.js->src/validate/isModuleOnlyRule.js - - +src/validate/match-dependency-rule.js->src/validate/is-module-only-rule.js + + src/validate/matches.js - -matches.js + +matches.js - + -src/validate/matchDependencyRule.js->src/validate/matches.js - - +src/validate/match-dependency-rule.js->src/validate/matches.js + + - + -src/validate/matchModuleRule.js->src/validate/isModuleOnlyRule.js - - +src/validate/match-module-rule.js->src/validate/is-module-only-rule.js + + - + -src/validate/matchModuleRule.js->src/validate/matches.js - - +src/validate/match-module-rule.js->src/validate/matches.js + + - + -src/validate/matches.js->src/utl/arrayUtil.js - - +src/validate/matches.js->src/utl/array-util.js + + diff --git a/doc/rules-reference.md b/doc/rules-reference.md index 5f9da753e..d8f740e98 100644 --- a/doc/rules-reference.md +++ b/doc/rules-reference.md @@ -1177,7 +1177,7 @@ The criteria are evaluated top to bottom: - Criteria in the configuration file take precedence over the default ones. For an extensive example you can have a look at the default theme dependency-cruiser -ships with - [defaultTheme.json](../src/report/dot/defaultTheme.json). +ships with - [default-theme.json](../src/report/dot/default-theme.json). ##### Some examples diff --git a/docs/dependency-cruiser-dependency-graph.html b/docs/dependency-cruiser-dependency-graph.html index 44e24508b..9c91c96e3 100644 --- a/docs/dependency-cruiser-dependency-graph.html +++ b/docs/dependency-cruiser-dependency-graph.html @@ -45,182 +45,182 @@ - - + + dependency-cruiser output - + cluster_bin - -bin + +bin cluster_src - -src + +src cluster_src/cli - -cli + +cli -cluster_src/cli/compileConfig - -compileConfig +cluster_src/cli/compile-config + +compile-config -cluster_src/cli/initConfig - -initConfig +cluster_src/cli/init-config + +init-config cluster_src/cli/tools - -tools + +tools cluster_src/cli/utl - -utl + +utl cluster_src/extract - -extract - - -cluster_src/extract/ast-extractors - -ast-extractors - - -cluster_src/extract/resolve - -resolve - - -cluster_src/extract/resolve/readPackageDeps - -readPackageDeps - - -cluster_src/extract/transpile - -transpile - - -cluster_src/extract/utl - -utl + +extract cluster_src/extract/derive - -derive + +derive cluster_src/extract/derive/circular - -circular + +circular cluster_src/extract/derive/orphan - -orphan + +orphan cluster_src/extract/derive/reachable - -reachable + +reachable cluster_src/extract/parse - -parse + +parse + + +cluster_src/extract/resolve + +resolve + + +cluster_src/extract/resolve/read-package-deps + +read-package-deps + + +cluster_src/extract/transpile + +transpile + + +cluster_src/extract/ast-extractors + +ast-extractors + + +cluster_src/extract/utl + +utl cluster_src/main - -main + +main -cluster_src/main/filesAndDirs - -filesAndDirs +cluster_src/main/files-and-dirs + +files-and-dirs cluster_src/main/options - -options + +options -cluster_src/main/resolveOptions - -resolveOptions +cluster_src/main/resolve-options + +resolve-options -cluster_src/main/ruleSet - -ruleSet +cluster_src/main/rule-set + +rule-set cluster_src/report - -report + +report cluster_src/report/anon - -anon + +anon cluster_src/report/csv - -csv + +csv cluster_src/report/dot - -dot + +dot cluster_src/report/err-html - -err-html + +err-html cluster_src/report/html - -html + +html cluster_src/report/utl - -utl + +utl cluster_src/schema - -schema + +schema cluster_src/utl - -utl + +utl cluster_src/validate - -validate + +validate bin/depcruise-fmt.js - -depcruise-fmt.js + +depcruise-fmt.js @@ -228,212 +228,212 @@ src/cli/format.js - -format.js + +format.js bin/depcruise-fmt.js->src/cli/format.js - - + + - + -src/cli/validateNodeEnv.js - - -validateNodeEnv.js +src/cli/validate-node-env.js + + +validate-node-env.js - + -bin/depcruise-fmt.js->src/cli/validateNodeEnv.js - - +bin/depcruise-fmt.js->src/cli/validate-node-env.js + + - + src/main/index.js - - -index.js + + +index.js - + src/cli/format.js->src/main/index.js - - + + - - -src/cli/normalizeOptions.js - - -normalizeOptions.js + + +src/cli/normalize-options.js + + +normalize-options.js - - -src/cli/format.js->src/cli/normalizeOptions.js - - + + +src/cli/format.js->src/cli/normalize-options.js + + - + src/cli/utl/io.js - - -io.js + + +io.js - + src/cli/format.js->src/cli/utl/io.js - - + + - - -src/cli/utl/validateFileExistence.js - - -validateFileExistence.js + + +src/cli/utl/validate-file-existence.js + + +validate-file-existence.js - - -src/cli/format.js->src/cli/utl/validateFileExistence.js - - + + +src/cli/format.js->src/cli/utl/validate-file-existence.js + + bin/dependency-cruise.js - -dependency-cruise.js + +dependency-cruise.js - + -bin/dependency-cruise.js->src/cli/validateNodeEnv.js - - +bin/dependency-cruise.js->src/cli/validate-node-env.js + + src/cli/index.js - -index.js + +index.js bin/dependency-cruise.js->src/cli/index.js - - + + + + + +src/cli/format-meta-info.js + + +format-meta-info.js + + + + + +src/cli/index.js->src/cli/format-meta-info.js + + src/cli/index.js->src/main/index.js - - + + - + -src/cli/index.js->src/cli/normalizeOptions.js - - +src/cli/index.js->src/cli/normalize-options.js + + src/cli/index.js->src/cli/utl/io.js - - + + - + -src/cli/index.js->src/cli/utl/validateFileExistence.js - - - - - -src/cli/formatMetaInfo.js - - -formatMetaInfo.js - +src/cli/index.js->src/cli/utl/validate-file-existence.js + + - - - -src/cli/index.js->src/cli/formatMetaInfo.js - - - - + -src/cli/getResolveConfig.js - - -getResolveConfig.js +src/cli/get-resolve-config.js + + +get-resolve-config.js - + -src/cli/index.js->src/cli/getResolveConfig.js - - +src/cli/index.js->src/cli/get-resolve-config.js + + - + -src/cli/initConfig/index.js - - -index.js +src/cli/init-config/index.js + + +index.js - + -src/cli/index.js->src/cli/initConfig/index.js - - +src/cli/index.js->src/cli/init-config/index.js + + - + -src/cli/parseTSConfig.js - - -parseTSConfig.js +src/cli/parse-ts-config.js + + +parse-ts-config.js - + -src/cli/index.js->src/cli/parseTSConfig.js - - +src/cli/index.js->src/cli/parse-ts-config.js + + bin/wrap-stream-in-html.js - -wrap-stream-in-html.js + +wrap-stream-in-html.js @@ -441,23 +441,23 @@ src/cli/tools/wrap-stream-in-html.js - -wrap-stream-in-html.js + +wrap-stream-in-html.js bin/wrap-stream-in-html.js->src/cli/tools/wrap-stream-in-html.js - - + + - + -src/cli/compileConfig/index.js - - -index.js +src/cli/compile-config/index.js + + +index.js @@ -465,377 +465,377 @@ src/extract/resolve/resolve.js - -resolve.js + +resolve.js - + -src/cli/compileConfig/index.js->src/extract/resolve/resolve.js +src/cli/compile-config/index.js->src/extract/resolve/resolve.js - - + + -cli-to-main-only-warn +cli-to-main-only-warn - + -src/main/resolveOptions/normalize.js - - -normalize.js +src/main/resolve-options/normalize.js + + +normalize.js - + -src/cli/compileConfig/index.js->src/main/resolveOptions/normalize.js - - +src/cli/compile-config/index.js->src/main/resolve-options/normalize.js + + - + -src/cli/compileConfig/mergeConfigs.js - - -mergeConfigs.js +src/cli/compile-config/merge-configs.js + + +merge-configs.js - + -src/cli/compileConfig/index.js->src/cli/compileConfig/mergeConfigs.js - - +src/cli/compile-config/index.js->src/cli/compile-config/merge-configs.js + + - + -src/cli/compileConfig/readConfig.js - - -readConfig.js +src/cli/compile-config/read-config.js + + +read-config.js - + -src/cli/compileConfig/index.js->src/cli/compileConfig/readConfig.js - - +src/cli/compile-config/index.js->src/cli/compile-config/read-config.js + + - - -src/extract/utl/pathToPosix.js - - -pathToPosix.js + + +src/extract/utl/path-to-posix.js + + +path-to-posix.js - + -src/extract/resolve/resolve.js->src/extract/utl/pathToPosix.js - - +src/extract/resolve/resolve.js->src/extract/utl/path-to-posix.js + + - + -src/extract/utl/stripQueryParams.js - - -stripQueryParams.js +src/extract/utl/strip-query-params.js + + +strip-query-params.js - + -src/extract/resolve/resolve.js->src/extract/utl/stripQueryParams.js - - +src/extract/resolve/resolve.js->src/extract/utl/strip-query-params.js + + - + src/extract/transpile/meta.js - - -meta.js + + +meta.js - + -src/main/resolveOptions/normalize.js->src/extract/transpile/meta.js - - +src/main/resolve-options/normalize.js->src/extract/transpile/meta.js + + src/cli/defaults.json - - -defaults.json + + +defaults.json - + + +src/cli/format-meta-info.js->src/main/index.js + + + + -src/main/index.js->src/main/resolveOptions/normalize.js - - +src/main/index.js->src/main/resolve-options/normalize.js + + src/main/index.js->src/extract/transpile/meta.js - - + + src/extract/index.js - -index.js + +index.js src/main/index.js->src/extract/index.js - - + + - + -src/main/filesAndDirs/normalize.js - - -normalize.js +src/main/files-and-dirs/normalize.js + + +normalize.js - + -src/main/index.js->src/main/filesAndDirs/normalize.js - - +src/main/index.js->src/main/files-and-dirs/normalize.js + + src/report/index.js - -index.js + +index.js src/main/index.js->src/report/index.js - - + + src/schema/cruise-result.schema.json - - -cruise-result.schema.json + + +cruise-result.schema.json src/main/index.js->src/schema/cruise-result.schema.json - - + + src/main/options/normalize.js - -normalize.js + +normalize.js src/main/index.js->src/main/options/normalize.js - - + + src/main/options/validate.js - -validate.js + +validate.js src/main/index.js->src/main/options/validate.js - - + + - + -src/main/ruleSet/normalize.js - - -normalize.js +src/main/rule-set/normalize.js + + +normalize.js - + -src/main/index.js->src/main/ruleSet/normalize.js - - +src/main/index.js->src/main/rule-set/normalize.js + + - + -src/main/ruleSet/validate.js - - -validate.js +src/main/rule-set/validate.js + + +validate.js - + -src/main/index.js->src/main/ruleSet/validate.js - - +src/main/index.js->src/main/rule-set/validate.js + + - + -src/cli/normalizeOptions.js->src/cli/compileConfig/index.js - - +src/cli/normalize-options.js->src/cli/compile-config/index.js + + - + -src/cli/normalizeOptions.js->src/cli/defaults.json - - +src/cli/normalize-options.js->src/cli/defaults.json + + - - -src/cli/formatMetaInfo.js->src/main/index.js - - - - + -src/cli/utl/makeAbsolute.js - - -makeAbsolute.js +src/cli/utl/make-absolute.js + + +make-absolute.js - + -src/cli/getResolveConfig.js->src/cli/utl/makeAbsolute.js - - +src/cli/get-resolve-config.js->src/cli/utl/make-absolute.js + + - + -src/cli/initConfig/index.js->src/cli/defaults.json - - +src/cli/init-config/index.js->src/cli/defaults.json + + - + -src/cli/initConfig/createConfigFile.js - - -createConfigFile.js +src/cli/init-config/create-config-file.js + + +create-config-file.js - + -src/cli/initConfig/index.js->src/cli/initConfig/createConfigFile.js - - +src/cli/init-config/index.js->src/cli/init-config/create-config-file.js + + - + -src/cli/initConfig/helpers.js - - -helpers.js +src/cli/init-config/helpers.js + + +helpers.js - + -src/cli/initConfig/index.js->src/cli/initConfig/helpers.js - - +src/cli/init-config/index.js->src/cli/init-config/helpers.js + + - + -src/cli/initConfig/getUserInput.js - - -getUserInput.js +src/cli/init-config/get-user-input.js + + +get-user-input.js - + -src/cli/initConfig/index.js->src/cli/initConfig/getUserInput.js - - +src/cli/init-config/index.js->src/cli/init-config/get-user-input.js + + - + -src/cli/initConfig/config.js.template.js - - -config.js.template.js +src/cli/init-config/config.js.template.js + + +config.js.template.js - + -src/cli/initConfig/createConfigFile.js->src/cli/initConfig/config.js.template.js - - +src/cli/init-config/create-config-file.js->src/cli/init-config/config.js.template.js + + - + -src/cli/initConfig/createConfigFile.js->src/cli/initConfig/helpers.js - - +src/cli/init-config/create-config-file.js->src/cli/init-config/helpers.js + + - + -src/cli/initConfig/getUserInput.js->src/cli/defaults.json - - +src/cli/init-config/get-user-input.js->src/cli/defaults.json + + - + -src/cli/initConfig/getUserInput.js->src/cli/initConfig/helpers.js - - +src/cli/init-config/get-user-input.js->src/cli/init-config/helpers.js + + - + -src/extract/addValidations.js - - -addValidations.js +src/extract/add-validations.js + + +add-validations.js @@ -843,350 +843,350 @@ src/validate/index.js - -index.js + +index.js - + -src/extract/addValidations.js->src/validate/index.js - - +src/extract/add-validations.js->src/validate/index.js + + - + -src/validate/matchDependencyRule.js - - -matchDependencyRule.js +src/validate/match-dependency-rule.js + + +match-dependency-rule.js - + -src/validate/index.js->src/validate/matchDependencyRule.js - - +src/validate/index.js->src/validate/match-dependency-rule.js + + - + -src/validate/matchModuleRule.js - - -matchModuleRule.js +src/validate/match-module-rule.js + + +match-module-rule.js - + -src/validate/index.js->src/validate/matchModuleRule.js - - +src/validate/index.js->src/validate/match-module-rule.js + + src/extract/ast-extractors/estree-helpers.js - -estree-helpers.js + +estree-helpers.js - + -src/extract/ast-extractors/extract-AMD-deps.js - - -extract-AMD-deps.js +src/extract/ast-extractors/extract-amd-deps.js + + +extract-amd-deps.js - + -src/extract/ast-extractors/extract-AMD-deps.js->src/extract/ast-extractors/estree-helpers.js - - +src/extract/ast-extractors/extract-amd-deps.js->src/extract/ast-extractors/estree-helpers.js + + - + -src/extract/ast-extractors/extract-commonJS-deps.js - - -extract-commonJS-deps.js +src/extract/ast-extractors/extract-cjs-deps.js + + +extract-cjs-deps.js - + -src/extract/ast-extractors/extract-AMD-deps.js->src/extract/ast-extractors/extract-commonJS-deps.js - - +src/extract/ast-extractors/extract-amd-deps.js->src/extract/ast-extractors/extract-cjs-deps.js + + - - -src/extract/ast-extractors/extract-commonJS-deps.js->src/extract/ast-extractors/estree-helpers.js - - + + +src/extract/ast-extractors/extract-cjs-deps.js->src/extract/ast-extractors/estree-helpers.js + + - + -src/extract/ast-extractors/extract-ES6-deps.js - - -extract-ES6-deps.js +src/extract/ast-extractors/extract-es6-deps.js + + +extract-es6-deps.js - - -src/extract/ast-extractors/extract-ES6-deps.js->src/extract/ast-extractors/estree-helpers.js - - + + +src/extract/ast-extractors/extract-es6-deps.js->src/extract/ast-extractors/estree-helpers.js + + src/extract/ast-extractors/extract-typescript-deps.js - -extract-typescript-deps.js + +extract-typescript-deps.js - + -src/extract/clearCaches.js - - -clearCaches.js +src/extract/clear-caches.js + + +clear-caches.js - + -src/extract/clearCaches.js->src/extract/resolve/resolve.js - - +src/extract/clear-caches.js->src/extract/resolve/resolve.js + + - + -src/extract/derive/reachable/isReachable.js - - -isReachable.js +src/extract/derive/reachable/is-reachable.js + + +is-reachable.js - + -src/extract/clearCaches.js->src/extract/derive/reachable/isReachable.js - - +src/extract/clear-caches.js->src/extract/derive/reachable/is-reachable.js + + - + -src/extract/parse/toJavascriptAST.js - - -toJavascriptAST.js +src/extract/parse/to-javascript-ast.js + + +to-javascript-ast.js - + -src/extract/clearCaches.js->src/extract/parse/toJavascriptAST.js - - +src/extract/clear-caches.js->src/extract/parse/to-javascript-ast.js + + - + -src/extract/parse/toTypescriptAST.js - - -toTypescriptAST.js +src/extract/parse/to-typescript-ast.js + + +to-typescript-ast.js - + -src/extract/clearCaches.js->src/extract/parse/toTypescriptAST.js - - +src/extract/clear-caches.js->src/extract/parse/to-typescript-ast.js + + - + -src/extract/resolve/localNpmHelpers.js - - -localNpmHelpers.js +src/extract/resolve/local-npm-helpers.js + + +local-npm-helpers.js - + -src/extract/clearCaches.js->src/extract/resolve/localNpmHelpers.js - - +src/extract/clear-caches.js->src/extract/resolve/local-npm-helpers.js + + - + -src/extract/resolve/readPackageDeps/index.js - - -index.js +src/extract/resolve/read-package-deps/index.js + + +index.js - + -src/extract/clearCaches.js->src/extract/resolve/readPackageDeps/index.js - - +src/extract/clear-caches.js->src/extract/resolve/read-package-deps/index.js + + - + -src/extract/resolve/resolve-AMD.js - - -resolve-AMD.js +src/extract/resolve/resolve-amd.js + + +resolve-amd.js - + -src/extract/clearCaches.js->src/extract/resolve/resolve-AMD.js - - +src/extract/clear-caches.js->src/extract/resolve/resolve-amd.js + + src/extract/transpile/index.js - -index.js + +index.js - + -src/extract/parse/toJavascriptAST.js->src/extract/transpile/index.js - - +src/extract/parse/to-javascript-ast.js->src/extract/transpile/index.js + + - + -src/extract/utl/getExtension.js - - -getExtension.js +src/extract/utl/get-extension.js + + +get-extension.js - + -src/extract/parse/toJavascriptAST.js->src/extract/utl/getExtension.js - - +src/extract/parse/to-javascript-ast.js->src/extract/utl/get-extension.js + + - + -src/extract/resolve/localNpmHelpers.js->src/extract/resolve/resolve.js - - +src/extract/resolve/local-npm-helpers.js->src/extract/resolve/resolve.js + + - + -src/extract/resolve/isRelativeModuleName.js - - -isRelativeModuleName.js +src/extract/resolve/is-relative-module-name.js + + +is-relative-module-name.js - + -src/extract/resolve/localNpmHelpers.js->src/extract/resolve/isRelativeModuleName.js - - +src/extract/resolve/local-npm-helpers.js->src/extract/resolve/is-relative-module-name.js + + - + -src/extract/resolve/readPackageDeps/mergePackages.js - - -mergePackages.js +src/extract/resolve/read-package-deps/merge-packages.js + + +merge-packages.js - + -src/extract/resolve/readPackageDeps/index.js->src/extract/resolve/readPackageDeps/mergePackages.js - - +src/extract/resolve/read-package-deps/index.js->src/extract/resolve/read-package-deps/merge-packages.js + + - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/readPackageDeps/index.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/read-package-deps/index.js + + - + -src/extract/resolve/resolve-AMD.js->src/extract/utl/pathToPosix.js - - +src/extract/resolve/resolve-amd.js->src/extract/utl/path-to-posix.js + + - + -src/extract/resolve/determineDependencyTypes.js - - -determineDependencyTypes.js +src/extract/resolve/determine-dependency-types.js + + +determine-dependency-types.js - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/determineDependencyTypes.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/determine-dependency-types.js + + - + -src/extract/resolve/isCore.js - - -isCore.js +src/extract/resolve/is-core.js + + +is-core.js - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/isCore.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/is-core.js + + src/extract/resolve/resolve-helpers.js - -resolve-helpers.js + +resolve-helpers.js - + -src/extract/resolve/resolve-AMD.js->src/extract/resolve/resolve-helpers.js - - +src/extract/resolve/resolve-amd.js->src/extract/resolve/resolve-helpers.js + + - + -src/extract/derive/circular/getCycle.js - - -getCycle.js +src/extract/derive/circular/get-cycle.js + + +get-cycle.js @@ -1194,722 +1194,722 @@ src/extract/derive/circular/index.js - -index.js + +index.js - + -src/extract/derive/circular/index.js->src/extract/derive/circular/getCycle.js - - +src/extract/derive/circular/index.js->src/extract/derive/circular/get-cycle.js + + src/extract/derive/orphan/index.js - -index.js + +index.js - + -src/extract/derive/orphan/isOrphan.js - - -isOrphan.js +src/extract/derive/orphan/is-orphan.js + + +is-orphan.js - + -src/extract/derive/orphan/index.js->src/extract/derive/orphan/isOrphan.js - - +src/extract/derive/orphan/index.js->src/extract/derive/orphan/is-orphan.js + + src/extract/derive/reachable/index.js - -index.js + +index.js - + -src/extract/derive/reachable/index.js->src/extract/derive/reachable/isReachable.js - - +src/extract/derive/reachable/index.js->src/extract/derive/reachable/is-reachable.js + + - + -src/extract/extract.js - - -extract.js +src/extract/gather-initial-sources.js + + +gather-initial-sources.js - - -src/extract/extract.js->src/extract/ast-extractors/extract-AMD-deps.js - - - - - -src/extract/extract.js->src/extract/ast-extractors/extract-commonJS-deps.js - - + + +src/extract/gather-initial-sources.js->src/extract/transpile/meta.js + + - - -src/extract/extract.js->src/extract/ast-extractors/extract-ES6-deps.js - - + + +src/extract/gather-initial-sources.js->src/extract/utl/path-to-posix.js + + - - -src/extract/extract.js->src/extract/ast-extractors/extract-typescript-deps.js - - + + +src/extract/transpile/coffeescript-wrap.js + + +coffeescript-wrap.js + - - -src/extract/extract.js->src/extract/parse/toJavascriptAST.js - - - - -src/extract/extract.js->src/extract/parse/toTypescriptAST.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/coffeescript-wrap.js + + - - -src/utl/arrayUtil.js - - -arrayUtil.js + + +src/extract/transpile/javascript-wrap.js + + +javascript-wrap.js - - -src/extract/extract.js->src/utl/arrayUtil.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/javascript-wrap.js + + - - -src/extract/resolve/index.js - - -index.js + + +src/extract/transpile/livescript-wrap.js + + +livescript-wrap.js - - -src/extract/extract.js->src/extract/resolve/index.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/livescript-wrap.js + + - - -src/extract/utl/detectPreCompilationNess.js - - -detectPreCompilationNess.js + + +src/extract/transpile/typescript-wrap.js + + +typescript-wrap.js - - -src/extract/extract.js->src/extract/utl/detectPreCompilationNess.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/typescript-wrap.js + + - - -src/extract/resolve/index.js->src/extract/resolve/resolve-AMD.js - - + + +src/extract/transpile/vue-template-wrap.js + + +vue-template-wrap.js + - - -src/extract/resolve/index.js->src/extract/utl/pathToPosix.js - - - - -src/extract/resolve/index.js->src/extract/resolve/isRelativeModuleName.js - - + + +src/extract/transpile/meta.js->src/extract/transpile/vue-template-wrap.js + + - - -src/extract/resolve/resolve-commonJS.js - - -resolve-commonJS.js + + +src/extract/get-dependencies.js + + +get-dependencies.js - - -src/extract/resolve/index.js->src/extract/resolve/resolve-commonJS.js - - + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-amd-deps.js + + - - -src/extract/utl/compare.js - - -compare.js - + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-cjs-deps.js + + + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-es6-deps.js + + - - -src/extract/utl/detectPreCompilationNess.js->src/extract/utl/compare.js - - + + +src/extract/get-dependencies.js->src/extract/ast-extractors/extract-typescript-deps.js + + + + + +src/extract/get-dependencies.js->src/extract/parse/to-javascript-ast.js + + + + + +src/extract/get-dependencies.js->src/extract/parse/to-typescript-ast.js + + - + -src/extract/gatherInitialSources.js - - -gatherInitialSources.js +src/utl/array-util.js + + +array-util.js - - -src/extract/gatherInitialSources.js->src/extract/transpile/meta.js - - - - - -src/extract/gatherInitialSources.js->src/extract/utl/pathToPosix.js - - + + +src/extract/get-dependencies.js->src/utl/array-util.js + + - - -src/extract/transpile/coffeeWrap.js - - -coffeeWrap.js + + +src/extract/resolve/index.js + + +index.js - - -src/extract/transpile/meta.js->src/extract/transpile/coffeeWrap.js - - + + +src/extract/get-dependencies.js->src/extract/resolve/index.js + + - - -src/extract/transpile/javaScriptWrap.js - - -javaScriptWrap.js + + +src/extract/utl/detect-pre-compilation-ness.js + + +detect-pre-compilation-ness.js - - -src/extract/transpile/meta.js->src/extract/transpile/javaScriptWrap.js - - + + +src/extract/get-dependencies.js->src/extract/utl/detect-pre-compilation-ness.js + + - - -src/extract/transpile/liveScriptWrap.js - - -liveScriptWrap.js - + + +src/extract/resolve/index.js->src/extract/resolve/resolve-amd.js + + + + +src/extract/resolve/index.js->src/extract/utl/path-to-posix.js + + - - -src/extract/transpile/meta.js->src/extract/transpile/liveScriptWrap.js - - + + +src/extract/resolve/index.js->src/extract/resolve/is-relative-module-name.js + + - - -src/extract/transpile/typeScriptWrap.js - - -typeScriptWrap.js + + +src/extract/resolve/resolve-cjs.js + + +resolve-cjs.js - - -src/extract/transpile/meta.js->src/extract/transpile/typeScriptWrap.js - - + + +src/extract/resolve/index.js->src/extract/resolve/resolve-cjs.js + + - - -src/extract/transpile/vueWrap.js - - -vueWrap.js + + +src/extract/utl/compare.js + + +compare.js - - -src/extract/transpile/meta.js->src/extract/transpile/vueWrap.js - - + + +src/extract/utl/detect-pre-compilation-ness.js->src/extract/utl/compare.js + + - + -src/extract/index.js->src/extract/addValidations.js - - +src/extract/index.js->src/extract/add-validations.js + + - + -src/extract/index.js->src/extract/clearCaches.js - - +src/extract/index.js->src/extract/clear-caches.js + + src/extract/index.js->src/extract/derive/circular/index.js - - + + src/extract/index.js->src/extract/derive/orphan/index.js - - + + src/extract/index.js->src/extract/derive/reachable/index.js - - + + - + -src/extract/index.js->src/extract/extract.js - - +src/extract/index.js->src/extract/gather-initial-sources.js + + - - -src/extract/index.js->src/extract/gatherInitialSources.js - - - - + -src/extract/index.js->src/extract/utl/pathToPosix.js - - +src/extract/index.js->src/extract/utl/path-to-posix.js + + + + + +src/extract/index.js->src/extract/get-dependencies.js + + src/extract/summarize.js - -summarize.js + +summarize.js src/extract/index.js->src/extract/summarize.js - - + + - + -src/utl/findRuleByName.js - - -findRuleByName.js +src/utl/find-rule-by-name.js + + +find-rule-by-name.js - + -src/extract/summarize.js->src/utl/findRuleByName.js - - +src/extract/summarize.js->src/utl/find-rule-by-name.js + + src/extract/summarize.js->src/extract/utl/compare.js - - + + src/extract/transpile/index.js->src/extract/transpile/meta.js - - + + - + -src/extract/resolve/determineDependencyTypes.js->src/extract/resolve/localNpmHelpers.js - - +src/extract/resolve/determine-dependency-types.js->src/extract/resolve/local-npm-helpers.js + + - + -src/extract/resolve/determineDependencyTypes.js->src/extract/resolve/isCore.js - - +src/extract/resolve/determine-dependency-types.js->src/extract/resolve/is-core.js + + - + -src/extract/resolve/determineDependencyTypes.js->src/extract/resolve/isRelativeModuleName.js - - +src/extract/resolve/determine-dependency-types.js->src/extract/resolve/is-relative-module-name.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/resolve.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/resolve.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/readPackageDeps/index.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/read-package-deps/index.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/utl/pathToPosix.js - - +src/extract/resolve/resolve-cjs.js->src/extract/utl/path-to-posix.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/determineDependencyTypes.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/determine-dependency-types.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/isCore.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/is-core.js + + - + -src/extract/resolve/isFollowable.js - - -isFollowable.js +src/extract/resolve/is-followable.js + + +is-followable.js - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/isFollowable.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/is-followable.js + + - + -src/extract/resolve/resolve-commonJS.js->src/extract/resolve/resolve-helpers.js - - +src/extract/resolve/resolve-cjs.js->src/extract/resolve/resolve-helpers.js + + - + -src/extract/resolve/isFollowable.js->src/extract/utl/getExtension.js - - +src/extract/resolve/is-followable.js->src/extract/utl/get-extension.js + + - + -src/extract/resolve/resolve-helpers.js->src/extract/resolve/localNpmHelpers.js - - +src/extract/resolve/resolve-helpers.js->src/extract/resolve/local-npm-helpers.js + + src/report/anon/index.js - -index.js + +index.js src/report/index.js->src/report/anon/index.js - - + + src/report/csv/index.js - -index.js + +index.js src/report/index.js->src/report/csv/index.js - - + + src/report/dot/index.js - -index.js + +index.js src/report/index.js->src/report/dot/index.js - - + + src/report/err-html/index.js - -index.js + +index.js src/report/index.js->src/report/err-html/index.js - - + + src/report/err.js - -err.js + +err.js src/report/index.js->src/report/err.js - - + + src/report/html/index.js - -index.js + +index.js src/report/index.js->src/report/html/index.js - - + + src/report/identity.js - -identity.js + +identity.js src/report/index.js->src/report/identity.js - - + + src/report/json.js - -json.js + +json.js src/report/index.js->src/report/json.js - - + + src/report/teamcity.js - -teamcity.js + +teamcity.js src/report/index.js->src/report/teamcity.js - - + + src/main/options/defaults.json - - -defaults.json + + +defaults.json src/main/options/normalize.js->src/main/options/defaults.json - - + + src/main/options/validate.js->src/report/index.js - - + + - + -src/main/ruleSet/validate.js->src/main/options/validate.js - - +src/main/rule-set/validate.js->src/main/options/validate.js + + src/schema/configuration.schema.json - - -configuration.schema.json + + +configuration.schema.json - + -src/main/ruleSet/validate.js->src/schema/configuration.schema.json - - +src/main/rule-set/validate.js->src/schema/configuration.schema.json + + - + -src/report/anon/anonymizePath.js - - -anonymizePath.js +src/report/anon/anonymize-path-element.js + + +anonymize-path-element.js - + -src/report/anon/anonymizePathElement.js - - -anonymizePathElement.js +src/report/anon/random-string.js + + +random-string.js - + -src/report/anon/anonymizePath.js->src/report/anon/anonymizePathElement.js - - +src/report/anon/anonymize-path-element.js->src/report/anon/random-string.js + + - + -src/report/anon/randomString.js - - -randomString.js +src/report/anon/anonymize-path.js + + +anonymize-path.js - + -src/report/anon/anonymizePathElement.js->src/report/anon/randomString.js - - +src/report/anon/anonymize-path.js->src/report/anon/anonymize-path-element.js + + - + -src/report/anon/index.js->src/report/anon/anonymizePath.js - - +src/report/anon/index.js->src/report/anon/anonymize-path.js + + src/report/csv/csv.template.js - -csv.template.js + +csv.template.js src/report/csv/index.js->src/report/csv/csv.template.js - - + + - + -src/report/utl/dependencyToIncidenceTransformer.js - - -dependencyToIncidenceTransformer.js +src/report/utl/dependency-to-incidence-transformer.js + + +dependency-to-incidence-transformer.js - + -src/report/csv/index.js->src/report/utl/dependencyToIncidenceTransformer.js - - +src/report/csv/index.js->src/report/utl/dependency-to-incidence-transformer.js + + - + -src/report/dot/defaultTheme.json - - - -defaultTheme.json +src/report/dot/default-theme.json + + + +default-theme.json @@ -1917,298 +1917,298 @@ src/report/dot/dot.template.js - -dot.template.js + +dot.template.js src/report/dot/index.js->src/report/dot/dot.template.js - - + + src/report/dot/module-utl.js - -module-utl.js + +module-utl.js src/report/dot/index.js->src/report/dot/module-utl.js - - + + - + -src/report/dot/prepareCustomLevel.js - - -prepareCustomLevel.js +src/report/dot/prepare-custom-level.js + + +prepare-custom-level.js - + -src/report/dot/index.js->src/report/dot/prepareCustomLevel.js - - +src/report/dot/index.js->src/report/dot/prepare-custom-level.js + + - + -src/report/dot/prepareFolderLevel.js - - -prepareFolderLevel.js +src/report/dot/prepare-folder-level.js + + +prepare-folder-level.js - + -src/report/dot/index.js->src/report/dot/prepareFolderLevel.js - - +src/report/dot/index.js->src/report/dot/prepare-folder-level.js + + src/report/dot/theming.js - -theming.js + +theming.js src/report/dot/index.js->src/report/dot/theming.js - - + + src/report/dot/module-utl.js->src/report/dot/theming.js - - + + - + -src/report/dot/prepareCustomLevel.js->src/report/dot/module-utl.js - - +src/report/dot/prepare-custom-level.js->src/report/dot/module-utl.js + + - + -src/report/utl/consolidateToPattern.js - - -consolidateToPattern.js +src/report/utl/consolidate-to-pattern.js + + +consolidate-to-pattern.js - + -src/report/dot/prepareCustomLevel.js->src/report/utl/consolidateToPattern.js - - +src/report/dot/prepare-custom-level.js->src/report/utl/consolidate-to-pattern.js + + - + -src/report/dot/prepareFolderLevel.js->src/report/dot/module-utl.js - - +src/report/dot/prepare-folder-level.js->src/report/dot/module-utl.js + + - + -src/report/utl/consolidateToFolder.js - - -consolidateToFolder.js +src/report/utl/consolidate-to-folder.js + + +consolidate-to-folder.js - + -src/report/dot/prepareFolderLevel.js->src/report/utl/consolidateToFolder.js - - +src/report/dot/prepare-folder-level.js->src/report/utl/consolidate-to-folder.js + + - + -src/report/dot/theming.js->src/report/dot/defaultTheme.json - - +src/report/dot/theming.js->src/report/dot/default-theme.json + + - + -src/report/utl/consolidateModuleDependencies.js - - -consolidateModuleDependencies.js +src/report/utl/consolidate-module-dependencies.js + + +consolidate-module-dependencies.js - + -src/report/utl/consolidateToPattern.js->src/report/utl/consolidateModuleDependencies.js - - +src/report/utl/consolidate-to-pattern.js->src/report/utl/consolidate-module-dependencies.js + + - + -src/report/utl/consolidateModules.js - - -consolidateModules.js +src/report/utl/consolidate-modules.js + + +consolidate-modules.js - + -src/report/utl/consolidateToPattern.js->src/report/utl/consolidateModules.js - - +src/report/utl/consolidate-to-pattern.js->src/report/utl/consolidate-modules.js + + - + -src/report/utl/consolidateToFolder.js->src/report/utl/consolidateModuleDependencies.js - - +src/report/utl/consolidate-to-folder.js->src/report/utl/consolidate-module-dependencies.js + + - + -src/report/utl/consolidateToFolder.js->src/report/utl/consolidateModules.js - - +src/report/utl/consolidate-to-folder.js->src/report/utl/consolidate-modules.js + + src/report/err-html/err-html.template.js - -err-html.template.js + +err-html.template.js src/report/err-html/index.js->src/report/err-html/err-html.template.js - - + + src/report/err-html/utl.js - -utl.js + +utl.js src/report/err-html/index.js->src/report/err-html/utl.js - - + + - + -src/report/err.js->src/utl/findRuleByName.js - - +src/report/err.js->src/utl/find-rule-by-name.js + + src/report/html/html.template.js - -html.template.js + +html.template.js - + -src/report/html/index.js->src/report/utl/dependencyToIncidenceTransformer.js - - +src/report/html/index.js->src/report/utl/dependency-to-incidence-transformer.js + + src/report/html/index.js->src/report/html/html.template.js - - + + - + -src/report/utl/compareRules.js - - -compareRules.js +src/report/utl/compare-rules.js + + +compare-rules.js - + -src/report/utl/consolidateModuleDependencies.js->src/report/utl/compareRules.js - - +src/report/utl/consolidate-module-dependencies.js->src/report/utl/compare-rules.js + + - + -src/report/utl/consolidateModules.js->src/report/utl/compareRules.js - - +src/report/utl/consolidate-modules.js->src/report/utl/compare-rules.js + + - + -src/validate/isModuleOnlyRule.js - - -isModuleOnlyRule.js +src/validate/is-module-only-rule.js + + +is-module-only-rule.js - + -src/validate/matchDependencyRule.js->src/validate/isModuleOnlyRule.js - - +src/validate/match-dependency-rule.js->src/validate/is-module-only-rule.js + + src/validate/matches.js - -matches.js + +matches.js - + -src/validate/matchDependencyRule.js->src/validate/matches.js - - +src/validate/match-dependency-rule.js->src/validate/matches.js + + - + -src/validate/matchModuleRule.js->src/validate/isModuleOnlyRule.js - - +src/validate/match-module-rule.js->src/validate/is-module-only-rule.js + + - + -src/validate/matchModuleRule.js->src/validate/matches.js - - +src/validate/match-module-rule.js->src/validate/matches.js + + - + -src/validate/matches.js->src/utl/arrayUtil.js - - +src/validate/matches.js->src/utl/array-util.js + + diff --git a/docs/dependency-cruiser-dir-graph.html b/docs/dependency-cruiser-dir-graph.html index 4eb0c05c9..7ee7b3724 100644 --- a/docs/dependency-cruiser-dir-graph.html +++ b/docs/dependency-cruiser-dir-graph.html @@ -45,40 +45,40 @@ - + dependency-cruiser output - + cluster_src - -src + +src cluster_src/cli - -cli + +cli cluster_src/extract - -extract + +extract cluster_src/extract/derive - -derive + +derive cluster_src/extract/resolve - -resolve + +resolve cluster_src/main - -main + +main cluster_src/report @@ -89,11 +89,11 @@ bin - - - - -bin + + + + +bin @@ -101,388 +101,394 @@ bin->src/cli - - + + src/cli/tools - - - - -tools + + + + +tools bin->src/cli/tools - - + + src/cli->src/main - - + + src/cli/utl - - - - -utl + + + + +utl src/cli->src/cli/utl - - + + - + -src/cli/compileConfig - - - - - -compileConfig +src/cli/compile-config + + + + + +compile-config - + -src/cli->src/cli/compileConfig - - +src/cli->src/cli/compile-config + + - + -src/cli/initConfig - - - - - -initConfig +src/cli/init-config + + + + + +init-config - + -src/cli->src/cli/initConfig - - +src/cli->src/cli/init-config + + - + -src/main/resolveOptions - - - - - -resolveOptions +src/main/resolve-options + + + + + +resolve-options - + -src/main->src/main/resolveOptions - - +src/main->src/main/resolve-options + + src/main->src/extract - - + + - + src/extract/transpile - - - - - -transpile + + + + + +transpile src/main->src/extract/transpile - - + + src/main->src/report - - + + src/schema - - - - -schema + + + + +schema src/main->src/schema - - + + - + -src/main/filesAndDirs - - - - - -filesAndDirs +src/main/files-and-dirs + + + + + +files-and-dirs - + -src/main->src/main/filesAndDirs - - +src/main->src/main/files-and-dirs + + src/main/options - - - - -options + + + + +options src/main->src/main/options - - + + - + -src/main/ruleSet - - - - - -ruleSet +src/main/rule-set + + + + + +rule-set - + -src/main->src/main/ruleSet - - +src/main->src/main/rule-set + + - + -src/cli/compileConfig->src/extract/resolve +src/cli/compile-config->src/extract/resolve - - + + -cli-to-main-only-warn +cli-to-main-only-warn - + -src/cli/compileConfig->src/main/resolveOptions - - +src/cli/compile-config->src/main/resolve-options + + - + -src/cli/initConfig->src/cli - - +src/cli/init-config->src/cli + + src/extract/utl - - - - -utl + + + + +utl src/extract/resolve->src/extract/utl - - + + - + -src/extract/resolve/readPackageDeps - - - - - -readPackageDeps +src/extract/resolve/read-package-deps + + + + + +read-package-deps - + -src/extract/resolve->src/extract/resolve/readPackageDeps - - +src/extract/resolve->src/extract/resolve/read-package-deps + + - + -src/main/resolveOptions->src/extract/transpile - - +src/main/resolve-options->src/extract/transpile + + src/extract->src/extract/resolve - - + + src/extract/derive/circular - - - - -circular + + + + +circular src/extract->src/extract/derive/circular - - + + src/extract/derive/orphan - - - - -orphan + + + + +orphan src/extract->src/extract/derive/orphan - - + + src/extract/derive/reachable - - - - -reachable + + + + +reachable src/extract->src/extract/derive/reachable - - + + src/extract->src/extract/utl - - + + src/validate - - - - -validate + + + + +validate src/extract->src/validate - - + + src/extract/parse - - - - -parse + + + + +parse src/extract->src/extract/parse - - + + - + -src/extract->src/extract/resolve/readPackageDeps - - +src/extract->src/extract/resolve/read-package-deps + + + + + +src/extract->src/extract/transpile + + - + src/utl - + @@ -492,197 +498,191 @@ - + src/extract->src/utl - - + + - + src/extract/ast-extractors - - - - - -ast-extractors + + + + + +ast-extractors - -src/extract->src/extract/ast-extractors - - - - -src/extract->src/extract/transpile - - +src/extract->src/extract/ast-extractors + + src/validate->src/utl - - + + src/extract/parse->src/extract/utl - - + + src/extract/parse->src/extract/transpile - - + + src/report->src/utl - - + + src/report/anon - - - - -anon + + + + +anon src/report->src/report/anon - - + + src/report/csv - - - - -csv + + + + +csv src/report->src/report/csv - - + + src/report/dot - - - - -dot + + + + +dot src/report->src/report/dot - - + + src/report/err-html - - - - -err-html + + + + +err-html src/report->src/report/err-html - - + + src/report/html - - - - -html + + + + +html src/report->src/report/html - - + + src/main/options->src/report - - + + - + -src/main/ruleSet->src/schema - - +src/main/rule-set->src/schema + + - + -src/main/ruleSet->src/main/options - - +src/main/rule-set->src/main/options + + src/report/utl - - - - -utl + + + + +utl src/report/csv->src/report/utl - - + + src/report/dot->src/report/utl - - + + src/report/html->src/report/utl - - + + diff --git a/package.json b/package.json index 53d8420e4..7677d5d36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dependency-cruiser", - "version": "7.3.0-beta-3", + "version": "7.3.0-beta-4", "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.", "keywords": [ "static analysis", @@ -157,6 +157,7 @@ "eslint-plugin-mocha": "6.3.0", "eslint-plugin-node": "11.0.0", "eslint-plugin-security": "1.4.0", + "eslint-plugin-unicorn": "15.0.1", "husky": "3.1.0", "intercept-stdout": "0.1.2", "lint-staged": "9.5.0", @@ -187,6 +188,10 @@ { "package": "lint-staged", "because": "lint-staged 10 doesn't support node 8 anymore while dependency-cruiser still does." + }, + { + "package": "eslint-plugin-unicorn", + "because": "eslint-plugin-unicorn 16 doesn't support node 8 anymore while dependency-cruiser still does." } ] }, @@ -200,7 +205,7 @@ "configs/**/*", "test/**/*", "src/**/*.template.js", - "src/cli/initConfig/getUserInput.js", + "src/cli/init-config/get-user-input.js", "coverage/**/*", "tmp*", "utl/**/*", diff --git a/src/cli/compileConfig/index.js b/src/cli/compile-config/index.js similarity index 88% rename from src/cli/compileConfig/index.js rename to src/cli/compile-config/index.js index fa45427f6..44e810732 100644 --- a/src/cli/compileConfig/index.js +++ b/src/cli/compile-config/index.js @@ -1,8 +1,8 @@ const path = require("path"); const resolve = require("../../extract/resolve/resolve"); -const normalizeResolveOptions = require("../../main/resolveOptions/normalize"); -const readConfig = require("./readConfig"); -const mergeConfigs = require("./mergeConfigs"); +const normalizeResolveOptions = require("../../main/resolve-options/normalize"); +const readConfig = require("./read-config"); +const mergeConfigs = require("./merge-configs"); /* eslint no-use-before-define: 0 */ function processExtends(pRetval, pAlreadyVisited, pBaseDir) { @@ -56,7 +56,7 @@ function compileConfig( if (pAlreadyVisited.has(lResolvedFileName)) { throw new Error( - `config is circular - ${Array.from(pAlreadyVisited).join( + `config is circular - ${[...pAlreadyVisited].join( " -> " )} -> ${lResolvedFileName}.\n` ); diff --git a/src/cli/compileConfig/mergeConfigs.js b/src/cli/compile-config/merge-configs.js similarity index 100% rename from src/cli/compileConfig/mergeConfigs.js rename to src/cli/compile-config/merge-configs.js diff --git a/src/cli/compileConfig/readConfig.js b/src/cli/compile-config/read-config.js similarity index 85% rename from src/cli/compileConfig/readConfig.js rename to src/cli/compile-config/read-config.js index 17a0e4609..76a15edb7 100644 --- a/src/cli/compileConfig/readConfig.js +++ b/src/cli/compile-config/read-config.js @@ -3,7 +3,7 @@ const path = require("path"); const stripJSONComments = require("strip-json-comments"); module.exports = pConfigFileName => { - if ([".js", ""].indexOf(path.extname(pConfigFileName)) > -1) { + if ([".js", ""].includes(path.extname(pConfigFileName))) { /* eslint global-require:0, security/detect-non-literal-require:0, import/no-dynamic-require:0 */ return require(pConfigFileName); } diff --git a/src/cli/formatMetaInfo.js b/src/cli/format-meta-info.js similarity index 100% rename from src/cli/formatMetaInfo.js rename to src/cli/format-meta-info.js diff --git a/src/cli/format.js b/src/cli/format.js index 9119daffa..781b203e9 100644 --- a/src/cli/format.js +++ b/src/cli/format.js @@ -1,7 +1,7 @@ const getStream = require("get-stream"); const main = require("../main"); -const validateFileExistence = require("./utl/validateFileExistence"); -const normalizeOptions = require("./normalizeOptions"); +const validateFileExistence = require("./utl/validate-file-existence"); +const normalizeOptions = require("./normalize-options"); const io = require("./utl/io"); module.exports = async (pResultFile, pOptions) => { diff --git a/src/cli/getResolveConfig.js b/src/cli/get-resolve-config.js similarity index 95% rename from src/cli/getResolveConfig.js rename to src/cli/get-resolve-config.js index ae35a0842..452b41b4f 100644 --- a/src/cli/getResolveConfig.js +++ b/src/cli/get-resolve-config.js @@ -1,4 +1,4 @@ -const makeAbsolute = require("./utl/makeAbsolute"); +const makeAbsolute = require("./utl/make-absolute"); function pryConfigFromTheConfig( pWebpackConfigModule, diff --git a/src/cli/index.js b/src/cli/index.js index ab7fe07d1..31b261a6f 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -1,13 +1,13 @@ const glob = require("glob"); const _get = require("lodash/get"); const main = require("../main"); -const parseTSConfig = require("./parseTSConfig"); -const getResolveConfig = require("./getResolveConfig"); -const validateFileExistence = require("./utl/validateFileExistence"); -const normalizeOptions = require("./normalizeOptions"); -const initConfig = require("./initConfig"); +const parseTSConfig = require("./parse-ts-config"); +const getResolveConfig = require("./get-resolve-config"); +const validateFileExistence = require("./utl/validate-file-existence"); +const normalizeOptions = require("./normalize-options"); +const initConfig = require("./init-config"); const io = require("./utl/io"); -const formatMetaInfo = require("./formatMetaInfo"); +const formatMetaInfo = require("./format-meta-info"); function extractResolveOptions(pOptions) { let lResolveOptions = {}; @@ -73,8 +73,8 @@ module.exports = (pFileDirArray, pOptions) => { } else { lExitCode = runCruise(pFileDirArray, pOptions); } - } catch (e) { - process.stderr.write(`\n ERROR: ${e.message}\n`); + } catch (pError) { + process.stderr.write(`\n ERROR: ${pError.message}\n`); lExitCode = 1; } return lExitCode; diff --git a/src/cli/initConfig/config.js.template.hbs b/src/cli/init-config/config.js.template.hbs similarity index 100% rename from src/cli/initConfig/config.js.template.hbs rename to src/cli/init-config/config.js.template.hbs diff --git a/src/cli/initConfig/config.js.template.js b/src/cli/init-config/config.js.template.js similarity index 100% rename from src/cli/initConfig/config.js.template.js rename to src/cli/init-config/config.js.template.js diff --git a/src/cli/initConfig/createConfigFile.js b/src/cli/init-config/create-config-file.js similarity index 90% rename from src/cli/initConfig/createConfigFile.js rename to src/cli/init-config/create-config-file.js index 26e205abd..207065b0a 100644 --- a/src/cli/initConfig/createConfigFile.js +++ b/src/cli/init-config/create-config-file.js @@ -14,14 +14,16 @@ function buildConfig(pInitOptions) { function writeTheThing(pFileName, pConfig) { if (fileExists(pFileName)) { - throw Error(`A '${pFileName}' already exists here - leaving it be.\n`); + throw new Error(`A '${pFileName}' already exists here - leaving it be.\n`); } else { try { fs.writeFileSync(pFileName, pConfig); process.stdout.write(`\n Successfully created '${pFileName}'\n\n`); - } catch (e) { + } catch (pError) { /* istanbul ignore next */ - throw Error(`ERROR: Writing to '${pFileName}' didn't work. ${e}\n`); + throw new Error( + `ERROR: Writing to '${pFileName}' didn't work. ${pError}\n` + ); } } } diff --git a/src/cli/initConfig/getUserInput.js b/src/cli/init-config/get-user-input.js similarity index 100% rename from src/cli/initConfig/getUserInput.js rename to src/cli/init-config/get-user-input.js diff --git a/src/cli/initConfig/helpers.js b/src/cli/init-config/helpers.js similarity index 94% rename from src/cli/initConfig/helpers.js rename to src/cli/init-config/helpers.js index 153d850a3..175f5fb79 100644 --- a/src/cli/initConfig/helpers.js +++ b/src/cli/init-config/helpers.js @@ -8,7 +8,7 @@ const _get = require("lodash/get"); function fileExists(pFile) { try { fs.accessSync(pFile, fs.R_OK); - } catch (e) { + } catch (pError) { return false; } return true; @@ -22,7 +22,7 @@ function pnpIsEnabled() { const lPackageJSON = JSON.parse(lPackageFileText); lRetval = _get(lPackageJSON, "installConfig.pnp", lRetval); - } catch (e) { + } catch (pError) { // silently ignore - we'll return false anyway then } return lRetval; diff --git a/src/cli/initConfig/index.js b/src/cli/init-config/index.js similarity index 92% rename from src/cli/initConfig/index.js rename to src/cli/init-config/index.js index 6c39cd108..3e8f9bf5c 100644 --- a/src/cli/initConfig/index.js +++ b/src/cli/init-config/index.js @@ -1,6 +1,6 @@ const $defaults = require("../defaults.json"); -const createConfigFile = require("./createConfigFile"); -const getUserInput = require("./getUserInput"); +const createConfigFile = require("./create-config-file"); +const getUserInput = require("./get-user-input"); const { pnpIsEnabled, fileExists } = require("./helpers"); const TYPESCRIPT_CONFIG = `./${$defaults.TYPESCRIPT_CONFIG}`; diff --git a/src/cli/normalizeOptions.js b/src/cli/normalize-options.js similarity index 97% rename from src/cli/normalizeOptions.js rename to src/cli/normalize-options.js index 791cfa503..3aa1de350 100644 --- a/src/cli/normalizeOptions.js +++ b/src/cli/normalize-options.js @@ -3,7 +3,7 @@ const path = require("path"); const _set = require("lodash/set"); const _get = require("lodash/get"); const _clone = require("lodash/clone"); -const compileConfig = require("./compileConfig"); +const compileConfig = require("./compile-config"); const defaults = require("./defaults.json"); function getOptionValue(pDefault) { @@ -49,7 +49,7 @@ function fileExists(pFileName) { try { fs.accessSync(pFileName, fs.R_OK); return true; - } catch (e) { + } catch (pError) { return false; } } diff --git a/src/cli/parseTSConfig.js b/src/cli/parse-ts-config.js similarity index 100% rename from src/cli/parseTSConfig.js rename to src/cli/parse-ts-config.js diff --git a/src/cli/utl/io.js b/src/cli/utl/io.js index 6e7aee8f6..69326decc 100644 --- a/src/cli/utl/io.js +++ b/src/cli/utl/io.js @@ -8,8 +8,8 @@ function writeToFile(pOutputTo, pDependencyString) { encoding: "utf8", flag: "w" }); - } catch (e) { - throw Error(`Writing to '${pOutputTo}' didn't work. ${e}`); + } catch (pError) { + throw new Error(`Writing to '${pOutputTo}' didn't work. ${pError}`); } } @@ -32,6 +32,7 @@ function writeToStdOut(pString, pBufferSize) { /* eslint no-plusplus: 0 */ for (i = 0; i < lNumberOfChunks; i++) { + // eslint-disable-next-line unicorn/prefer-string-slice process.stdout.write(pString.substr(i * pBufferSize, pBufferSize), "utf8"); } } diff --git a/src/cli/utl/makeAbsolute.js b/src/cli/utl/make-absolute.js similarity index 100% rename from src/cli/utl/makeAbsolute.js rename to src/cli/utl/make-absolute.js diff --git a/src/cli/utl/validateFileExistence.js b/src/cli/utl/validate-file-existence.js similarity index 52% rename from src/cli/utl/validateFileExistence.js rename to src/cli/utl/validate-file-existence.js index 19c00cab2..c6082159c 100644 --- a/src/cli/utl/validateFileExistence.js +++ b/src/cli/utl/validate-file-existence.js @@ -3,7 +3,7 @@ const fs = require("fs"); module.exports = pDirOrFile => { try { fs.accessSync(pDirOrFile, fs.R_OK); - } catch (e) { - throw Error(`Can't open '${pDirOrFile}' for reading. Does it exist?\n`); + } catch (pError) { + throw new Error(`Can't open '${pDirOrFile}' for reading. Does it exist?\n`); } }; diff --git a/src/cli/validateNodeEnv.js b/src/cli/validate-node-env.js similarity index 100% rename from src/cli/validateNodeEnv.js rename to src/cli/validate-node-env.js diff --git a/src/extract/addValidations.js b/src/extract/add-validations.js similarity index 100% rename from src/extract/addValidations.js rename to src/extract/add-validations.js diff --git a/src/extract/ast-extractors/extract-AMD-deps.js b/src/extract/ast-extractors/extract-amd-deps.js similarity index 96% rename from src/extract/ast-extractors/extract-AMD-deps.js rename to src/extract/ast-extractors/extract-amd-deps.js index 64db22806..43598c955 100644 --- a/src/extract/ast-extractors/extract-AMD-deps.js +++ b/src/extract/ast-extractors/extract-amd-deps.js @@ -1,5 +1,5 @@ const walk = require("acorn-walk"); -const extractCommonJSDependencies = require("./extract-commonJS-deps"); +const extractCommonJSDependencies = require("./extract-cjs-deps"); const estreeHelpers = require("./estree-helpers"); function extractRegularAMDDependencies(pNode, pDependencies) { diff --git a/src/extract/ast-extractors/extract-commonJS-deps.js b/src/extract/ast-extractors/extract-cjs-deps.js similarity index 100% rename from src/extract/ast-extractors/extract-commonJS-deps.js rename to src/extract/ast-extractors/extract-cjs-deps.js diff --git a/src/extract/ast-extractors/extract-ES6-deps.js b/src/extract/ast-extractors/extract-es6-deps.js similarity index 100% rename from src/extract/ast-extractors/extract-ES6-deps.js rename to src/extract/ast-extractors/extract-es6-deps.js diff --git a/src/extract/clear-caches.js b/src/extract/clear-caches.js new file mode 100644 index 000000000..38ca7f51f --- /dev/null +++ b/src/extract/clear-caches.js @@ -0,0 +1,17 @@ +const toTypescriptAST = require("./parse/to-typescript-ast"); +const toJavascriptAST = require("./parse/to-javascript-ast"); +const localNpmHelpers = require("./resolve/local-npm-helpers"); +const readPackageDeps = require("./resolve/read-package-deps"); +const resolveAMD = require("./resolve/resolve-amd"); +const resolve = require("./resolve/resolve"); +const reachable = require("./derive/reachable/is-reachable"); + +module.exports = () => { + toTypescriptAST.clearCache(); + toJavascriptAST.clearCache(); + localNpmHelpers.clearCache(); + readPackageDeps.clearCache(); + resolveAMD.clearCache(); + resolve.clearCache(); + reachable.clearCache(); +}; diff --git a/src/extract/clearCaches.js b/src/extract/clearCaches.js deleted file mode 100644 index 81578bca3..000000000 --- a/src/extract/clearCaches.js +++ /dev/null @@ -1,17 +0,0 @@ -const toTypescriptAST = require("./parse/toTypescriptAST"); -const toJavascriptAST = require("./parse/toJavascriptAST"); -const localNpmHelpers = require("./resolve/localNpmHelpers"); -const readPackageDeps = require("./resolve/readPackageDeps"); -const resolveAMD = require("./resolve/resolve-AMD"); -const resolve = require("./resolve/resolve"); -const reachable = require("./derive/reachable/isReachable"); - -module.exports = () => { - toTypescriptAST.clearCache(); - toJavascriptAST.clearCache(); - localNpmHelpers.clearCache(); - readPackageDeps.clearCache(); - resolveAMD.clearCache(); - resolve.clearCache(); - reachable.clearCache(); -}; diff --git a/src/extract/derive/circular/getCycle.js b/src/extract/derive/circular/get-cycle.js similarity index 100% rename from src/extract/derive/circular/getCycle.js rename to src/extract/derive/circular/get-cycle.js diff --git a/src/extract/derive/circular/index.js b/src/extract/derive/circular/index.js index 6b2d62dbf..49726a6e3 100644 --- a/src/extract/derive/circular/index.js +++ b/src/extract/derive/circular/index.js @@ -1,4 +1,4 @@ -const getCycle = require("./getCycle"); +const getCycle = require("./get-cycle"); function addCircularityCheckToDependency(pToDep, pGraph, pFrom) { const lCycle = getCycle(pGraph, pFrom, pToDep.resolved); diff --git a/src/extract/derive/orphan/index.js b/src/extract/derive/orphan/index.js index 78345ba48..34344fce3 100644 --- a/src/extract/derive/orphan/index.js +++ b/src/extract/derive/orphan/index.js @@ -1,4 +1,4 @@ -const isOrphan = require("./isOrphan"); +const isOrphan = require("./is-orphan"); module.exports = pModules => pModules.map(pNode => ({ diff --git a/src/extract/derive/orphan/isOrphan.js b/src/extract/derive/orphan/is-orphan.js similarity index 100% rename from src/extract/derive/orphan/isOrphan.js rename to src/extract/derive/orphan/is-orphan.js diff --git a/src/extract/derive/reachable/index.js b/src/extract/derive/reachable/index.js index cef214ae4..f200be41b 100644 --- a/src/extract/derive/reachable/index.js +++ b/src/extract/derive/reachable/index.js @@ -1,6 +1,6 @@ const _clone = require("lodash/clone"); const _get = require("lodash/get"); -const isReachable = require("./isReachable"); +const isReachable = require("./is-reachable"); function getReachableRules(pRuleSet) { return _get(pRuleSet, "forbidden", []) diff --git a/src/extract/derive/reachable/isReachable.js b/src/extract/derive/reachable/is-reachable.js similarity index 100% rename from src/extract/derive/reachable/isReachable.js rename to src/extract/derive/reachable/is-reachable.js diff --git a/src/extract/gatherInitialSources.js b/src/extract/gather-initial-sources.js similarity index 98% rename from src/extract/gatherInitialSources.js rename to src/extract/gather-initial-sources.js index d8ef1b004..7a324d46c 100644 --- a/src/extract/gatherInitialSources.js +++ b/src/extract/gather-initial-sources.js @@ -3,7 +3,7 @@ const path = require("path"); const glob = require("glob"); const _get = require("lodash/get"); const transpileMeta = require("./transpile/meta"); -const pathToPosix = require("./utl/pathToPosix"); +const pathToPosix = require("./utl/path-to-posix"); const SUPPORTED_EXTENSIONS = transpileMeta.scannableExtensions; diff --git a/src/extract/extract.js b/src/extract/get-dependencies.js similarity index 87% rename from src/extract/extract.js rename to src/extract/get-dependencies.js index 43f9324cd..0cbf652bd 100644 --- a/src/extract/extract.js +++ b/src/extract/get-dependencies.js @@ -1,15 +1,15 @@ const path = require("path"); const _get = require("lodash/get"); const _uniqBy = require("lodash/uniqBy"); -const intersects = require("../utl/arrayUtil").intersects; +const intersects = require("../utl/array-util").intersects; const resolve = require("./resolve"); -const extractES6Deps = require("./ast-extractors/extract-ES6-deps"); -const extractCommonJSDeps = require("./ast-extractors/extract-commonJS-deps"); -const extractAMDDeps = require("./ast-extractors/extract-AMD-deps"); +const extractES6Deps = require("./ast-extractors/extract-es6-deps"); +const extractCommonJSDeps = require("./ast-extractors/extract-cjs-deps"); +const extractAMDDeps = require("./ast-extractors/extract-amd-deps"); const extractTypeScriptDeps = require("./ast-extractors/extract-typescript-deps"); -const getJSASTCached = require("./parse/toJavascriptAST").getASTCached; -const toTypescriptAST = require("./parse/toTypescriptAST"); -const detectPreCompilationNess = require("./utl/detectPreCompilationNess"); +const toJavascriptAST = require("./parse/to-javascript-ast"); +const toTypescriptAST = require("./parse/to-typescript-ast"); +const detectPreCompilationNess = require("./utl/detect-pre-compilation-ness"); function extractFromTypeScriptAST(pOptions, pFileName) { return extractTypeScriptDeps( @@ -28,12 +28,12 @@ function shouldUseTSC(pOptions, pFileName) { function extractFromJavaScriptAST(pOptions, pFileName, pTSConfig) { let lDependencies = []; - const lAST = getJSASTCached( + const lAST = toJavascriptAST.getASTCached( path.join(pOptions.baseDir, pFileName), pTSConfig ); - if (pOptions.moduleSystems.indexOf("cjs") > -1) { + if (pOptions.moduleSystems.includes("cjs")) { extractCommonJSDeps( lAST, lDependencies, @@ -41,10 +41,10 @@ function extractFromJavaScriptAST(pOptions, pFileName, pTSConfig) { pOptions.exoticRequireStrings ); } - if (pOptions.moduleSystems.indexOf("es6") > -1) { + if (pOptions.moduleSystems.includes("es6")) { extractES6Deps(lAST, lDependencies); } - if (pOptions.moduleSystems.indexOf("amd") > -1) { + if (pOptions.moduleSystems.includes("amd")) { extractAMDDeps(lAST, lDependencies, pOptions.exoticRequireStrings); } @@ -165,10 +165,9 @@ module.exports = (pFileName, pOptions, pResolveOptions, pTSConfig) => { (!pOptions.includeOnly || matchesPattern(pDep.resolved, pOptions.includeOnly)) ); - // .value(); - } catch (e) { + } catch (pError) { throw new Error( - `Extracting dependencies ran afoul of...\n\n ${e.message}\n... in ${pFileName}\n\n` + `Extracting dependencies ran afoul of...\n\n ${pError.message}\n... in ${pFileName}\n\n` ); } }; diff --git a/src/extract/index.js b/src/extract/index.js index 04a6e8aa4..6d30d8e61 100644 --- a/src/extract/index.js +++ b/src/extract/index.js @@ -2,15 +2,15 @@ const _get = require("lodash/get"); const _uniqBy = require("lodash/uniqBy"); const _spread = require("lodash/spread"); const _concat = require("lodash/concat"); -const pathToPosix = require("./utl/pathToPosix"); -const extract = require("./extract"); +const pathToPosix = require("./utl/path-to-posix"); +const getDependencies = require("./get-dependencies"); const deriveCirculars = require("./derive/circular"); const deriveOrphans = require("./derive/orphan"); const deriveReachable = require("./derive/reachable"); -const gather = require("./gatherInitialSources"); +const gatherInitialSources = require("./gather-initial-sources"); const summarize = require("./summarize"); -const addValidations = require("./addValidations"); -const clearCaches = require("./clearCaches"); +const addValidations = require("./add-validations"); +const clearCaches = require("./clear-caches"); const SHAREABLE_OPTIONS = [ "combinedDependencies", @@ -44,7 +44,7 @@ function extractRecursive( pVisited.add(pFileName); const lDependencies = pOptions.maxDepth <= 0 || pDepth < pOptions.maxDepth - ? extract(pFileName, pOptions, pResolveOptions, pTSConfig) + ? getDependencies(pFileName, pOptions, pResolveOptions, pTSConfig) : []; return lDependencies @@ -83,22 +83,25 @@ function extractFileDirArray( let lVisited = new Set(); return _spread(_concat)( - gather(pFileDirArray, pOptions).reduce((pDependencies, pFilename) => { - if (!lVisited.has(pFilename)) { - lVisited.add(pFilename); - return pDependencies.concat( - extractRecursive( - pFilename, - pOptions, - lVisited, - 0, - pResolveOptions, - pTSConfig - ) - ); - } - return pDependencies; - }, []) + gatherInitialSources(pFileDirArray, pOptions).reduce( + (pDependencies, pFilename) => { + if (!lVisited.has(pFilename)) { + lVisited.add(pFilename); + return pDependencies.concat( + extractRecursive( + pFilename, + pOptions, + lVisited, + 0, + pResolveOptions, + pTSConfig + ) + ); + } + return pDependencies; + }, + [] + ) ); } diff --git a/src/extract/parse/toJavascriptAST.js b/src/extract/parse/to-javascript-ast.js similarity index 95% rename from src/extract/parse/toJavascriptAST.js rename to src/extract/parse/to-javascript-ast.js index 8f01d560f..e842c678a 100644 --- a/src/extract/parse/toJavascriptAST.js +++ b/src/extract/parse/to-javascript-ast.js @@ -3,7 +3,7 @@ const acorn = require("acorn"); const acornLoose = require("acorn-loose"); const _memoize = require("lodash/memoize"); const transpile = require("../transpile"); -const getExtension = require("../utl/getExtension"); +const getExtension = require("../utl/get-extension"); function getASTFromSource(pSource, pExtension, pTSConfig) { const lJavaScriptSource = transpile(pExtension, pSource, pTSConfig); @@ -15,7 +15,7 @@ function getASTFromSource(pSource, pExtension, pTSConfig) { sourceType: "module", ecmaVersion: 11 }); - } catch (e) { + } catch (pError) { return acornLoose.parse(lJavaScriptSource, { sourceType: "module" }); } } diff --git a/src/extract/parse/toTypescriptAST.js b/src/extract/parse/to-typescript-ast.js similarity index 100% rename from src/extract/parse/toTypescriptAST.js rename to src/extract/parse/to-typescript-ast.js diff --git a/src/extract/resolve/determineDependencyTypes.js b/src/extract/resolve/determine-dependency-types.js similarity index 97% rename from src/extract/resolve/determineDependencyTypes.js rename to src/extract/resolve/determine-dependency-types.js index 12658d484..3dbc5a34b 100644 --- a/src/extract/resolve/determineDependencyTypes.js +++ b/src/extract/resolve/determine-dependency-types.js @@ -1,7 +1,7 @@ const path = require("path"); -const isCore = require("./isCore"); -const isRelativeModuleName = require("./isRelativeModuleName"); -const localNpmHelpers = require("./localNpmHelpers"); +const isCore = require("./is-core"); +const isRelativeModuleName = require("./is-relative-module-name"); +const localNpmHelpers = require("./local-npm-helpers"); const npm2depType = { dependencies: "npm", diff --git a/src/extract/resolve/index.js b/src/extract/resolve/index.js index 0c7e49531..34682a5aa 100644 --- a/src/extract/resolve/index.js +++ b/src/extract/resolve/index.js @@ -1,16 +1,16 @@ const fs = require("fs"); const path = require("path"); -const pathToPosix = require("../utl/pathToPosix"); -const isRelativeModuleName = require("./isRelativeModuleName"); -const resolveAMD = require("./resolve-AMD"); -const resolveCommonJS = require("./resolve-commonJS"); +const pathToPosix = require("../utl/path-to-posix"); +const isRelativeModuleName = require("./is-relative-module-name"); +const resolveAMD = require("./resolve-amd"); +const resolveCommonJS = require("./resolve-cjs"); function resolveModule(pDependency, pBaseDir, pFileDir, pResolveOptions) { let lRetval = null; if ( isRelativeModuleName(pDependency.module) || - ["cjs", "es6"].indexOf(pDependency.moduleSystem) > -1 + ["cjs", "es6"].includes(pDependency.moduleSystem) ) { lRetval = resolveCommonJS( pDependency.module, @@ -83,7 +83,7 @@ module.exports = (pDependency, pBaseDir, pFileDir, pResolveOptions) => { fs.realpathSync(path.resolve(pBaseDir, lResolvedModule.resolved)) ) ); - } catch (e) { + } catch (pError) { lResolvedModule.couldNotResolve = true; } } diff --git a/src/extract/resolve/isCore.js b/src/extract/resolve/is-core.js similarity index 100% rename from src/extract/resolve/isCore.js rename to src/extract/resolve/is-core.js diff --git a/src/extract/resolve/isFollowable.js b/src/extract/resolve/is-followable.js similarity index 96% rename from src/extract/resolve/isFollowable.js rename to src/extract/resolve/is-followable.js index a0f3ae2d7..c359ffc8e 100644 --- a/src/extract/resolve/isFollowable.js +++ b/src/extract/resolve/is-followable.js @@ -1,4 +1,4 @@ -const getExtension = require("../utl/getExtension"); +const getExtension = require("../utl/get-extension"); let gFollowableExtensions = new Set(); let gFollowableExtensionsInitialized = false; diff --git a/src/extract/resolve/isRelativeModuleName.js b/src/extract/resolve/is-relative-module-name.js similarity index 100% rename from src/extract/resolve/isRelativeModuleName.js rename to src/extract/resolve/is-relative-module-name.js diff --git a/src/extract/resolve/localNpmHelpers.js b/src/extract/resolve/local-npm-helpers.js similarity index 98% rename from src/extract/resolve/localNpmHelpers.js rename to src/extract/resolve/local-npm-helpers.js index 49ffe676e..e9db2cee6 100644 --- a/src/extract/resolve/localNpmHelpers.js +++ b/src/extract/resolve/local-npm-helpers.js @@ -2,7 +2,7 @@ const fs = require("fs"); const path = require("path"); const _memoize = require("lodash/memoize"); const resolve = require("./resolve"); -const isRelativeModuleName = require("./isRelativeModuleName"); +const isRelativeModuleName = require("./is-relative-module-name"); const isScoped = pModule => pModule.startsWith("@"); @@ -85,7 +85,7 @@ function bareGetPackageJson(pModule, pBaseDir, pResolveOptions) { ); lRetval = JSON.parse(fs.readFileSync(lPackageJsonFilename, "utf8")); - } catch (e) { + } catch (pError) { // left empty on purpose } return lRetval; diff --git a/src/extract/resolve/readPackageDeps/index.js b/src/extract/resolve/read-package-deps/index.js similarity index 95% rename from src/extract/resolve/readPackageDeps/index.js rename to src/extract/resolve/read-package-deps/index.js index 3bb40d72a..ea00bc8f8 100644 --- a/src/extract/resolve/readPackageDeps/index.js +++ b/src/extract/resolve/read-package-deps/index.js @@ -1,7 +1,7 @@ const path = require("path"); const fs = require("fs"); const _memoize = require("lodash/memoize"); -const mergePackages = require("./mergePackages"); +const mergePackages = require("./merge-packages"); /** * return the contents of the package.json closest to the passed @@ -28,10 +28,10 @@ const readPackageDeps = _memoize(pFileDir => { try { lRetval = JSON.parse(lPackageContent); - } catch (e) { + } catch (pError) { // left empty on purpose } - } catch (e) { + } catch (pError) { const lNextDir = path.dirname(pFileDir); if (lNextDir !== pFileDir) { @@ -53,10 +53,10 @@ function maybeReadPackage(pFileDir) { try { lRetval = JSON.parse(lPackageContent); - } catch (e) { + } catch (pError) { // left empty on purpose } - } catch (e) { + } catch (pError) { // left empty on purpose } return lRetval; @@ -106,7 +106,7 @@ const readPackageDepsCombined = _memoize((pFileDir, pBaseDir) => { /** * return * - the contents of the package.json closest to the passed folder - * (see readPackageDeps above) when pCombinedDependencies === false + * (see read-package-deps above) when pCombinedDependencies === false * - the 'combined' contents of all package.jsons between the passed folder * and the 'root' folder (the folder the cruise was run from) in * all other cases diff --git a/src/extract/resolve/readPackageDeps/mergePackages.js b/src/extract/resolve/read-package-deps/merge-packages.js similarity index 100% rename from src/extract/resolve/readPackageDeps/mergePackages.js rename to src/extract/resolve/read-package-deps/merge-packages.js diff --git a/src/extract/resolve/resolve-AMD.js b/src/extract/resolve/resolve-amd.js similarity index 86% rename from src/extract/resolve/resolve-AMD.js rename to src/extract/resolve/resolve-amd.js index 3aef6c7ac..b6fbcca21 100644 --- a/src/extract/resolve/resolve-AMD.js +++ b/src/extract/resolve/resolve-amd.js @@ -1,16 +1,16 @@ const fs = require("fs"); const path = require("path"); const memoize = require("lodash/memoize"); -const pathToPosix = require("../utl/pathToPosix"); -const determineDependencyTypes = require("./determineDependencyTypes"); -const isCore = require("./isCore"); -const readPackageDeps = require("./readPackageDeps"); +const pathToPosix = require("../utl/path-to-posix"); +const determineDependencyTypes = require("./determine-dependency-types"); +const isCore = require("./is-core"); +const readPackageDeps = require("./read-package-deps"); const resolveHelpers = require("./resolve-helpers"); const fileExists = memoize(pFile => { try { fs.accessSync(pFile, fs.R_OK); - } catch (e) { + } catch (pError) { return false; } diff --git a/src/extract/resolve/resolve-commonJS.js b/src/extract/resolve/resolve-cjs.js similarity index 81% rename from src/extract/resolve/resolve-commonJS.js rename to src/extract/resolve/resolve-cjs.js index bb52891d1..592da7b96 100644 --- a/src/extract/resolve/resolve-commonJS.js +++ b/src/extract/resolve/resolve-cjs.js @@ -1,11 +1,11 @@ const path = require("path"); -const pathToPosix = require("../utl/pathToPosix"); -const determineDependencyTypes = require("./determineDependencyTypes"); -const isCore = require("./isCore"); -const readPackageDeps = require("./readPackageDeps"); +const pathToPosix = require("../utl/path-to-posix"); +const determineDependencyTypes = require("./determine-dependency-types"); +const isCore = require("./is-core"); +const readPackageDeps = require("./read-package-deps"); const resolveHelpers = require("./resolve-helpers"); const resolve = require("./resolve"); -const isFollowable = require("./isFollowable"); +const isFollowable = require("./is-followable"); function addResolutionAttributes( pBaseDir, @@ -23,7 +23,7 @@ function addResolutionAttributes( path.relative(pBaseDir, resolve(pModuleName, pFileDir, pResolveOptions)) ); lRetval.followable = isFollowable(lRetval.resolved, pResolveOptions); - } catch (e) { + } catch (pError) { lRetval.couldNotResolve = true; } } diff --git a/src/extract/resolve/resolve-helpers.js b/src/extract/resolve/resolve-helpers.js index 8f1062ca4..469d86eb1 100644 --- a/src/extract/resolve/resolve-helpers.js +++ b/src/extract/resolve/resolve-helpers.js @@ -1,4 +1,4 @@ -const localNpmHelpers = require("./localNpmHelpers"); +const localNpmHelpers = require("./local-npm-helpers"); module.exports = { addLicenseAttribute(pModuleName, pBaseDir, pResolveOptions) { diff --git a/src/extract/resolve/resolve.js b/src/extract/resolve/resolve.js index eae5a23b9..134cd57ae 100644 --- a/src/extract/resolve/resolve.js +++ b/src/extract/resolve/resolve.js @@ -1,6 +1,6 @@ const enhancedResolve = require("enhanced-resolve"); -const pathToPosix = require("../utl/pathToPosix"); -const stripQueryParams = require("../utl/stripQueryParams"); +const pathToPosix = require("../utl/path-to-posix"); +const stripQueryParams = require("../utl/strip-query-params"); let gResolver = null; let gInitialized = {}; diff --git a/src/extract/summarize.js b/src/extract/summarize.js index c9d325547..89e85ff9f 100644 --- a/src/extract/summarize.js +++ b/src/extract/summarize.js @@ -1,6 +1,6 @@ const _flattenDeep = require("lodash/flattenDeep"); const _get = require("lodash/get"); -const findRuleByName = require("../utl/findRuleByName"); +const findRuleByName = require("../utl/find-rule-by-name"); const compare = require("./utl/compare"); function cutNonTransgressions(pSourceEntry) { diff --git a/src/extract/transpile/coffeeWrap.js b/src/extract/transpile/coffeescript-wrap.js similarity index 100% rename from src/extract/transpile/coffeeWrap.js rename to src/extract/transpile/coffeescript-wrap.js diff --git a/src/extract/transpile/javaScriptWrap.js b/src/extract/transpile/javascript-wrap.js similarity index 100% rename from src/extract/transpile/javaScriptWrap.js rename to src/extract/transpile/javascript-wrap.js diff --git a/src/extract/transpile/jsxImplementationRationale.md b/src/extract/transpile/jsx-implementation-rationale.md similarity index 98% rename from src/extract/transpile/jsxImplementationRationale.md rename to src/extract/transpile/jsx-implementation-rationale.md index fc4c85c59..4d80b5149 100644 --- a/src/extract/transpile/jsxImplementationRationale.md +++ b/src/extract/transpile/jsx-implementation-rationale.md @@ -63,4 +63,4 @@ seems to perform pretty ok, but a more elegant solution is welcome. For these we can use the vue-template-compiler - which seems to do a clean and consistent job - it splits the _template_, _script_, _style_ etc parts in an object, and these can be parsed -individually. Implementation in `vueWrap.js` \ No newline at end of file +individually. Implementation in `vue-template-wrap.js` \ No newline at end of file diff --git a/src/extract/transpile/liveScriptWrap.js b/src/extract/transpile/livescript-wrap.js similarity index 100% rename from src/extract/transpile/liveScriptWrap.js rename to src/extract/transpile/livescript-wrap.js diff --git a/src/extract/transpile/meta.js b/src/extract/transpile/meta.js index 42b28ed62..0fc47d823 100644 --- a/src/extract/transpile/meta.js +++ b/src/extract/transpile/meta.js @@ -1,12 +1,12 @@ const supportedTranspilers = require("../../../package.json") .supportedTranspilers; -const javaScriptWrap = require("./javaScriptWrap"); -const typeScriptWrap = require("./typeScriptWrap")(); -const tsxWrap = require("./typeScriptWrap")(true); -const liveScriptWrap = require("./liveScriptWrap"); -const coffeeWrap = require("./coffeeWrap")(); -const litCoffeeWrap = require("./coffeeWrap")(true); -const vueWrap = require("./vueWrap"); +const javaScriptWrap = require("./javascript-wrap"); +const typeScriptWrap = require("./typescript-wrap")(); +const tsxWrap = require("./typescript-wrap")(true); +const liveScriptWrap = require("./livescript-wrap"); +const coffeeWrap = require("./coffeescript-wrap")(); +const litCoffeeWrap = require("./coffeescript-wrap")(true); +const vueWrap = require("./vue-template-wrap"); /* jsx - acorn_loose will handle this correctly when imports @@ -16,7 +16,7 @@ const vueWrap = require("./vueWrap"); edge cases but are either much harder to implement or likely to fail in basic use cases. - See ./jsxImplementationRationale.md for an implementation + See ./jsx-implementation-rationale.md for an implementation rationale on jsx ... */ const extension2wrapper = { diff --git a/src/extract/transpile/typeScriptWrap.js b/src/extract/transpile/typescript-wrap.js similarity index 100% rename from src/extract/transpile/typeScriptWrap.js rename to src/extract/transpile/typescript-wrap.js diff --git a/src/extract/transpile/vueWrap.js b/src/extract/transpile/vue-template-wrap.js similarity index 100% rename from src/extract/transpile/vueWrap.js rename to src/extract/transpile/vue-template-wrap.js diff --git a/src/extract/utl/detectPreCompilationNess.js b/src/extract/utl/detect-pre-compilation-ness.js similarity index 100% rename from src/extract/utl/detectPreCompilationNess.js rename to src/extract/utl/detect-pre-compilation-ness.js diff --git a/src/extract/utl/getExtension.js b/src/extract/utl/get-extension.js similarity index 100% rename from src/extract/utl/getExtension.js rename to src/extract/utl/get-extension.js diff --git a/src/extract/utl/pathToPosix.js b/src/extract/utl/path-to-posix.js similarity index 100% rename from src/extract/utl/pathToPosix.js rename to src/extract/utl/path-to-posix.js diff --git a/src/extract/utl/stripQueryParams.js b/src/extract/utl/strip-query-params.js similarity index 100% rename from src/extract/utl/stripQueryParams.js rename to src/extract/utl/strip-query-params.js diff --git a/src/main/filesAndDirs/normalize.js b/src/main/files-and-dirs/normalize.js similarity index 100% rename from src/main/filesAndDirs/normalize.js rename to src/main/files-and-dirs/normalize.js diff --git a/src/main/index.js b/src/main/index.js index 9048b4474..21edd62eb 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -3,12 +3,12 @@ const extract = require("../extract"); const cruiseResultSchema = require("../schema/cruise-result.schema.json"); const meta = require("../extract/transpile/meta"); const report = require("../report"); -const normalizeFilesAndDirs = require("./filesAndDirs/normalize"); -const validateRuleSet = require("./ruleSet/validate"); -const normalizeRuleSet = require("./ruleSet/normalize"); +const normalizeFilesAndDirs = require("./files-and-dirs/normalize"); +const validateRuleSet = require("./rule-set/validate"); +const normalizeRuleSet = require("./rule-set/normalize"); const validateOptions = require("./options/validate"); const normalizeOptions = require("./options/normalize"); -const normalizeResolveOptions = require("./resolveOptions/normalize"); +const normalizeResolveOptions = require("./resolve-options/normalize"); // see [api.md](../../doc/api.md) and/ or the // [type definition](../../types/depencency-cruiser.d.ts) for details diff --git a/src/main/options/normalize.js b/src/main/options/normalize.js index 5f58743cd..b0dc92cc1 100644 --- a/src/main/options/normalize.js +++ b/src/main/options/normalize.js @@ -1,7 +1,7 @@ const defaults = require("./defaults.json"); function uniq(pArray) { - return Array.from(new Set(pArray)); + return [...new Set(pArray)]; } function normalizeFilterOption(pFilterOption) { diff --git a/src/main/options/validate.js b/src/main/options/validate.js index 3b8fefcb5..9f5d3223f 100644 --- a/src/main/options/validate.js +++ b/src/main/options/validate.js @@ -12,7 +12,7 @@ function validateSystems(pModuleSystems) { Boolean(pModuleSystem.match(MODULE_SYSTEM_LIST_RE)) ) ) { - throw Error( + throw new Error( `Invalid module system list: '${pModuleSystems.join(", ")}'\n` ); } @@ -21,7 +21,7 @@ function validateSystems(pModuleSystems) { function validateRegExpSafety(pPattern) { if (Boolean(pPattern) && !safeRegex(pPattern)) { - throw Error( + throw new Error( `The pattern '${pPattern}' will probably run very slowly - cowardly refusing to run.\n` ); } @@ -32,13 +32,13 @@ function validateOutputType(pOutputType) { Boolean(pOutputType) && !report.getAvailableReporters().includes(pOutputType) ) { - throw Error(`'${pOutputType}' is not a valid output type.\n`); + throw new Error(`'${pOutputType}' is not a valid output type.\n`); } } function validateMaxDepth(pDepth) { if (Boolean(pDepth) && !pDepth.toString().match(VALID_DEPTH_RE)) { - throw Error( + throw new Error( `'${pDepth}' is not a valid depth - use an integer between 0 and 99` ); } diff --git a/src/main/resolveOptions/normalize.js b/src/main/resolve-options/normalize.js similarity index 100% rename from src/main/resolveOptions/normalize.js rename to src/main/resolve-options/normalize.js diff --git a/src/main/ruleSet/normalize.js b/src/main/rule-set/normalize.js similarity index 100% rename from src/main/ruleSet/normalize.js rename to src/main/rule-set/normalize.js diff --git a/src/main/ruleSet/validate.js b/src/main/rule-set/validate.js similarity index 100% rename from src/main/ruleSet/validate.js rename to src/main/rule-set/validate.js diff --git a/src/report/anon/anonymizePathElement.js b/src/report/anon/anonymize-path-element.js similarity index 97% rename from src/report/anon/anonymizePathElement.js rename to src/report/anon/anonymize-path-element.js index 7fdc29559..94598ddde 100644 --- a/src/report/anon/anonymizePathElement.js +++ b/src/report/anon/anonymize-path-element.js @@ -1,5 +1,5 @@ const _memoize = require("lodash/memoize"); -const randomString = require("./randomString"); +const randomString = require("./random-string"); function replace(pElement, pIndex, pWordList) { return pIndex === 0 ? pWordList.shift() || randomString(pElement) : pElement; diff --git a/src/report/anon/anonymizePath.js b/src/report/anon/anonymize-path.js similarity index 95% rename from src/report/anon/anonymizePath.js rename to src/report/anon/anonymize-path.js index 5f652ab47..c4c886910 100644 --- a/src/report/anon/anonymizePath.js +++ b/src/report/anon/anonymize-path.js @@ -1,4 +1,4 @@ -const anonymizePathElement = require("./anonymizePathElement"); +const anonymizePathElement = require("./anonymize-path-element"); const WHITELIST_RE = /^(|[.]+|~|bin|app|cli|src|configs?|components?|fixtures?|helpers?|i18n|index\.(jsx?|tsx?|vue|coffee|ls)|lib|_?_?mocks?_?_?|node_modules|packages?|package\.json|scripts?|services?|sources?|specs?|_?_?tests?_?_?|types?|uti?ls?)$/; diff --git a/src/report/anon/index.js b/src/report/anon/index.js index 69b8e2ba7..5d2227ac9 100644 --- a/src/report/anon/index.js +++ b/src/report/anon/index.js @@ -1,6 +1,6 @@ const _clone = require("lodash/clone"); const _get = require("lodash/get"); -const anonymizePath = require("./anonymizePath"); +const anonymizePath = require("./anonymize-path"); function anonymizeCycles(pPathArray, pWordList) { return (pPathArray || []).map(pPath => anonymizePath(pPath, pWordList)); diff --git a/src/report/anon/randomString.js b/src/report/anon/random-string.js similarity index 100% rename from src/report/anon/randomString.js rename to src/report/anon/random-string.js diff --git a/src/report/csv/index.js b/src/report/csv/index.js index 1cd23101a..c56fced1a 100644 --- a/src/report/csv/index.js +++ b/src/report/csv/index.js @@ -1,5 +1,5 @@ const Handlebars = require("handlebars/runtime"); -const dependencyToIncidenceTransformer = require("../utl/dependencyToIncidenceTransformer"); +const dependencyToIncidenceTransformer = require("../utl/dependency-to-incidence-transformer"); // eslint-disable-next-line import/no-unassigned-import require("./csv.template"); diff --git a/src/report/dot/defaultTheme.json b/src/report/dot/default-theme.json similarity index 100% rename from src/report/dot/defaultTheme.json rename to src/report/dot/default-theme.json diff --git a/src/report/dot/index.js b/src/report/dot/index.js index bb835219a..e30dfda3b 100644 --- a/src/report/dot/index.js +++ b/src/report/dot/index.js @@ -2,8 +2,8 @@ const Handlebars = require("handlebars/runtime"); const _get = require("lodash/get"); const theming = require("./theming"); const moduleUtl = require("./module-utl"); -const prepareFolderLevel = require("./prepareFolderLevel"); -const prepareCustomLevel = require("./prepareCustomLevel"); +const prepareFolderLevel = require("./prepare-folder-level"); +const prepareCustomLevel = require("./prepare-custom-level"); // eslint-disable-next-line import/no-unassigned-import require("./dot.template"); diff --git a/src/report/dot/prepareCustomLevel.js b/src/report/dot/prepare-custom-level.js similarity index 90% rename from src/report/dot/prepareCustomLevel.js rename to src/report/dot/prepare-custom-level.js index 5c0657e21..6065a5ac4 100644 --- a/src/report/dot/prepareCustomLevel.js +++ b/src/report/dot/prepare-custom-level.js @@ -1,5 +1,5 @@ const _get = require("lodash/get"); -const consolidateToPattern = require("../utl/consolidateToPattern"); +const consolidateToPattern = require("../utl/consolidate-to-pattern"); const moduleUtl = require("./module-utl"); module.exports = ( diff --git a/src/report/dot/prepareFolderLevel.js b/src/report/dot/prepare-folder-level.js similarity index 86% rename from src/report/dot/prepareFolderLevel.js rename to src/report/dot/prepare-folder-level.js index 05d38fd63..af4bead59 100644 --- a/src/report/dot/prepareFolderLevel.js +++ b/src/report/dot/prepare-folder-level.js @@ -1,5 +1,5 @@ const _get = require("lodash/get"); -const consolidateToFolder = require("../utl/consolidateToFolder"); +const consolidateToFolder = require("../utl/consolidate-to-folder"); const moduleUtl = require("./module-utl"); module.exports = (pResults, pTheme) => { diff --git a/src/report/dot/theming.js b/src/report/dot/theming.js index 428a5df68..30285b2c6 100644 --- a/src/report/dot/theming.js +++ b/src/report/dot/theming.js @@ -1,5 +1,5 @@ const _get = require("lodash/get"); -const DEFAULT_THEME = require("./defaultTheme.json"); +const DEFAULT_THEME = require("./default-theme.json"); function matchesRE(pValue, pRE) { const lMatchResult = pValue.match && pValue.match(pRE); diff --git a/src/report/err.js b/src/report/err.js index 3a8b79b85..289e327de 100644 --- a/src/report/err.js +++ b/src/report/err.js @@ -3,7 +3,7 @@ const figures = require("figures"); const indentString = require("indent-string"); const wrapAnsi = require("wrap-ansi"); const _get = require("lodash/get"); -const findRuleByName = require("../utl/findRuleByName"); +const findRuleByName = require("../utl/find-rule-by-name"); const SEVERITY2CHALK = { error: chalk.red, diff --git a/src/report/html/index.js b/src/report/html/index.js index 8deced186..d7375171a 100644 --- a/src/report/html/index.js +++ b/src/report/html/index.js @@ -1,5 +1,5 @@ const Handlebars = require("handlebars/runtime"); -const dependencyToIncidenceTransformer = require("../utl/dependencyToIncidenceTransformer"); +const dependencyToIncidenceTransformer = require("../utl/dependency-to-incidence-transformer"); // eslint-disable-next-line import/no-unassigned-import require("./html.template"); diff --git a/src/report/utl/compareRules.js b/src/report/utl/compare-rules.js similarity index 100% rename from src/report/utl/compareRules.js rename to src/report/utl/compare-rules.js diff --git a/src/report/utl/consolidateModuleDependencies.js b/src/report/utl/consolidate-module-dependencies.js similarity index 96% rename from src/report/utl/consolidateModuleDependencies.js rename to src/report/utl/consolidate-module-dependencies.js index 16f04a756..e95a4f3f6 100644 --- a/src/report/utl/consolidateModuleDependencies.js +++ b/src/report/utl/consolidate-module-dependencies.js @@ -2,7 +2,7 @@ const _clone = require("lodash/clone"); const _get = require("lodash/get"); const _reject = require("lodash/reject"); const _uniqBy = require("lodash/uniqBy"); -const compareRules = require("./compareRules"); +const compareRules = require("./compare-rules"); function mergeDependency(pLeftDependency, pRightDependency) { return { diff --git a/src/report/utl/consolidateModules.js b/src/report/utl/consolidate-modules.js similarity index 96% rename from src/report/utl/consolidateModules.js rename to src/report/utl/consolidate-modules.js index 74fedb3cb..bb6f8b848 100644 --- a/src/report/utl/consolidateModules.js +++ b/src/report/utl/consolidate-modules.js @@ -2,7 +2,7 @@ const _clone = require("lodash/clone"); const _get = require("lodash/get"); const _reject = require("lodash/reject"); const _uniqBy = require("lodash/uniqBy"); -const compareRules = require("./compareRules"); +const compareRules = require("./compare-rules"); function mergeModule(pLeftModule, pRightModule) { return { diff --git a/src/report/utl/consolidateToFolder.js b/src/report/utl/consolidate-to-folder.js similarity index 77% rename from src/report/utl/consolidateToFolder.js rename to src/report/utl/consolidate-to-folder.js index 0e50ed7eb..1338244ab 100644 --- a/src/report/utl/consolidateToFolder.js +++ b/src/report/utl/consolidate-to-folder.js @@ -1,6 +1,6 @@ const path = require("path"); -const consolidateModules = require("./consolidateModules"); -const consolidateModuleDependencies = require("./consolidateModuleDependencies"); +const consolidateModules = require("./consolidate-modules"); +const consolidateModuleDependencies = require("./consolidate-module-dependencies"); function squashDependencyToDir(pDependency) { return { diff --git a/src/report/utl/consolidateToPattern.js b/src/report/utl/consolidate-to-pattern.js similarity index 86% rename from src/report/utl/consolidateToPattern.js rename to src/report/utl/consolidate-to-pattern.js index dd8f9c1fe..84fe70480 100644 --- a/src/report/utl/consolidateToPattern.js +++ b/src/report/utl/consolidate-to-pattern.js @@ -1,5 +1,5 @@ -const consolidateModules = require("./consolidateModules"); -const consolidateModuleDependencies = require("./consolidateModuleDependencies"); +const consolidateModules = require("./consolidate-modules"); +const consolidateModuleDependencies = require("./consolidate-module-dependencies"); function squashDependencyToPattern(pCollapsePattern) { return pDependency => { diff --git a/src/report/utl/dependencyToIncidenceTransformer.js b/src/report/utl/dependency-to-incidence-transformer.js similarity index 100% rename from src/report/utl/dependencyToIncidenceTransformer.js rename to src/report/utl/dependency-to-incidence-transformer.js diff --git a/src/schema/README.md b/src/schema/README.md index 210639151..64a74b75d 100644 --- a/src/schema/README.md +++ b/src/schema/README.md @@ -1,5 +1,5 @@ - The JSON schemas here are generated with `utl/generate-schemas.utl.js`. - If you need to modify the schemas: - - do so in `utl/schema/` + - do so in [`utl/schema/`](../../utl/schema) - re-run the schema generation script (either with `make clean dev-build` or by manually running `node utl/generate-schemas.utl.js`) diff --git a/src/utl/arrayUtil.js b/src/utl/array-util.js similarity index 100% rename from src/utl/arrayUtil.js rename to src/utl/array-util.js diff --git a/src/utl/findRuleByName.js b/src/utl/find-rule-by-name.js similarity index 100% rename from src/utl/findRuleByName.js rename to src/utl/find-rule-by-name.js diff --git a/src/validate/index.js b/src/validate/index.js index d341eaf5d..5665d9d2a 100644 --- a/src/validate/index.js +++ b/src/validate/index.js @@ -1,5 +1,5 @@ -const matchModuleRule = require("./matchModuleRule"); -const matchDependencyRule = require("./matchDependencyRule"); +const matchModuleRule = require("./match-module-rule"); +const matchDependencyRule = require("./match-dependency-rule"); function compareSeverity(pFirst, pSecond) { const SEVERITY2INT = { diff --git a/src/validate/isModuleOnlyRule.js b/src/validate/is-module-only-rule.js similarity index 100% rename from src/validate/isModuleOnlyRule.js rename to src/validate/is-module-only-rule.js diff --git a/src/validate/matchDependencyRule.js b/src/validate/match-dependency-rule.js similarity index 97% rename from src/validate/matchDependencyRule.js rename to src/validate/match-dependency-rule.js index 9aa0bdc83..013b21690 100644 --- a/src/validate/matchDependencyRule.js +++ b/src/validate/match-dependency-rule.js @@ -1,4 +1,4 @@ -const isModuleOnlyRule = require("./isModuleOnlyRule"); +const isModuleOnlyRule = require("./is-module-only-rule"); const matches = require("./matches"); function propertyEquals(pTo, pRule, pProperty) { diff --git a/src/validate/matchModuleRule.js b/src/validate/match-module-rule.js similarity index 95% rename from src/validate/matchModuleRule.js rename to src/validate/match-module-rule.js index ec27b9d06..34394e35c 100644 --- a/src/validate/matchModuleRule.js +++ b/src/validate/match-module-rule.js @@ -1,4 +1,4 @@ -const isModuleOnlyRule = require("./isModuleOnlyRule"); +const isModuleOnlyRule = require("./is-module-only-rule"); const matches = require("./matches"); function matchesOrphanRule(pRule, pModule) { diff --git a/src/validate/matches.js b/src/validate/matches.js index 1657491f5..9c1af73b0 100644 --- a/src/validate/matches.js +++ b/src/validate/matches.js @@ -1,4 +1,4 @@ -const intersects = require("../utl/arrayUtil").intersects; +const intersects = require("../utl/array-util").intersects; function fromPath(pRule, pModule) { return !pRule.from.path || pModule.source.match(pRule.from.path); diff --git a/test/cli/compileConfig/index.spec.js b/test/cli/compile-config/index.spec.js similarity index 96% rename from test/cli/compileConfig/index.spec.js rename to test/cli/compile-config/index.spec.js index 6dadc419b..9949611e2 100644 --- a/test/cli/compileConfig/index.spec.js +++ b/test/cli/compile-config/index.spec.js @@ -1,6 +1,6 @@ const path = require("path"); const expect = require("chai").expect; -const compileConfig = require("../../../src/cli/compileConfig"); +const compileConfig = require("../../../src/cli/compile-config"); const fixture = require("./mocks/rules.sub-not-allowed-error.json"); const mergedFixture = require("./mocks/extends/merged.json"); const mergedArrayOneFixture = require("./mocks/extends/merged-array-1.json"); @@ -8,7 +8,7 @@ const mergedArrayTwoFixture = require("./mocks/extends/merged-array-2.json"); const mockDir = path.join(__dirname, "mocks"); -describe("cli/compileConfig", () => { +describe("cli/compile-config", () => { it("a rule set without an extends returns just that rule set", () => { expect( compileConfig(path.join(mockDir, "rules.sub-not-allowed-error.json")) diff --git a/test/cli/compileConfig/mergeRuleSets.spec.js b/test/cli/compile-config/merge-rule-sets.spec.js similarity index 99% rename from test/cli/compileConfig/mergeRuleSets.spec.js rename to test/cli/compile-config/merge-rule-sets.spec.js index 015cf75db..d9444da6e 100644 --- a/test/cli/compileConfig/mergeRuleSets.spec.js +++ b/test/cli/compile-config/merge-rule-sets.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const merge = require("../../../src/cli/compileConfig/mergeConfigs"); +const merge = require("../../../src/cli/compile-config/merge-configs"); describe("cli/mergeRuleSets - general", () => { it("two empty rule sets yield an empty rule set with named attributes", () => { diff --git a/test/cli/compileConfig/mocks/extends/base-for-base.js b/test/cli/compile-config/mocks/extends/base-for-base.js similarity index 100% rename from test/cli/compileConfig/mocks/extends/base-for-base.js rename to test/cli/compile-config/mocks/extends/base-for-base.js diff --git a/test/cli/compileConfig/mocks/extends/base-for-extends.js b/test/cli/compile-config/mocks/extends/base-for-extends.js similarity index 100% rename from test/cli/compileConfig/mocks/extends/base-for-extends.js rename to test/cli/compile-config/mocks/extends/base-for-extends.js diff --git a/test/cli/compileConfig/mocks/extends/circular-one.js b/test/cli/compile-config/mocks/extends/circular-one.js similarity index 100% rename from test/cli/compileConfig/mocks/extends/circular-one.js rename to test/cli/compile-config/mocks/extends/circular-one.js diff --git a/test/cli/compileConfig/mocks/extends/circular-two.js b/test/cli/compile-config/mocks/extends/circular-two.js similarity index 100% rename from test/cli/compileConfig/mocks/extends/circular-two.js rename to test/cli/compile-config/mocks/extends/circular-two.js diff --git a/test/cli/compileConfig/mocks/extends/extending-array-with-one-member.json b/test/cli/compile-config/mocks/extends/extending-array-with-one-member.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/extending-array-with-one-member.json rename to test/cli/compile-config/mocks/extends/extending-array-with-one-member.json diff --git a/test/cli/compileConfig/mocks/extends/extending-array-with-two-members.json b/test/cli/compile-config/mocks/extends/extending-array-with-two-members.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/extending-array-with-two-members.json rename to test/cli/compile-config/mocks/extends/extending-array-with-two-members.json diff --git a/test/cli/compileConfig/mocks/extends/extending-array-with-zero-members.json b/test/cli/compile-config/mocks/extends/extending-array-with-zero-members.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/extending-array-with-zero-members.json rename to test/cli/compile-config/mocks/extends/extending-array-with-zero-members.json diff --git a/test/cli/compileConfig/mocks/extends/extending-from-node-modules.json b/test/cli/compile-config/mocks/extends/extending-from-node-modules.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/extending-from-node-modules.json rename to test/cli/compile-config/mocks/extends/extending-from-node-modules.json diff --git a/test/cli/compileConfig/mocks/extends/extending.json b/test/cli/compile-config/mocks/extends/extending.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/extending.json rename to test/cli/compile-config/mocks/extends/extending.json diff --git a/test/cli/compileConfig/mocks/extends/merged-array-1.json b/test/cli/compile-config/mocks/extends/merged-array-1.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/merged-array-1.json rename to test/cli/compile-config/mocks/extends/merged-array-1.json diff --git a/test/cli/compileConfig/mocks/extends/merged-array-2.json b/test/cli/compile-config/mocks/extends/merged-array-2.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/merged-array-2.json rename to test/cli/compile-config/mocks/extends/merged-array-2.json diff --git a/test/cli/compileConfig/mocks/extends/merged.json b/test/cli/compile-config/mocks/extends/merged.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/merged.json rename to test/cli/compile-config/mocks/extends/merged.json diff --git a/test/cli/compileConfig/mocks/extends/node_modules/base-from-node-modules/index.js b/test/cli/compile-config/mocks/extends/node_modules/base-from-node-modules/index.js similarity index 100% rename from test/cli/compileConfig/mocks/extends/node_modules/base-from-node-modules/index.js rename to test/cli/compile-config/mocks/extends/node_modules/base-from-node-modules/index.js diff --git a/test/cli/compileConfig/mocks/extends/node_modules/base-from-node-modules/package.json b/test/cli/compile-config/mocks/extends/node_modules/base-from-node-modules/package.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/node_modules/base-from-node-modules/package.json rename to test/cli/compile-config/mocks/extends/node_modules/base-from-node-modules/package.json diff --git a/test/cli/compileConfig/mocks/extends/second-base-for-extends.json b/test/cli/compile-config/mocks/extends/second-base-for-extends.json similarity index 100% rename from test/cli/compileConfig/mocks/extends/second-base-for-extends.json rename to test/cli/compile-config/mocks/extends/second-base-for-extends.json diff --git a/test/cli/compileConfig/mocks/rules.sub-not-allowed-error.json b/test/cli/compile-config/mocks/rules.sub-not-allowed-error.json similarity index 100% rename from test/cli/compileConfig/mocks/rules.sub-not-allowed-error.json rename to test/cli/compile-config/mocks/rules.sub-not-allowed-error.json diff --git a/test/cli/deleteDammit.utl.js b/test/cli/delete-dammit.utl.js similarity index 87% rename from test/cli/deleteDammit.utl.js rename to test/cli/delete-dammit.utl.js index 030259ae9..596c8501f 100644 --- a/test/cli/deleteDammit.utl.js +++ b/test/cli/delete-dammit.utl.js @@ -3,7 +3,7 @@ const fs = require("fs"); module.exports = pFileName => { try { fs.unlinkSync(pFileName); - } catch (e) { + } catch (pError) { // process.stderr.write(e.message || e); } }; diff --git a/test/cli/formatMetaInfo.spec.js b/test/cli/format-meta-info.spec.js similarity index 83% rename from test/cli/formatMetaInfo.spec.js rename to test/cli/format-meta-info.spec.js index daf4584b2..5fa92aa70 100644 --- a/test/cli/formatMetaInfo.spec.js +++ b/test/cli/format-meta-info.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const meta = require("../../src/cli/formatMetaInfo"); +const meta = require("../../src/cli/format-meta-info"); describe("cli/formatMetaInfo - transpiler formatted meta information", () => { it("tells which extensions can be scanned", () => { diff --git a/test/cli/format.spec.js b/test/cli/format.spec.js index 9cc983e0c..0d7b9950a 100644 --- a/test/cli/format.spec.js +++ b/test/cli/format.spec.js @@ -2,7 +2,7 @@ const fs = require("fs"); const path = require("path"); const expect = require("chai").expect; const format = require("../../src/cli/format"); -const deleteDammit = require("./deleteDammit.utl"); +const deleteDammit = require("./delete-dammit.utl"); describe("cli/format", () => { it("formats a cruise result and writes it to file", async () => { diff --git a/test/cli/getResolveConfig.spec.js b/test/cli/get-resolve-config.spec.js similarity index 97% rename from test/cli/getResolveConfig.spec.js rename to test/cli/get-resolve-config.spec.js index 3fc1a94d7..f95aaf84c 100644 --- a/test/cli/getResolveConfig.spec.js +++ b/test/cli/get-resolve-config.spec.js @@ -1,6 +1,6 @@ const path = require("path"); const expect = require("chai").expect; -const getResolveConfig = require("../../src/cli/getResolveConfig"); +const getResolveConfig = require("../../src/cli/get-resolve-config"); describe("cli/getResolveConfig", () => { it("throws whenno config file name is passed", () => { diff --git a/test/cli/index.spec.js b/test/cli/index.spec.js index 1f7263d50..c435637e0 100644 --- a/test/cli/index.spec.js +++ b/test/cli/index.spec.js @@ -6,7 +6,7 @@ const expect = require("chai").expect; const intercept = require("intercept-stdout"); const cli = require("../../src/cli"); const asserthelpers = require("./asserthelpers.utl"); -const deleteDammit = require("./deleteDammit.utl"); +const deleteDammit = require("./delete-dammit.utl"); const OUT_DIR = "./test/cli/output"; const FIX_DIR = "./test/cli/fixtures"; @@ -114,7 +114,7 @@ function resetOutputDir() { try { fs.unlinkSync(pPair.options.outputTo.replace("{{moduleType}}", "cjs")); fs.unlinkSync(pPair.options.outputTo.replace("{{moduleType}}", "amd")); - } catch (e) { + } catch (pError) { // process.stderr.write(typeof e); } }); diff --git a/test/cli/initConfig/createConfig.spec.js b/test/cli/init-config/create-config.spec.js similarity index 95% rename from test/cli/initConfig/createConfig.spec.js rename to test/cli/init-config/create-config.spec.js index 3bed48186..a9145326f 100644 --- a/test/cli/initConfig/createConfig.spec.js +++ b/test/cli/init-config/create-config.spec.js @@ -1,16 +1,16 @@ const fs = require("fs"); const path = require("path"); const chai = require("chai"); -const createConfigFile = require("../../../src/cli/initConfig/createConfigFile"); +const createConfigFile = require("../../../src/cli/init-config/create-config-file"); const configurationSchema = require("../../../src/schema/configuration.schema.json"); -const deleteDammit = require("../deleteDammit.utl"); +const deleteDammit = require("../delete-dammit.utl"); const expect = chai.expect; const RULES_FILE_JS = ".dependency-cruiser.js"; chai.use(require("chai-json-schema")); -describe("cli/initConfig/createConfig", () => { +describe("cli/init-config/createConfig", () => { const WORKINGDIR = process.cwd(); afterEach("tear down", () => { @@ -192,9 +192,9 @@ describe("cli/initConfig/createConfig", () => { }); try { createConfigFile(); - } catch (e) { + } catch (pError) { lStillHere = false; - expect(e.message).to.contain("already exists here - leaving it be"); + expect(pError.message).to.contain("already exists here - leaving it be"); } expect(lStillHere).to.equal(false); diff --git a/test/cli/initConfig/helpers.spec.js b/test/cli/init-config/helpers.spec.js similarity index 92% rename from test/cli/initConfig/helpers.spec.js rename to test/cli/init-config/helpers.spec.js index 7800d81b4..e8072b1e7 100644 --- a/test/cli/initConfig/helpers.spec.js +++ b/test/cli/init-config/helpers.spec.js @@ -1,7 +1,7 @@ const expect = require("chai").expect; -const { pnpIsEnabled } = require("../../../src/cli/initConfig/helpers"); +const { pnpIsEnabled } = require("../../../src/cli/init-config/helpers"); -describe("cli/initConfig/helpers - pnpIsEnabled", () => { +describe("cli/init-config/helpers - pnpIsEnabled", () => { const WORKINGDIR = process.cwd(); afterEach("tear down", () => { diff --git a/test/cli/initConfig/index.spec.js b/test/cli/init-config/index.spec.js similarity index 96% rename from test/cli/initConfig/index.spec.js rename to test/cli/init-config/index.spec.js index 9c0954125..c831405eb 100644 --- a/test/cli/initConfig/index.spec.js +++ b/test/cli/init-config/index.spec.js @@ -1,14 +1,14 @@ const path = require("path"); const chai = require("chai"); -const initConfig = require("../../../src/cli/initConfig"); +const initConfig = require("../../../src/cli/init-config"); const configurationSchema = require("../../../src/schema/configuration.schema.json"); -const deleteDammit = require("../deleteDammit.utl"); +const deleteDammit = require("../delete-dammit.utl"); const expect = chai.expect; const RULES_FILE_JS = ".dependency-cruiser.js"; -describe("cli/initConfig/index", () => { +describe("cli/init-config/index", () => { const WORKINGDIR = process.cwd(); afterEach("tear down", () => { diff --git a/test/cli/normalizeOptions.spec.js b/test/cli/normalize-options.spec.js similarity index 96% rename from test/cli/normalizeOptions.spec.js rename to test/cli/normalize-options.spec.js index 634328af5..cc5fa116c 100644 --- a/test/cli/normalizeOptions.spec.js +++ b/test/cli/normalize-options.spec.js @@ -1,6 +1,6 @@ const path = require("path"); const expect = require("chai").expect; -const normalizeOptions = require("../../src/cli/normalizeOptions"); +const normalizeOptions = require("../../src/cli/normalize-options"); describe("cli/normalizeOptions", () => { const WORKINGDIR = process.cwd(); @@ -64,8 +64,8 @@ describe("cli/normalizeOptions", () => { process.chdir("test/cli/fixtures/normalize-config/no-default-config"); try { normalizeOptions({ validate: true }); - } catch (e) { - expect(e.message).to.include(".dependency-cruiser.json'"); + } catch (pError) { + expect(pError.message).to.include(".dependency-cruiser.json'"); } }); @@ -105,8 +105,8 @@ describe("cli/normalizeOptions", () => { it("-v with parameter borks when that parameter doesn't exist as a rules file", () => { try { normalizeOptions({ validate: "./non-existing-config-file-name" }); - } catch (e) { - expect(e.message).to.include("./non-existing-config-file-name"); + } catch (pError) { + expect(pError.message).to.include("./non-existing-config-file-name"); } }); diff --git a/test/cli/parseTSConfig.spec.js b/test/cli/parse-ts-config.spec.js similarity index 97% rename from test/cli/parseTSConfig.spec.js rename to test/cli/parse-ts-config.spec.js index 1e07f35bd..415327976 100644 --- a/test/cli/parseTSConfig.spec.js +++ b/test/cli/parse-ts-config.spec.js @@ -1,7 +1,7 @@ const path = require("path").posix; const expect = require("chai").expect; -const parseTSConfig = require("../../src/cli/parseTSConfig"); -const pathToPosix = require("../../src/extract/utl/pathToPosix"); +const parseTSConfig = require("../../src/cli/parse-ts-config"); +const pathToPosix = require("../../src/extract/utl/path-to-posix"); const DIRNAME = pathToPosix(__dirname); diff --git a/test/cli/utl/io.spec.js b/test/cli/utl/io.spec.js index fc8e5d6d1..4c1f22e6a 100644 --- a/test/cli/utl/io.spec.js +++ b/test/cli/utl/io.spec.js @@ -11,34 +11,26 @@ describe("cli/utl/io", () => { "output", `tmp_hello_${Math.random() .toString() - .substr("0.".length)}.json` + .slice("0.".length)}.json` ); function removeDammit(pFileName) { try { - process.stdout.write(`|>|>|>|> unlinkin ${pFileName} starting\n`); fs.unlinkSync(pFileName); - process.stdout.write(`|>|>|>|> unlinkin ${pFileName} done\n`); - } catch (e) { + } catch (pError) { // probably files didn't exist in the first place // so ignore the exception - process.stdout.write(`|>|>|>|> could not unlink ${pFileName} - ${e}\n`); } finally { // explicitly ignore finally as well - process.stdout.write(`|>|>|>|> finally!\n`); } } before("set up", () => { - process.stdout.write(`|>|>|> set up - started\n`); fs.writeFileSync(OUTFILE, "{}", "utf8"); - process.stdout.write(`|>|>|> set up - written\n`); }); after("tear down", () => { - process.stdout.write(`|>|>|> tear down - start\n`); removeDammit(OUTFILE); - process.stdout.write(`|>|>|> tear down - done dee dee done\n`); }); it("getInStream(OUTFILE) yields a readable stream", () => { diff --git a/test/cli/utl/makeAbsolute.spec.js b/test/cli/utl/make-absolute.spec.js similarity index 86% rename from test/cli/utl/makeAbsolute.spec.js rename to test/cli/utl/make-absolute.spec.js index 00c0b3011..77b0d7aaf 100644 --- a/test/cli/utl/makeAbsolute.spec.js +++ b/test/cli/utl/make-absolute.spec.js @@ -1,6 +1,6 @@ const path = require("path"); const expect = require("chai").expect; -const makeAbsolute = require("../../../src/cli/utl/makeAbsolute"); +const makeAbsolute = require("../../../src/cli/utl/make-absolute"); describe("cli/utl/makeAbsolute", () => { it("leaves absolute path names alone", () => { diff --git a/test/cli/utl/validateFileExistence.spec.js b/test/cli/utl/validate-file-existence.spec.js similarity index 96% rename from test/cli/utl/validateFileExistence.spec.js rename to test/cli/utl/validate-file-existence.spec.js index cbdb5df71..6fee2ab02 100644 --- a/test/cli/utl/validateFileExistence.spec.js +++ b/test/cli/utl/validate-file-existence.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const validateFileExistence = require("../../../src/cli/utl/validateFileExistence"); +const validateFileExistence = require("../../../src/cli/utl/validate-file-existence"); describe("cli/utl/validateFileExistence", () => { it("throws when the file or dir passed does not exists", () => { diff --git a/test/cli/validateNodeEnv.spec.js b/test/cli/validate-node-env.spec.js similarity index 95% rename from test/cli/validateNodeEnv.spec.js rename to test/cli/validate-node-env.spec.js index 5673730e7..a5c8c2b8a 100644 --- a/test/cli/validateNodeEnv.spec.js +++ b/test/cli/validate-node-env.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const validateNodeEnv = require("../../src/cli/validateNodeEnv"); +const validateNodeEnv = require("../../src/cli/validate-node-env"); describe("cli/validateNodeEnv", () => { it("throws when an older and unsupported node version is passed", () => { diff --git a/test/extract/ast-extractors/allShapesOfImportExport.md b/test/extract/ast-extractors/all-shapes-of-import-export.md similarity index 100% rename from test/extract/ast-extractors/allShapesOfImportExport.md rename to test/extract/ast-extractors/all-shapes-of-import-export.md diff --git a/test/extract/ast-extractors/extract-amd-deps.spec.js b/test/extract/ast-extractors/extract-amd-deps.spec.js index ecc2dc66b..7ca25e23a 100644 --- a/test/extract/ast-extractors/extract-amd-deps.spec.js +++ b/test/extract/ast-extractors/extract-amd-deps.spec.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; -const extractAMDDeps = require("../../../src/extract/ast-extractors/extract-AMD-deps"); -const getASTFromSource = require("../../../src/extract/parse/toJavascriptAST") +const extractAMDDeps = require("../../../src/extract/ast-extractors/extract-amd-deps"); +const getASTFromSource = require("../../../src/extract/parse/to-javascript-ast") .getASTFromSource; const extractAMD = ( diff --git a/test/extract/ast-extractors/extract-commonjs-deps.spec.js b/test/extract/ast-extractors/extract-cjs-deps.spec.js similarity index 94% rename from test/extract/ast-extractors/extract-commonjs-deps.spec.js rename to test/extract/ast-extractors/extract-cjs-deps.spec.js index badce2c6a..cfad1fc4c 100644 --- a/test/extract/ast-extractors/extract-commonjs-deps.spec.js +++ b/test/extract/ast-extractors/extract-cjs-deps.spec.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; -const extractcommonJSDeps = require("../../../src/extract/ast-extractors/extract-commonJS-deps"); -const getASTFromSource = require("../../../src/extract/parse/toJavascriptAST") +const extractcommonJSDeps = require("../../../src/extract/ast-extractors/extract-cjs-deps"); +const getASTFromSource = require("../../../src/extract/parse/to-javascript-ast") .getASTFromSource; const extractcommonJS = ( @@ -15,7 +15,7 @@ const extractcommonJS = ( pExoticRequireStrings ); -describe("ast-extractors/extract-commonJS-deps", () => { +describe("ast-extractors/extract-cjs-deps", () => { it("require with in an assignment", () => { let lDeps = []; diff --git a/test/extract/ast-extractors/extract-ES6-deps.spec.js b/test/extract/ast-extractors/extract-es6-deps.spec.js similarity index 95% rename from test/extract/ast-extractors/extract-ES6-deps.spec.js rename to test/extract/ast-extractors/extract-es6-deps.spec.js index 469ef0985..16d93254f 100644 --- a/test/extract/ast-extractors/extract-ES6-deps.spec.js +++ b/test/extract/ast-extractors/extract-es6-deps.spec.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; -const extractES6Deps = require("../../../src/extract/ast-extractors/extract-ES6-deps"); -const getASTFromSource = require("../../../src/extract/parse/toJavascriptAST") +const extractES6Deps = require("../../../src/extract/ast-extractors/extract-es6-deps"); +const getASTFromSource = require("../../../src/extract/parse/to-javascript-ast") .getASTFromSource; const extractES6 = (pJavaScriptSource, pDependencies) => diff --git a/test/extract/ast-extractors/extract-typescript.utl.js b/test/extract/ast-extractors/extract-typescript.utl.js index e421354f8..6cb416472 100644 --- a/test/extract/ast-extractors/extract-typescript.utl.js +++ b/test/extract/ast-extractors/extract-typescript.utl.js @@ -1,5 +1,5 @@ const extractTypescript = require("../../../src/extract/ast-extractors/extract-typescript-deps"); -const getASTFromSource = require("../../../src/extract/parse/toTypescriptAST") +const getASTFromSource = require("../../../src/extract/parse/to-typescript-ast") .getASTFromSource; module.exports = (pTypesScriptSource, pExoticRequireStrings = []) => diff --git a/test/extract/derive/circular/getCycle.spec.js b/test/extract/derive/circular/get-cycle.spec.js similarity index 99% rename from test/extract/derive/circular/getCycle.spec.js rename to test/extract/derive/circular/get-cycle.spec.js index ff678cf15..810617098 100644 --- a/test/extract/derive/circular/getCycle.spec.js +++ b/test/extract/derive/circular/get-cycle.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const getCycle = require("../../../../src/extract/derive/circular/getCycle"); +const getCycle = require("../../../../src/extract/derive/circular/get-cycle"); const inputGraphs = require("./inputgraphs.json"); diff --git a/test/extract/derive/orphan/isOrphan.spec.js b/test/extract/derive/orphan/is-orphan.spec.js similarity index 98% rename from test/extract/derive/orphan/isOrphan.spec.js rename to test/extract/derive/orphan/is-orphan.spec.js index 7a5db244e..e86dcc219 100644 --- a/test/extract/derive/orphan/isOrphan.spec.js +++ b/test/extract/derive/orphan/is-orphan.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const isOrphan = require("../../../../src/extract/derive/orphan/isOrphan"); +const isOrphan = require("../../../../src/extract/derive/orphan/is-orphan"); const ONE_MODULE_FIXTURE = require("./fixtures/oneModule.json"); const TWO_MODULES_FIXTURE = require("./fixtures/twoModule.json"); diff --git a/test/extract/derive/reachable/index.spec.js b/test/extract/derive/reachable/index.spec.js index c01516772..07d48524d 100644 --- a/test/extract/derive/reachable/index.spec.js +++ b/test/extract/derive/reachable/index.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const normalize = require("../../../../src/main/ruleSet/normalize"); +const normalize = require("../../../../src/main/rule-set/normalize"); const addReachability = require("../../../../src/extract/derive/reachable/index"); const gGraph = [ diff --git a/test/extract/derive/reachable/isReachable.spec.js b/test/extract/derive/reachable/is-reachable.spec.js similarity index 99% rename from test/extract/derive/reachable/isReachable.spec.js rename to test/extract/derive/reachable/is-reachable.spec.js index a3dd0e9d3..a3f86d830 100644 --- a/test/extract/derive/reachable/isReachable.spec.js +++ b/test/extract/derive/reachable/is-reachable.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const isReachable = require("../../../../src/extract/derive/reachable/isReachable"); +const isReachable = require("../../../../src/extract/derive/reachable/is-reachable"); describe("extract/derive/reachable/isReachable - reachability detection", () => { beforeEach(() => { diff --git a/test/extract/gatherInitialSources.spec.js b/test/extract/gather-initial-sources.spec.js similarity index 98% rename from test/extract/gatherInitialSources.spec.js rename to test/extract/gather-initial-sources.spec.js index 54142a4f5..dad959c93 100644 --- a/test/extract/gatherInitialSources.spec.js +++ b/test/extract/gather-initial-sources.spec.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; -const gather = require("../../src/extract/gatherInitialSources"); -const p2p = require("../../src/extract/utl/pathToPosix"); +const gather = require("../../src/extract/gather-initial-sources"); +const p2p = require("../../src/extract/utl/path-to-posix"); const normalize = require("../../src/main/options/normalize"); // make the import pathToPosix the correct function profile diff --git a/test/extract/extract.spec.js b/test/extract/get-dependencies.spec.js similarity index 87% rename from test/extract/extract.spec.js rename to test/extract/get-dependencies.spec.js index 2aaf40b7f..86adbc984 100644 --- a/test/extract/extract.spec.js +++ b/test/extract/get-dependencies.spec.js @@ -2,9 +2,9 @@ const path = require("path"); const fs = require("fs"); const symlinkDir = require("symlink-dir"); const expect = require("chai").expect; -const extract = require("../../src/extract/extract"); +const getDependencies = require("../../src/extract/get-dependencies"); const normalize = require("../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const cjsFixtures = require("./fixtures/cjs.json"); const es6Fixtures = require("./fixtures/es6.json"); const amdFixtures = require("./fixtures/amd.json"); @@ -32,7 +32,7 @@ function runFixture(pFixture) { it(pFixture.title, () => { expect( - extract( + getDependencies( pFixture.input.fileName, normalize(lOptions), normalizeResolveOptions({ bustTheCache: true }, normalize(lOptions)) @@ -55,14 +55,14 @@ before(cb => { after(() => { try { fs.unlinkSync(symlinkDirectory); - } catch (e) { + } catch (pError) { // just swallow the error, there's nothing we can do about it } }); -describe("extract/extract - CommonJS - ", () => +describe("extract/getDependencies - CommonJS - ", () => cjsFixtures.forEach(runFixture)); -describe("extract/extract - CommonJS - with bangs", () => { +describe("extract/getDependencies - CommonJS - with bangs", () => { it("splits bang!./blabla into bang and ./blabla", () => { const lOptions = normalize({ moduleSystems: ["cjs"] }); const lResolveOptions = normalizeResolveOptions( @@ -71,7 +71,7 @@ describe("extract/extract - CommonJS - with bangs", () => { ); expect( - extract( + getDependencies( "test/extract/fixtures/cjs-bangs/index.js", lOptions, lResolveOptions @@ -80,9 +80,11 @@ describe("extract/extract - CommonJS - with bangs", () => { }); }); -describe("extract/extract - ES6 - ", () => es6Fixtures.forEach(runFixture)); -describe("extract/extract - AMD - ", () => amdFixtures.forEach(runFixture)); -describe("extract/extract - AMD - with bangs", () => { +describe("extract/getDependencies - ES6 - ", () => + es6Fixtures.forEach(runFixture)); +describe("extract/getDependencies - AMD - ", () => + amdFixtures.forEach(runFixture)); +describe("extract/getDependencies - AMD - with bangs", () => { it("splits bang!./blabla into bang and ./blabla - regular requirejs", () => { const lOptions = normalize({ moduleSystems: ["amd"] }); const lResolveOptions = normalizeResolveOptions( @@ -91,7 +93,7 @@ describe("extract/extract - AMD - with bangs", () => { ); expect( - extract( + getDependencies( "test/extract/fixtures/amd-bangs/root_one.js", lOptions, lResolveOptions @@ -107,7 +109,7 @@ describe("extract/extract - AMD - with bangs", () => { ); expect( - extract( + getDependencies( "test/extract/fixtures/amd-bangs/simplified-commonjs-wrapper.js", lOptions, lResolveOptions @@ -116,12 +118,12 @@ describe("extract/extract - AMD - with bangs", () => { }); }); -describe("extract/extract - TypeScript - ", () => +describe("extract/getDependencies - TypeScript - ", () => tsFixtures.forEach(runFixture)); -describe("extract/extract - CoffeeScript - ", () => +describe("extract/getDependencies - CoffeeScript - ", () => coffeeFixtures.forEach(runFixture)); -describe("extract/extract - Error scenarios - ", () => { +describe("extract/getDependencies - Error scenarios - ", () => { it("Does not raise an exception on syntax errors (because we're on the loose parser)", () => { const lOptions = normalize({}); const lResolveOptions = normalizeResolveOptions( @@ -130,7 +132,7 @@ describe("extract/extract - Error scenarios - ", () => { ); expect(() => - extract( + getDependencies( "test/extract/fixtures/syntax-error.js", lOptions, lResolveOptions @@ -141,14 +143,14 @@ describe("extract/extract - Error scenarios - ", () => { }); it("Raises an exception on non-existing files", () => { expect(() => { - extract("non-existing-file.md", normalize({}), {}); + getDependencies("non-existing-file.md", normalize({}), {}); }).to.throw( "Extracting dependencies ran afoul of...\n\n ENOENT: no such file or directory, open " ); }); }); -describe("extract/extract - even when require gets non-string arguments, extract doesn't break", () => { +describe("extract/getDependencies - even when require gets non-string arguments, extract doesn't break", () => { const lOptions = normalize({}); const lResolveOptions = normalizeResolveOptions( { bustTheCache: true }, @@ -157,7 +159,7 @@ describe("extract/extract - even when require gets non-string arguments, extract it("Just skips require(481)", () => { expect( - extract( + getDependencies( "./test/extract/fixtures/cjs-require-non-strings/require-a-number.js", lOptions, lResolveOptions @@ -167,7 +169,7 @@ describe("extract/extract - even when require gets non-string arguments, extract it("Just skips require(a function)", () => { expect( - extract( + getDependencies( "./test/extract/fixtures/cjs-require-non-strings/require-a-function.js", lOptions, lResolveOptions @@ -177,7 +179,7 @@ describe("extract/extract - even when require gets non-string arguments, extract it("Just skips require(an iife)", () => { expect( - extract( + getDependencies( "./test/extract/fixtures/cjs-require-non-strings/require-an-iife.js", normalize({}), {} @@ -186,7 +188,7 @@ describe("extract/extract - even when require gets non-string arguments, extract }); }); -describe("extract/extract - include", () => { +describe("extract/getDependencies - include", () => { it("returns no dependencies when the includeOnly pattern is erroneous", () => { const lOptions = normalize({ includeOnly: "will-not-match-dependencies-for-this-file" @@ -197,7 +199,7 @@ describe("extract/extract - include", () => { ); expect( - extract( + getDependencies( "./test/extract/fixtures/include/src/index.js", lOptions, lResolveOptions @@ -213,7 +215,7 @@ describe("extract/extract - include", () => { ); expect( - extract( + getDependencies( "./test/extract/fixtures/include/src/index.js", lOptions, lResolveOptions @@ -242,7 +244,7 @@ describe("extract/extract - include", () => { ); expect( - extract( + getDependencies( "./test/extract/fixtures/include/src/index.js", lOptions, lResolveOptions @@ -283,7 +285,7 @@ describe("extract/extract - include", () => { ); expect( - extract( + getDependencies( "./test/extract/fixtures/exotic-require/index.js", lOptions, lResolveOptions @@ -313,7 +315,7 @@ describe("extract/extract - include", () => { ); expect( - extract( + getDependencies( "./test/extract/fixtures/specifyTsPreCompilationDeps/index.ts", lOptions, lResolveOptions diff --git a/test/extract/index.cachebusting.spec.js b/test/extract/index.cachebusting.spec.js index 9c2f39412..69b5089b7 100644 --- a/test/extract/index.cachebusting.spec.js +++ b/test/extract/index.cachebusting.spec.js @@ -3,7 +3,7 @@ const fs = require("fs"); const chai = require("chai"); const extract = require("../../src/extract"); const normalize = require("../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const expect = chai.expect; diff --git a/test/extract/index.donotfollow.spec.js b/test/extract/index.donotfollow.spec.js index d9555d8e1..4c6213ba0 100644 --- a/test/extract/index.donotfollow.spec.js +++ b/test/extract/index.donotfollow.spec.js @@ -2,7 +2,7 @@ const chai = require("chai"); const extract = require("../../src/extract"); const cruiseResultSchema = require("../../src/schema/cruise-result.schema.json"); const normalize = require("../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const expect = chai.expect; diff --git a/test/extract/index.exclude.spec.js b/test/extract/index.exclude.spec.js index f638f7c1f..6f657a1c4 100644 --- a/test/extract/index.exclude.spec.js +++ b/test/extract/index.exclude.spec.js @@ -2,7 +2,7 @@ const chai = require("chai"); const extract = require("../../src/extract"); const cruiseResultSchema = require("../../src/schema/cruise-result.schema.json"); const normalize = require("../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const expect = chai.expect; diff --git a/test/extract/index.maxdepth.spec.js b/test/extract/index.maxdepth.spec.js index d093e8ce3..7963e0496 100644 --- a/test/extract/index.maxdepth.spec.js +++ b/test/extract/index.maxdepth.spec.js @@ -2,7 +2,7 @@ const chai = require("chai"); const extract = require("../../src/extract"); const resultSchema = require("../../src/schema/cruise-result.schema.json"); const normalize = require("../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const expect = chai.expect; diff --git a/test/extract/index.reachable.spec.js b/test/extract/index.reachable.spec.js index 9b4067eb3..fe504ad39 100644 --- a/test/extract/index.reachable.spec.js +++ b/test/extract/index.reachable.spec.js @@ -2,8 +2,8 @@ const chai = require("chai"); const extract = require("../../src/extract"); const cruiseResultSchema = require("../../src/schema/cruise-result.schema.json"); const normalize = require("../../src/main/options/normalize"); -const normalizeRuleSet = require("../../src/main/ruleSet/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeRuleSet = require("../../src/main/rule-set/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const expect = chai.expect; diff --git a/test/extract/index.spec.js b/test/extract/index.spec.js index 1a4a04767..b5b93943d 100644 --- a/test/extract/index.spec.js +++ b/test/extract/index.spec.js @@ -2,7 +2,7 @@ const chai = require("chai"); const extract = require("../../src/extract"); const cruiseResultSchema = require("../../src/schema/cruise-result.schema.json"); const normalize = require("../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../src/main/resolve-options/normalize"); const cjsRecursiveFixtures = require("./fixtures/cjs-recursive.json"); const deprecationFixtures = require("./fixtures/deprecated-node-module.json"); const bundledFixtures = require("./fixtures/bundled-dependencies.json"); diff --git a/test/extract/resolve/determineDependencyTypes.spec.js b/test/extract/resolve/determine-dependency-types.spec.js similarity index 99% rename from test/extract/resolve/determineDependencyTypes.spec.js rename to test/extract/resolve/determine-dependency-types.spec.js index 2cca364de..c5f902330 100644 --- a/test/extract/resolve/determineDependencyTypes.spec.js +++ b/test/extract/resolve/determine-dependency-types.spec.js @@ -1,6 +1,6 @@ const path = require("path"); const expect = require("chai").expect; -const determine = require("../../../src/extract/resolve/determineDependencyTypes"); +const determine = require("../../../src/extract/resolve/determine-dependency-types"); describe("extract/resolve/determineDependencyTypes - determine dependencyTypes", () => { it("sorts local dependencies into 'local'", () => { diff --git a/test/extract/resolve/index.spec.js b/test/extract/resolve/index.spec.js index d084a6d87..ca3c6f0bd 100644 --- a/test/extract/resolve/index.spec.js +++ b/test/extract/resolve/index.spec.js @@ -1,8 +1,8 @@ const path = require("path"); const expect = require("chai").expect; -const parseTSConfig = require("../../../src/cli/parseTSConfig"); +const parseTSConfig = require("../../../src/cli/parse-ts-config"); const resolve = require("../../../src/extract/resolve"); -const normalizeResolveOptions = require("../../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../../src/main/resolve-options/normalize"); const TSCONFIG = path.join( __dirname, diff --git a/test/extract/resolve/isCore.spec.js b/test/extract/resolve/is-core.spec.js similarity index 91% rename from test/extract/resolve/isCore.spec.js rename to test/extract/resolve/is-core.spec.js index d8ff06474..c4bf0e0bc 100644 --- a/test/extract/resolve/isCore.spec.js +++ b/test/extract/resolve/is-core.spec.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-expressions */ const expect = require("chai").expect; -const isCore = require("../../../src/extract/resolve/isCore"); +const isCore = require("../../../src/extract/resolve/is-core"); describe("extract/resolve/isCore", () => { it("returns false when passed nothing", () => { diff --git a/test/extract/resolve/isRelativeModuleName.spec.js b/test/extract/resolve/is-relative-module-name.spec.js similarity index 98% rename from test/extract/resolve/isRelativeModuleName.spec.js rename to test/extract/resolve/is-relative-module-name.spec.js index d01ca19bb..fe6a9af59 100644 --- a/test/extract/resolve/isRelativeModuleName.spec.js +++ b/test/extract/resolve/is-relative-module-name.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const isRelativeModuleName = require("../../../src/extract/resolve/isRelativeModuleName"); +const isRelativeModuleName = require("../../../src/extract/resolve/is-relative-module-name"); describe("extract/resolve/isRelativeModuleName", () => { it("throws an error when passed nothing", () => { diff --git a/test/extract/resolve/localNpmHelpers.spec.js b/test/extract/resolve/local-npm-helpers.spec.js similarity index 99% rename from test/extract/resolve/localNpmHelpers.spec.js rename to test/extract/resolve/local-npm-helpers.spec.js index 8ed660d07..b216da74b 100644 --- a/test/extract/resolve/localNpmHelpers.spec.js +++ b/test/extract/resolve/local-npm-helpers.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const localNpmHelpers = require("../../../src/extract/resolve/localNpmHelpers"); +const localNpmHelpers = require("../../../src/extract/resolve/local-npm-helpers"); describe("extract/resolve/localNpmHelpers.getPackageJson", () => { it("returns null if the module does not exist", () => { diff --git a/test/extract/resolve/readPackageDeps/fixtures/amok-prevention-bogus-sub/.keepalive b/test/extract/resolve/read-package-deps/fixtures/amok-prevention-bogus-sub/.keepalive similarity index 100% rename from test/extract/resolve/readPackageDeps/fixtures/amok-prevention-bogus-sub/.keepalive rename to test/extract/resolve/read-package-deps/fixtures/amok-prevention-bogus-sub/.keepalive diff --git a/test/extract/resolve/readPackageDeps/fixtures/amok-prevention-non-exist/.keepalive b/test/extract/resolve/read-package-deps/fixtures/amok-prevention-non-exist/.keepalive similarity index 100% rename from test/extract/resolve/readPackageDeps/fixtures/amok-prevention-non-exist/.keepalive rename to test/extract/resolve/read-package-deps/fixtures/amok-prevention-non-exist/.keepalive diff --git a/test/extract/resolve/readPackageDeps/fixtures/no-package-json-here/.keepalive b/test/extract/resolve/read-package-deps/fixtures/no-package-json-here/.keepalive similarity index 100% rename from test/extract/resolve/readPackageDeps/fixtures/no-package-json-here/.keepalive rename to test/extract/resolve/read-package-deps/fixtures/no-package-json-here/.keepalive diff --git a/test/extract/resolve/readPackageDeps/fixtures/package-json-in-here/package.json b/test/extract/resolve/read-package-deps/fixtures/package-json-in-here/package.json similarity index 100% rename from test/extract/resolve/readPackageDeps/fixtures/package-json-in-here/package.json rename to test/extract/resolve/read-package-deps/fixtures/package-json-in-here/package.json diff --git a/test/extract/resolve/readPackageDeps/fixtures/two-level-package-jsons/package.json b/test/extract/resolve/read-package-deps/fixtures/two-level-package-jsons/package.json similarity index 100% rename from test/extract/resolve/readPackageDeps/fixtures/two-level-package-jsons/package.json rename to test/extract/resolve/read-package-deps/fixtures/two-level-package-jsons/package.json diff --git a/test/extract/resolve/readPackageDeps/fixtures/two-level-package-jsons/packages/subthing/package.json b/test/extract/resolve/read-package-deps/fixtures/two-level-package-jsons/packages/subthing/package.json similarity index 100% rename from test/extract/resolve/readPackageDeps/fixtures/two-level-package-jsons/packages/subthing/package.json rename to test/extract/resolve/read-package-deps/fixtures/two-level-package-jsons/packages/subthing/package.json diff --git a/test/extract/resolve/readPackageDeps/index.spec.js b/test/extract/resolve/read-package-deps/index.spec.js similarity index 84% rename from test/extract/resolve/readPackageDeps/index.spec.js rename to test/extract/resolve/read-package-deps/index.spec.js index df0714771..5a3585f9c 100644 --- a/test/extract/resolve/readPackageDeps/index.spec.js +++ b/test/extract/resolve/read-package-deps/index.spec.js @@ -1,19 +1,19 @@ const path = require("path"); const expect = require("chai").expect; -const readPackageDeps = require("../../../../src/extract/resolve/readPackageDeps"); +const readPackageDeps = require("../../../../src/extract/resolve/read-package-deps"); const rootPackageJson = require("../../../../package.json"); const FIXTUREDIR = "test/extract/resolve/fixtures"; const WORKINGDIR = process.cwd(); -describe("extract/resolve/readPackageDeps - classic strategy", () => { +describe("extract/resolve/read-package-deps - classic strategy", () => { afterEach("tear down", () => { process.chdir(WORKINGDIR); }); it("returns 'null' if the package.json does not exist over there", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/no-package-json-here" + "test/extract/resolve/read-package-deps/fixtures/no-package-json-here" ); expect(readPackageDeps(path.parse(process.cwd()).root)).to.equal(null); }); @@ -46,14 +46,14 @@ describe("extract/resolve/readPackageDeps - classic strategy", () => { }); }); -describe("extract/resolve/readPackageDeps - combined dependencies strategy", () => { +describe("extract/resolve/read-package-deps - combined dependencies strategy", () => { afterEach("tear down", () => { process.chdir(WORKINGDIR); }); it("returns 'null' if the package.json does not exist over there", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/no-package-json-here" + "test/extract/resolve/read-package-deps/fixtures/no-package-json-here" ); expect(readPackageDeps(process.cwd(), process.cwd(), true)).to.equal(null); }); @@ -70,7 +70,7 @@ describe("extract/resolve/readPackageDeps - combined dependencies strategy", () it("returns the deps if the package.json exists in the baseDir", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/package-json-in-here" + "test/extract/resolve/read-package-deps/fixtures/package-json-in-here" ); expect(readPackageDeps(process.cwd(), process.cwd(), true)).to.deep.equal({ dependencies: { @@ -81,7 +81,7 @@ describe("extract/resolve/readPackageDeps - combined dependencies strategy", () it("returns the combined deps if there's a package.json in both base and sub package", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/two-level-package-jsons" + "test/extract/resolve/read-package-deps/fixtures/two-level-package-jsons" ); expect( readPackageDeps( @@ -105,7 +105,7 @@ describe("extract/resolve/readPackageDeps - combined dependencies strategy", () it("returns the combined deps if there's a package.json in both base and sub package - subdir of sub", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/two-level-package-jsons" + "test/extract/resolve/read-package-deps/fixtures/two-level-package-jsons" ); expect( readPackageDeps( @@ -135,7 +135,7 @@ describe("extract/resolve/readPackageDeps - combined dependencies strategy", () it("passing a non-matching or non-existing basedir doesn't make combining dependencies loop eternaly", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/amok-prevention-non-exist" + "test/extract/resolve/read-package-deps/fixtures/amok-prevention-non-exist" ); expect(() => { readPackageDeps(process.cwd(), "bullocks-or-non-valid-basedir", true); @@ -144,7 +144,7 @@ describe("extract/resolve/readPackageDeps - combined dependencies strategy", () it("passing a basedir that weirdly ends in '/' doesn't make combining dependencies loop eternaly", () => { process.chdir( - "test/extract/resolve/readPackageDeps/fixtures/amok-prevention-bogus-sub" + "test/extract/resolve/read-package-deps/fixtures/amok-prevention-bogus-sub" ); expect(() => { readPackageDeps(process.cwd(), `${path.dirname(process.cwd())}/`, true); diff --git a/test/extract/resolve/readPackageDeps/mergePackages.spec.js b/test/extract/resolve/read-package-deps/merge-packages.spec.js similarity index 95% rename from test/extract/resolve/readPackageDeps/mergePackages.spec.js rename to test/extract/resolve/read-package-deps/merge-packages.spec.js index 28ab782b8..e969d7276 100644 --- a/test/extract/resolve/readPackageDeps/mergePackages.spec.js +++ b/test/extract/resolve/read-package-deps/merge-packages.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const mergePackages = require("../../../../src/extract/resolve/readPackageDeps/mergePackages"); +const mergePackages = require("../../../../src/extract/resolve/read-package-deps/merge-packages"); const INPUT = { description: "testington", @@ -58,7 +58,7 @@ const FIXTURE_MERGED = { bundledDependencies: ["nodash", "slodash", "furtherdash"] }; -describe("extract/resolve/readPackageDeps/mergePackages", () => { +describe("extract/resolve/read-package-deps/mergePackages", () => { it("merging empty packages yields {}", () => { expect(mergePackages({}, {})).to.deep.equal({}); }); diff --git a/test/extract/transpile/coffeeWrap.spec.js b/test/extract/transpile/coffeescript-wrap.spec.js similarity index 91% rename from test/extract/transpile/coffeeWrap.spec.js rename to test/extract/transpile/coffeescript-wrap.spec.js index cc968ece8..60675682a 100644 --- a/test/extract/transpile/coffeeWrap.spec.js +++ b/test/extract/transpile/coffeescript-wrap.spec.js @@ -1,8 +1,10 @@ const fs = require("fs"); const expect = require("chai").expect; const normalizeNewline = require("normalize-newline"); -const wrap = require("../../../src/extract/transpile/coffeeWrap")(); -const litWrap = require("../../../src/extract/transpile/coffeeWrap")(true); +const wrap = require("../../../src/extract/transpile/coffeescript-wrap")(); +const litWrap = require("../../../src/extract/transpile/coffeescript-wrap")( + true +); describe("coffeescript transpiler", () => { it("tells the coffeescript transpiler is available", () => { diff --git a/test/extract/transpile/javascriptWrap.spec.js b/test/extract/transpile/javascript-wrap.spec.js similarity index 91% rename from test/extract/transpile/javascriptWrap.spec.js rename to test/extract/transpile/javascript-wrap.spec.js index e495ab92c..99b18ecd5 100644 --- a/test/extract/transpile/javascriptWrap.spec.js +++ b/test/extract/transpile/javascript-wrap.spec.js @@ -1,6 +1,6 @@ const fs = require("fs"); const expect = require("chai").expect; -const wrap = require("../../../src/extract/transpile/javaScriptWrap"); +const wrap = require("../../../src/extract/transpile/javascript-wrap"); describe("jsx transpiler (the plain old javascript one)", () => { it("tells the jsx transpiler is available", () => { diff --git a/test/extract/transpile/liveScriptWrap.spec.js b/test/extract/transpile/livescript-wrap.spec.js similarity index 74% rename from test/extract/transpile/liveScriptWrap.spec.js rename to test/extract/transpile/livescript-wrap.spec.js index 0381dc730..c010c520b 100644 --- a/test/extract/transpile/liveScriptWrap.spec.js +++ b/test/extract/transpile/livescript-wrap.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const wrap = require("../../../src/extract/transpile/liveScriptWrap"); +const wrap = require("../../../src/extract/transpile/livescript-wrap"); describe("livescript transpiler", () => { it("tells the livescript transpiler is not available", () => { diff --git a/test/extract/transpile/meta.spec.js b/test/extract/transpile/meta.spec.js index aa9b4c214..3c4ac3183 100644 --- a/test/extract/transpile/meta.spec.js +++ b/test/extract/transpile/meta.spec.js @@ -1,7 +1,7 @@ const expect = require("chai").expect; const meta = require("../../../src/extract/transpile/meta"); -const jsWrap = require("../../../src/extract/transpile/javaScriptWrap"); -const lsWrap = require("../../../src/extract/transpile/liveScriptWrap"); +const jsWrap = require("../../../src/extract/transpile/javascript-wrap"); +const lsWrap = require("../../../src/extract/transpile/livescript-wrap"); describe("transpiler meta", () => { it("tells which extensions can be scanned", () => { diff --git a/test/extract/transpile/typeScriptWrap.spec.js b/test/extract/transpile/typescript-wrap.spec.js similarity index 87% rename from test/extract/transpile/typeScriptWrap.spec.js rename to test/extract/transpile/typescript-wrap.spec.js index 76134fb71..6c6e8cb65 100644 --- a/test/extract/transpile/typeScriptWrap.spec.js +++ b/test/extract/transpile/typescript-wrap.spec.js @@ -1,8 +1,8 @@ const fs = require("fs"); const expect = require("chai").expect; const normalizeNewline = require("normalize-newline"); -const wrap = require("../../../src/extract/transpile/typeScriptWrap")(); -const tsxWrap = require("../../../src/extract/transpile/typeScriptWrap")(true); +const wrap = require("../../../src/extract/transpile/typescript-wrap")(); +const tsxWrap = require("../../../src/extract/transpile/typescript-wrap")(true); describe("typescript transpiler", () => { it("tells the typescript transpiler is available", () => { diff --git a/test/extract/transpile/vueWrap.spec.js b/test/extract/transpile/vue-template-wrap.spec.js similarity index 94% rename from test/extract/transpile/vueWrap.spec.js rename to test/extract/transpile/vue-template-wrap.spec.js index 1997bb40c..6426de4a6 100644 --- a/test/extract/transpile/vueWrap.spec.js +++ b/test/extract/transpile/vue-template-wrap.spec.js @@ -2,7 +2,7 @@ const fs = require("fs"); const path = require("path"); const expect = require("chai").expect; const normalizeNewline = require("normalize-newline"); -const wrap = require("../../../src/extract/transpile/vueWrap"); +const wrap = require("../../../src/extract/transpile/vue-template-wrap"); describe("vue transpiler", () => { it("extracts the script content from a vue SFC", () => { diff --git a/test/extract/utl/compare.dependenciesEqual.spec.js b/test/extract/utl/compare.dependencies-equal.spec.js similarity index 100% rename from test/extract/utl/compare.dependenciesEqual.spec.js rename to test/extract/utl/compare.dependencies-equal.spec.js diff --git a/test/extract/utl/detectPreCompilationNess.spec.js b/test/extract/utl/detect-pre-compilation-ness.spec.js similarity index 97% rename from test/extract/utl/detectPreCompilationNess.spec.js rename to test/extract/utl/detect-pre-compilation-ness.spec.js index 4bb0d90d8..2ff0700c1 100644 --- a/test/extract/utl/detectPreCompilationNess.spec.js +++ b/test/extract/utl/detect-pre-compilation-ness.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const detectPrecompilationNess = require("../../../src/extract/utl/detectPreCompilationNess"); +const detectPrecompilationNess = require("../../../src/extract/utl/detect-pre-compilation-ness"); describe("extract/utl/detectPreCompilationNess", () => { it("empty dependency lists yield an empty one", () => { diff --git a/test/extract/utl/getExtension.spec.js b/test/extract/utl/get-extension.spec.js similarity index 89% rename from test/extract/utl/getExtension.spec.js rename to test/extract/utl/get-extension.spec.js index 499f47d25..9916bc820 100644 --- a/test/extract/utl/getExtension.spec.js +++ b/test/extract/utl/get-extension.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const getExtension = require("../../../src/extract/utl/getExtension"); +const getExtension = require("../../../src/extract/utl/get-extension"); describe("extract/utl/getExtension", () => { it(".coffee.md classifies as .coffee.md", () => { diff --git a/test/extract/utl/pathToPosix.spec.js b/test/extract/utl/path-to-posix.spec.js similarity index 95% rename from test/extract/utl/pathToPosix.spec.js rename to test/extract/utl/path-to-posix.spec.js index 058e61818..253a802e5 100644 --- a/test/extract/utl/pathToPosix.spec.js +++ b/test/extract/utl/path-to-posix.spec.js @@ -1,6 +1,6 @@ const path = require("path"); const expect = require("chai").expect; -const pathToPosix = require("../../../src/extract/utl/pathToPosix"); +const pathToPosix = require("../../../src/extract/utl/path-to-posix"); describe("extract/utl/pathToPosix on win32", () => { it('transforms win32 style paths to posix ones: ""', () => { diff --git a/test/extract/utl/stripQueryParams.spec.js b/test/extract/utl/strip-query-params.spec.js similarity index 97% rename from test/extract/utl/stripQueryParams.spec.js rename to test/extract/utl/strip-query-params.spec.js index 1f11b2ac5..51ec79a68 100644 --- a/test/extract/utl/stripQueryParams.spec.js +++ b/test/extract/utl/strip-query-params.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const stripQueryParams = require("../../../src/extract/utl/stripQueryParams"); +const stripQueryParams = require("../../../src/extract/utl/strip-query-params"); describe("extract/utl/stripQueryParams", () => { it("leaves the empty string alone", () => { diff --git a/test/main/filesAndDirs/normalize.spec.js b/test/main/files-and-dirs/normalize.spec.js similarity index 82% rename from test/main/filesAndDirs/normalize.spec.js rename to test/main/files-and-dirs/normalize.spec.js index 811e68163..ef778f31a 100644 --- a/test/main/filesAndDirs/normalize.spec.js +++ b/test/main/files-and-dirs/normalize.spec.js @@ -1,8 +1,8 @@ const path = require("path"); const expect = require("chai").expect; -const normalizeFilesAndDirs = require("../../../src/main/filesAndDirs/normalize"); +const normalizeFilesAndDirs = require("../../../src/main/files-and-dirs/normalize"); -describe("main/filesAndDirs", () => { +describe("main/files-and-dirs", () => { it("Keeps an empty file dir array as is", () => { expect(normalizeFilesAndDirs([])).to.deep.equal([]); }); @@ -23,7 +23,7 @@ describe("main/filesAndDirs", () => { it("Normalizes absolute paths to paths relative to the current working dir", () => { expect( normalizeFilesAndDirs([__dirname]).map(path.win32.normalize) - ).to.deep.equal(["test\\main\\filesAndDirs"]); + ).to.deep.equal(["test\\main\\files-and-dirs"]); }); it("Normalizes absolute paths to paths relative to the current working dir keeping globs in tact", () => { @@ -31,7 +31,7 @@ describe("main/filesAndDirs", () => { normalizeFilesAndDirs([`${__dirname}/**/*.{js,ts}`]).map( path.win32.normalize ) - ).to.deep.equal(["test\\main\\filesAndDirs\\**\\*.{js,ts}"]); + ).to.deep.equal(["test\\main\\files-and-dirs\\**\\*.{js,ts}"]); }); it("Normalizes the current working dir passed as an absolute path to '.'", () => { diff --git a/test/main/options/validate.spec.js b/test/main/options/validate.spec.js index 6647b18e7..23ca6410e 100644 --- a/test/main/options/validate.spec.js +++ b/test/main/options/validate.spec.js @@ -108,13 +108,13 @@ describe("main/options/validate", () => { }).to.not.throw(); }); - it("passes when --validate is passed a safe regex in ruleSet.exclude", () => { + it("passes when --validate is passed a safe regex in rule-set.exclude", () => { expect(() => { validateOptions({ ruleSet: { options: { exclude: "([A-Za-z]+)" } } }); }).to.not.throw(); }); - it("throws when --validate is passed an unsafe regex in ruleSet.exclude", () => { + it("throws when --validate is passed an unsafe regex in rule-set.exclude", () => { expect(() => { validateOptions({ ruleSet: { options: { exclude: "(.*)+" } } }); }).to.throw( @@ -122,7 +122,7 @@ describe("main/options/validate", () => { ); }); - it("command line options trump those passed in --validate ruleSet", () => { + it("command line options trump those passed in --validate rule-set", () => { const lOptions = validateOptions({ exclude: "from the commandline", ruleSet: { options: { exclude: "from the ruleset" } } @@ -131,7 +131,7 @@ describe("main/options/validate", () => { expect(lOptions.exclude).to.equal("from the commandline"); }); - it("options passed in --validate ruleSet drip down to the proper options", () => { + it("options passed in --validate rule-set drip down to the proper options", () => { const lOptions = validateOptions({ doNotFollow: "from the commandline", ruleSet: { options: { exclude: "from the ruleset" } } diff --git a/test/main/resolveOptions/normalize.spec.js b/test/main/resolve-options/normalize.spec.js similarity index 98% rename from test/main/resolveOptions/normalize.spec.js rename to test/main/resolve-options/normalize.spec.js index 74435815d..588c0671d 100644 --- a/test/main/resolveOptions/normalize.spec.js +++ b/test/main/resolve-options/normalize.spec.js @@ -1,9 +1,9 @@ const path = require("path"); const expect = require("chai").expect; const normalizeOptions = require("../../../src/main/options/normalize"); -const normalizeResolveOptions = require("../../../src/main/resolveOptions/normalize"); +const normalizeResolveOptions = require("../../../src/main/resolve-options/normalize"); -describe("main/resolveOptions/normalize", () => { +describe("main/resolve-options/normalize", () => { const DEFAULT_NO_OF_RESOLVE_OPTIONS = 8; const TEST_TSCONFIG = path.join( __dirname, diff --git a/test/main/ruleSet/normalize.spec.js b/test/main/rule-set/normalize.spec.js similarity index 96% rename from test/main/ruleSet/normalize.spec.js rename to test/main/rule-set/normalize.spec.js index 82270dc8f..3a207b661 100644 --- a/test/main/ruleSet/normalize.spec.js +++ b/test/main/rule-set/normalize.spec.js @@ -1,7 +1,7 @@ const expect = require("chai").expect; -const normalize = require("../../../src/main/ruleSet/normalize"); +const normalize = require("../../../src/main/rule-set/normalize"); -describe("main/ruleSet/normalize", () => { +describe("main/rule-set/normalize", () => { it("leaves the empty ruleset alone", () => { expect(normalize({})).to.deep.equal({}); }); diff --git a/test/main/ruleSet/validate.spec.js b/test/main/rule-set/validate.spec.js similarity index 95% rename from test/main/ruleSet/validate.spec.js rename to test/main/rule-set/validate.spec.js index 5f4b80702..8b2a66e7d 100644 --- a/test/main/ruleSet/validate.spec.js +++ b/test/main/rule-set/validate.spec.js @@ -1,6 +1,6 @@ const fs = require("fs"); const expect = require("chai").expect; -const validate = require("../../../src/main/ruleSet/validate"); +const validate = require("../../../src/main/rule-set/validate"); function shouldBarfWithMessage(pRulesFile, pMessage) { expect(() => { @@ -14,7 +14,7 @@ function shouldBeOK(pRulesFile) { expect(validate(lRulesObject)).to.deep.equal(lRulesObject); } -describe("main/ruleSet/validate - regular", () => { +describe("main/rule-set/validate - regular", () => { it("barfs on an invalid rules file", () => { shouldBarfWithMessage( "./test/validate/fixtures/rules.not-a-valid-rulesfile.json", @@ -59,7 +59,7 @@ describe("main/ruleSet/validate - regular", () => { }); }); -describe("main/ruleSet/validate - regexp safety checks", () => { +describe("main/rule-set/validate - regexp safety checks", () => { it("bails out on scary regexps in paths", () => { shouldBarfWithMessage( "./test/validate/fixtures/rules.scary-regex.json", diff --git a/test/report/anon/anonymizePathElement.spec.js b/test/report/anon/anonymize-path-element.spec.js similarity index 98% rename from test/report/anon/anonymizePathElement.spec.js rename to test/report/anon/anonymize-path-element.spec.js index c04614230..bef15d75d 100644 --- a/test/report/anon/anonymizePathElement.spec.js +++ b/test/report/anon/anonymize-path-element.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const anonymizePath = require("../../../src/report/anon/anonymizePathElement"); +const anonymizePath = require("../../../src/report/anon/anonymize-path-element"); describe("report/anon/anonymizePathElement - uncached", () => { it("'' => ''", () => { diff --git a/test/report/anon/anonymizePath.spec.js b/test/report/anon/anonymize-path.spec.js similarity index 97% rename from test/report/anon/anonymizePath.spec.js rename to test/report/anon/anonymize-path.spec.js index 5ab1e3c13..40613b3ce 100644 --- a/test/report/anon/anonymizePath.spec.js +++ b/test/report/anon/anonymize-path.spec.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; -const anonymizePath = require("../../../src/report/anon/anonymizePath"); -const anonymizePathElement = require("../../../src/report/anon/anonymizePathElement"); +const anonymizePath = require("../../../src/report/anon/anonymize-path"); +const anonymizePathElement = require("../../../src/report/anon/anonymize-path-element"); describe("report/anon/anonymizePath", () => { beforeEach(() => { diff --git a/test/report/anon/anonymize.spec.js b/test/report/anon/anonymize.spec.js index 2e0000229..34b51f180 100644 --- a/test/report/anon/anonymize.spec.js +++ b/test/report/anon/anonymize.spec.js @@ -1,7 +1,7 @@ const expect = require("chai").expect; const _clone = require("lodash/clone"); const anonymize = require("../../../src/report/anon"); -const anonymizePathElement = require("../../../src/report/anon/anonymizePathElement"); +const anonymizePathElement = require("../../../src/report/anon/anonymize-path-element"); const srcReport = require("./mocks/src-report.json"); const srcReportWithWordlist = require("./mocks/src-report-wordlist.json"); const fixtureReport = require("./fixtures/src-report.json"); diff --git a/test/report/anon/randomString.spec.js b/test/report/anon/random-string.spec.js similarity index 94% rename from test/report/anon/randomString.spec.js rename to test/report/anon/random-string.spec.js index eaeb6c5ee..8e5fc6497 100644 --- a/test/report/anon/randomString.spec.js +++ b/test/report/anon/random-string.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const randomString = require("../../../src/report/anon/randomString"); +const randomString = require("../../../src/report/anon/random-string"); describe("report/anon/randomString", () => { it("returns the empty string when passed the empty string", () => { diff --git a/test/report/dot/customLevel/index.spec.js b/test/report/dot/custom-level/index.spec.js similarity index 96% rename from test/report/dot/customLevel/index.spec.js rename to test/report/dot/custom-level/index.spec.js index 3997096d9..78f207181 100644 --- a/test/report/dot/customLevel/index.spec.js +++ b/test/report/dot/custom-level/index.spec.js @@ -20,7 +20,7 @@ const consolidatedRxJs = fs.readFileSync( "utf8" ); -describe("report/dot/customLevel reporter", () => { +describe("report/dot/custom-level reporter", () => { it("consolidates to custome levels", () => { const lRetval = render(deps); diff --git a/test/report/dot/customLevel/mocks/dependency-cruiser-2020-01-25.dot b/test/report/dot/custom-level/mocks/dependency-cruiser-2020-01-25.dot similarity index 100% rename from test/report/dot/customLevel/mocks/dependency-cruiser-2020-01-25.dot rename to test/report/dot/custom-level/mocks/dependency-cruiser-2020-01-25.dot diff --git a/test/report/dot/customLevel/mocks/dependency-cruiser-2020-01-25.json b/test/report/dot/custom-level/mocks/dependency-cruiser-2020-01-25.json similarity index 100% rename from test/report/dot/customLevel/mocks/dependency-cruiser-2020-01-25.json rename to test/report/dot/custom-level/mocks/dependency-cruiser-2020-01-25.json diff --git a/test/report/dot/customLevel/mocks/orphans.dot b/test/report/dot/custom-level/mocks/orphans.dot similarity index 100% rename from test/report/dot/customLevel/mocks/orphans.dot rename to test/report/dot/custom-level/mocks/orphans.dot diff --git a/test/report/dot/customLevel/mocks/orphans.json b/test/report/dot/custom-level/mocks/orphans.json similarity index 100% rename from test/report/dot/customLevel/mocks/orphans.json rename to test/report/dot/custom-level/mocks/orphans.json diff --git a/test/report/dot/customLevel/mocks/rxjs.dot b/test/report/dot/custom-level/mocks/rxjs.dot similarity index 100% rename from test/report/dot/customLevel/mocks/rxjs.dot rename to test/report/dot/custom-level/mocks/rxjs.dot diff --git a/test/report/dot/customLevel/mocks/rxjs.json b/test/report/dot/custom-level/mocks/rxjs.json similarity index 100% rename from test/report/dot/customLevel/mocks/rxjs.json rename to test/report/dot/custom-level/mocks/rxjs.json diff --git a/test/report/dot/dotColoring.spec.js b/test/report/dot/dot-coloring.spec.js similarity index 100% rename from test/report/dot/dotColoring.spec.js rename to test/report/dot/dot-coloring.spec.js diff --git a/test/report/dot/folderLevel/folderLevel.spec.js b/test/report/dot/folder-level/folder-level.spec.js similarity index 96% rename from test/report/dot/folderLevel/folderLevel.spec.js rename to test/report/dot/folder-level/folder-level.spec.js index d928a608a..d376bb1f6 100644 --- a/test/report/dot/folderLevel/folderLevel.spec.js +++ b/test/report/dot/folder-level/folder-level.spec.js @@ -20,7 +20,7 @@ const consolidatedRxJs = fs.readFileSync( "utf8" ); -describe("report/dot/folderLevel reporter", () => { +describe("report/dot/folder-level reporter", () => { it("consolidates to folder level", () => { const lRetval = render(deps); diff --git a/test/report/dot/folderLevel/mocks/dependency-cruiser-2019-01-14.dot b/test/report/dot/folder-level/mocks/dependency-cruiser-2019-01-14.dot similarity index 100% rename from test/report/dot/folderLevel/mocks/dependency-cruiser-2019-01-14.dot rename to test/report/dot/folder-level/mocks/dependency-cruiser-2019-01-14.dot diff --git a/test/report/dot/folderLevel/mocks/dependency-cruiser-2019-01-14.json b/test/report/dot/folder-level/mocks/dependency-cruiser-2019-01-14.json similarity index 100% rename from test/report/dot/folderLevel/mocks/dependency-cruiser-2019-01-14.json rename to test/report/dot/folder-level/mocks/dependency-cruiser-2019-01-14.json diff --git a/test/report/dot/folderLevel/mocks/orphans.dot b/test/report/dot/folder-level/mocks/orphans.dot similarity index 100% rename from test/report/dot/folderLevel/mocks/orphans.dot rename to test/report/dot/folder-level/mocks/orphans.dot diff --git a/test/report/dot/folderLevel/mocks/orphans.json b/test/report/dot/folder-level/mocks/orphans.json similarity index 100% rename from test/report/dot/folderLevel/mocks/orphans.json rename to test/report/dot/folder-level/mocks/orphans.json diff --git a/test/report/dot/folderLevel/mocks/rxjs.dot b/test/report/dot/folder-level/mocks/rxjs.dot similarity index 100% rename from test/report/dot/folderLevel/mocks/rxjs.dot rename to test/report/dot/folder-level/mocks/rxjs.dot diff --git a/test/report/dot/folderLevel/mocks/rxjs.json b/test/report/dot/folder-level/mocks/rxjs.json similarity index 100% rename from test/report/dot/folderLevel/mocks/rxjs.json rename to test/report/dot/folder-level/mocks/rxjs.json diff --git a/test/report/dot/moduleLevel/bareTheme.json b/test/report/dot/module-level/bareTheme.json similarity index 100% rename from test/report/dot/moduleLevel/bareTheme.json rename to test/report/dot/module-level/bareTheme.json diff --git a/test/report/dot/moduleLevel/index.spec.js b/test/report/dot/module-level/index.spec.js similarity index 98% rename from test/report/dot/moduleLevel/index.spec.js rename to test/report/dot/module-level/index.spec.js index 4ae229bbc..d76428f5d 100644 --- a/test/report/dot/moduleLevel/index.spec.js +++ b/test/report/dot/module-level/index.spec.js @@ -1,7 +1,7 @@ const fs = require("fs"); const path = require("path"); const expect = require("chai").expect; -const defaultTheme = require("../../../../src/report/dot/defaultTheme.json"); +const defaultTheme = require("../../../../src/report/dot/default-theme.json"); const render = require("../../../../src/report/dot")("module"); const defaultRender = require("../../../../src/report/dot")(); const clusterless = require("./mocks/clusterless.json"); @@ -55,7 +55,7 @@ const bareColorFixture = fs.readFileSync( "utf8" ); -describe("report/dot/moduleLevel reporter", () => { +describe("report/dot/module-level reporter", () => { it("renders a dot - modules in the root don't come in a cluster", () => { expect(render(clusterless, bareTheme).output).to.deep.equal( clusterlessFixture diff --git a/test/report/dot/moduleLevel/mocks/bunch-of-modules-default-theme.dot b/test/report/dot/module-level/mocks/bunch-of-modules-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/bunch-of-modules-default-theme.dot rename to test/report/dot/module-level/mocks/bunch-of-modules-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/bunch-of-modules.dot b/test/report/dot/module-level/mocks/bunch-of-modules.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/bunch-of-modules.dot rename to test/report/dot/module-level/mocks/bunch-of-modules.dot diff --git a/test/report/dot/moduleLevel/mocks/bunch-of-modules.json b/test/report/dot/module-level/mocks/bunch-of-modules.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/bunch-of-modules.json rename to test/report/dot/module-level/mocks/bunch-of-modules.json diff --git a/test/report/dot/moduleLevel/mocks/clusterless-default-theme.dot b/test/report/dot/module-level/mocks/clusterless-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/clusterless-default-theme.dot rename to test/report/dot/module-level/mocks/clusterless-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/clusterless.dot b/test/report/dot/module-level/mocks/clusterless.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/clusterless.dot rename to test/report/dot/module-level/mocks/clusterless.dot diff --git a/test/report/dot/moduleLevel/mocks/clusterless.json b/test/report/dot/module-level/mocks/clusterless.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/clusterless.json rename to test/report/dot/module-level/mocks/clusterless.json diff --git a/test/report/dot/moduleLevel/mocks/do-not-follow-deps-default-theme.dot b/test/report/dot/module-level/mocks/do-not-follow-deps-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/do-not-follow-deps-default-theme.dot rename to test/report/dot/module-level/mocks/do-not-follow-deps-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/do-not-follow-deps.dot b/test/report/dot/module-level/mocks/do-not-follow-deps.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/do-not-follow-deps.dot rename to test/report/dot/module-level/mocks/do-not-follow-deps.dot diff --git a/test/report/dot/moduleLevel/mocks/do-not-follow-deps.json b/test/report/dot/module-level/mocks/do-not-follow-deps.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/do-not-follow-deps.json rename to test/report/dot/module-level/mocks/do-not-follow-deps.json diff --git a/test/report/dot/moduleLevel/mocks/es6-unresolvable-deps-default-theme.dot b/test/report/dot/module-level/mocks/es6-unresolvable-deps-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/es6-unresolvable-deps-default-theme.dot rename to test/report/dot/module-level/mocks/es6-unresolvable-deps-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/es6-unresolvable-deps.dot b/test/report/dot/module-level/mocks/es6-unresolvable-deps.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/es6-unresolvable-deps.dot rename to test/report/dot/module-level/mocks/es6-unresolvable-deps.dot diff --git a/test/report/dot/moduleLevel/mocks/es6-unresolvable-deps.json b/test/report/dot/module-level/mocks/es6-unresolvable-deps.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/es6-unresolvable-deps.json rename to test/report/dot/module-level/mocks/es6-unresolvable-deps.json diff --git a/test/report/dot/moduleLevel/mocks/orphan-deps-default-theme.dot b/test/report/dot/module-level/mocks/orphan-deps-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/orphan-deps-default-theme.dot rename to test/report/dot/module-level/mocks/orphan-deps-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/orphan-deps.dot b/test/report/dot/module-level/mocks/orphan-deps.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/orphan-deps.dot rename to test/report/dot/module-level/mocks/orphan-deps.dot diff --git a/test/report/dot/moduleLevel/mocks/orphan-deps.json b/test/report/dot/module-level/mocks/orphan-deps.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/orphan-deps.json rename to test/report/dot/module-level/mocks/orphan-deps.json diff --git a/test/report/dot/moduleLevel/mocks/prefix-non-uri-default-theme.dot b/test/report/dot/module-level/mocks/prefix-non-uri-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/prefix-non-uri-default-theme.dot rename to test/report/dot/module-level/mocks/prefix-non-uri-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/prefix-non-uri.dot b/test/report/dot/module-level/mocks/prefix-non-uri.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/prefix-non-uri.dot rename to test/report/dot/module-level/mocks/prefix-non-uri.dot diff --git a/test/report/dot/moduleLevel/mocks/prefix-non-uri.json b/test/report/dot/module-level/mocks/prefix-non-uri.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/prefix-non-uri.json rename to test/report/dot/module-level/mocks/prefix-non-uri.json diff --git a/test/report/dot/moduleLevel/mocks/prefix-uri-default-theme.dot b/test/report/dot/module-level/mocks/prefix-uri-default-theme.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/prefix-uri-default-theme.dot rename to test/report/dot/module-level/mocks/prefix-uri-default-theme.dot diff --git a/test/report/dot/moduleLevel/mocks/prefix-uri.dot b/test/report/dot/module-level/mocks/prefix-uri.dot similarity index 100% rename from test/report/dot/moduleLevel/mocks/prefix-uri.dot rename to test/report/dot/module-level/mocks/prefix-uri.dot diff --git a/test/report/dot/moduleLevel/mocks/prefix-uri.json b/test/report/dot/module-level/mocks/prefix-uri.json similarity index 100% rename from test/report/dot/moduleLevel/mocks/prefix-uri.json rename to test/report/dot/module-level/mocks/prefix-uri.json diff --git a/test/report/teamcity/mocks/circular-deps-teamcity-format.txt b/test/report/teamcity/mocks/circular-deps-teamcity-format.txt index ecce9f36f..3aab12025 100644 --- a/test/report/teamcity/mocks/circular-deps-teamcity-format.txt +++ b/test/report/teamcity/mocks/circular-deps-teamcity-format.txt @@ -1,4 +1,4 @@ -##teamcity[inspectionType id='no-circular' name='no-circular' description='This dependency is part of a circular relationship. You might want to revise your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ' category='dependency-cruiser' flowId='3957399060' timestamp='2020-02-15T13:54:02.782'] -##teamcity[inspection typeId='no-circular' message='src/some/folder/nested/center.js -> src/some/folder/loop-a.js -> src/some/folder/loop-b.js -> src/some/folder/nested/center.js' file='src/some/folder/nested/center.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.782'] -##teamcity[inspection typeId='no-circular' message='src/some/folder/loop-a.js -> src/some/folder/loop-b.js -> src/some/folder/nested/center.js -> src/some/folder/loop-a.js' file='src/some/folder/loop-a.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.782'] -##teamcity[inspection typeId='no-circular' message='src/some/folder/loop-b.js -> src/some/folder/nested/center.js -> src/some/folder/loop-a.js -> src/some/folder/loop-b.js' file='src/some/folder/loop-b.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.782'] +##teamcity[inspectionType id='no-circular' name='no-circular' description='This dependency is part of a circular relationship. You might want to revise your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ' category='dependency-cruiser' flowId='181243112' timestamp='2020-02-23T18:09:46.901'] +##teamcity[inspection typeId='no-circular' message='src/some/folder/nested/center.js -> src/some/folder/loop-a.js -> src/some/folder/loop-b.js -> src/some/folder/nested/center.js' file='src/some/folder/nested/center.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.902'] +##teamcity[inspection typeId='no-circular' message='src/some/folder/loop-a.js -> src/some/folder/loop-b.js -> src/some/folder/nested/center.js -> src/some/folder/loop-a.js' file='src/some/folder/loop-a.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.902'] +##teamcity[inspection typeId='no-circular' message='src/some/folder/loop-b.js -> src/some/folder/nested/center.js -> src/some/folder/loop-a.js -> src/some/folder/loop-b.js' file='src/some/folder/loop-b.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.902'] diff --git a/test/report/teamcity/mocks/module-errors-teamcity-format.txt b/test/report/teamcity/mocks/module-errors-teamcity-format.txt index 69d49bef6..bd03b08d5 100644 --- a/test/report/teamcity/mocks/module-errors-teamcity-format.txt +++ b/test/report/teamcity/mocks/module-errors-teamcity-format.txt @@ -1,10 +1,10 @@ -##teamcity[inspectionType id='not-to-dev-dep' name='not-to-dev-dep' description='Don|'t allow dependencies from src/app/lib to a development only package' category='dependency-cruiser' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspectionType id='no-orphans' name='no-orphans' description='Modules without any incoming or outgoing dependencies are might indicate unused code.' category='dependency-cruiser' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspectionType id='not-to-unresolvable' name='not-to-unresolvable' description='not-to-unresolvable' category='dependency-cruiser' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspectionType id='not-in-allowed' name='not-in-allowed' description='dependency is not in the |'allowed|' set of rules' category='dependency-cruiser' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspection typeId='not-to-dev-dep' message='src/asneeze.js -> node_modules/eslint/lib/api.js' file='src/asneeze.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspection typeId='not-to-unresolvable' message='src/index.js -> ./medontexist.json' file='src/index.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspection typeId='not-to-dev-dep' message='src/index.js -> node_modules/dependency-cruiser/src/main/index.js' file='src/index.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspection typeId='not-to-dev-dep' message='src/index.js -> node_modules/eslint/lib/api.js' file='src/index.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspection typeId='no-orphans' message='src/orphan.js' file='src/orphan.js' SEVERITY='ERROR' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] -##teamcity[inspection typeId='not-in-allowed' message='src/index.js -> ./medontexist.json' file='src/index.js' SEVERITY='WARNING' flowId='3957399060' timestamp='2020-02-15T13:54:02.783'] +##teamcity[inspectionType id='not-to-dev-dep' name='not-to-dev-dep' description='Don|'t allow dependencies from src/app/lib to a development only package' category='dependency-cruiser' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspectionType id='no-orphans' name='no-orphans' description='Modules without any incoming or outgoing dependencies are might indicate unused code.' category='dependency-cruiser' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspectionType id='not-to-unresolvable' name='not-to-unresolvable' description='not-to-unresolvable' category='dependency-cruiser' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspectionType id='not-in-allowed' name='not-in-allowed' description='dependency is not in the |'allowed|' set of rules' category='dependency-cruiser' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspection typeId='not-to-dev-dep' message='src/asneeze.js -> node_modules/eslint/lib/api.js' file='src/asneeze.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspection typeId='not-to-unresolvable' message='src/index.js -> ./medontexist.json' file='src/index.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspection typeId='not-to-dev-dep' message='src/index.js -> node_modules/dependency-cruiser/src/main/index.js' file='src/index.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspection typeId='not-to-dev-dep' message='src/index.js -> node_modules/eslint/lib/api.js' file='src/index.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspection typeId='no-orphans' message='src/orphan.js' file='src/orphan.js' SEVERITY='ERROR' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] +##teamcity[inspection typeId='not-in-allowed' message='src/index.js -> ./medontexist.json' file='src/index.js' SEVERITY='WARNING' flowId='181243112' timestamp='2020-02-23T18:09:46.903'] diff --git a/test/report/utl/compareRules.spec.js b/test/report/utl/compare-rules.spec.js similarity index 94% rename from test/report/utl/compareRules.spec.js rename to test/report/utl/compare-rules.spec.js index f8f86b55f..b5d553837 100644 --- a/test/report/utl/compareRules.spec.js +++ b/test/report/utl/compare-rules.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const compareRules = require("../../../src/report/utl/compareRules"); +const compareRules = require("../../../src/report/utl/compare-rules"); describe("report/utl/compareRules", () => { it("samesies yield 0", () => { diff --git a/test/report/utl/consolidateToFolder.spec.js b/test/report/utl/consolidate-to-folder.spec.js similarity index 98% rename from test/report/utl/consolidateToFolder.spec.js rename to test/report/utl/consolidate-to-folder.spec.js index be82aa2af..968029f18 100644 --- a/test/report/utl/consolidateToFolder.spec.js +++ b/test/report/utl/consolidate-to-folder.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const consolidateToFolder = require("../../../src/report/utl/consolidateToFolder"); +const consolidateToFolder = require("../../../src/report/utl/consolidate-to-folder"); describe("report/utl/consolidateToFolder", () => { it("source gets squashed to its folder", () => { diff --git a/test/report/utl/consolidateToPattern.spec.js b/test/report/utl/consolidate-to-pattern.spec.js similarity index 99% rename from test/report/utl/consolidateToPattern.spec.js rename to test/report/utl/consolidate-to-pattern.spec.js index c33aa9adb..e9248cf81 100644 --- a/test/report/utl/consolidateToPattern.spec.js +++ b/test/report/utl/consolidate-to-pattern.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const consolidateToPattern = require("../../../src/report/utl/consolidateToPattern"); +const consolidateToPattern = require("../../../src/report/utl/consolidate-to-pattern"); describe("report/utl/consolidateToPattern", () => { it("no pattern => no squashing", () => { diff --git a/test/report/utl/dependencyToIncidenceTransformer.spec.js b/test/report/utl/dependency-to-incidence-transformer.spec.js similarity index 91% rename from test/report/utl/dependencyToIncidenceTransformer.spec.js rename to test/report/utl/dependency-to-incidence-transformer.spec.js index 3e9ebad31..a37d4198c 100644 --- a/test/report/utl/dependencyToIncidenceTransformer.spec.js +++ b/test/report/utl/dependency-to-incidence-transformer.spec.js @@ -1,5 +1,5 @@ const expect = require("chai").expect; -const transform = require("../../../src/report/utl/dependencyToIncidenceTransformer"); +const transform = require("../../../src/report/utl/dependency-to-incidence-transformer"); const ONE_VIOLATION_DEPS_INPUT = require("./mocks/one-violation.json").modules; const ONE_VIOLATION_DEPS_FIXTURE = require("./mocks/one-violation-incidences.json"); diff --git a/test/utl/findRuleByName.spec.js b/test/utl/find-rule-by-name.spec.js similarity index 94% rename from test/utl/findRuleByName.spec.js rename to test/utl/find-rule-by-name.spec.js index 1d630dd7b..12f637bcf 100644 --- a/test/utl/findRuleByName.spec.js +++ b/test/utl/find-rule-by-name.spec.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-expressions */ const expect = require("chai").expect; -const findRuleByName = require("../../src/utl/findRuleByName"); +const findRuleByName = require("../../src/utl/find-rule-by-name"); describe("report/utl/findRuleByName", () => { const lRuleSet = { diff --git a/test/validate/index.exoticRequire.spec.js b/test/validate/index.exotic-require.spec.js similarity index 100% rename from test/validate/index.exoticRequire.spec.js rename to test/validate/index.exotic-require.spec.js diff --git a/test/validate/index.preCompilationOnly.spec.js b/test/validate/index.pre-compilation-only.spec.js similarity index 100% rename from test/validate/index.preCompilationOnly.spec.js rename to test/validate/index.pre-compilation-only.spec.js diff --git a/test/validate/readruleset.utl.js b/test/validate/readruleset.utl.js index c0481c619..a74532f4c 100644 --- a/test/validate/readruleset.utl.js +++ b/test/validate/readruleset.utl.js @@ -1,6 +1,6 @@ const fs = require("fs"); -const normalizeRuleSet = require("../../src/main/ruleSet/normalize"); -const validateRuleSet = require("../../src/main/ruleSet/validate"); +const normalizeRuleSet = require("../../src/main/rule-set/normalize"); +const validateRuleSet = require("../../src/main/rule-set/validate"); module.exports = pFileName => normalizeRuleSet( diff --git a/types/dependency-cruiser.d.ts b/types/dependency-cruiser.d.ts index cd1315d90..ed21f8121 100644 --- a/types/dependency-cruiser.d.ts +++ b/types/dependency-cruiser.d.ts @@ -70,7 +70,7 @@ export interface IReporterOutput { * API will not take any 'extends' keys there into account, so * before calling make sure to flatten them out if you want them * used (the dependency-cruiser cli does this - * [here](../src/cli/parseTSConfig.js)) + * [here](../src/cli/parse-ts-config.js)) */ export function cruise( pFileDirArray: string[], diff --git a/types/options.d.ts b/types/options.d.ts index 76860f5fc..ee23a45f9 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -38,7 +38,7 @@ export interface ICruiseOptions { * * This ain't in none of the json schemas, but is used internally _instead_ * of the rule set defined on global configuration level. Judo - * (a.o. flattening out extended rule sets) done in ../src/cli/normalizeOptions.js + * (a.o. flattening out extended rule sets) done in ../src/cli/normalize-options.js */ ruleSet?: IFlattenedRuleSet; /**