pumuki-ast-hooks 5.3.24 → 5.3.26
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.26",
|
|
4
4
|
"description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -121,20 +121,25 @@ const commands = {
|
|
|
121
121
|
},
|
|
122
122
|
|
|
123
123
|
ast: () => {
|
|
124
|
-
const env = { ...process.env };
|
|
125
124
|
const filteredArgs = [];
|
|
125
|
+
let stagingOnlyMode = false;
|
|
126
126
|
|
|
127
127
|
for (const arg of args) {
|
|
128
128
|
if (arg === '--staged') {
|
|
129
|
-
|
|
129
|
+
stagingOnlyMode = true;
|
|
130
130
|
} else {
|
|
131
131
|
filteredArgs.push(arg);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
const execEnv = { ...process.env };
|
|
136
|
+
if (stagingOnlyMode) {
|
|
137
|
+
execEnv.STAGING_ONLY_MODE = '1';
|
|
138
|
+
}
|
|
139
|
+
|
|
135
140
|
execSync(
|
|
136
141
|
`node ${path.join(HOOKS_ROOT, 'infrastructure/ast/ast-intelligence.js')} ${filteredArgs.join(' ')}`,
|
|
137
|
-
{ stdio: 'inherit', env }
|
|
142
|
+
{ stdio: 'inherit', env: execEnv }
|
|
138
143
|
);
|
|
139
144
|
},
|
|
140
145
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const ENV = (
|
|
1
|
+
const ENV = (function () {
|
|
2
|
+
return (process.env.NODE_ENV || 'development').toLowerCase();
|
|
3
|
+
})();
|
|
2
4
|
|
|
3
5
|
function normalizeBool(val, defaultValue = false) {
|
|
4
6
|
if (val === undefined) return defaultValue;
|
|
@@ -323,6 +323,31 @@ async function runPlatformAnalysis(project, findings, context) {
|
|
|
323
323
|
* Generate analysis output and reports
|
|
324
324
|
*/
|
|
325
325
|
function generateOutput(findings, context, project, root) {
|
|
326
|
+
const stagingOnlyMode = env.get('STAGING_ONLY_MODE', '0') === '1';
|
|
327
|
+
if (stagingOnlyMode) {
|
|
328
|
+
try {
|
|
329
|
+
const { execSync } = require('child_process');
|
|
330
|
+
const stagedRel = execSync('git diff --cached --name-only --diff-filter=ACM', {
|
|
331
|
+
encoding: 'utf8',
|
|
332
|
+
cwd: root
|
|
333
|
+
})
|
|
334
|
+
.trim()
|
|
335
|
+
.split('\n')
|
|
336
|
+
.map(s => s.trim())
|
|
337
|
+
.filter(Boolean);
|
|
338
|
+
|
|
339
|
+
const stagedAbs = new Set(stagedRel.map(r => path.resolve(root, r)));
|
|
340
|
+
findings = (findings || []).filter(f => {
|
|
341
|
+
if (!f || !f.filePath) return false;
|
|
342
|
+
const fp = String(f.filePath);
|
|
343
|
+
if (stagedAbs.has(fp)) return true;
|
|
344
|
+
return stagedRel.some(rel => fp.endsWith(rel) || fp.includes(`/${rel}`));
|
|
345
|
+
});
|
|
346
|
+
} catch {
|
|
347
|
+
findings = [];
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
326
351
|
const levelTotals = { CRITICAL: 0, HIGH: 0, MEDIUM: 0, LOW: 0 };
|
|
327
352
|
const platformTotals = { Backend: 0, Frontend: 0, iOS: 0, Android: 0, Other: 0 };
|
|
328
353
|
|