@mocoto/mahoraga 0.14.1 → 0.14.3
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/README.md +0 -34
- package/dist/analysts/architects/analyst-structure.js +20 -20
- package/dist/analysts/architects/archetypes-custom.js +16 -19
- package/dist/analysts/architects/detector-archetypes.js +43 -36
- package/dist/analysts/architects/orchestrator-archetypes.js +3 -3
- package/dist/analysts/architects/signals-project-advanced.js +26 -28
- package/dist/analysts/architects/signals-project.js +2 -2
- package/dist/analysts/architects/strategist-structure.js +47 -66
- package/dist/analysts/azure-pipelines/analysts/analyst-azure.js +41 -35
- package/dist/analysts/azure-pipelines/corrections/correction-azure.js +22 -19
- package/dist/analysts/azure-pipelines/detectors/detector-azure-performance.js +21 -18
- package/dist/analysts/azure-pipelines/detectors/detector-azure-security.js +25 -20
- package/dist/analysts/azure-pipelines/detectors/detector-azure-structure.js +39 -40
- package/dist/analysts/azure-pipelines/scorers/scorer-azure.js +10 -7
- package/dist/analysts/circleci/analysts/analyst-circleci.js +33 -27
- package/dist/analysts/circleci/corrections/correction-circleci.js +22 -20
- package/dist/analysts/circleci/detectors/detector-circleci-performance.js +23 -19
- package/dist/analysts/circleci/detectors/detector-circleci-security.js +78 -82
- package/dist/analysts/circleci/detectors/detector-circleci-structure.js +22 -22
- package/dist/analysts/converters/convert-registry.js +1 -1
- package/dist/analysts/converters/engines/converter-gha-to-gitlab.js +17 -15
- package/dist/analysts/converters/index.js +1 -1
- package/dist/analysts/corrections/analyst-quick-fixes.js +25 -28
- package/dist/analysts/corrections/analyst-scoring.js +24 -21
- package/dist/analysts/corrections/auto-fix-engine.js +1 -1
- package/dist/analysts/corrections/corrector-structure.js +43 -42
- package/dist/analysts/corrections/fix-alias-imports.js +10 -6
- package/dist/analysts/corrections/fix-md-fences.js +23 -23
- package/dist/analysts/corrections/map-reversion.js +56 -53
- package/dist/analysts/corrections/pruning.js +19 -16
- package/dist/analysts/corrections/quick-fixes/fix-any-to-proper-type.js +57 -61
- package/dist/analysts/corrections/quick-fixes/fix-unknown-to-specific-type.js +30 -30
- package/dist/analysts/corrections/reorganize-barrels.js +13 -13
- package/dist/analysts/corrections/rewrite-testes-aliases.js +23 -22
- package/dist/analysts/corrections/scoring-shared.js +19 -18
- package/dist/analysts/corrections/type-safety/context-analyzer.js +15 -10
- package/dist/analysts/corrections/type-safety/type-analyzer.js +3 -3
- package/dist/analysts/corrections/type-safety/type-validator.js +4 -3
- package/dist/analysts/corrections/type-safety/usage-analyzer.js +39 -42
- package/dist/analysts/css/analysts/analyst-css.js +42 -42
- package/dist/analysts/css/corrections/correction-css.js +19 -11
- package/dist/analysts/css/detectors/detector-css-best-practices.js +129 -118
- package/dist/analysts/css/scorers/scorer-css.js +23 -18
- package/dist/analysts/css-in-js/analysts/analyst-css-in-js.js +24 -17
- package/dist/analysts/css-in-js/corrections/correction-css-in-js.js +31 -16
- package/dist/analysts/css-in-js/detectors/detector-css-in-js-best-practices.js +28 -30
- package/dist/analysts/css-in-js/scorers/scorer-css-in-js.js +79 -54
- package/dist/analysts/css-in-js/shared.js +7 -0
- package/dist/analysts/detectors/detector-architecture.js +91 -85
- package/dist/analysts/detectors/detector-bugs-ml.js +29 -27
- package/dist/analysts/detectors/detector-code-fragile.js +41 -36
- package/dist/analysts/detectors/detector-dependencies.js +5 -5
- package/dist/analysts/detectors/detector-duplications.js +26 -26
- package/dist/analysts/detectors/detector-monorepo.js +51 -45
- package/dist/analysts/detectors/detector-performance.js +24 -17
- package/dist/analysts/detectors/detector-recommendation-architecture.js +40 -36
- package/dist/analysts/detectors/detector-security.js +43 -42
- package/dist/analysts/detectors/detector-structure.js +31 -28
- package/dist/analysts/github-actions/analysts/analyst-github-actions.js +5 -8
- package/dist/analysts/github-actions/detectors/detector-workflow-accessibility.js +1 -9
- package/dist/analysts/github-actions/detectors/detector-workflow-structure.js +1 -4
- package/dist/analysts/github-actions/detectors/detector-workflow-trigger-unsafe.js +6 -5
- package/dist/analysts/gitlab-ci/analysts/analyst-gitlab-ci.js +2 -2
- package/dist/analysts/gitlab-ci/detectors/detector-gitlab-ci-structure.js +0 -3
- package/dist/analysts/go/analysts/analyst-best-practices.js +2 -2
- package/dist/analysts/go/analysts/analyst-concurrency.js +1 -1
- package/dist/analysts/go/analysts/analyst-security.js +1 -1
- package/dist/analysts/go/detectors/detector-conventions.js +1 -1
- package/dist/analysts/html/analysts/analyst-html.js +10 -12
- package/dist/analysts/html/detectors/detector-html.js +3 -3
- package/dist/analysts/js-ts/analysts/analyst-commands-cli.js +22 -22
- package/dist/analysts/js-ts/analysts/analyst-functions-long.js +5 -5
- package/dist/analysts/js-ts/analysts/analyst-patterns-usage.js +6 -2
- package/dist/analysts/js-ts/detectors/detector-anti-patterns-async.js +84 -9
- package/dist/analysts/js-ts/detectors/detector-constructions-syntactic.js +33 -10
- package/dist/analysts/js-ts/detectors/detector-context-smart.js +6 -6
- package/dist/analysts/js-ts/detectors/detector-leaks-memory.js +1 -1
- package/dist/analysts/js-ts/detectors/detector-types-unsafe.js +33 -2
- package/dist/analysts/php/analysts/analyst-php.js +3 -3
- package/dist/analysts/php/detectors/detector-php-best-practices.js +5 -5
- package/dist/analysts/php/detectors/detector-php-security.js +5 -5
- package/dist/analysts/php/scorers/scorer-php.js +2 -2
- package/dist/analysts/plugins/detector-documentation.js +6 -6
- package/dist/analysts/plugins/detector-markdown.js +7 -7
- package/dist/analysts/python/analysts/analyst-python.js +2 -5
- package/dist/analysts/react/analysts/analyst-react-hooks.js +66 -9
- package/dist/analysts/react/analysts/analyst-react.js +46 -2
- package/dist/analysts/react/corrections/correction-react.js +41 -1
- package/dist/analysts/react/detectors/detector-react-best-practices.js +5 -5
- package/dist/analysts/react/scorers/scorer-react.js +36 -1
- package/dist/analysts/registry/autodiscovery.js +2 -2
- package/dist/analysts/rust/analysts/analyst-best-practices.js +42 -3
- package/dist/analysts/rust/analysts/analyst-memory.js +2 -2
- package/dist/analysts/rust/analysts/analyst-rust.js +52 -5
- package/dist/analysts/rust/analysts/analyst-security.js +29 -1
- package/dist/analysts/scorers/scorer.js +5 -5
- package/dist/analysts/shell/analysts/analyst-shell.js +81 -5
- package/dist/analysts/shell/corrections/correction-shell.js +34 -1
- package/dist/analysts/shell/detectors/detector-shell-security.js +88 -0
- package/dist/analysts/shell/scorers/scorer-shell.js +58 -1
- package/dist/analysts/strategists/operator-structure.js +5 -7
- package/dist/analysts/strategists/suggestions-contextuais.js +5 -2
- package/dist/analysts/svg/analysts/analyst-svg.js +1 -0
- package/dist/analysts/tailwind/analysts/analyst-tailwind.js +79 -55
- package/dist/analysts/tailwind/corrections/correction-tailwind.js +108 -9
- package/dist/analysts/tailwind/detectors/detector-tailwind-best-practices.js +122 -7
- package/dist/analysts/tailwind/scorers/scorer-tailwind.js +62 -11
- package/dist/analysts/xml/analysts/analyst-xml.js +2 -2
- package/dist/app/index.js +1 -0
- package/dist/bin/cli-bootstrap.js +6 -4
- package/dist/bin/index.js +6 -4
- package/dist/caretakers/scoring.js +1 -0
- package/dist/cli/commands/command-analysts.js +4 -3
- package/dist/cli/commands/command-azure.js +1 -1
- package/dist/cli/commands/command-circleci.js +1 -1
- package/dist/cli/commands/command-compliance.js +1 -1
- package/dist/cli/commands/command-diagnose.js +10 -13
- package/dist/cli/commands/command-fix-types.js +9 -32
- package/dist/cli/commands/command-formatters.js +2 -2
- package/dist/cli/commands/command-github-actions.js +1 -1
- package/dist/cli/commands/command-gitlab-ci.js +1 -1
- package/dist/cli/commands/command-guardian.js +1 -1
- package/dist/cli/commands/command-imports.js +6 -6
- package/dist/cli/commands/command-jenkins.js +1 -1
- package/dist/cli/commands/command-licenses.js +1 -1
- package/dist/cli/commands/command-marketplace.js +7 -7
- package/dist/cli/commands/command-names.js +3 -8
- package/dist/cli/commands/command-perf.js +7 -9
- package/dist/cli/commands/command-plugins.js +4 -4
- package/dist/cli/diagnostic/auto-fix.js +2 -2
- package/dist/cli/diagnostic/exporters/json-exporter.js +1 -1
- package/dist/cli/diagnostic/exporters/sharded-exporter.js +0 -3
- package/dist/cli/diagnostic/exporters/svg-optimization-exporter.js +1 -1
- package/dist/cli/diagnostic/filters.js +9 -9
- package/dist/cli/diagnostic/handlers/archetype-handler.js +3 -6
- package/dist/cli/diagnostic/handlers/auto-fix-handler.js +4 -4
- package/dist/cli/diagnostic/handlers/guardian-handler.js +1 -1
- package/dist/cli/diagnostic/processing-diagnostic.js +31 -35
- package/dist/cli/diagnostic/processing-helpers.js +2 -2
- package/dist/cli/handlers/fix-types-exporter.js +1 -4
- package/dist/cli/helpers/display-frame.js +5 -5
- package/dist/core/config/auto/auto-fix-config.js +0 -6
- package/dist/core/config/chalk-safe.js +6 -6
- package/dist/core/config/config.js +11 -13
- package/dist/core/config/conventions.js +1 -1
- package/dist/core/config/security.js +2 -2
- package/dist/core/execution/analysis-cache.js +5 -8
- package/dist/core/execution/ast-cache.js +1 -3
- package/dist/core/execution/executor.js +8 -21
- package/dist/core/execution/inquisitor.js +24 -21
- package/dist/core/execution/results.js +1 -0
- package/dist/core/execution/scanner.js +4 -4
- package/dist/core/messages/en/analysts/analyst-github-actions-messages.js +1 -1
- package/dist/core/messages/en/analysts/analyst-patterns-usage-messages.js +1 -0
- package/dist/core/messages/en/analysts/analyst-shell-messages.js +15 -0
- package/dist/core/messages/en/analysts/detector-constructions-syntactic-messages.js +6 -0
- package/dist/core/messages/en/analysts/detector-js-ts-messages.js +27 -0
- package/dist/core/messages/en/analysts/detector-react-messages.js +8 -0
- package/dist/core/messages/en/analysts/detector-shell-messages.js +17 -0
- package/dist/core/messages/en/analysts/detector-tailwind-messages.js +3 -3
- package/dist/core/messages/en/analysts/report-circleci-messages.js +7 -7
- package/dist/core/messages/en/caretakers/caretaker-messages.js +1 -7
- package/dist/core/messages/en/core/plugin-messages.js +31 -3
- package/dist/core/messages/en/log/log.js +4 -4
- package/dist/core/messages/en/ui/filter-config.js +1 -5
- package/dist/core/messages/i18n-system.js +3 -3
- package/dist/core/messages/index.js +3 -3
- package/dist/core/messages/ja/analysts/analyst-github-actions-messages.js +1 -1
- package/dist/core/messages/ja/analysts/analyst-patterns-usage-messages.js +1 -0
- package/dist/core/messages/ja/analysts/analyst-shell-messages.js +15 -0
- package/dist/core/messages/ja/analysts/detector-constructions-syntactic-messages.js +6 -0
- package/dist/core/messages/ja/analysts/detector-js-ts-messages.js +27 -0
- package/dist/core/messages/ja/analysts/detector-react-messages.js +8 -0
- package/dist/core/messages/ja/analysts/detector-shell-messages.js +17 -0
- package/dist/core/messages/ja/analysts/detector-tailwind-messages.js +3 -3
- package/dist/core/messages/ja/analysts/report-circleci-messages.js +7 -7
- package/dist/core/messages/ja/caretakers/caretaker-messages.js +1 -7
- package/dist/core/messages/ja/core/plugin-messages.js +31 -3
- package/dist/core/messages/ja/log/log.js +4 -4
- package/dist/core/messages/ja/ui/filter-config.js +1 -1
- package/dist/core/messages/pt/analysts/analyst-github-actions-messages.js +1 -1
- package/dist/core/messages/pt/analysts/analyst-patterns-usage-messages.js +1 -0
- package/dist/core/messages/pt/analysts/analyst-shell-messages.js +15 -0
- package/dist/core/messages/pt/analysts/detector-constructions-syntactic-messages.js +6 -0
- package/dist/core/messages/pt/analysts/detector-js-ts-messages.js +27 -0
- package/dist/core/messages/pt/analysts/detector-react-messages.js +8 -0
- package/dist/core/messages/pt/analysts/detector-shell-messages.js +17 -0
- package/dist/core/messages/pt/analysts/detector-tailwind-messages.js +3 -3
- package/dist/core/messages/pt/analysts/report-circleci-messages.js +7 -7
- package/dist/core/messages/pt/caretakers/caretaker-messages.js +1 -7
- package/dist/core/messages/pt/core/plugin-messages.js +31 -3
- package/dist/core/messages/pt/log/log-engine.js +6 -6
- package/dist/core/messages/pt/log/log.js +3 -3
- package/dist/core/messages/pt/ui/filter-config.js +1 -1
- package/dist/core/messages/shared/icons.js +3 -3
- package/dist/core/messages/zh/analysts/analyst-github-actions-messages.js +1 -1
- package/dist/core/messages/zh/analysts/analyst-patterns-usage-messages.js +1 -0
- package/dist/core/messages/zh/analysts/analyst-shell-messages.js +15 -0
- package/dist/core/messages/zh/analysts/detector-constructions-syntactic-messages.js +6 -0
- package/dist/core/messages/zh/analysts/detector-js-ts-messages.js +27 -0
- package/dist/core/messages/zh/analysts/detector-react-messages.js +8 -0
- package/dist/core/messages/zh/analysts/detector-shell-messages.js +17 -0
- package/dist/core/messages/zh/analysts/detector-tailwind-messages.js +3 -3
- package/dist/core/messages/zh/analysts/report-circleci-messages.js +7 -7
- package/dist/core/messages/zh/caretakers/caretaker-messages.js +1 -7
- package/dist/core/messages/zh/core/plugin-messages.js +31 -3
- package/dist/core/messages/zh/log/log.js +3 -3
- package/dist/core/messages/zh/ui/filter-config.js +1 -5
- package/dist/core/parsing/filters.js +3 -3
- package/dist/core/parsing/langs/json.js +1 -1
- package/dist/core/parsing/langs/python.js +1 -1
- package/dist/core/parsing/langs/typescript.js +1 -1
- package/dist/core/parsing/parser.js +3 -4
- package/dist/core/parsing/utils.js +1 -0
- package/dist/core/registry/file-registry.js +3 -2
- package/dist/core/registry/paths.js +3 -3
- package/dist/core/reporting/default-reporter.js +2 -2
- package/dist/core/schema/version.js +6 -6
- package/dist/core/workers/worker-executor.js +3 -3
- package/dist/core/workers/worker-pool.js +0 -0
- package/dist/guardian/baseline.js +1 -1
- package/dist/guardian/gpg.js +3 -1
- package/dist/guardian/integrity.js +2 -7
- package/dist/guardian/records.js +7 -1
- package/dist/guardian/result.js +1 -1
- package/dist/guardian/sentinel.js +7 -1
- package/dist/guardian/watcher-hidden.js +6 -1
- package/dist/licenses/fs-utils.js +5 -1
- package/dist/licenses/generate-notices.js +1 -1
- package/dist/licenses/index.js +1 -0
- package/dist/licenses/normalizer.js +10 -9
- package/dist/node.loader.js +224 -4
- package/dist/reports/analise-async-patterns.js +1 -1
- package/dist/reports/filter-smart.js +2 -5
- package/dist/reports/generator-report.js +7 -7
- package/dist/reports/report-archetypes.js +10 -10
- package/dist/reports/report-caretaker-health.js +2 -1
- package/dist/reports/report-patterns-usage.js +1 -1
- package/dist/sdk/analyzer.js +1 -1
- package/dist/shared/data-processing/fragment-report.js +11 -11
- package/dist/shared/data-processing/json.js +1 -1
- package/dist/shared/data-processing/occurrences.js +3 -2
- package/dist/shared/formatters/code-min-formatter.js +1 -1
- package/dist/shared/formatters/engines/prettier.js +1 -1
- package/dist/shared/formatters/engines/stylelint.js +43 -40
- package/dist/shared/formatters/formatter.js +8 -8
- package/dist/shared/formatters/formatters/code.js +3 -3
- package/dist/shared/formatters/formatters/css.js +2 -10
- package/dist/shared/formatters/formatters/dotfiles.js +1 -1
- package/dist/shared/formatters/formatters/html.js +1 -5
- package/dist/shared/formatters/formatters/json.js +0 -3
- package/dist/shared/formatters/formatters/markdown.js +19 -24
- package/dist/shared/formatters/formatters/properties.js +2 -2
- package/dist/shared/formatters/formatters/shell.js +1 -4
- package/dist/shared/formatters/formatters/sql.js +0 -3
- package/dist/shared/formatters/formatters/xml.js +5 -7
- package/dist/shared/formatters/formatters/yaml.js +2 -7
- package/dist/shared/formatters/index.js +1 -1
- package/dist/shared/helpers/framework-detector.js +6 -2
- package/dist/shared/helpers/json.js +1 -1
- package/dist/shared/helpers/magic-constants-whitelist.js +1 -1
- package/dist/shared/helpers/masking.js +17 -17
- package/dist/shared/helpers/reader-report.js +0 -12
- package/dist/shared/helpers/structural-hash.js +3 -2
- package/dist/shared/helpers/structure.js +1 -1
- package/dist/shared/marketplace/registry.js +1 -1
- package/dist/shared/marketplace/remote.js +4 -4
- package/dist/shared/persistence/persistence.js +13 -6
- package/dist/shared/plugins/core-plugin.js +5 -1
- package/dist/shared/plugins/registry.js +3 -2
- package/dist/types/analysts/tailwind-correction.js +2 -0
- package/dist/types/caretakers/imports-barrel.js +1 -0
- package/dist/types/caretakers/index.js +4 -0
- package/dist/types/caretakers/map-reversion.js +1 -0
- package/dist/types/caretakers/pruning.js +1 -0
- package/dist/types/caretakers/scoring.js +1 -0
- package/dist/types/common/analysts.js +1 -1
- package/dist/types/core/config/filters.js +1 -0
- package/dist/types/core/config/index.js +2 -0
- package/dist/types/core/execution/ambiente.js +1 -0
- package/dist/types/core/execution/linguagens.js +1 -0
- package/dist/types/core/execution/parse-errors.js +1 -0
- package/dist/types/core/execution/results.js +1 -0
- package/dist/types/core/execution/structure-json.js +1 -0
- package/dist/types/core/index.js +1 -0
- package/dist/types/core/messages/index.js +1 -0
- package/dist/types/core/messages/log.js +1 -0
- package/dist/types/core/parsing/babel-narrow.js +1 -0
- package/dist/types/core/parsing/index.js +1 -0
- package/dist/types/core/runtime.js +1 -0
- package/dist/types/guardian/index.js +2 -0
- package/dist/types/guardian/integrity.js +7 -0
- package/dist/types/guardian/snapshot.js +1 -0
- package/dist/types/index.js +4 -4
- package/dist/types/licenses/index.js +2 -0
- package/dist/types/processing/display.js +16 -13
- package/dist/types/processing/filters.js +8 -11
- package/dist/types/reports/compliance.js +1 -0
- package/dist/types/reports/streaming.js +1 -0
- package/dist/types/scripts/index.js +1 -0
- package/dist/types/scripts/migrar-aliases.js +1 -0
- package/dist/types/sdk/index.js +1 -0
- package/dist/types/shared/index.js +2 -0
- package/dist/types/vulnerabilities/index.js +2 -0
- package/dist/vulnerabilities/scanner.js +3 -2
- package/package.json +14 -20
|
@@ -23,7 +23,7 @@ export function maskKeepingNewlines(src, start, end) {
|
|
|
23
23
|
export function maskJsComments(src) {
|
|
24
24
|
let out = src;
|
|
25
25
|
for (const metrica of out.matchAll(/\/\*[\s\S]*?\*\//g)) {
|
|
26
|
-
const start = metrica.index
|
|
26
|
+
const start = metrica.index;
|
|
27
27
|
if (start < 0) {
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
@@ -31,11 +31,11 @@ export function maskJsComments(src) {
|
|
|
31
31
|
}
|
|
32
32
|
// Usa negative lookbehind para evitar match em URLs (://)
|
|
33
33
|
for (const metrica of out.matchAll(/(?<![\\:])\/\/.*$/gm)) {
|
|
34
|
-
const start = metrica.index
|
|
34
|
+
const start = metrica.index;
|
|
35
35
|
if (start < 0) {
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
|
-
out = maskKeepingNewlines(out, start, start +
|
|
38
|
+
out = maskKeepingNewlines(out, start, start + metrica[0].length);
|
|
39
39
|
}
|
|
40
40
|
return out;
|
|
41
41
|
}
|
|
@@ -47,7 +47,7 @@ export function maskJsComments(src) {
|
|
|
47
47
|
export function maskHtmlComments(src) {
|
|
48
48
|
let out = src;
|
|
49
49
|
for (const metrica of out.matchAll(/<!--([\s\S]*?)-->/g)) {
|
|
50
|
-
const start = metrica.index
|
|
50
|
+
const start = metrica.index;
|
|
51
51
|
if (start < 0) {
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
@@ -66,7 +66,7 @@ export function maskTagBlocks(src, tag) {
|
|
|
66
66
|
let out = src;
|
|
67
67
|
const re = new RegExp(`<${tag}\\b[^>]*>[\\s\\S]*?<\\/${tag}>`, 'gi');
|
|
68
68
|
for (const metrica of out.matchAll(re)) {
|
|
69
|
-
const start = metrica.index
|
|
69
|
+
const start = metrica.index;
|
|
70
70
|
if (start < 0) {
|
|
71
71
|
continue;
|
|
72
72
|
}
|
|
@@ -83,14 +83,14 @@ export function maskTagBlocks(src, tag) {
|
|
|
83
83
|
export function maskXmlNonCode(src) {
|
|
84
84
|
let out = src;
|
|
85
85
|
for (const metrica of out.matchAll(/<!--[\s\S]*?-->/g)) {
|
|
86
|
-
const start = metrica.index
|
|
86
|
+
const start = metrica.index;
|
|
87
87
|
if (start < 0) {
|
|
88
88
|
continue;
|
|
89
89
|
}
|
|
90
90
|
out = maskKeepingNewlines(out, start, start + metrica[0].length);
|
|
91
91
|
}
|
|
92
92
|
for (const metrica of out.matchAll(/<!\[CDATA\[[\s\S]*?\]\]>/g)) {
|
|
93
|
-
const start = metrica.index
|
|
93
|
+
const start = metrica.index;
|
|
94
94
|
if (start < 0) {
|
|
95
95
|
continue;
|
|
96
96
|
}
|
|
@@ -107,14 +107,14 @@ export function maskXmlNonCode(src) {
|
|
|
107
107
|
export function maskPythonStringsAndComments(src) {
|
|
108
108
|
let out = maskPythonComments(src);
|
|
109
109
|
for (const metrica of out.matchAll(/([ruRUfFbB]{0,3})("""|''')[\s\S]*?\2/g)) {
|
|
110
|
-
const start = metrica.index
|
|
110
|
+
const start = metrica.index;
|
|
111
111
|
if (start < 0) {
|
|
112
112
|
continue;
|
|
113
113
|
}
|
|
114
114
|
out = maskKeepingNewlines(out, start, start + metrica[0].length);
|
|
115
115
|
}
|
|
116
116
|
for (const metrica of out.matchAll(/([ruRUfFbB]{0,3})("([^"\\\n]|\\.)*"|'([^'\\\n]|\\.)*')/g)) {
|
|
117
|
-
const start = metrica.index
|
|
117
|
+
const start = metrica.index;
|
|
118
118
|
if (start < 0) {
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
@@ -130,11 +130,11 @@ export function maskPythonStringsAndComments(src) {
|
|
|
130
130
|
export function maskPythonComments(src) {
|
|
131
131
|
let out = src;
|
|
132
132
|
for (const metrica of out.matchAll(/(^|[^\\])#.*$/gm)) {
|
|
133
|
-
const start =
|
|
133
|
+
const start = metrica.index + (metrica[1] ? metrica[1].length : 0);
|
|
134
134
|
if (start < 0) {
|
|
135
135
|
continue;
|
|
136
136
|
}
|
|
137
|
-
out = maskKeepingNewlines(out, start, start + (metrica[0].length
|
|
137
|
+
out = maskKeepingNewlines(out, start, start + (metrica[0].length) - (metrica[1] ? metrica[1].length : 0));
|
|
138
138
|
}
|
|
139
139
|
return out;
|
|
140
140
|
}
|
|
@@ -146,14 +146,14 @@ export function maskPythonComments(src) {
|
|
|
146
146
|
export function maskGoComments(src) {
|
|
147
147
|
let out = src;
|
|
148
148
|
for (const metrica of out.matchAll(/\/\*[\s\S]*?\*\//g)) {
|
|
149
|
-
const start = metrica.index
|
|
149
|
+
const start = metrica.index;
|
|
150
150
|
if (start < 0) {
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
153
|
out = maskKeepingNewlines(out, start, start + metrica[0].length);
|
|
154
154
|
}
|
|
155
155
|
for (const metrica of out.matchAll(/\/\/.*$/gm)) {
|
|
156
|
-
const start = metrica.index
|
|
156
|
+
const start = metrica.index;
|
|
157
157
|
if (start < 0) {
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
@@ -178,14 +178,14 @@ export function maskRustComments(src) {
|
|
|
178
178
|
export function maskJavaComments(src) {
|
|
179
179
|
let out = src;
|
|
180
180
|
for (const metrica of out.matchAll(/\/\*[\s\S]*?\*\//g)) {
|
|
181
|
-
const start = metrica.index
|
|
181
|
+
const start = metrica.index;
|
|
182
182
|
if (start < 0) {
|
|
183
183
|
continue;
|
|
184
184
|
}
|
|
185
185
|
out = maskKeepingNewlines(out, start, start + metrica[0].length);
|
|
186
186
|
}
|
|
187
187
|
for (const metrica of out.matchAll(/\/\/.*$/gm)) {
|
|
188
|
-
const start = metrica.index
|
|
188
|
+
const start = metrica.index;
|
|
189
189
|
if (start < 0) {
|
|
190
190
|
continue;
|
|
191
191
|
}
|
|
@@ -202,14 +202,14 @@ export function maskJavaComments(src) {
|
|
|
202
202
|
export function maskPhpComments(src) {
|
|
203
203
|
let out = src;
|
|
204
204
|
for (const metrica of out.matchAll(/\/\*[\s\S]*?\*\//g)) {
|
|
205
|
-
const start = metrica.index
|
|
205
|
+
const start = metrica.index;
|
|
206
206
|
if (start < 0) {
|
|
207
207
|
continue;
|
|
208
208
|
}
|
|
209
209
|
out = maskKeepingNewlines(out, start, start + metrica[0].length);
|
|
210
210
|
}
|
|
211
211
|
for (const metrica of out.matchAll(/(\/\/|#).*$/gm)) {
|
|
212
|
-
const start = metrica.index
|
|
212
|
+
const start = metrica.index;
|
|
213
213
|
if (start < 0) {
|
|
214
214
|
continue;
|
|
215
215
|
}
|
|
@@ -12,12 +12,6 @@ export async function lerRelatorioVersionado(options) {
|
|
|
12
12
|
try {
|
|
13
13
|
// Ler arquivo
|
|
14
14
|
const conteudo = await lerEstado(caminho);
|
|
15
|
-
if (!conteudo) {
|
|
16
|
-
return {
|
|
17
|
-
sucesso: false,
|
|
18
|
-
erro: 'Arquivo não encontrado ou vazio',
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
15
|
let relatorioFinal = conteudo;
|
|
22
16
|
let migrado = false;
|
|
23
17
|
// Validar schema se solicitado
|
|
@@ -97,12 +91,6 @@ export async function lerDadosRelatorio(caminho) {
|
|
|
97
91
|
export async function verificarSchemaRelatorio(caminho) {
|
|
98
92
|
try {
|
|
99
93
|
const conteudo = await lerEstado(caminho);
|
|
100
|
-
if (!conteudo) {
|
|
101
|
-
return {
|
|
102
|
-
valido: false,
|
|
103
|
-
erros: ['Arquivo não encontrado ou vazio'],
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
94
|
const validacao = validarSchema(conteudo);
|
|
107
95
|
return {
|
|
108
96
|
valido: validacao.valido,
|
|
@@ -34,7 +34,7 @@ function extrairEstrutura(ast) {
|
|
|
34
34
|
return elementos;
|
|
35
35
|
}
|
|
36
36
|
const node = isNodePath(ast) ? ast.node : ast;
|
|
37
|
-
if (
|
|
37
|
+
if (typeof node !== 'object') {
|
|
38
38
|
return elementos;
|
|
39
39
|
}
|
|
40
40
|
const nodeRecord = toRecord(node);
|
|
@@ -47,7 +47,8 @@ function extrairEstrutura(ast) {
|
|
|
47
47
|
}
|
|
48
48
|
const body = Array.isArray(program.body) ? program.body : [];
|
|
49
49
|
for (const stmt of body) {
|
|
50
|
-
const
|
|
50
|
+
const rawTipo = stmt.type;
|
|
51
|
+
const tipo = typeof rawTipo === 'string' ? rawTipo : '';
|
|
51
52
|
const stmtRecord = toRecord(stmt);
|
|
52
53
|
if (!stmtRecord) {
|
|
53
54
|
continue;
|
|
@@ -268,7 +268,7 @@ export function normalizarRel(relPath) {
|
|
|
268
268
|
export async function carregarConfigEstrategia(baseDir, overrides) {
|
|
269
269
|
const caminho = path.join(baseDir, '.mahoraga', 'estrutura.json');
|
|
270
270
|
const lido = await lerEstado(caminho);
|
|
271
|
-
const cfgObj =
|
|
271
|
+
const cfgObj = !Array.isArray(lido) && typeof lido === 'object' ? lido : {};
|
|
272
272
|
const nomePreset = overrides?.preset ?? cfgObj['preset'];
|
|
273
273
|
const preset = nomePreset && PRESETS[nomePreset].nome ? PRESETS[nomePreset] : undefined;
|
|
274
274
|
const base = {
|
|
@@ -26,7 +26,7 @@ export async function salvarPacotesInstalados(pacotes) {
|
|
|
26
26
|
}
|
|
27
27
|
export async function pacoteEstaInstalado(nome) {
|
|
28
28
|
const pacotes = await listarPacotesInstalados();
|
|
29
|
-
return pacotes
|
|
29
|
+
return pacotes?.find(p => p.nome === nome) ?? null;
|
|
30
30
|
}
|
|
31
31
|
export async function instalarPacote(analista, versao, _conteudo) {
|
|
32
32
|
const pacotes = await listarPacotesInstalados();
|
|
@@ -15,7 +15,7 @@ const CONFIG_PATH = '.mahoraga/marketplace/registries.json';
|
|
|
15
15
|
async function carregarRegistries() {
|
|
16
16
|
try {
|
|
17
17
|
const configs = await lerEstado(CONFIG_PATH);
|
|
18
|
-
if (
|
|
18
|
+
if (configs.length === 0) {
|
|
19
19
|
return DEFAULT_REGISTRIES;
|
|
20
20
|
}
|
|
21
21
|
return configs;
|
|
@@ -55,7 +55,7 @@ export async function obterAnalistaDoRegistry(nome, registry) {
|
|
|
55
55
|
}
|
|
56
56
|
try {
|
|
57
57
|
const analistas = await fetchRegistry(reg);
|
|
58
|
-
const encontrado = analistas
|
|
58
|
+
const encontrado = analistas?.find(a => a.nome === nome);
|
|
59
59
|
if (encontrado) {
|
|
60
60
|
return encontrado;
|
|
61
61
|
}
|
|
@@ -74,7 +74,7 @@ async function fetchRegistry(reg) {
|
|
|
74
74
|
throw new Error(MarketplaceRemoteMensagens.httpStatus(res.status));
|
|
75
75
|
}
|
|
76
76
|
const data = await res.json();
|
|
77
|
-
return data.analistas
|
|
77
|
+
return data.analistas;
|
|
78
78
|
}
|
|
79
79
|
case 'github': {
|
|
80
80
|
const apiUrl = `https://api.github.com/repos/${reg.url}/contents/index.json`;
|
|
@@ -85,7 +85,7 @@ async function fetchRegistry(reg) {
|
|
|
85
85
|
throw new Error(MarketplaceRemoteMensagens.githubApiHttpStatus(res.status));
|
|
86
86
|
}
|
|
87
87
|
const data = await res.json();
|
|
88
|
-
return data.analistas
|
|
88
|
+
return data.analistas;
|
|
89
89
|
}
|
|
90
90
|
case "npm": {
|
|
91
91
|
throw new Error('Not implemented yet: "npm" case');
|
|
@@ -6,7 +6,6 @@ import * as fsCb from 'node:fs';
|
|
|
6
6
|
import { promises as fs } from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { messages } from '../../core/messages/index.js';
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
9
|
const getLog = () => messages.log;
|
|
11
10
|
const RAIZ = process.cwd();
|
|
12
11
|
const IS_TEST = (process.env.VITEST ?? '') !== '';
|
|
@@ -110,11 +109,18 @@ async function salvarEstadoImpl(caminho, dados) {
|
|
|
110
109
|
/**
|
|
111
110
|
* Encapsula função com spy do Vitest quando em ambiente de teste,
|
|
112
111
|
* permitindo assertions sem modificar a implementação original.
|
|
113
|
-
*
|
|
114
|
-
* @
|
|
115
|
-
* @
|
|
112
|
+
*
|
|
113
|
+
* @template T - Tipo da função que será envolvida. Deve ser uma função com qualquer número de argumentos
|
|
114
|
+
* @param fn - Função original a ser envolvida com spy
|
|
115
|
+
* @returns Função com spy do Vitest (se em ambiente de teste) ou a função original sem modificações
|
|
116
|
+
* @throws Não lança erros; erros internos são logados como debug
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* const originalFn = (x: number) => x * 2;
|
|
120
|
+
* const spyedFn = wrapVitestSpy(originalFn);
|
|
121
|
+
* // Se em teste: spyedFn pode ser usado para assertions (vi.fn())
|
|
122
|
+
* // Se em produção: spyedFn é idêntico a originalFn
|
|
116
123
|
*/
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
124
|
function wrapVitestSpy(fn) {
|
|
119
125
|
try {
|
|
120
126
|
const maybeVi = globalThis.vi;
|
|
@@ -123,7 +129,8 @@ function wrapVitestSpy(fn) {
|
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
131
|
catch (err) {
|
|
126
|
-
|
|
132
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
133
|
+
getLog().debug(`Erro ao configurar spy (Vitest): ${errorMessage}`);
|
|
127
134
|
}
|
|
128
135
|
return fn;
|
|
129
136
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
1
2
|
import { getMessages } from '../../core/messages/index.js';
|
|
2
3
|
import { parseComBabel, parseComCss, parseComHtmlFunc, parseComPhp, parseComPython, parseComTypeScript, parseComXml, } from '../../core/parsing/langs/index.js';
|
|
3
4
|
const { logCore } = getMessages();
|
|
@@ -58,7 +59,10 @@ export class CorePlugin {
|
|
|
58
59
|
}
|
|
59
60
|
inferExtension(codigo, opts) {
|
|
60
61
|
if (opts?.pluginConfig?.extension) {
|
|
61
|
-
|
|
62
|
+
const ext = opts.pluginConfig.extension;
|
|
63
|
+
if (typeof ext === 'string') {
|
|
64
|
+
return ext;
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
if (/^<\?php/.test(codigo.trim())) {
|
|
64
68
|
return '.php';
|
|
@@ -91,7 +91,8 @@ export class PluginRegistry {
|
|
|
91
91
|
// Usa import dinâmico mockável (globalThis.import pode ser substituído nos testes)
|
|
92
92
|
const dynImport = globalThis.import ?? ((caminho) => import(caminho));
|
|
93
93
|
const pluginModule = await dynImport(pluginCaminho);
|
|
94
|
-
const
|
|
94
|
+
const pluginModuleDefault = pluginModule.default;
|
|
95
|
+
const plugin = (pluginModuleDefault ?? pluginModule);
|
|
95
96
|
// Valida e registra
|
|
96
97
|
this.validatePlugin(plugin);
|
|
97
98
|
this.registerPlugin(plugin);
|
|
@@ -134,7 +135,7 @@ export class PluginRegistry {
|
|
|
134
135
|
// Verifica suporte da linguagem
|
|
135
136
|
const langChave = extension.substring(1); // remove o ponto
|
|
136
137
|
const langSuporte = this.languageSupport[langChave];
|
|
137
|
-
if (
|
|
138
|
+
if (!langSuporte.enabled) {
|
|
138
139
|
const msgLinguagem = messages.PluginRegistryMensagens.linguagemDesabilitada;
|
|
139
140
|
log.debug(msgLinguagem.replace('{linguagem}', langChave));
|
|
140
141
|
return null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import { messages } from '../../core/messages/index.js';
|
|
|
4
4
|
* Fábrica para criar analista com validação mínima
|
|
5
5
|
*/
|
|
6
6
|
export function criarAnalista(def) {
|
|
7
|
-
if (
|
|
7
|
+
if (typeof def !== 'object') {
|
|
8
8
|
throw new Error(messages.ExcecoesMensagens.definicaoAnalistaInvalida);
|
|
9
9
|
}
|
|
10
10
|
if (!def.nome || /\s/.test(def.nome)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './runtime.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './log.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './babel-narrow.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var IntegridadeStatus;
|
|
2
|
+
(function (IntegridadeStatus) {
|
|
3
|
+
IntegridadeStatus["Criado"] = "baseline-criado";
|
|
4
|
+
IntegridadeStatus["Aceito"] = "baseline-aceito";
|
|
5
|
+
IntegridadeStatus["Ok"] = "ok";
|
|
6
|
+
IntegridadeStatus["AlteracoesDetectadas"] = "alteracoes-detectadas";
|
|
7
|
+
})(IntegridadeStatus || (IntegridadeStatus = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { IntegridadeStatus } from '../guardian/integrity.js';
|
|
2
|
-
export { converterResultadoGuardian } from '../guardian/result.js';
|
|
3
|
-
export { extrairMensagemErro } from '../shared/validation.js';
|
|
4
1
|
export * from './analysts/index.js';
|
|
5
2
|
export * from './common/index.js';
|
|
3
|
+
export { IntegridadeStatus } from './guardian/integrity.js';
|
|
6
4
|
export * from './processing/index.js';
|
|
7
5
|
export * from './project/index.js';
|
|
8
6
|
export * from './structure/index.js';
|
|
9
|
-
export {
|
|
7
|
+
export { converterResultadoGuardian } from '../guardian/index.js';
|
|
8
|
+
export { extrairMensagemErro } from '../shared/index.js';
|
|
9
|
+
export { GuardianError } from '../guardian/index.js';
|
|
@@ -26,10 +26,13 @@ export function exibirBlocoFiltros(includeGroupsExpanded, includeListFlat, exclu
|
|
|
26
26
|
linhas.push('(node_modules incluído: ignorado dos padrões de exclusão)');
|
|
27
27
|
}
|
|
28
28
|
const titulo = 'Filtros ativos:';
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
const log = getLog();
|
|
30
|
+
const logComLargura = log;
|
|
31
|
+
const largura = logComLargura.calcularLargura
|
|
32
|
+
? logComLargura.calcularLargura(titulo, linhas, config.COMPACT_MODE ? 84 : 96)
|
|
33
|
+
: undefined;
|
|
34
|
+
const logBloco = (log).imprimirBloco;
|
|
35
|
+
const logInfo = log;
|
|
33
36
|
if (typeof logInfo.info === 'function') {
|
|
34
37
|
if (linhas.length) {
|
|
35
38
|
logInfo.info(`${titulo} ${linhas.join(' ')}`);
|
|
@@ -40,7 +43,7 @@ export function exibirBlocoFiltros(includeGroupsExpanded, includeListFlat, exclu
|
|
|
40
43
|
}
|
|
41
44
|
// Imprime bloco moldurado se disponível
|
|
42
45
|
if (typeof logBloco === 'function') {
|
|
43
|
-
logBloco(titulo, linhas, chalk.cyan.bold, typeof largura === 'number' ? largura : config.COMPACT_MODE ? 84 : 96);
|
|
46
|
+
logBloco(titulo, linhas, chalk.cyan.bold ?? ((text) => text), typeof largura === 'number' ? largura : config.COMPACT_MODE ? 84 : 96);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
// Função para listar analistas registrados
|
|
@@ -53,12 +56,12 @@ export async function listarAnalistas() {
|
|
|
53
56
|
}
|
|
54
57
|
catch (err) {
|
|
55
58
|
listaAnalistas = [];
|
|
56
|
-
const
|
|
57
|
-
if (config.DEV_MODE && typeof
|
|
58
|
-
|
|
59
|
+
const log2 = getLog();
|
|
60
|
+
if (config.DEV_MODE && typeof log2.debug === 'function') {
|
|
61
|
+
log2.debug(`Falha ao listar analistas: ${String(err)}`);
|
|
59
62
|
}
|
|
60
|
-
if (process.env.VITEST && typeof
|
|
61
|
-
|
|
63
|
+
if (process.env.VITEST && typeof log2.debug === 'function') {
|
|
64
|
+
log2.debug('Falha ao listar analistas');
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
// Prepara linhas do bloco
|
|
@@ -78,9 +81,9 @@ export async function listarAnalistas() {
|
|
|
78
81
|
const titulo = 'Técnicas ativas (registro de analistas)';
|
|
79
82
|
// Largura definida dinamicamente com fallback para modo compacto/padrão
|
|
80
83
|
let largura;
|
|
81
|
-
const
|
|
82
|
-
if (typeof (
|
|
83
|
-
largura =
|
|
84
|
+
const log3 = getLog();
|
|
85
|
+
if (typeof (log3).calcularLargura === 'function') {
|
|
86
|
+
largura = log3.calcularLargura(titulo, linhas, config.COMPACT_MODE ? 84 : 96);
|
|
84
87
|
// Se calcularLargura retornar undefined, usar fallback 96
|
|
85
88
|
if (typeof largura !== 'number' || isNaN(largura)) {
|
|
86
89
|
largura = config.COMPACT_MODE ? 84 : 96;
|
|
@@ -37,13 +37,9 @@ export function expandIncludes(list) {
|
|
|
37
37
|
export function getDefaultExcludes() {
|
|
38
38
|
// Primeiro tenta obter do mahoraga.config.json do usuário
|
|
39
39
|
const configIncluirExcluir = config.INCLUDE_EXCLUDE_RULES;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (Array.isArray(configIncluirExcluir.globalExcludeGlob) && configIncluirExcluir.globalExcludeGlob.length > 0) {
|
|
44
|
-
return Array.from(new Set(configIncluirExcluir.globalExcludeGlob));
|
|
45
|
-
}
|
|
46
|
-
// Se não houver globalExcludeGlob, cairá no fallback abaixo que mescla padrões do sistema
|
|
40
|
+
const globalExclude = configIncluirExcluir.globalExcludeGlob;
|
|
41
|
+
if (Array.isArray(globalExclude) && globalExclude.length > 0) {
|
|
42
|
+
return Array.from(new Set(configIncluirExcluir.globalExcludeGlob));
|
|
47
43
|
}
|
|
48
44
|
// Se não há configuração do usuário, usa os padrões recomendados do sistema
|
|
49
45
|
// Por enquanto usa 'generico', mas poderia detectar o tipo de projeto
|
|
@@ -78,13 +74,14 @@ function detectarTipoProjeto() {
|
|
|
78
74
|
// Função principal para configurar filtros CLI
|
|
79
75
|
export function configurarFiltros(includeGroupsRaw, includeListFlat, excludeList, incluiNodeModules) {
|
|
80
76
|
// Configurar includes
|
|
77
|
+
const cfg = config;
|
|
81
78
|
if (includeListFlat.length) {
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
cfg.CLI_INCLUDE_GROUPS = includeGroupsRaw;
|
|
80
|
+
cfg.CLI_INCLUDE_PATTERNS = includeListFlat;
|
|
84
81
|
}
|
|
85
82
|
else {
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
cfg.CLI_INCLUDE_GROUPS = [];
|
|
84
|
+
cfg.CLI_INCLUDE_PATTERNS = [];
|
|
88
85
|
}
|
|
89
86
|
// Configurar excludes com precedência clara:
|
|
90
87
|
// 1. CLI --exclude (prioridade máxima)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './migrar-aliases.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './analyzer.js';
|
|
@@ -5,7 +5,8 @@ function execFileAsync(cmd, args, opts) {
|
|
|
5
5
|
return new Promise((resolve, reject) => {
|
|
6
6
|
execFile(cmd, args, opts, (err, stdout) => {
|
|
7
7
|
if (err) {
|
|
8
|
-
|
|
8
|
+
const npmErr = Object.assign(err, { stdout });
|
|
9
|
+
reject(npmErr);
|
|
9
10
|
}
|
|
10
11
|
else {
|
|
11
12
|
resolve({ stdout });
|
|
@@ -54,7 +55,7 @@ function normalizeAuditResult(raw) {
|
|
|
54
55
|
name: vuln.name,
|
|
55
56
|
severity: vuln.severity,
|
|
56
57
|
isDirect: vuln.isDirect,
|
|
57
|
-
via: vuln.via.map(v => (typeof v === 'string' ? v : (
|
|
58
|
+
via: vuln.via.map(v => (typeof v === 'string' ? v : (v.title || v.url || v.name || ''))),
|
|
58
59
|
effects: vuln.effects,
|
|
59
60
|
range: vuln.range,
|
|
60
61
|
fixAvailable: vuln.fixAvailable === false ? null : {
|