| author | |
| committer | |
| log | fd419f88c1068452779bcc11869d8e4aff6cee48 |
| tree | 7130fc45b4b2e6800cc080686e48846d315d46ef |
| parent | 35af679821a76a4704d65dcb04943e1b4922367d |
| signature | Signed by SSH key SHA256:xbd+BjjhyBfwk7GVoURf9Yx0gzDerHbvYv7SddNWmAs |
28 files changed, 101 insertions(+), 100 deletions(-)
lib/Events.ts+3-3| ... | @@ -102,6 +102,6 @@ export namespace Events { | ... | @@ -102,6 +102,6 @@ export namespace Events { |
| 102 | export type Handler<Args extends unknown[]> = (...args: Args) => void; | 102 | export type Handler<Args extends unknown[]> = (...args: Args) => void; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | import * as ts from "@clo/lib/ts"; | 105 | import * as ts from "./ts.ts"; |
| 106 | import * as async from "@clo/lib/async"; | 106 | import * as async from "./async.ts"; |
| 107 | import { UNWRAP } from "@clo/lib/assert"; | 107 | import { UNWRAP } from "./assert.ts"; |
lib/Lru.test.ts+1-1| ... | @@ -151,4 +151,4 @@ test("revival", () => { | ... | @@ -151,4 +151,4 @@ test("revival", () => { |
| 151 | 151 | ||
| 152 | import assert from "node:assert"; | 152 | import assert from "node:assert"; |
| 153 | import { test } from "vitest"; | 153 | import { test } from "vitest"; |
| 154 | import { Lru } from "@clo/lib/Lru"; | 154 | import { Lru } from "./Lru.ts"; |
lib/Lru.ts+2-2| ... | @@ -278,5 +278,5 @@ export declare namespace Lru { | ... | @@ -278,5 +278,5 @@ export declare namespace Lru { |
| 278 | const none: unique symbol = Symbol(); | 278 | const none: unique symbol = Symbol(); |
| 279 | type none = typeof none; | 279 | type none = typeof none; |
| 280 | 280 | ||
| 281 | import { ASSERT, UNWRAP } from "@clo/lib/assert"; | 281 | import { ASSERT, UNWRAP } from "./assert.ts"; |
| 282 | import * as ts from "@clo/lib/ts"; | 282 | import * as ts from "./ts.ts"; |
lib/assert.ts+1-1| ... | @@ -43,4 +43,4 @@ function inspect(object: unknown) { | ... | @@ -43,4 +43,4 @@ function inspect(object: unknown) { |
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | import * as node from "@clo/lib/node"; | 46 | import * as node from "./node.ts"; |
lib/async.ts+2-2| ... | @@ -255,5 +255,5 @@ export function delay(ms: number): Cancelable<void> { | ... | @@ -255,5 +255,5 @@ export function delay(ms: number): Cancelable<void> { |
| 255 | ); | 255 | ); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | import { ASSERT } from "@clo/lib/assert"; | 258 | import { ASSERT } from "./assert.ts"; |
| 259 | import * as ts from "@clo/lib/ts"; | 259 | import * as ts from "./ts.ts"; |
lib/deno.json+3-4| ... | @@ -27,14 +27,13 @@ | ... | @@ -27,14 +27,13 @@ |
| 27 | "./testing": "./testing.ts", | 27 | "./testing": "./testing.ts", |
| 28 | "./ts": "./ts.ts" | 28 | "./ts": "./ts.ts" |
| 29 | }, | 29 | }, |
| 30 | "imports": { | ||
| 31 | "@clo/lib/*": "./*.ts" | ||
| 32 | }, | ||
| 30 | "compilerOptions": { | 33 | "compilerOptions": { |
| 31 | "jsx": "react-jsx", | 34 | "jsx": "react-jsx", |
| 32 | "jsxImportSource": "@clo/lib/render" | 35 | "jsxImportSource": "@clo/lib/render" |
| 33 | }, | 36 | }, |
| 34 | "imports": { | ||
| 35 | "@clo/lib/render/jsx-runtime": "./render/jsx-runtime", | ||
| 36 | "@clo/lib/render/jsx-dev-runtime": "./render/jsx-runtime" | ||
| 37 | }, | ||
| 38 | "exclude": [ | 37 | "exclude": [ |
| 39 | "readme.npm.md", | 38 | "readme.npm.md", |
| 40 | "package.json", | 39 | "package.json", |
lib/error.ts+1-1| ... | @@ -51,4 +51,4 @@ export function rethrowWithMetadata( | ... | @@ -51,4 +51,4 @@ export function rethrowWithMetadata( |
| 51 | throw error; | 51 | throw error; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | import type * as node from "@clo/lib/node"; | 54 | import type * as node from "./node.ts"; |
lib/examples/progress-log-stream.ts+3-3| ... | @@ -62,6 +62,6 @@ async.delay(500).then(async () => { | ... | @@ -62,6 +62,6 @@ async.delay(500).then(async () => { |
| 62 | })(); | 62 | })(); |
| 63 | }); | 63 | }); |
| 64 | 64 | ||
| 65 | import * as async from "@clo/lib/async"; | 65 | import * as async from "../async.ts"; |
| 66 | import * as progress from "@clo/lib/progress"; | 66 | import * as progress from "../progress.ts"; |
| 67 | import * as log from "@clo/lib/log"; | 67 | import * as log from "../log.ts"; |
lib/examples/progress-stdout-stream.ts+3-3| ... | @@ -34,6 +34,6 @@ async.delay(1000).then(async () => { | ... | @@ -34,6 +34,6 @@ async.delay(1000).then(async () => { |
| 34 | const root = progress.start("generation"); | 34 | const root = progress.start("generation"); |
| 35 | }); | 35 | }); |
| 36 | 36 | ||
| 37 | import * as async from "@clo/lib/async"; | 37 | import * as async from "../async.ts"; |
| 38 | import * as progress from "@clo/lib/progress"; | 38 | import * as progress from "../progress.ts"; |
| 39 | import * as log from "@clo/lib/log"; | 39 | import * as log from "../log.ts"; |
lib/log.test.ts+37-39| ... | @@ -7,16 +7,16 @@ log satisfies log.Scope; | ... | @@ -7,16 +7,16 @@ log satisfies log.Scope; |
| 7 | describe("log widgets", () => { | 7 | describe("log widgets", () => { |
| 8 | test("write buffering", () => { | 8 | test("write buffering", () => { |
| 9 | const host = new testing.MockScreen(); | 9 | const host = new testing.MockScreen(); |
| 10 | host.write("hello world "); | 10 | host.writeOutput("hello world "); |
| 11 | host.write("and so on\n"); | 11 | host.writeOutput("and so on\n"); |
| 12 | host.expectFrame(0, { | 12 | host.expectFrame(0, { |
| 13 | stdout: "hello world and so on\n", | 13 | stdout: "hello world and so on\n", |
| 14 | }); | 14 | }); |
| 15 | host.write("more logs\n"); | 15 | host.writeOutput("more logs\n"); |
| 16 | host.expectFrame(0, { | 16 | host.expectFrame(0, { |
| 17 | stdout: "more logs\n", | 17 | stdout: "more logs\n", |
| 18 | }); | 18 | }); |
| 19 | host.write("abc def"); | 19 | host.writeOutput("abc def"); |
| 20 | { | 20 | { |
| 21 | using lock = host.getDrawLock("long"); | 21 | using lock = host.getDrawLock("long"); |
| 22 | host.expectFrame(null, { | 22 | host.expectFrame(null, { |
| ... | @@ -27,8 +27,8 @@ describe("log widgets", () => { | ... | @@ -27,8 +27,8 @@ describe("log widgets", () => { |
| 27 | host.expectFrame(null, { stdout: "" }); | 27 | host.expectFrame(null, { stdout: "" }); |
| 28 | { | 28 | { |
| 29 | const lock = host.getDrawLock("long"); | 29 | const lock = host.getDrawLock("long"); |
| 30 | host.write("abc def "); | 30 | host.writeOutput("abc def "); |
| 31 | host.write("hijk"); | 31 | host.writeOutput("hijk"); |
| 32 | lock.release("cursor-start-of-line"); | 32 | lock.release("cursor-start-of-line"); |
| 33 | host.expectFrame(0, { | 33 | host.expectFrame(0, { |
| 34 | stdout: "abc def hijk", | 34 | stdout: "abc def hijk", |
| ... | @@ -40,15 +40,14 @@ describe("log widgets", () => { | ... | @@ -40,15 +40,14 @@ describe("log widgets", () => { |
| 40 | 40 | ||
| 41 | test("widget partial line", () => { | 41 | test("widget partial line", () => { |
| 42 | const host = new testing.MockScreen(); | 42 | const host = new testing.MockScreen(); |
| 43 | const wd1: log.Widget = { format: (now) => `t=${now}` }; | 43 | const w1 = host.startWidget({ format: ({ now }) => `t=${now}` }); |
| 44 | const w1 = host.startWidget(wd1); | ||
| 45 | host.expectFrame(0, { | 44 | host.expectFrame(0, { |
| 46 | stderr: testing.MockScreen.sync([ | 45 | stderr: testing.MockScreen.sync([ |
| 47 | "t=0\n", | 46 | "t=0\n", |
| 48 | ]), | 47 | ]), |
| 49 | }); | 48 | }); |
| 50 | host.expectNone(); | 49 | host.expectNone(); |
| 51 | host.write("partial line"); | 50 | host.writeOutput("partial line"); |
| 52 | host.expectFrame(0, { | 51 | host.expectFrame(0, { |
| 53 | merged: testing.MockScreen.sync([ | 52 | merged: testing.MockScreen.sync([ |
| 54 | ansi.cursorUp(1), | 53 | ansi.cursorUp(1), |
| ... | @@ -65,7 +64,7 @@ describe("log widgets", () => { | ... | @@ -65,7 +64,7 @@ describe("log widgets", () => { |
| 65 | "t=0\n", | 64 | "t=0\n", |
| 66 | ]), | 65 | ]), |
| 67 | }); | 66 | }); |
| 68 | host.write(" and more\n"); | 67 | host.writeOutput(" and more\n"); |
| 69 | // partial line | 68 | // partial line |
| 70 | // t=0 | 69 | // t=0 |
| 71 | // [C] | 70 | // [C] |
| ... | @@ -86,8 +85,7 @@ describe("log widgets", () => { | ... | @@ -86,8 +85,7 @@ describe("log widgets", () => { |
| 86 | 85 | ||
| 87 | test("widget partial line 2", () => { | 86 | test("widget partial line 2", () => { |
| 88 | const host = new testing.MockScreen(); | 87 | const host = new testing.MockScreen(); |
| 89 | const wd1: log.Widget = { format: (now) => `abc\ndefg` }; | 88 | const w1 = host.startWidget({ format: () => `abc\ndefg` }); |
| 90 | const w1 = host.startWidget(wd1); | ||
| 91 | host.expectFrame(0, { | 89 | host.expectFrame(0, { |
| 92 | stderr: testing.MockScreen.sync([ | 90 | stderr: testing.MockScreen.sync([ |
| 93 | "abc\ndefg\n", | 91 | "abc\ndefg\n", |
| ... | @@ -96,7 +94,7 @@ describe("log widgets", () => { | ... | @@ -96,7 +94,7 @@ describe("log widgets", () => { |
| 96 | // abc | 94 | // abc |
| 97 | // defg | 95 | // defg |
| 98 | host.expectNone(); | 96 | host.expectNone(); |
| 99 | host.write("partial line"); | 97 | host.writeOutput("partial line"); |
| 100 | // abc | 98 | // abc |
| 101 | // defg | 99 | // defg |
| 102 | // [c] | 100 | // [c] |
| ... | @@ -111,7 +109,7 @@ describe("log widgets", () => { | ... | @@ -111,7 +109,7 @@ describe("log widgets", () => { |
| 111 | "\ndefg\n", | 109 | "\ndefg\n", |
| 112 | ]), | 110 | ]), |
| 113 | }); | 111 | }); |
| 114 | host.write(" and more\na"); | 112 | host.writeOutput(" and more\na"); |
| 115 | // partial line[T] | 113 | // partial line[T] |
| 116 | // abc | 114 | // abc |
| 117 | // defg | 115 | // defg |
| ... | @@ -137,7 +135,7 @@ describe("log widgets", () => { | ... | @@ -137,7 +135,7 @@ describe("log widgets", () => { |
| 137 | const host = new testing.MockScreen(); | 135 | const host = new testing.MockScreen(); |
| 138 | 136 | ||
| 139 | using _ = host.startWidget({ | 137 | using _ = host.startWidget({ |
| 140 | format: (now) => `line one ${now}\nline two`, | 138 | format: ({ now }) => `line one ${now}\nline two`, |
| 141 | }); | 139 | }); |
| 142 | 140 | ||
| 143 | host.expectFrame(0, { | 141 | host.expectFrame(0, { |
| ... | @@ -146,7 +144,7 @@ describe("log widgets", () => { | ... | @@ -146,7 +144,7 @@ describe("log widgets", () => { |
| 146 | ]), | 144 | ]), |
| 147 | }); | 145 | }); |
| 148 | 146 | ||
| 149 | host.write("info: line of log\n"); | 147 | host.writeOutput("info: line of log\n"); |
| 150 | host.expectFrame(0, { | 148 | host.expectFrame(0, { |
| 151 | merged: testing.MockScreen.sync([ | 149 | merged: testing.MockScreen.sync([ |
| 152 | ansi.cursorUp(2), | 150 | ansi.cursorUp(2), |
| ... | @@ -156,8 +154,8 @@ describe("log widgets", () => { | ... | @@ -156,8 +154,8 @@ describe("log widgets", () => { |
| 156 | ]), | 154 | ]), |
| 157 | }); | 155 | }); |
| 158 | 156 | ||
| 159 | host.write("warn: line of log\n"); | 157 | host.writeOutput("warn: line of log\n"); |
| 160 | host.write("error: line of log\n"); | 158 | host.writeOutput("error: line of log\n"); |
| 161 | host.expectFrame(0, { | 159 | host.expectFrame(0, { |
| 162 | merged: testing.MockScreen.sync([ | 160 | merged: testing.MockScreen.sync([ |
| 163 | ansi.cursorUp(1), | 161 | ansi.cursorUp(1), |
| ... | @@ -176,7 +174,7 @@ describe("log widgets", () => { | ... | @@ -176,7 +174,7 @@ describe("log widgets", () => { |
| 176 | const host = new testing.MockScreen(); | 174 | const host = new testing.MockScreen(); |
| 177 | 175 | ||
| 178 | using _ = host.startWidget({ | 176 | using _ = host.startWidget({ |
| 179 | format: (now) => `line one ${now}\nline two`, | 177 | format: ({now}) => `line one ${now}\nline two`, |
| 180 | }); | 178 | }); |
| 181 | 179 | ||
| 182 | host.expectFrame(0, { | 180 | host.expectFrame(0, { |
| ... | @@ -185,7 +183,7 @@ describe("log widgets", () => { | ... | @@ -185,7 +183,7 @@ describe("log widgets", () => { |
| 185 | ]), | 183 | ]), |
| 186 | }); | 184 | }); |
| 187 | 185 | ||
| 188 | host.write("info: line of log\n"); | 186 | host.writeOutput("info: line of log\n"); |
| 189 | host.expectFrame(0, { | 187 | host.expectFrame(0, { |
| 190 | merged: testing.MockScreen.sync([ | 188 | merged: testing.MockScreen.sync([ |
| 191 | ansi.cursorUp(2), | 189 | ansi.cursorUp(2), |
| ... | @@ -196,7 +194,7 @@ describe("log widgets", () => { | ... | @@ -196,7 +194,7 @@ describe("log widgets", () => { |
| 196 | }); | 194 | }); |
| 197 | 195 | ||
| 198 | { | 196 | { |
| 199 | host.write("warn: line of log\n"); | 197 | host.writeOutput("warn: line of log\n"); |
| 200 | host.expectWithoutConsume(0); | 198 | host.expectWithoutConsume(0); |
| 201 | const lock = host.getDrawLock("short"); | 199 | const lock = host.getDrawLock("short"); |
| 202 | // info: line of log | 200 | // info: line of log |
| ... | @@ -219,7 +217,7 @@ describe("log widgets", () => { | ... | @@ -219,7 +217,7 @@ describe("log widgets", () => { |
| 219 | // [C] | 217 | // [C] |
| 220 | const lock2 = host.getDrawLock("long"); | 218 | const lock2 = host.getDrawLock("long"); |
| 221 | host.expectNone(); | 219 | host.expectNone(); |
| 222 | host.write("error: line of log\n"); | 220 | host.writeOutput("error: line of log\n"); |
| 223 | host.expectNone(); | 221 | host.expectNone(); |
| 224 | lock2.release("cursor-start-of-line"); | 222 | lock2.release("cursor-start-of-line"); |
| 225 | host.expectNone(); | 223 | host.expectNone(); |
| ... | @@ -272,7 +270,7 @@ describe("log widgets", () => { | ... | @@ -272,7 +270,7 @@ describe("log widgets", () => { |
| 272 | const host = new testing.MockScreen(); | 270 | const host = new testing.MockScreen(); |
| 273 | 271 | ||
| 274 | using _ = host.startWidget({ | 272 | using _ = host.startWidget({ |
| 275 | format: (now) => `line one ${now}\nline two`, | 273 | format: ({ now }) => `line one ${now}\nline two`, |
| 276 | }); | 274 | }); |
| 277 | 275 | ||
| 278 | host.expectFrame(0, { | 276 | host.expectFrame(0, { |
| ... | @@ -281,7 +279,7 @@ describe("log widgets", () => { | ... | @@ -281,7 +279,7 @@ describe("log widgets", () => { |
| 281 | ]), | 279 | ]), |
| 282 | }); | 280 | }); |
| 283 | 281 | ||
| 284 | host.write("info: line of log\n"); | 282 | host.writeOutput("info: line of log\n"); |
| 285 | host.expectFrame(0, { | 283 | host.expectFrame(0, { |
| 286 | merged: testing.MockScreen.sync([ | 284 | merged: testing.MockScreen.sync([ |
| 287 | ansi.cursorUp(2), | 285 | ansi.cursorUp(2), |
| ... | @@ -291,7 +289,7 @@ describe("log widgets", () => { | ... | @@ -291,7 +289,7 @@ describe("log widgets", () => { |
| 291 | ]), | 289 | ]), |
| 292 | }); | 290 | }); |
| 293 | 291 | ||
| 294 | host.write("warn: line of log\n"); | 292 | host.writeOutput("warn: line of log\n"); |
| 295 | host.expectWithoutConsume(0); | 293 | host.expectWithoutConsume(0); |
| 296 | const lock = host.getDrawLock("short"); | 294 | const lock = host.getDrawLock("short"); |
| 297 | // info: line of log | 295 | // info: line of log |
| ... | @@ -363,7 +361,7 @@ describe("log widgets", () => { | ... | @@ -363,7 +361,7 @@ describe("log widgets", () => { |
| 363 | const host = new testing.MockScreen(); | 361 | const host = new testing.MockScreen(); |
| 364 | 362 | ||
| 365 | using _ = host.startWidget({ | 363 | using _ = host.startWidget({ |
| 366 | format: (now) => `line one ${now}\nline two`, | 364 | format: ({now}) => `line one ${now}\nline two`, |
| 367 | }); | 365 | }); |
| 368 | 366 | ||
| 369 | host.expectFrame(0, { | 367 | host.expectFrame(0, { |
| ... | @@ -372,7 +370,7 @@ describe("log widgets", () => { | ... | @@ -372,7 +370,7 @@ describe("log widgets", () => { |
| 372 | ]), | 370 | ]), |
| 373 | }); | 371 | }); |
| 374 | 372 | ||
| 375 | host.write("info: line of log\n"); | 373 | host.writeOutput("info: line of log\n"); |
| 376 | host.expectFrame(0, { | 374 | host.expectFrame(0, { |
| 377 | merged: testing.MockScreen.sync([ | 375 | merged: testing.MockScreen.sync([ |
| 378 | ansi.cursorUp(2), | 376 | ansi.cursorUp(2), |
| ... | @@ -382,7 +380,7 @@ describe("log widgets", () => { | ... | @@ -382,7 +380,7 @@ describe("log widgets", () => { |
| 382 | ]), | 380 | ]), |
| 383 | }); | 381 | }); |
| 384 | 382 | ||
| 385 | host.write("warn: line of log\n"); | 383 | host.writeOutput("warn: line of log\n"); |
| 386 | host.expectWithoutConsume(0); | 384 | host.expectWithoutConsume(0); |
| 387 | const lock = host.getDrawLock("long"); | 385 | const lock = host.getDrawLock("long"); |
| 388 | // info: line of log | 386 | // info: line of log |
| ... | @@ -406,8 +404,8 @@ describe("log widgets", () => { | ... | @@ -406,8 +404,8 @@ describe("log widgets", () => { |
| 406 | // [C] | 404 | // [C] |
| 407 | const lock2 = host.getDrawLock("long"); | 405 | const lock2 = host.getDrawLock("long"); |
| 408 | host.expectNone(); | 406 | host.expectNone(); |
| 409 | // now we will pretend the environment writes "hello " without | 407 | // now we will pretend the environment writeOutput "hello " without |
| 410 | // a newline. without extra write calls, it has to save and | 408 | // a newline. without extra writeOutput calls, it has to save and |
| 411 | // restore the cursor perfectly. when multiple locks are held, | 409 | // restore the cursor perfectly. when multiple locks are held, |
| 412 | // it's a bit ambiguous, so the implementation takes the slow path | 410 | // it's a bit ambiguous, so the implementation takes the slow path |
| 413 | // if any releases are uncertain of the terminal state. | 411 | // if any releases are uncertain of the terminal state. |
| ... | @@ -457,11 +455,11 @@ describe("log widgets", () => { | ... | @@ -457,11 +455,11 @@ describe("log widgets", () => { |
| 457 | test("widget expires", () => { | 455 | test("widget expires", () => { |
| 458 | const host = new testing.MockScreen(); | 456 | const host = new testing.MockScreen(); |
| 459 | 457 | ||
| 460 | host.write("log line 1\n"); | 458 | host.writeOutput("log line 1\n"); |
| 461 | host.write("log line 2\n"); | 459 | host.writeOutput("log line 2\n"); |
| 462 | 460 | ||
| 463 | using _ = host.startWidget({ | 461 | using _ = host.startWidget({ |
| 464 | format: (now) => | 462 | format: ({now}) => |
| 465 | now > 1000 ? null : `widget line one ${now}\nwidget line two`, | 463 | now > 1000 ? null : `widget line one ${now}\nwidget line two`, |
| 466 | fps: 1, | 464 | fps: 1, |
| 467 | }); | 465 | }); |
| ... | @@ -494,10 +492,10 @@ describe("log widgets", () => { | ... | @@ -494,10 +492,10 @@ describe("log widgets", () => { |
| 494 | test("widget expires partial line output", () => { | 492 | test("widget expires partial line output", () => { |
| 495 | const host = new testing.MockScreen(); | 493 | const host = new testing.MockScreen(); |
| 496 | 494 | ||
| 497 | host.write("log line;"); | 495 | host.writeOutput("log line;"); |
| 498 | 496 | ||
| 499 | using _ = host.startWidget({ | 497 | using _ = host.startWidget({ |
| 500 | format: (now) => | 498 | format: ({now}) => |
| 501 | now > 500 ? null : `widget line one ${now}\nwidget line two`, | 499 | now > 500 ? null : `widget line one ${now}\nwidget line two`, |
| 502 | fps: 1, | 500 | fps: 1, |
| 503 | }); | 501 | }); |
| ... | @@ -510,7 +508,7 @@ describe("log widgets", () => { | ... | @@ -510,7 +508,7 @@ describe("log widgets", () => { |
| 510 | "widget line one 0\nwidget line two\n", | 508 | "widget line one 0\nwidget line two\n", |
| 511 | ]), | 509 | ]), |
| 512 | }); | 510 | }); |
| 513 | host.write(" rest of line\n"); | 511 | host.writeOutput(" rest of line\n"); |
| 514 | host.expectFrame(1000, { | 512 | host.expectFrame(1000, { |
| 515 | stdout: " rest of line\n", | 513 | stdout: " rest of line\n", |
| 516 | merged: testing.MockScreen.sync([ | 514 | merged: testing.MockScreen.sync([ |
| ... | @@ -527,6 +525,6 @@ describe("log widgets", () => { | ... | @@ -527,6 +525,6 @@ describe("log widgets", () => { |
| 527 | }); | 525 | }); |
| 528 | 526 | ||
| 529 | import { describe, test } from "vitest"; | 527 | import { describe, test } from "vitest"; |
| 530 | import * as ansi from "@clo/lib/string/ansi"; | 528 | import * as ansi from "./string/ansi.ts"; |
| 531 | import * as log from "@clo/lib/log"; | 529 | import * as log from "./log.ts"; |
| 532 | import * as testing from "@clo/lib/testing"; | 530 | import * as testing from "./testing.ts"; |
lib/log.ts+1-1| ... | @@ -1203,7 +1203,7 @@ export type MessageFormatFunction = ( | ... | @@ -1203,7 +1203,7 @@ export type MessageFormatFunction = ( |
| 1203 | colors: boolean, | 1203 | colors: boolean, |
| 1204 | ) => string; | 1204 | ) => string; |
| 1205 | 1205 | ||
| 1206 | import * as ansi from "@clo/lib/string/ansi"; | 1206 | import * as ansi from "./string/ansi.ts"; |
| 1207 | import * as async from "./async.ts"; | 1207 | import * as async from "./async.ts"; |
| 1208 | import * as node from "./node.ts"; | 1208 | import * as node from "./node.ts"; |
| 1209 | import * as stack from "./log/stack.ts"; | 1209 | import * as stack from "./log/stack.ts"; |
lib/log/stack.ts+2-2| ... | @@ -428,5 +428,5 @@ const regexFunctionName = /((.*".+"[^@]*)?[^@]*)(?:@)/; | ... | @@ -428,5 +428,5 @@ const regexFunctionName = /((.*".+"[^@]*)?[^@]*)(?:@)/; |
| 428 | const regexV8Stack = /^\s*at .*(\S+:\d+|\(native\))/m; | 428 | const regexV8Stack = /^\s*at .*(\S+:\d+|\(native\))/m; |
| 429 | const regexLocation = /(.+?)(?::(\d+))?(?::(\d+))?$/; | 429 | const regexLocation = /(.+?)(?::(\d+))?(?::(\d+))?$/; |
| 430 | 430 | ||
| 431 | import * as ansi from "@clo/lib/string/ansi"; | 431 | import * as ansi from "../string/ansi.ts"; |
| 432 | import * as node from "@clo/lib/node"; | 432 | import * as node from "../node.ts"; |
lib/mime.test.ts+1-1| ... | @@ -25,4 +25,4 @@ test("for", () => { | ... | @@ -25,4 +25,4 @@ test("for", () => { |
| 25 | 25 | ||
| 26 | import { test } from "vitest"; | 26 | import { test } from "vitest"; |
| 27 | import assert from "node:assert"; | 27 | import assert from "node:assert"; |
| 28 | import * as mime from "@clo/lib/mime"; | 28 | import * as mime from "./mime.ts"; |
lib/package.json+4| ... | @@ -1,5 +1,9 @@ | ... | @@ -1,5 +1,9 @@ |
| 1 | { | 1 | { |
| 2 | "name": "@clo/lib", | 2 | "name": "@clo/lib", |
| 3 | "type": "module", | 3 | "type": "module", |
| 4 | "dependencies": { | ||
| 5 | "@types/node": "^24.0.0", | ||
| 6 | "@clo/lib": "file:." | ||
| 7 | }, | ||
| 4 | "exports": { "./*": "./*.ts" } | 8 | "exports": { "./*": "./*.ts" } |
| 5 | } | 9 | } |
lib/progress.test.ts+5-5| ... | @@ -235,10 +235,10 @@ function cleanProgressEvent(event: progress.StreamEvent) { | ... | @@ -235,10 +235,10 @@ function cleanProgressEvent(event: progress.StreamEvent) { |
| 235 | 235 | ||
| 236 | type EncodedKey = typeof progress.internals.EncodedKey; | 236 | type EncodedKey = typeof progress.internals.EncodedKey; |
| 237 | 237 | ||
| 238 | import * as progress from "@clo/lib/progress"; | 238 | import * as progress from "./progress.ts"; |
| 239 | import { describe, test, vi } from "vitest"; | 239 | import { describe, test, vi } from "vitest"; |
| 240 | import assert from "node:assert/strict"; | 240 | import assert from "node:assert/strict"; |
| 241 | import * as stream from "@clo/lib/stream"; | 241 | import * as stream from "./stream.ts"; |
| 242 | import * as testing from "@clo/lib/testing"; | 242 | import * as testing from "./testing.ts"; |
| 243 | import * as ansi from "@clo/lib/string/ansi"; | 243 | import * as ansi from "./string/ansi.ts"; |
| 244 | import { UNWRAP } from "@clo/lib/assert"; | 244 | import { UNWRAP } from "./assert.ts"; |
lib/progress.ts+10-10| ... | @@ -1768,13 +1768,13 @@ export const internals: { | ... | @@ -1768,13 +1768,13 @@ export const internals: { |
| 1768 | EncodedKey: 0 as EncodedKey, | 1768 | EncodedKey: 0 as EncodedKey, |
| 1769 | }))(); | 1769 | }))(); |
| 1770 | 1770 | ||
| 1771 | import * as ansi from "@clo/lib/string/ansi"; | 1771 | import * as ansi from "./string/ansi.ts"; |
| 1772 | import * as async from "@clo/lib/async"; | 1772 | import * as async from "./async.ts"; |
| 1773 | import * as bytes from "@clo/lib/bytes"; | 1773 | import * as bytes from "./bytes.ts"; |
| 1774 | import * as log from "@clo/lib/log"; | 1774 | import * as log from "./log.ts"; |
| 1775 | import * as stack from "@clo/lib/log/stack"; | 1775 | import * as stack from "./log/stack.ts"; |
| 1776 | import * as stream from "@clo/lib/stream"; | 1776 | import * as stream from "./stream.ts"; |
| 1777 | import * as string from "@clo/lib/string"; | 1777 | import * as string from "./string.ts"; |
| 1778 | import * as ts from "@clo/lib/ts"; | 1778 | import * as ts from "./ts.ts"; |
| 1779 | import { ASSERT, UNWRAP } from "@clo/lib/assert"; | 1779 | import { ASSERT, UNWRAP } from "./assert.ts"; |
| 1780 | import { Events } from "@clo/lib/Events"; | 1780 | import { Events } from "./Events.ts"; |
lib/queue.ts+1-1| ... | @@ -176,4 +176,4 @@ function insertSorted<T extends { priority: number }>(arr: T[], item: T) { | ... | @@ -176,4 +176,4 @@ function insertSorted<T extends { priority: number }>(arr: T[], item: T) { |
| 176 | declare var navigator: { hardwareConcurrency: number }; | 176 | declare var navigator: { hardwareConcurrency: number }; |
| 177 | const global = new PriorityQueue(navigator.hardwareConcurrency); | 177 | const global = new PriorityQueue(navigator.hardwareConcurrency); |
| 178 | 178 | ||
| 179 | import { UNWRAP } from "@clo/lib/assert"; | 179 | import { UNWRAP } from "./assert.ts"; |
lib/render.ts+1-1| ... | @@ -476,4 +476,4 @@ const kRaw = Symbol("Raw"); | ... | @@ -476,4 +476,4 @@ const kRaw = Symbol("Raw"); |
| 476 | /** secret key to facilitate {@linkcode init} with a `ContextValue[]` */ | 476 | /** secret key to facilitate {@linkcode init} with a `ContextValue[]` */ |
| 477 | const kContext: unique symbol = Symbol(); | 477 | const kContext: unique symbol = Symbol(); |
| 478 | 478 | ||
| 479 | import { ASSERT, UNWRAP } from "@clo/lib/assert"; | 479 | import { ASSERT, UNWRAP } from "./assert.ts"; |
lib/render/jsx-runtime.ts+2-2| ... | @@ -77,5 +77,5 @@ export declare namespace ts { | ... | @@ -77,5 +77,5 @@ export declare namespace ts { |
| 77 | export type ElementClass = ReturnType<render.Component>; | 77 | export type ElementClass = ReturnType<render.Component>; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | import * as render from "@clo/lib/render"; | 80 | import * as render from "../render.ts"; |
| 81 | import { ASSERT } from "@clo/lib/assert"; | 81 | import { ASSERT } from "../assert.ts"; |
lib/render/meta.test.tsx+1-1| ... | @@ -46,4 +46,4 @@ test("automatic embed with '{}'", () => | ... | @@ -46,4 +46,4 @@ test("automatic embed with '{}'", () => |
| 46 | 46 | ||
| 47 | import { test } from "vitest"; | 47 | import { test } from "vitest"; |
| 48 | import assert from "node:assert"; | 48 | import assert from "node:assert"; |
| 49 | import * as meta from "@clo/lib/render/meta"; | 49 | import * as meta from "./meta.ts"; |
lib/render/meta.ts+2-2| ... | @@ -253,5 +253,5 @@ function attr(value: string) { | ... | @@ -253,5 +253,5 @@ function attr(value: string) { |
| 253 | return render.quoteIfNeeded(esc(value)); | 253 | return render.quoteIfNeeded(esc(value)); |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | import { escapeHtmlContent as esc } from "@clo/lib/render"; | 256 | import { escapeHtmlContent as esc } from "../render.ts"; |
| 257 | import * as render from "@clo/lib/render"; | 257 | import * as render from "../render.ts"; |
lib/stream.test.ts+1-1| ... | @@ -227,4 +227,4 @@ describe("BufferedReader", () => { | ... | @@ -227,4 +227,4 @@ describe("BufferedReader", () => { |
| 227 | 227 | ||
| 228 | import { describe, test } from "vitest"; | 228 | import { describe, test } from "vitest"; |
| 229 | import { strict as assert } from "node:assert"; | 229 | import { strict as assert } from "node:assert"; |
| 230 | import * as stream from "@clo/lib/stream"; | 230 | import * as stream from "./stream.ts"; |
lib/stream.ts+2-2| ... | @@ -472,5 +472,5 @@ export function readWritePair(): [ | ... | @@ -472,5 +472,5 @@ export function readWritePair(): [ |
| 472 | return [reader, unbuffered]; | 472 | return [reader, unbuffered]; |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | import * as string from "@clo/lib/string"; | 475 | import * as string from "./string.ts"; |
| 476 | import { ASSERT, UNWRAP } from "@clo/lib/assert"; | 476 | import { ASSERT, UNWRAP } from "./assert.ts"; |
lib/string.test.ts+1-1| ... | @@ -48,4 +48,4 @@ test.todo("formatByteSize", () => { | ... | @@ -48,4 +48,4 @@ test.todo("formatByteSize", () => { |
| 48 | 48 | ||
| 49 | import { test } from "vitest"; | 49 | import { test } from "vitest"; |
| 50 | import assert from "node:assert"; | 50 | import assert from "node:assert"; |
| 51 | import * as string from "@clo/lib/string"; | 51 | import * as string from "./string.ts"; |
lib/string/ansi.test.ts+1-1| ... | @@ -21,4 +21,4 @@ test("trimForTerminal", () => { | ... | @@ -21,4 +21,4 @@ test("trimForTerminal", () => { |
| 21 | 21 | ||
| 22 | import { test } from "vitest"; | 22 | import { test } from "vitest"; |
| 23 | import assert from "node:assert"; | 23 | import assert from "node:assert"; |
| 24 | import * as ansi from "@clo/lib/string/ansi"; | 24 | import * as ansi from "./ansi.ts"; |
lib/string/ansi.ts+2-2| ... | @@ -407,5 +407,5 @@ function segmentWidth(segment: string) { | ... | @@ -407,5 +407,5 @@ function segmentWidth(segment: string) { |
| 407 | ); | 407 | ); |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | import * as self from "@clo/lib/string/ansi"; | 410 | import * as self from "./ansi.ts"; |
| 411 | import { UNWRAP } from "@clo/lib/assert"; | 411 | import { UNWRAP } from "../assert.ts"; |
lib/subprocess/ffmpeg.ts+3-3| ... | @@ -195,6 +195,6 @@ import * as readline from "node:readline"; | ... | @@ -195,6 +195,6 @@ import * as readline from "node:readline"; |
| 195 | import * as process from "node:process"; | 195 | import * as process from "node:process"; |
| 196 | import events from "node:events"; | 196 | import events from "node:events"; |
| 197 | import * as path from "node:path"; | 197 | import * as path from "node:path"; |
| 198 | import * as subprocess from "@clo/lib/subprocess"; | 198 | import * as subprocess from "../subprocess.ts"; |
| 199 | import type * as progress from "@clo/lib/progress"; | 199 | import type * as progress from "../progress.ts"; |
| 200 | import * as string from "@clo/lib/string"; | 200 | import * as string from "../string.ts"; |
lib/testing.ts+5-5| ... | @@ -334,8 +334,8 @@ export class MockScreen implements Disposable, log.WidgetHost { | ... | @@ -334,8 +334,8 @@ export class MockScreen implements Disposable, log.WidgetHost { |
| 334 | } | 334 | } |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | import * as ansi from "@clo/lib/string/ansi"; | 337 | import * as ansi from "./string/ansi.ts"; |
| 338 | import { ASSERT, UNWRAP } from "@clo/lib/assert"; | 338 | import { ASSERT, UNWRAP } from "./assert.ts"; |
| 339 | import * as log from "@clo/lib/log"; | 339 | import * as log from "./log.ts"; |
| 340 | import * as async from "@clo/lib/async"; | 340 | import * as async from "./async.ts"; |
| 341 | import * as stack from "@clo/lib/log/stack"; | 341 | import * as stack from "./log/stack.ts"; |