@mocoto/mahoraga 0.14.2 → 0.14.4
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 +2 -32
- package/dist/analysts/architects/analyst-structure.js +19 -19
- package/dist/analysts/architects/archetypes-custom.js +8 -6
- package/dist/analysts/architects/detector-archetypes.js +30 -27
- package/dist/analysts/architects/signals-project-advanced.js +24 -26
- package/dist/analysts/architects/signals-project.js +1 -1
- package/dist/analysts/architects/strategist-structure.js +47 -66
- package/dist/analysts/azure-pipelines/analysts/analyst-azure.js +21 -14
- 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 -37
- package/dist/analysts/azure-pipelines/scorers/scorer-azure.js +10 -7
- package/dist/analysts/circleci/analysts/analyst-circleci.js +23 -15
- 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 +20 -17
- package/dist/analysts/converters/engines/converter-gha-to-gitlab.js +17 -15
- package/dist/analysts/corrections/analyst-quick-fixes.js +25 -28
- package/dist/analysts/corrections/analyst-scoring.js +24 -21
- package/dist/analysts/corrections/corrector-structure.js +35 -35
- 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 +54 -51
- 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 +10 -10
- 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-validator.js +2 -1
- package/dist/analysts/corrections/type-safety/usage-analyzer.js +36 -39
- package/dist/analysts/css/analysts/analyst-css.js +16 -15
- 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 +20 -15
- 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 +89 -83
- package/dist/analysts/detectors/detector-bugs-ml.js +21 -19
- package/dist/analysts/detectors/detector-code-fragile.js +30 -26
- package/dist/analysts/detectors/detector-duplications.js +21 -18
- package/dist/analysts/detectors/detector-monorepo.js +41 -36
- package/dist/analysts/detectors/detector-performance.js +22 -16
- package/dist/analysts/detectors/detector-recommendation-architecture.js +39 -35
- package/dist/analysts/detectors/detector-security.js +43 -42
- package/dist/analysts/detectors/detector-structure.js +29 -26
- package/dist/analysts/js-ts/detectors/detector-anti-patterns-async.js +4 -1
- package/dist/analysts/js-ts/detectors/detector-constructions-syntactic.js +10 -16
- package/dist/analysts/plugins/detector-documentation.js +1 -0
- package/dist/analysts/react/analysts/analyst-react-hooks.js +4 -2
- package/dist/analysts/react/analysts/analyst-react.js +1 -1
- package/dist/analysts/react/corrections/correction-react.js +2 -2
- package/dist/analysts/react/detectors/detector-react-best-practices.js +1 -1
- package/dist/analysts/registry/autodiscovery.js +2 -2
- package/dist/analysts/tailwind/corrections/correction-tailwind.js +0 -8
- package/dist/analysts/tailwind/scorers/scorer-tailwind.js +1 -2
- package/dist/cli/commands/command-analysts.js +3 -2
- package/dist/cli/commands/command-formatters.js +6 -5
- package/dist/cli/commands/command-github-actions.js +1 -1
- package/dist/cli/commands/command-guardian.js +1 -1
- package/dist/cli/commands/command-marketplace.js +4 -4
- package/dist/cli/diagnostic/filters.js +9 -9
- package/dist/core/config/chalk-safe.js +4 -4
- package/dist/core/config/config.js +5 -5
- package/dist/core/execution/analysis-cache.js +1 -1
- package/dist/core/execution/ast-cache.js +1 -3
- package/dist/core/execution/executor.js +2 -4
- package/dist/core/execution/scanner.js +1 -1
- 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/ja/analysts/report-circleci-messages.js +7 -7
- package/dist/core/messages/ja/caretakers/caretaker-messages.js +1 -7
- 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/zh/analysts/report-circleci-messages.js +7 -7
- package/dist/core/messages/zh/caretakers/caretaker-messages.js +1 -7
- package/dist/core/parsing/parser.js +2 -3
- package/dist/core/parsing/utils.js +1 -0
- package/dist/core/workers/worker-pool.js +0 -0
- package/dist/guardian/records.js +1 -0
- package/dist/guardian/sentinel.js +1 -0
- package/dist/guardian/watcher-hidden.js +1 -0
- package/dist/licenses/fs-utils.js +2 -1
- package/dist/licenses/header-options.js +1 -0
- package/dist/licenses/index.js +1 -1
- package/dist/reports/generator-report.js +3 -3
- package/dist/reports/report-patterns-usage.js +1 -1
- package/dist/shared/data-processing/fragment-report.js +1 -1
- package/dist/shared/formatters/engines/stylelint.js +40 -34
- package/dist/shared/formatters/formatters/markdown.js +1 -1
- package/dist/shared/helpers/framework-detector.js +5 -1
- package/dist/shared/persistence/persistence.js +13 -5
- package/dist/shared/plugins/core-plugin.js +3 -1
- package/dist/types/analysts/tailwind-correction.js +2 -0
- package/dist/types/index.js +3 -3
- package/dist/types/processing/filters.js +5 -4
- package/dist/vulnerabilities/npm-audit.js +1 -0
- package/dist/vulnerabilities/scanner.js +1 -1
- package/dist/vulnerabilities/vulnerabilities.js +1 -0
- package/package.json +5 -10
|
@@ -25,9 +25,9 @@ export async function gerarRelatorioMarkdown(resultado, outputCaminho, modoBrief
|
|
|
25
25
|
});
|
|
26
26
|
// Extrair dados do Guardian
|
|
27
27
|
const guardianData = guardian && typeof guardian === 'object' ? {
|
|
28
|
-
status: 'status' in guardian ?
|
|
29
|
-
timestamp: 'timestamp' in guardian ?
|
|
30
|
-
totalArquivos: 'totalArquivos' in guardian ?
|
|
28
|
+
status: 'status' in guardian ? guardian.status : 'não executada',
|
|
29
|
+
timestamp: 'timestamp' in guardian ? guardian.timestamp : '-',
|
|
30
|
+
totalArquivos: 'totalArquivos' in guardian ? guardian.totalArquivos : '-'
|
|
31
31
|
} : {
|
|
32
32
|
status: 'não executada',
|
|
33
33
|
timestamp: '-',
|
|
@@ -10,7 +10,7 @@ export function exibirRelatorioPadroesUso() {
|
|
|
10
10
|
const titulo = 'Padrões de Uso do Código';
|
|
11
11
|
const linhas = [];
|
|
12
12
|
const logComBloco = log;
|
|
13
|
-
const largura = logComBloco.calcularLargura
|
|
13
|
+
const largura = logComBloco.calcularLargura(titulo, linhas, 84);
|
|
14
14
|
logComBloco.imprimirBloco(titulo, linhas, (string) => string, typeof largura === 'number' ? largura : 84);
|
|
15
15
|
}
|
|
16
16
|
// Rodapé compatível com testes
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Importante: este arquivo NÃO usa nem depende dos artefatos em /implis.
|
|
6
6
|
* A pasta implis serve apenas como referência/"inspiração" de regras.
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import postcss, {} from 'postcss';
|
|
9
9
|
function normalizeWhitespace(input) {
|
|
10
10
|
return input.replace(/\s+/g, ' ').trim();
|
|
11
11
|
}
|
|
@@ -104,11 +104,7 @@ export function lintCssLikeStylelint(opts) {
|
|
|
104
104
|
warnings.push(...checkNoInvalidDoubleSlashComments(code));
|
|
105
105
|
let ast;
|
|
106
106
|
try {
|
|
107
|
-
ast =
|
|
108
|
-
filename: opts.relPath,
|
|
109
|
-
positions: true,
|
|
110
|
-
parseCustomProperty: true
|
|
111
|
-
});
|
|
107
|
+
ast = postcss.parse(code, { from: opts.relPath });
|
|
112
108
|
}
|
|
113
109
|
catch (erro) {
|
|
114
110
|
warnings.push({
|
|
@@ -132,10 +128,13 @@ export function lintCssLikeStylelint(opts) {
|
|
|
132
128
|
}).join(' | ');
|
|
133
129
|
}
|
|
134
130
|
function generateNodeText(node) {
|
|
135
|
-
|
|
131
|
+
if (node.type === 'atrule' && typeof node.params === 'string') {
|
|
132
|
+
return normalizeWhitespace(node.params);
|
|
133
|
+
}
|
|
134
|
+
return '';
|
|
136
135
|
}
|
|
137
136
|
function checkAtImport(node) {
|
|
138
|
-
if (node.type !== '
|
|
137
|
+
if (node.type !== 'atrule' || typeof node.name !== 'string' || node.name.toLowerCase() !== 'import') {
|
|
139
138
|
return;
|
|
140
139
|
}
|
|
141
140
|
const prelude = generateNodeText(node);
|
|
@@ -165,7 +164,7 @@ export function lintCssLikeStylelint(opts) {
|
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
166
|
function checkKeyframes(node) {
|
|
168
|
-
if (node.type !== '
|
|
167
|
+
if (node.type !== 'atrule') {
|
|
169
168
|
return;
|
|
170
169
|
}
|
|
171
170
|
const name = typeof node.name === 'string' ? node.name.toLowerCase() : '';
|
|
@@ -189,7 +188,7 @@ export function lintCssLikeStylelint(opts) {
|
|
|
189
188
|
}
|
|
190
189
|
}
|
|
191
190
|
function pushAtRuleScope(node) {
|
|
192
|
-
if (node.type !== '
|
|
191
|
+
if (node.type !== 'atrule' || !Array.isArray(node.nodes)) {
|
|
193
192
|
return;
|
|
194
193
|
}
|
|
195
194
|
const name = typeof node.name === 'string' ? node.name.toLowerCase() : '';
|
|
@@ -197,10 +196,10 @@ export function lintCssLikeStylelint(opts) {
|
|
|
197
196
|
atruleStack.push({ name, prelude });
|
|
198
197
|
}
|
|
199
198
|
function checkDuplicateSelector(node) {
|
|
200
|
-
if (node.type !== '
|
|
199
|
+
if (node.type !== 'rule' || typeof node.selector !== 'string') {
|
|
201
200
|
return;
|
|
202
201
|
}
|
|
203
|
-
const selector = normalizeWhitespace(
|
|
202
|
+
const selector = normalizeWhitespace(node.selector);
|
|
204
203
|
if (!selector) {
|
|
205
204
|
return;
|
|
206
205
|
}
|
|
@@ -219,15 +218,10 @@ export function lintCssLikeStylelint(opts) {
|
|
|
219
218
|
}
|
|
220
219
|
}
|
|
221
220
|
function checkEmptyBlock(node) {
|
|
222
|
-
if (node.type !== '
|
|
221
|
+
if (node.type !== 'rule' && node.type !== 'atrule') {
|
|
223
222
|
return;
|
|
224
223
|
}
|
|
225
|
-
if (!node.
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
const children = node.block.children;
|
|
229
|
-
const isEmpty = typeof children.getSize === 'function' ? children.getSize() === 0 : false;
|
|
230
|
-
if (!isEmpty) {
|
|
224
|
+
if (!Array.isArray(node.nodes) || node.nodes.length > 0) {
|
|
231
225
|
return;
|
|
232
226
|
}
|
|
233
227
|
const loc = node.loc?.start;
|
|
@@ -253,7 +247,19 @@ export function lintCssLikeStylelint(opts) {
|
|
|
253
247
|
column: loc.column
|
|
254
248
|
});
|
|
255
249
|
}
|
|
256
|
-
|
|
250
|
+
function walk(node, visitor) {
|
|
251
|
+
if (typeof node !== 'object') {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
visitor.enter?.(node);
|
|
255
|
+
if (Array.isArray(node.nodes)) {
|
|
256
|
+
for (const child of node.nodes) {
|
|
257
|
+
walk(child, visitor);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
visitor.leave?.(node);
|
|
261
|
+
}
|
|
262
|
+
walk(ast, {
|
|
257
263
|
enter: (node) => {
|
|
258
264
|
checkAtImport(node);
|
|
259
265
|
checkKeyframes(node);
|
|
@@ -262,7 +268,7 @@ export function lintCssLikeStylelint(opts) {
|
|
|
262
268
|
checkEmptyBlock(node);
|
|
263
269
|
},
|
|
264
270
|
leave: (node) => {
|
|
265
|
-
if (node.type === '
|
|
271
|
+
if (node.type === 'atrule' && Array.isArray(node.nodes)) {
|
|
266
272
|
atruleStack.pop();
|
|
267
273
|
}
|
|
268
274
|
}
|
|
@@ -272,25 +278,25 @@ export function lintCssLikeStylelint(opts) {
|
|
|
272
278
|
const atruleStackForDecl = [];
|
|
273
279
|
const declStack = [];
|
|
274
280
|
function generateNodeTextSimple(prelude) {
|
|
275
|
-
return prelude ? normalizeWhitespace(
|
|
281
|
+
return prelude && typeof prelude !== 'object' ? normalizeWhitespace(prelude) : '';
|
|
276
282
|
}
|
|
277
283
|
function pushAtRuleDeclStack(node) {
|
|
278
|
-
if (node.type !== '
|
|
284
|
+
if (node.type !== 'atrule' || !Array.isArray(node.nodes)) {
|
|
279
285
|
return;
|
|
280
286
|
}
|
|
281
287
|
const name = typeof node.name === 'string' ? node.name.toLowerCase() : '';
|
|
282
|
-
const prelude = generateNodeTextSimple(node.
|
|
288
|
+
const prelude = generateNodeTextSimple(node.params);
|
|
283
289
|
atruleStackForDecl.push({ name, prelude });
|
|
284
290
|
}
|
|
285
291
|
function pushRuleDeclStack(node) {
|
|
286
|
-
if (node.type !== '
|
|
292
|
+
if (node.type !== 'rule' && node.type !== 'atrule') {
|
|
287
293
|
return;
|
|
288
294
|
}
|
|
289
|
-
if (!node.
|
|
295
|
+
if (!Array.isArray(node.nodes)) {
|
|
290
296
|
return;
|
|
291
297
|
}
|
|
292
|
-
const name = node.type === '
|
|
293
|
-
const prelude = node.type === '
|
|
298
|
+
const name = node.type === 'atrule' && typeof node.name === 'string' ? node.name.toLowerCase() : '';
|
|
299
|
+
const prelude = node.type === 'atrule' ? generateNodeTextSimple(node.params) : '';
|
|
294
300
|
declStack.push({
|
|
295
301
|
nodeType: node.type,
|
|
296
302
|
name,
|
|
@@ -323,12 +329,12 @@ export function lintCssLikeStylelint(opts) {
|
|
|
323
329
|
});
|
|
324
330
|
}
|
|
325
331
|
function processDeclaration(node) {
|
|
326
|
-
if (node.type !== '
|
|
332
|
+
if (node.type !== 'decl') {
|
|
327
333
|
return;
|
|
328
334
|
}
|
|
329
335
|
const current = declStack[declStack.length - 1];
|
|
330
|
-
const prop = node.
|
|
331
|
-
const value = node.value ? normalizeWhitespace(
|
|
336
|
+
const prop = typeof node.prop === 'string' ? node.prop.toLowerCase() : '';
|
|
337
|
+
const value = typeof node.value === 'string' ? normalizeWhitespace(node.value) : '';
|
|
332
338
|
const loc = node.loc?.start;
|
|
333
339
|
checkImportant(node, loc);
|
|
334
340
|
checkHttpUrl(value, loc);
|
|
@@ -355,17 +361,17 @@ export function lintCssLikeStylelint(opts) {
|
|
|
355
361
|
column: loc?.column
|
|
356
362
|
});
|
|
357
363
|
}
|
|
358
|
-
|
|
364
|
+
walk(ast, {
|
|
359
365
|
enter: (node) => {
|
|
360
366
|
pushAtRuleDeclStack(node);
|
|
361
367
|
pushRuleDeclStack(node);
|
|
362
368
|
processDeclaration(node);
|
|
363
369
|
},
|
|
364
370
|
leave: (node) => {
|
|
365
|
-
if ((node.type === '
|
|
371
|
+
if ((node.type === 'rule' || node.type === 'atrule') && Array.isArray(node.nodes)) {
|
|
366
372
|
declStack.pop();
|
|
367
373
|
}
|
|
368
|
-
if (node.type === '
|
|
374
|
+
if (node.type === 'atrule' && Array.isArray(node.nodes)) {
|
|
369
375
|
atruleStackForDecl.pop();
|
|
370
376
|
}
|
|
371
377
|
}
|
|
@@ -122,7 +122,7 @@ function corrigirEnfaseMarkdown(text) {
|
|
|
122
122
|
const antes = texto.slice(0, pontuacaoForte.index);
|
|
123
123
|
const ultimaPalavra = antes.match(/(\S+)$/);
|
|
124
124
|
if (ultimaPalavra) {
|
|
125
|
-
const palavra = ultimaPalavra[1]
|
|
125
|
+
const palavra = ultimaPalavra[1].toLowerCase();
|
|
126
126
|
if (palavra) {
|
|
127
127
|
const abreviacoes = ['sr', 'sra', 'dr', 'dra', 'prof', 'etc', 'ex', 'vs', 'aprox', 'obs', 'v', 'p', 'n', 'e'];
|
|
128
128
|
if (!abreviacoes.includes(palavra.replace(/[.!?]+$/, ''))) {
|
|
@@ -9,7 +9,11 @@ export function detectarFrameworks(rootDir) {
|
|
|
9
9
|
try {
|
|
10
10
|
const packageJsonCaminho = path.join(rootDir, 'package.json');
|
|
11
11
|
const packageJsonRaw = fs.readFileSync(packageJsonCaminho, 'utf-8');
|
|
12
|
-
const
|
|
12
|
+
const parsedJson = JSON.parse(packageJsonRaw);
|
|
13
|
+
if (typeof parsedJson !== 'object' || parsedJson === null) {
|
|
14
|
+
return frameworks;
|
|
15
|
+
}
|
|
16
|
+
const packageJson = parsedJson;
|
|
13
17
|
const dependencies = packageJson.dependencies ?? {};
|
|
14
18
|
const devDependencies = packageJson.devDependencies ?? {};
|
|
15
19
|
// Lista de frameworks conhecidos com seus identificadores
|
|
@@ -109,11 +109,18 @@ async function salvarEstadoImpl(caminho, dados) {
|
|
|
109
109
|
/**
|
|
110
110
|
* Encapsula função com spy do Vitest quando em ambiente de teste,
|
|
111
111
|
* permitindo assertions sem modificar a implementação original.
|
|
112
|
-
*
|
|
113
|
-
* @
|
|
114
|
-
* @
|
|
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
|
|
115
123
|
*/
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
124
|
function wrapVitestSpy(fn) {
|
|
118
125
|
try {
|
|
119
126
|
const maybeVi = globalThis.vi;
|
|
@@ -122,7 +129,8 @@ function wrapVitestSpy(fn) {
|
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
catch (err) {
|
|
125
|
-
|
|
132
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
133
|
+
getLog().debug(`Erro ao configurar spy (Vitest): ${errorMessage}`);
|
|
126
134
|
}
|
|
127
135
|
return fn;
|
|
128
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();
|
|
@@ -59,8 +60,9 @@ export class CorePlugin {
|
|
|
59
60
|
inferExtension(codigo, opts) {
|
|
60
61
|
if (opts?.pluginConfig?.extension) {
|
|
61
62
|
const ext = opts.pluginConfig.extension;
|
|
62
|
-
if (typeof ext === 'string')
|
|
63
|
+
if (typeof ext === 'string') {
|
|
63
64
|
return ext;
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
67
|
if (/^<\?php/.test(codigo.trim())) {
|
|
66
68
|
return '.php';
|
package/dist/types/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { IntegridadeStatus } from './guardian/integrity.js';
|
|
2
|
-
export { converterResultadoGuardian } from '../guardian/index.js';
|
|
3
|
-
export { extrairMensagemErro } from '../shared/index.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';
|
|
7
|
+
export { converterResultadoGuardian } from '../guardian/index.js';
|
|
8
|
+
export { extrairMensagemErro } from '../shared/index.js';
|
|
9
9
|
export { GuardianError } from '../guardian/index.js';
|
|
@@ -74,13 +74,14 @@ function detectarTipoProjeto() {
|
|
|
74
74
|
// Função principal para configurar filtros CLI
|
|
75
75
|
export function configurarFiltros(includeGroupsRaw, includeListFlat, excludeList, incluiNodeModules) {
|
|
76
76
|
// Configurar includes
|
|
77
|
+
const cfg = config;
|
|
77
78
|
if (includeListFlat.length) {
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
cfg.CLI_INCLUDE_GROUPS = includeGroupsRaw;
|
|
80
|
+
cfg.CLI_INCLUDE_PATTERNS = includeListFlat;
|
|
80
81
|
}
|
|
81
82
|
else {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
cfg.CLI_INCLUDE_GROUPS = [];
|
|
84
|
+
cfg.CLI_INCLUDE_PATTERNS = [];
|
|
84
85
|
}
|
|
85
86
|
// Configurar excludes com precedência clara:
|
|
86
87
|
// 1. CLI --exclude (prioridade máxima)
|
|
@@ -55,7 +55,7 @@ function normalizeAuditResult(raw) {
|
|
|
55
55
|
name: vuln.name,
|
|
56
56
|
severity: vuln.severity,
|
|
57
57
|
isDirect: vuln.isDirect,
|
|
58
|
-
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 || ''))),
|
|
59
59
|
effects: vuln.effects,
|
|
60
60
|
range: vuln.range,
|
|
61
61
|
fixAvailable: vuln.fixAvailable === false ? null : {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mocoto/mahoraga",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "C.L.I modular para análise, diagnóstico e manutenção de projetos JavaScript/TypeScript e multi-stack leve",
|
|
6
6
|
"author": "rei macaco",
|
|
@@ -121,19 +121,20 @@
|
|
|
121
121
|
"@babel/types": "^8.0.0",
|
|
122
122
|
"chalk": "^5.6.2",
|
|
123
123
|
"commander": "^15.0.0",
|
|
124
|
-
"css-tree": "^3.2.1",
|
|
125
124
|
"dotenv": "^17.4.2",
|
|
126
125
|
"fast-xml-parser": "^5.9.3",
|
|
127
126
|
"htmlparser2": "^12.0.0",
|
|
128
127
|
"marked": "^18.0.5",
|
|
129
128
|
"micromatch": "^4.0.8",
|
|
129
|
+
"minimatch": "^10.2.5",
|
|
130
130
|
"openpgp": "^6.3.1",
|
|
131
131
|
"ora": "^9.4.1",
|
|
132
132
|
"p-limit": "^7.3.0",
|
|
133
133
|
"postcss-sass": "^0.5.0",
|
|
134
134
|
"postcss-scss": "^4.0.9",
|
|
135
135
|
"xxhashjs": "^0.2.2",
|
|
136
|
-
"yaml": "^2.9.0"
|
|
136
|
+
"yaml": "^2.9.0",
|
|
137
|
+
"postcss": "^8.5.16"
|
|
137
138
|
},
|
|
138
139
|
"devDependencies": {
|
|
139
140
|
"@types/micromatch": "^4.0.10",
|
|
@@ -151,18 +152,12 @@
|
|
|
151
152
|
"husky": "^9.1.7",
|
|
152
153
|
"license-checker-rseidelsohn": "^5.0.1",
|
|
153
154
|
"lint-staged": "^17.0.8",
|
|
154
|
-
"postcss": "^8.5.16",
|
|
155
155
|
"rimraf": "^6.1.3",
|
|
156
156
|
"tsc-alias": "^1.8.17",
|
|
157
|
-
"tsx": "^4.
|
|
157
|
+
"tsx": "^4.23.0",
|
|
158
158
|
"typescript": "^6.0.3",
|
|
159
159
|
"vitest": "^4.1.8"
|
|
160
160
|
},
|
|
161
|
-
"overrides": {
|
|
162
|
-
"next": {
|
|
163
|
-
"postcss": "8.5.15"
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
161
|
"lint-staged": {
|
|
167
162
|
"*.{ts,tsx,js,jsx}": [
|
|
168
163
|
"eslint --fix",
|