zedbee 0.1.0-beta.16 → 0.1.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +68 -74
- package/dist/attribution/metrics.d.ts.map +1 -1
- package/dist/attribution/metrics.js +8 -5
- package/dist/attribution/metrics.js.map +1 -1
- package/dist/attribution/pair-source-moves.d.ts +12 -0
- package/dist/attribution/pair-source-moves.d.ts.map +1 -0
- package/dist/attribution/pair-source-moves.js +108 -0
- package/dist/attribution/pair-source-moves.js.map +1 -0
- package/dist/attribution/source-moves.d.ts +47 -0
- package/dist/attribution/source-moves.d.ts.map +1 -0
- package/dist/attribution/source-moves.js +199 -0
- package/dist/attribution/source-moves.js.map +1 -0
- package/dist/cache/captured-dependencies.d.ts +24 -1
- package/dist/cache/captured-dependencies.d.ts.map +1 -1
- package/dist/cache/captured-dependencies.js +146 -25
- package/dist/cache/captured-dependencies.js.map +1 -1
- package/dist/cache/dependency-inputs.d.ts +3 -1
- package/dist/cache/dependency-inputs.d.ts.map +1 -1
- package/dist/cache/dependency-inputs.js +7 -3
- package/dist/cache/dependency-inputs.js.map +1 -1
- package/dist/checks/adapter.d.ts +1 -0
- package/dist/checks/adapter.d.ts.map +1 -1
- package/dist/checks/applicability.d.ts.map +1 -1
- package/dist/checks/applicability.js +1 -1
- package/dist/checks/applicability.js.map +1 -1
- package/dist/checks/changed-file-paths.d.ts.map +1 -1
- package/dist/checks/changed-file-paths.js +7 -1
- package/dist/checks/changed-file-paths.js.map +1 -1
- package/dist/checks/closed-compiler-project.d.ts +5 -0
- package/dist/checks/closed-compiler-project.d.ts.map +1 -0
- package/dist/checks/closed-compiler-project.js +106 -0
- package/dist/checks/closed-compiler-project.js.map +1 -0
- package/dist/checks/comparison-context.d.ts +3 -1
- package/dist/checks/comparison-context.d.ts.map +1 -1
- package/dist/checks/comparison-context.js +122 -7
- package/dist/checks/comparison-context.js.map +1 -1
- package/dist/checks/compiler-change-inputs.d.ts +12 -0
- package/dist/checks/compiler-change-inputs.d.ts.map +1 -0
- package/dist/checks/compiler-change-inputs.js +104 -0
- package/dist/checks/compiler-change-inputs.js.map +1 -0
- package/dist/checks/compiler-inputs.d.ts +1 -1
- package/dist/checks/compiler-inputs.d.ts.map +1 -1
- package/dist/checks/compiler-inputs.js +65 -5
- package/dist/checks/compiler-inputs.js.map +1 -1
- package/dist/checks/complexity/adapter.d.ts.map +1 -1
- package/dist/checks/complexity/adapter.js +21 -2
- package/dist/checks/complexity/adapter.js.map +1 -1
- package/dist/checks/dead-code/adapter.d.ts.map +1 -1
- package/dist/checks/dead-code/adapter.js +16 -5
- package/dist/checks/dead-code/adapter.js.map +1 -1
- package/dist/checks/dead-code/entry-configuration.d.ts +6 -0
- package/dist/checks/dead-code/entry-configuration.d.ts.map +1 -0
- package/dist/checks/dead-code/entry-configuration.js +48 -0
- package/dist/checks/dead-code/entry-configuration.js.map +1 -0
- package/dist/checks/dead-code/managed-config.d.ts +1 -1
- package/dist/checks/dead-code/managed-config.d.ts.map +1 -1
- package/dist/checks/dead-code/managed-config.js +24 -3
- package/dist/checks/dead-code/managed-config.js.map +1 -1
- package/dist/checks/dead-code/vite-entrypoints.d.ts +13 -0
- package/dist/checks/dead-code/vite-entrypoints.d.ts.map +1 -0
- package/dist/checks/dead-code/vite-entrypoints.js +314 -0
- package/dist/checks/dead-code/vite-entrypoints.js.map +1 -0
- package/dist/checks/diagnostic-details.d.ts.map +1 -1
- package/dist/checks/diagnostic-details.js +32 -0
- package/dist/checks/diagnostic-details.js.map +1 -1
- package/dist/checks/dispatch-cache.d.ts.map +1 -1
- package/dist/checks/dispatch-cache.js +9 -0
- package/dist/checks/dispatch-cache.js.map +1 -1
- package/dist/checks/dispatch-context.d.ts.map +1 -1
- package/dist/checks/dispatch-context.js +1 -0
- package/dist/checks/dispatch-context.js.map +1 -1
- package/dist/checks/dispatch-target.d.ts.map +1 -1
- package/dist/checks/dispatch-target.js +36 -5
- package/dist/checks/dispatch-target.js.map +1 -1
- package/dist/checks/dispatcher.d.ts.map +1 -1
- package/dist/checks/dispatcher.js +20 -7
- package/dist/checks/dispatcher.js.map +1 -1
- package/dist/checks/engine-identity.d.ts.map +1 -1
- package/dist/checks/engine-identity.js +9 -8
- package/dist/checks/engine-identity.js.map +1 -1
- package/dist/checks/eslint/convert-message.d.ts.map +1 -1
- package/dist/checks/eslint/convert-message.js +5 -2
- package/dist/checks/eslint/convert-message.js.map +1 -1
- package/dist/checks/incomplete-error.d.ts +3 -0
- package/dist/checks/incomplete-error.d.ts.map +1 -1
- package/dist/checks/incomplete-error.js +4 -0
- package/dist/checks/incomplete-error.js.map +1 -1
- package/dist/checks/incomplete-result.d.ts +1 -0
- package/dist/checks/incomplete-result.d.ts.map +1 -1
- package/dist/checks/incomplete-result.js +3 -0
- package/dist/checks/incomplete-result.js.map +1 -1
- package/dist/checks/installation-diagnostic.d.ts +11 -0
- package/dist/checks/installation-diagnostic.d.ts.map +1 -0
- package/dist/checks/installation-diagnostic.js +71 -0
- package/dist/checks/installation-diagnostic.js.map +1 -0
- package/dist/checks/observation-result.d.ts.map +1 -1
- package/dist/checks/observation-result.js +69 -7
- package/dist/checks/observation-result.js.map +1 -1
- package/dist/checks/prettier/settings.d.ts +2 -2
- package/dist/checks/project-inputs.d.ts +1 -1
- package/dist/checks/project-inputs.d.ts.map +1 -1
- package/dist/checks/project-inputs.js +13 -4
- package/dist/checks/project-inputs.js.map +1 -1
- package/dist/checks/react/adapter.d.ts.map +1 -1
- package/dist/checks/react/adapter.js +38 -5
- package/dist/checks/react/adapter.js.map +1 -1
- package/dist/checks/runner/envelope.d.ts.map +1 -1
- package/dist/checks/runner/envelope.js +1 -0
- package/dist/checks/runner/envelope.js.map +1 -1
- package/dist/checks/runner/worker.js +3 -0
- package/dist/checks/runner/worker.js.map +1 -1
- package/dist/checks/sanitize-result.d.ts +1 -0
- package/dist/checks/sanitize-result.d.ts.map +1 -1
- package/dist/checks/sanitize-result.js +7 -0
- package/dist/checks/sanitize-result.js.map +1 -1
- package/dist/checks/source-moves.d.ts +9 -0
- package/dist/checks/source-moves.d.ts.map +1 -0
- package/dist/checks/source-moves.js +184 -0
- package/dist/checks/source-moves.js.map +1 -0
- package/dist/checks/structural-security/adapter.d.ts.map +1 -1
- package/dist/checks/structural-security/adapter.js +35 -55
- package/dist/checks/structural-security/adapter.js.map +1 -1
- package/dist/checks/structural-security/parse-failures.d.ts +6 -0
- package/dist/checks/structural-security/parse-failures.d.ts.map +1 -0
- package/dist/checks/structural-security/parse-failures.js +76 -0
- package/dist/checks/structural-security/parse-failures.js.map +1 -0
- package/dist/checks/structural-security/parser.d.ts +18 -0
- package/dist/checks/structural-security/parser.d.ts.map +1 -0
- package/dist/checks/structural-security/parser.js +96 -0
- package/dist/checks/structural-security/parser.js.map +1 -0
- package/dist/checks/structural-security/rules.d.ts.map +1 -1
- package/dist/checks/structural-security/rules.js +67 -113
- package/dist/checks/structural-security/rules.js.map +1 -1
- package/dist/checks/typescript/compiler-host.d.ts.map +1 -1
- package/dist/checks/typescript/compiler-host.js +68 -49
- package/dist/checks/typescript/compiler-host.js.map +1 -1
- package/dist/checks/typescript/compiler-scope-graph.d.ts +11 -0
- package/dist/checks/typescript/compiler-scope-graph.d.ts.map +1 -0
- package/dist/checks/typescript/compiler-scope-graph.js +694 -0
- package/dist/checks/typescript/compiler-scope-graph.js.map +1 -0
- package/dist/checks/typescript/compiler-scope-inputs.d.ts +20 -0
- package/dist/checks/typescript/compiler-scope-inputs.d.ts.map +1 -0
- package/dist/checks/typescript/compiler-scope-inputs.js +183 -0
- package/dist/checks/typescript/compiler-scope-inputs.js.map +1 -0
- package/dist/checks/typescript/config.d.ts +3 -0
- package/dist/checks/typescript/config.d.ts.map +1 -1
- package/dist/checks/typescript/config.js +2 -2
- package/dist/checks/typescript/config.js.map +1 -1
- package/dist/checks/typescript/configuration-paths.d.ts +3 -2
- package/dist/checks/typescript/configuration-paths.d.ts.map +1 -1
- package/dist/checks/typescript/configuration-paths.js +67 -12
- package/dist/checks/typescript/configuration-paths.js.map +1 -1
- package/dist/checks/typescript/convert-diagnostic.d.ts +1 -2
- package/dist/checks/typescript/convert-diagnostic.d.ts.map +1 -1
- package/dist/checks/typescript/convert-diagnostic.js +2 -16
- package/dist/checks/typescript/convert-diagnostic.js.map +1 -1
- package/dist/checks/typescript/diagnostic-message.d.ts +3 -0
- package/dist/checks/typescript/diagnostic-message.d.ts.map +1 -0
- package/dist/checks/typescript/diagnostic-message.js +18 -0
- package/dist/checks/typescript/diagnostic-message.js.map +1 -0
- package/dist/checks/typescript/project-coverage.d.ts.map +1 -1
- package/dist/checks/typescript/project-coverage.js +3 -2
- package/dist/checks/typescript/project-coverage.js.map +1 -1
- package/dist/checks/typescript/reuse-inputs.d.ts +3 -0
- package/dist/checks/typescript/reuse-inputs.d.ts.map +1 -1
- package/dist/checks/typescript/reuse-inputs.js +14 -4
- package/dist/checks/typescript/reuse-inputs.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/checks.js +3 -3
- package/dist/commands/checks.js.map +1 -1
- package/dist/commands/diagnostics.d.ts +2 -0
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +34 -0
- package/dist/commands/diagnostics.js.map +1 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +4 -1
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/scan.d.ts +1 -0
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +31 -3
- package/dist/commands/scan.js.map +1 -1
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +6 -0
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/schema.d.ts +43 -23
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +16 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/config/settings-registry.js +2 -2
- package/dist/config/settings-registry.js.map +1 -1
- package/dist/core/types.d.ts +14 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/diagnostics/local-scan-diagnostics.d.ts +12 -0
- package/dist/diagnostics/local-scan-diagnostics.d.ts.map +1 -0
- package/dist/diagnostics/local-scan-diagnostics.js +138 -0
- package/dist/diagnostics/local-scan-diagnostics.js.map +1 -0
- package/dist/diagnostics/scan-performance.d.ts +2 -0
- package/dist/diagnostics/scan-performance.d.ts.map +1 -1
- package/dist/diagnostics/scan-performance.js +22 -20
- package/dist/diagnostics/scan-performance.js.map +1 -1
- package/dist/doctor/diagnostics.d.ts.map +1 -1
- package/dist/doctor/diagnostics.js +22 -3
- package/dist/doctor/diagnostics.js.map +1 -1
- package/dist/doctor/workspace-installation.d.ts +9 -0
- package/dist/doctor/workspace-installation.d.ts.map +1 -0
- package/dist/doctor/workspace-installation.js +165 -0
- package/dist/doctor/workspace-installation.js.map +1 -0
- package/dist/hooks/detect.d.ts +4 -0
- package/dist/hooks/detect.d.ts.map +1 -1
- package/dist/hooks/detect.js +5 -4
- package/dist/hooks/detect.js.map +1 -1
- package/dist/hooks/update-notice.d.ts +5 -0
- package/dist/hooks/update-notice.d.ts.map +1 -0
- package/dist/hooks/update-notice.js +145 -0
- package/dist/hooks/update-notice.js.map +1 -0
- package/dist/init/presentation.d.ts +2 -2
- package/dist/renderers/incomplete.d.ts +5 -1
- package/dist/renderers/incomplete.d.ts.map +1 -1
- package/dist/renderers/incomplete.js +29 -2
- package/dist/renderers/incomplete.js.map +1 -1
- package/dist/renderers/json.d.ts.map +1 -1
- package/dist/renderers/json.js +20 -3
- package/dist/renderers/json.js.map +1 -1
- package/dist/renderers/sarif.d.ts.map +1 -1
- package/dist/renderers/sarif.js +7 -0
- package/dist/renderers/sarif.js.map +1 -1
- package/dist/renderers/text.d.ts.map +1 -1
- package/dist/renderers/text.js +20 -0
- package/dist/renderers/text.js.map +1 -1
- package/dist/reporting/agent-guidance.d.ts.map +1 -1
- package/dist/reporting/agent-guidance.js +7 -0
- package/dist/reporting/agent-guidance.js.map +1 -1
- package/dist/reporting/finding-priority.d.ts +6 -0
- package/dist/reporting/finding-priority.d.ts.map +1 -0
- package/dist/reporting/finding-priority.js +69 -0
- package/dist/reporting/finding-priority.js.map +1 -0
- package/dist/reporting/fix-plan-store.d.ts +2 -5
- package/dist/reporting/fix-plan-store.d.ts.map +1 -1
- package/dist/reporting/fix-plan-store.js +2 -1
- package/dist/reporting/fix-plan-store.js.map +1 -1
- package/dist/reporting/fix-presentation.d.ts +1 -1
- package/dist/reporting/hook-update-notice.d.ts +12 -0
- package/dist/reporting/hook-update-notice.d.ts.map +1 -0
- package/dist/reporting/hook-update-notice.js +13 -0
- package/dist/reporting/hook-update-notice.js.map +1 -0
- package/dist/reporting/presentation.d.ts +3 -1
- package/dist/reporting/presentation.d.ts.map +1 -1
- package/dist/reporting/presentation.js +19 -7
- package/dist/reporting/presentation.js.map +1 -1
- package/dist/reporting/result-sections.d.ts +1 -0
- package/dist/reporting/result-sections.d.ts.map +1 -1
- package/dist/reporting/result-sections.js +12 -0
- package/dist/reporting/result-sections.js.map +1 -1
- package/dist/reporting/temporary-report-common.d.ts +13 -1
- package/dist/reporting/temporary-report-common.d.ts.map +1 -1
- package/dist/reporting/temporary-report-common.js +4 -1
- package/dist/reporting/temporary-report-common.js.map +1 -1
- package/dist/reporting/temporary-report-lifecycle.d.ts +3 -3
- package/dist/reporting/temporary-report-lifecycle.d.ts.map +1 -1
- package/dist/reporting/temporary-report-lifecycle.js +18 -4
- package/dist/reporting/temporary-report-lifecycle.js.map +1 -1
- package/dist/reporting/temporary-reports.d.ts +1 -1
- package/dist/reporting/temporary-reports.d.ts.map +1 -1
- package/dist/reporting/temporary-reports.js +22 -3
- package/dist/reporting/temporary-reports.js.map +1 -1
- package/dist/scan/analysis-session.d.ts.map +1 -1
- package/dist/scan/analysis-session.js +15 -1
- package/dist/scan/analysis-session.js.map +1 -1
- package/dist/scan/report.d.ts +6 -0
- package/dist/scan/report.d.ts.map +1 -1
- package/dist/scan/run-scan.d.ts.map +1 -1
- package/dist/scan/run-scan.js +17 -8
- package/dist/scan/run-scan.js.map +1 -1
- package/dist/service/server-connection.d.ts.map +1 -1
- package/dist/service/server-connection.js +2 -1
- package/dist/service/server-connection.js.map +1 -1
- package/dist/telemetry/schema.d.ts +45 -45
- package/dist/telemetry/state.d.ts +5 -5
- package/dist/ui/incomplete-list.d.ts.map +1 -1
- package/dist/ui/incomplete-list.js +4 -2
- package/dist/ui/incomplete-list.js.map +1 -1
- package/dist/ui/scan-result-dashboard.d.ts.map +1 -1
- package/dist/ui/scan-result-dashboard.js +7 -3
- package/dist/ui/scan-result-dashboard.js.map +1 -1
- package/docs/checks.md +106 -2
- package/docs/cli-reference.md +7 -1
- package/docs/privacy.md +15 -0
- package/docs/react-analysis.md +7 -0
- package/docs/reporting.md +43 -1
- package/docs/support.md +19 -0
- package/{node_modules/dependency-cruiser/node_modules/picomatch/LICENSE → licenses/overrides/jscpd-5.4.2-LICENSE} +5 -5
- package/licenses/overrides/napi-rs-wasm-runtime-1.2.5-LICENSE +43 -0
- package/licenses/reviewed-overrides.json +70 -0
- package/node_modules/acorn/CHANGELOG.md +14 -0
- package/node_modules/acorn/dist/acorn.js +42 -14
- package/node_modules/acorn/dist/acorn.mjs +42 -14
- package/node_modules/acorn/package.json +1 -1
- package/node_modules/dependency-cruiser/README.md +7 -8
- package/node_modules/dependency-cruiser/bin/depcruise-baseline.mjs +12 -5
- package/node_modules/dependency-cruiser/bin/{dependency-cruise.mjs → dependency-cruiser.mjs} +24 -14
- package/node_modules/dependency-cruiser/configs/rules/no-duplicate-dependency-types.cjs +1 -1
- package/node_modules/dependency-cruiser/node_modules/ignore/README.md +138 -8
- package/node_modules/dependency-cruiser/node_modules/ignore/index.d.ts +56 -20
- package/node_modules/dependency-cruiser/node_modules/ignore/index.js +1032 -229
- package/node_modules/dependency-cruiser/node_modules/ignore/legacy.js +868 -184
- package/node_modules/dependency-cruiser/node_modules/ignore/package.json +10 -4
- package/node_modules/dependency-cruiser/node_modules/semver/LICENSE +15 -0
- package/node_modules/dependency-cruiser/node_modules/semver/README.md +680 -0
- package/node_modules/dependency-cruiser/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/index.js +7 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/range.js +577 -0
- package/node_modules/dependency-cruiser/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/major.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/dependency-cruiser/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/dependency-cruiser/node_modules/semver/index.js +93 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/constants.js +67 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/re.js +223 -0
- package/node_modules/dependency-cruiser/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/node_modules/dependency-cruiser/node_modules/semver/package.json +78 -0
- package/node_modules/dependency-cruiser/node_modules/semver/preload.js +4 -0
- package/node_modules/dependency-cruiser/node_modules/semver/range.bnf +17 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/dependency-cruiser/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/dependency-cruiser/package.json +16 -10
- package/node_modules/dependency-cruiser/src/analyze/analyze-modules.mjs +5 -1
- package/node_modules/dependency-cruiser/src/analyze/index.mjs +3 -3
- package/node_modules/dependency-cruiser/src/analyze/soften-known-violations.mjs +4 -2
- package/node_modules/dependency-cruiser/src/analyze/summarize/get-stats.mjs +38 -3
- package/node_modules/dependency-cruiser/src/analyze/summarize/index.mjs +28 -105
- package/node_modules/dependency-cruiser/src/analyze/summarize/summarize-options.mjs +3 -0
- package/node_modules/dependency-cruiser/src/analyze/summarize/verify-environment.mjs +146 -0
- package/node_modules/dependency-cruiser/src/cache/cache.mjs +1 -1
- package/node_modules/dependency-cruiser/src/cache/options-compatible.mjs +3 -0
- package/node_modules/dependency-cruiser/src/cli/defaults.mjs +0 -1
- package/node_modules/dependency-cruiser/src/cli/index.mjs +11 -3
- package/node_modules/dependency-cruiser/src/cli/init-config/build-config.mjs +14 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/config-template.mjs +7 -2
- package/node_modules/dependency-cruiser/src/cli/init-config/environment-helpers.mjs +5 -1
- package/node_modules/dependency-cruiser/src/cli/init-config/get-user-input.mjs +11 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/index.mjs +1 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/normalize-init-options.mjs +1 -1
- package/node_modules/dependency-cruiser/src/cli/init-config/types.d.mts +4 -0
- package/node_modules/dependency-cruiser/src/cli/init-config/write-run-scripts-to-manifest.mjs +7 -7
- package/node_modules/dependency-cruiser/src/cli/normalize-cli-options.mjs +63 -2
- package/node_modules/dependency-cruiser/src/config-utl/extract-ts-config.mjs +1 -1
- package/node_modules/dependency-cruiser/src/extract/helpers.mjs +1 -0
- package/node_modules/dependency-cruiser/src/extract/resolve/determine-dependency-types.mjs +15 -7
- package/node_modules/dependency-cruiser/src/extract/resolve/merge-manifests.mjs +6 -3
- package/node_modules/dependency-cruiser/src/extract/swc/dependency-visitor.mjs +21 -4
- package/node_modules/dependency-cruiser/src/extract/swc/parse.mjs +14 -4
- package/node_modules/dependency-cruiser/src/extract/transpile/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/extract/transpile/meta.mjs +15 -3
- package/node_modules/dependency-cruiser/src/extract/transpile/svelte-wrap.mjs +23 -2
- package/node_modules/dependency-cruiser/src/extract/transpile/try-import-available.mjs +2 -2
- package/node_modules/dependency-cruiser/src/extract/transpile/typescript-wrap.mjs +23 -1
- package/node_modules/dependency-cruiser/src/extract/tsc/extract-typescript-deps.mjs +57 -12
- package/node_modules/dependency-cruiser/src/extract/tsc/extract.mjs +2 -0
- package/node_modules/dependency-cruiser/src/graph-utl/add-focus.mjs +2 -2
- package/node_modules/dependency-cruiser/src/graph-utl/compare.mjs +113 -14
- package/node_modules/dependency-cruiser/src/main/cruise.mjs +1 -2
- package/node_modules/dependency-cruiser/src/main/format.mjs +1 -1
- package/node_modules/dependency-cruiser/src/main/options/defaults.mjs +1 -0
- package/node_modules/dependency-cruiser/src/main/options/normalize.mjs +13 -4
- package/node_modules/dependency-cruiser/src/main/report-wrap.mjs +4 -2
- package/node_modules/dependency-cruiser/src/main/resolve-options/normalize.mjs +0 -27
- package/node_modules/dependency-cruiser/src/meta.cjs +1 -1
- package/node_modules/dependency-cruiser/src/report/anon/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/azure-devops.mjs +15 -11
- package/node_modules/dependency-cruiser/src/report/baseline.mjs +67 -10
- package/node_modules/dependency-cruiser/src/report/csv.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/dot/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/dot-webpage/dot-module.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/error-html/error-html-template.mjs +2 -0
- package/node_modules/dependency-cruiser/src/report/error-html/index.mjs +84 -8
- package/node_modules/dependency-cruiser/src/report/error.mjs +62 -13
- package/node_modules/dependency-cruiser/src/report/html/index.mjs +1 -1
- package/node_modules/dependency-cruiser/src/report/index.mjs +3 -2
- package/node_modules/dependency-cruiser/src/report/markdown.mjs +89 -19
- package/node_modules/dependency-cruiser/src/report/metrics.mjs +3 -3
- package/node_modules/dependency-cruiser/src/report/null.mjs +6 -3
- package/node_modules/dependency-cruiser/src/report/teamcity.mjs +4 -1
- package/node_modules/dependency-cruiser/src/schema/configuration.validate.mjs +1 -1
- package/node_modules/dependency-cruiser/src/schema/cruise-result.validate.mjs +1 -1
- package/node_modules/dependency-cruiser/src/utl/try-import.mjs +1 -1
- package/node_modules/dependency-cruiser/types/cruise-result.d.mts +14 -0
- package/node_modules/dependency-cruiser/types/dependency-cruiser.d.mts +6 -0
- package/node_modules/dependency-cruiser/types/options.d.mts +37 -2
- package/node_modules/dependency-cruiser/types/reporter-options.d.mts +30 -5
- package/node_modules/dependency-cruiser/types/restrictions.d.mts +2 -2
- package/node_modules/dependency-cruiser/types/shared-types.d.mts +16 -13
- package/node_modules/enhanced-resolve/README.md +46 -1
- package/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js +31 -6
- package/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js +27 -6
- package/node_modules/enhanced-resolve/lib/PackageMapPlugin.js +297 -0
- package/node_modules/enhanced-resolve/lib/Resolver.js +37 -30
- package/node_modules/enhanced-resolve/lib/ResolverFactory.js +104 -11
- package/node_modules/enhanced-resolve/lib/getPaths.js +6 -1
- package/node_modules/enhanced-resolve/lib/index.js +4 -0
- package/node_modules/enhanced-resolve/lib/util/entrypoints.js +104 -0
- package/node_modules/enhanced-resolve/lib/util/graceful-fs-browser.js +5 -1
- package/node_modules/enhanced-resolve/lib/util/identifier.js +4 -2
- package/node_modules/enhanced-resolve/lib/util/packageMap.js +224 -0
- package/node_modules/enhanced-resolve/lib/util/path.js +29 -8
- package/node_modules/enhanced-resolve/lib/util/pathToFileURL.js +87 -0
- package/node_modules/enhanced-resolve/package.json +8 -9
- package/node_modules/enhanced-resolve/types/AliasFieldPlugin.d.ts +41 -0
- package/node_modules/enhanced-resolve/types/AliasPlugin.d.ts +32 -0
- package/node_modules/enhanced-resolve/types/AliasUtils.d.ts +128 -0
- package/node_modules/enhanced-resolve/types/AppendPlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/CachedInputFileSystem.d.ts +224 -0
- package/node_modules/enhanced-resolve/types/CloneBasenamePlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/ConditionalPlugin.d.ts +33 -0
- package/node_modules/enhanced-resolve/types/DescriptionFilePlugin.d.ts +30 -0
- package/node_modules/enhanced-resolve/types/DescriptionFileUtils.d.ts +83 -0
- package/node_modules/enhanced-resolve/types/DirectoryExistsPlugin.d.ts +23 -0
- package/node_modules/enhanced-resolve/types/ExportsFieldPlugin.d.ts +45 -0
- package/node_modules/enhanced-resolve/types/ExtensionAliasPlugin.d.ts +31 -0
- package/node_modules/enhanced-resolve/types/FileExistsPlugin.d.ts +23 -0
- package/node_modules/enhanced-resolve/types/ImportsFieldPlugin.d.ts +45 -0
- package/node_modules/enhanced-resolve/types/JoinRequestPartPlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/JoinRequestPlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/LogInfoPlugin.d.ts +18 -0
- package/node_modules/enhanced-resolve/types/MainFieldPlugin.d.ts +41 -0
- package/node_modules/enhanced-resolve/types/ModulesInHierachicDirectoriesPlugin.d.ts +2 -0
- package/node_modules/enhanced-resolve/types/ModulesInHierarchicalDirectoriesPlugin.d.ts +26 -0
- package/node_modules/enhanced-resolve/types/ModulesInRootPlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/ModulesUtils.d.ts +25 -0
- package/node_modules/enhanced-resolve/types/NextPlugin.d.ts +23 -0
- package/node_modules/enhanced-resolve/types/PackageMapPlugin.d.ts +85 -0
- package/node_modules/enhanced-resolve/types/ParsePlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/PnpPlugin.d.ts +42 -0
- package/node_modules/enhanced-resolve/types/Resolver.d.ts +1545 -0
- package/node_modules/enhanced-resolve/types/ResolverFactory.d.ts +340 -0
- package/node_modules/enhanced-resolve/types/RestrictionsPlugin.d.ts +52 -0
- package/node_modules/enhanced-resolve/types/ResultPlugin.d.ts +18 -0
- package/node_modules/enhanced-resolve/types/RootsPlugin.d.ts +30 -0
- package/node_modules/enhanced-resolve/types/SelfReferencePlugin.d.ts +31 -0
- package/node_modules/enhanced-resolve/types/SymlinkPlugin.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/SyncAsyncFileSystemDecorator.d.ts +52 -0
- package/node_modules/enhanced-resolve/types/TryNextPlugin.d.ts +26 -0
- package/node_modules/enhanced-resolve/types/TsconfigPathsPlugin.d.ts +204 -0
- package/node_modules/enhanced-resolve/types/UnsafeCachePlugin.d.ts +43 -0
- package/node_modules/enhanced-resolve/types/UseFilePlugin.d.ts +27 -0
- package/node_modules/enhanced-resolve/types/createInnerContext.d.ts +10 -0
- package/node_modules/enhanced-resolve/types/forEachBail.d.ts +15 -0
- package/node_modules/enhanced-resolve/types/getInnerRequest.d.ts +7 -0
- package/node_modules/enhanced-resolve/types/getPaths.d.ts +34 -0
- package/node_modules/enhanced-resolve/types/index.d.ts +131 -0
- package/node_modules/enhanced-resolve/types/util/entrypoints.d.ts +62 -0
- package/node_modules/enhanced-resolve/types/util/fileURLToPath.d.ts +14 -0
- package/node_modules/enhanced-resolve/types/util/fs.d.ts +38 -0
- package/node_modules/enhanced-resolve/types/util/graceful-fs-browser.d.ts +22 -0
- package/node_modules/enhanced-resolve/types/util/identifier.d.ts +7 -0
- package/node_modules/enhanced-resolve/types/util/memoize.d.ts +15 -0
- package/node_modules/enhanced-resolve/types/util/module-browser.d.ts +1 -0
- package/node_modules/enhanced-resolve/types/util/packageMap.d.ts +118 -0
- package/node_modules/enhanced-resolve/types/util/path-browser.d.ts +45 -0
- package/node_modules/enhanced-resolve/types/util/path.d.ts +125 -0
- package/node_modules/enhanced-resolve/types/util/pathToFileURL.d.ts +14 -0
- package/node_modules/enhanced-resolve/types/util/process-browser.d.ts +3 -0
- package/node_modules/enhanced-resolve/types/util/strip-json-comments.d.ts +24 -0
- package/node_modules/enhanced-resolve/types/util/url-browser.d.ts +1 -0
- package/node_modules/enhanced-resolve/types.d.ts +5 -2057
- package/node_modules/is-installed-globally/index.js +26 -4
- package/node_modules/is-installed-globally/package.json +1 -1
- package/package.json +5 -5
- package/schema/zedbee.schema.json +12 -1
- package/node_modules/dependency-cruiser/node_modules/picomatch/README.md +0 -743
- package/node_modules/dependency-cruiser/node_modules/picomatch/index.js +0 -17
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/constants.js +0 -184
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/parse.js +0 -1416
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/picomatch.js +0 -361
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/scan.js +0 -391
- package/node_modules/dependency-cruiser/node_modules/picomatch/lib/utils.js +0 -72
- package/node_modules/dependency-cruiser/node_modules/picomatch/package.json +0 -83
- package/node_modules/dependency-cruiser/node_modules/picomatch/posix.js +0 -3
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { EOL } from "node:os";
|
|
2
1
|
import addRuleSetUsed from "./add-rule-set-used.mjs";
|
|
3
2
|
import summarizeModules from "./summarize-modules.mjs";
|
|
4
3
|
import summarizeFolders from "./summarize-folders.mjs";
|
|
5
4
|
import summarizeOptions from "./summarize-options.mjs";
|
|
6
5
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
getViolationCounts,
|
|
7
|
+
getModulesCruisedCount,
|
|
8
|
+
getDependenciesCruisedCount,
|
|
9
|
+
getBaselineDiffCounts,
|
|
10
10
|
} from "./get-stats.mjs";
|
|
11
11
|
import { compareViolations } from "#graph-utl/compare.mjs";
|
|
12
12
|
import { getEnvironmentInfo } from "#environment.mjs";
|
|
13
|
+
import { determineEnvironmentIssues } from "./verify-environment.mjs";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @import { IOptions, IEnvironmentIssue, ISummary, IModule, IFolder } from "../../../types/cruise-result.mjs"
|
|
@@ -17,105 +18,15 @@ import { getEnvironmentInfo } from "#environment.mjs";
|
|
|
17
18
|
* @import { IStrictCruiseOptions } from "../../../types/strict-options.mjs"
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return lSWCNeeded
|
|
28
|
-
? pAvailableTranspilers.some(
|
|
29
|
-
(pTranspiler) => pTranspiler.name === "swc" && pTranspiler.available,
|
|
30
|
-
)
|
|
31
|
-
: true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @param { IOptions } pOptions
|
|
36
|
-
* @param { IAvailableTranspiler[] } pAvailableTranspilers
|
|
37
|
-
* @returns { boolean }
|
|
38
|
-
*/
|
|
39
|
-
function typescriptIsConsistent(pOptions, pAvailableTranspilers) {
|
|
40
|
-
const lTypeScriptNeeded =
|
|
41
|
-
Boolean(pOptions?.tsConfig) ||
|
|
42
|
-
Boolean(pOptions?.tsPreCompilationDeps) ||
|
|
43
|
-
Boolean(pOptions?.detectJSDocImports) ||
|
|
44
|
-
(pOptions?.parser ?? "acorn") === "tsc";
|
|
45
|
-
return lTypeScriptNeeded
|
|
46
|
-
? pAvailableTranspilers.some(
|
|
47
|
-
(pTranspiler) =>
|
|
48
|
-
pTranspiler.name === "typescript" && pTranspiler.available,
|
|
49
|
-
)
|
|
50
|
-
: true;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* @param { IOptions } pOptions
|
|
54
|
-
* @param { IAvailableTranspiler[] } pAvailableTranspilers
|
|
55
|
-
* @returns { boolean }
|
|
56
|
-
*/
|
|
57
|
-
function babelIsConsistent(pOptions, pAvailableTranspilers) {
|
|
58
|
-
return Boolean(pOptions?.babelConfig)
|
|
59
|
-
? pAvailableTranspilers.some(
|
|
60
|
-
(pTranspiler) => pTranspiler.name === "babel" && pTranspiler.available,
|
|
61
|
-
)
|
|
62
|
-
: true;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @param {IOptions} pOptions
|
|
67
|
-
* @param {IAvailableTranspiler[]} pAvailableTranspilers
|
|
68
|
-
* @returns {{issues?: IEnvironmentIssue[]}}
|
|
69
|
-
*/
|
|
70
|
-
function determineEnvironmentIssues(pOptions, pAvailableTranspilers) {
|
|
71
|
-
const lIssues = [];
|
|
72
|
-
if (!typescriptIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
73
|
-
const tsTranspiler = pAvailableTranspilers.find(
|
|
74
|
-
(pTranspiler) => pTranspiler.name === "typescript",
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
lIssues.push({
|
|
78
|
-
severity: "warn",
|
|
79
|
-
name: "missing-typescript-transpiler",
|
|
80
|
-
description:
|
|
81
|
-
`dependency-cruiser detected a TypeScript environment,${EOL}` +
|
|
82
|
-
` but not a compatible TypeScript compiler (${tsTranspiler.name}: ${tsTranspiler.version}). This means${EOL}` +
|
|
83
|
-
` it's likely to have missed TypeScript sources and dependencies.${EOL}${EOL}` +
|
|
84
|
-
` Install typescript to get better results (e.g. npm i -D typescript@^6).${EOL}${EOL}` +
|
|
85
|
-
` => Support for typescript@>=7 will follow when its API is published and stable.${EOL}`,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
if (!swcIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
89
|
-
const swcTranspiler = pAvailableTranspilers.find(
|
|
90
|
-
(pTranspiler) => pTranspiler.name === "swc",
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
lIssues.push({
|
|
94
|
-
severity: "warn",
|
|
95
|
-
name: "missing-swc-transpiler",
|
|
96
|
-
description:
|
|
97
|
-
`dependency-cruiser found swc configured as parser, but ${EOL}` +
|
|
98
|
-
` it did not find a compatible version of swc (${swcTranspiler.name}: ${swcTranspiler.version}).${EOL}` +
|
|
99
|
-
` dependency-cruiser might have missed some sources or dependencies.${EOL}${EOL}` +
|
|
100
|
-
` Install swc (e.g. npm i -D @swc/core) to get better results.${EOL}`,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
if (!babelIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
104
|
-
const babelTranspiler = pAvailableTranspilers.find(
|
|
105
|
-
(pTranspiler) => pTranspiler.name === "babel",
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
lIssues.push({
|
|
109
|
-
severity: "warn",
|
|
110
|
-
name: "missing-babel-transpiler",
|
|
111
|
-
description:
|
|
112
|
-
`dependency-cruiser detected a babel configuration, but not a${EOL}` +
|
|
113
|
-
` compatible babel transpiler (${babelTranspiler.name}: ${babelTranspiler.version}). If you indeed use babel,${EOL}` +
|
|
114
|
-
` dependency-cruiser might have missed some sources or dependencies.${EOL}${EOL}` +
|
|
115
|
-
` Install babel (e.g. npm i -D @babel/core@^7) to get better results.${EOL}`,
|
|
116
|
-
});
|
|
21
|
+
function getAdvisedExitCode(
|
|
22
|
+
pErrorCount,
|
|
23
|
+
pBaselineStaleCount,
|
|
24
|
+
pStaleEntriesSeverity,
|
|
25
|
+
) {
|
|
26
|
+
if ((pStaleEntriesSeverity ?? "warn") === "error") {
|
|
27
|
+
return pErrorCount + (pBaselineStaleCount ?? 0);
|
|
117
28
|
}
|
|
118
|
-
return
|
|
29
|
+
return pErrorCount;
|
|
119
30
|
}
|
|
120
31
|
|
|
121
32
|
/**
|
|
@@ -149,11 +60,23 @@ export default function summarize(
|
|
|
149
60
|
...lEnvironment,
|
|
150
61
|
...determineEnvironmentIssues(pOptions, lEnvironment.transpilersFound),
|
|
151
62
|
};
|
|
63
|
+
const lViolationCounts = getViolationCounts(lViolations);
|
|
64
|
+
const lBaselineDiffCounts = pOptions.knownViolations
|
|
65
|
+
? getBaselineDiffCounts(pOptions.knownViolations, lViolations)
|
|
66
|
+
: {};
|
|
67
|
+
const lAdvisedExitCode = getAdvisedExitCode(
|
|
68
|
+
lViolationCounts.error,
|
|
69
|
+
lBaselineDiffCounts?.baselineStale,
|
|
70
|
+
pOptions?.baseline?.staleEntriesSeverity,
|
|
71
|
+
);
|
|
72
|
+
|
|
152
73
|
return {
|
|
153
74
|
violations: lViolations,
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
|
|
75
|
+
...lViolationCounts,
|
|
76
|
+
...lBaselineDiffCounts,
|
|
77
|
+
advisedExitCode: lAdvisedExitCode,
|
|
78
|
+
totalCruised: getModulesCruisedCount(pModules),
|
|
79
|
+
totalDependenciesCruised: getDependenciesCruisedCount(pModules),
|
|
157
80
|
...summarizeOptions(pFileDirectoryArray, pOptions),
|
|
158
81
|
...(pOptions.ruleSet ? { ruleSetUsed: addRuleSetUsed(pOptions) } : {}),
|
|
159
82
|
environment: lEnvironmentWithIssues,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const SHAREABLE_OPTIONS = [
|
|
2
2
|
"babelConfig",
|
|
3
3
|
"baseDir",
|
|
4
|
+
"baseline",
|
|
4
5
|
"cache",
|
|
5
6
|
"collapse",
|
|
6
7
|
"combinedDependencies",
|
|
8
|
+
"detectImportsInAmbientModules",
|
|
7
9
|
"detectJSDocImports",
|
|
8
10
|
"detectProcessBuiltinModuleCalls",
|
|
9
11
|
"doNotFollow",
|
|
@@ -15,6 +17,7 @@ const SHAREABLE_OPTIONS = [
|
|
|
15
17
|
"externalModuleResolutionStrategy",
|
|
16
18
|
"focus",
|
|
17
19
|
"focusDepth",
|
|
20
|
+
"ignoreKnown",
|
|
18
21
|
"includeOnly",
|
|
19
22
|
"knownViolations",
|
|
20
23
|
"maxDepth",
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { EOL } from "node:os";
|
|
2
|
+
/**
|
|
3
|
+
* @import { IOptions, IEnvironmentIssue } from "../../../types/cruise-result.mjs"
|
|
4
|
+
* @import { IAvailableTranspiler } from "../../../types/environment.mjs"
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param { IOptions } pOptions
|
|
9
|
+
* @param { IAvailableTranspiler[] } pAvailableTranspilers
|
|
10
|
+
* @returns { boolean }
|
|
11
|
+
*/
|
|
12
|
+
function swcIsConsistent(pOptions, pAvailableTranspilers) {
|
|
13
|
+
const lSWCNeeded = (pOptions?.parser ?? "acorn") === "swc";
|
|
14
|
+
return lSWCNeeded
|
|
15
|
+
? pAvailableTranspilers.some(
|
|
16
|
+
(pTranspiler) => pTranspiler.name === "swc" && pTranspiler.available,
|
|
17
|
+
)
|
|
18
|
+
: true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param { IOptions } pOptions
|
|
23
|
+
* @param { IAvailableTranspiler[] } pAvailableTranspilers
|
|
24
|
+
* @returns { boolean }
|
|
25
|
+
*/
|
|
26
|
+
function tscIsConsistent(pOptions, pAvailableTranspilers) {
|
|
27
|
+
const lTSCNeeded =
|
|
28
|
+
Boolean(pOptions?.tsPreCompilationDeps) ||
|
|
29
|
+
Boolean(pOptions?.detectJSDocImports) ||
|
|
30
|
+
(pOptions?.parser ?? "acorn") === "tsc";
|
|
31
|
+
return lTSCNeeded
|
|
32
|
+
? pAvailableTranspilers.some(
|
|
33
|
+
(pTranspiler) =>
|
|
34
|
+
pTranspiler.name === "typescript" && pTranspiler.available,
|
|
35
|
+
)
|
|
36
|
+
: true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function typeScriptIsConsistent(pOptions, pAvailableTranspilers) {
|
|
40
|
+
const lTypeScriptNeeded =
|
|
41
|
+
Boolean(pOptions?.tsConfig) &&
|
|
42
|
+
!(
|
|
43
|
+
// these two options require tsc (covered in tscIsConsistent), so
|
|
44
|
+
// to prevent typeScriptIsConsistent from also firing (and printing
|
|
45
|
+
// two messages) we exclude them here
|
|
46
|
+
Boolean(pOptions?.tsPreCompilationDeps) ||
|
|
47
|
+
Boolean(pOptions?.detectJSDocImports)
|
|
48
|
+
);
|
|
49
|
+
return lTypeScriptNeeded
|
|
50
|
+
? pAvailableTranspilers.some(
|
|
51
|
+
(pTranspiler) =>
|
|
52
|
+
(pTranspiler.name === "typescript" ||
|
|
53
|
+
(pTranspiler.name === "swc" && pOptions?.parser === "swc")) &&
|
|
54
|
+
pTranspiler.available,
|
|
55
|
+
)
|
|
56
|
+
: true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @param { IOptions } pOptions
|
|
61
|
+
* @param { IAvailableTranspiler[] } pAvailableTranspilers
|
|
62
|
+
* @returns { boolean }
|
|
63
|
+
*/
|
|
64
|
+
function babelIsConsistent(pOptions, pAvailableTranspilers) {
|
|
65
|
+
return Boolean(pOptions?.babelConfig)
|
|
66
|
+
? pAvailableTranspilers.some(
|
|
67
|
+
(pTranspiler) => pTranspiler.name === "babel" && pTranspiler.available,
|
|
68
|
+
)
|
|
69
|
+
: true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @param {IOptions} pOptions
|
|
74
|
+
* @param {IAvailableTranspiler[]} pAvailableTranspilers
|
|
75
|
+
* @returns {{issues?: IEnvironmentIssue[]}}
|
|
76
|
+
*/
|
|
77
|
+
export function determineEnvironmentIssues(pOptions, pAvailableTranspilers) {
|
|
78
|
+
const lIssues = [];
|
|
79
|
+
if (!tscIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
80
|
+
const tsTranspiler = pAvailableTranspilers.find(
|
|
81
|
+
(pTranspiler) => pTranspiler.name === "typescript",
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
lIssues.push({
|
|
85
|
+
severity: "warn",
|
|
86
|
+
name: "missing-tsc-transpiler",
|
|
87
|
+
description:
|
|
88
|
+
`dependency-cruiser detected a TypeScript environment,${EOL}` +
|
|
89
|
+
` but not a compatible TypeScript compiler (${tsTranspiler.name}: ${tsTranspiler.version}). This means${EOL}` +
|
|
90
|
+
` it's likely to have missed TypeScript sources and dependencies.${EOL}${EOL}` +
|
|
91
|
+
` Install typescript to get better results (e.g. npm i -D typescript@^6).${EOL}${EOL}` +
|
|
92
|
+
` => Support for typescript@>=7 will follow when its API is published and stable.${EOL}`,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (!typeScriptIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
96
|
+
const tsTranspilersString = pAvailableTranspilers
|
|
97
|
+
.filter(
|
|
98
|
+
(pTranspiler) =>
|
|
99
|
+
pTranspiler.name === "typescript" || pTranspiler.name === "swc",
|
|
100
|
+
)
|
|
101
|
+
.map((pTranspiler) => `${pTranspiler.name}: ${pTranspiler.version}`)
|
|
102
|
+
.join(", ");
|
|
103
|
+
lIssues.push({
|
|
104
|
+
severity: "warn",
|
|
105
|
+
name: "missing-typescript-transpiler",
|
|
106
|
+
description:
|
|
107
|
+
`dependency-cruiser detected an environment that needs a TypeScript compiler of some sort,${EOL}` +
|
|
108
|
+
` but did not find one of the supported ones (${tsTranspilersString}).${EOL}` +
|
|
109
|
+
` This means it's likely to have missed TypeScript sources and dependencies.${EOL}${EOL}` +
|
|
110
|
+
` Install one of the above for better results.${EOL}${EOL}` +
|
|
111
|
+
` => if you choose to use swc don't forget to set the "parser" option to "swc"${EOL}` +
|
|
112
|
+
` => Support for typescript@>=7 will follow when its API is published and stable.${EOL}`,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (!swcIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
116
|
+
const swcTranspiler = pAvailableTranspilers.find(
|
|
117
|
+
(pTranspiler) => pTranspiler.name === "swc",
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
lIssues.push({
|
|
121
|
+
severity: "warn",
|
|
122
|
+
name: "missing-swc-transpiler",
|
|
123
|
+
description:
|
|
124
|
+
`dependency-cruiser found swc configured as compiler, but ${EOL}` +
|
|
125
|
+
` it did not find a compatible version of swc (${swcTranspiler.name}: ${swcTranspiler.version}).${EOL}` +
|
|
126
|
+
` dependency-cruiser might have missed some sources or dependencies.${EOL}${EOL}` +
|
|
127
|
+
` Install swc (e.g. npm i -D @swc/core) to get better results.${EOL}`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (!babelIsConsistent(pOptions, pAvailableTranspilers)) {
|
|
131
|
+
const babelTranspiler = pAvailableTranspilers.find(
|
|
132
|
+
(pTranspiler) => pTranspiler.name === "babel",
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
lIssues.push({
|
|
136
|
+
severity: "warn",
|
|
137
|
+
name: "missing-babel-transpiler",
|
|
138
|
+
description:
|
|
139
|
+
`dependency-cruiser detected a babel configuration, but not a${EOL}` +
|
|
140
|
+
` compatible babel transpiler (${babelTranspiler.name}: ${babelTranspiler.version}). If you indeed use babel,${EOL}` +
|
|
141
|
+
` dependency-cruiser might have missed some sources or dependencies.${EOL}${EOL}` +
|
|
142
|
+
` Install babel (e.g. npm i -D @babel/core@^7) to get better results.${EOL}`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return lIssues.length > 0 ? { issues: lIssues } : {};
|
|
146
|
+
}
|
|
@@ -33,7 +33,7 @@ const EMPTY_CACHE = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// see ./cache-rationales.md#cache-format-versioning for rationale & bump instructions
|
|
36
|
-
const CACHE_FORMAT_VERSION = 18.
|
|
36
|
+
const CACHE_FORMAT_VERSION = 18.5;
|
|
37
37
|
|
|
38
38
|
export default class Cache {
|
|
39
39
|
/** @type {(IRevisionData | null)=} */
|
|
@@ -52,10 +52,13 @@ export function optionsAreCompatible(pOldOptions, pNewOptions) {
|
|
|
52
52
|
pOldOptions.preserveSymlinks === pNewOptions.preserveSymlinks &&
|
|
53
53
|
pOldOptions.combinedDependencies === pNewOptions.combinedDependencies &&
|
|
54
54
|
pOldOptions.experimentalStats === pNewOptions.experimentalStats &&
|
|
55
|
+
pOldOptions.detectImportsInAmbientModules ===
|
|
56
|
+
pNewOptions.detectImportsInAmbientModules &&
|
|
55
57
|
pOldOptions.detectJSDocImports === pNewOptions.detectJSDocImports &&
|
|
56
58
|
pOldOptions.detectProcessBuiltinModuleCalls ===
|
|
57
59
|
pNewOptions.detectProcessBuiltinModuleCalls &&
|
|
58
60
|
pOldOptions.skipAnalysisNotInRules === pNewOptions.skipAnalysisNotInRules &&
|
|
61
|
+
pOldOptions.ignoreKnown === pNewOptions.ignoreKnown &&
|
|
59
62
|
metricsIsCompatible(pOldOptions.metrics, pNewOptions.metrics) &&
|
|
60
63
|
// includeOnly suffers from a backwards compatibility disease
|
|
61
64
|
includeOnlyIsCompatible(pOldOptions.includeOnly, pNewOptions.includeOnly) &&
|
|
@@ -12,6 +12,7 @@ import setUpNDJSONListener from "./listeners/ndjson.mjs";
|
|
|
12
12
|
import { set } from "#utl/object-util.mjs";
|
|
13
13
|
import cruise from "#main/cruise.mjs";
|
|
14
14
|
import { INFO, bus } from "#utl/bus.mjs";
|
|
15
|
+
import { EOL } from "node:os";
|
|
15
16
|
|
|
16
17
|
// eslint-disable-next-line complexity
|
|
17
18
|
async function extractResolveOptions(pCruiseOptions) {
|
|
@@ -96,9 +97,9 @@ function setUpListener(pCruiseOptions) {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
async function runCruise(pFileDirectoryArray, pCruiseOptions) {
|
|
100
|
+
async function runCruise(pFileDirectoryArray, pCruiseOptions, pErrorStream) {
|
|
100
101
|
const lCruiseOptions = await addKnownViolations(
|
|
101
|
-
await normalizeCliOptions(pCruiseOptions),
|
|
102
|
+
await normalizeCliOptions(pCruiseOptions, pErrorStream),
|
|
102
103
|
);
|
|
103
104
|
|
|
104
105
|
pFileDirectoryArray
|
|
@@ -128,6 +129,9 @@ async function runCruise(pFileDirectoryArray, pCruiseOptions) {
|
|
|
128
129
|
bus.progress("cli: writing results", { complete: 1 });
|
|
129
130
|
bus.emit("write-start");
|
|
130
131
|
write(lCruiseOptions.outputTo, lReportingResult.output);
|
|
132
|
+
if (lReportingResult.meta) {
|
|
133
|
+
pErrorStream.write(`${lReportingResult.meta}${EOL}`);
|
|
134
|
+
}
|
|
131
135
|
|
|
132
136
|
return lReportingResult.exitCode;
|
|
133
137
|
}
|
|
@@ -179,7 +183,11 @@ export default async function executeCli(
|
|
|
179
183
|
const { default: initConfig } = await import("./init-config/index.mjs");
|
|
180
184
|
initConfig(lCruiseOptions.init, null, lStreams);
|
|
181
185
|
} else {
|
|
182
|
-
lExitCode = await runCruise(
|
|
186
|
+
lExitCode = await runCruise(
|
|
187
|
+
pFileDirectoryArray,
|
|
188
|
+
lCruiseOptions,
|
|
189
|
+
lStreams.stderr,
|
|
190
|
+
);
|
|
183
191
|
}
|
|
184
192
|
} catch (pError) {
|
|
185
193
|
lStreams.stderr.write(
|
|
@@ -73,6 +73,16 @@ function buildDetectJSDocumentImportsAttribute(pInitOptions) {
|
|
|
73
73
|
: "// detectJSDocImports: true,";
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* @param {IInitConfig} pInitOptions
|
|
78
|
+
* @returns {string}
|
|
79
|
+
*/
|
|
80
|
+
function buildDetectImportsInAmbientModulesAttribute(pInitOptions) {
|
|
81
|
+
return pInitOptions.detectImportsInAmbientModules
|
|
82
|
+
? "detectImportsInAmbientModules: true,"
|
|
83
|
+
: "// detectImportsInAmbientModules: true,";
|
|
84
|
+
}
|
|
85
|
+
|
|
76
86
|
/**
|
|
77
87
|
*
|
|
78
88
|
* @param {IInitConfig} pInitOptions
|
|
@@ -224,6 +234,10 @@ export default function buildConfig(pInitOptions) {
|
|
|
224
234
|
"{{detectJSDocImportsAttribute}}",
|
|
225
235
|
buildDetectJSDocumentImportsAttribute(pInitOptions),
|
|
226
236
|
)
|
|
237
|
+
.replace(
|
|
238
|
+
"{{detectImportsInAmbientModulesAttribute}}",
|
|
239
|
+
buildDetectImportsInAmbientModulesAttribute(pInitOptions),
|
|
240
|
+
)
|
|
227
241
|
.replace(
|
|
228
242
|
"{{detectProcessBuiltinModuleCalls}}",
|
|
229
243
|
buildDetectProcessBuiltinModuleCalls(pInitOptions),
|
|
@@ -112,7 +112,7 @@ module.exports = {
|
|
|
112
112
|
name: 'no-duplicate-dep-types',
|
|
113
113
|
comment:
|
|
114
114
|
"Likely this module depends on an external ('npm') package that occurs more than once " +
|
|
115
|
-
"in your package.json i.e.
|
|
115
|
+
"in your package.json i.e. both as a devDependencies and in dependencies. This will cause " +
|
|
116
116
|
"maintenance problems later on.",
|
|
117
117
|
severity: 'warn',
|
|
118
118
|
from: {},
|
|
@@ -227,6 +227,11 @@ module.exports = {
|
|
|
227
227
|
// to be installed in the same spot you run dependency-cruiser from.
|
|
228
228
|
{{detectJSDocImportsAttribute}}
|
|
229
229
|
|
|
230
|
+
// false: don't look at imports in ambient module declarations (the default)
|
|
231
|
+
// true: detect imports, re-exports and import-equals declarations inside
|
|
232
|
+
// ambient modules and namespaces. Implies parser: 'tsc'.
|
|
233
|
+
{{detectImportsInAmbientModulesAttribute}}
|
|
234
|
+
|
|
230
235
|
// false: don't look at process.getBuiltinModule calls (the default)
|
|
231
236
|
// true: dependency-cruiser will detect calls to process.getBuiltinModule/
|
|
232
237
|
// globalThis.process.getBuiltinModule as imports.
|
|
@@ -304,7 +309,7 @@ module.exports = {
|
|
|
304
309
|
conditionNames: ['import', 'require', 'node', 'default', 'types'],
|
|
305
310
|
|
|
306
311
|
// The extensions, by default are the same as the ones dependency-cruiser
|
|
307
|
-
// can access (run \`npx
|
|
312
|
+
// can access (run \`npx dependency-cruiser --info\` to see which ones that are in
|
|
308
313
|
// _your_ environment). If that list is larger than you need you can pass
|
|
309
314
|
// the extensions you actually use (e.g. ['.js', '.jsx']). This can speed
|
|
310
315
|
// up module resolution, which is the most expensive step.
|
|
@@ -105,6 +105,10 @@ export function isLikelyMonoRepo(pFolderNames = getFolderNames(process.cwd())) {
|
|
|
105
105
|
return pFolderNames.includes("packages");
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* @param {Record<string,any>} [pManifest]
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
108
112
|
function getPackageManager(pManifest) {
|
|
109
113
|
let lReturnValue = "";
|
|
110
114
|
try {
|
|
@@ -119,7 +123,7 @@ function getPackageManager(pManifest) {
|
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
/**
|
|
122
|
-
* @param {Record<string,any>} pManifest
|
|
126
|
+
* @param {Record<string,any>} [pManifest]
|
|
123
127
|
* @returns {boolean}
|
|
124
128
|
*/
|
|
125
129
|
export function likelyUsesBun(pManifest) {
|
|
@@ -21,6 +21,10 @@ import {
|
|
|
21
21
|
import { validateLocation } from "./validators.mjs";
|
|
22
22
|
import { isAvailable as tscIsAvailable } from "#extract/tsc/parse.mjs";
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @param {string} pString
|
|
26
|
+
* @returns {{title:string;value:string}}
|
|
27
|
+
*/
|
|
24
28
|
function toPromptChoice(pString) {
|
|
25
29
|
return {
|
|
26
30
|
title: pString,
|
|
@@ -116,6 +120,13 @@ const QUESTIONS = [
|
|
|
116
120
|
message: "Do you want to detect JSDoc imports (slightly slower)?",
|
|
117
121
|
initial: false,
|
|
118
122
|
},
|
|
123
|
+
{
|
|
124
|
+
name: "detectImportsInAmbientModules",
|
|
125
|
+
type: () => (tscIsAvailable() ? "confirm" : false),
|
|
126
|
+
message:
|
|
127
|
+
"Do you want to detect imports inside ambient modules (slightly slower)?",
|
|
128
|
+
initial: false,
|
|
129
|
+
},
|
|
119
130
|
{
|
|
120
131
|
name: "detectProcessBuiltinModuleCalls",
|
|
121
132
|
type: "confirm",
|
|
@@ -46,6 +46,7 @@ function getOneShotConfig(pOneShotConfigId) {
|
|
|
46
46
|
useTsConfig: hasTSConfigCandidates(),
|
|
47
47
|
tsConfig: getTSConfigCandidates().shift(),
|
|
48
48
|
detectJSDocImports: false,
|
|
49
|
+
detectImportsInAmbientModules: false,
|
|
49
50
|
detectProcessBuiltinModuleCalls: true,
|
|
50
51
|
tsPreCompilationDeps: hasTSConfigCandidates(),
|
|
51
52
|
useWebpackConfig: hasWebpackConfigCandidates(),
|
|
@@ -20,7 +20,7 @@ function usesTypeScript(pInitOptions, pExtensions) {
|
|
|
20
20
|
return Boolean(
|
|
21
21
|
pInitOptions.tsConfig ||
|
|
22
22
|
pInitOptions.tsPreCompilationDeps ||
|
|
23
|
-
(pExtensions || []).some((pExtension) =>
|
|
23
|
+
(pExtensions /* c8 ignore next */ || []).some((pExtension) =>
|
|
24
24
|
[".ts", ".tsx", ".d.ts", ".mts", ".d.mts", ".cts", ".d.cts"].includes(
|
|
25
25
|
pExtension,
|
|
26
26
|
),
|
|
@@ -36,6 +36,10 @@ export interface IInitConfig {
|
|
|
36
36
|
* Whether or not to detect JSDoc imports
|
|
37
37
|
*/
|
|
38
38
|
detectJSDocImports?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether or not to detect imports in ambient module and namespace declarations
|
|
41
|
+
*/
|
|
42
|
+
detectImportsInAmbientModules?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Whether or not to detect calls to `process.getBuiltinModule`/
|
|
41
45
|
* `globalThis.process.getBuiltinModule` as imports
|
package/node_modules/dependency-cruiser/src/cli/init-config/write-run-scripts-to-manifest.mjs
CHANGED
|
@@ -71,13 +71,13 @@ export function compileRunScripts(pInitOptions) {
|
|
|
71
71
|
const lTestLocations = (pInitOptions.testLocation || []).join(" ");
|
|
72
72
|
|
|
73
73
|
lReturnValue = {
|
|
74
|
-
depcruise: `
|
|
75
|
-
"depcruise:graph": `
|
|
76
|
-
"depcruise:graph:dev": `
|
|
77
|
-
"depcruise:graph:archi": `
|
|
78
|
-
"depcruise:html": `
|
|
79
|
-
"depcruise:text": `
|
|
80
|
-
"depcruise:focus": `
|
|
74
|
+
depcruise: `dependency-cruiser ${lSourceLocations} ${lTestLocations}`,
|
|
75
|
+
"depcruise:graph": `dependency-cruiser ${lSourceLocations} --include-only '${lSourceLocationRE}' --output-type dot-webpage > dependency-graph.html`,
|
|
76
|
+
"depcruise:graph:dev": `dependency-cruiser ${lSourceLocations} --include-only '${lSourceLocationRE}' --prefix vscode://file/$(pwd)/ --output-type dot-webpage | browser`,
|
|
77
|
+
"depcruise:graph:archi": `dependency-cruiser ${lSourceLocations} --include-only '${lSourceLocationRE}' --output-type archi | dot -T svg | depcruise-wrap-stream-in-html > high-level-dependency-graph.html`,
|
|
78
|
+
"depcruise:html": `dependency-cruiser ${lSourceLocations} ${lTestLocations} --progress --output-type err-html --output-to dependency-violation-report.html`,
|
|
79
|
+
"depcruise:text": `dependency-cruiser ${lSourceLocations} ${lTestLocations} --progress --output-type text`,
|
|
80
|
+
"depcruise:focus": `dependency-cruiser ${lSourceLocations} ${lTestLocations} --progress --output-type text --focus`,
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { accessSync, constants } from "node:fs";
|
|
2
2
|
import { isAbsolute } from "node:path";
|
|
3
|
+
import { styleText } from "node:util";
|
|
3
4
|
import {
|
|
4
5
|
RULES_FILE_NAME_SEARCH_ARRAY,
|
|
5
6
|
DEFAULT_BASELINE_FILE_NAME,
|
|
@@ -12,11 +13,31 @@ import {
|
|
|
12
13
|
} from "./defaults.mjs";
|
|
13
14
|
import { set } from "#utl/object-util.mjs";
|
|
14
15
|
import loadConfig from "#config-utl/extract-depcruise-config/index.mjs";
|
|
16
|
+
import extractKnownViolations from "#config-utl/extract-known-violations.mjs";
|
|
15
17
|
|
|
16
18
|
function getOptionValue(pDefault) {
|
|
17
19
|
return (pValue) => (typeof pValue === "string" ? pValue : pDefault);
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
async function getCurrentBaseline(pBaselineFileName, pErrorStream) {
|
|
23
|
+
let lCurrentBaseline = [];
|
|
24
|
+
try {
|
|
25
|
+
lCurrentBaseline = await extractKnownViolations(pBaselineFileName);
|
|
26
|
+
} catch (pKnownViolationsExtractionError) {
|
|
27
|
+
if (pKnownViolationsExtractionError.code === "ENOENT") {
|
|
28
|
+
pErrorStream.write(
|
|
29
|
+
styleText(
|
|
30
|
+
"yellow",
|
|
31
|
+
`‼ Known violations file '${pBaselineFileName}' does not exist yet. Will assume an empty current violations set and create a new one instead.\n`,
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
} else {
|
|
35
|
+
throw pKnownViolationsExtractionError;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return lCurrentBaseline;
|
|
39
|
+
}
|
|
40
|
+
|
|
20
41
|
// eslint-disable-next-line complexity
|
|
21
42
|
function normalizeConfigFileName(pCliOptions, pConfigWrapperName, pDefault) {
|
|
22
43
|
const lOptions = structuredClone(pCliOptions);
|
|
@@ -108,6 +129,12 @@ function validateAndGetKnownViolationsFileName(pKnownViolations) {
|
|
|
108
129
|
}
|
|
109
130
|
}
|
|
110
131
|
|
|
132
|
+
function normalizeIgnoreKnown(pCliOptions) {
|
|
133
|
+
return Object.hasOwn(pCliOptions, "ignoreKnown")
|
|
134
|
+
? { ignoreKnown: !!pCliOptions.ignoreKnown }
|
|
135
|
+
: {};
|
|
136
|
+
}
|
|
137
|
+
|
|
111
138
|
function normalizeKnownViolationsOption(pCliOptions) {
|
|
112
139
|
if (
|
|
113
140
|
!Object.hasOwn(pCliOptions, "ignoreKnown") ||
|
|
@@ -196,11 +223,15 @@ function normalizeCache(pCliOptions) {
|
|
|
196
223
|
* returns the pOptionsAsPassedFromCommander, so that the returned value contains a
|
|
197
224
|
* valid value for each possible option
|
|
198
225
|
*
|
|
199
|
-
* @param
|
|
226
|
+
* @param {object} pOptionsAsPassedFromCommander [description]
|
|
200
227
|
* @param {any} pKnownCliOptions [description]
|
|
228
|
+
* @param {typeof process.stderr} pErrorStream
|
|
201
229
|
* @returns {import("../../types/options.mjs").ICruiseOptions} [description]
|
|
202
230
|
*/
|
|
203
|
-
export default async function normalizeOptions(
|
|
231
|
+
export default async function normalizeOptions(
|
|
232
|
+
pOptionsAsPassedFromCommander,
|
|
233
|
+
pErrorStream,
|
|
234
|
+
) {
|
|
204
235
|
let lOptions = {
|
|
205
236
|
outputTo: OUTPUT_TO,
|
|
206
237
|
outputType: OUTPUT_TYPE,
|
|
@@ -217,11 +248,41 @@ export default async function normalizeOptions(pOptionsAsPassedFromCommander) {
|
|
|
217
248
|
lOptions.validate = lOptions.config;
|
|
218
249
|
}
|
|
219
250
|
|
|
251
|
+
if (Object.hasOwn(lOptions, "baseline")) {
|
|
252
|
+
const lBaselineFileName =
|
|
253
|
+
typeof pOptionsAsPassedFromCommander.baseline === "string"
|
|
254
|
+
? pOptionsAsPassedFromCommander.baseline
|
|
255
|
+
: ".dependency-cruiser-known-violations.json";
|
|
256
|
+
|
|
257
|
+
// keeping the baseline option (a boolean or a string) as passed from commander
|
|
258
|
+
// in would overwrite the option as passed in the configuration file (an object,
|
|
259
|
+
// if any)
|
|
260
|
+
Reflect.deleteProperty(lOptions, "baseline");
|
|
261
|
+
|
|
262
|
+
lOptions.ignoreKnown = false;
|
|
263
|
+
lOptions.outputTo = lBaselineFileName;
|
|
264
|
+
lOptions.outputType = "baseline";
|
|
265
|
+
lOptions.knownViolations = await getCurrentBaseline(
|
|
266
|
+
lBaselineFileName,
|
|
267
|
+
pErrorStream,
|
|
268
|
+
);
|
|
269
|
+
lOptions.cache = false;
|
|
270
|
+
Reflect.deleteProperty(lOptions, "cacheStrategy");
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (Object.hasOwn(lOptions, "baselineMode")) {
|
|
274
|
+
lOptions.baseline = {
|
|
275
|
+
...lOptions.baseline,
|
|
276
|
+
mode: lOptions.baselineMode,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
220
280
|
lOptions = { ...lOptions, ...(await normalizeValidationOption(lOptions)) };
|
|
221
281
|
lOptions = { ...lOptions, ...normalizeProgress(lOptions) };
|
|
222
282
|
lOptions = { ...lOptions, ...normalizeCache(lOptions) };
|
|
223
283
|
lOptions = { ...lOptions, ...normalizeCacheStrategy(lOptions) };
|
|
224
284
|
lOptions = { ...lOptions, ...normalizeKnownViolationsOption(lOptions) };
|
|
285
|
+
lOptions = { ...lOptions, ...normalizeIgnoreKnown(lOptions) };
|
|
225
286
|
lOptions = normalizeConfigFileName(lOptions, "webpackConfig", WEBPACK_CONFIG);
|
|
226
287
|
lOptions = normalizeConfigFileName(lOptions, "tsConfig", TYPESCRIPT_CONFIG);
|
|
227
288
|
lOptions = normalizeConfigFileName(lOptions, "babelConfig", BABEL_CONFIG);
|