@alint-js/cli 0.1.5 → 0.2.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/bin/index.mjs
CHANGED
|
@@ -11,12 +11,13 @@ import { createColors } from "tinyrainbow";
|
|
|
11
11
|
import cliSpinners from "cli-spinners";
|
|
12
12
|
import fastStringWidth from "fast-string-width";
|
|
13
13
|
import { relative as relative$1 } from "node:path";
|
|
14
|
+
import { formatDuration, intervalToDuration } from "date-fns";
|
|
14
15
|
import fastStringTruncatedWidth from "fast-string-truncated-width";
|
|
15
16
|
import Gitignore from "gitignore-fs";
|
|
16
17
|
import { Minimatch, minimatch } from "minimatch";
|
|
17
18
|
import { errorMessageFrom as errorMessageFrom$1 } from "@moeru/std";
|
|
18
19
|
//#region package.json
|
|
19
|
-
var version = "0.
|
|
20
|
+
var version = "0.2.0";
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/cli/output.ts
|
|
22
23
|
function escapeLineValue(value) {
|
|
@@ -592,8 +593,8 @@ function benchmarkRow(modelId, modelName, providerId, benchmark, color) {
|
|
|
592
593
|
modelId,
|
|
593
594
|
providerId,
|
|
594
595
|
modelName,
|
|
595
|
-
benchmark.error === void 0 ? formatDuration$
|
|
596
|
-
benchmark.error === void 0 ? formatDuration$
|
|
596
|
+
benchmark.error === void 0 ? formatDuration$2(benchmark.repeatMs) : errored,
|
|
597
|
+
benchmark.error === void 0 ? formatDuration$2(benchmark.nonRepeatMs) : errored,
|
|
597
598
|
benchmark.error === void 0 ? formatThroughput(benchmark.throughput) : errored,
|
|
598
599
|
`${benchmark.success.completed}/${benchmark.success.attempted}`
|
|
599
600
|
];
|
|
@@ -612,7 +613,7 @@ function formatBenchmarkTable(rows, columns) {
|
|
|
612
613
|
"success"
|
|
613
614
|
], ...rows], columns);
|
|
614
615
|
}
|
|
615
|
-
function formatDuration$
|
|
616
|
+
function formatDuration$2(durationMs) {
|
|
616
617
|
if (durationMs === void 0) return "n/a";
|
|
617
618
|
if (durationMs < 1e3) return `${Math.round(durationMs)}ms`;
|
|
618
619
|
return `${stripTrailingZeros((durationMs / 1e3).toFixed(2))}s`;
|
|
@@ -2348,7 +2349,7 @@ function createRuleGroups(state) {
|
|
|
2348
2349
|
}
|
|
2349
2350
|
function estimateEta(durationMs, terminal, planned) {
|
|
2350
2351
|
if (terminal <= 0 || planned <= 0 || durationMs <= 0) return "eta ?";
|
|
2351
|
-
return `eta ~${formatDuration(durationMs * (planned - terminal) / terminal)}`;
|
|
2352
|
+
return `eta ~${formatDuration$1(durationMs * (planned - terminal) / terminal)}`;
|
|
2352
2353
|
}
|
|
2353
2354
|
function fitRow(row, columns) {
|
|
2354
2355
|
if (columns <= 0) return "";
|
|
@@ -2402,8 +2403,13 @@ function formatContentRows(groups, state, options, now, contentBudget) {
|
|
|
2402
2403
|
}
|
|
2403
2404
|
return rows;
|
|
2404
2405
|
}
|
|
2405
|
-
function formatDuration(ms) {
|
|
2406
|
-
|
|
2406
|
+
function formatDuration$1(ms) {
|
|
2407
|
+
const durationMs = Math.max(ms, 0);
|
|
2408
|
+
if (durationMs < 6e4) return `${(durationMs / 1e3).toFixed(1)}s`;
|
|
2409
|
+
return formatDuration(intervalToDuration({
|
|
2410
|
+
end: durationMs,
|
|
2411
|
+
start: 0
|
|
2412
|
+
}));
|
|
2407
2413
|
}
|
|
2408
2414
|
function formatFooters(state, options, now) {
|
|
2409
2415
|
const terminal = terminalCount(state.execution);
|
|
@@ -2413,7 +2419,7 @@ function formatFooters(state, options, now) {
|
|
|
2413
2419
|
const projectedTokens = state.progress.planningComplete && terminal > 0 && state.execution.planned > 0 ? Math.ceil((state.totalTokens + state.cachedTokens) * state.execution.planned / terminal) : void 0;
|
|
2414
2420
|
const discovering = state.progress.planningComplete ? "" : " jobs (discovering)";
|
|
2415
2421
|
return [
|
|
2416
|
-
fitRow(`${terminal}/${state.execution.planned}${discovering}${progressBar} ${formatDuration(elapsed)} -> ${eta === "eta ?" ? "~?" : eta.replace("eta ", "")}`, options.columns),
|
|
2422
|
+
fitRow(`${terminal}/${state.execution.planned}${discovering}${progressBar} ${formatDuration$1(elapsed)} -> ${eta === "eta ?" ? "~?" : eta.replace("eta ", "")}`, options.columns),
|
|
2417
2423
|
fitRow(`${state.execution.running} concurrency / ${state.execution.queued} queued / ${state.execution.cached} cached / ${state.execution.failed} failed`, options.columns),
|
|
2418
2424
|
fitRow(`${state.totalTokens.toLocaleString("en-US")} tokens (${state.cachedTokens.toLocaleString("en-US")} cached) -> ${projectedTokens === void 0 ? "~?" : `~${projectedTokens.toLocaleString("en-US")} tokens`}`, options.columns)
|
|
2419
2425
|
];
|
|
@@ -2444,7 +2450,7 @@ function formatTargetRow(jobState, options, now, last) {
|
|
|
2444
2450
|
const inputPath = options.cwd ? relative$1(options.cwd, jobState.job.inputPath) || "." : jobState.job.inputPath;
|
|
2445
2451
|
const target = jobState.job.target.name ? `${jobState.job.target.kind} ${jobState.job.target.name}` : jobState.job.target.kind;
|
|
2446
2452
|
const startedAt = jobState.retry?.startedAt ?? jobState.startedAt ?? now;
|
|
2447
|
-
return fitRow(`${last ? " └─" : " ├─"} ${inputPath} > ${target} ${jobState.retry ? `${jobState.retry.attempt}/${jobState.retry.maxAttempts} retrying elapsed ${formatDuration(now - startedAt)}` : `running ${formatDuration(now - startedAt)}`}`, options.columns);
|
|
2453
|
+
return fitRow(`${last ? " └─" : " ├─"} ${inputPath} > ${target} ${jobState.retry ? `${jobState.retry.attempt}/${jobState.retry.maxAttempts} retrying elapsed ${formatDuration$1(now - startedAt)}` : `running ${formatDuration$1(now - startedAt)}`}`, options.columns);
|
|
2448
2454
|
}
|
|
2449
2455
|
function styleRow(row, state, warnCount, errorCount, options) {
|
|
2450
2456
|
let styledRow = row;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as formatJson, n as formatDiagnostics, r as formatStylish, t as executeCli } from "./cli-
|
|
1
|
+
import { i as formatJson, n as formatDiagnostics, r as formatStylish, t as executeCli } from "./cli-3Ov9-ZVf.mjs";
|
|
2
2
|
import { ignorePatternsAIAgents, ignorePatternsBuildOutputs, ignorePatternsCaches, ignorePatternsCommon, ignorePatternsEslintDefaults, ignorePatternsGenerated } from "@alint-js/config";
|
|
3
3
|
import { defineConfig } from "@alint-js/core";
|
|
4
4
|
export { defineConfig, executeCli, formatDiagnostics, formatJson, formatStylish, ignorePatternsAIAgents, ignorePatternsBuildOutputs, ignorePatternsCaches, ignorePatternsCommon, ignorePatternsEslintDefaults, ignorePatternsGenerated };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alint-js/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.mts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@moeru/std": "^0.1.0-beta.20",
|
|
21
21
|
"cac": "^7.0.0",
|
|
22
22
|
"cli-spinners": "^3.4.0",
|
|
23
|
+
"date-fns": "^4.4.0",
|
|
23
24
|
"fast-string-truncated-width": "^3.0.3",
|
|
24
25
|
"fast-string-width": "^3.0.2",
|
|
25
26
|
"gitignore-fs": "^2.2.3",
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
"pathe": "^2.0.3",
|
|
28
29
|
"table": "^6.9.0",
|
|
29
30
|
"tinyrainbow": "^3.1.0",
|
|
30
|
-
"@alint-js/config": "0.
|
|
31
|
-
"@alint-js/core": "0.
|
|
31
|
+
"@alint-js/config": "0.2.0",
|
|
32
|
+
"@alint-js/core": "0.2.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|