aiwf 0.3.12 → 0.3.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiwf",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "AI Workflow Framework for Claude Code with multi-language support (Korean/English)",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -12,6 +12,8 @@
12
12
  },
13
13
  "scripts": {
14
14
  "test": "node --experimental-vm-modules node_modules/.bin/jest",
15
+ "check:deps": "node scripts/check-dependencies.js",
16
+ "prepublishOnly": "npm run check:deps",
15
17
  "lang:status": "node src/cli/index.js lang status",
16
18
  "lang:set": "node src/cli/index.js lang set",
17
19
  "lang:reset": "node src/cli/index.js lang reset",
@@ -67,13 +69,17 @@
67
69
  ],
68
70
  "dependencies": {
69
71
  "chalk": "^5.3.0",
72
+ "chokidar": "^3.5.3",
70
73
  "commander": "^11.1.0",
71
74
  "fs-extra": "^11.3.0",
75
+ "glob": "^10.3.10",
72
76
  "js-yaml": "^4.1.0",
73
77
  "ora": "^8.0.1",
74
78
  "prompts": "^2.4.2",
79
+ "table": "^6.8.1",
75
80
  "tar": "^6.2.1",
76
- "tiktoken": "^1.0.21"
81
+ "tiktoken": "^1.0.21",
82
+ "yaml": "^2.3.4"
77
83
  },
78
84
  "devDependencies": {
79
85
  "jest": "^30.0.3"
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * 의존성 검증 스크립트
5
+ * 모든 import된 패키지가 package.json에 선언되어 있는지 확인
6
+ */
7
+
8
+ import fs from 'fs/promises';
9
+ import path from 'path';
10
+ import { glob } from 'glob';
11
+ import { builtinModules } from 'module';
12
+
13
+ // Node.js 내장 모듈 체크 함수
14
+ function isBuiltinModule(moduleName) {
15
+ const rootModule = moduleName.split('/')[0];
16
+ return builtinModules.includes(rootModule);
17
+ }
18
+
19
+ async function checkDependencies() {
20
+ console.log('🔍 의존성 검증을 시작합니다...\n');
21
+
22
+ try {
23
+ // package.json 읽기
24
+ const packageJson = JSON.parse(await fs.readFile('package.json', 'utf8'));
25
+ const dependencies = {
26
+ ...packageJson.dependencies,
27
+ ...packageJson.devDependencies
28
+ };
29
+
30
+ // 모든 JS 파일 찾기 (템플릿 제외)
31
+ const jsFiles = await glob('src/**/*.js', {
32
+ ignore: ['src/lib/resources/templates/**/*.js']
33
+ });
34
+
35
+ const missingDeps = new Set();
36
+ const foundImports = new Set();
37
+
38
+ for (const file of jsFiles) {
39
+ const content = await fs.readFile(file, 'utf8');
40
+
41
+ // import 문 찾기
42
+ const importMatches = content.match(/import\s+.*?\s+from\s+['"`]([^'"`]+)['"`]/g);
43
+ if (importMatches) {
44
+ for (const match of importMatches) {
45
+ const packageName = match.match(/from\s+['"`]([^'"`]+)['"`]/)[1];
46
+
47
+ // 내장 모듈이나 상대 경로가 아닌 경우만 체크
48
+ if (!packageName.startsWith('.') && !packageName.startsWith('node:') && !isBuiltinModule(packageName)) {
49
+ const rootPackage = packageName.split('/')[0];
50
+ foundImports.add(rootPackage);
51
+
52
+ if (!dependencies[rootPackage]) {
53
+ missingDeps.add(`${rootPackage} (used in ${file})`);
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ // require 문도 찾기 (혹시 있을 경우)
60
+ const requireMatches = content.match(/require\s*\(\s*['"`]([^'"`]+)['"`]\s*\)/g);
61
+ if (requireMatches) {
62
+ for (const match of requireMatches) {
63
+ const packageName = match.match(/['"`]([^'"`]+)['"`]/)[1];
64
+
65
+ if (!packageName.startsWith('.') && !packageName.startsWith('node:') && !isBuiltinModule(packageName)) {
66
+ const rootPackage = packageName.split('/')[0];
67
+ foundImports.add(rootPackage);
68
+
69
+ if (!dependencies[rootPackage]) {
70
+ missingDeps.add(`${rootPackage} (used in ${file})`);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ // 결과 출력
78
+ console.log(`✅ 검사한 파일: ${jsFiles.length}개`);
79
+ console.log(`📦 발견된 외부 패키지: ${foundImports.size}개`);
80
+ console.log(` ${Array.from(foundImports).join(', ')}\n`);
81
+
82
+ if (missingDeps.size > 0) {
83
+ console.log('❌ 누락된 의존성:');
84
+ for (const dep of missingDeps) {
85
+ console.log(` - ${dep}`);
86
+ }
87
+ console.log('\n💡 다음 명령어로 설치하세요:');
88
+ const packages = Array.from(missingDeps).map(dep => dep.split(' ')[0]);
89
+ console.log(` npm install ${packages.join(' ')}`);
90
+ process.exit(1);
91
+ } else {
92
+ console.log('✅ 모든 의존성이 올바르게 선언되어 있습니다!');
93
+ }
94
+
95
+ } catch (error) {
96
+ console.error('❌ 의존성 검증 중 오류 발생:', error.message);
97
+ process.exit(1);
98
+ }
99
+ }
100
+
101
+ checkDependencies();