From 367f564c813bfada851a56e3d80a2bb51fa9fd6d Mon Sep 17 00:00:00 2001 From: clover caruso Date: Mon, 29 Sep 2025 01:13:10 -0700 Subject: [PATCH] chore(lib): publish to jsr and npm https://jsr.io/@clo/lib https://www.npmjs.com/package/@paperclover/lib --- .gitignore | 1 + lib/assert.ts | 4 +- lib/deno.json | 24 ++- lib/deno.lock | 156 +++++++++++++++++- lib/log.ts | 4 + lib/log/ansi.ts | 2 +- lib/log/headless.ts | 9 +- lib/log/progress.sample.ts | 2 +- lib/log/progress.ts | 37 +++-- lib/log/stack.ts | 20 ++- lib/packaging.ts | 131 +++++++++++++++ lib/readme.changes.md | 10 ++ lib/readme.md | 26 ++- lib/readme.npm.md | 49 ++++++ package-lock.json | 327 +++++++++++++++++++++++++++++++++++++ package.json | 1 + tsconfig.json | 3 +- 17 files changed, 755 insertions(+), 51 deletions(-) create mode 100644 lib/packaging.ts create mode 100644 lib/readme.changes.md create mode 100644 lib/readme.npm.md diff --git a/.gitignore b/.gitignore index fd1566add4482bd0d91a343a6c7c7c44361799c9..1b17dce145df182acc1692ee112b80db4f8240ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .clover .env +lib/dist-npm node_modules diff --git a/lib/assert.ts b/lib/assert.ts index 7def4c49a2e204a609525530c29613d9cb17472e..34a4c72b01b779553822de0959cd891c3a2c95a5 100644 --- a/lib/assert.ts +++ b/lib/assert.ts @@ -8,7 +8,7 @@ export function ASSERT(condition: boolean, msg?: Message): asserts condition { } /** Assert that `nullable` is non-null, returning a non-nullable T */ -export function UNWRAP(nullable: T | null | undefined, msg?: Message) { +export function UNWRAP(nullable: T | null | undefined, msg?: Message): T { if (nullable == null) { throw new Error( `Unexpected ${nullable}${msg ? `: ${messageToString(msg)}` : ""}`, @@ -18,7 +18,7 @@ export function UNWRAP(nullable: T | null | undefined, msg?: Message) { } /** Assert that `number` is not NaN */ -export function FINITE(number: number, msg?: Message) { +export function FINITE(number: number, msg?: Message): number { if (Number.isNaN(number)) { throw new Error(`Unexpected NaN${msg ? `: ${messageToString(msg)}` : ""}`); } diff --git a/lib/deno.json b/lib/deno.json index c476596c5b96e46d7779c742de58cbbb9cb0549e..7d582025b455d4b832c764c75c99b39f7294a246 100644 --- a/lib/deno.json +++ b/lib/deno.json @@ -1,16 +1,24 @@ { "name": "@clo/lib", + "description": "", "version": "1.0.0", "license": "MIT", "exports": { - "./log": "./log.ts", - "./log/ansi": "./log/ansi.ts", - "./log/headless": "./log/headless.ts", - "./queue": "./queue.ts", - "./string": "./string.ts", - "./ts": "./ts.ts" + "./assert.ts": "./assert.ts", + "./log.ts": "./log.ts", + "./log/ansi.ts": "./log/ansi.ts", + "./log/headless.ts": "./log/headless.ts", + "./log/progress.ts": "./log/progress.ts", + "./log/stack.ts": "./log/stack.ts", + "./packaging.ts": "./packaging.ts", + "./queue.ts": "./queue.ts", + "./string.ts": "./string.ts", + "./ts.ts": "./ts.ts" }, "imports": { "lib/": "./" - } -} + }, + "exclude": [ + "readme.npm.md" + ] +} \ No newline at end of file diff --git a/lib/deno.lock b/lib/deno.lock index 9b2906da8b9572972445b7e0e70a1a53ccd90b56..82ef046ffa510d16beae371abe1aa574e77739a3 100644 --- a/lib/deno.lock +++ b/lib/deno.lock @@ -1,15 +1,169 @@ { "version": "5", "specifiers": { - "npm:@types/node@*": "24.2.0" + "npm:@types/node@*": "24.2.0", + "npm:ts-to-jsdoc@2.4.0": "2.4.0" }, "npm": { + "@nodelib/fs.scandir@2.1.5": { + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": [ + "@nodelib/fs.stat", + "run-parallel" + ] + }, + "@nodelib/fs.stat@2.0.5": { + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + }, + "@nodelib/fs.walk@1.2.8": { + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": [ + "@nodelib/fs.scandir", + "fastq" + ] + }, + "@ts-morph/common@0.24.0": { + "integrity": "sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==", + "dependencies": [ + "fast-glob", + "minimatch", + "mkdirp", + "path-browserify" + ] + }, "@types/node@24.2.0": { "integrity": "sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==", "dependencies": [ "undici-types" ] }, + "arg@5.0.2": { + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" + }, + "balanced-match@1.0.2": { + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion@2.0.2": { + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dependencies": [ + "balanced-match" + ] + }, + "braces@3.0.3": { + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": [ + "fill-range" + ] + }, + "code-block-writer@13.0.3": { + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==" + }, + "fast-glob@3.3.3": { + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dependencies": [ + "@nodelib/fs.stat", + "@nodelib/fs.walk", + "glob-parent", + "merge2", + "micromatch" + ] + }, + "fastq@1.19.1": { + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dependencies": [ + "reusify" + ] + }, + "fill-range@7.1.1": { + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": [ + "to-regex-range" + ] + }, + "glob-parent@5.1.2": { + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": [ + "is-glob" + ] + }, + "is-extglob@2.1.1": { + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob@4.0.3": { + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": [ + "is-extglob" + ] + }, + "is-number@7.0.0": { + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "merge2@1.4.1": { + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, + "micromatch@4.0.8": { + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dependencies": [ + "braces", + "picomatch" + ] + }, + "minimatch@9.0.5": { + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": [ + "brace-expansion" + ] + }, + "mkdirp@3.0.1": { + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "bin": true + }, + "path-browserify@1.0.1": { + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "picomatch@2.3.1": { + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "queue-microtask@1.2.3": { + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "reusify@1.1.0": { + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==" + }, + "run-parallel@1.2.0": { + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dependencies": [ + "queue-microtask" + ] + }, + "to-regex-range@5.0.1": { + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": [ + "is-number" + ] + }, + "ts-morph@23.0.0": { + "integrity": "sha512-FcvFx7a9E8TUe6T3ShihXJLiJOiqyafzFKUO4aqIHDUCIvADdGNShcbc2W5PMr3LerXRv7mafvFZ9lRENxJmug==", + "dependencies": [ + "@ts-morph/common", + "code-block-writer" + ] + }, + "ts-to-jsdoc@2.4.0": { + "integrity": "sha512-RiI9ipxkLjXESp5+YjXIQJ5GgtjwWTZU4uDahxsIdr1HKLFaC/nQOtgkGRJ+AFxqHrrhwrXtPh093r0nXQwKmw==", + "dependencies": [ + "arg", + "ts-morph" + ], + "optionalDependencies": [ + "typescript" + ], + "bin": true + }, + "typescript@5.9.2": { + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "bin": true + }, "undici-types@7.10.0": { "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==" } diff --git a/lib/log.ts b/lib/log.ts index f6d8395fe68f73c36ae289e63a7e18f03ffb28c6..4351d7a58c6bfb31f0381d096b3a53513b3c1916 100644 --- a/lib/log.ts +++ b/lib/log.ts @@ -10,6 +10,10 @@ export function warn(...args: unknown[]) { export function error(...args: unknown[]) { globalLog.error(...args); } +/** debugging */ +export function debug(...args: unknown[]) { + globalLog(...args); +} export interface Scope { /** default call signature is informational scope */ diff --git a/lib/log/ansi.ts b/lib/log/ansi.ts index 0986cc9460a99164b842cf8e9769dd6a6f4227e6..f991b3f8bf9a7dc16fd00a63b9b8a2123154644c 100644 --- a/lib/log/ansi.ts +++ b/lib/log/ansi.ts @@ -128,4 +128,4 @@ export function debugAnsi(text: string): string { return text; } -import * as self from "./ansi.ts"; +import * as self from "lib/log/ansi.ts"; diff --git a/lib/log/headless.ts b/lib/log/headless.ts index 75cfeabfe1c571b74dbcfb26a333a520659d5a0c..1020fcd93a85c313e42240bd8eb2bc2b83f38f3a 100644 --- a/lib/log/headless.ts +++ b/lib/log/headless.ts @@ -85,12 +85,7 @@ export function widgetHost(env: WidgetHostEnv): WidgetHost { let next = Infinity; if (widgets[0]) { for (let w = 0, { length } = widgets; w < length; w += 1) { - const outText = UNWRAP(widgets[w]).format({ - now: lastFlush, - columns, - rows, - colors: true, - }); + const outText = UNWRAP(widgets[w]).format(lastFlush); if (!outText) { widgets.splice(w, 1); UNWRAP(internals.splice(w, 1)[0]).unsub?.(); @@ -331,4 +326,4 @@ import * as ts from "lib/ts.ts"; import * as stack from "lib/log/stack.ts"; import * as util from "node:util"; import { UNWRAP } from "lib/assert.ts"; -import type * as log from "../log.ts"; +import type * as log from "lib/log.ts"; diff --git a/lib/log/progress.sample.ts b/lib/log/progress.sample.ts index 3fa176ceff701421bfca0dd949425f65ae191799..8386b420fb4b5e26d6c298c213494c4810c8269e 100644 --- a/lib/log/progress.sample.ts +++ b/lib/log/progress.sample.ts @@ -69,5 +69,5 @@ function random() { return Math.floor(Math.random() * 9999999).toString(32); } -import * as progress from "./progress.ts"; +import * as progress from "lib/log/progress.ts"; import * as timers from "node:timers/promises"; diff --git a/lib/log/progress.ts b/lib/log/progress.ts index b3001a26cce7f9a1262d6ee06919051be3b523f8..242da8e9bce01c4dcc7cf05e632bc47a5fe151e7 100644 --- a/lib/log/progress.ts +++ b/lib/log/progress.ts @@ -63,7 +63,12 @@ export interface Node extends Ref { } export interface StartOptions { + value?: number | undefined | null; estimate?: number | undefined | null; + passive?: boolean | undefined | null; + showEstimate?: boolean | undefined | null; + maxHeight?: number | undefined | null; + sortChildren?: Node["sortChildren"] | undefined | null; } /** a valid `Node` without any output */ @@ -103,18 +108,18 @@ type Signal = function newNode( text: string, - { estimate }: StartOptions = {}, + opts: StartOptions = {}, ): [Internal, Node] { const state: Internal = { text, - value: 0, - estimate: estimate ?? 0, - showEstimate: true, - passive: false, + value: opts.value ?? 0, + estimate: opts.estimate ?? 0, + showEstimate: opts.showEstimate ?? true, + passive: opts.passive ?? false, logs: [], children: [], parent: null, - sortChildren: null, + sortChildren: opts.sortChildren ?? null, signal() { throw new Error("no signaler"); }, @@ -225,7 +230,7 @@ function newNode( return [state, binding]; } -function format(now: number, list: Internal[]) { +function formatProgress(now: number, list: Internal[]): string { let out = ""; for (const top of list) { if (top.passive && top.children.length === 0) continue; @@ -236,15 +241,19 @@ function format(now: number, list: Internal[]) { } /** These functions are used to test `lib/log/progress` */ -export const internals = { - node(text: string, props: Partial, children: Internal[]): Internal { +export namespace internals { + export function node( + text: string, + props: Partial, + children: Internal[], + ): Internal { const [node] = newNode(text); Object.assign(node, props); node.children.push(...children); return node; - }, - format, -}; + } + export const format = formatProgress; +} const spinnerFps = 12.5; @@ -313,7 +322,7 @@ function renderChildren(state: Internal, now: number, depth: boolean[]) { * which did ffmpeg handling. It is probably one of the coolest progress bars * ever imagined. */ -export function getUnicodeBar(progress: number, width: number) { +export function getUnicodeBar(progress: number, width: number): string { if (progress >= 1) return fullBar.repeat(width); if (progress <= 0 || Number.isNaN(progress)) return " ".repeat(width); @@ -352,7 +361,7 @@ export class Headless { } widget: log.Widget = { - format: (now) => format(now, this.active), + format: (now) => formatProgress(now, this.active), onChange: ( rerender, ) => (this.#rerender = rerender, () => this.#rerender = null), diff --git a/lib/log/stack.ts b/lib/log/stack.ts index 4c8e7a70af9130044204776d5a2f39e19721dd20..b68e830c2ec2b9f54049447f553a31d766702722 100644 --- a/lib/log/stack.ts +++ b/lib/log/stack.ts @@ -32,7 +32,7 @@ export interface Frame { const regexV8Stack = /^\s*at .*(\S+:\d+|\(native\))/m; const regexLocation = /(.+?)(?::(\d+))?(?::(\d+))?$/; -export function parse(error: Error): null | Frame[] { +export function parse(error: Error): Frame[] | null { const stack = error?.stack; if (typeof stack === "string") { if (stack.match(regexV8Stack)) { @@ -43,7 +43,7 @@ export function parse(error: Error): null | Frame[] { return null; } -export function format(error: Error, colors = false) { +export function format(error: Error, colors = false): string { const { name, message, stack: _, ...payload } = error; const headingLine = (colors ? ansi.fgRed : "") + @@ -63,11 +63,10 @@ export function format(error: Error, colors = false) { if ("Bun" in globalThis) { frames = frames.filter((frame) => frame.file !== "native" || ![ - "moduleEvaluation", "moduleEvaluation", "loadAndEvaluateModule", "processTicksAndRejections", - ].includes(frame.fn) + ].includes(frame.fn ?? "") ); } if (frames.length) { @@ -77,7 +76,10 @@ export function format(error: Error, colors = false) { return headingLine + payloadLines + frameLines + "\n"; } -export function formatFrame({ fn, file, line, col }: Frame, colors: boolean) { +export function formatFrame( + { fn, file, line, col }: Frame, + colors: boolean, +): string { let out = ""; if (file === "native") file = null; const internal = !file || file.startsWith("node:") || @@ -102,7 +104,7 @@ export function formatFrame({ fn, file, line, col }: Frame, colors: boolean) { if (colors) { if (root) { - const [pathTo, project, sub] = root; + const [pathTo, project] = root; out += ansi.dim + pathTo + ansi.mergeStyles(ansi.resetWeight + ansi.fgCyan) + project + ansi.fgReset; @@ -312,7 +314,7 @@ function parseV8OrIe(stack: string): Frame[] { : locationParts[0]; return { - fn: functionName, + fn: functionName ?? null, file: fileName, line: 0 | locationParts[1], col: 0 | locationParts[2], @@ -322,8 +324,8 @@ function parseV8OrIe(stack: string): Frame[] { function parseJscOrSpidermonkey(stack: string): Frame[] { // Using string literal "\n" does not work in Safari. - return stack.split(/\n/g).map((source, i) => { - let fn = ""; + return stack.split(/\n/g).map((source) => { + let fn: string | null = ""; let file: string | null = null; let line: number | null = null; let col: number | null = null; diff --git a/lib/packaging.ts b/lib/packaging.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b642282f1876724551d79e6af83d7aee92ebbb6 --- /dev/null +++ b/lib/packaging.ts @@ -0,0 +1,131 @@ +// Tools that `lib` uses to package itself for NPM. +// This depends on an installation of `ts-to-jsdoc` available as a resolvable node module. + +export async function updateJsrPackageExportsToAll( + absPath: string, + p: progress.Ref, +) { + using _ = p.start("update deno.json"); + const manifestPath = path.join(absPath, "deno.json"); + const deno = JSON.parse( + await fs.readFile(manifestPath, "utf-8"), + ); + const newExports: Record = {}; + for (const subPath of await fs.readdir(absPath, { recursive: true })) { + if (!subPath.match(/\.tsx?$/)) continue; + if (subPath.match(/\.(test|sample)\.tsx?$/)) continue; + if (subPath.startsWith("dist")) continue; + newExports["./" + subPath] = "./" + subPath; + } + deno.exports = Object.fromEntries( + Object.entries(newExports).sort(([a], [b]) => a.localeCompare(b)), + ) as typeof deno.exports; + await fs.writeFile(manifestPath, JSON.stringify(deno, null, 2)); +} + +interface TsToJsdoc { + transpileFile: (opts: { code: string }) => string; +} + +export async function transpileForNpm( + absPath: string, + p: progress.Ref, + packageJson: Record, + tsToJsdoc?: TsToJsdoc, +) { + try { + // @ts-expect-error optional dependency + tsToJsdoc ??= await import("ts-to-jsdoc") as TsToJsdoc; + } catch { + // @ts-expect-error unsupported import specifier + tsToJsdoc ??= await import("npm:ts-to-jsdoc@2.4.0") as TsToJsdoc; + } + const { transpileFile } = tsToJsdoc; + + using node = p.start("transpile into jsdoc for npm"); + const manifestPath = path.join(absPath, "deno.json"); + const deno = JSON.parse( + await fs.readFile(manifestPath, "utf-8"), + ); + const distPath = path.join(absPath, "dist-npm"); + await fs.rm(distPath, { recursive: true, force: true }); + await fs.mkdir(distPath, { recursive: true }); + + const files: string[] = []; + const exports: Record = {}; + for (const subPath of await fs.readdir(absPath, { recursive: true })) { + if (!subPath.match(/\.tsx?$/)) continue; + if (subPath.startsWith("dist")) continue; + files.push(subPath); + } + node.estimate = Object.keys(exports).length; + for (const subPath of files) { + using _ = node.start(subPath); + const targetSubPath = subPath.replace(/\.tsx?$/, ".js"); + if (!subPath.match(/\.(test|sample)\.tsx?$/)) { + exports["./" + subPath] = "./" + targetSubPath; + } + + let code = transpileFile({ + code: await fs.readFile(path.join(absPath, subPath), "utf-8"), + }); + code = code.replace( + / from "lib\/([^"]+)"/g, + (_, src) => { + return ' from "./' + path.relative( + path.dirname(subPath), + src.replace(/\.tsx?$/, ".js"), + ) + '"'; + }, + ); + if (packageJson.homepage) { + code = + "// This file is transpiled from TypeScript from paper clover's sitegen\n" + + "// " + packageJson.homepage + "/" + subPath + "\n" + + code; + } + const out = path.join(distPath, targetSubPath); + await fs.mkdir(path.dirname(out), { recursive: true }); + await fs.writeFile(out, code); + node.value += 1; + } + await fs.cp( + path.join(absPath, "readme.npm.md"), + path.join(distPath, "readme.md"), + ).catch((e) => { + if (e.code !== "ENOENT") throw e; + }); + await fs.cp( + path.join(absPath, "readme.changes.md"), + path.join(distPath, "readme.changes.md"), + ).catch((e) => { + if (e.code !== "ENOENT") throw e; + }); + const { name, description, ...rest } = packageJson; + await fs.writeFile( + path.join(distPath, "package.json"), + JSON.stringify({ + name, + description, + version: deno.version, + type: "module", + ...rest, + }), + ); +} + +if (import.meta.main) { + updateJsrPackageExportsToAll(import.meta.dirname!, progress) + .then(() => + transpileForNpm(import.meta.dirname!, progress, { + name: "@paperclover/lib", + description: "high quality typescript libraries", + homepage: + "https://git.paperclover.net/clo/sitegen/src/branch/master/lib", + }) + ); +} + +import * as progress from "lib/log/progress.ts"; +import * as path from "node:path"; +import * as fs from "node:fs/promises"; diff --git a/lib/readme.changes.md b/lib/readme.changes.md new file mode 100644 index 0000000000000000000000000000000000000000..405df536dd637ea45e527f24040a71370ef01a9f --- /dev/null +++ b/lib/readme.changes.md @@ -0,0 +1,10 @@ +# notable changes in clover's typescript library + +## v1 + +- new library `assert` +- new library `log` +- new library `packaging` +- new library `queue` +- new library `string` +- new library `ts` diff --git a/lib/readme.md b/lib/readme.md index f5bb34035f010cc333f79fd303c7da85e2ca7565..62831430c4a2e3c65fae34359a43d7f076114dbf 100644 --- a/lib/readme.md +++ b/lib/readme.md @@ -1,12 +1,12 @@ -# clover's typescript library +# [clover's typescript library] `lib` is a collection of high-quality typescript libraries for things missing in either browsers or node.js. originally, these were helper functions used to create my website, , but i started wanting them across -projects. +projects and at work. all top-level namespaces stand alone as their own projects, and generally do not -depend on each other. no external dependencies == easy to audit. +depend on each other. there are no external dependencies; code is easy to audit. the public api is simply all of the code. an overview: @@ -18,15 +18,27 @@ the public api is simply all of the code. an overview: -- `string` +- `assert` - `log` - logging, terminal i/o, interactive widgets - `log/ansi` - cursor and color constants - `log/headless` - use `log` and `log/progress` without a tty - `log/progress` - progress bar, spinner, and tree +- `log/stack` - stack trace parse and formatter +- `packaging` - workflows used for `lib`'s publications +- `queue` - priority queue with rescheduling +- `string` - `ts` typescript types and general purpose code these libraries are published as is, **without versioning or maintainance -guarantees**. note that on package registries where a semantic version is -required, a major version bump is done on each publication. +guarantees**. every version is a breaking major release. please upgrade your +libraries with intent, considering api changes in [readme.changes.md]. +individual modules may annotate their intended api and usage stability. -to contribute bug fixes, please send patches to . +keep in mind there are [known bugs and missing features] in this release. + +to contribute, please send bug reports or patches to . new +features may not be accepted if they are complex and don't further my use cases. + +[readme.changes.md]: ./readme.changes.md +[known bugs and missing features]: https://git.paperclover.net/clo/sitegen/issues?state=open&labels=4 +[clover's typescript library]: https://git.paperclover.net/clo/sitegen/src/branch/master/lib diff --git a/lib/readme.npm.md b/lib/readme.npm.md new file mode 100644 index 0000000000000000000000000000000000000000..13d6e9046dae5815a01d019e87ecb3e5737de420 --- /dev/null +++ b/lib/readme.npm.md @@ -0,0 +1,49 @@ +# [clover's typescript library] + +`lib` is a collection of high-quality typescript libraries for things missing in +either browsers or node.js. originally, these were helper functions used to +create my website, , but i started wanting them across +projects and at work. + +```sh +# alias install "lib" using "@paperclover/lib" +npm install lib@npm:@paperclover/lib +``` + +all top-level namespaces stand alone as their own projects, and generally do not +depend on each other. there are no external dependencies; code is easy to audit. + +the public api is simply all of the code. an overview: + + + + + + + + + +- `assert` +- `log` - logging, terminal i/o, interactive widgets +- `log/ansi` - cursor and color constants +- `log/headless` - use `log` and `log/progress` without a tty +- `log/progress` - progress bar, spinner, and tree +- `log/stack` - stack trace parse and formatter +- `packaging` - workflows used for `lib`'s publications +- `queue` - priority queue with rescheduling +- `string` +- `ts` typescript types and general purpose code + +these libraries are published as is, **without versioning or maintainance +guarantees**. every version is a breaking major release. please upgrade your +libraries with intent, considering api changes in [readme.changes.md]. +individual modules may annotate their intended api and usage stability. + +keep in mind there are [known bugs and missing features] in this release. + +to contribute, please send bug reports or patches to . new +features may not be accepted if they are complex and don't further my use cases. + +[readme.changes.md]: ./readme.changes.md +[known bugs and missing features]: https://git.paperclover.net/clo/sitegen/issues?state=open&labels=4 +[clover's typescript library]: https://git.paperclover.net/clo/sitegen/src/branch/master/lib diff --git a/package-lock.json b/package-lock.json index 012b678a5715c8f4cad13834f5b6cbf68772c886..3bb936e327dd3e8f566abcabeb9cef998bd281c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "puppeteer": "^24.10.1", "sharp": "^0.34.2", "source-map-support": "^0.5.21", + "ts-to-jsdoc": "^2.4.0", "unique-names-generator": "^4.7.1", "vscode-oniguruma": "^2.0.1", "vscode-textmate": "^9.2.0" @@ -1560,6 +1561,41 @@ "win32" ] }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@paperclover/console": { "resolved": "git+https://git.paperclover.net/clo/console.git#1a6ac2b79fdd8a21a1c57d25723975872bc07e3e", "dependencies": { @@ -1607,6 +1643,18 @@ "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", "license": "MIT" }, + "node_modules/@ts-morph/common": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.24.0.tgz", + "integrity": "sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==", + "license": "MIT", + "dependencies": { + "fast-glob": "^3.3.2", + "minimatch": "^9.0.4", + "mkdirp": "^3.0.1", + "path-browserify": "^1.0.1" + } + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -1765,6 +1813,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "license": "MIT" + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1808,6 +1862,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, "node_modules/bare-events": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz", @@ -1895,6 +1955,27 @@ "integrity": "sha512-cRygWd7kGBQO3VEhPiTgq4Wc43ctsM+o46urrmPOiuAe+07fzlSB9OJVdpgDL0jPqXUVQ9ht7aq7kxOeJHRK+w==", "license": "MIT" }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/browserslist": { "version": "4.25.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.1.tgz", @@ -2081,6 +2162,12 @@ "node": ">=8" } }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "license": "MIT" + }, "node_modules/codemirror": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz", @@ -2633,6 +2720,31 @@ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", "license": "MIT" }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -2642,6 +2754,18 @@ "pend": "~1.2.0" } }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2689,6 +2813,18 @@ "node": ">= 14" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/hast-util-to-estree": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", @@ -2897,6 +3033,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2906,6 +3051,18 @@ "node": ">=8" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-hexadecimal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", @@ -2916,6 +3073,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-plain-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", @@ -3243,6 +3409,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/micromark": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", @@ -3839,12 +4014,55 @@ ], "license": "MIT" }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mitt": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", "license": "MIT" }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4008,6 +4226,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "license": "MIT" + }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -4020,6 +4244,18 @@ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -4121,6 +4357,26 @@ "node": ">=18" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/raptor-async": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/raptor-async/-/raptor-async-1.1.3.tgz", @@ -4289,6 +4545,39 @@ "node": ">=8" } }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/self-closing-tags": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/self-closing-tags/-/self-closing-tags-1.0.1.tgz", @@ -4598,6 +4887,18 @@ "b4a": "^1.6.4" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -4618,6 +4919,32 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/ts-morph": { + "version": "23.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-23.0.0.tgz", + "integrity": "sha512-FcvFx7a9E8TUe6T3ShihXJLiJOiqyafzFKUO4aqIHDUCIvADdGNShcbc2W5PMr3LerXRv7mafvFZ9lRENxJmug==", + "license": "MIT", + "dependencies": { + "@ts-morph/common": "~0.24.0", + "code-block-writer": "^13.0.1" + } + }, + "node_modules/ts-to-jsdoc": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-to-jsdoc/-/ts-to-jsdoc-2.4.0.tgz", + "integrity": "sha512-RiI9ipxkLjXESp5+YjXIQJ5GgtjwWTZU4uDahxsIdr1HKLFaC/nQOtgkGRJ+AFxqHrrhwrXtPh093r0nXQwKmw==", + "license": "MIT", + "dependencies": { + "arg": "^5.0.1", + "ts-morph": "^23.0.0" + }, + "bin": { + "ts-to-jsdoc": "bin/ts-to-jsdoc" + }, + "optionalDependencies": { + "typescript": "*" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", diff --git a/package.json b/package.json index ab2769027c19c7da54eb51dff4206bcb7ef9612f..1617bac140b3b0873574b45bf1478d3f1c70ab1a 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "puppeteer": "^24.10.1", "sharp": "^0.34.2", "source-map-support": "^0.5.21", + "ts-to-jsdoc": "^2.4.0", "unique-names-generator": "^4.7.1", "vscode-oniguruma": "^2.0.1", "vscode-textmate": "^9.2.0" diff --git a/tsconfig.json b/tsconfig.json index c9f71e3c43a3d4e0cc51ea020834fc98163ddc2b..ef99ba0bb8e224d768f2172acd64da26c7540688 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ "strict": true, "verbatimModuleSyntax": true, "target": "es2024", - "noUncheckedIndexedAccess": true + "noUncheckedIndexedAccess": true, + "resolveJsonModule": true }, "include": ["framework/**/*", "src/**/*", "lib/**/*"] } -- 2.54.0