authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-03-22 23:08:51-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-03-23 22:27:40-07:00
logfd419f88c1068452779bcc11869d8e4aff6cee48
tree7130fc45b4b2e6800cc080686e48846d315d46ef
parent35af679821a76a4704d65dcb04943e1b4922367d
signature Signed by SSH key SHA256:xbd+BjjhyBfwk7GVoURf9Yx0gzDerHbvYv7SddNWmAs

chore(lib): woops


28 files changed, 101 insertions(+), 100 deletions(-)

lib/Events.ts+3-3
......@@ -102,6 +102,6 @@ export namespace Events {
102102 export type Handler<Args extends unknown[]> = (...args: Args) => void;
103103}
104104
105import * as ts from "@clo/lib/ts";
106import * as async from "@clo/lib/async";
107import { UNWRAP } from "@clo/lib/assert";
105import * as ts from "./ts.ts";
106import * as async from "./async.ts";
107import { UNWRAP } from "./assert.ts";
lib/Lru.test.ts+1-1
......@@ -151,4 +151,4 @@ test("revival", () => {
151151
152152import assert from "node:assert";
153153import { test } from "vitest";
154import { Lru } from "@clo/lib/Lru";
154import { Lru } from "./Lru.ts";
lib/Lru.ts+2-2
......@@ -278,5 +278,5 @@ export declare namespace Lru {
278278const none: unique symbol = Symbol();
279279type none = typeof none;
280280
281import { ASSERT, UNWRAP } from "@clo/lib/assert";
282import * as ts from "@clo/lib/ts";
281import { ASSERT, UNWRAP } from "./assert.ts";
282import * as ts from "./ts.ts";
lib/assert.ts+1-1
......@@ -43,4 +43,4 @@ function inspect(object: unknown) {
4343 }
4444}
4545
46import * as node from "@clo/lib/node";
46import * as node from "./node.ts";
lib/async.ts+2-2
......@@ -255,5 +255,5 @@ export function delay(ms: number): Cancelable<void> {
255255 );
256256}
257257
258import { ASSERT } from "@clo/lib/assert";
259import * as ts from "@clo/lib/ts";
258import { ASSERT } from "./assert.ts";
259import * as ts from "./ts.ts";
lib/deno.json+3-4
......@@ -27,14 +27,13 @@
2727 "./testing": "./testing.ts",
2828 "./ts": "./ts.ts"
2929 },
30 "imports": {
31 "@clo/lib/*": "./*.ts"
32 },
3033 "compilerOptions": {
3134 "jsx": "react-jsx",
3235 "jsxImportSource": "@clo/lib/render"
3336 },
34 "imports": {
35 "@clo/lib/render/jsx-runtime": "./render/jsx-runtime",
36 "@clo/lib/render/jsx-dev-runtime": "./render/jsx-runtime"
37 },
3837 "exclude": [
3938 "readme.npm.md",
4039 "package.json",
lib/error.ts+1-1
......@@ -51,4 +51,4 @@ export function rethrowWithMetadata(
5151 throw error;
5252}
5353
54import type * as node from "@clo/lib/node";
54import type * as node from "./node.ts";
lib/examples/progress-log-stream.ts+3-3
......@@ -62,6 +62,6 @@ async.delay(500).then(async () => {
6262 })();
6363});
6464
65import * as async from "@clo/lib/async";
66import * as progress from "@clo/lib/progress";
67import * as log from "@clo/lib/log";
65import * as async from "../async.ts";
66import * as progress from "../progress.ts";
67import * as log from "../log.ts";
lib/examples/progress-stdout-stream.ts+3-3
......@@ -34,6 +34,6 @@ async.delay(1000).then(async () => {
3434 const root = progress.start("generation");
3535});
3636
37import * as async from "@clo/lib/async";
38import * as progress from "@clo/lib/progress";
39import * as log from "@clo/lib/log";
37import * as async from "../async.ts";
38import * as progress from "../progress.ts";
39import * as log from "../log.ts";
lib/log.test.ts+37-39
......@@ -7,16 +7,16 @@ log satisfies log.Scope;
77describe("log widgets", () => {
88 test("write buffering", () => {
99 const host = new testing.MockScreen();
10 host.write("hello world ");
11 host.write("and so on\n");
10 host.writeOutput("hello world ");
11 host.writeOutput("and so on\n");
1212 host.expectFrame(0, {
1313 stdout: "hello world and so on\n",
1414 });
15 host.write("more logs\n");
15 host.writeOutput("more logs\n");
1616 host.expectFrame(0, {
1717 stdout: "more logs\n",
1818 });
19 host.write("abc def");
19 host.writeOutput("abc def");
2020 {
2121 using lock = host.getDrawLock("long");
2222 host.expectFrame(null, {
......@@ -27,8 +27,8 @@ describe("log widgets", () => {
2727 host.expectFrame(null, { stdout: "" });
2828 {
2929 const lock = host.getDrawLock("long");
30 host.write("abc def ");
31 host.write("hijk");
30 host.writeOutput("abc def ");
31 host.writeOutput("hijk");
3232 lock.release("cursor-start-of-line");
3333 host.expectFrame(0, {
3434 stdout: "abc def hijk",
......@@ -40,15 +40,14 @@ describe("log widgets", () => {
4040
4141 test("widget partial line", () => {
4242 const host = new testing.MockScreen();
43 const wd1: log.Widget = { format: (now) => `t=${now}` };
44 const w1 = host.startWidget(wd1);
43 const w1 = host.startWidget({ format: ({ now }) => `t=${now}` });
4544 host.expectFrame(0, {
4645 stderr: testing.MockScreen.sync([
4746 "t=0\n",
4847 ]),
4948 });
5049 host.expectNone();
51 host.write("partial line");
50 host.writeOutput("partial line");
5251 host.expectFrame(0, {
5352 merged: testing.MockScreen.sync([
5453 ansi.cursorUp(1),
......@@ -65,7 +64,7 @@ describe("log widgets", () => {
6564 "t=0\n",
6665 ]),
6766 });
68 host.write(" and more\n");
67 host.writeOutput(" and more\n");
6968 // partial line
7069 // t=0
7170 // [C]
......@@ -86,8 +85,7 @@ describe("log widgets", () => {
8685
8786 test("widget partial line 2", () => {
8887 const host = new testing.MockScreen();
89 const wd1: log.Widget = { format: (now) => `abc\ndefg` };
90 const w1 = host.startWidget(wd1);
88 const w1 = host.startWidget({ format: () => `abc\ndefg` });
9189 host.expectFrame(0, {
9290 stderr: testing.MockScreen.sync([
9391 "abc\ndefg\n",
......@@ -96,7 +94,7 @@ describe("log widgets", () => {
9694 // abc
9795 // defg
9896 host.expectNone();
99 host.write("partial line");
97 host.writeOutput("partial line");
10098 // abc
10199 // defg
102100 // [c]
......@@ -111,7 +109,7 @@ describe("log widgets", () => {
111109 "\ndefg\n",
112110 ]),
113111 });
114 host.write(" and more\na");
112 host.writeOutput(" and more\na");
115113 // partial line[T]
116114 // abc
117115 // defg
......@@ -137,7 +135,7 @@ describe("log widgets", () => {
137135 const host = new testing.MockScreen();
138136
139137 using _ = host.startWidget({
140 format: (now) => `line one ${now}\nline two`,
138 format: ({ now }) => `line one ${now}\nline two`,
141139 });
142140
143141 host.expectFrame(0, {
......@@ -146,7 +144,7 @@ describe("log widgets", () => {
146144 ]),
147145 });
148146
149 host.write("info: line of log\n");
147 host.writeOutput("info: line of log\n");
150148 host.expectFrame(0, {
151149 merged: testing.MockScreen.sync([
152150 ansi.cursorUp(2),
......@@ -156,8 +154,8 @@ describe("log widgets", () => {
156154 ]),
157155 });
158156
159 host.write("warn: line of log\n");
160 host.write("error: line of log\n");
157 host.writeOutput("warn: line of log\n");
158 host.writeOutput("error: line of log\n");
161159 host.expectFrame(0, {
162160 merged: testing.MockScreen.sync([
163161 ansi.cursorUp(1),
......@@ -176,7 +174,7 @@ describe("log widgets", () => {
176174 const host = new testing.MockScreen();
177175
178176 using _ = host.startWidget({
179 format: (now) => `line one ${now}\nline two`,
177 format: ({now}) => `line one ${now}\nline two`,
180178 });
181179
182180 host.expectFrame(0, {
......@@ -185,7 +183,7 @@ describe("log widgets", () => {
185183 ]),
186184 });
187185
188 host.write("info: line of log\n");
186 host.writeOutput("info: line of log\n");
189187 host.expectFrame(0, {
190188 merged: testing.MockScreen.sync([
191189 ansi.cursorUp(2),
......@@ -196,7 +194,7 @@ describe("log widgets", () => {
196194 });
197195
198196 {
199 host.write("warn: line of log\n");
197 host.writeOutput("warn: line of log\n");
200198 host.expectWithoutConsume(0);
201199 const lock = host.getDrawLock("short");
202200 // info: line of log
......@@ -219,7 +217,7 @@ describe("log widgets", () => {
219217 // [C]
220218 const lock2 = host.getDrawLock("long");
221219 host.expectNone();
222 host.write("error: line of log\n");
220 host.writeOutput("error: line of log\n");
223221 host.expectNone();
224222 lock2.release("cursor-start-of-line");
225223 host.expectNone();
......@@ -272,7 +270,7 @@ describe("log widgets", () => {
272270 const host = new testing.MockScreen();
273271
274272 using _ = host.startWidget({
275 format: (now) => `line one ${now}\nline two`,
273 format: ({ now }) => `line one ${now}\nline two`,
276274 });
277275
278276 host.expectFrame(0, {
......@@ -281,7 +279,7 @@ describe("log widgets", () => {
281279 ]),
282280 });
283281
284 host.write("info: line of log\n");
282 host.writeOutput("info: line of log\n");
285283 host.expectFrame(0, {
286284 merged: testing.MockScreen.sync([
287285 ansi.cursorUp(2),
......@@ -291,7 +289,7 @@ describe("log widgets", () => {
291289 ]),
292290 });
293291
294 host.write("warn: line of log\n");
292 host.writeOutput("warn: line of log\n");
295293 host.expectWithoutConsume(0);
296294 const lock = host.getDrawLock("short");
297295 // info: line of log
......@@ -363,7 +361,7 @@ describe("log widgets", () => {
363361 const host = new testing.MockScreen();
364362
365363 using _ = host.startWidget({
366 format: (now) => `line one ${now}\nline two`,
364 format: ({now}) => `line one ${now}\nline two`,
367365 });
368366
369367 host.expectFrame(0, {
......@@ -372,7 +370,7 @@ describe("log widgets", () => {
372370 ]),
373371 });
374372
375 host.write("info: line of log\n");
373 host.writeOutput("info: line of log\n");
376374 host.expectFrame(0, {
377375 merged: testing.MockScreen.sync([
378376 ansi.cursorUp(2),
......@@ -382,7 +380,7 @@ describe("log widgets", () => {
382380 ]),
383381 });
384382
385 host.write("warn: line of log\n");
383 host.writeOutput("warn: line of log\n");
386384 host.expectWithoutConsume(0);
387385 const lock = host.getDrawLock("long");
388386 // info: line of log
......@@ -406,8 +404,8 @@ describe("log widgets", () => {
406404 // [C]
407405 const lock2 = host.getDrawLock("long");
408406 host.expectNone();
409 // now we will pretend the environment writes "hello " without
410 // a newline. without extra write calls, it has to save and
407 // now we will pretend the environment writeOutput "hello " without
408 // a newline. without extra writeOutput calls, it has to save and
411409 // restore the cursor perfectly. when multiple locks are held,
412410 // it's a bit ambiguous, so the implementation takes the slow path
413411 // if any releases are uncertain of the terminal state.
......@@ -457,11 +455,11 @@ describe("log widgets", () => {
457455 test("widget expires", () => {
458456 const host = new testing.MockScreen();
459457
460 host.write("log line 1\n");
461 host.write("log line 2\n");
458 host.writeOutput("log line 1\n");
459 host.writeOutput("log line 2\n");
462460
463461 using _ = host.startWidget({
464 format: (now) =>
462 format: ({now}) =>
465463 now > 1000 ? null : `widget line one ${now}\nwidget line two`,
466464 fps: 1,
467465 });
......@@ -494,10 +492,10 @@ describe("log widgets", () => {
494492 test("widget expires partial line output", () => {
495493 const host = new testing.MockScreen();
496494
497 host.write("log line;");
495 host.writeOutput("log line;");
498496
499497 using _ = host.startWidget({
500 format: (now) =>
498 format: ({now}) =>
501499 now > 500 ? null : `widget line one ${now}\nwidget line two`,
502500 fps: 1,
503501 });
......@@ -510,7 +508,7 @@ describe("log widgets", () => {
510508 "widget line one 0\nwidget line two\n",
511509 ]),
512510 });
513 host.write(" rest of line\n");
511 host.writeOutput(" rest of line\n");
514512 host.expectFrame(1000, {
515513 stdout: " rest of line\n",
516514 merged: testing.MockScreen.sync([
......@@ -527,6 +525,6 @@ describe("log widgets", () => {
527525});
528526
529527import { describe, test } from "vitest";
530import * as ansi from "@clo/lib/string/ansi";
531import * as log from "@clo/lib/log";
532import * as testing from "@clo/lib/testing";
528import * as ansi from "./string/ansi.ts";
529import * as log from "./log.ts";
530import * as testing from "./testing.ts";
lib/log.ts+1-1
......@@ -1203,7 +1203,7 @@ export type MessageFormatFunction = (
12031203 colors: boolean,
12041204) => string;
12051205
1206import * as ansi from "@clo/lib/string/ansi";
1206import * as ansi from "./string/ansi.ts";
12071207import * as async from "./async.ts";
12081208import * as node from "./node.ts";
12091209import * as stack from "./log/stack.ts";
lib/log/stack.ts+2-2
......@@ -428,5 +428,5 @@ const regexFunctionName = /((.*".+"[^@]*)?[^@]*)(?:@)/;
428428const regexV8Stack = /^\s*at .*(\S+:\d+|\(native\))/m;
429429const regexLocation = /(.+?)(?::(\d+))?(?::(\d+))?$/;
430430
431import * as ansi from "@clo/lib/string/ansi";
432import * as node from "@clo/lib/node";
431import * as ansi from "../string/ansi.ts";
432import * as node from "../node.ts";
lib/mime.test.ts+1-1
......@@ -25,4 +25,4 @@ test("for", () => {
2525
2626import { test } from "vitest";
2727import assert from "node:assert";
28import * as mime from "@clo/lib/mime";
28import * as mime from "./mime.ts";
lib/package.json+4
......@@ -1,5 +1,9 @@
11{
22 "name": "@clo/lib",
33 "type": "module",
4 "dependencies": {
5 "@types/node": "^24.0.0",
6 "@clo/lib": "file:."
7 },
48 "exports": { "./*": "./*.ts" }
59}
lib/progress.test.ts+5-5
......@@ -235,10 +235,10 @@ function cleanProgressEvent(event: progress.StreamEvent) {
235235
236236type EncodedKey = typeof progress.internals.EncodedKey;
237237
238import * as progress from "@clo/lib/progress";
238import * as progress from "./progress.ts";
239239import { describe, test, vi } from "vitest";
240240import assert from "node:assert/strict";
241import * as stream from "@clo/lib/stream";
242import * as testing from "@clo/lib/testing";
243import * as ansi from "@clo/lib/string/ansi";
244import { UNWRAP } from "@clo/lib/assert";
241import * as stream from "./stream.ts";
242import * as testing from "./testing.ts";
243import * as ansi from "./string/ansi.ts";
244import { UNWRAP } from "./assert.ts";
lib/progress.ts+10-10
......@@ -1768,13 +1768,13 @@ export const internals: {
17681768 EncodedKey: 0 as EncodedKey,
17691769}))();
17701770
1771import * as ansi from "@clo/lib/string/ansi";
1772import * as async from "@clo/lib/async";
1773import * as bytes from "@clo/lib/bytes";
1774import * as log from "@clo/lib/log";
1775import * as stack from "@clo/lib/log/stack";
1776import * as stream from "@clo/lib/stream";
1777import * as string from "@clo/lib/string";
1778import * as ts from "@clo/lib/ts";
1779import { ASSERT, UNWRAP } from "@clo/lib/assert";
1780import { Events } from "@clo/lib/Events";
1771import * as ansi from "./string/ansi.ts";
1772import * as async from "./async.ts";
1773import * as bytes from "./bytes.ts";
1774import * as log from "./log.ts";
1775import * as stack from "./log/stack.ts";
1776import * as stream from "./stream.ts";
1777import * as string from "./string.ts";
1778import * as ts from "./ts.ts";
1779import { ASSERT, UNWRAP } from "./assert.ts";
1780import { Events } from "./Events.ts";
lib/queue.ts+1-1
......@@ -176,4 +176,4 @@ function insertSorted<T extends { priority: number }>(arr: T[], item: T) {
176176declare var navigator: { hardwareConcurrency: number };
177177const global = new PriorityQueue(navigator.hardwareConcurrency);
178178
179import { UNWRAP } from "@clo/lib/assert";
179import { UNWRAP } from "./assert.ts";
lib/render.ts+1-1
......@@ -476,4 +476,4 @@ const kRaw = Symbol("Raw");
476476/** secret key to facilitate {@linkcode init} with a `ContextValue[]` */
477477const kContext: unique symbol = Symbol();
478478
479import { ASSERT, UNWRAP } from "@clo/lib/assert";
479import { ASSERT, UNWRAP } from "./assert.ts";
lib/render/jsx-runtime.ts+2-2
......@@ -77,5 +77,5 @@ export declare namespace ts {
7777 export type ElementClass = ReturnType<render.Component>;
7878}
7979
80import * as render from "@clo/lib/render";
81import { ASSERT } from "@clo/lib/assert";
80import * as render from "../render.ts";
81import { ASSERT } from "../assert.ts";
lib/render/meta.test.tsx+1-1
......@@ -46,4 +46,4 @@ test("automatic embed with '{}'", () =>
4646
4747import { test } from "vitest";
4848import assert from "node:assert";
49import * as meta from "@clo/lib/render/meta";
49import * as meta from "./meta.ts";
lib/render/meta.ts+2-2
......@@ -253,5 +253,5 @@ function attr(value: string) {
253253 return render.quoteIfNeeded(esc(value));
254254}
255255
256import { escapeHtmlContent as esc } from "@clo/lib/render";
257import * as render from "@clo/lib/render";
256import { escapeHtmlContent as esc } from "../render.ts";
257import * as render from "../render.ts";
lib/stream.test.ts+1-1
......@@ -227,4 +227,4 @@ describe("BufferedReader", () => {
227227
228228import { describe, test } from "vitest";
229229import { strict as assert } from "node:assert";
230import * as stream from "@clo/lib/stream";
230import * as stream from "./stream.ts";
lib/stream.ts+2-2
......@@ -472,5 +472,5 @@ export function readWritePair(): [
472472 return [reader, unbuffered];
473473}
474474
475import * as string from "@clo/lib/string";
476import { ASSERT, UNWRAP } from "@clo/lib/assert";
475import * as string from "./string.ts";
476import { ASSERT, UNWRAP } from "./assert.ts";
lib/string.test.ts+1-1
......@@ -48,4 +48,4 @@ test.todo("formatByteSize", () => {
4848
4949import { test } from "vitest";
5050import assert from "node:assert";
51import * as string from "@clo/lib/string";
51import * as string from "./string.ts";
lib/string/ansi.test.ts+1-1
......@@ -21,4 +21,4 @@ test("trimForTerminal", () => {
2121
2222import { test } from "vitest";
2323import assert from "node:assert";
24import * as ansi from "@clo/lib/string/ansi";
24import * as ansi from "./ansi.ts";
lib/string/ansi.ts+2-2
......@@ -407,5 +407,5 @@ function segmentWidth(segment: string) {
407407 );
408408}
409409
410import * as self from "@clo/lib/string/ansi";
411import { UNWRAP } from "@clo/lib/assert";
410import * as self from "./ansi.ts";
411import { UNWRAP } from "../assert.ts";
lib/subprocess/ffmpeg.ts+3-3
......@@ -195,6 +195,6 @@ import * as readline from "node:readline";
195195import * as process from "node:process";
196196import events from "node:events";
197197import * as path from "node:path";
198import * as subprocess from "@clo/lib/subprocess";
199import type * as progress from "@clo/lib/progress";
200import * as string from "@clo/lib/string";
198import * as subprocess from "../subprocess.ts";
199import type * as progress from "../progress.ts";
200import * as string from "../string.ts";
lib/testing.ts+5-5
......@@ -334,8 +334,8 @@ export class MockScreen implements Disposable, log.WidgetHost {
334334 }
335335}
336336
337import * as ansi from "@clo/lib/string/ansi";
338import { ASSERT, UNWRAP } from "@clo/lib/assert";
339import * as log from "@clo/lib/log";
340import * as async from "@clo/lib/async";
341import * as stack from "@clo/lib/log/stack";
337import * as ansi from "./string/ansi.ts";
338import { ASSERT, UNWRAP } from "./assert.ts";
339import * as log from "./log.ts";
340import * as async from "./async.ts";
341import * as stack from "./log/stack.ts";