@thozoz/pr-review-go 0.1.0

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.
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const path = require('node:path');
5
+ const { spawnSync } = require('node:child_process');
6
+
7
+ // Kept as an inline copy (not required from ../../scripts/lib/mapping.js) because
8
+ // this file ships standalone inside the published package — the repo-internal
9
+ // script path does not exist on an end user's machine.
10
+ const PLATFORMS = {
11
+ 'linux-x64': '@thozoz/pr-review-go-linux-x64',
12
+ 'linux-arm64': '@thozoz/pr-review-go-linux-arm64',
13
+ 'darwin-x64': '@thozoz/pr-review-go-darwin-x64',
14
+ 'darwin-arm64': '@thozoz/pr-review-go-darwin-arm64',
15
+ 'win32-x64': '@thozoz/pr-review-go-win32-x64',
16
+ 'win32-arm64': '@thozoz/pr-review-go-win32-arm64',
17
+ };
18
+
19
+ const key = `${process.platform}-${process.arch}`;
20
+ const pkgName = PLATFORMS[key];
21
+
22
+ if (!pkgName) {
23
+ process.stderr.write(`pr-review-go: unsupported platform ${key}\n`);
24
+ process.exit(1);
25
+ }
26
+
27
+ let resolvedPath;
28
+ try {
29
+ resolvedPath = require.resolve(`${pkgName}/package.json`);
30
+ } catch (err) {
31
+ process.stderr.write(
32
+ `pr-review-go: could not find platform package "${pkgName}" — was it installed? ` +
33
+ `(try reinstalling without --omit=optional)\n`
34
+ );
35
+ process.exit(1);
36
+ }
37
+
38
+ const pkgDir = path.dirname(resolvedPath);
39
+ const command = path.basename(__filename, '.js');
40
+ const binName = command + (process.platform === 'win32' ? '.exe' : '');
41
+ const binPath = path.join(pkgDir, 'bin', binName);
42
+
43
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
44
+
45
+ if (result.error) {
46
+ process.stderr.write(`${result.error.message}\n`);
47
+ process.exit(1);
48
+ }
49
+
50
+ process.exit(result.status ?? 1);
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const path = require('node:path');
5
+ const { spawnSync } = require('node:child_process');
6
+
7
+ // Kept as an inline copy (not required from ../../scripts/lib/mapping.js) because
8
+ // this file ships standalone inside the published package — the repo-internal
9
+ // script path does not exist on an end user's machine.
10
+ const PLATFORMS = {
11
+ 'linux-x64': '@thozoz/pr-review-go-linux-x64',
12
+ 'linux-arm64': '@thozoz/pr-review-go-linux-arm64',
13
+ 'darwin-x64': '@thozoz/pr-review-go-darwin-x64',
14
+ 'darwin-arm64': '@thozoz/pr-review-go-darwin-arm64',
15
+ 'win32-x64': '@thozoz/pr-review-go-win32-x64',
16
+ 'win32-arm64': '@thozoz/pr-review-go-win32-arm64',
17
+ };
18
+
19
+ const key = `${process.platform}-${process.arch}`;
20
+ const pkgName = PLATFORMS[key];
21
+
22
+ if (!pkgName) {
23
+ process.stderr.write(`pr-review-go: unsupported platform ${key}\n`);
24
+ process.exit(1);
25
+ }
26
+
27
+ let resolvedPath;
28
+ try {
29
+ resolvedPath = require.resolve(`${pkgName}/package.json`);
30
+ } catch (err) {
31
+ process.stderr.write(
32
+ `pr-review-go: could not find platform package "${pkgName}" — was it installed? ` +
33
+ `(try reinstalling without --omit=optional)\n`
34
+ );
35
+ process.exit(1);
36
+ }
37
+
38
+ const pkgDir = path.dirname(resolvedPath);
39
+ const command = path.basename(__filename, '.js');
40
+ const binName = command + (process.platform === 'win32' ? '.exe' : '');
41
+ const binPath = path.join(pkgDir, 'bin', binName);
42
+
43
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
44
+
45
+ if (result.error) {
46
+ process.stderr.write(`${result.error.message}\n`);
47
+ process.exit(1);
48
+ }
49
+
50
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@thozoz/pr-review-go",
3
+ "version": "0.1.0",
4
+ "description": "AI PR reviewer and read-only assistant \u2014 prebuilt Go CLI and webhook server",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/thozoz/pr-review-go.git"
9
+ },
10
+ "bin": {
11
+ "pr-review-go": "bin/pr-review-go.js",
12
+ "pr-review-server": "bin/pr-review-server.js"
13
+ },
14
+ "os": [
15
+ "linux",
16
+ "darwin",
17
+ "win32"
18
+ ],
19
+ "cpu": [
20
+ "x64",
21
+ "arm64"
22
+ ],
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "files": [
27
+ "bin/pr-review-go.js",
28
+ "bin/pr-review-server.js"
29
+ ],
30
+ "optionalDependencies": {
31
+ "@thozoz/pr-review-go-linux-x64": "0.1.0",
32
+ "@thozoz/pr-review-go-linux-arm64": "0.1.0",
33
+ "@thozoz/pr-review-go-darwin-x64": "0.1.0",
34
+ "@thozoz/pr-review-go-darwin-arm64": "0.1.0",
35
+ "@thozoz/pr-review-go-win32-x64": "0.1.0",
36
+ "@thozoz/pr-review-go-win32-arm64": "0.1.0"
37
+ }
38
+ }