pumuki-ast-hooks 5.5.27 → 5.5.29

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.
@@ -597,7 +597,7 @@ The library includes a version checker to detect if updates are available:
597
597
 
598
598
  ```bash
599
599
  # Using npm script
600
- npm run check-version
600
+ npm run ast:check-version
601
601
 
602
602
  # Or using CLI directly
603
603
  npx ast-check-version
@@ -666,7 +666,7 @@ This ensures:
666
666
 
667
667
  ```bash
668
668
  # Check version
669
- npm run check-version
669
+ npm run ast:check-version
670
670
 
671
671
  # Verify hooks work
672
672
  git commit --allow-empty -m "test: verify hooks after update"
@@ -678,7 +678,7 @@ You can check for updates periodically:
678
678
 
679
679
  ```bash
680
680
  # Add to your workflow (weekly/monthly)
681
- npm run check-version
681
+ npm run ast:check-version
682
682
  ```
683
683
 
684
684
  ### For Local Development Installations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "5.5.27",
3
+ "version": "5.5.29",
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": {
@@ -115,6 +115,7 @@ class ConfigurationGeneratorService {
115
115
  packageJson.scripts['ast:guard:restart'] = 'bash scripts/hooks-system/bin/evidence-guard restart';
116
116
  packageJson.scripts['ast:guard:status'] = 'bash scripts/hooks-system/bin/evidence-guard status';
117
117
  packageJson.scripts['ast:guard:logs'] = 'bash scripts/hooks-system/bin/evidence-guard logs';
118
+ packageJson.scripts['ast:check-version'] = 'node scripts/hooks-system/bin/check-version.js';
118
119
 
119
120
  fs.writeFileSync(projectPackageJsonPath, JSON.stringify(packageJson, null, 2));
120
121
  this.logSuccess('npm scripts added');
@@ -21,27 +21,29 @@ const COLORS = {
21
21
 
22
22
  function getInstalledVersion() {
23
23
  const projectRoot = process.cwd();
24
-
25
- try {
26
- const packageJsonPath = require.resolve('@pumuki/ast-intelligence-hooks/package.json');
27
- const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
28
- const packageRoot = path.dirname(path.dirname(packageJsonPath));
29
-
30
- const projectPkgPath = path.join(projectRoot, 'package.json');
31
- if (fs.existsSync(projectPkgPath)) {
32
- const projectPkg = JSON.parse(fs.readFileSync(projectPkgPath, 'utf-8'));
33
- const deps = { ...projectPkg.dependencies, ...projectPkg.devDependencies };
34
- const depVersion = deps['@pumuki/ast-intelligence-hooks'];
35
-
36
- if (depVersion && depVersion.startsWith('file:')) {
37
- return { version: pkg.version, type: 'local', path: packageRoot };
24
+ const packageNames = ['@pumuki/ast-intelligence-hooks', 'pumuki-ast-hooks'];
25
+
26
+ for (const packageName of packageNames) {
27
+ try {
28
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
29
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
30
+ const packageRoot = path.dirname(path.dirname(packageJsonPath));
31
+
32
+ const projectPkgPath = path.join(projectRoot, 'package.json');
33
+ if (fs.existsSync(projectPkgPath)) {
34
+ const projectPkg = JSON.parse(fs.readFileSync(projectPkgPath, 'utf-8'));
35
+ const deps = { ...projectPkg.dependencies, ...projectPkg.devDependencies };
36
+ const depVersion = deps[packageName];
37
+
38
+ if (depVersion && depVersion.startsWith('file:')) {
39
+ return { version: pkg.version, type: 'local', path: packageRoot, packageName };
40
+ }
38
41
  }
39
- }
40
42
 
41
- return { version: pkg.version, type: 'npm', path: packageRoot };
42
- } catch (err) {
43
- err = null;
44
- // Fallback: continue with local project dependency checks
43
+ return { version: pkg.version, type: 'npm', path: packageRoot, packageName };
44
+ } catch (err) {
45
+ // Try next package name
46
+ }
45
47
  }
46
48
 
47
49
  const projectPkgPath = path.join(projectRoot, 'package.json');
@@ -49,33 +51,43 @@ function getInstalledVersion() {
49
51
  const projectPkg = JSON.parse(fs.readFileSync(projectPkgPath, 'utf-8'));
50
52
  const deps = { ...projectPkg.dependencies, ...projectPkg.devDependencies };
51
53
 
52
- if (deps['@pumuki/ast-intelligence-hooks']) {
53
- let version = deps['@pumuki/ast-intelligence-hooks'];
54
+ for (const packageName of packageNames) {
55
+ if (deps[packageName]) {
56
+ let version = deps[packageName];
57
+
58
+ if (version.startsWith('file:')) {
59
+ const libPath = path.resolve(projectRoot, version.replace('file:', ''));
60
+ const libPackageJson = path.join(libPath, 'package.json');
61
+ if (fs.existsSync(libPackageJson)) {
62
+ const libPkg = JSON.parse(fs.readFileSync(libPackageJson, 'utf-8'));
63
+ return { version: libPkg.version, type: 'local', path: libPath, packageName };
64
+ }
65
+ return { version: 'unknown (local)', type: 'local', path: libPath, packageName };
66
+ }
67
+
68
+ const nodeModulesPath = packageName.startsWith('@')
69
+ ? path.join(projectRoot, 'node_modules', packageName.replace('/', path.sep), 'package.json')
70
+ : path.join(projectRoot, 'node_modules', packageName, 'package.json');
54
71
 
55
- if (version.startsWith('file:')) {
56
- const libPath = path.resolve(projectRoot, version.replace('file:', ''));
57
- const libPackageJson = path.join(libPath, 'package.json');
58
- if (fs.existsSync(libPackageJson)) {
59
- const libPkg = JSON.parse(fs.readFileSync(libPackageJson, 'utf-8'));
60
- return { version: libPkg.version, type: 'local', path: libPath };
72
+ if (fs.existsSync(nodeModulesPath)) {
73
+ const installedPkg = JSON.parse(fs.readFileSync(nodeModulesPath, 'utf-8'));
74
+ return { version: installedPkg.version, type: 'npm', declaredVersion: version, packageName };
61
75
  }
62
- return { version: 'unknown (local)', type: 'local', path: libPath };
63
- }
64
76
 
65
- const nodeModulesPath = path.join(projectRoot, 'node_modules', '@pumuki', 'ast-intelligence-hooks', 'package.json');
66
- if (fs.existsSync(nodeModulesPath)) {
67
- const installedPkg = JSON.parse(fs.readFileSync(nodeModulesPath, 'utf-8'));
68
- return { version: installedPkg.version, type: 'npm', declaredVersion: version };
77
+ return { version: version.replace(/^[\^~]/, ''), type: 'npm', declaredVersion: version, packageName };
69
78
  }
70
-
71
- return { version: version.replace(/^[\^~]/, ''), type: 'npm', declaredVersion: version };
72
79
  }
73
80
  }
74
81
 
75
- const nodeModulesPath = path.join(projectRoot, 'node_modules', '@pumuki', 'ast-intelligence-hooks', 'package.json');
76
- if (fs.existsSync(nodeModulesPath)) {
77
- const pkg = JSON.parse(fs.readFileSync(nodeModulesPath, 'utf-8'));
78
- return { version: pkg.version, type: 'npm' };
82
+ for (const packageName of packageNames) {
83
+ const nodeModulesPath = packageName.startsWith('@')
84
+ ? path.join(projectRoot, 'node_modules', packageName.replace('/', path.sep), 'package.json')
85
+ : path.join(projectRoot, 'node_modules', packageName, 'package.json');
86
+
87
+ if (fs.existsSync(nodeModulesPath)) {
88
+ const pkg = JSON.parse(fs.readFileSync(nodeModulesPath, 'utf-8'));
89
+ return { version: pkg.version, type: 'npm', packageName };
90
+ }
79
91
  }
80
92
 
81
93
  const scriptsPath = path.join(projectRoot, 'scripts', 'hooks-system');