staklink 0.3.18 → 0.3.20
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/proxy-server.cjs +46 -1
- package/dist/staklink-cli.cjs +1 -1
- package/package.json +1 -1
package/dist/proxy-server.cjs
CHANGED
|
@@ -33935,7 +33935,7 @@ var SSEManager = class {
|
|
|
33935
33935
|
var sseManager = new SSEManager();
|
|
33936
33936
|
|
|
33937
33937
|
// src/proxy/version.ts
|
|
33938
|
-
var VERSION = "0.3.
|
|
33938
|
+
var VERSION = "0.3.20";
|
|
33939
33939
|
|
|
33940
33940
|
// node_modules/uuid/dist/esm/stringify.js
|
|
33941
33941
|
var byteToHex = [];
|
|
@@ -80250,6 +80250,9 @@ async function startProxyServer() {
|
|
|
80250
80250
|
const diffOutput = await repo.execCommand(
|
|
80251
80251
|
"git diff --name-status HEAD"
|
|
80252
80252
|
);
|
|
80253
|
+
const untrackedOutput = await repo.execCommand(
|
|
80254
|
+
"git ls-files --others --exclude-standard"
|
|
80255
|
+
);
|
|
80253
80256
|
const lines = diffOutput.trim().split("\n").filter((line) => line);
|
|
80254
80257
|
for (const line of lines) {
|
|
80255
80258
|
const parts = line.split(" ");
|
|
@@ -80289,6 +80292,27 @@ async function startProxyServer() {
|
|
|
80289
80292
|
errors: []
|
|
80290
80293
|
});
|
|
80291
80294
|
}
|
|
80295
|
+
const untrackedLines = untrackedOutput.trim().split("\n").filter((line) => line);
|
|
80296
|
+
for (const filePath of untrackedLines) {
|
|
80297
|
+
let content = "";
|
|
80298
|
+
try {
|
|
80299
|
+
const fileContent = await repo.execCommand(`cat "${filePath}"`);
|
|
80300
|
+
const lines2 = fileContent.split("\n");
|
|
80301
|
+
content = `--- /dev/null
|
|
80302
|
+
+++ b/${filePath}
|
|
80303
|
+
@@ -0,0 +1,${lines2.length} @@
|
|
80304
|
+
${lines2.map((line) => "+" + line).join("\n")}`;
|
|
80305
|
+
} catch (error82) {
|
|
80306
|
+
console.warn(`Error reading untracked file ${filePath}:`, error82);
|
|
80307
|
+
}
|
|
80308
|
+
results.push({
|
|
80309
|
+
file: `${repoName}/${filePath}`,
|
|
80310
|
+
action: "create",
|
|
80311
|
+
content,
|
|
80312
|
+
repoName,
|
|
80313
|
+
errors: []
|
|
80314
|
+
});
|
|
80315
|
+
}
|
|
80292
80316
|
}
|
|
80293
80317
|
res.status(200).json(results);
|
|
80294
80318
|
} catch (error82) {
|
|
@@ -80342,11 +80366,13 @@ async function startProxyServer() {
|
|
|
80342
80366
|
const repos = getReposWithChangedFiles(code);
|
|
80343
80367
|
const createPR = req.query.pr === "true";
|
|
80344
80368
|
const shouldCommit = req.query.commit === "true";
|
|
80369
|
+
const autoMerge = req.query.automerge === "true";
|
|
80345
80370
|
const commits = [];
|
|
80346
80371
|
const prs = {};
|
|
80347
80372
|
const branches = {};
|
|
80348
80373
|
console.log(`=> Commit requested: ${shouldCommit}`);
|
|
80349
80374
|
console.log(`=> PR creation requested: ${createPR}`);
|
|
80375
|
+
console.log(`=> Auto-merge requested: ${autoMerge}`);
|
|
80350
80376
|
console.log(
|
|
80351
80377
|
`=> Git credentials available: ${!!code.git_credentials?.auth_data?.token}`
|
|
80352
80378
|
);
|
|
@@ -80451,9 +80477,11 @@ ${diff.trim()}`);
|
|
|
80451
80477
|
);
|
|
80452
80478
|
await gh.init();
|
|
80453
80479
|
const existingPR = await gh.findPRByBranch();
|
|
80480
|
+
let prNumber;
|
|
80454
80481
|
if (existingPR) {
|
|
80455
80482
|
console.log(`=> PR already exists: ${existingPR.url}`);
|
|
80456
80483
|
prs[repoName] = existingPR.url;
|
|
80484
|
+
prNumber = existingPR.number;
|
|
80457
80485
|
} else {
|
|
80458
80486
|
const pr = await gh.createPR({
|
|
80459
80487
|
title: r.commit_name || `Changes from ${currentBranch2}`,
|
|
@@ -80463,6 +80491,23 @@ ${diff.trim()}`);
|
|
|
80463
80491
|
});
|
|
80464
80492
|
console.log(`=> PR created: ${pr.url}`);
|
|
80465
80493
|
prs[repoName] = pr.url;
|
|
80494
|
+
prNumber = pr.number;
|
|
80495
|
+
}
|
|
80496
|
+
if (autoMerge) {
|
|
80497
|
+
try {
|
|
80498
|
+
console.log(`=> Enabling auto-merge for PR #${prNumber}...`);
|
|
80499
|
+
await gh.mergePR(prNumber, {
|
|
80500
|
+
auto: true,
|
|
80501
|
+
method: "squash",
|
|
80502
|
+
deleteBranch: true
|
|
80503
|
+
});
|
|
80504
|
+
console.log(`=> Auto-merge enabled for PR #${prNumber}`);
|
|
80505
|
+
} catch (autoMergeError) {
|
|
80506
|
+
console.error(
|
|
80507
|
+
`=> Failed to enable auto-merge for PR #${prNumber}:`,
|
|
80508
|
+
autoMergeError
|
|
80509
|
+
);
|
|
80510
|
+
}
|
|
80466
80511
|
}
|
|
80467
80512
|
} catch (prError) {
|
|
80468
80513
|
console.error(`=> Failed to create PR for ${r.url}:`, prError);
|
package/dist/staklink-cli.cjs
CHANGED
|
@@ -10905,7 +10905,7 @@ var glob = Object.assign(glob_, {
|
|
|
10905
10905
|
glob.glob = glob;
|
|
10906
10906
|
|
|
10907
10907
|
// src/proxy/version.ts
|
|
10908
|
-
var VERSION = "0.3.
|
|
10908
|
+
var VERSION = "0.3.20";
|
|
10909
10909
|
|
|
10910
10910
|
// src/cli.ts
|
|
10911
10911
|
var STAKLINK_PROXY = "staklink-proxy";
|