repomap-bin 2.3.2 → 2.4.2
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/install.js +10 -0
- package/package.json +14 -24
- package/repomap +0 -0
- package/index.js +0 -47
- package/run.js +0 -62
package/install.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Postinstall: ensure the binary is executable
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const bin = path.join(__dirname, 'repomap');
|
|
6
|
+
try {
|
|
7
|
+
fs.chmodSync(bin, 0o755);
|
|
8
|
+
} catch (e) {
|
|
9
|
+
// binary might not exist during dev; ignore
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,34 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repomap-bin",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Standalone repomap binary
|
|
5
|
-
"type": "module",
|
|
3
|
+
"version": "2.4.2",
|
|
4
|
+
"description": "Standalone repomap binary — tree-sitter AST code intelligence CLI",
|
|
6
5
|
"bin": {
|
|
7
|
-
"repomap": "
|
|
6
|
+
"repomap": "repomap"
|
|
8
7
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"index.js"
|
|
12
|
-
],
|
|
13
|
-
"optionalDependencies": {
|
|
14
|
-
"repomap-bin-linux-x64": "2.3.1",
|
|
15
|
-
"repomap-bin-darwin-arm64": "2.3.1",
|
|
16
|
-
"repomap-bin-windows-x64": "2.3.1"
|
|
17
|
-
},
|
|
18
|
-
"engines": {
|
|
19
|
-
"node": ">=18"
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node install.js"
|
|
20
10
|
},
|
|
21
|
-
"
|
|
11
|
+
"files": [
|
|
22
12
|
"repomap",
|
|
23
|
-
"
|
|
24
|
-
"ast",
|
|
25
|
-
"code-analysis",
|
|
26
|
-
"cli"
|
|
13
|
+
"install.js"
|
|
27
14
|
],
|
|
15
|
+
"os": ["linux"],
|
|
16
|
+
"cpu": ["x64"],
|
|
17
|
+
"keywords": ["repomap", "tree-sitter", "ast", "code-analysis", "cli"],
|
|
18
|
+
"author": "gjczone",
|
|
19
|
+
"license": "MIT",
|
|
28
20
|
"repository": {
|
|
29
21
|
"type": "git",
|
|
30
|
-
"url": "
|
|
31
|
-
}
|
|
32
|
-
"homepage": "https://github.com/gjczone/repomap",
|
|
33
|
-
"license": "MIT"
|
|
22
|
+
"url": "https://github.com/gjczone/repomap"
|
|
23
|
+
}
|
|
34
24
|
}
|
package/repomap
ADDED
|
Binary file
|
package/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { join, dirname } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
|
|
6
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const localRequire = createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
function findBinary() {
|
|
10
|
-
const platform = process.platform;
|
|
11
|
-
const arch = process.arch;
|
|
12
|
-
const binName = platform === "win32" ? "repomap.exe" : "repomap";
|
|
13
|
-
|
|
14
|
-
// 1. Check repo dist/ directory (local development)
|
|
15
|
-
const repoBin = join(__dirname, "..", "..", "dist", binName);
|
|
16
|
-
if (existsSync(repoBin)) return repoBin;
|
|
17
|
-
|
|
18
|
-
// 2. Resolve platform package via Node module resolution (handles hoisted, npx, yarn, pnpm)
|
|
19
|
-
const platformPackages = {
|
|
20
|
-
"linux-x64": { pkg: "repomap-bin-linux-x64", bin: "repomap" },
|
|
21
|
-
"darwin-arm64": { pkg: "repomap-bin-darwin-arm64", bin: "repomap" },
|
|
22
|
-
"win32-x64": { pkg: "repomap-bin-windows-x64", bin: "repomap.exe" },
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const key = `${platform}-${arch}`;
|
|
26
|
-
const info = platformPackages[key];
|
|
27
|
-
if (info) {
|
|
28
|
-
try {
|
|
29
|
-
const pkgJson = localRequire.resolve(`${info.pkg}/package.json`);
|
|
30
|
-
const candidate = join(dirname(pkgJson), info.bin);
|
|
31
|
-
if (existsSync(candidate)) return candidate;
|
|
32
|
-
} catch { /* not resolvable */ }
|
|
33
|
-
|
|
34
|
-
// Non-hoisted: inside repomap-bin's own node_modules
|
|
35
|
-
const nested = join(__dirname, "node_modules", info.pkg, info.bin);
|
|
36
|
-
if (existsSync(nested)) return nested;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 3. PATH fallback
|
|
40
|
-
return binName;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function getBinaryPath() {
|
|
44
|
-
return findBinary();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default { getBinaryPath };
|
package/run.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
import { existsSync } from "node:fs";
|
|
5
|
-
import { join, dirname } from "node:path";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
|
|
8
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const localRequire = createRequire(import.meta.url);
|
|
10
|
-
|
|
11
|
-
function findBinary() {
|
|
12
|
-
const platform = process.platform;
|
|
13
|
-
const arch = process.arch;
|
|
14
|
-
const binName = platform === "win32" ? "repomap.exe" : "repomap";
|
|
15
|
-
|
|
16
|
-
// 1. Check repo dist/ directory (local development)
|
|
17
|
-
const repoBin = join(__dirname, "..", "..", "dist", binName);
|
|
18
|
-
if (existsSync(repoBin)) return repoBin;
|
|
19
|
-
|
|
20
|
-
// 2. Resolve platform package via Node module resolution (handles hoisted, npx, yarn, pnpm)
|
|
21
|
-
const platformPackages = {
|
|
22
|
-
"linux-x64": { pkg: "repomap-bin-linux-x64", bin: "repomap" },
|
|
23
|
-
"darwin-arm64": { pkg: "repomap-bin-darwin-arm64", bin: "repomap" },
|
|
24
|
-
"win32-x64": { pkg: "repomap-bin-windows-x64", bin: "repomap.exe" },
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const key = `${platform}-${arch}`;
|
|
28
|
-
const info = platformPackages[key];
|
|
29
|
-
if (info) {
|
|
30
|
-
try {
|
|
31
|
-
const pkgJson = localRequire.resolve(`${info.pkg}/package.json`);
|
|
32
|
-
const candidate = join(dirname(pkgJson), info.bin);
|
|
33
|
-
if (existsSync(candidate)) return candidate;
|
|
34
|
-
} catch { /* not resolvable */ }
|
|
35
|
-
|
|
36
|
-
// Non-hoisted: inside repomap-bin's own node_modules
|
|
37
|
-
const nested = join(__dirname, "node_modules", info.pkg, info.bin);
|
|
38
|
-
if (existsSync(nested)) return nested;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// 3. PATH fallback
|
|
42
|
-
return binName;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const binaryPath = findBinary();
|
|
46
|
-
|
|
47
|
-
if (!binaryPath) {
|
|
48
|
-
console.error(
|
|
49
|
-
"repomap binary not found for this platform.\n" +
|
|
50
|
-
"Try: npm install repomap-bin"
|
|
51
|
-
);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
execFileSync(binaryPath, process.argv.slice(2), {
|
|
57
|
-
stdio: "inherit",
|
|
58
|
-
env: { ...process.env },
|
|
59
|
-
});
|
|
60
|
-
} catch (e) {
|
|
61
|
-
process.exit(e.status ?? 1);
|
|
62
|
-
}
|