@staff0rd/assist 0.68.0 → 0.70.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 +54 -44
- 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.70.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -1338,6 +1338,48 @@ Total: ${lines.length} hardcoded color(s)`);
|
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
1340
|
|
|
1341
|
+
// src/commands/verify/run/resolveEntries.ts
|
|
1342
|
+
import * as path13 from "path";
|
|
1343
|
+
function quoteIfNeeded(arg) {
|
|
1344
|
+
return arg.includes(" ") ? `"${arg}"` : arg;
|
|
1345
|
+
}
|
|
1346
|
+
function buildFullCommand(command, args) {
|
|
1347
|
+
return [quoteIfNeeded(command), ...(args ?? []).map(quoteIfNeeded)].join(" ");
|
|
1348
|
+
}
|
|
1349
|
+
function getRunEntries() {
|
|
1350
|
+
const { run: run3 } = loadConfig();
|
|
1351
|
+
if (!run3) return [];
|
|
1352
|
+
return run3.filter((r) => r.name.startsWith("verify:")).map((r) => ({
|
|
1353
|
+
name: r.name,
|
|
1354
|
+
fullCommand: buildFullCommand(r.command, r.args)
|
|
1355
|
+
}));
|
|
1356
|
+
}
|
|
1357
|
+
function getPackageJsonEntries() {
|
|
1358
|
+
const result = findPackageJsonWithVerifyScripts(process.cwd());
|
|
1359
|
+
if (!result) return [];
|
|
1360
|
+
const cwd = path13.dirname(result.packageJsonPath);
|
|
1361
|
+
return result.verifyScripts.map((script) => ({
|
|
1362
|
+
name: script,
|
|
1363
|
+
fullCommand: `npm run ${script}`,
|
|
1364
|
+
cwd
|
|
1365
|
+
}));
|
|
1366
|
+
}
|
|
1367
|
+
function resolveEntries() {
|
|
1368
|
+
return [...getRunEntries(), ...getPackageJsonEntries()];
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// src/commands/verify/list.ts
|
|
1372
|
+
function list() {
|
|
1373
|
+
const entries = resolveEntries();
|
|
1374
|
+
if (entries.length === 0) {
|
|
1375
|
+
console.error("No verify commands found");
|
|
1376
|
+
process.exit(1);
|
|
1377
|
+
}
|
|
1378
|
+
for (const entry of entries) {
|
|
1379
|
+
console.log(`${entry.name}: ${entry.fullCommand}`);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1341
1383
|
// src/commands/verify/run/createTimerCallback/printTaskStatuses.ts
|
|
1342
1384
|
function formatDuration(ms) {
|
|
1343
1385
|
if (ms < 1e3) {
|
|
@@ -1380,36 +1422,6 @@ function initTaskStatuses(scripts) {
|
|
|
1380
1422
|
return scripts.map((script) => ({ script, startTime: Date.now() }));
|
|
1381
1423
|
}
|
|
1382
1424
|
|
|
1383
|
-
// src/commands/verify/run/resolveEntries.ts
|
|
1384
|
-
import * as path13 from "path";
|
|
1385
|
-
function quoteIfNeeded(arg) {
|
|
1386
|
-
return arg.includes(" ") ? `"${arg}"` : arg;
|
|
1387
|
-
}
|
|
1388
|
-
function buildFullCommand(command, args) {
|
|
1389
|
-
return [quoteIfNeeded(command), ...(args ?? []).map(quoteIfNeeded)].join(" ");
|
|
1390
|
-
}
|
|
1391
|
-
function getRunEntries() {
|
|
1392
|
-
const { run: run3 } = loadConfig();
|
|
1393
|
-
if (!run3) return [];
|
|
1394
|
-
return run3.filter((r) => r.name.startsWith("verify:")).map((r) => ({
|
|
1395
|
-
name: r.name,
|
|
1396
|
-
fullCommand: buildFullCommand(r.command, r.args)
|
|
1397
|
-
}));
|
|
1398
|
-
}
|
|
1399
|
-
function getPackageJsonEntries() {
|
|
1400
|
-
const result = findPackageJsonWithVerifyScripts(process.cwd());
|
|
1401
|
-
if (!result) return [];
|
|
1402
|
-
const cwd = path13.dirname(result.packageJsonPath);
|
|
1403
|
-
return result.verifyScripts.map((script) => ({
|
|
1404
|
-
name: script,
|
|
1405
|
-
fullCommand: `npm run ${script}`,
|
|
1406
|
-
cwd
|
|
1407
|
-
}));
|
|
1408
|
-
}
|
|
1409
|
-
function resolveEntries() {
|
|
1410
|
-
return [...getRunEntries(), ...getPackageJsonEntries()];
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
1425
|
// src/commands/verify/run/spawnCommand.ts
|
|
1414
1426
|
import { spawn } from "child_process";
|
|
1415
1427
|
var isClaudeCode = !!process.env.CLAUDECODE;
|
|
@@ -2041,7 +2053,7 @@ function statusIcon(status) {
|
|
|
2041
2053
|
return chalk26.green("[x]");
|
|
2042
2054
|
}
|
|
2043
2055
|
}
|
|
2044
|
-
async function
|
|
2056
|
+
async function list2(options2) {
|
|
2045
2057
|
const backlogPath = getBacklogPath();
|
|
2046
2058
|
if (!existsSync14(backlogPath)) {
|
|
2047
2059
|
console.log(
|
|
@@ -2285,9 +2297,9 @@ async function web(options2) {
|
|
|
2285
2297
|
|
|
2286
2298
|
// src/commands/registerBacklog.ts
|
|
2287
2299
|
function registerBacklog(program2) {
|
|
2288
|
-
const backlogCommand = program2.command("backlog").description("Manage a backlog of work items").action(
|
|
2300
|
+
const backlogCommand = program2.command("backlog").description("Manage a backlog of work items").action(list2);
|
|
2289
2301
|
backlogCommand.command("init").description("Create an empty assist.backlog.yml").action(init6);
|
|
2290
|
-
backlogCommand.command("list").description("List all backlog items").option("--status <type>", "Filter by status (todo, in-progress, done)").option("-v, --verbose", "Show all item details").action(
|
|
2302
|
+
backlogCommand.command("list").description("List all backlog items").option("--status <type>", "Filter by status (todo, in-progress, done)").option("-v, --verbose", "Show all item details").action(list2);
|
|
2291
2303
|
backlogCommand.command("add").description("Add a new backlog item").action(add);
|
|
2292
2304
|
backlogCommand.command("start <id>").description("Set a backlog item to in-progress").action(start);
|
|
2293
2305
|
backlogCommand.command("done <id>").description("Set a backlog item to done").action(done);
|
|
@@ -2934,7 +2946,7 @@ function printDateHeader(date, isSkipped, entries) {
|
|
|
2934
2946
|
}
|
|
2935
2947
|
|
|
2936
2948
|
// src/commands/devlog/list/index.ts
|
|
2937
|
-
function
|
|
2949
|
+
function list3(options2) {
|
|
2938
2950
|
const config = loadConfig();
|
|
2939
2951
|
const days = options2.days ?? 30;
|
|
2940
2952
|
const ignore2 = options2.ignore ?? config.devlog?.ignore ?? [];
|
|
@@ -3183,7 +3195,7 @@ function registerDevlog(program2) {
|
|
|
3183
3195
|
"--days <number>",
|
|
3184
3196
|
"Number of days to show (default: 30)",
|
|
3185
3197
|
Number.parseInt
|
|
3186
|
-
).option("--since <date>", "Only show commits since this date (YYYY-MM-DD)").option("-r, --reverse", "Show earliest commits first").option("-v, --verbose", "Show file names for each commit").action(
|
|
3198
|
+
).option("--since <date>", "Only show commits since this date (YYYY-MM-DD)").option("-r, --reverse", "Show earliest commits first").option("-v, --verbose", "Show file names for each commit").action(list3);
|
|
3187
3199
|
devlogCommand.command("version").description("Show current repo name and version info").action(version);
|
|
3188
3200
|
devlogCommand.command("next").description("Show commits for the day after the last versioned entry").option("-v, --verbose", "Show file names for each commit").action(next);
|
|
3189
3201
|
devlogCommand.command("skip <date>").description("Add a date (YYYY-MM-DD) to the skip list").action(skip);
|
|
@@ -4086,9 +4098,9 @@ import path21 from "path";
|
|
|
4086
4098
|
// src/commands/refactor/restructure/computeRewrites/applyRewrites.ts
|
|
4087
4099
|
import fs17 from "fs";
|
|
4088
4100
|
function getOrCreateList(map, key) {
|
|
4089
|
-
const
|
|
4090
|
-
if (!map.has(key)) map.set(key,
|
|
4091
|
-
return
|
|
4101
|
+
const list4 = map.get(key) ?? [];
|
|
4102
|
+
if (!map.has(key)) map.set(key, list4);
|
|
4103
|
+
return list4;
|
|
4092
4104
|
}
|
|
4093
4105
|
function groupByFile(rewrites) {
|
|
4094
4106
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -5085,6 +5097,7 @@ function registerTranscript(program2) {
|
|
|
5085
5097
|
// src/commands/registerVerify.ts
|
|
5086
5098
|
function registerVerify(program2) {
|
|
5087
5099
|
const verifyCommand = program2.command("verify").description("Run all verify:* commands in parallel").option("--timer", "Show timing information for each task as they complete").action((options2) => run(options2));
|
|
5100
|
+
verifyCommand.command("list").description("List configured verify commands").action(list);
|
|
5088
5101
|
verifyCommand.command("init").description("Add verify scripts to a project").action(init2);
|
|
5089
5102
|
verifyCommand.command("hardcoded-colors").description("Check for hardcoded hex colors in src/").action(hardcodedColors);
|
|
5090
5103
|
}
|
|
@@ -5600,13 +5613,10 @@ var configCommand = program.command("config").description("View and modify assis
|
|
|
5600
5613
|
configCommand.command("set <key> <value>").description("Set a config value (e.g. commit.push true)").action(configSet);
|
|
5601
5614
|
configCommand.command("get <key>").description("Get a config value").action(configGet);
|
|
5602
5615
|
configCommand.command("list").description("List all config values").action(configList);
|
|
5603
|
-
var runCommand = program.command("run").description("Run a configured command from assist.yml").argument("
|
|
5604
|
-
if (!name) {
|
|
5605
|
-
listRunConfigs();
|
|
5606
|
-
return;
|
|
5607
|
-
}
|
|
5616
|
+
var runCommand = program.command("run").description("Run a configured command from assist.yml").argument("<name>", "Name of the configured command").argument("[args...]", "Arguments to pass to the command").allowUnknownOption().action((name, args) => {
|
|
5608
5617
|
run2(name, args);
|
|
5609
5618
|
});
|
|
5619
|
+
runCommand.command("list").description("List configured run commands").action(listRunConfigs);
|
|
5610
5620
|
runCommand.command("add").description("Add a new run configuration to assist.yml").allowUnknownOption().allowExcessArguments().action(() => add2());
|
|
5611
5621
|
registerNew(program);
|
|
5612
5622
|
var lintCommand = program.command("lint").description("Run lint checks for conventions not enforced by biomejs").action(lint);
|