gitnexus 1.3.5 → 1.3.6

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/dist/cli/index.js CHANGED
@@ -31,11 +31,14 @@ import { augmentCommand } from './augment.js';
31
31
  import { wikiCommand } from './wiki.js';
32
32
  import { queryCommand, contextCommand, impactCommand, cypherCommand } from './tool.js';
33
33
  import { evalServerCommand } from './eval-server.js';
34
+ import { createRequire } from 'node:module';
35
+ const _require = createRequire(import.meta.url);
36
+ const pkg = _require('../../package.json');
34
37
  const program = new Command();
35
38
  program
36
39
  .name('gitnexus')
37
40
  .description('GitNexus local CLI and MCP server')
38
- .version('1.2.0');
41
+ .version(pkg.version);
39
42
  program
40
43
  .command('setup')
41
44
  .description('One-time setup: configure MCP for Cursor, Claude Code, OpenCode')
@@ -10,8 +10,15 @@ import CSharp from 'tree-sitter-c-sharp';
10
10
  import Go from 'tree-sitter-go';
11
11
  import Rust from 'tree-sitter-rust';
12
12
  import PHP from 'tree-sitter-php';
13
- import Swift from 'tree-sitter-swift';
13
+ import { createRequire } from 'node:module';
14
14
  import { SupportedLanguages } from '../../../config/supported-languages.js';
15
+ // tree-sitter-swift is an optionalDependency — may not be installed
16
+ const _require = createRequire(import.meta.url);
17
+ let Swift = null;
18
+ try {
19
+ Swift = _require('tree-sitter-swift');
20
+ }
21
+ catch { }
15
22
  import { LANGUAGE_QUERIES } from '../tree-sitter-queries.js';
16
23
  import { getLanguageFromFilename } from '../utils.js';
17
24
  import { detectFrameworkFromAST } from '../framework-detection.js';
@@ -32,7 +39,7 @@ const languageMap = {
32
39
  [SupportedLanguages.Go]: Go,
33
40
  [SupportedLanguages.Rust]: Rust,
34
41
  [SupportedLanguages.PHP]: PHP.php_only,
35
- [SupportedLanguages.Swift]: Swift,
42
+ ...(Swift ? { [SupportedLanguages.Swift]: Swift } : {}),
36
43
  };
37
44
  const setLanguage = (language, filePath) => {
38
45
  const key = language === SupportedLanguages.TypeScript && filePath.endsWith('.tsx')
@@ -9,8 +9,15 @@ import CSharp from 'tree-sitter-c-sharp';
9
9
  import Go from 'tree-sitter-go';
10
10
  import Rust from 'tree-sitter-rust';
11
11
  import PHP from 'tree-sitter-php';
12
- import Swift from 'tree-sitter-swift';
12
+ import { createRequire } from 'node:module';
13
13
  import { SupportedLanguages } from '../../config/supported-languages.js';
14
+ // tree-sitter-swift is an optionalDependency — may not be installed
15
+ const _require = createRequire(import.meta.url);
16
+ let Swift = null;
17
+ try {
18
+ Swift = _require('tree-sitter-swift');
19
+ }
20
+ catch { }
14
21
  let parser = null;
15
22
  const languageMap = {
16
23
  [SupportedLanguages.JavaScript]: JavaScript,
@@ -24,7 +31,7 @@ const languageMap = {
24
31
  [SupportedLanguages.Go]: Go,
25
32
  [SupportedLanguages.Rust]: Rust,
26
33
  [SupportedLanguages.PHP]: PHP.php_only,
27
- [SupportedLanguages.Swift]: Swift,
34
+ ...(Swift ? { [SupportedLanguages.Swift]: Swift } : {}),
28
35
  };
29
36
  export const loadParser = async () => {
30
37
  if (parser)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -65,13 +65,15 @@
65
65
  "tree-sitter-java": "^0.21.0",
66
66
  "tree-sitter-javascript": "^0.21.0",
67
67
  "tree-sitter-php": "^0.23.12",
68
- "tree-sitter-swift": "^0.6.0",
69
68
  "tree-sitter-python": "^0.21.0",
70
69
  "tree-sitter-rust": "^0.21.0",
71
70
  "tree-sitter-typescript": "^0.21.0",
72
71
  "typescript": "^5.4.5",
73
72
  "uuid": "^13.0.0"
74
73
  },
74
+ "optionalDependencies": {
75
+ "tree-sitter-swift": "^0.6.0"
76
+ },
75
77
  "devDependencies": {
76
78
  "@types/cli-progress": "^3.11.6",
77
79
  "@types/cors": "^2.8.17",