co-maintainer 0.4.0-beta.2 → 0.4.0-beta.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/dist/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "co-maintainer",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.3",
|
|
4
4
|
"description": "Analyzes a GitHub repository and writes repository-specific contribution guidance.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
|
-
"co-maintainer": "
|
|
7
|
+
"co-maintainer": "dist/main.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/",
|
|
@@ -20,7 +20,7 @@ import { getRepo } from "../../store/repos.js";
|
|
|
20
20
|
import { getJob } from "../../store/jobs.js";
|
|
21
21
|
import { getLogsSince } from "../../services/jobs.js";
|
|
22
22
|
import { listInstallationsWithRepos } from "../../github/app.js";
|
|
23
|
-
const REPO = /^\/repos\/([^/]+)\/([^/]+)(?:\/(pulls|knowledge|settings)(?:\/(\d+))?)?$/;
|
|
23
|
+
const REPO = /^\/repos\/([^/]+)\/([^/]+)(?:\/(pulls|knowledge|settings|remote)(?:\/(\d+))?)?$/;
|
|
24
24
|
export async function handlePageRequest(request, deps, ip) {
|
|
25
25
|
const url = new URL(request.url);
|
|
26
26
|
if (url.pathname === "/styles.css" && request.method === "GET") {
|
|
@@ -7,7 +7,13 @@ export type ExecOptions = {
|
|
|
7
7
|
env?: Record<string, string>;
|
|
8
8
|
};
|
|
9
9
|
export type CodegraphRunner = (binary: string, args: string[], worktree: string) => Promise<CommandResult>;
|
|
10
|
-
/** Run the codegraph CLI in a repo root (plan §13.4).
|
|
10
|
+
/** Run the codegraph CLI in a repo root (plan §13.4).
|
|
11
|
+
*
|
|
12
|
+
* On Windows the CLI is a `.cmd`/`.ps1` shim, and `node:child_process.spawn`
|
|
13
|
+
* cannot execute those without a shell — it fails with `EINVAL`. `Deno.Command`
|
|
14
|
+
* resolved them natively, so this wrapper is needed only after the Node move.
|
|
15
|
+
* Route through `cmd /c` exactly like `pr/checkout.ts` does for `git`.
|
|
16
|
+
*/
|
|
11
17
|
export declare function execCodegraph(binary: string, args: string[], cwd: string, options?: ExecOptions): Promise<CommandResult>;
|
|
12
18
|
export declare function createCodegraphRunner(indexDir: string): CodegraphRunner;
|
|
13
19
|
export declare function runCodegraphTool(binary: string, args: string[], worktree: string, runner: CodegraphRunner): Promise<string>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { commandOutput, commandSpawn, envToObject, } from "../util/runtime.js";
|
|
1
|
+
import { commandOutput, commandSpawn, envToObject, isWindows, } from "../util/runtime.js";
|
|
2
2
|
export const LOCAL_CODEGRAPH_DIR = ".co-maintainer-codegraph";
|
|
3
3
|
export const SERVER_CODEGRAPH_DIR = ".codegraph";
|
|
4
4
|
const TOOL_TIMEOUT_MS = 60_000;
|
|
5
5
|
const INDEX_COMMANDS = new Set(["init", "sync", "index", "unlock"]);
|
|
6
|
-
/** Run the codegraph CLI in a repo root (plan §13.4).
|
|
6
|
+
/** Run the codegraph CLI in a repo root (plan §13.4).
|
|
7
|
+
*
|
|
8
|
+
* On Windows the CLI is a `.cmd`/`.ps1` shim, and `node:child_process.spawn`
|
|
9
|
+
* cannot execute those without a shell — it fails with `EINVAL`. `Deno.Command`
|
|
10
|
+
* resolved them natively, so this wrapper is needed only after the Node move.
|
|
11
|
+
* Route through `cmd /c` exactly like `pr/checkout.ts` does for `git`.
|
|
12
|
+
*/
|
|
7
13
|
export async function execCodegraph(binary, args, cwd, options = {}) {
|
|
8
14
|
const indexDir = options.codegraphDir ?? LOCAL_CODEGRAPH_DIR;
|
|
9
15
|
const env = {
|
|
@@ -12,18 +18,20 @@ export async function execCodegraph(binary, args, cwd, options = {}) {
|
|
|
12
18
|
...options.env,
|
|
13
19
|
};
|
|
14
20
|
const timeoutMs = options.timeoutMs === undefined ? TOOL_TIMEOUT_MS : options.timeoutMs;
|
|
21
|
+
const windows = isWindows();
|
|
15
22
|
const commandOptions = {
|
|
16
|
-
args,
|
|
23
|
+
args: windows ? ["/c", binary, ...args] : args,
|
|
17
24
|
cwd,
|
|
18
25
|
env,
|
|
19
26
|
stdout: "piped",
|
|
20
27
|
stderr: "piped",
|
|
21
28
|
};
|
|
29
|
+
const target = windows ? "cmd" : binary;
|
|
22
30
|
if (timeoutMs === null) {
|
|
23
|
-
const output = await commandOutput(
|
|
31
|
+
const output = await commandOutput(target, commandOptions);
|
|
24
32
|
return decode(output);
|
|
25
33
|
}
|
|
26
|
-
const proc = commandSpawn(
|
|
34
|
+
const proc = commandSpawn(target, commandOptions);
|
|
27
35
|
let timedOut = false;
|
|
28
36
|
const timer = setTimeout(() => {
|
|
29
37
|
timedOut = true;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "co-maintainer",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.3",
|
|
4
4
|
"description": "Analyzes a GitHub repository and writes repository-specific contribution guidance.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
|
-
"co-maintainer": "
|
|
7
|
+
"co-maintainer": "dist/main.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/",
|