carrick 0.3.79 → 0.3.81
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/bin/carrick.mjs +47 -2
- package/dist/init/output.d.ts +20 -1
- package/dist/init/output.js +6 -2
- package/dist/init/output.js.map +1 -1
- package/dist/scan.d.ts +152 -0
- package/dist/scan.js +404 -0
- package/dist/scan.js.map +1 -0
- package/package.json +6 -6
package/bin/carrick.mjs
CHANGED
|
@@ -43,6 +43,48 @@ const HOOKS = {
|
|
|
43
43
|
const argv = process.argv.slice(2);
|
|
44
44
|
const [command, ...rest] = argv;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Run a build of the index and render it (carrick#1315).
|
|
48
|
+
*
|
|
49
|
+
* The binary writes for a log file as well as for a person: a run banner, a
|
|
50
|
+
* spinner per phase and a boundary census. Rendered, this holds its streams
|
|
51
|
+
* and draws the markers it states through the renderer `carrick init` uses.
|
|
52
|
+
* `--verbose` and `--detach` never reach here — they want the binary's own
|
|
53
|
+
* output — and a run that draws nothing writes its output through untouched.
|
|
54
|
+
*/
|
|
55
|
+
async function renderNative(args) {
|
|
56
|
+
const { resolveNativeBinary, nativeEnv, overrideLine } = await import("../dist/native.js");
|
|
57
|
+
const { renderScan } = await import("../dist/scan.js");
|
|
58
|
+
const lookup = resolveNativeBinary();
|
|
59
|
+
if (!lookup.binary) {
|
|
60
|
+
process.stderr.write(`carrick: ${lookup.problem}\n`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
const override = overrideLine(lookup);
|
|
64
|
+
if (override) process.stderr.write(`${override}\n`);
|
|
65
|
+
const { readFile } = await import("node:fs/promises");
|
|
66
|
+
const { version } = JSON.parse(
|
|
67
|
+
await readFile(new URL("../package.json", import.meta.url), "utf8"),
|
|
68
|
+
);
|
|
69
|
+
let outcome;
|
|
70
|
+
try {
|
|
71
|
+
outcome = await renderScan({
|
|
72
|
+
binary: lookup.binary,
|
|
73
|
+
args,
|
|
74
|
+
env: nativeEnv(),
|
|
75
|
+
version,
|
|
76
|
+
});
|
|
77
|
+
} catch (error) {
|
|
78
|
+
process.stderr.write(`carrick: could not run ${lookup.binary}: ${error.message}\n`);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
if (outcome.signal) {
|
|
82
|
+
process.kill(process.pid, outcome.signal);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
process.exit(outcome.code);
|
|
86
|
+
}
|
|
87
|
+
|
|
46
88
|
/** Run the scanner binary, streaming its output and answering with its code. */
|
|
47
89
|
async function runNative(args) {
|
|
48
90
|
const { resolveNativeBinary, nativeEnv, overrideLine } = await import("../dist/native.js");
|
|
@@ -209,6 +251,9 @@ switch (command) {
|
|
|
209
251
|
process.stderr.write(extraHelp());
|
|
210
252
|
process.exit(0);
|
|
211
253
|
}
|
|
212
|
-
default:
|
|
213
|
-
await
|
|
254
|
+
default: {
|
|
255
|
+
const { isRendered } = await import("../dist/scan.js");
|
|
256
|
+
if (isRendered(command, rest)) await renderNative(argv);
|
|
257
|
+
else await runNative(argv);
|
|
258
|
+
}
|
|
214
259
|
}
|
package/dist/init/output.d.ts
CHANGED
|
@@ -14,6 +14,16 @@ export type StepReport = {
|
|
|
14
14
|
kind: "done" | "warn" | "refuse";
|
|
15
15
|
text: string;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Say where a running step has got to, without ending it.
|
|
19
|
+
*
|
|
20
|
+
* Handed to the step's work rather than exposed on its own, because only the
|
|
21
|
+
* step that owns the terminal may write to it: a spinner rewrites one line, so
|
|
22
|
+
* anything else printing underneath corrupts it. In the plain rendering this
|
|
23
|
+
* does nothing — one line per step is what a pipe gets, and a scan of a large
|
|
24
|
+
* repo would otherwise write thousands (carrick#1315).
|
|
25
|
+
*/
|
|
26
|
+
export type StepProgress = (text: string) => void;
|
|
17
27
|
/** Everything `init` prints or asks. */
|
|
18
28
|
export type InitOutput = {
|
|
19
29
|
/** A thing this run did. */
|
|
@@ -24,6 +34,15 @@ export type InitOutput = {
|
|
|
24
34
|
refuse(text: string): void;
|
|
25
35
|
/** A line with no state of its own — a browser step, a list, a prompt. */
|
|
26
36
|
say(text: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Open a run: the name and version of what is about to happen.
|
|
39
|
+
*
|
|
40
|
+
* `init` prints its lines without one; a rendered scan opens with it, so the
|
|
41
|
+
* block a first run sees is bounded at both ends (carrick#1315).
|
|
42
|
+
*/
|
|
43
|
+
intro(text: string): void;
|
|
44
|
+
/** Close a run with the one next step. */
|
|
45
|
+
outro(text: string): void;
|
|
27
46
|
/** The closing block: a title and the lines under it. */
|
|
28
47
|
note(title: string, body: string[]): void;
|
|
29
48
|
/**
|
|
@@ -33,7 +52,7 @@ export type InitOutput = {
|
|
|
33
52
|
* the work's value into the line and the marker, and a spinner stops as that
|
|
34
53
|
* marker rather than repeating the label it started with (carrick#1032).
|
|
35
54
|
*/
|
|
36
|
-
step<T>(label: string, work: () => Promise<T>, report: (value: T) => StepReport): Promise<T>;
|
|
55
|
+
step<T>(label: string, work: (progress: StepProgress) => Promise<T>, report: (value: T) => StepReport): Promise<T>;
|
|
37
56
|
/** Yes or no, defaulting to yes, as the old readline prompt did. */
|
|
38
57
|
confirm(question: string): Promise<boolean>;
|
|
39
58
|
/** A typed answer, for the questions whose answer is not yes or no. */
|
package/dist/init/output.js
CHANGED
|
@@ -53,6 +53,8 @@ export function plainOutput(write = (text) => process.stdout.write(text)) {
|
|
|
53
53
|
warn: (text) => line(WARN, text),
|
|
54
54
|
refuse: (text) => line(REFUSE, text),
|
|
55
55
|
say: (text) => write(`${text}\n`),
|
|
56
|
+
intro: (text) => write(`${text}\n`),
|
|
57
|
+
outro: (text) => write(`${text}\n`),
|
|
56
58
|
note: (title, body) => {
|
|
57
59
|
write("\n");
|
|
58
60
|
write(`${title}\n`);
|
|
@@ -64,7 +66,7 @@ export function plainOutput(write = (text) => process.stdout.write(text)) {
|
|
|
64
66
|
// one line its work reports, which is what the plain rendering already
|
|
65
67
|
// spent on it.
|
|
66
68
|
step: async (_label, work, report) => {
|
|
67
|
-
const value = await work();
|
|
69
|
+
const value = await work(() => { });
|
|
68
70
|
const outcome = report(value);
|
|
69
71
|
line(marker(outcome.kind), outcome.text);
|
|
70
72
|
return value;
|
|
@@ -114,6 +116,8 @@ export function interactiveOutput(output = process.stdout) {
|
|
|
114
116
|
warn: (text) => clack.log.warn(text, { output }),
|
|
115
117
|
refuse: (text) => clack.log.error(text, { output }),
|
|
116
118
|
say: (text) => clack.log.message(text, { output }),
|
|
119
|
+
intro: (text) => clack.intro(text, { output }),
|
|
120
|
+
outro: (text) => clack.outro(text, { output }),
|
|
117
121
|
note: (title, body) => clack.note(body.join("\n"), title, { output }),
|
|
118
122
|
// The spinner's finishers ARE the markers: `stop` prints `◇`, `error`
|
|
119
123
|
// prints `▲` and `cancel` prints `■`, so the step ends on one line with
|
|
@@ -125,7 +129,7 @@ export function interactiveOutput(output = process.stdout) {
|
|
|
125
129
|
spinner.start(label);
|
|
126
130
|
let value;
|
|
127
131
|
try {
|
|
128
|
-
value = await work();
|
|
132
|
+
value = await work((text) => spinner.message(text));
|
|
129
133
|
}
|
|
130
134
|
catch (error) {
|
|
131
135
|
// The step did not finish, so it is a refusal: the caller prints why.
|
package/dist/init/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/init/output.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,sEAAsE;AACtE,4DAA4D;AAC5D,4EAA4E;AAC5E,8EAA8E;AAC9E,mDAAmD;AACnD,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,mCAAmC;AACnC,0EAA0E;AAC1E,iDAAiD;AACjD,EAAE;AACF,+EAA+E;AAC/E,yEAAyE;AACzE,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,oEAAoE;AACpE,6EAA6E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1B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACtF,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACjD,CAAC;QACD,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC/D,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrD,CAAC;QACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;QAC9B,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAe,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC;IAEjF,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACnD,CAAC"}
|
package/dist/scan.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { type InitOutput } from "./init/output.ts";
|
|
2
|
+
/** How far a build's phase has got. Mirrors `progress::PhaseState`. */
|
|
3
|
+
export type PhaseState = "started" | "done" | "warned";
|
|
4
|
+
/** Mirrors `progress::PhaseUpdate`. */
|
|
5
|
+
export type PhaseUpdate = {
|
|
6
|
+
label: string;
|
|
7
|
+
state: PhaseState;
|
|
8
|
+
};
|
|
9
|
+
/** Mirrors `progress::Update`: how far through a service's files a scan is. */
|
|
10
|
+
export type ProgressUpdate = {
|
|
11
|
+
service: string;
|
|
12
|
+
service_index: number;
|
|
13
|
+
service_total: number;
|
|
14
|
+
phase: "files" | "intents";
|
|
15
|
+
done: number;
|
|
16
|
+
total: number;
|
|
17
|
+
};
|
|
18
|
+
/** Mirrors `progress::ServiceSummary`. */
|
|
19
|
+
export type ServiceSummary = {
|
|
20
|
+
name: string;
|
|
21
|
+
routes: number;
|
|
22
|
+
calls: number;
|
|
23
|
+
routes_without_response_type: number;
|
|
24
|
+
};
|
|
25
|
+
/** Mirrors `progress::Summary`: what a finished build amounts to. */
|
|
26
|
+
export type Summary = {
|
|
27
|
+
services: ServiceSummary[];
|
|
28
|
+
elapsed_secs: number;
|
|
29
|
+
next?: string[];
|
|
30
|
+
};
|
|
31
|
+
/** One line of a build's output, once it has been read. */
|
|
32
|
+
export type Marker = {
|
|
33
|
+
kind: "phase";
|
|
34
|
+
phase: PhaseUpdate;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "progress";
|
|
37
|
+
update: ProgressUpdate;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "summary";
|
|
40
|
+
summary: Summary;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "notice";
|
|
43
|
+
text: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Read one line of a build's output as a marker, or answer null.
|
|
47
|
+
*
|
|
48
|
+
* Longest prefix wins, so a family whose names share a word cannot be read as
|
|
49
|
+
* one another — the same property `src/progress.rs` holds itself to. A marker
|
|
50
|
+
* whose payload is not the JSON this version expects is not a marker: the
|
|
51
|
+
* renderer draws nothing rather than drawing a guess.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseMarker(line: string): Marker | null;
|
|
54
|
+
/** The commands this renders. Everything else runs with its streams inherited. */
|
|
55
|
+
export declare const RENDERED: Set<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Whether this invocation is rendered, or run as the binary writes it.
|
|
58
|
+
*
|
|
59
|
+
* `--verbose` is the escape hatch the closing line names, so it must hand the
|
|
60
|
+
* terminal straight to the binary. `--detach` answers with an id and leaves a
|
|
61
|
+
* log file behind — there is no run here to draw. `--help` is text.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isRendered(command: string | undefined, args: string[]): boolean;
|
|
64
|
+
/** `169.4` as `2m49s`, `32.7` as `32.7s`. Under a minute keeps its tenth. */
|
|
65
|
+
export declare function elapsed(seconds: number): string;
|
|
66
|
+
/**
|
|
67
|
+
* The one line a finished build is worth: how many routes, how many calls,
|
|
68
|
+
* and how many of those routes have nothing on the producer side of a
|
|
69
|
+
* compatibility check.
|
|
70
|
+
*
|
|
71
|
+
* The third count is dropped when it is zero. A line states how many, of
|
|
72
|
+
* which thing, and what to do about it; nothing to do is nothing to say
|
|
73
|
+
* (carrick#1284).
|
|
74
|
+
*/
|
|
75
|
+
export declare function summaryLine(summary: Summary): string;
|
|
76
|
+
/** What a rendered run closes on: the next step, and nothing about cost. */
|
|
77
|
+
export declare function outroLine(summary: Summary): string;
|
|
78
|
+
/**
|
|
79
|
+
* The renderer, as a state machine over the child's lines.
|
|
80
|
+
*
|
|
81
|
+
* Separated from the spawn so a test drives it with a written stream and reads
|
|
82
|
+
* the interactive markers back — a terminal's own bytes are not capturable,
|
|
83
|
+
* and the plain rendering is a different renderer with different lines
|
|
84
|
+
* (carrick#1032).
|
|
85
|
+
*/
|
|
86
|
+
export declare class ScanRender {
|
|
87
|
+
private readonly output;
|
|
88
|
+
private readonly version;
|
|
89
|
+
/** Renders run in order, whichever event scheduled them. */
|
|
90
|
+
private chain;
|
|
91
|
+
/**
|
|
92
|
+
* The open step's own promise.
|
|
93
|
+
*
|
|
94
|
+
* Awaited at the head of every scheduled render and never inside the chain
|
|
95
|
+
* that starts it: a step ends when its phase ends, and a chain that waited
|
|
96
|
+
* on the step before running the line that ends it would wait forever.
|
|
97
|
+
*/
|
|
98
|
+
private stepDone;
|
|
99
|
+
private open;
|
|
100
|
+
/** The fraction the open phase last stated, for its spinner only. */
|
|
101
|
+
private running;
|
|
102
|
+
/** A finished phase whose line is not drawn yet: the summary may replace it. */
|
|
103
|
+
private held;
|
|
104
|
+
private opened;
|
|
105
|
+
private summarised;
|
|
106
|
+
/** Lines nobody rendered, for a failure and for nothing else. */
|
|
107
|
+
private readonly buffered;
|
|
108
|
+
/** The command's own answer, said before any phase began. */
|
|
109
|
+
private readonly answered;
|
|
110
|
+
constructor(output: InitOutput, version: string);
|
|
111
|
+
/** Whether anything at all was rendered. */
|
|
112
|
+
get rendered(): boolean;
|
|
113
|
+
/** What was not rendered, in the order it arrived. */
|
|
114
|
+
get unrendered(): string[];
|
|
115
|
+
/** One line of the child's stdout. */
|
|
116
|
+
stdout(line: string): void;
|
|
117
|
+
/** One line of the child's stderr. */
|
|
118
|
+
stderr(line: string): void;
|
|
119
|
+
private consume;
|
|
120
|
+
private begin;
|
|
121
|
+
private phase;
|
|
122
|
+
private phaseText;
|
|
123
|
+
/** Draw the held line, if there is one, and free the phase it belongs to. */
|
|
124
|
+
private close;
|
|
125
|
+
private progress;
|
|
126
|
+
private notice;
|
|
127
|
+
/** Say where an open phase is while it runs, without ending it. */
|
|
128
|
+
private redraw;
|
|
129
|
+
private summary;
|
|
130
|
+
/**
|
|
131
|
+
* The child is over. Answer whether anything was rendered, so a caller that
|
|
132
|
+
* rendered nothing can write the output through instead of eating it.
|
|
133
|
+
*/
|
|
134
|
+
finish(failed: boolean): Promise<boolean>;
|
|
135
|
+
private schedule;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Run the binary and render it.
|
|
139
|
+
*
|
|
140
|
+
* stdin stays inherited: a build asks nothing, but a child holding no stdin
|
|
141
|
+
* would break the moment one of them does.
|
|
142
|
+
*/
|
|
143
|
+
export declare function renderScan(options: {
|
|
144
|
+
binary: string;
|
|
145
|
+
args: string[];
|
|
146
|
+
env: NodeJS.ProcessEnv;
|
|
147
|
+
version: string;
|
|
148
|
+
output?: InitOutput;
|
|
149
|
+
}): Promise<{
|
|
150
|
+
code: number;
|
|
151
|
+
signal: NodeJS.Signals | null;
|
|
152
|
+
}>;
|
package/dist/scan.js
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// What a build of the index looks like from the outside (carrick#1315).
|
|
2
|
+
//
|
|
3
|
+
// `carrick index`, `resume` and `refresh` are the Rust binary, and the binary
|
|
4
|
+
// writes for two readers at once: a person, and a log file. Run under this
|
|
5
|
+
// package with the two streams inherited, a first run opened on a tracing
|
|
6
|
+
// banner with eleven `<unset>` fields, then a pair of indicatif spinners
|
|
7
|
+
// rewriting a pipe — which arrive as padded fragments sharing one line — and
|
|
8
|
+
// closed on the boundary block, which is a per-package census of what the
|
|
9
|
+
// deterministic passes could not classify. All three are diagnostics.
|
|
10
|
+
//
|
|
11
|
+
// So the binary is spawned as a child whose streams this process holds, and
|
|
12
|
+
// what it states as a marker is rendered here, through the renderer `carrick
|
|
13
|
+
// init` already uses: clack in a terminal, the same lines plain in a pipe.
|
|
14
|
+
// Nothing else is drawn. The unparsed text is kept for exactly two readers:
|
|
15
|
+
// a run that failed, which prints it, and `--verbose`, which does not come
|
|
16
|
+
// through here at all — it inherits the streams and gets the binary's own
|
|
17
|
+
// output, banner included.
|
|
18
|
+
//
|
|
19
|
+
// Two rules decide what a line is, and neither reads its words:
|
|
20
|
+
//
|
|
21
|
+
// - A marker (`@carrick-…`) is rendered. `src/progress.rs` is the other
|
|
22
|
+
// half of each of these shapes.
|
|
23
|
+
// - Everything else is buffered. A stdout line that arrives BEFORE the
|
|
24
|
+
// first phase is the command's own answer — what `resume` collected, what
|
|
25
|
+
// it is still waiting for — and is shown. After the first phase, stdout
|
|
26
|
+
// is the map, and the summary marker carries what a person needs of it.
|
|
27
|
+
//
|
|
28
|
+
// A child that states no phase and no summary was not building anything: a
|
|
29
|
+
// refusal, a `resume` with nothing to collect, a help text. Its output is
|
|
30
|
+
// written through untouched, because the alternative is swallowing the answer.
|
|
31
|
+
import { spawn } from "node:child_process";
|
|
32
|
+
import { createOutput, } from "./init/output.js";
|
|
33
|
+
const PREFIXES = {
|
|
34
|
+
phase: "@carrick-phase ",
|
|
35
|
+
progress: "@carrick-progress ",
|
|
36
|
+
summary: "@carrick-summary ",
|
|
37
|
+
notice: "@carrick-notice ",
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Read one line of a build's output as a marker, or answer null.
|
|
41
|
+
*
|
|
42
|
+
* Longest prefix wins, so a family whose names share a word cannot be read as
|
|
43
|
+
* one another — the same property `src/progress.rs` holds itself to. A marker
|
|
44
|
+
* whose payload is not the JSON this version expects is not a marker: the
|
|
45
|
+
* renderer draws nothing rather than drawing a guess.
|
|
46
|
+
*/
|
|
47
|
+
export function parseMarker(line) {
|
|
48
|
+
const text = line.trimStart();
|
|
49
|
+
for (const [kind, prefix] of Object.entries(PREFIXES)) {
|
|
50
|
+
if (!text.startsWith(prefix))
|
|
51
|
+
continue;
|
|
52
|
+
let payload;
|
|
53
|
+
try {
|
|
54
|
+
payload = JSON.parse(text.slice(prefix.length));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
if (payload === null || typeof payload !== "object")
|
|
60
|
+
return null;
|
|
61
|
+
if (kind === "phase") {
|
|
62
|
+
const phase = payload;
|
|
63
|
+
if (typeof phase.label !== "string")
|
|
64
|
+
return null;
|
|
65
|
+
return { kind: "phase", phase };
|
|
66
|
+
}
|
|
67
|
+
if (kind === "progress") {
|
|
68
|
+
const update = payload;
|
|
69
|
+
if (typeof update.total !== "number")
|
|
70
|
+
return null;
|
|
71
|
+
return { kind: "progress", update };
|
|
72
|
+
}
|
|
73
|
+
if (kind === "summary") {
|
|
74
|
+
const summary = payload;
|
|
75
|
+
if (!Array.isArray(summary.services))
|
|
76
|
+
return null;
|
|
77
|
+
return { kind: "summary", summary };
|
|
78
|
+
}
|
|
79
|
+
const notice = payload;
|
|
80
|
+
if (typeof notice.text !== "string")
|
|
81
|
+
return null;
|
|
82
|
+
return { kind: "notice", text: notice.text };
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
/** The commands this renders. Everything else runs with its streams inherited. */
|
|
87
|
+
export const RENDERED = new Set(["index", "resume", "refresh"]);
|
|
88
|
+
/**
|
|
89
|
+
* Whether this invocation is rendered, or run as the binary writes it.
|
|
90
|
+
*
|
|
91
|
+
* `--verbose` is the escape hatch the closing line names, so it must hand the
|
|
92
|
+
* terminal straight to the binary. `--detach` answers with an id and leaves a
|
|
93
|
+
* log file behind — there is no run here to draw. `--help` is text.
|
|
94
|
+
*/
|
|
95
|
+
export function isRendered(command, args) {
|
|
96
|
+
if (!command || !RENDERED.has(command))
|
|
97
|
+
return false;
|
|
98
|
+
return !args.some((arg) => arg === "--verbose" ||
|
|
99
|
+
arg === "-v" ||
|
|
100
|
+
arg === "--detach" ||
|
|
101
|
+
arg === "--help" ||
|
|
102
|
+
arg === "-h");
|
|
103
|
+
}
|
|
104
|
+
/** `169.4` as `2m49s`, `32.7` as `32.7s`. Under a minute keeps its tenth. */
|
|
105
|
+
export function elapsed(seconds) {
|
|
106
|
+
if (!Number.isFinite(seconds) || seconds < 0)
|
|
107
|
+
return "0.0s";
|
|
108
|
+
if (seconds < 60)
|
|
109
|
+
return `${seconds.toFixed(1)}s`;
|
|
110
|
+
const minutes = Math.floor(seconds / 60);
|
|
111
|
+
return `${minutes}m${Math.round(seconds - minutes * 60)}s`;
|
|
112
|
+
}
|
|
113
|
+
function plural(count, noun) {
|
|
114
|
+
return `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The one line a finished build is worth: how many routes, how many calls,
|
|
118
|
+
* and how many of those routes have nothing on the producer side of a
|
|
119
|
+
* compatibility check.
|
|
120
|
+
*
|
|
121
|
+
* The third count is dropped when it is zero. A line states how many, of
|
|
122
|
+
* which thing, and what to do about it; nothing to do is nothing to say
|
|
123
|
+
* (carrick#1284).
|
|
124
|
+
*/
|
|
125
|
+
export function summaryLine(summary) {
|
|
126
|
+
const total = (pick) => summary.services.reduce((sum, service) => sum + pick(service), 0);
|
|
127
|
+
const untyped = total((service) => service.routes_without_response_type);
|
|
128
|
+
const parts = [
|
|
129
|
+
plural(total((service) => service.routes), "route"),
|
|
130
|
+
plural(total((service) => service.calls), "call"),
|
|
131
|
+
];
|
|
132
|
+
if (untyped > 0)
|
|
133
|
+
parts.push(`${plural(untyped, "route")} without a response type`);
|
|
134
|
+
return parts.join(" · ");
|
|
135
|
+
}
|
|
136
|
+
/** What a rendered run closes on: the next step, and nothing about cost. */
|
|
137
|
+
export function outroLine(summary) {
|
|
138
|
+
const next = summary.next ?? [];
|
|
139
|
+
if (next.length > 0)
|
|
140
|
+
return next.join(" ");
|
|
141
|
+
return "Your agents can query it now. `carrick index --verbose` shows the full report.";
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The renderer, as a state machine over the child's lines.
|
|
145
|
+
*
|
|
146
|
+
* Separated from the spawn so a test drives it with a written stream and reads
|
|
147
|
+
* the interactive markers back — a terminal's own bytes are not capturable,
|
|
148
|
+
* and the plain rendering is a different renderer with different lines
|
|
149
|
+
* (carrick#1032).
|
|
150
|
+
*/
|
|
151
|
+
export class ScanRender {
|
|
152
|
+
output;
|
|
153
|
+
version;
|
|
154
|
+
/** Renders run in order, whichever event scheduled them. */
|
|
155
|
+
chain = Promise.resolve();
|
|
156
|
+
/**
|
|
157
|
+
* The open step's own promise.
|
|
158
|
+
*
|
|
159
|
+
* Awaited at the head of every scheduled render and never inside the chain
|
|
160
|
+
* that starts it: a step ends when its phase ends, and a chain that waited
|
|
161
|
+
* on the step before running the line that ends it would wait forever.
|
|
162
|
+
*/
|
|
163
|
+
stepDone = Promise.resolve();
|
|
164
|
+
open = null;
|
|
165
|
+
/** The fraction the open phase last stated, for its spinner only. */
|
|
166
|
+
running = null;
|
|
167
|
+
/** A finished phase whose line is not drawn yet: the summary may replace it. */
|
|
168
|
+
held = null;
|
|
169
|
+
opened = false;
|
|
170
|
+
summarised = false;
|
|
171
|
+
/** Lines nobody rendered, for a failure and for nothing else. */
|
|
172
|
+
buffered = [];
|
|
173
|
+
/** The command's own answer, said before any phase began. */
|
|
174
|
+
answered = [];
|
|
175
|
+
constructor(output, version) {
|
|
176
|
+
this.output = output;
|
|
177
|
+
this.version = version;
|
|
178
|
+
}
|
|
179
|
+
/** Whether anything at all was rendered. */
|
|
180
|
+
get rendered() {
|
|
181
|
+
return this.opened;
|
|
182
|
+
}
|
|
183
|
+
/** What was not rendered, in the order it arrived. */
|
|
184
|
+
get unrendered() {
|
|
185
|
+
return [...this.answered, ...this.buffered];
|
|
186
|
+
}
|
|
187
|
+
/** One line of the child's stdout. */
|
|
188
|
+
stdout(line) {
|
|
189
|
+
if (this.consume(line))
|
|
190
|
+
return;
|
|
191
|
+
// Before the first phase this is the command answering — what `resume`
|
|
192
|
+
// collected, what it is still waiting on. After it, it is the map.
|
|
193
|
+
if (!this.opened && line.trim().length > 0) {
|
|
194
|
+
this.answered.push(line);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
this.buffered.push(line);
|
|
198
|
+
}
|
|
199
|
+
/** One line of the child's stderr. */
|
|
200
|
+
stderr(line) {
|
|
201
|
+
if (this.consume(line))
|
|
202
|
+
return;
|
|
203
|
+
this.buffered.push(line);
|
|
204
|
+
}
|
|
205
|
+
consume(line) {
|
|
206
|
+
const marker = parseMarker(line);
|
|
207
|
+
if (!marker)
|
|
208
|
+
return false;
|
|
209
|
+
if (marker.kind === "phase")
|
|
210
|
+
this.phase(marker.phase);
|
|
211
|
+
else if (marker.kind === "progress")
|
|
212
|
+
this.progress(marker.update);
|
|
213
|
+
else if (marker.kind === "notice")
|
|
214
|
+
this.notice(marker.text);
|
|
215
|
+
else
|
|
216
|
+
this.summary(marker.summary);
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
begin() {
|
|
220
|
+
if (this.opened)
|
|
221
|
+
return;
|
|
222
|
+
this.opened = true;
|
|
223
|
+
this.schedule(() => {
|
|
224
|
+
this.output.intro(`carrick ${this.version}`);
|
|
225
|
+
for (const line of this.answered)
|
|
226
|
+
this.output.say(line);
|
|
227
|
+
this.answered.length = 0;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
phase(update) {
|
|
231
|
+
if (update.state === "started") {
|
|
232
|
+
this.begin();
|
|
233
|
+
this.close();
|
|
234
|
+
const label = update.label;
|
|
235
|
+
const startedAt = Date.now();
|
|
236
|
+
let resolve = () => { };
|
|
237
|
+
const finished = new Promise((settle) => {
|
|
238
|
+
resolve = settle;
|
|
239
|
+
});
|
|
240
|
+
const phase = {
|
|
241
|
+
label,
|
|
242
|
+
startedAt,
|
|
243
|
+
resolve,
|
|
244
|
+
say: () => { },
|
|
245
|
+
counted: null,
|
|
246
|
+
notice: null,
|
|
247
|
+
};
|
|
248
|
+
this.open = phase;
|
|
249
|
+
this.schedule(() => {
|
|
250
|
+
this.stepDone = this.output.step(label, (say) => {
|
|
251
|
+
phase.say = say;
|
|
252
|
+
return finished;
|
|
253
|
+
}, (report) => report);
|
|
254
|
+
});
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
// Finished, but not drawn: a summary arriving next is this phase's real
|
|
258
|
+
// outcome, and the join phase has no line of its own.
|
|
259
|
+
this.held = {
|
|
260
|
+
kind: update.state === "warned" ? "warn" : "done",
|
|
261
|
+
text: this.phaseText(),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
phaseText() {
|
|
265
|
+
if (!this.open)
|
|
266
|
+
return "";
|
|
267
|
+
const spent = elapsed((Date.now() - this.open.startedAt) / 1000);
|
|
268
|
+
return this.open.counted
|
|
269
|
+
? `${this.open.label} ${this.open.counted}, ${spent}`
|
|
270
|
+
: `${this.open.label} ${spent}`;
|
|
271
|
+
}
|
|
272
|
+
/** Draw the held line, if there is one, and free the phase it belongs to. */
|
|
273
|
+
close(report) {
|
|
274
|
+
const open = this.open;
|
|
275
|
+
if (!open)
|
|
276
|
+
return;
|
|
277
|
+
const outcome = report ?? this.held ?? { kind: "done", text: this.phaseText() };
|
|
278
|
+
this.open = null;
|
|
279
|
+
this.held = null;
|
|
280
|
+
this.running = null;
|
|
281
|
+
// Settling the step's promise is not a render, so it does not queue behind
|
|
282
|
+
// one: it is what lets the render already in the chain finish.
|
|
283
|
+
open.resolve(outcome);
|
|
284
|
+
}
|
|
285
|
+
progress(update) {
|
|
286
|
+
if (!this.open)
|
|
287
|
+
return;
|
|
288
|
+
// The spinner says how far through; the line it stops on says how much
|
|
289
|
+
// there was. A fraction is the answer to "is this moving", and the wrong
|
|
290
|
+
// answer to "what did it cover".
|
|
291
|
+
this.open.counted = `${update.total} ${update.phase}`;
|
|
292
|
+
this.running = `${update.done} of ${update.total} ${update.phase}`;
|
|
293
|
+
this.redraw();
|
|
294
|
+
}
|
|
295
|
+
notice(text) {
|
|
296
|
+
if (!this.open) {
|
|
297
|
+
this.buffered.push(text);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
this.open.notice = text;
|
|
301
|
+
this.redraw();
|
|
302
|
+
}
|
|
303
|
+
/** Say where an open phase is while it runs, without ending it. */
|
|
304
|
+
redraw() {
|
|
305
|
+
const open = this.open;
|
|
306
|
+
if (!open)
|
|
307
|
+
return;
|
|
308
|
+
const counted = this.running ? `: ${this.running}` : "";
|
|
309
|
+
const notice = open.notice ? ` (${open.notice})` : "";
|
|
310
|
+
open.say(`${open.label}${counted}${notice}`);
|
|
311
|
+
}
|
|
312
|
+
summary(summary) {
|
|
313
|
+
this.summarised = true;
|
|
314
|
+
this.begin();
|
|
315
|
+
// The counts ARE the closing phase's outcome, so they take its line
|
|
316
|
+
// rather than adding one under it.
|
|
317
|
+
if (summary.services.length > 0) {
|
|
318
|
+
this.close({ kind: "done", text: summaryLine(summary) });
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
this.close();
|
|
322
|
+
}
|
|
323
|
+
this.schedule(() => this.output.outro(outroLine(summary)));
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* The child is over. Answer whether anything was rendered, so a caller that
|
|
327
|
+
* rendered nothing can write the output through instead of eating it.
|
|
328
|
+
*/
|
|
329
|
+
async finish(failed) {
|
|
330
|
+
if (this.open) {
|
|
331
|
+
this.close(failed
|
|
332
|
+
? { kind: "refuse", text: `${this.open.label} — the scan stopped` }
|
|
333
|
+
: undefined);
|
|
334
|
+
if (failed)
|
|
335
|
+
this.summarised = false;
|
|
336
|
+
}
|
|
337
|
+
// One last link, so the chain waits on whatever step is still open.
|
|
338
|
+
this.schedule(() => { });
|
|
339
|
+
await this.chain;
|
|
340
|
+
return this.opened && this.summarised;
|
|
341
|
+
}
|
|
342
|
+
schedule(work) {
|
|
343
|
+
this.chain = this.chain
|
|
344
|
+
.then(() => this.stepDone)
|
|
345
|
+
.then(work)
|
|
346
|
+
.then(() => { }, () => { });
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/** Where a rendered run writes the lines it did not draw. */
|
|
350
|
+
function writeThrough(lines) {
|
|
351
|
+
if (lines.length === 0)
|
|
352
|
+
return;
|
|
353
|
+
process.stderr.write(`${lines.join("\n")}\n`);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Run the binary and render it.
|
|
357
|
+
*
|
|
358
|
+
* stdin stays inherited: a build asks nothing, but a child holding no stdin
|
|
359
|
+
* would break the moment one of them does.
|
|
360
|
+
*/
|
|
361
|
+
export async function renderScan(options) {
|
|
362
|
+
const render = new ScanRender(options.output ?? createOutput(), options.version);
|
|
363
|
+
const child = spawn(options.binary, options.args, {
|
|
364
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
365
|
+
// The markers are written only when a parent asks for them, so a run
|
|
366
|
+
// nobody is rendering — a CI scan, a direct `carrick index` — is unchanged.
|
|
367
|
+
env: { ...options.env, CARRICK_PROGRESS: "1" },
|
|
368
|
+
});
|
|
369
|
+
const read = (stream, take) => new Promise((resolve) => {
|
|
370
|
+
let rest = "";
|
|
371
|
+
stream.setEncoding("utf8");
|
|
372
|
+
stream.on("data", (chunk) => {
|
|
373
|
+
const lines = (rest + chunk).split("\n");
|
|
374
|
+
rest = lines.pop() ?? "";
|
|
375
|
+
for (const line of lines)
|
|
376
|
+
take(line);
|
|
377
|
+
});
|
|
378
|
+
stream.on("end", () => {
|
|
379
|
+
if (rest.length > 0)
|
|
380
|
+
take(rest);
|
|
381
|
+
resolve();
|
|
382
|
+
});
|
|
383
|
+
stream.on("error", () => resolve());
|
|
384
|
+
});
|
|
385
|
+
const ended = new Promise((resolve, reject) => {
|
|
386
|
+
child.on("error", reject);
|
|
387
|
+
child.on("exit", (code, signal) => resolve({ code: code ?? 1, signal }));
|
|
388
|
+
});
|
|
389
|
+
const [, , outcome] = await Promise.all([
|
|
390
|
+
read(child.stdout, (line) => render.stdout(line)),
|
|
391
|
+
read(child.stderr, (line) => render.stderr(line)),
|
|
392
|
+
ended,
|
|
393
|
+
]);
|
|
394
|
+
const failed = outcome.code !== 0 || outcome.signal !== null;
|
|
395
|
+
const drew = await render.finish(failed);
|
|
396
|
+
// A run that drew nothing was not a build: a refusal, a `resume` with
|
|
397
|
+
// nothing to collect, a help text. Its output IS the answer.
|
|
398
|
+
if (!drew)
|
|
399
|
+
writeThrough(render.unrendered);
|
|
400
|
+
else if (failed)
|
|
401
|
+
writeThrough(render.unrendered);
|
|
402
|
+
return outcome;
|
|
403
|
+
}
|
|
404
|
+
//# sourceMappingURL=scan.js.map
|
package/dist/scan.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,0EAA0E;AAC1E,sEAAsE;A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AAC,CAAC;IACjD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carrick",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.81",
|
|
4
4
|
"description": "The API contract index for a TypeScript workspace: what the other services do with the routes and calls in the file you are editing, in your editor and in your agent's context",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"zod": "^3.23.0"
|
|
58
58
|
},
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"@carrick-tools/cli-darwin-arm64": "0.3.
|
|
61
|
-
"@carrick-tools/cli-darwin-x64": "0.3.
|
|
62
|
-
"@carrick-tools/cli-linux-arm64": "0.3.
|
|
63
|
-
"@carrick-tools/cli-linux-x64": "0.3.
|
|
64
|
-
"@carrick-tools/cli-win32-x64": "0.3.
|
|
60
|
+
"@carrick-tools/cli-darwin-arm64": "0.3.81",
|
|
61
|
+
"@carrick-tools/cli-darwin-x64": "0.3.81",
|
|
62
|
+
"@carrick-tools/cli-linux-arm64": "0.3.81",
|
|
63
|
+
"@carrick-tools/cli-linux-x64": "0.3.81",
|
|
64
|
+
"@carrick-tools/cli-win32-x64": "0.3.81"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/node": "^24.13.3",
|