@staff0rd/assist 0.146.0 → 0.147.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/dist/index.js +75 -42
- 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.147.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -2608,7 +2608,7 @@ async function list2(options2) {
|
|
|
2608
2608
|
|
|
2609
2609
|
// src/commands/backlog/next.ts
|
|
2610
2610
|
import chalk36 from "chalk";
|
|
2611
|
-
import
|
|
2611
|
+
import enquirer7 from "enquirer";
|
|
2612
2612
|
|
|
2613
2613
|
// src/commands/backlog/run.ts
|
|
2614
2614
|
import chalk35 from "chalk";
|
|
@@ -2717,7 +2717,21 @@ import chalk34 from "chalk";
|
|
|
2717
2717
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
2718
2718
|
import { existsSync as existsSync16, unlinkSync as unlinkSync3 } from "fs";
|
|
2719
2719
|
import chalk33 from "chalk";
|
|
2720
|
+
import enquirer6 from "enquirer";
|
|
2721
|
+
|
|
2722
|
+
// src/commands/backlog/handleIncompletePhase.ts
|
|
2720
2723
|
import enquirer5 from "enquirer";
|
|
2724
|
+
async function handleIncompletePhase() {
|
|
2725
|
+
const { action } = await enquirer5.prompt({
|
|
2726
|
+
type: "select",
|
|
2727
|
+
name: "action",
|
|
2728
|
+
message: "Phase was not marked complete. What would you like to do?",
|
|
2729
|
+
choices: ["Retry this phase", "Skip to next phase", "Abort"]
|
|
2730
|
+
});
|
|
2731
|
+
if (action === "Retry this phase") return "retry";
|
|
2732
|
+
if (action === "Skip to next phase") return "skip";
|
|
2733
|
+
return "abort";
|
|
2734
|
+
}
|
|
2721
2735
|
|
|
2722
2736
|
// src/commands/backlog/phaseDone.ts
|
|
2723
2737
|
import { writeFileSync as writeFileSync13 } from "fs";
|
|
@@ -2780,7 +2794,7 @@ Phase ${phaseIndex + 1} completed. Running verify...`)
|
|
|
2780
2794
|
return true;
|
|
2781
2795
|
}
|
|
2782
2796
|
while (true) {
|
|
2783
|
-
const { action } = await
|
|
2797
|
+
const { action } = await enquirer6.prompt({
|
|
2784
2798
|
type: "select",
|
|
2785
2799
|
name: "action",
|
|
2786
2800
|
message: "Verification failed. What would you like to do?",
|
|
@@ -2800,25 +2814,18 @@ Phase ${phaseIndex + 1} completed. Running verify...`)
|
|
|
2800
2814
|
return action === "Continue to next phase";
|
|
2801
2815
|
}
|
|
2802
2816
|
}
|
|
2803
|
-
async function
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
return "abort";
|
|
2813
|
-
}
|
|
2814
|
-
async function resolvePhaseResult(phaseIndex) {
|
|
2815
|
-
if (existsSync16(getPhaseStatusPath())) {
|
|
2816
|
-
const shouldContinue = await handleCompletedPhase(phaseIndex);
|
|
2817
|
-
return shouldContinue ? 1 : -1;
|
|
2817
|
+
async function resolvePhaseResult(phaseIndex, options2) {
|
|
2818
|
+
if (!existsSync16(getPhaseStatusPath())) {
|
|
2819
|
+
const action = await handleIncompletePhase();
|
|
2820
|
+
if (action === "abort") return -1;
|
|
2821
|
+
return action === "skip" ? 1 : 0;
|
|
2822
|
+
}
|
|
2823
|
+
if (options2?.skipVerify) {
|
|
2824
|
+
cleanupMarker();
|
|
2825
|
+
return 1;
|
|
2818
2826
|
}
|
|
2819
|
-
const
|
|
2820
|
-
|
|
2821
|
-
return action === "skip" ? 1 : 0;
|
|
2827
|
+
const shouldContinue = await handleCompletedPhase(phaseIndex);
|
|
2828
|
+
return shouldContinue ? 1 : -1;
|
|
2822
2829
|
}
|
|
2823
2830
|
|
|
2824
2831
|
// src/commands/backlog/watchForMarker.ts
|
|
@@ -2837,7 +2844,7 @@ function stopWatching() {
|
|
|
2837
2844
|
}
|
|
2838
2845
|
|
|
2839
2846
|
// src/commands/backlog/executePhase.ts
|
|
2840
|
-
async function executePhase(item, phaseIndex, phases) {
|
|
2847
|
+
async function executePhase(item, phaseIndex, phases, options2) {
|
|
2841
2848
|
const phase = phases[phaseIndex];
|
|
2842
2849
|
console.log(
|
|
2843
2850
|
chalk34.bold(
|
|
@@ -2852,7 +2859,9 @@ async function executePhase(item, phaseIndex, phases) {
|
|
|
2852
2859
|
watchForMarker(child);
|
|
2853
2860
|
await done2;
|
|
2854
2861
|
stopWatching();
|
|
2855
|
-
const delta = await resolvePhaseResult(phaseIndex
|
|
2862
|
+
const delta = await resolvePhaseResult(phaseIndex, {
|
|
2863
|
+
skipVerify: options2?.skipVerify
|
|
2864
|
+
});
|
|
2856
2865
|
return delta < 0 ? -1 : phaseIndex + delta;
|
|
2857
2866
|
}
|
|
2858
2867
|
|
|
@@ -2902,7 +2911,9 @@ async function run2(id) {
|
|
|
2902
2911
|
const reviewPhase = buildReviewPhase();
|
|
2903
2912
|
const allPhases = [...plan2, reviewPhase];
|
|
2904
2913
|
const reviewIndex = plan2.length;
|
|
2905
|
-
const reviewResult = await executePhase(item, reviewIndex, allPhases
|
|
2914
|
+
const reviewResult = await executePhase(item, reviewIndex, allPhases, {
|
|
2915
|
+
skipVerify: true
|
|
2916
|
+
});
|
|
2906
2917
|
if (reviewResult < 0) return;
|
|
2907
2918
|
if (item.status !== "done") setStatus(id, "done");
|
|
2908
2919
|
console.log(chalk35.green(`
|
|
@@ -2932,7 +2943,7 @@ async function next() {
|
|
|
2932
2943
|
name: `${typeLabel(i.type)} #${i.id}: ${i.name}`,
|
|
2933
2944
|
value: String(i.id)
|
|
2934
2945
|
}));
|
|
2935
|
-
const { selected } = await
|
|
2946
|
+
const { selected } = await enquirer7.prompt({
|
|
2936
2947
|
type: "select",
|
|
2937
2948
|
name: "selected",
|
|
2938
2949
|
message: "Choose a backlog item to start:",
|
|
@@ -5744,10 +5755,10 @@ function registerJira(program2) {
|
|
|
5744
5755
|
|
|
5745
5756
|
// src/commands/news/add/index.ts
|
|
5746
5757
|
import chalk68 from "chalk";
|
|
5747
|
-
import
|
|
5758
|
+
import enquirer8 from "enquirer";
|
|
5748
5759
|
async function add2(url) {
|
|
5749
5760
|
if (!url) {
|
|
5750
|
-
const response = await
|
|
5761
|
+
const response = await enquirer8.prompt({
|
|
5751
5762
|
type: "input",
|
|
5752
5763
|
name: "url",
|
|
5753
5764
|
message: "RSS feed URL:",
|
|
@@ -6383,7 +6394,7 @@ async function listComments() {
|
|
|
6383
6394
|
import { execSync as execSync30 } from "child_process";
|
|
6384
6395
|
|
|
6385
6396
|
// src/commands/prs/prs/displayPaginated/index.ts
|
|
6386
|
-
import
|
|
6397
|
+
import enquirer9 from "enquirer";
|
|
6387
6398
|
|
|
6388
6399
|
// src/commands/prs/prs/displayPaginated/printPr.ts
|
|
6389
6400
|
import chalk71 from "chalk";
|
|
@@ -6453,7 +6464,7 @@ function parseAction(action) {
|
|
|
6453
6464
|
}
|
|
6454
6465
|
async function promptNavigation(currentPage, totalPages) {
|
|
6455
6466
|
const choices = buildNavChoices(currentPage, totalPages);
|
|
6456
|
-
const { action } = await
|
|
6467
|
+
const { action } = await enquirer9.prompt({
|
|
6457
6468
|
type: "select",
|
|
6458
6469
|
name: "action",
|
|
6459
6470
|
message: "Navigate",
|
|
@@ -7279,6 +7290,18 @@ async function applyExtraction(functionName, sourceFile, destPath, plan2, projec
|
|
|
7279
7290
|
}
|
|
7280
7291
|
updateImporters(functionName, sourceFile, plan2.importersToUpdate);
|
|
7281
7292
|
if (plan2.barrel) {
|
|
7293
|
+
for (const decl of plan2.barrel.getExportDeclarations()) {
|
|
7294
|
+
const named = decl.getNamedExports();
|
|
7295
|
+
const match = named.find((n) => n.getName() === functionName);
|
|
7296
|
+
if (match) {
|
|
7297
|
+
if (named.length === 1) {
|
|
7298
|
+
decl.remove();
|
|
7299
|
+
} else {
|
|
7300
|
+
match.remove();
|
|
7301
|
+
}
|
|
7302
|
+
break;
|
|
7303
|
+
}
|
|
7304
|
+
}
|
|
7282
7305
|
plan2.barrel.addExportDeclaration({
|
|
7283
7306
|
moduleSpecifier: plan2.barrelRelPath,
|
|
7284
7307
|
namedExports: [functionName]
|
|
@@ -7287,9 +7310,6 @@ async function applyExtraction(functionName, sourceFile, destPath, plan2, projec
|
|
|
7287
7310
|
await project.save();
|
|
7288
7311
|
}
|
|
7289
7312
|
|
|
7290
|
-
// src/commands/refactor/extract/buildPlan.ts
|
|
7291
|
-
import path29 from "path";
|
|
7292
|
-
|
|
7293
7313
|
// src/commands/refactor/extract/collectDependencies.ts
|
|
7294
7314
|
import {
|
|
7295
7315
|
SyntaxKind as SyntaxKind5
|
|
@@ -7617,6 +7637,26 @@ function findImporters(functionName, sourceFile, destPath, project) {
|
|
|
7617
7637
|
return result;
|
|
7618
7638
|
}
|
|
7619
7639
|
|
|
7640
|
+
// src/commands/refactor/extract/resolveBarrel.ts
|
|
7641
|
+
import path29 from "path";
|
|
7642
|
+
function resolveBarrel(functionName, sourcePath, destPath, project) {
|
|
7643
|
+
const indexPath = path29.join(path29.dirname(destPath), "index.ts");
|
|
7644
|
+
const barrel = project.getSourceFile(indexPath);
|
|
7645
|
+
if (!barrel) return { barrel: void 0, barrelRelPath: "" };
|
|
7646
|
+
const sourceRelFromBarrel = getRelativeImportPath(indexPath, sourcePath);
|
|
7647
|
+
const alreadyExported = barrel.getExportDeclarations().some((decl) => {
|
|
7648
|
+
const specifier = decl.getModuleSpecifierValue();
|
|
7649
|
+
if (specifier !== sourceRelFromBarrel) return false;
|
|
7650
|
+
const named = decl.getNamedExports();
|
|
7651
|
+
return named.some((n) => n.getName() === functionName);
|
|
7652
|
+
});
|
|
7653
|
+
if (!alreadyExported) return { barrel: void 0, barrelRelPath: "" };
|
|
7654
|
+
return {
|
|
7655
|
+
barrel,
|
|
7656
|
+
barrelRelPath: getRelativeImportPath(indexPath, destPath)
|
|
7657
|
+
};
|
|
7658
|
+
}
|
|
7659
|
+
|
|
7620
7660
|
// src/commands/refactor/extract/sourceReferencesName.ts
|
|
7621
7661
|
import { SyntaxKind as SyntaxKind10 } from "ts-morph";
|
|
7622
7662
|
var DECLARATION_KINDS = /* @__PURE__ */ new Set([
|
|
@@ -7649,13 +7689,6 @@ function sourceReferencesName(sourceFile, functionName, extractedNames) {
|
|
|
7649
7689
|
}
|
|
7650
7690
|
|
|
7651
7691
|
// src/commands/refactor/extract/buildPlan.ts
|
|
7652
|
-
function resolveBarrel(destPath, project) {
|
|
7653
|
-
const indexPath = path29.join(path29.dirname(destPath), "index.ts");
|
|
7654
|
-
return {
|
|
7655
|
-
barrel: project.getSourceFile(indexPath),
|
|
7656
|
-
barrelRelPath: getRelativeImportPath(indexPath, destPath)
|
|
7657
|
-
};
|
|
7658
|
-
}
|
|
7659
7692
|
function buildPlan(functionName, sourceFile, sourcePath, destPath, project) {
|
|
7660
7693
|
const analysis = analyseTarget(sourceFile, functionName);
|
|
7661
7694
|
const sourceRelPath = getRelativeImportPath(destPath, sourcePath);
|
|
@@ -7676,7 +7709,7 @@ function buildPlan(functionName, sourceFile, sourcePath, destPath, project) {
|
|
|
7676
7709
|
analysis.extractedNames
|
|
7677
7710
|
),
|
|
7678
7711
|
importersToUpdate: analysis.target.isExported() ? findImporters(functionName, sourceFile, destPath, project) : [],
|
|
7679
|
-
...resolveBarrel(destPath, project)
|
|
7712
|
+
...resolveBarrel(functionName, sourcePath, destPath, project)
|
|
7680
7713
|
};
|
|
7681
7714
|
}
|
|
7682
7715
|
|
|
@@ -9711,7 +9744,7 @@ async function exchangeToken(params) {
|
|
|
9711
9744
|
}
|
|
9712
9745
|
|
|
9713
9746
|
// src/commands/roam/promptCredentials.ts
|
|
9714
|
-
import
|
|
9747
|
+
import enquirer10 from "enquirer";
|
|
9715
9748
|
function censor(value) {
|
|
9716
9749
|
const visible = value.slice(-4);
|
|
9717
9750
|
return `${"*".repeat(value.length - 4)}${visible}`;
|
|
@@ -9720,7 +9753,7 @@ function label(name, existing) {
|
|
|
9720
9753
|
return existing ? `${name} (${censor(existing)})` : name;
|
|
9721
9754
|
}
|
|
9722
9755
|
async function promptField(name, existing) {
|
|
9723
|
-
const { value } = await
|
|
9756
|
+
const { value } = await enquirer10.prompt({
|
|
9724
9757
|
type: "input",
|
|
9725
9758
|
name: "value",
|
|
9726
9759
|
message: `${label(name, existing)}:`,
|