staklink 0.3.8 → 0.3.9

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.
@@ -33901,7 +33901,7 @@ var SSEManager = class {
33901
33901
  var sseManager = new SSEManager();
33902
33902
 
33903
33903
  // src/proxy/version.ts
33904
- var VERSION = "0.3.8";
33904
+ var VERSION = "0.3.9";
33905
33905
 
33906
33906
  // node_modules/uuid/dist/esm/stringify.js
33907
33907
  var byteToHex = [];
@@ -80293,6 +80293,7 @@ async function startProxyServer() {
80293
80293
  for (const r of repos) {
80294
80294
  console.log(`=> PUSH to ${r.url}`);
80295
80295
  const repo = await NewRepo(r.url);
80296
+ const repoName = getRepoNameFromUrl(r.url);
80296
80297
  const stashCreated = await repo.stashDevcontainer();
80297
80298
  await repo.pushCurrentBranchWithCredentials(code.git_credentials);
80298
80299
  if (stashCreated) {
@@ -80301,7 +80302,6 @@ async function startProxyServer() {
80301
80302
  const link = await repo.getLatestCommitLink();
80302
80303
  commits.push(link);
80303
80304
  if (createPR) {
80304
- const repoName = getRepoNameFromUrl(r.url);
80305
80305
  if (!code.git_credentials?.auth_data?.token) {
80306
80306
  console.error(`=> No GitHub token available for PR creation`);
80307
80307
  prs[repoName] = "Error: GitHub token required for PR creation";
@@ -80313,6 +80313,27 @@ async function startProxyServer() {
80313
80313
  console.log(`=> Base: ${r.base_branch || "main"}`);
80314
80314
  const repoLocation = repo.printcwd();
80315
80315
  console.log(`=> Repo location: ${repoLocation}`);
80316
+ const currentBranch = await repo.execCommand(
80317
+ "git rev-parse --abbrev-ref HEAD"
80318
+ );
80319
+ console.log(`=> Current branch: ${currentBranch.trim()}`);
80320
+ const baseBranch = r.base_branch || "main";
80321
+ try {
80322
+ const diff = await repo.execCommand(
80323
+ `git log origin/${baseBranch}..HEAD --oneline`
80324
+ );
80325
+ if (!diff.trim()) {
80326
+ console.log(
80327
+ `=> No commits between ${baseBranch} and current branch`
80328
+ );
80329
+ prs[repoName] = "Error: No commits to create PR - branch is up to date with base";
80330
+ continue;
80331
+ }
80332
+ console.log(`=> Commits to include in PR:
80333
+ ${diff.trim()}`);
80334
+ } catch (diffError) {
80335
+ console.warn(`=> Could not check commit diff: ${diffError}`);
80336
+ }
80316
80337
  const gh = new GitHubCLI(
80317
80338
  code.git_credentials.auth_data.token,
80318
80339
  r.branch_name,
@@ -80327,7 +80348,7 @@ async function startProxyServer() {
80327
80348
  const pr = await gh.createPR({
80328
80349
  title: r.commit_name || `Changes from ${r.branch_name}`,
80329
80350
  body: `Automated PR from branch ${r.branch_name}`,
80330
- base: r.base_branch || "main",
80351
+ base: baseBranch,
80331
80352
  draft: false
80332
80353
  });
80333
80354
  console.log(`=> PR created: ${pr.url}`);
@@ -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.8";
10908
+ var VERSION = "0.3.9";
10909
10909
 
10910
10910
  // src/cli.ts
10911
10911
  var STAKLINK_PROXY = "staklink-proxy";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "staklink",
3
3
  "displayName": "staklink",
4
4
  "description": "staklink process manager",
5
- "version": "0.3.8",
5
+ "version": "0.3.9",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {