From 29751666e4e62269bc3f48767bf726ac5789ced7 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Thu, 6 Nov 2025 22:38:54 -0800 Subject: [PATCH] chore: death to lib's import map this allows usage of `@clo/lib` via HTTPs imports. --- lib/Lru.test.ts | 2 +- lib/Lru.ts | 4 ++-- lib/async.ts | 2 +- lib/deno.json | 2 -- lib/error.ts | 2 +- lib/log.test.ts | 2 +- lib/log.ts | 12 ++++++------ lib/log/stack.ts | 4 ++-- lib/progress.ts | 9 ++++----- lib/queue.ts | 2 +- lib/render.ts | 2 +- lib/render/jsx-runtime.ts | 4 ++-- lib/render/meta.test.tsx | 2 +- lib/render/meta.ts | 4 ++-- lib/string.test.ts | 2 +- lib/string/ansi.ts | 4 ++-- lib/subprocess/ffmpeg.ts | 4 ++-- 17 files changed, 30 insertions(+), 33 deletions(-) diff --git a/lib/Lru.test.ts b/lib/Lru.test.ts index b80fc4d4f6dcc7d5f7131e1851c545b73d96f09d..003a250e6874d6c481eeae108263bf2383424520 100644 --- a/lib/Lru.test.ts +++ b/lib/Lru.test.ts @@ -135,4 +135,4 @@ test("throws on evicting a locked item", () => { import assert from "node:assert"; import { test } from "node:test"; -import { Lru } from "lib/Lru.ts"; +import { Lru } from "./Lru.ts"; diff --git a/lib/Lru.ts b/lib/Lru.ts index 7716386975db3b21f75d2bab3b041095a34c10c3..ca457740b45b76809704b49e26b63962547972c2 100644 --- a/lib/Lru.ts +++ b/lib/Lru.ts @@ -269,5 +269,5 @@ export declare namespace Lru { const none: unique symbol = Symbol(); type none = typeof none; -import { ASSERT, UNWRAP } from "lib/assert.ts"; -import * as ts from "lib/ts.ts"; +import { ASSERT, UNWRAP } from "./assert.ts"; +import * as ts from "./ts.ts"; diff --git a/lib/async.ts b/lib/async.ts index 41f0e82ab7dc2e65183c1e69edd79760ec155453..e0ae0df70890116dcd175304c35493c7b6991775 100644 --- a/lib/async.ts +++ b/lib/async.ts @@ -204,4 +204,4 @@ export class PromiseAggregator { } } -import { ASSERT } from "lib/assert.ts"; +import { ASSERT } from "./assert.ts"; diff --git a/lib/deno.json b/lib/deno.json index c30b6c44f84093bc7e6079bdf270a282ebbee992..dcc4816eb0bf1eefb7eb62746e6b28168744277a 100644 --- a/lib/deno.json +++ b/lib/deno.json @@ -29,7 +29,6 @@ "jsxImportSource": "lib/render" }, "imports": { - "lib/": "./", "lib/render/jsx-runtime": "./render/jsx-runtime.ts", "lib/render/jsx-dev-runtime": "./render/jsx-runtime.ts" }, @@ -38,4 +37,3 @@ "deno.lock" ] } - diff --git a/lib/error.ts b/lib/error.ts index 1c2817b0c8a10ac3331d3207cd251d33ef14eba6..c95cef98a56c63c6a7fa4be74430d92d9cc13ded 100644 --- a/lib/error.ts +++ b/lib/error.ts @@ -47,4 +47,4 @@ export function rethrowWithMetadata( throw error; } -import type * as node from "lib/node.ts"; +import type * as node from "./node.ts"; diff --git a/lib/log.test.ts b/lib/log.test.ts index 35aeeb1821d3747e76ad2d3d85bbeb5c6ef78328..65559bbcef81a272a595233fde3b1b6dfea9895f 100644 --- a/lib/log.test.ts +++ b/lib/log.test.ts @@ -161,4 +161,4 @@ class TestWidgetHost implements headless.WidgetHost { } } -import * as ansi from "lib/string/ansi.ts"; +import * as ansi from "./string/ansi.ts"; diff --git a/lib/log.ts b/lib/log.ts index 7fc7751aaf9914286c8a3548ff39f42175255d48..92878f9e5caceb3b47e82530e1344fb5e8e23e93 100644 --- a/lib/log.ts +++ b/lib/log.ts @@ -626,9 +626,9 @@ export interface DispatchFunction { (message: Message): void; } -import * as ansi from "lib/string/ansi.ts"; -import * as node from "lib/node.ts"; -import * as stack from "lib/log/stack.ts"; -import * as string from "lib/string.ts"; -import * as ts from "lib/ts.ts"; -import { UNWRAP } from "lib/assert.ts"; +import * as ansi from "./string/ansi.ts"; +import * as node from "./node.ts"; +import * as stack from "./log/stack.ts"; +import * as string from "./string.ts"; +import * as ts from "./ts.ts"; +import { UNWRAP } from "./assert.ts"; diff --git a/lib/log/stack.ts b/lib/log/stack.ts index 9fe72879dd165668a41b3dc805a70930c1f1b2be..3122b33b501b9a60494ffab906a2cc5e55584768 100644 --- a/lib/log/stack.ts +++ b/lib/log/stack.ts @@ -426,5 +426,5 @@ const regexFunctionName = /((.*".+"[^@]*)?[^@]*)(?:@)/; const regexV8Stack = /^\s*at .*(\S+:\d+|\(native\))/m; const regexLocation = /(.+?)(?::(\d+))?(?::(\d+))?$/; -import * as ansi from "lib/string/ansi.ts"; -import * as node from "lib/node.ts"; +import * as ansi from "../string/ansi.ts"; +import * as node from "../node.ts"; diff --git a/lib/progress.ts b/lib/progress.ts index ba31486a317e3d133f2cd3e517031df73ac7f5da..e1b686670f408c94e05ef11537151fbdcdb0d106 100644 --- a/lib/progress.ts +++ b/lib/progress.ts @@ -407,8 +407,7 @@ export class Headless { const global = /** @__PURE__ */ new Headless(log); -import * as process from "node:process"; -import * as log from "lib/log.ts"; -import * as ansi from "lib/string/ansi.ts"; -import * as string from "lib/string.ts"; -import { ASSERT, UNWRAP } from "lib/assert.ts"; +import * as log from "./log.ts"; +import * as ansi from "./string/ansi.ts"; +import * as string from "./string.ts"; +import { ASSERT, UNWRAP } from "./assert.ts"; diff --git a/lib/queue.ts b/lib/queue.ts index aedbeeca36c6147062242d43e4b01523d883643e..2432fdec4f4b7b840442863421ee49bb835de15b 100644 --- a/lib/queue.ts +++ b/lib/queue.ts @@ -176,4 +176,4 @@ function insertSorted(arr: T[], item: T) { declare var navigator: { hardwareConcurrency: number }; const global = new PriorityQueue(navigator.hardwareConcurrency); -import { UNWRAP } from "lib/assert.ts"; +import { UNWRAP } from "./assert.ts"; diff --git a/lib/render.ts b/lib/render.ts index bf70fc98de65366114786764832d6a351f5b55c2..2c8093d86a2a967f4e0041b7f9d677dbcc87a556 100644 --- a/lib/render.ts +++ b/lib/render.ts @@ -464,4 +464,4 @@ const kRaw = Symbol("Raw"); /** secret key to facilitate {@linkcode init} with a `ContextValue[]` */ const kContext: unique symbol = Symbol(); -import { ASSERT, UNWRAP } from "lib/assert.ts"; +import { ASSERT, UNWRAP } from "./assert.ts"; diff --git a/lib/render/jsx-runtime.ts b/lib/render/jsx-runtime.ts index b0df60f1bef0fdb47440f0944b374d1e04c35b60..71d6900f11fce596389bd3bb58ffe64b02b7a963 100644 --- a/lib/render/jsx-runtime.ts +++ b/lib/render/jsx-runtime.ts @@ -75,5 +75,5 @@ export type Element = render.Element; export type ElementType = keyof IntrinsicElements | render.Component; export type ElementClass = ReturnType; -import * as render from "lib/render.ts"; -import { ASSERT } from "lib/assert.ts"; +import * as render from "../render.ts"; +import { ASSERT } from "../assert.ts"; diff --git a/lib/render/meta.test.tsx b/lib/render/meta.test.tsx index 8ac85e3d9b02cc2b486c4d0878686d1a63540e75..945d636083e412035640031d4db102224e27ae44 100644 --- a/lib/render/meta.test.tsx +++ b/lib/render/meta.test.tsx @@ -46,4 +46,4 @@ test("automatic embed with '{}'", () => import { test } from "node:test"; import assert from "node:assert"; -import * as meta from "lib/render/meta.ts"; +import * as meta from "./meta.ts"; diff --git a/lib/render/meta.ts b/lib/render/meta.ts index 10a962f2638ac91029f36715d6918b5422ebf77b..c709399a190b4ec50a4c3164fca7bbd6b0a7f064 100644 --- a/lib/render/meta.ts +++ b/lib/render/meta.ts @@ -251,5 +251,5 @@ function attr(value: string) { return render.quoteIfNeeded(esc(value)); } -import { escapeHtmlContent as esc } from "lib/render.ts"; -import * as render from "lib/render.ts"; +import { escapeHtmlContent as esc } from "../render.ts"; +import * as render from "../render.ts"; diff --git a/lib/string.test.ts b/lib/string.test.ts index f6184a3fff465ef1000171c7a4c13c4adc42a088..1f9be414a6d02ba777e6076c0933c8c36787046b 100644 --- a/lib/string.test.ts +++ b/lib/string.test.ts @@ -32,4 +32,4 @@ test("escapeShellArgument", () => { import { test } from "node:test"; import assert from "node:assert"; -import * as string from "lib/string.ts"; +import * as string from "./string.ts"; diff --git a/lib/string/ansi.ts b/lib/string/ansi.ts index 4a54b671115034de86891b2fe6384f57ba2253c1..b3882d22686c0f9d6b15c61f698f93026feaa758 100644 --- a/lib/string/ansi.ts +++ b/lib/string/ansi.ts @@ -378,5 +378,5 @@ function segmentWidth(segment: string) { ); } -import * as self from "lib/string/ansi.ts"; -import { UNWRAP } from "lib/assert.ts"; +import * as self from "./ansi.ts"; +import { UNWRAP } from "../assert.ts"; diff --git a/lib/subprocess/ffmpeg.ts b/lib/subprocess/ffmpeg.ts index 518cbd5d422b046300575d2fe6237f80d5ffb97c..9e8db036318bf0adb8a8f3088c9fabf474023f3e 100644 --- a/lib/subprocess/ffmpeg.ts +++ b/lib/subprocess/ffmpeg.ts @@ -194,5 +194,5 @@ import * as readline from "node:readline"; import * as process from "node:process"; import events from "node:events"; import * as path from "node:path"; -import type * as progress from "lib/progress.ts"; -import * as string from "lib/string.ts"; +import type * as progress from "../progress.ts"; +import * as string from "../string.ts"; -- 2.54.0