staklink 0.3.23 → 0.3.25

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.
@@ -34824,7 +34824,7 @@ var SSEManager = class {
34824
34824
  var sseManager = new SSEManager();
34825
34825
 
34826
34826
  // src/proxy/version.ts
34827
- var VERSION = "0.3.23";
34827
+ var VERSION = "0.3.25";
34828
34828
 
34829
34829
  // node_modules/uuid/dist/esm/stringify.js
34830
34830
  var byteToHex = [];
@@ -80367,6 +80367,9 @@ function gitleaksProtect() {
80367
80367
  var import_child_process4 = require("child_process");
80368
80368
  var import_util10 = require("util");
80369
80369
  var execAsync = (0, import_util10.promisify)(import_child_process4.exec);
80370
+ function sanitizeGitHubText(text2) {
80371
+ return text2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/`/g, "\\`").replace(/\$/g, "\\$");
80372
+ }
80370
80373
  var GitHubCLI = class {
80371
80374
  token;
80372
80375
  branch;
@@ -80474,10 +80477,10 @@ Stderr: ${error82.stderr}`
80474
80477
  "--head",
80475
80478
  this.branch,
80476
80479
  "--title",
80477
- `"${options.title}"`
80480
+ `"${sanitizeGitHubText(options.title)}"`
80478
80481
  ];
80479
80482
  if (options.body) {
80480
- args.push("--body", `"${options.body}"`);
80483
+ args.push("--body", `"${sanitizeGitHubText(options.body)}"`);
80481
80484
  }
80482
80485
  if (options.base) {
80483
80486
  args.push("--base", options.base);
@@ -80619,10 +80622,10 @@ Stderr: ${error82.stderr}`
80619
80622
  args.push("--delete-branch");
80620
80623
  }
80621
80624
  if (commitTitle) {
80622
- args.push("--subject", `"${commitTitle}"`);
80625
+ args.push("--subject", `"${sanitizeGitHubText(commitTitle)}"`);
80623
80626
  }
80624
80627
  if (commitBody) {
80625
- args.push("--body", `"${commitBody}"`);
80628
+ args.push("--body", `"${sanitizeGitHubText(commitBody)}"`);
80626
80629
  }
80627
80630
  try {
80628
80631
  const { stdout } = await this.execGH(args.join(" "));
@@ -80676,7 +80679,9 @@ Stderr: ${error82.stderr}`
80676
80679
  */
80677
80680
  async addComment(prNumber, comment) {
80678
80681
  try {
80679
- await this.execGH(`pr comment ${prNumber} --body "${comment}"`);
80682
+ await this.execGH(
80683
+ `pr comment ${prNumber} --body "${sanitizeGitHubText(comment)}"`
80684
+ );
80680
80685
  } catch (error82) {
80681
80686
  throw new Error(`Failed to add comment to PR #${prNumber}: ${error82}`);
80682
80687
  }
@@ -80687,10 +80692,10 @@ Stderr: ${error82.stderr}`
80687
80692
  async updatePR(prNumber, updates) {
80688
80693
  const args = ["pr", "edit", prNumber.toString()];
80689
80694
  if (updates.title) {
80690
- args.push("--title", `"${updates.title}"`);
80695
+ args.push("--title", `"${sanitizeGitHubText(updates.title)}"`);
80691
80696
  }
80692
80697
  if (updates.body) {
80693
- args.push("--body", `"${updates.body}"`);
80698
+ args.push("--body", `"${sanitizeGitHubText(updates.body)}"`);
80694
80699
  }
80695
80700
  try {
80696
80701
  await this.execGH(args.join(" "));
@@ -80858,6 +80863,31 @@ async function setupPlaywrightConfig(repoLocation) {
80858
80863
  wasModified
80859
80864
  };
80860
80865
  }
80866
+ async function ensureTestResultsInGitignore(repoLocation) {
80867
+ const gitignorePath = path9.join(repoLocation, ".gitignore");
80868
+ const testResultsEntry = "test-results";
80869
+ try {
80870
+ const gitignoreContent = await fs10.readFile(gitignorePath, "utf-8");
80871
+ const lines = gitignoreContent.split("\n");
80872
+ const hasTestResults = lines.some(
80873
+ (line) => line.trim() === testResultsEntry
80874
+ );
80875
+ if (hasTestResults) {
80876
+ console.log("test-results already in .gitignore");
80877
+ return;
80878
+ }
80879
+ const updatedContent = gitignoreContent.endsWith("\n") ? `${gitignoreContent}${testResultsEntry}
80880
+ ` : `${gitignoreContent}
80881
+ ${testResultsEntry}
80882
+ `;
80883
+ await fs10.writeFile(gitignorePath, updatedContent);
80884
+ console.log("Added test-results to .gitignore");
80885
+ } catch (error82) {
80886
+ await fs10.writeFile(gitignorePath, `${testResultsEntry}
80887
+ `);
80888
+ console.log("Created .gitignore with test-results");
80889
+ }
80890
+ }
80861
80891
  async function runPlaywrightTest(repoLocation, testFilePath) {
80862
80892
  const runner = new Runner(repoLocation, console.log);
80863
80893
  const testCommand = `npx playwright test ${testFilePath}`;
@@ -80955,6 +80985,7 @@ async function runPlaywrightTestWithVideo(options) {
80955
80985
  const repoLocation = await findRepositoryLocation(repoName);
80956
80986
  await verifyTestFileExists(repoLocation, testFilePath);
80957
80987
  configState = await setupPlaywrightConfig(repoLocation);
80988
+ await ensureTestResultsInGitignore(repoLocation);
80958
80989
  const testResult = await runPlaywrightTest(repoLocation, testFilePath);
80959
80990
  const videoPath = await findVideoFile(repoLocation);
80960
80991
  let uploadStatus;
@@ -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.23";
10908
+ var VERSION = "0.3.25";
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.23",
5
+ "version": "0.3.25",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {
@@ -0,0 +1,4 @@
1
+ {
2
+ "status": "passed",
3
+ "failedTests": []
4
+ }