@staff0rd/assist 0.51.0 → 0.52.0
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/index.js +76 -65
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { execSync as
|
|
4
|
+
import { execSync as execSync23 } from "child_process";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@staff0rd/assist",
|
|
10
|
-
version: "0.
|
|
10
|
+
version: "0.52.0",
|
|
11
11
|
type: "module",
|
|
12
12
|
main: "dist/index.js",
|
|
13
13
|
bin: {
|
|
@@ -1277,7 +1277,7 @@ function lint() {
|
|
|
1277
1277
|
}
|
|
1278
1278
|
|
|
1279
1279
|
// src/commands/new/registerNew/newCli/index.ts
|
|
1280
|
-
import { execSync as
|
|
1280
|
+
import { execSync as execSync8 } from "child_process";
|
|
1281
1281
|
import { basename as basename2, resolve } from "path";
|
|
1282
1282
|
|
|
1283
1283
|
// src/commands/verify/hardcodedColors.ts
|
|
@@ -1432,26 +1432,35 @@ async function run(options2 = {}) {
|
|
|
1432
1432
|
await executeVerifyScripts(found, options2.timer ?? false);
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
|
-
// src/commands/new/registerNew/
|
|
1435
|
+
// src/commands/new/registerNew/initGit.ts
|
|
1436
1436
|
import { execSync as execSync6 } from "child_process";
|
|
1437
|
+
import { writeFileSync as writeFileSync6 } from "fs";
|
|
1438
|
+
function initGit() {
|
|
1439
|
+
console.log("Initializing git repository...");
|
|
1440
|
+
execSync6("git init", { stdio: "inherit" });
|
|
1441
|
+
writeFileSync6(".gitignore", "dist\nnode_modules\n");
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
// src/commands/new/registerNew/newCli/initPackageJson.ts
|
|
1445
|
+
import { execSync as execSync7 } from "child_process";
|
|
1437
1446
|
function initPackageJson(name) {
|
|
1438
1447
|
console.log("Initializing package.json...");
|
|
1439
|
-
|
|
1448
|
+
execSync7("npm init -y", { stdio: "inherit" });
|
|
1440
1449
|
console.log("Configuring package.json...");
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1450
|
+
execSync7("npm pkg delete main", { stdio: "inherit" });
|
|
1451
|
+
execSync7("npm pkg set type=module", { stdio: "inherit" });
|
|
1452
|
+
execSync7(`npm pkg set bin.${name}=./dist/index.js`, { stdio: "inherit" });
|
|
1453
|
+
execSync7("npm pkg set scripts.build=tsup", { stdio: "inherit" });
|
|
1454
|
+
execSync7('npm pkg set scripts.start="node dist/index.js"', {
|
|
1446
1455
|
stdio: "inherit"
|
|
1447
1456
|
});
|
|
1448
1457
|
}
|
|
1449
1458
|
|
|
1450
1459
|
// src/commands/new/registerNew/newCli/writeCliTemplate.ts
|
|
1451
|
-
import { mkdirSync as mkdirSync2, writeFileSync as
|
|
1460
|
+
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
1452
1461
|
function writeCliTemplate(name) {
|
|
1453
1462
|
console.log("Writing tsconfig.json...");
|
|
1454
|
-
|
|
1463
|
+
writeFileSync7(
|
|
1455
1464
|
"tsconfig.json",
|
|
1456
1465
|
JSON.stringify(
|
|
1457
1466
|
{
|
|
@@ -1475,7 +1484,7 @@ function writeCliTemplate(name) {
|
|
|
1475
1484
|
)
|
|
1476
1485
|
);
|
|
1477
1486
|
console.log("Writing tsup.config.ts...");
|
|
1478
|
-
|
|
1487
|
+
writeFileSync7(
|
|
1479
1488
|
"tsup.config.ts",
|
|
1480
1489
|
`import { defineConfig } from "tsup";
|
|
1481
1490
|
export default defineConfig({
|
|
@@ -1490,7 +1499,7 @@ export default defineConfig({
|
|
|
1490
1499
|
);
|
|
1491
1500
|
console.log("Writing src/index.ts...");
|
|
1492
1501
|
mkdirSync2("src", { recursive: true });
|
|
1493
|
-
|
|
1502
|
+
writeFileSync7(
|
|
1494
1503
|
"src/index.ts",
|
|
1495
1504
|
`#!/usr/bin/env node
|
|
1496
1505
|
import { Command } from "commander";
|
|
@@ -1504,10 +1513,11 @@ program.parse();
|
|
|
1504
1513
|
// src/commands/new/registerNew/newCli/index.ts
|
|
1505
1514
|
async function newCli() {
|
|
1506
1515
|
const name = basename2(resolve("."));
|
|
1516
|
+
initGit();
|
|
1507
1517
|
initPackageJson(name);
|
|
1508
1518
|
console.log("Installing dependencies...");
|
|
1509
|
-
|
|
1510
|
-
|
|
1519
|
+
execSync8("npm install commander", { stdio: "inherit" });
|
|
1520
|
+
execSync8("npm install -D tsup typescript @types/node", {
|
|
1511
1521
|
stdio: "inherit"
|
|
1512
1522
|
});
|
|
1513
1523
|
writeCliTemplate(name);
|
|
@@ -1516,16 +1526,16 @@ async function newCli() {
|
|
|
1516
1526
|
}
|
|
1517
1527
|
|
|
1518
1528
|
// src/commands/new/registerNew/newProject.ts
|
|
1519
|
-
import { execSync as
|
|
1520
|
-
import { existsSync as existsSync10, readFileSync as readFileSync8, writeFileSync as
|
|
1529
|
+
import { execSync as execSync10 } from "child_process";
|
|
1530
|
+
import { existsSync as existsSync10, readFileSync as readFileSync8, writeFileSync as writeFileSync9 } from "fs";
|
|
1521
1531
|
|
|
1522
1532
|
// src/commands/deploy/init/index.ts
|
|
1523
|
-
import { execSync as
|
|
1533
|
+
import { execSync as execSync9 } from "child_process";
|
|
1524
1534
|
import chalk21 from "chalk";
|
|
1525
1535
|
import enquirer3 from "enquirer";
|
|
1526
1536
|
|
|
1527
1537
|
// src/commands/deploy/init/updateWorkflow.ts
|
|
1528
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as
|
|
1538
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync8 } from "fs";
|
|
1529
1539
|
import { dirname as dirname10, join as join7 } from "path";
|
|
1530
1540
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1531
1541
|
import chalk20 from "chalk";
|
|
@@ -1565,7 +1575,7 @@ async function updateWorkflow(siteId) {
|
|
|
1565
1575
|
return;
|
|
1566
1576
|
}
|
|
1567
1577
|
}
|
|
1568
|
-
|
|
1578
|
+
writeFileSync8(WORKFLOW_PATH, newContent);
|
|
1569
1579
|
console.log(chalk20.green(`
|
|
1570
1580
|
Created ${WORKFLOW_PATH}`));
|
|
1571
1581
|
}
|
|
@@ -1573,7 +1583,7 @@ Created ${WORKFLOW_PATH}`));
|
|
|
1573
1583
|
// src/commands/deploy/init/index.ts
|
|
1574
1584
|
async function ensureNetlifyCli() {
|
|
1575
1585
|
try {
|
|
1576
|
-
|
|
1586
|
+
execSync9("netlify sites:create --disable-linking", { stdio: "inherit" });
|
|
1577
1587
|
} catch (error) {
|
|
1578
1588
|
if (!(error instanceof Error) || !error.message.includes("command not found"))
|
|
1579
1589
|
throw error;
|
|
@@ -1588,9 +1598,9 @@ async function ensureNetlifyCli() {
|
|
|
1588
1598
|
process.exit(1);
|
|
1589
1599
|
}
|
|
1590
1600
|
console.log(chalk21.dim("\nInstalling netlify-cli...\n"));
|
|
1591
|
-
|
|
1601
|
+
execSync9("npm install -g netlify-cli", { stdio: "inherit" });
|
|
1592
1602
|
console.log();
|
|
1593
|
-
|
|
1603
|
+
execSync9("netlify sites:create --disable-linking", { stdio: "inherit" });
|
|
1594
1604
|
}
|
|
1595
1605
|
}
|
|
1596
1606
|
function printSetupInstructions() {
|
|
@@ -1633,9 +1643,10 @@ async function init5() {
|
|
|
1633
1643
|
// src/commands/new/registerNew/newProject.ts
|
|
1634
1644
|
async function newProject() {
|
|
1635
1645
|
console.log("Initializing Vite with react-ts template...");
|
|
1636
|
-
|
|
1646
|
+
execSync10("npm create vite@latest . -- --template react-ts", {
|
|
1637
1647
|
stdio: "inherit"
|
|
1638
1648
|
});
|
|
1649
|
+
initGit();
|
|
1639
1650
|
removeEslint({ removeLintScripts: true });
|
|
1640
1651
|
addViteBaseConfig();
|
|
1641
1652
|
await init4();
|
|
@@ -1657,7 +1668,7 @@ function addViteBaseConfig() {
|
|
|
1657
1668
|
'defineConfig({\n base: "./",'
|
|
1658
1669
|
);
|
|
1659
1670
|
if (updated !== content) {
|
|
1660
|
-
|
|
1671
|
+
writeFileSync9(viteConfigPath, updated);
|
|
1661
1672
|
console.log('Added base: "./" to vite.config.ts');
|
|
1662
1673
|
}
|
|
1663
1674
|
}
|
|
@@ -2283,7 +2294,7 @@ function registerComplexity(program2) {
|
|
|
2283
2294
|
}
|
|
2284
2295
|
|
|
2285
2296
|
// src/commands/deploy/redirect.ts
|
|
2286
|
-
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as
|
|
2297
|
+
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync10 } from "fs";
|
|
2287
2298
|
import chalk28 from "chalk";
|
|
2288
2299
|
var TRAILING_SLASH_SCRIPT = ` <script>
|
|
2289
2300
|
if (!window.location.pathname.endsWith('/')) {
|
|
@@ -2307,7 +2318,7 @@ function redirect() {
|
|
|
2307
2318
|
return;
|
|
2308
2319
|
}
|
|
2309
2320
|
const newContent = content.slice(0, headCloseIndex) + TRAILING_SLASH_SCRIPT + "\n " + content.slice(headCloseIndex);
|
|
2310
|
-
|
|
2321
|
+
writeFileSync10(indexPath, newContent);
|
|
2311
2322
|
console.log(chalk28.green("Added trailing slash redirect to index.html"));
|
|
2312
2323
|
}
|
|
2313
2324
|
|
|
@@ -2319,11 +2330,11 @@ function registerDeploy(program2) {
|
|
|
2319
2330
|
}
|
|
2320
2331
|
|
|
2321
2332
|
// src/commands/devlog/list/index.ts
|
|
2322
|
-
import { execSync as
|
|
2333
|
+
import { execSync as execSync12 } from "child_process";
|
|
2323
2334
|
import { basename as basename3 } from "path";
|
|
2324
2335
|
|
|
2325
2336
|
// src/commands/devlog/shared.ts
|
|
2326
|
-
import { execSync as
|
|
2337
|
+
import { execSync as execSync11 } from "child_process";
|
|
2327
2338
|
import chalk29 from "chalk";
|
|
2328
2339
|
|
|
2329
2340
|
// src/commands/devlog/loadDevlogEntries.ts
|
|
@@ -2367,7 +2378,7 @@ function loadDevlogEntries(repoName) {
|
|
|
2367
2378
|
// src/commands/devlog/shared.ts
|
|
2368
2379
|
function getCommitFiles(hash) {
|
|
2369
2380
|
try {
|
|
2370
|
-
const output =
|
|
2381
|
+
const output = execSync11(`git show --name-only --format="" ${hash}`, {
|
|
2371
2382
|
encoding: "utf-8"
|
|
2372
2383
|
});
|
|
2373
2384
|
return output.trim().split("\n").filter(Boolean);
|
|
@@ -2438,7 +2449,7 @@ function list(options2) {
|
|
|
2438
2449
|
const devlogEntries = loadDevlogEntries(repoName);
|
|
2439
2450
|
const reverseFlag = options2.reverse ? "--reverse " : "";
|
|
2440
2451
|
const limitFlag = options2.reverse ? "" : "-n 500 ";
|
|
2441
|
-
const output =
|
|
2452
|
+
const output = execSync12(
|
|
2442
2453
|
`git log ${reverseFlag}${limitFlag}--pretty=format:'%ad|%h|%s' --date=short`,
|
|
2443
2454
|
{ encoding: "utf-8" }
|
|
2444
2455
|
);
|
|
@@ -2464,11 +2475,11 @@ function list(options2) {
|
|
|
2464
2475
|
}
|
|
2465
2476
|
|
|
2466
2477
|
// src/commands/devlog/getLastVersionInfo.ts
|
|
2467
|
-
import { execSync as
|
|
2478
|
+
import { execSync as execSync13 } from "child_process";
|
|
2468
2479
|
import semver from "semver";
|
|
2469
2480
|
function getVersionAtCommit(hash) {
|
|
2470
2481
|
try {
|
|
2471
|
-
const content =
|
|
2482
|
+
const content = execSync13(`git show ${hash}:package.json`, {
|
|
2472
2483
|
encoding: "utf-8"
|
|
2473
2484
|
});
|
|
2474
2485
|
const pkg = JSON.parse(content);
|
|
@@ -2483,7 +2494,7 @@ function stripToMinor(version2) {
|
|
|
2483
2494
|
}
|
|
2484
2495
|
function getLastVersionInfoFromGit() {
|
|
2485
2496
|
try {
|
|
2486
|
-
const output =
|
|
2497
|
+
const output = execSync13(
|
|
2487
2498
|
"git log -1 --pretty=format:'%ad|%h' --date=short",
|
|
2488
2499
|
{
|
|
2489
2500
|
encoding: "utf-8"
|
|
@@ -2526,7 +2537,7 @@ function bumpVersion(version2, type) {
|
|
|
2526
2537
|
}
|
|
2527
2538
|
|
|
2528
2539
|
// src/commands/devlog/next/displayNextEntry/index.ts
|
|
2529
|
-
import { execSync as
|
|
2540
|
+
import { execSync as execSync14 } from "child_process";
|
|
2530
2541
|
import chalk32 from "chalk";
|
|
2531
2542
|
|
|
2532
2543
|
// src/commands/devlog/next/displayNextEntry/displayVersion.ts
|
|
@@ -2560,7 +2571,7 @@ function findTargetDate(commitsByDate, skipDays) {
|
|
|
2560
2571
|
return Array.from(commitsByDate.keys()).filter((d) => !skipDays.has(d)).sort()[0];
|
|
2561
2572
|
}
|
|
2562
2573
|
function fetchCommitsByDate(ignore2, lastDate) {
|
|
2563
|
-
const output =
|
|
2574
|
+
const output = execSync14(
|
|
2564
2575
|
"git log --pretty=format:'%ad|%h|%s' --date=short -n 500",
|
|
2565
2576
|
{ encoding: "utf-8" }
|
|
2566
2577
|
);
|
|
@@ -2687,11 +2698,11 @@ function registerDevlog(program2) {
|
|
|
2687
2698
|
}
|
|
2688
2699
|
|
|
2689
2700
|
// src/commands/prs/fixed.ts
|
|
2690
|
-
import { execSync as
|
|
2701
|
+
import { execSync as execSync17 } from "child_process";
|
|
2691
2702
|
|
|
2692
2703
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
2693
|
-
import { execSync as
|
|
2694
|
-
import { unlinkSync as unlinkSync3, writeFileSync as
|
|
2704
|
+
import { execSync as execSync16 } from "child_process";
|
|
2705
|
+
import { unlinkSync as unlinkSync3, writeFileSync as writeFileSync11 } from "fs";
|
|
2695
2706
|
import { tmpdir } from "os";
|
|
2696
2707
|
import { join as join10 } from "path";
|
|
2697
2708
|
|
|
@@ -2719,7 +2730,7 @@ function deleteCommentsCache(prNumber) {
|
|
|
2719
2730
|
}
|
|
2720
2731
|
|
|
2721
2732
|
// src/commands/prs/shared.ts
|
|
2722
|
-
import { execSync as
|
|
2733
|
+
import { execSync as execSync15 } from "child_process";
|
|
2723
2734
|
function isGhNotInstalled(error) {
|
|
2724
2735
|
if (error instanceof Error) {
|
|
2725
2736
|
const msg = error.message.toLowerCase();
|
|
@@ -2735,14 +2746,14 @@ function isNotFound(error) {
|
|
|
2735
2746
|
}
|
|
2736
2747
|
function getRepoInfo() {
|
|
2737
2748
|
const repoInfo = JSON.parse(
|
|
2738
|
-
|
|
2749
|
+
execSync15("gh repo view --json owner,name", { encoding: "utf-8" })
|
|
2739
2750
|
);
|
|
2740
2751
|
return { org: repoInfo.owner.login, repo: repoInfo.name };
|
|
2741
2752
|
}
|
|
2742
2753
|
function getCurrentPrNumber() {
|
|
2743
2754
|
try {
|
|
2744
2755
|
const prInfo = JSON.parse(
|
|
2745
|
-
|
|
2756
|
+
execSync15("gh pr view --json number", { encoding: "utf-8" })
|
|
2746
2757
|
);
|
|
2747
2758
|
return prInfo.number;
|
|
2748
2759
|
} catch (error) {
|
|
@@ -2756,7 +2767,7 @@ function getCurrentPrNumber() {
|
|
|
2756
2767
|
|
|
2757
2768
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
2758
2769
|
function replyToComment(org, repo, prNumber, commentId, message) {
|
|
2759
|
-
|
|
2770
|
+
execSync16(
|
|
2760
2771
|
`gh api repos/${org}/${repo}/pulls/${prNumber}/comments -f body="${message.replace(/"/g, '\\"')}" -F in_reply_to=${commentId}`,
|
|
2761
2772
|
{ stdio: "inherit" }
|
|
2762
2773
|
);
|
|
@@ -2764,9 +2775,9 @@ function replyToComment(org, repo, prNumber, commentId, message) {
|
|
|
2764
2775
|
function resolveThread(threadId) {
|
|
2765
2776
|
const mutation = `mutation($threadId: ID!) { resolveReviewThread(input: {threadId: $threadId}) { thread { isResolved } } }`;
|
|
2766
2777
|
const queryFile = join10(tmpdir(), `gh-mutation-${Date.now()}.graphql`);
|
|
2767
|
-
|
|
2778
|
+
writeFileSync11(queryFile, mutation);
|
|
2768
2779
|
try {
|
|
2769
|
-
|
|
2780
|
+
execSync16(
|
|
2770
2781
|
`gh api graphql -F query=@${queryFile} -f threadId="${threadId}"`,
|
|
2771
2782
|
{ stdio: "inherit" }
|
|
2772
2783
|
);
|
|
@@ -2818,7 +2829,7 @@ function resolveCommentWithReply(commentId, message) {
|
|
|
2818
2829
|
// src/commands/prs/fixed.ts
|
|
2819
2830
|
function verifySha(sha) {
|
|
2820
2831
|
try {
|
|
2821
|
-
return
|
|
2832
|
+
return execSync17(`git rev-parse --verify ${sha}`, {
|
|
2822
2833
|
encoding: "utf-8"
|
|
2823
2834
|
}).trim();
|
|
2824
2835
|
} catch {
|
|
@@ -2844,7 +2855,7 @@ function fixed(commentId, sha) {
|
|
|
2844
2855
|
}
|
|
2845
2856
|
|
|
2846
2857
|
// src/commands/prs/listComments/index.ts
|
|
2847
|
-
import { existsSync as existsSync13, mkdirSync as mkdirSync4, writeFileSync as
|
|
2858
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync4, writeFileSync as writeFileSync13 } from "fs";
|
|
2848
2859
|
import { join as join12 } from "path";
|
|
2849
2860
|
import { stringify } from "yaml";
|
|
2850
2861
|
|
|
@@ -2854,16 +2865,16 @@ function isClaudeCode() {
|
|
|
2854
2865
|
}
|
|
2855
2866
|
|
|
2856
2867
|
// src/commands/prs/fetchThreadIds.ts
|
|
2857
|
-
import { execSync as
|
|
2858
|
-
import { unlinkSync as unlinkSync4, writeFileSync as
|
|
2868
|
+
import { execSync as execSync18 } from "child_process";
|
|
2869
|
+
import { unlinkSync as unlinkSync4, writeFileSync as writeFileSync12 } from "fs";
|
|
2859
2870
|
import { tmpdir as tmpdir2 } from "os";
|
|
2860
2871
|
import { join as join11 } from "path";
|
|
2861
2872
|
var THREAD_QUERY = `query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { id isResolved comments(first: 100) { nodes { databaseId } } } } } } }`;
|
|
2862
2873
|
function fetchThreadIds(org, repo, prNumber) {
|
|
2863
2874
|
const queryFile = join11(tmpdir2(), `gh-query-${Date.now()}.graphql`);
|
|
2864
|
-
|
|
2875
|
+
writeFileSync12(queryFile, THREAD_QUERY);
|
|
2865
2876
|
try {
|
|
2866
|
-
const result =
|
|
2877
|
+
const result = execSync18(
|
|
2867
2878
|
`gh api graphql -F query=@${queryFile} -F owner="${org}" -F repo="${repo}" -F prNumber=${prNumber}`,
|
|
2868
2879
|
{ encoding: "utf-8" }
|
|
2869
2880
|
);
|
|
@@ -2885,9 +2896,9 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
2885
2896
|
}
|
|
2886
2897
|
|
|
2887
2898
|
// src/commands/prs/listComments/fetchReviewComments.ts
|
|
2888
|
-
import { execSync as
|
|
2899
|
+
import { execSync as execSync19 } from "child_process";
|
|
2889
2900
|
function fetchJson(endpoint) {
|
|
2890
|
-
const result =
|
|
2901
|
+
const result = execSync19(`gh api ${endpoint}`, { encoding: "utf-8" });
|
|
2891
2902
|
if (!result.trim()) return [];
|
|
2892
2903
|
return JSON.parse(result);
|
|
2893
2904
|
}
|
|
@@ -2973,7 +2984,7 @@ function writeCommentsCache(prNumber, comments) {
|
|
|
2973
2984
|
comments
|
|
2974
2985
|
};
|
|
2975
2986
|
const cachePath = join12(assistDir, `pr-${prNumber}-comments.yaml`);
|
|
2976
|
-
|
|
2987
|
+
writeFileSync13(cachePath, stringify(cacheData));
|
|
2977
2988
|
}
|
|
2978
2989
|
function handleKnownErrors(error) {
|
|
2979
2990
|
if (isGhNotInstalled(error)) {
|
|
@@ -3013,7 +3024,7 @@ async function listComments() {
|
|
|
3013
3024
|
}
|
|
3014
3025
|
|
|
3015
3026
|
// src/commands/prs/prs/index.ts
|
|
3016
|
-
import { execSync as
|
|
3027
|
+
import { execSync as execSync20 } from "child_process";
|
|
3017
3028
|
|
|
3018
3029
|
// src/commands/prs/prs/displayPaginated/index.ts
|
|
3019
3030
|
import enquirer4 from "enquirer";
|
|
@@ -3119,7 +3130,7 @@ async function displayPaginated(pullRequests) {
|
|
|
3119
3130
|
async function prs(options2) {
|
|
3120
3131
|
const state = options2.open ? "open" : options2.closed ? "closed" : "all";
|
|
3121
3132
|
try {
|
|
3122
|
-
const result =
|
|
3133
|
+
const result = execSync20(
|
|
3123
3134
|
`gh pr list --state ${state} --json number,title,url,author,createdAt,mergedAt,closedAt,state,changedFiles --limit 100`,
|
|
3124
3135
|
{ encoding: "utf-8" }
|
|
3125
3136
|
);
|
|
@@ -3142,7 +3153,7 @@ async function prs(options2) {
|
|
|
3142
3153
|
}
|
|
3143
3154
|
|
|
3144
3155
|
// src/commands/prs/wontfix.ts
|
|
3145
|
-
import { execSync as
|
|
3156
|
+
import { execSync as execSync21 } from "child_process";
|
|
3146
3157
|
function validateReason(reason) {
|
|
3147
3158
|
const lowerReason = reason.toLowerCase();
|
|
3148
3159
|
if (lowerReason.includes("claude") || lowerReason.includes("opus")) {
|
|
@@ -3159,7 +3170,7 @@ function validateShaReferences(reason) {
|
|
|
3159
3170
|
const invalidShas = [];
|
|
3160
3171
|
for (const sha of shas) {
|
|
3161
3172
|
try {
|
|
3162
|
-
|
|
3173
|
+
execSync21(`git cat-file -t ${sha}`, { stdio: "pipe" });
|
|
3163
3174
|
} catch {
|
|
3164
3175
|
invalidShas.push(sha);
|
|
3165
3176
|
}
|
|
@@ -3260,7 +3271,7 @@ Refactor check failed:
|
|
|
3260
3271
|
}
|
|
3261
3272
|
|
|
3262
3273
|
// src/commands/refactor/check/getViolations/index.ts
|
|
3263
|
-
import { execSync as
|
|
3274
|
+
import { execSync as execSync22 } from "child_process";
|
|
3264
3275
|
import fs15 from "fs";
|
|
3265
3276
|
import { minimatch as minimatch2 } from "minimatch";
|
|
3266
3277
|
|
|
@@ -3310,7 +3321,7 @@ function getGitFiles(options2) {
|
|
|
3310
3321
|
}
|
|
3311
3322
|
const files = /* @__PURE__ */ new Set();
|
|
3312
3323
|
if (options2.staged || options2.modified) {
|
|
3313
|
-
const staged =
|
|
3324
|
+
const staged = execSync22("git diff --cached --name-only", {
|
|
3314
3325
|
encoding: "utf-8"
|
|
3315
3326
|
});
|
|
3316
3327
|
for (const file of staged.trim().split("\n").filter(Boolean)) {
|
|
@@ -3318,7 +3329,7 @@ function getGitFiles(options2) {
|
|
|
3318
3329
|
}
|
|
3319
3330
|
}
|
|
3320
3331
|
if (options2.unstaged || options2.modified) {
|
|
3321
|
-
const unstaged =
|
|
3332
|
+
const unstaged = execSync22("git diff --name-only", { encoding: "utf-8" });
|
|
3322
3333
|
for (const file of unstaged.trim().split("\n").filter(Boolean)) {
|
|
3323
3334
|
files.add(file);
|
|
3324
3335
|
}
|
|
@@ -4121,7 +4132,7 @@ async function fixInvalidDatePrefixes(vttFiles) {
|
|
|
4121
4132
|
}
|
|
4122
4133
|
|
|
4123
4134
|
// src/commands/transcript/format/processVttFile/index.ts
|
|
4124
|
-
import { existsSync as existsSync15, mkdirSync as mkdirSync5, readFileSync as readFileSync12, writeFileSync as
|
|
4135
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync5, readFileSync as readFileSync12, writeFileSync as writeFileSync14 } from "fs";
|
|
4125
4136
|
import { basename as basename5, dirname as dirname13, join as join16 } from "path";
|
|
4126
4137
|
|
|
4127
4138
|
// src/commands/transcript/cleanText.ts
|
|
@@ -4372,7 +4383,7 @@ function readAndParseCues(inputPath) {
|
|
|
4372
4383
|
return processCues(readFileSync12(inputPath, "utf-8"));
|
|
4373
4384
|
}
|
|
4374
4385
|
function writeFormatted(outputPath, content) {
|
|
4375
|
-
|
|
4386
|
+
writeFileSync14(outputPath, content, "utf-8");
|
|
4376
4387
|
console.log(`Written: ${outputPath}`);
|
|
4377
4388
|
}
|
|
4378
4389
|
function convertVttToMarkdown(inputPath, outputPath) {
|
|
@@ -4812,7 +4823,7 @@ program.command("init").description("Initialize VS Code and verify configuration
|
|
|
4812
4823
|
program.command("commit <message>").description("Create a git commit with validation").action(commit);
|
|
4813
4824
|
program.command("update").description("Update claude-code to the latest version").action(() => {
|
|
4814
4825
|
console.log("Updating claude-code...");
|
|
4815
|
-
|
|
4826
|
+
execSync23("npm install -g @anthropic-ai/claude-code", { stdio: "inherit" });
|
|
4816
4827
|
});
|
|
4817
4828
|
var configCommand = program.command("config").description("View and modify assist.yml configuration");
|
|
4818
4829
|
configCommand.command("set <key> <value>").description("Set a config value (e.g. commit.push true)").action(configSet);
|