@rensoai/code-graph 1.0.3

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/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # npm channel — `npm install -g @rensoai/code-graph`
2
+
3
+ Uses the `esbuild`/`swc`/`turbo` platform-package pattern: a meta
4
+ package `@rensoai/code-graph` declares per-platform sub-packages as
5
+ `optionalDependencies`. npm picks the right one at install time. No
6
+ postinstall network call.
7
+
8
+ ## Files in this directory
9
+
10
+ - `package.json` — meta package manifest (`@rensoai/code-graph`)
11
+ - `bin/code_graph.js`, `bin/code_graph-mcp.js` — tiny Node shims that
12
+ resolve the matching platform sub-package and spawn its binary
13
+ - `platforms/` — per-platform sub-package templates, generated at
14
+ release time
15
+
16
+ ## Sub-packages published
17
+
18
+ | Sub-package name | Binary target |
19
+ |-----------------------------------|--------------------------|
20
+ | `@rensoai/code-graph-linux-x64-gnu` | x86_64-unknown-linux-gnu |
21
+ | `@rensoai/code-graph-linux-arm64-gnu` | aarch64-unknown-linux-gnu |
22
+ | `@rensoai/code-graph-darwin-x64` | x86_64-apple-darwin |
23
+ | `@rensoai/code-graph-darwin-arm64` | aarch64-apple-darwin |
24
+ | `@rensoai/code-graph-win32-x64` | x86_64-pc-windows-msvc |
25
+
26
+ ## Publish order
27
+
28
+ The `publish-npm` job in `.github/workflows/release.yml`:
29
+
30
+ 1. Templates each platform `package.json` with the current version.
31
+ 2. Copies the matching binary into each platform sub-package directory.
32
+ 3. Publishes all five platform sub-packages (`npm publish` each).
33
+ 4. Waits 60 seconds for registry CDN propagation.
34
+ 5. Publishes the meta package.
35
+
36
+ **Order matters.** Publishing the meta package before platform
37
+ sub-packages propagate causes warm-cache `npm install` failures.
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ // @rensoai/code-graph MCP-server shim. Mirrors bin/code_graph.js but
3
+ // spawns the `code_graph-mcp` binary inside the platform sub-package.
4
+
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("child_process");
8
+ const path = require("path");
9
+ const fs = require("fs");
10
+
11
+ function platformPackage() {
12
+ const { platform, arch } = process;
13
+ const key = `${platform}-${arch}`;
14
+ const map = {
15
+ "linux-x64": "@rensoai/code-graph-linux-x64-gnu",
16
+ "linux-arm64": "@rensoai/code-graph-linux-arm64-gnu",
17
+ "darwin-x64": "@rensoai/code-graph-darwin-x64",
18
+ "darwin-arm64":"@rensoai/code-graph-darwin-arm64",
19
+ "win32-x64": "@rensoai/code-graph-win32-x64",
20
+ };
21
+ const pkg = map[key];
22
+ if (!pkg) {
23
+ console.error(
24
+ `error: @rensoai/code-graph: no prebuilt binary for ${key}. ` +
25
+ `Supported platforms: ${Object.keys(map).join(", ")}.`
26
+ );
27
+ process.exit(1);
28
+ }
29
+ return pkg;
30
+ }
31
+
32
+ function binaryPath() {
33
+ const pkg = platformPackage();
34
+ let pkgRoot;
35
+ try {
36
+ pkgRoot = path.dirname(require.resolve(`${pkg}/package.json`));
37
+ } catch (err) {
38
+ console.error(
39
+ `error: @rensoai/code-graph: platform sub-package ${pkg} not installed.`
40
+ );
41
+ process.exit(1);
42
+ }
43
+ const ext = process.platform === "win32" ? ".exe" : "";
44
+ const candidate = path.join(pkgRoot, "bin", `code_graph-mcp${ext}`);
45
+ if (!fs.existsSync(candidate)) {
46
+ console.error(`error: ${candidate} missing from ${pkg}`);
47
+ process.exit(1);
48
+ }
49
+ return candidate;
50
+ }
51
+
52
+ const bin = binaryPath();
53
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
54
+ if (result.error) {
55
+ console.error(`error: spawning ${bin}: ${result.error.message}`);
56
+ process.exit(1);
57
+ }
58
+ process.exit(result.status ?? 0);
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ // @rensoai/code-graph CLI shim.
3
+ //
4
+ // Resolves the matching platform sub-package, locates the bundled
5
+ // native binary inside it, and spawns it forwarding stdio + argv +
6
+ // env. Exits with the child's exit code.
7
+
8
+ "use strict";
9
+
10
+ const { spawnSync } = require("child_process");
11
+ const path = require("path");
12
+ const fs = require("fs");
13
+
14
+ function platformPackage() {
15
+ const { platform, arch } = process;
16
+ const key = `${platform}-${arch}`;
17
+ const map = {
18
+ "linux-x64": "@rensoai/code-graph-linux-x64-gnu",
19
+ "linux-arm64": "@rensoai/code-graph-linux-arm64-gnu",
20
+ "darwin-x64": "@rensoai/code-graph-darwin-x64",
21
+ "darwin-arm64":"@rensoai/code-graph-darwin-arm64",
22
+ "win32-x64": "@rensoai/code-graph-win32-x64",
23
+ };
24
+ const pkg = map[key];
25
+ if (!pkg) {
26
+ console.error(
27
+ `error: @rensoai/code-graph: no prebuilt binary for ${key}. ` +
28
+ `Supported platforms: ${Object.keys(map).join(", ")}.`
29
+ );
30
+ process.exit(1);
31
+ }
32
+ return pkg;
33
+ }
34
+
35
+ function binaryPath() {
36
+ const pkg = platformPackage();
37
+ let pkgRoot;
38
+ try {
39
+ pkgRoot = path.dirname(require.resolve(`${pkg}/package.json`));
40
+ } catch (err) {
41
+ console.error(
42
+ `error: @rensoai/code-graph: platform sub-package ${pkg} not installed. ` +
43
+ `Run \`npm install -g @rensoai/code-graph\` and ensure ` +
44
+ `optionalDependencies are not blocked (--include=optional).`
45
+ );
46
+ process.exit(1);
47
+ }
48
+ const ext = process.platform === "win32" ? ".exe" : "";
49
+ const candidate = path.join(pkgRoot, "bin", `code_graph${ext}`);
50
+ if (!fs.existsSync(candidate)) {
51
+ console.error(`error: ${candidate} missing from ${pkg}`);
52
+ process.exit(1);
53
+ }
54
+ return candidate;
55
+ }
56
+
57
+ const bin = binaryPath();
58
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
59
+ if (result.error) {
60
+ console.error(`error: spawning ${bin}: ${result.error.message}`);
61
+ process.exit(1);
62
+ }
63
+ process.exit(result.status ?? 0);
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@rensoai/code-graph",
3
+ "version": "1.0.3",
4
+ "description": "Dependency graph analyzer for code, tests, docs, and policy surfaces. Bundles the prebuilt code_graph + code_graph-mcp binaries via per-platform sub-packages.",
5
+ "keywords": [
6
+ "code-graph",
7
+ "static-analysis",
8
+ "llm",
9
+ "mcp",
10
+ "blast-radius",
11
+ "rust"
12
+ ],
13
+ "homepage": "https://cg.renso.ai",
14
+ "bugs": "https://github.com/Renso-AI/code-graph-dist/issues",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/Renso-AI/code-graph-dist.git",
18
+ "directory": "packaging/wrappers/npm"
19
+ },
20
+ "license": "UNLICENSED",
21
+ "author": "Renso AI",
22
+ "engines": {
23
+ "node": ">=16"
24
+ },
25
+ "bin": {
26
+ "code_graph": "./bin/code_graph.js",
27
+ "code_graph-mcp": "./bin/code_graph-mcp.js"
28
+ },
29
+ "files": [
30
+ "bin/",
31
+ "README.md"
32
+ ],
33
+ "optionalDependencies": {
34
+ "@rensoai/code-graph-linux-x64-gnu": "1.0.3",
35
+ "@rensoai/code-graph-linux-arm64-gnu": "1.0.3",
36
+ "@rensoai/code-graph-darwin-x64": "1.0.3",
37
+ "@rensoai/code-graph-darwin-arm64": "1.0.3",
38
+ "@rensoai/code-graph-win32-x64": "1.0.3"
39
+ }
40
+ }