@educa-corp/sdd-framework 0.7.4 → 0.7.5
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/bin/gate-trace.js +13 -1
- package/bin/index.js +18 -1
- package/bin/lint-trace.js +14 -1
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/templates/ci/trace-gate.gitlab-ci.yml +7 -1
- package/package.json +1 -1
package/bin/gate-trace.js
CHANGED
|
@@ -63,6 +63,18 @@ const NO_RECONCILE = argv.includes('--no-reconcile');
|
|
|
63
63
|
const TRACE_DIRS = flag('--trace', '.trace').split(',').map(s => s.trim()).filter(Boolean);
|
|
64
64
|
const REPORT_ARG = flag('--report', null);
|
|
65
65
|
|
|
66
|
+
// Version của framework — IN RA MỌI LẦN CHẠY.
|
|
67
|
+
//
|
|
68
|
+
// Vì sao (báo cáo từ project thật): người dùng chạy `npx …@${SDD_VERSION} --lint-trace`
|
|
69
|
+
// trong CI và KHÔNG có cách nào biết bản nào thật sự chạy. `npx` cache theo version, biến
|
|
70
|
+
// CI có thể rỗng, và `.agent/FRAMEWORK_VERSION` chỉ nói bản ĐÃ CÀI chứ không nói bản đang
|
|
71
|
+
// KIỂM. Nên câu "lỗi này sửa chưa?" không trả lời được từ log — đúng lúc cần nhất.
|
|
72
|
+
// Một cổng quyết định PR nào được merge thì phải nói nó là ai.
|
|
73
|
+
const FW_VERSION = (() => {
|
|
74
|
+
try { return require(path.join(__dirname, '..', 'package.json')).version; }
|
|
75
|
+
catch { return '?'; }
|
|
76
|
+
})();
|
|
77
|
+
|
|
66
78
|
const fails = [];
|
|
67
79
|
const warns = [];
|
|
68
80
|
const oks = [];
|
|
@@ -434,7 +446,7 @@ if (AS_JSON) {
|
|
|
434
446
|
}
|
|
435
447
|
|
|
436
448
|
console.log('');
|
|
437
|
-
console.log(
|
|
449
|
+
console.log(`Trace gate v${FW_VERSION} (bin/trace-schema.json → gate) ...`);
|
|
438
450
|
console.log('');
|
|
439
451
|
|
|
440
452
|
for (const o of oks) console.log(` ✅ ${o}`);
|
package/bin/index.js
CHANGED
|
@@ -45,6 +45,10 @@ const isInit = args.includes('--init');
|
|
|
45
45
|
const isProject = args.includes('--project');
|
|
46
46
|
const installHooks = args.includes('--hooks');
|
|
47
47
|
const showHelp = args.includes('--help') || args.includes('-h');
|
|
48
|
+
// `--version` / `-v` — trả lời "bản nào đang chạy?" bằng MỘT lệnh, không cần đoán.
|
|
49
|
+
// Cần thiết vì `npx` cache theo version và biến CI có thể rỗng: `npx pkg@${VAR}` với VAR
|
|
50
|
+
// rỗng thành `pkg@` ⇒ npm resolve về latest, và log không nói gì về việc đó.
|
|
51
|
+
const showVersion = args.includes('--version') || args.includes('-v');
|
|
48
52
|
|
|
49
53
|
// --module <name> flag
|
|
50
54
|
const moduleIdx = args.indexOf('--module');
|
|
@@ -97,8 +101,21 @@ const MODULE_STACK = {
|
|
|
97
101
|
'phaser-game': { language: 'TypeScript', framework: 'Phaser 3' },
|
|
98
102
|
};
|
|
99
103
|
|
|
104
|
+
if (showVersion) {
|
|
105
|
+
// In cả hai: version package VÀ version của core/ dựng sẵn. Lệch nhau nghĩa là bản cài
|
|
106
|
+
// hỏng (index.js §corePrebuilt sẽ xử) — thấy được ở đây thì đỡ một vòng chẩn đoán.
|
|
107
|
+
let coreV = '(không có core/)';
|
|
108
|
+
try { coreV = fs.readFileSync(path.join(ROOT, 'core', 'FRAMEWORK_VERSION'), 'utf8').trim(); } catch {}
|
|
109
|
+
console.log(`@educa-corp/sdd-framework ${VERSION}`);
|
|
110
|
+
console.log(` core/FRAMEWORK_VERSION : ${coreV}${coreV === VERSION ? '' : ' ⚠️ LỆCH — bản cài hỏng'}`);
|
|
111
|
+
process.exit(0);
|
|
112
|
+
}
|
|
113
|
+
|
|
100
114
|
if (showHelp) {
|
|
101
|
-
console.log(
|
|
115
|
+
console.log(`Usage: npx @educa-corp/sdd-framework [options] (v${VERSION})`);
|
|
116
|
+
console.log('');
|
|
117
|
+
console.log('');
|
|
118
|
+
console.log(' --version, -v In version đang chạy (package + core/). Dùng để chắc `npx` không lấy bản cache.');
|
|
102
119
|
console.log('');
|
|
103
120
|
console.log('Install modes:');
|
|
104
121
|
console.log(' --init Install framework to .agent/ + create shortcuts in .claude/commands/');
|
package/bin/lint-trace.js
CHANGED
|
@@ -53,6 +53,18 @@ const flag = (name, def) => {
|
|
|
53
53
|
const i = argv.indexOf(name);
|
|
54
54
|
return i !== -1 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : def;
|
|
55
55
|
};
|
|
56
|
+
// Version của framework — IN RA MỌI LẦN CHẠY.
|
|
57
|
+
//
|
|
58
|
+
// Vì sao (báo cáo từ project thật): người dùng chạy `npx …@${SDD_VERSION} --lint-trace`
|
|
59
|
+
// trong CI và KHÔNG có cách nào biết bản nào thật sự chạy. `npx` cache theo version, biến
|
|
60
|
+
// CI có thể rỗng, và `.agent/FRAMEWORK_VERSION` chỉ nói bản ĐÃ CÀI chứ không nói bản đang
|
|
61
|
+
// KIỂM. Nên câu "lỗi này sửa chưa?" không trả lời được từ log — đúng lúc cần nhất.
|
|
62
|
+
// Một cổng quyết định PR nào được merge thì phải nói nó là ai.
|
|
63
|
+
const FW_VERSION = (() => {
|
|
64
|
+
try { return require(path.join(__dirname, '..', 'package.json')).version; }
|
|
65
|
+
catch { return '?'; }
|
|
66
|
+
})();
|
|
67
|
+
|
|
56
68
|
const WARN_ONLY = argv.includes('--warn-only');
|
|
57
69
|
const AS_JSON = argv.includes('--json');
|
|
58
70
|
const TRACE_DIRS = flag('--trace', '.trace').split(',').map(s => s.trim()).filter(Boolean);
|
|
@@ -657,13 +669,14 @@ for (const dir of TRACE_DIRS) {
|
|
|
657
669
|
if (AS_JSON) {
|
|
658
670
|
console.log(JSON.stringify({
|
|
659
671
|
ok: errors.length === 0,
|
|
672
|
+
framework_version: FW_VERSION,
|
|
660
673
|
scanned, trace_dirs: foundDirs, git_state: _gitState, errors, warns, infos,
|
|
661
674
|
}, null, 2));
|
|
662
675
|
process.exit(errors.length && !WARN_ONLY ? 1 : 0);
|
|
663
676
|
}
|
|
664
677
|
|
|
665
678
|
console.log('');
|
|
666
|
-
console.log(
|
|
679
|
+
console.log(`Lint trace v${FW_VERSION} (bin/trace-schema.json) ...`);
|
|
667
680
|
console.log('');
|
|
668
681
|
|
|
669
682
|
if (!foundDirs.length) {
|
package/core/FRAMEWORK_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.5
|
|
@@ -75,9 +75,15 @@ variables:
|
|
|
75
75
|
- CHANGE_ME
|
|
76
76
|
|
|
77
77
|
before_script:
|
|
78
|
-
#
|
|
78
|
+
# Ba dòng này tồn tại để bẫy 2, 4 và "npx lấy bản cache" lộ ra NGAY ở đầu log, chứ không
|
|
79
|
+
# lộ ra dưới dạng một dấu xanh sai.
|
|
79
80
|
- node -v
|
|
80
81
|
- git --version
|
|
82
|
+
# CHỨNG MINH version đã pin. `npx` cache theo version, và một biến CI rỗng làm
|
|
83
|
+
# `pkg@${SDD_VERSION}` thành `pkg@` ⇒ npm resolve về latest mà log không nói gì.
|
|
84
|
+
# Dòng này in ra version THẬT sẽ chạy — nếu nó khác SDD_VERSION thì bạn thấy ngay.
|
|
85
|
+
- echo "SDD_VERSION=${SDD_VERSION}"
|
|
86
|
+
- npx -y @educa-corp/sdd-framework@${SDD_VERSION} --version
|
|
81
87
|
|
|
82
88
|
# ── 1+2. Cấu trúc sổ + cổng chặn cờ 🔴 ───────────────────────────────────────
|
|
83
89
|
# Sổ trace 24 cột do LLM ghi tay: một dấu tab thiếu dồn mọi ô sang trái, ô `status`
|