@staff0rd/assist 0.811.0 → 0.812.1
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/README.md +1 -1
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +161 -108
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.812.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -123,7 +123,7 @@ var package_default = {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// src/commands/new/registerNew/newCli.ts
|
|
126
|
-
import { execSync as
|
|
126
|
+
import { execSync as execSync7 } from "child_process";
|
|
127
127
|
import { basename as basename3, resolve as resolve7 } from "path";
|
|
128
128
|
|
|
129
129
|
// src/commands/verify/init.ts
|
|
@@ -2042,13 +2042,71 @@ function ignoreUnreachableDaemon() {
|
|
|
2042
2042
|
import { minimatch } from "minimatch";
|
|
2043
2043
|
|
|
2044
2044
|
// src/commands/verify/run/getChangedFiles.ts
|
|
2045
|
+
import { execSync as execSync4 } from "child_process";
|
|
2046
|
+
|
|
2047
|
+
// src/shared/tryGit.ts
|
|
2045
2048
|
import { execSync as execSync3 } from "child_process";
|
|
2046
|
-
function
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
+
function tryGit2(args) {
|
|
2050
|
+
try {
|
|
2051
|
+
return execSync3(`git ${args}`, {
|
|
2052
|
+
encoding: "utf8",
|
|
2053
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
2054
|
+
}).trim();
|
|
2055
|
+
} catch {
|
|
2056
|
+
return null;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
// src/commands/verify/run/remoteDefaultRef.ts
|
|
2061
|
+
function configuredDefaultBranch() {
|
|
2062
|
+
try {
|
|
2063
|
+
return loadConfig().branch?.defaultBranch;
|
|
2064
|
+
} catch {
|
|
2065
|
+
return void 0;
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
function originHeadBranch() {
|
|
2069
|
+
const head = tryGit2("symbolic-ref --quiet --short refs/remotes/origin/HEAD");
|
|
2070
|
+
return head?.startsWith("origin/") ? head.slice("origin/".length) : void 0;
|
|
2071
|
+
}
|
|
2072
|
+
function remoteDefaultRef() {
|
|
2073
|
+
const branches = [
|
|
2074
|
+
configuredDefaultBranch(),
|
|
2075
|
+
originHeadBranch(),
|
|
2076
|
+
"main",
|
|
2077
|
+
"master"
|
|
2078
|
+
].filter((branch2) => Boolean(branch2));
|
|
2079
|
+
for (const branch2 of new Set(branches)) {
|
|
2080
|
+
const ref = `origin/${branch2}`;
|
|
2081
|
+
if (tryGit2(`rev-parse --verify --quiet ${ref}^{commit}`) !== null)
|
|
2082
|
+
return ref;
|
|
2083
|
+
}
|
|
2084
|
+
return null;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
// src/commands/verify/run/getChangedFiles.ts
|
|
2088
|
+
function gitLines(args) {
|
|
2089
|
+
const output = execSync4(`git ${args}`, {
|
|
2090
|
+
encoding: "utf8",
|
|
2091
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
2049
2092
|
}).trim();
|
|
2050
|
-
|
|
2051
|
-
|
|
2093
|
+
return output === "" ? [] : output.split("\n");
|
|
2094
|
+
}
|
|
2095
|
+
function diffBase() {
|
|
2096
|
+
const ref = remoteDefaultRef();
|
|
2097
|
+
if (!ref) return "HEAD";
|
|
2098
|
+
try {
|
|
2099
|
+
return gitLines(`merge-base ${ref} HEAD`)[0] ?? "HEAD";
|
|
2100
|
+
} catch {
|
|
2101
|
+
return "HEAD";
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
function getChangedFiles() {
|
|
2105
|
+
const tracked = gitLines(`diff --name-only ${diffBase()}`);
|
|
2106
|
+
const untracked = gitLines(
|
|
2107
|
+
"ls-files --others --exclude-standard --full-name -- :/"
|
|
2108
|
+
);
|
|
2109
|
+
return [.../* @__PURE__ */ new Set([...tracked, ...untracked])];
|
|
2052
2110
|
}
|
|
2053
2111
|
|
|
2054
2112
|
// src/commands/verify/run/filterByChangedFiles.ts
|
|
@@ -2434,25 +2492,25 @@ async function run(options2 = {}) {
|
|
|
2434
2492
|
}
|
|
2435
2493
|
|
|
2436
2494
|
// src/commands/new/registerNew/initGit.ts
|
|
2437
|
-
import { execSync as
|
|
2495
|
+
import { execSync as execSync5 } from "child_process";
|
|
2438
2496
|
import { writeFileSync as writeFileSync11 } from "fs";
|
|
2439
2497
|
function initGit() {
|
|
2440
2498
|
console.log("Initializing git repository...");
|
|
2441
|
-
|
|
2499
|
+
execSync5("git init", { stdio: "inherit" });
|
|
2442
2500
|
writeFileSync11(".gitignore", "dist\nnode_modules\n");
|
|
2443
2501
|
}
|
|
2444
2502
|
|
|
2445
2503
|
// src/commands/new/registerNew/newCli/initPackageJson.ts
|
|
2446
|
-
import { execSync as
|
|
2504
|
+
import { execSync as execSync6 } from "child_process";
|
|
2447
2505
|
function initPackageJson(name) {
|
|
2448
2506
|
console.log("Initializing package.json...");
|
|
2449
|
-
|
|
2507
|
+
execSync6("npm init -y", { stdio: "inherit" });
|
|
2450
2508
|
console.log("Configuring package.json...");
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2509
|
+
execSync6("npm pkg delete main", { stdio: "inherit" });
|
|
2510
|
+
execSync6("npm pkg set type=module", { stdio: "inherit" });
|
|
2511
|
+
execSync6(`npm pkg set bin.${name}=./dist/index.js`, { stdio: "inherit" });
|
|
2512
|
+
execSync6("npm pkg set scripts.build=tsup", { stdio: "inherit" });
|
|
2513
|
+
execSync6('npm pkg set scripts.start="node dist/index.js"', {
|
|
2456
2514
|
stdio: "inherit"
|
|
2457
2515
|
});
|
|
2458
2516
|
}
|
|
@@ -2517,8 +2575,8 @@ async function newCli() {
|
|
|
2517
2575
|
initGit();
|
|
2518
2576
|
initPackageJson(name);
|
|
2519
2577
|
console.log("Installing dependencies...");
|
|
2520
|
-
|
|
2521
|
-
|
|
2578
|
+
execSync7("npm install commander", { stdio: "inherit" });
|
|
2579
|
+
execSync7("npm install -D tsup typescript @types/node", {
|
|
2522
2580
|
stdio: "inherit"
|
|
2523
2581
|
});
|
|
2524
2582
|
writeCliTemplate(name);
|
|
@@ -2527,11 +2585,11 @@ async function newCli() {
|
|
|
2527
2585
|
}
|
|
2528
2586
|
|
|
2529
2587
|
// src/commands/new/registerNew/newProject.ts
|
|
2530
|
-
import { execSync as
|
|
2588
|
+
import { execSync as execSync9 } from "child_process";
|
|
2531
2589
|
import { existsSync as existsSync18, readFileSync as readFileSync13, writeFileSync as writeFileSync14 } from "fs";
|
|
2532
2590
|
|
|
2533
2591
|
// src/commands/deploy/init.ts
|
|
2534
|
-
import { execSync as
|
|
2592
|
+
import { execSync as execSync8 } from "child_process";
|
|
2535
2593
|
import chalk24 from "chalk";
|
|
2536
2594
|
import enquirer3 from "enquirer";
|
|
2537
2595
|
|
|
@@ -2584,7 +2642,7 @@ Created ${WORKFLOW_PATH}`));
|
|
|
2584
2642
|
// src/commands/deploy/init.ts
|
|
2585
2643
|
async function ensureNetlifyCli() {
|
|
2586
2644
|
try {
|
|
2587
|
-
|
|
2645
|
+
execSync8("netlify sites:create --disable-linking", { stdio: "inherit" });
|
|
2588
2646
|
} catch (error) {
|
|
2589
2647
|
if (!(error instanceof Error) || !error.message.includes("command not found"))
|
|
2590
2648
|
throw error;
|
|
@@ -2599,9 +2657,9 @@ async function ensureNetlifyCli() {
|
|
|
2599
2657
|
process.exit(1);
|
|
2600
2658
|
}
|
|
2601
2659
|
console.log(chalk24.dim("\nInstalling netlify-cli...\n"));
|
|
2602
|
-
|
|
2660
|
+
execSync8("npm install -g netlify-cli", { stdio: "inherit" });
|
|
2603
2661
|
console.log();
|
|
2604
|
-
|
|
2662
|
+
execSync8("netlify sites:create --disable-linking", { stdio: "inherit" });
|
|
2605
2663
|
}
|
|
2606
2664
|
}
|
|
2607
2665
|
function printSetupInstructions() {
|
|
@@ -2644,7 +2702,7 @@ async function init6() {
|
|
|
2644
2702
|
// src/commands/new/registerNew/newProject.ts
|
|
2645
2703
|
async function newProject() {
|
|
2646
2704
|
console.log("Initializing Vite with react-ts template...");
|
|
2647
|
-
|
|
2705
|
+
execSync9("npm create vite@latest . -- --template react-ts", {
|
|
2648
2706
|
stdio: "inherit"
|
|
2649
2707
|
});
|
|
2650
2708
|
initGit();
|
|
@@ -2738,11 +2796,11 @@ function renderLineChart({
|
|
|
2738
2796
|
}
|
|
2739
2797
|
|
|
2740
2798
|
// src/commands/activity/fetchCommitsPerDay.ts
|
|
2741
|
-
import { execSync as
|
|
2799
|
+
import { execSync as execSync10 } from "child_process";
|
|
2742
2800
|
function fetchContributions(from, to) {
|
|
2743
2801
|
const query = `{ viewer { contributionsCollection(from: "${from}T00:00:00Z", to: "${to}T23:59:59Z") { contributionCalendar { weeks { contributionDays { date contributionCount } } } } } }`;
|
|
2744
2802
|
const jq = ".data.viewer.contributionsCollection.contributionCalendar.weeks[].contributionDays[]";
|
|
2745
|
-
const raw =
|
|
2803
|
+
const raw = execSync10(`gh api graphql -f query='${query}' --jq '${jq}'`, {
|
|
2746
2804
|
encoding: "utf8"
|
|
2747
2805
|
}).trim();
|
|
2748
2806
|
if (!raw) return [];
|
|
@@ -4267,10 +4325,10 @@ import { join as join19 } from "path";
|
|
|
4267
4325
|
import chalk27 from "chalk";
|
|
4268
4326
|
|
|
4269
4327
|
// src/commands/backup/readCrontab.ts
|
|
4270
|
-
import { execSync as
|
|
4328
|
+
import { execSync as execSync11 } from "child_process";
|
|
4271
4329
|
function readCrontab() {
|
|
4272
4330
|
try {
|
|
4273
|
-
return
|
|
4331
|
+
return execSync11("crontab -l", {
|
|
4274
4332
|
encoding: "utf8",
|
|
4275
4333
|
stdio: ["ignore", "pipe", "ignore"]
|
|
4276
4334
|
});
|
|
@@ -4280,7 +4338,7 @@ function readCrontab() {
|
|
|
4280
4338
|
}
|
|
4281
4339
|
function writeCrontab(content) {
|
|
4282
4340
|
try {
|
|
4283
|
-
|
|
4341
|
+
execSync11("crontab -", {
|
|
4284
4342
|
input: content,
|
|
4285
4343
|
stdio: ["pipe", "ignore", "pipe"]
|
|
4286
4344
|
});
|
|
@@ -4747,7 +4805,7 @@ async function recordGitRef(db, itemId2, ref) {
|
|
|
4747
4805
|
}
|
|
4748
4806
|
|
|
4749
4807
|
// src/commands/prs/getPreferredRemoteRepo.ts
|
|
4750
|
-
import { execSync as
|
|
4808
|
+
import { execSync as execSync12 } from "child_process";
|
|
4751
4809
|
|
|
4752
4810
|
// src/commands/prs/parseGitHubUrl.ts
|
|
4753
4811
|
var GITHUB_URL_PATTERN = /(?:git@github\.com:|https:\/\/github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?\/?$/;
|
|
@@ -4760,7 +4818,7 @@ function parseGitHubUrl(url) {
|
|
|
4760
4818
|
// src/commands/prs/getPreferredRemoteRepo.ts
|
|
4761
4819
|
function tryGetRemoteUrl(remote, cwd) {
|
|
4762
4820
|
try {
|
|
4763
|
-
return
|
|
4821
|
+
return execSync12(`git remote get-url ${remote}`, {
|
|
4764
4822
|
encoding: "utf8",
|
|
4765
4823
|
stdio: ["pipe", "pipe", "pipe"],
|
|
4766
4824
|
windowsHide: true,
|
|
@@ -4772,7 +4830,7 @@ function tryGetRemoteUrl(remote, cwd) {
|
|
|
4772
4830
|
}
|
|
4773
4831
|
function getCurrentBranchRemote(cwd) {
|
|
4774
4832
|
try {
|
|
4775
|
-
const ref =
|
|
4833
|
+
const ref = execSync12(
|
|
4776
4834
|
"git rev-parse --abbrev-ref --symbolic-full-name @{u}",
|
|
4777
4835
|
{
|
|
4778
4836
|
encoding: "utf8",
|
|
@@ -4789,7 +4847,7 @@ function getCurrentBranchRemote(cwd) {
|
|
|
4789
4847
|
}
|
|
4790
4848
|
function listRemotes(cwd) {
|
|
4791
4849
|
try {
|
|
4792
|
-
return
|
|
4850
|
+
return execSync12("git remote", {
|
|
4793
4851
|
encoding: "utf8",
|
|
4794
4852
|
stdio: ["pipe", "pipe", "pipe"],
|
|
4795
4853
|
windowsHide: true,
|
|
@@ -4994,11 +5052,11 @@ function backupLocalBacklogFiles(dir) {
|
|
|
4994
5052
|
}
|
|
4995
5053
|
|
|
4996
5054
|
// src/commands/backlog/gitPullBacklog.ts
|
|
4997
|
-
import { execSync as
|
|
5055
|
+
import { execSync as execSync13 } from "child_process";
|
|
4998
5056
|
import chalk30 from "chalk";
|
|
4999
5057
|
function gitPullBacklog(dir) {
|
|
5000
5058
|
try {
|
|
5001
|
-
|
|
5059
|
+
execSync13("git pull --ff-only", {
|
|
5002
5060
|
cwd: dir,
|
|
5003
5061
|
stdio: ["pipe", "pipe", "pipe"],
|
|
5004
5062
|
windowsHide: true
|
|
@@ -5849,13 +5907,13 @@ async function beginAssociation(id, options2, clearPatch, label2) {
|
|
|
5849
5907
|
}
|
|
5850
5908
|
|
|
5851
5909
|
// src/commands/backlog/associate-github/fetchGithubIssueTitle.ts
|
|
5852
|
-
import { execSync as
|
|
5910
|
+
import { execSync as execSync14 } from "child_process";
|
|
5853
5911
|
function fetchGithubIssueTitle(issue) {
|
|
5854
5912
|
const match = /^([^/]+)\/([^#]+)#(\d+)$/.exec(issue);
|
|
5855
5913
|
if (!match) return void 0;
|
|
5856
5914
|
const [, owner, repo, number] = match;
|
|
5857
5915
|
try {
|
|
5858
|
-
const result =
|
|
5916
|
+
const result = execSync14(
|
|
5859
5917
|
`gh issue view ${number} -R ${owner}/${repo} --json title`,
|
|
5860
5918
|
{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
|
|
5861
5919
|
);
|
|
@@ -5922,12 +5980,12 @@ import chalk38 from "chalk";
|
|
|
5922
5980
|
import { eq as eq13 } from "drizzle-orm";
|
|
5923
5981
|
|
|
5924
5982
|
// src/commands/jira/fetchIssue.ts
|
|
5925
|
-
import { execSync as
|
|
5983
|
+
import { execSync as execSync15 } from "child_process";
|
|
5926
5984
|
import chalk37 from "chalk";
|
|
5927
5985
|
function fetchIssue(issueKey, fields) {
|
|
5928
5986
|
let result;
|
|
5929
5987
|
try {
|
|
5930
|
-
result =
|
|
5988
|
+
result = execSync15(
|
|
5931
5989
|
`acli jira workitem view ${issueKey} -f ${fields} --json`,
|
|
5932
5990
|
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
5933
5991
|
);
|
|
@@ -7371,11 +7429,11 @@ import chalk71 from "chalk";
|
|
|
7371
7429
|
import enquirer6 from "enquirer";
|
|
7372
7430
|
|
|
7373
7431
|
// src/shared/pullIfConfigured.ts
|
|
7374
|
-
import { execSync as
|
|
7432
|
+
import { execSync as execSync17 } from "child_process";
|
|
7375
7433
|
import chalk61 from "chalk";
|
|
7376
7434
|
|
|
7377
7435
|
// src/shared/catchUpToRemoteDefault.ts
|
|
7378
|
-
import { execSync as
|
|
7436
|
+
import { execSync as execSync16 } from "child_process";
|
|
7379
7437
|
import chalk60 from "chalk";
|
|
7380
7438
|
|
|
7381
7439
|
// src/commands/sessions/daemon/worktree/git.ts
|
|
@@ -7466,7 +7524,7 @@ function remoteDefaultBranch(clone) {
|
|
|
7466
7524
|
// src/shared/catchUpToRemoteDefault.ts
|
|
7467
7525
|
function catchUpToRemoteDefault() {
|
|
7468
7526
|
try {
|
|
7469
|
-
|
|
7527
|
+
execSync16("git fetch", { stdio: "inherit" });
|
|
7470
7528
|
} catch {
|
|
7471
7529
|
skip("git fetch failed");
|
|
7472
7530
|
return;
|
|
@@ -7483,7 +7541,7 @@ function catchUpToRemoteDefault() {
|
|
|
7483
7541
|
return;
|
|
7484
7542
|
}
|
|
7485
7543
|
try {
|
|
7486
|
-
|
|
7544
|
+
execSync16(`git merge --ff-only ${ref}`, { stdio: "inherit" });
|
|
7487
7545
|
} catch {
|
|
7488
7546
|
console.error(chalk60.red(`git fast-forward to ${ref} failed; aborting.`));
|
|
7489
7547
|
process.exit(1);
|
|
@@ -7494,7 +7552,7 @@ function skip(reason4) {
|
|
|
7494
7552
|
}
|
|
7495
7553
|
function succeeds(command) {
|
|
7496
7554
|
try {
|
|
7497
|
-
|
|
7555
|
+
execSync16(command, { stdio: "ignore" });
|
|
7498
7556
|
return true;
|
|
7499
7557
|
} catch {
|
|
7500
7558
|
return false;
|
|
@@ -7518,8 +7576,8 @@ function pullIfConfigured() {
|
|
|
7518
7576
|
return;
|
|
7519
7577
|
}
|
|
7520
7578
|
try {
|
|
7521
|
-
|
|
7522
|
-
|
|
7579
|
+
execSync17("git fetch", { stdio: "inherit" });
|
|
7580
|
+
execSync17("git merge --ff-only @{u}", { stdio: "inherit" });
|
|
7523
7581
|
} catch {
|
|
7524
7582
|
console.error(chalk61.red("git fast-forward to upstream failed; aborting."));
|
|
7525
7583
|
process.exit(1);
|
|
@@ -7527,7 +7585,7 @@ function pullIfConfigured() {
|
|
|
7527
7585
|
}
|
|
7528
7586
|
function hasUpstream() {
|
|
7529
7587
|
try {
|
|
7530
|
-
|
|
7588
|
+
execSync17("git rev-parse --abbrev-ref --symbolic-full-name @{upstream}", {
|
|
7531
7589
|
encoding: "utf8",
|
|
7532
7590
|
stdio: ["ignore", "pipe", "ignore"]
|
|
7533
7591
|
});
|
|
@@ -7538,7 +7596,7 @@ function hasUpstream() {
|
|
|
7538
7596
|
}
|
|
7539
7597
|
function hasLocalChanges() {
|
|
7540
7598
|
try {
|
|
7541
|
-
const status2 =
|
|
7599
|
+
const status2 = execSync17("git status --porcelain", {
|
|
7542
7600
|
encoding: "utf8"
|
|
7543
7601
|
});
|
|
7544
7602
|
return status2.trim().length > 0;
|
|
@@ -7717,11 +7775,11 @@ function buildArgs(prompt, options2) {
|
|
|
7717
7775
|
}
|
|
7718
7776
|
|
|
7719
7777
|
// src/commands/backlog/ensureStoryBranch.ts
|
|
7720
|
-
import { execSync as
|
|
7778
|
+
import { execSync as execSync20 } from "child_process";
|
|
7721
7779
|
import { basename as basename6 } from "path";
|
|
7722
7780
|
|
|
7723
7781
|
// src/commands/branch/createBranch.ts
|
|
7724
|
-
import { execSync as
|
|
7782
|
+
import { execSync as execSync19 } from "child_process";
|
|
7725
7783
|
|
|
7726
7784
|
// src/commands/branch/buildBranchName.ts
|
|
7727
7785
|
function buildBranchName({
|
|
@@ -7737,12 +7795,12 @@ function buildBranchName({
|
|
|
7737
7795
|
}
|
|
7738
7796
|
|
|
7739
7797
|
// src/commands/branch/resolveDefaultBranch.ts
|
|
7740
|
-
import { execSync as
|
|
7798
|
+
import { execSync as execSync18 } from "child_process";
|
|
7741
7799
|
var REMOTE_HEAD_REGEX = /^ref:\s+refs\/heads\/(\S+)\s+HEAD$/m;
|
|
7742
7800
|
function resolveDefaultBranch(override, cwd) {
|
|
7743
7801
|
if (override) return override;
|
|
7744
7802
|
try {
|
|
7745
|
-
const output =
|
|
7803
|
+
const output = execSync18("git ls-remote --symref origin HEAD", {
|
|
7746
7804
|
encoding: "utf8",
|
|
7747
7805
|
stdio: ["pipe", "pipe", "pipe"],
|
|
7748
7806
|
cwd
|
|
@@ -7766,11 +7824,11 @@ async function createBranch({
|
|
|
7766
7824
|
jira,
|
|
7767
7825
|
slug: slug2
|
|
7768
7826
|
});
|
|
7769
|
-
|
|
7827
|
+
execSync19("git fetch", { stdio: "inherit" });
|
|
7770
7828
|
let baseRef;
|
|
7771
7829
|
if (from) {
|
|
7772
7830
|
try {
|
|
7773
|
-
|
|
7831
|
+
execSync19(`git rev-parse --verify ${shellQuote(from)}`, {
|
|
7774
7832
|
stdio: ["pipe", "pipe", "pipe"]
|
|
7775
7833
|
});
|
|
7776
7834
|
} catch {
|
|
@@ -7780,7 +7838,7 @@ async function createBranch({
|
|
|
7780
7838
|
} else {
|
|
7781
7839
|
baseRef = `origin/${resolveDefaultBranch(config.branch?.defaultBranch)}`;
|
|
7782
7840
|
}
|
|
7783
|
-
|
|
7841
|
+
execSync19(`git switch -c ${shellQuote(branchName)} ${shellQuote(baseRef)}`, {
|
|
7784
7842
|
stdio: "inherit"
|
|
7785
7843
|
});
|
|
7786
7844
|
await recordBranchActivity(branchName);
|
|
@@ -7898,11 +7956,11 @@ function adoptRecordedBranch(item, branch2) {
|
|
|
7898
7956
|
return;
|
|
7899
7957
|
}
|
|
7900
7958
|
try {
|
|
7901
|
-
|
|
7959
|
+
execSync20("git fetch", { stdio: "ignore" });
|
|
7902
7960
|
} catch {
|
|
7903
7961
|
}
|
|
7904
7962
|
try {
|
|
7905
|
-
|
|
7963
|
+
execSync20(`git switch ${shellQuote(branch2)}`, { stdio: "pipe" });
|
|
7906
7964
|
log(
|
|
7907
7965
|
item,
|
|
7908
7966
|
`branch ${branch2} already recorded; switched off ${parked} onto it`
|
|
@@ -7922,7 +7980,7 @@ function worktreeBranchInPlay() {
|
|
|
7922
7980
|
}
|
|
7923
7981
|
function currentBranch() {
|
|
7924
7982
|
try {
|
|
7925
|
-
return
|
|
7983
|
+
return execSync20("git rev-parse --abbrev-ref HEAD", {
|
|
7926
7984
|
encoding: "utf8",
|
|
7927
7985
|
stdio: ["ignore", "pipe", "ignore"]
|
|
7928
7986
|
}).trim();
|
|
@@ -8310,7 +8368,7 @@ import * as os2 from "os";
|
|
|
8310
8368
|
import * as path19 from "path";
|
|
8311
8369
|
|
|
8312
8370
|
// src/shared/checkCliAvailable.ts
|
|
8313
|
-
import { execSync as
|
|
8371
|
+
import { execSync as execSync21 } from "child_process";
|
|
8314
8372
|
function checkCliAvailable(cli) {
|
|
8315
8373
|
const binary = cli.split(/\s+/)[0];
|
|
8316
8374
|
const opts = {
|
|
@@ -8319,11 +8377,11 @@ function checkCliAvailable(cli) {
|
|
|
8319
8377
|
windowsHide: true
|
|
8320
8378
|
};
|
|
8321
8379
|
try {
|
|
8322
|
-
|
|
8380
|
+
execSync21(`command -v ${binary}`, opts);
|
|
8323
8381
|
return true;
|
|
8324
8382
|
} catch {
|
|
8325
8383
|
try {
|
|
8326
|
-
|
|
8384
|
+
execSync21(`where ${binary}`, opts);
|
|
8327
8385
|
return true;
|
|
8328
8386
|
} catch {
|
|
8329
8387
|
return false;
|
|
@@ -10974,7 +11032,7 @@ function registerUpdateCommands(cmd) {
|
|
|
10974
11032
|
import chalk110 from "chalk";
|
|
10975
11033
|
|
|
10976
11034
|
// src/shared/getInstallDir.ts
|
|
10977
|
-
import { execSync as
|
|
11035
|
+
import { execSync as execSync22 } from "child_process";
|
|
10978
11036
|
import { dirname as dirname20, resolve as resolve10 } from "path";
|
|
10979
11037
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
10980
11038
|
var __filename2 = fileURLToPath3(import.meta.url);
|
|
@@ -10984,7 +11042,7 @@ function getInstallDir() {
|
|
|
10984
11042
|
}
|
|
10985
11043
|
function isGitRepo(dir) {
|
|
10986
11044
|
try {
|
|
10987
|
-
const result =
|
|
11045
|
+
const result = execSync22("git rev-parse --show-toplevel", {
|
|
10988
11046
|
cwd: dir,
|
|
10989
11047
|
stdio: "pipe",
|
|
10990
11048
|
windowsHide: true
|
|
@@ -11031,7 +11089,7 @@ import {
|
|
|
11031
11089
|
import chalk105 from "chalk";
|
|
11032
11090
|
|
|
11033
11091
|
// src/lib/openBrowser.ts
|
|
11034
|
-
import { execSync as
|
|
11092
|
+
import { execSync as execSync23 } from "child_process";
|
|
11035
11093
|
|
|
11036
11094
|
// src/lib/detectPlatform.ts
|
|
11037
11095
|
import isWsl from "is-wsl";
|
|
@@ -11053,7 +11111,7 @@ function detectPlatform() {
|
|
|
11053
11111
|
function tryExec(commands) {
|
|
11054
11112
|
for (const cmd of commands) {
|
|
11055
11113
|
try {
|
|
11056
|
-
|
|
11114
|
+
execSync23(cmd, { stdio: "ignore", windowsHide: true });
|
|
11057
11115
|
return true;
|
|
11058
11116
|
} catch {
|
|
11059
11117
|
}
|
|
@@ -12026,14 +12084,14 @@ async function execGit(cwd, args, opts = {}) {
|
|
|
12026
12084
|
var ORIGIN_HEAD_REF = "refs/remotes/origin/HEAD";
|
|
12027
12085
|
var ORIGIN_REF_PREFIX = "refs/remotes/origin/";
|
|
12028
12086
|
var FALLBACK_BRANCHES = ["main", "master"];
|
|
12029
|
-
function
|
|
12087
|
+
function configuredDefaultBranch2(cwd) {
|
|
12030
12088
|
try {
|
|
12031
12089
|
return loadConfigFrom(cwd).branch?.defaultBranch;
|
|
12032
12090
|
} catch {
|
|
12033
12091
|
return void 0;
|
|
12034
12092
|
}
|
|
12035
12093
|
}
|
|
12036
|
-
async function
|
|
12094
|
+
async function originHeadBranch2(cwd) {
|
|
12037
12095
|
try {
|
|
12038
12096
|
const ref = (await execGit(cwd, ["symbolic-ref", "--quiet", ORIGIN_HEAD_REF])).trim();
|
|
12039
12097
|
if (!ref.startsWith(ORIGIN_REF_PREFIX)) return void 0;
|
|
@@ -12043,8 +12101,8 @@ async function originHeadBranch(cwd) {
|
|
|
12043
12101
|
}
|
|
12044
12102
|
}
|
|
12045
12103
|
async function candidateBranches(cwd) {
|
|
12046
|
-
const configured =
|
|
12047
|
-
const originHead = configured ? void 0 : await
|
|
12104
|
+
const configured = configuredDefaultBranch2(cwd);
|
|
12105
|
+
const originHead = configured ? void 0 : await originHeadBranch2(cwd);
|
|
12048
12106
|
const candidates = [configured, originHead, ...FALLBACK_BRANCHES].filter(
|
|
12049
12107
|
(branch2) => Boolean(branch2)
|
|
12050
12108
|
);
|
|
@@ -20574,14 +20632,14 @@ function buildCommitMessage(subject, refs) {
|
|
|
20574
20632
|
import { execSync as execSync29 } from "child_process";
|
|
20575
20633
|
|
|
20576
20634
|
// src/shared/warnIfUnexpectedBranch.ts
|
|
20577
|
-
import { execSync as
|
|
20635
|
+
import { execSync as execSync25 } from "child_process";
|
|
20578
20636
|
import chalk123 from "chalk";
|
|
20579
20637
|
|
|
20580
20638
|
// src/shared/upstreamBranch.ts
|
|
20581
|
-
import { execSync as
|
|
20639
|
+
import { execSync as execSync24 } from "child_process";
|
|
20582
20640
|
function upstreamBranch() {
|
|
20583
20641
|
try {
|
|
20584
|
-
const upstream =
|
|
20642
|
+
const upstream = execSync24(
|
|
20585
20643
|
"git rev-parse --abbrev-ref --symbolic-full-name @{upstream}",
|
|
20586
20644
|
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
20587
20645
|
).trim();
|
|
@@ -20615,7 +20673,7 @@ function warnIfUnexpectedBranch(config) {
|
|
|
20615
20673
|
}
|
|
20616
20674
|
function currentBranch3() {
|
|
20617
20675
|
try {
|
|
20618
|
-
return
|
|
20676
|
+
return execSync25("git rev-parse --abbrev-ref HEAD", {
|
|
20619
20677
|
encoding: "utf8"
|
|
20620
20678
|
}).trim();
|
|
20621
20679
|
} catch {
|
|
@@ -20624,10 +20682,10 @@ function currentBranch3() {
|
|
|
20624
20682
|
}
|
|
20625
20683
|
|
|
20626
20684
|
// src/commands/commit/findConflictMarkers.ts
|
|
20627
|
-
import { execSync as
|
|
20685
|
+
import { execSync as execSync26 } from "child_process";
|
|
20628
20686
|
function gitCheckOutput(cmd) {
|
|
20629
20687
|
try {
|
|
20630
|
-
return
|
|
20688
|
+
return execSync26(cmd, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
|
|
20631
20689
|
} catch (error) {
|
|
20632
20690
|
const stdout = error.stdout;
|
|
20633
20691
|
if (typeof stdout === "string") return stdout;
|
|
@@ -20656,7 +20714,7 @@ function findConflictMarkers(files) {
|
|
|
20656
20714
|
function findUnmergedPaths() {
|
|
20657
20715
|
let output;
|
|
20658
20716
|
try {
|
|
20659
|
-
output =
|
|
20717
|
+
output = execSync26("git ls-files -u", {
|
|
20660
20718
|
encoding: "utf8",
|
|
20661
20719
|
stdio: ["pipe", "pipe", "pipe"]
|
|
20662
20720
|
});
|
|
@@ -20698,10 +20756,9 @@ function abortOnConflicts(files, pulled) {
|
|
|
20698
20756
|
}
|
|
20699
20757
|
|
|
20700
20758
|
// src/commands/commit/collectCommitRefs.ts
|
|
20701
|
-
import { execSync as execSync26 } from "child_process";
|
|
20702
20759
|
function collectCommitRefs(message3) {
|
|
20703
20760
|
const refs = [];
|
|
20704
|
-
const branch2 =
|
|
20761
|
+
const branch2 = tryGit2("rev-parse --abbrev-ref HEAD");
|
|
20705
20762
|
if (branch2 && branch2 !== "HEAD") {
|
|
20706
20763
|
refs.push({
|
|
20707
20764
|
kind: "branch",
|
|
@@ -20709,7 +20766,7 @@ function collectCommitRefs(message3) {
|
|
|
20709
20766
|
url: gitRefUrl("branch", branch2)
|
|
20710
20767
|
});
|
|
20711
20768
|
}
|
|
20712
|
-
const sha =
|
|
20769
|
+
const sha = tryGit2("rev-parse HEAD");
|
|
20713
20770
|
if (sha) {
|
|
20714
20771
|
const ref = {
|
|
20715
20772
|
kind: "commit",
|
|
@@ -20719,21 +20776,11 @@ function collectCommitRefs(message3) {
|
|
|
20719
20776
|
const subject = message3.split("\n", 1)[0];
|
|
20720
20777
|
if (subject) ref.title = subject;
|
|
20721
20778
|
refs.push(ref);
|
|
20722
|
-
const parent =
|
|
20779
|
+
const parent = tryGit2("rev-parse HEAD^");
|
|
20723
20780
|
if (parent) refs.push({ kind: "commit-parent", ref: parent });
|
|
20724
20781
|
}
|
|
20725
20782
|
return refs;
|
|
20726
20783
|
}
|
|
20727
|
-
function git2(args) {
|
|
20728
|
-
try {
|
|
20729
|
-
return execSync26(`git ${args}`, {
|
|
20730
|
-
encoding: "utf8",
|
|
20731
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
20732
|
-
}).trim();
|
|
20733
|
-
} catch {
|
|
20734
|
-
return null;
|
|
20735
|
-
}
|
|
20736
|
-
}
|
|
20737
20784
|
|
|
20738
20785
|
// src/commands/commit/pushCommit.ts
|
|
20739
20786
|
import { execSync as execSync27 } from "child_process";
|
|
@@ -21415,7 +21462,7 @@ function formatResultLine(entry, failing) {
|
|
|
21415
21462
|
// src/commands/complexity/maintainability/getMaintainabilityGitState.ts
|
|
21416
21463
|
import { execSync as execSync31 } from "child_process";
|
|
21417
21464
|
import path34 from "path";
|
|
21418
|
-
function
|
|
21465
|
+
function git2(command) {
|
|
21419
21466
|
return execSync31(command, { encoding: "utf8" });
|
|
21420
21467
|
}
|
|
21421
21468
|
function toAbsolute(root2, repoRelative) {
|
|
@@ -21423,7 +21470,7 @@ function toAbsolute(root2, repoRelative) {
|
|
|
21423
21470
|
}
|
|
21424
21471
|
function collectShrunkFiles(root2) {
|
|
21425
21472
|
const shrunk = /* @__PURE__ */ new Set();
|
|
21426
|
-
const numstat =
|
|
21473
|
+
const numstat = git2("git diff --numstat HEAD").trim();
|
|
21427
21474
|
if (numstat === "") return shrunk;
|
|
21428
21475
|
for (const line of numstat.split("\n")) {
|
|
21429
21476
|
const [addedRaw, removedRaw, ...rest] = line.split(" ");
|
|
@@ -21436,7 +21483,7 @@ function collectShrunkFiles(root2) {
|
|
|
21436
21483
|
return shrunk;
|
|
21437
21484
|
}
|
|
21438
21485
|
function hasNewSourceFile() {
|
|
21439
|
-
const status2 =
|
|
21486
|
+
const status2 = git2("git status --porcelain --untracked-files=all").trim();
|
|
21440
21487
|
if (status2 === "") return false;
|
|
21441
21488
|
for (const line of status2.split("\n")) {
|
|
21442
21489
|
const code = line.slice(0, 2);
|
|
@@ -21448,7 +21495,7 @@ function hasNewSourceFile() {
|
|
|
21448
21495
|
}
|
|
21449
21496
|
function getMaintainabilityGitState() {
|
|
21450
21497
|
try {
|
|
21451
|
-
const root2 =
|
|
21498
|
+
const root2 = git2("git rev-parse --show-toplevel").trim();
|
|
21452
21499
|
return {
|
|
21453
21500
|
shrunkFiles: collectShrunkFiles(root2),
|
|
21454
21501
|
newFileCreated: hasNewSourceFile()
|
|
@@ -25248,11 +25295,15 @@ function collectLabels(value, previous) {
|
|
|
25248
25295
|
|
|
25249
25296
|
// src/commands/prs/renderScreenshotBlock.ts
|
|
25250
25297
|
import { extname as extname3 } from "path";
|
|
25251
|
-
|
|
25252
|
-
|
|
25298
|
+
|
|
25299
|
+
// src/commands/prs/screenshotReference.ts
|
|
25300
|
+
function screenshotReference({ path: path108, alt }) {
|
|
25253
25301
|
const target = /\s/.test(path108) ? `<${path108}>` : path108;
|
|
25254
25302
|
return ``;
|
|
25255
25303
|
}
|
|
25304
|
+
|
|
25305
|
+
// src/commands/prs/renderScreenshotBlock.ts
|
|
25306
|
+
var VIDEO_EXTENSIONS = /* @__PURE__ */ new Set([".mp4", ".webm", ".mov"]);
|
|
25256
25307
|
function cell(text18) {
|
|
25257
25308
|
return text18.replaceAll("|", String.raw`\|`);
|
|
25258
25309
|
}
|
|
@@ -25265,7 +25316,9 @@ function imageTable(images) {
|
|
|
25265
25316
|
for (let i = 0; i < images.length; i += 2) {
|
|
25266
25317
|
const pair = images.slice(i, i + 2);
|
|
25267
25318
|
const captions = [0, 1].map((j) => pair[j] ? cell(pair[j].alt) : "");
|
|
25268
|
-
const refs = [0, 1].map(
|
|
25319
|
+
const refs = [0, 1].map(
|
|
25320
|
+
(j) => pair[j] ? cell(screenshotReference(pair[j])) : ""
|
|
25321
|
+
);
|
|
25269
25322
|
if (i === 0) lines2.push(row(captions), row(["---", "---"]));
|
|
25270
25323
|
else lines2.push(row(captions.map((c) => c ? `**${c}**` : "")));
|
|
25271
25324
|
lines2.push(row(refs));
|
|
@@ -25276,7 +25329,7 @@ function renderScreenshotBlock(attachments) {
|
|
|
25276
25329
|
const isVideo = (a) => VIDEO_EXTENSIONS.has(extname3(a.path).toLowerCase());
|
|
25277
25330
|
return [
|
|
25278
25331
|
...imageTable(attachments.filter((a) => !isVideo(a))),
|
|
25279
|
-
...attachments.filter(isVideo).map(
|
|
25332
|
+
...attachments.filter(isVideo).map(screenshotReference)
|
|
25280
25333
|
];
|
|
25281
25334
|
}
|
|
25282
25335
|
|
|
@@ -25300,7 +25353,7 @@ function renderScreenshotsSection(attachments) {
|
|
|
25300
25353
|
return [
|
|
25301
25354
|
"## Screenshots",
|
|
25302
25355
|
...blocks,
|
|
25303
|
-
...
|
|
25356
|
+
...ungrouped.map(screenshotReference)
|
|
25304
25357
|
].join("\n\n");
|
|
25305
25358
|
}
|
|
25306
25359
|
|
|
@@ -25590,11 +25643,11 @@ function resolveIssueRepoTarget(repo) {
|
|
|
25590
25643
|
|
|
25591
25644
|
// src/commands/github/issue/resolveCreateIssueParent.ts
|
|
25592
25645
|
function resolveCreateIssueParent(target, parent) {
|
|
25593
|
-
const
|
|
25646
|
+
const reference = resolveFixStructureTarget(
|
|
25594
25647
|
parent,
|
|
25595
25648
|
`${target.owner}/${target.repo}`
|
|
25596
25649
|
);
|
|
25597
|
-
return { ...
|
|
25650
|
+
return { ...reference, id: fetchIssueNodeId(reference) };
|
|
25598
25651
|
}
|
|
25599
25652
|
|
|
25600
25653
|
// src/commands/github/issue/resolveCreateIssueProject.ts
|
|
@@ -29948,7 +30001,7 @@ var screenshotGuidance = `Screenshots: pass --screenshot '[Group/]Caption=path'
|
|
|
29948
30001
|
(png, jpg, jpeg, gif, webp, svg, mp4, webm, mov). gh ${minGhAttachVersion}+ uploads each
|
|
29949
30002
|
file and the body gets a ## Screenshots section: one ### Group heading per group
|
|
29950
30003
|
with its images in a 2-column captioned table (so light/dark pairs sit side by
|
|
29951
|
-
side), then any ungrouped images. The spec splits on the first '=' (label vs
|
|
30004
|
+
side), then any ungrouped images as plain images. The spec splits on the first '=' (label vs
|
|
29952
30005
|
path), then the label on the first '/' (group vs caption); a missing caption
|
|
29953
30006
|
falls back to the file name. A missing file or unsupported extension fails the
|
|
29954
30007
|
command before anything is previewed or sent. Never author ## Screenshots in a
|
|
@@ -31228,13 +31281,13 @@ ${errorText}`
|
|
|
31228
31281
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
31229
31282
|
import { execSync as execSync51 } from "child_process";
|
|
31230
31283
|
import chalk197 from "chalk";
|
|
31231
|
-
function resolveOpSecret(
|
|
31232
|
-
if (!
|
|
31284
|
+
function resolveOpSecret(reference) {
|
|
31285
|
+
if (!reference.startsWith("op://")) {
|
|
31233
31286
|
console.error(chalk197.red(`Invalid secret reference: must start with op://`));
|
|
31234
31287
|
process.exit(1);
|
|
31235
31288
|
}
|
|
31236
31289
|
try {
|
|
31237
|
-
return execSync51(`op read "${
|
|
31290
|
+
return execSync51(`op read "${reference}"`, {
|
|
31238
31291
|
encoding: "utf8",
|
|
31239
31292
|
stdio: ["pipe", "pipe", "pipe"]
|
|
31240
31293
|
}).trim();
|
|
@@ -35234,13 +35287,13 @@ function firstMatch(body, pattern2) {
|
|
|
35234
35287
|
return body.match(pattern2)?.[0] ?? null;
|
|
35235
35288
|
}
|
|
35236
35289
|
function checkDescriptionLinksIssue(body) {
|
|
35237
|
-
const
|
|
35238
|
-
if (!
|
|
35290
|
+
const reference = firstMatch(body, ISSUE_URL_PATTERN) ?? firstMatch(body, CROSS_REPO_PATTERN) ?? firstMatch(body, SAME_REPO_PATTERN2);
|
|
35291
|
+
if (!reference)
|
|
35239
35292
|
return {
|
|
35240
35293
|
status: "fail",
|
|
35241
35294
|
reason: "no GitHub issue reference (`#123`, `owner/repo#123`, or an issue URL) in the description"
|
|
35242
35295
|
};
|
|
35243
|
-
return { status: "pass", reason: `links ${
|
|
35296
|
+
return { status: "pass", reason: `links ${reference}` };
|
|
35244
35297
|
}
|
|
35245
35298
|
|
|
35246
35299
|
// src/commands/review/highLevel/checkDescriptionSections.ts
|