@ngocsangairvds/vsaf 3.1.12 → 3.1.13
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 +1 -1
- package/src/utils.js +10 -1
- package/src/workflow.js +47 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngocsangairvds/vsaf",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.13",
|
|
4
4
|
"description": "VSAF — Agentic AI SDLC Framework. 3 integrated tools: BMAD, GitNexus, Superpowers. 2-layer review.",
|
|
5
5
|
"keywords": ["claude", "claude-code", "ai", "sdlc", "framework", "bmad", "gitnexus", "superpowers"],
|
|
6
6
|
"bin": {
|
package/src/utils.js
CHANGED
|
@@ -52,10 +52,19 @@ function copyFile(src, dst) {
|
|
|
52
52
|
fs.copyFileSync(src, dst);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
function hasGitCommits() {
|
|
56
|
+
try {
|
|
57
|
+
execSync('git rev-parse HEAD', { stdio: 'pipe', shell: true });
|
|
58
|
+
return true;
|
|
59
|
+
} catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
function getPlatform() {
|
|
56
65
|
if (process.platform === 'win32') return 'windows';
|
|
57
66
|
if (process.platform === 'darwin') return 'macos';
|
|
58
67
|
return 'linux';
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
module.exports = { ok, info, warn, step, hasCommand, exec, copyDir, copyFile, CLAUDE_HOME, isWindows, getPlatform };
|
|
70
|
+
module.exports = { ok, info, warn, step, hasCommand, exec, copyDir, copyFile, CLAUDE_HOME, isWindows, getPlatform, hasGitCommits };
|
package/src/workflow.js
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const { ok, info, warn, step, hasCommand, exec, isWindows, hasGitCommits } = require('./utils');
|
|
6
|
+
|
|
7
|
+
function preflightCheck() {
|
|
8
|
+
// Check: is this a git repo?
|
|
9
|
+
if (!fs.existsSync(path.join(process.cwd(), '.git'))) {
|
|
10
|
+
warn('Not a git repository. Run: git init');
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Check: does the repo have at least one commit?
|
|
15
|
+
if (!hasGitCommits()) {
|
|
16
|
+
warn('Repository has no commits yet.');
|
|
17
|
+
warn('GitNexus requires at least one commit to index.');
|
|
18
|
+
info('Fix: create an initial commit first:');
|
|
19
|
+
info(' git add .');
|
|
20
|
+
info(' git commit -m "initial commit"');
|
|
21
|
+
info('Then retry: vsaf index');
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Check (Windows): is LadybugDB native binding present?
|
|
26
|
+
if (isWindows) {
|
|
27
|
+
try {
|
|
28
|
+
const npmRoot = require('child_process')
|
|
29
|
+
.execSync('npm root -g', { encoding: 'utf8', shell: true }).trim();
|
|
30
|
+
const lbugNode = path.join(npmRoot, 'gitnexus', 'node_modules', '@ladybugdb', 'core', 'lbugjs.node');
|
|
31
|
+
if (!fs.existsSync(lbugNode)) {
|
|
32
|
+
warn('LadybugDB native binding missing (lbugjs.node).');
|
|
33
|
+
warn('gitnexus analyze will fail at 60% without it.');
|
|
34
|
+
info('Fix: run this in CMD:');
|
|
35
|
+
info(' cd "' + path.join(npmRoot, 'gitnexus') + '"');
|
|
36
|
+
info(' npm install @ladybugdb/core-win32-x64 --no-save');
|
|
37
|
+
info('Then retry: vsaf index');
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
} catch { /* can't check, proceed anyway */ }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
4
45
|
|
|
5
46
|
function runIndex() {
|
|
6
47
|
step('Index');
|
|
@@ -10,9 +51,12 @@ function runIndex() {
|
|
|
10
51
|
return false;
|
|
11
52
|
}
|
|
12
53
|
|
|
13
|
-
|
|
54
|
+
if (!preflightCheck()) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
14
58
|
info('Running gitnexus analyze...');
|
|
15
|
-
const gitnexusOk = exec(
|
|
59
|
+
const gitnexusOk = exec('gitnexus analyze --skip-git');
|
|
16
60
|
if (gitnexusOk) {
|
|
17
61
|
ok('GitNexus index updated');
|
|
18
62
|
} else {
|