| author | |
| committer | |
| log | 367f564c813bfada851a56e3d80a2bb51fa9fd6d |
| tree | 523a263fa4a89db40795e9b2d312774105aa5a54 |
| parent | cd988f1930b18b9a8a7f443f104b45569efb5f6d |
| signature | Commit is signed but in an unrecognized format. |
https://jsr.io/@clo/lib
https://www.npmjs.com/package/@paperclover/lib17 files changed, 755 insertions(+), 51 deletions(-)
.gitignore+1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | .clover |
| 2 | 2 | .env |
| 3 | lib/dist-npm | |
| 3 | 4 | node_modules |
| 4 | 5 |
lib/assert.ts+2-2| ... | ... | @@ -8,7 +8,7 @@ export function ASSERT(condition: boolean, msg?: Message): asserts condition { |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | /** Assert that `nullable` is non-null, returning a non-nullable T */ |
| 11 | export function UNWRAP<T>(nullable: T | null | undefined, msg?: Message) { | |
| 11 | export function UNWRAP<T>(nullable: T | null | undefined, msg?: Message): T { | |
| 12 | 12 | if (nullable == null) { |
| 13 | 13 | throw new Error( |
| 14 | 14 | `Unexpected ${nullable}${msg ? `: ${messageToString(msg)}` : ""}`, |
| ... | ... | @@ -18,7 +18,7 @@ export function UNWRAP<T>(nullable: T | null | undefined, msg?: Message) { |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** Assert that `number` is not NaN */ |
| 21 | export function FINITE(number: number, msg?: Message) { | |
| 21 | export function FINITE(number: number, msg?: Message): number { | |
| 22 | 22 | if (Number.isNaN(number)) { |
| 23 | 23 | throw new Error(`Unexpected NaN${msg ? `: ${messageToString(msg)}` : ""}`); |
| 24 | 24 | } |
lib/deno.json+16-8| ... | ... | @@ -1,16 +1,24 @@ |
| 1 | 1 | { |
| 2 | 2 | "name": "@clo/lib", |
| 3 | "description": "", | |
| 3 | 4 | "version": "1.0.0", |
| 4 | 5 | "license": "MIT", |
| 5 | 6 | "exports": { |
| 6 | "./log": "./log.ts", | |
| 7 | "./log/ansi": "./log/ansi.ts", | |
| 8 | "./log/headless": "./log/headless.ts", | |
| 9 | "./queue": "./queue.ts", | |
| 10 | "./string": "./string.ts", | |
| 11 | "./ts": "./ts.ts" | |
| 7 | "./assert.ts": "./assert.ts", | |
| 8 | "./log.ts": "./log.ts", | |
| 9 | "./log/ansi.ts": "./log/ansi.ts", | |
| 10 | "./log/headless.ts": "./log/headless.ts", | |
| 11 | "./log/progress.ts": "./log/progress.ts", | |
| 12 | "./log/stack.ts": "./log/stack.ts", | |
| 13 | "./packaging.ts": "./packaging.ts", | |
| 14 | "./queue.ts": "./queue.ts", | |
| 15 | "./string.ts": "./string.ts", | |
| 16 | "./ts.ts": "./ts.ts" | |
| 12 | 17 | }, |
| 13 | 18 | "imports": { |
| 14 | 19 | "lib/": "./" |
| 15 | } | |
| 16 | } | |
| 20 | }, | |
| 21 | "exclude": [ | |
| 22 | "readme.npm.md" | |
| 23 | ] | |
| 24 | } | |
| \ No newline at end of file |
lib/deno.lock+155-1| ... | ... | @@ -1,15 +1,169 @@ |
| 1 | 1 | { |
| 2 | 2 | "version": "5", |
| 3 | 3 | "specifiers": { |
| 4 | "npm:@types/node@*": "24.2.0" | |
| 4 | "npm:@types/node@*": "24.2.0", | |
| 5 | "npm:ts-to-jsdoc@2.4.0": "2.4.0" | |
| 5 | 6 | }, |
| 6 | 7 | "npm": { |
| 8 | "@nodelib/fs.scandir@2.1.5": { | |
| 9 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", | |
| 10 | "dependencies": [ | |
| 11 | "@nodelib/fs.stat", | |
| 12 | "run-parallel" | |
| 13 | ] | |
| 14 | }, | |
| 15 | "@nodelib/fs.stat@2.0.5": { | |
| 16 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" | |
| 17 | }, | |
| 18 | "@nodelib/fs.walk@1.2.8": { | |
| 19 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", | |
| 20 | "dependencies": [ | |
| 21 | "@nodelib/fs.scandir", | |
| 22 | "fastq" | |
| 23 | ] | |
| 24 | }, | |
| 25 | "@ts-morph/common@0.24.0": { | |
| 26 | "integrity": "sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==", | |
| 27 | "dependencies": [ | |
| 28 | "fast-glob", | |
| 29 | "minimatch", | |
| 30 | "mkdirp", | |
| 31 | "path-browserify" | |
| 32 | ] | |
| 33 | }, | |
| 7 | 34 | "@types/node@24.2.0": { |
| 8 | 35 | "integrity": "sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==", |
| 9 | 36 | "dependencies": [ |
| 10 | 37 | "undici-types" |
| 11 | 38 | ] |
| 12 | 39 | }, |
| 40 | "arg@5.0.2": { | |
| 41 | "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" | |
| 42 | }, | |
| 43 | "balanced-match@1.0.2": { | |
| 44 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" | |
| 45 | }, | |
| 46 | "brace-expansion@2.0.2": { | |
| 47 | "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", | |
| 48 | "dependencies": [ | |
| 49 | "balanced-match" | |
| 50 | ] | |
| 51 | }, | |
| 52 | "braces@3.0.3": { | |
| 53 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", | |
| 54 | "dependencies": [ | |
| 55 | "fill-range" | |
| 56 | ] | |
| 57 | }, | |
| 58 | "code-block-writer@13.0.3": { | |
| 59 | "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==" | |
| 60 | }, | |
| 61 | "fast-glob@3.3.3": { | |
| 62 | "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", | |
| 63 | "dependencies": [ | |
| 64 | "@nodelib/fs.stat", | |
| 65 | "@nodelib/fs.walk", | |
| 66 | "glob-parent", | |
| 67 | "merge2", | |
| 68 | "micromatch" | |
| 69 | ] | |
| 70 | }, | |
| 71 | "fastq@1.19.1": { | |
| 72 | "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", | |
| 73 | "dependencies": [ | |
| 74 | "reusify" | |
| 75 | ] | |
| 76 | }, | |
| 77 | "fill-range@7.1.1": { | |
| 78 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", | |
| 79 | "dependencies": [ | |
| 80 | "to-regex-range" | |
| 81 | ] | |
| 82 | }, | |
| 83 | "glob-parent@5.1.2": { | |
| 84 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", | |
| 85 | "dependencies": [ | |
| 86 | "is-glob" | |
| 87 | ] | |
| 88 | }, | |
| 89 | "is-extglob@2.1.1": { | |
| 90 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" | |
| 91 | }, | |
| 92 | "is-glob@4.0.3": { | |
| 93 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", | |
| 94 | "dependencies": [ | |
| 95 | "is-extglob" | |
| 96 | ] | |
| 97 | }, | |
| 98 | "is-number@7.0.0": { | |
| 99 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" | |
| 100 | }, | |
| 101 | "merge2@1.4.1": { | |
| 102 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" | |
| 103 | }, | |
| 104 | "micromatch@4.0.8": { | |
| 105 | "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", | |
| 106 | "dependencies": [ | |
| 107 | "braces", | |
| 108 | "picomatch" | |
| 109 | ] | |
| 110 | }, | |
| 111 | "minimatch@9.0.5": { | |
| 112 | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", | |
| 113 | "dependencies": [ | |
| 114 | "brace-expansion" | |
| 115 | ] | |
| 116 | }, | |
| 117 | "mkdirp@3.0.1": { | |
| 118 | "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", | |
| 119 | "bin": true | |
| 120 | }, | |
| 121 | "path-browserify@1.0.1": { | |
| 122 | "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" | |
| 123 | }, | |
| 124 | "picomatch@2.3.1": { | |
| 125 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" | |
| 126 | }, | |
| 127 | "queue-microtask@1.2.3": { | |
| 128 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" | |
| 129 | }, | |
| 130 | "reusify@1.1.0": { | |
| 131 | "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==" | |
| 132 | }, | |
| 133 | "run-parallel@1.2.0": { | |
| 134 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", | |
| 135 | "dependencies": [ | |
| 136 | "queue-microtask" | |
| 137 | ] | |
| 138 | }, | |
| 139 | "to-regex-range@5.0.1": { | |
| 140 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", | |
| 141 | "dependencies": [ | |
| 142 | "is-number" | |
| 143 | ] | |
| 144 | }, | |
| 145 | "ts-morph@23.0.0": { | |
| 146 | "integrity": "sha512-FcvFx7a9E8TUe6T3ShihXJLiJOiqyafzFKUO4aqIHDUCIvADdGNShcbc2W5PMr3LerXRv7mafvFZ9lRENxJmug==", | |
| 147 | "dependencies": [ | |
| 148 | "@ts-morph/common", | |
| 149 | "code-block-writer" | |
| 150 | ] | |
| 151 | }, | |
| 152 | "ts-to-jsdoc@2.4.0": { | |
| 153 | "integrity": "sha512-RiI9ipxkLjXESp5+YjXIQJ5GgtjwWTZU4uDahxsIdr1HKLFaC/nQOtgkGRJ+AFxqHrrhwrXtPh093r0nXQwKmw==", | |
| 154 | "dependencies": [ | |
| 155 | "arg", | |
| 156 | "ts-morph" | |
| 157 | ], | |
| 158 | "optionalDependencies": [ | |
| 159 | "typescript" | |
| 160 | ], | |
| 161 | "bin": true | |
| 162 | }, | |
| 163 | "typescript@5.9.2": { | |
| 164 | "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", | |
| 165 | "bin": true | |
| 166 | }, | |
| 13 | 167 | "undici-types@7.10.0": { |
| 14 | 168 | "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==" |
| 15 | 169 | } |
lib/log.ts+4| ... | ... | @@ -10,6 +10,10 @@ export function warn(...args: unknown[]) { |
| 10 | 10 | export function error(...args: unknown[]) { |
| 11 | 11 | globalLog.error(...args); |
| 12 | 12 | } |
| 13 | /** debugging */ | |
| 14 | export function debug(...args: unknown[]) { | |
| 15 | globalLog(...args); | |
| 16 | } | |
| 13 | 17 | |
| 14 | 18 | export interface Scope { |
| 15 | 19 | /** default call signature is informational scope */ |
lib/log/ansi.ts+1-1| ... | ... | @@ -128,4 +128,4 @@ export function debugAnsi(text: string): string { |
| 128 | 128 | return text; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | import * as self from "./ansi.ts"; | |
| 131 | import * as self from "lib/log/ansi.ts"; |
lib/log/headless.ts+2-7| ... | ... | @@ -85,12 +85,7 @@ export function widgetHost(env: WidgetHostEnv): WidgetHost { |
| 85 | 85 | let next = Infinity; |
| 86 | 86 | if (widgets[0]) { |
| 87 | 87 | for (let w = 0, { length } = widgets; w < length; w += 1) { |
| 88 | const outText = UNWRAP(widgets[w]).format({ | |
| 89 | now: lastFlush, | |
| 90 | columns, | |
| 91 | rows, | |
| 92 | colors: true, | |
| 93 | }); | |
| 88 | const outText = UNWRAP(widgets[w]).format(lastFlush); | |
| 94 | 89 | if (!outText) { |
| 95 | 90 | widgets.splice(w, 1); |
| 96 | 91 | UNWRAP(internals.splice(w, 1)[0]).unsub?.(); |
| ... | ... | @@ -331,4 +326,4 @@ import * as ts from "lib/ts.ts"; |
| 331 | 326 | import * as stack from "lib/log/stack.ts"; |
| 332 | 327 | import * as util from "node:util"; |
| 333 | 328 | import { UNWRAP } from "lib/assert.ts"; |
| 334 | import type * as log from "../log.ts"; | |
| 329 | import type * as log from "lib/log.ts"; |
lib/log/progress.sample.ts+1-1| ... | ... | @@ -69,5 +69,5 @@ function random() { |
| 69 | 69 | return Math.floor(Math.random() * 9999999).toString(32); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | import * as progress from "./progress.ts"; | |
| 72 | import * as progress from "lib/log/progress.ts"; | |
| 73 | 73 | import * as timers from "node:timers/promises"; |
lib/log/progress.ts+23-14| ... | ... | @@ -63,7 +63,12 @@ export interface Node extends Ref { |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | export interface StartOptions { |
| 66 | value?: number | undefined | null; | |
| 66 | 67 | estimate?: number | undefined | null; |
| 68 | passive?: boolean | undefined | null; | |
| 69 | showEstimate?: boolean | undefined | null; | |
| 70 | maxHeight?: number | undefined | null; | |
| 71 | sortChildren?: Node["sortChildren"] | undefined | null; | |
| 67 | 72 | } |
| 68 | 73 | |
| 69 | 74 | /** a valid `Node` without any output */ |
| ... | ... | @@ -103,18 +108,18 @@ type Signal = |
| 103 | 108 | |
| 104 | 109 | function newNode( |
| 105 | 110 | text: string, |
| 106 | { estimate }: StartOptions = {}, | |
| 111 | opts: StartOptions = {}, | |
| 107 | 112 | ): [Internal, Node] { |
| 108 | 113 | const state: Internal = { |
| 109 | 114 | text, |
| 110 | value: 0, | |
| 111 | estimate: estimate ?? 0, | |
| 112 | showEstimate: true, | |
| 113 | passive: false, | |
| 115 | value: opts.value ?? 0, | |
| 116 | estimate: opts.estimate ?? 0, | |
| 117 | showEstimate: opts.showEstimate ?? true, | |
| 118 | passive: opts.passive ?? false, | |
| 114 | 119 | logs: [], |
| 115 | 120 | children: [], |
| 116 | 121 | parent: null, |
| 117 | sortChildren: null, | |
| 122 | sortChildren: opts.sortChildren ?? null, | |
| 118 | 123 | signal() { |
| 119 | 124 | throw new Error("no signaler"); |
| 120 | 125 | }, |
| ... | ... | @@ -225,7 +230,7 @@ function newNode( |
| 225 | 230 | return [state, binding]; |
| 226 | 231 | } |
| 227 | 232 | |
| 228 | function format(now: number, list: Internal[]) { | |
| 233 | function formatProgress(now: number, list: Internal[]): string { | |
| 229 | 234 | let out = ""; |
| 230 | 235 | for (const top of list) { |
| 231 | 236 | if (top.passive && top.children.length === 0) continue; |
| ... | ... | @@ -236,15 +241,19 @@ function format(now: number, list: Internal[]) { |
| 236 | 241 | } |
| 237 | 242 | |
| 238 | 243 | /** These functions are used to test `lib/log/progress` */ |
| 239 | export const internals = { | |
| 240 | node(text: string, props: Partial<Internal>, children: Internal[]): Internal { | |
| 244 | export namespace internals { | |
| 245 | export function node( | |
| 246 | text: string, | |
| 247 | props: Partial<Internal>, | |
| 248 | children: Internal[], | |
| 249 | ): Internal { | |
| 241 | 250 | const [node] = newNode(text); |
| 242 | 251 | Object.assign(node, props); |
| 243 | 252 | node.children.push(...children); |
| 244 | 253 | return node; |
| 245 | }, | |
| 246 | format, | |
| 247 | }; | |
| 254 | } | |
| 255 | export const format = formatProgress; | |
| 256 | } | |
| 248 | 257 | |
| 249 | 258 | const spinnerFps = 12.5; |
| 250 | 259 | |
| ... | ... | @@ -313,7 +322,7 @@ function renderChildren(state: Internal, now: number, depth: boolean[]) { |
| 313 | 322 | * which did ffmpeg handling. It is probably one of the coolest progress bars |
| 314 | 323 | * ever imagined. |
| 315 | 324 | */ |
| 316 | export function getUnicodeBar(progress: number, width: number) { | |
| 325 | export function getUnicodeBar(progress: number, width: number): string { | |
| 317 | 326 | if (progress >= 1) return fullBar.repeat(width); |
| 318 | 327 | if (progress <= 0 || Number.isNaN(progress)) return " ".repeat(width); |
| 319 | 328 | |
| ... | ... | @@ -352,7 +361,7 @@ export class Headless { |
| 352 | 361 | } |
| 353 | 362 | |
| 354 | 363 | widget: log.Widget = { |
| 355 | format: (now) => format(now, this.active), | |
| 364 | format: (now) => formatProgress(now, this.active), | |
| 356 | 365 | onChange: ( |
| 357 | 366 | rerender, |
| 358 | 367 | ) => (this.#rerender = rerender, () => this.#rerender = null), |
lib/log/stack.ts+11-9| ... | ... | @@ -32,7 +32,7 @@ export interface Frame { |
| 32 | 32 | const regexV8Stack = /^\s*at .*(\S+:\d+|\(native\))/m; |
| 33 | 33 | const regexLocation = /(.+?)(?::(\d+))?(?::(\d+))?$/; |
| 34 | 34 | |
| 35 | export function parse(error: Error): null | Frame[] { | |
| 35 | export function parse(error: Error): Frame[] | null { | |
| 36 | 36 | const stack = error?.stack; |
| 37 | 37 | if (typeof stack === "string") { |
| 38 | 38 | if (stack.match(regexV8Stack)) { |
| ... | ... | @@ -43,7 +43,7 @@ export function parse(error: Error): null | Frame[] { |
| 43 | 43 | return null; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | export function format(error: Error, colors = false) { | |
| 46 | export function format(error: Error, colors = false): string { | |
| 47 | 47 | const { name, message, stack: _, ...payload } = error; |
| 48 | 48 | |
| 49 | 49 | const headingLine = (colors ? ansi.fgRed : "") + |
| ... | ... | @@ -63,11 +63,10 @@ export function format(error: Error, colors = false) { |
| 63 | 63 | if ("Bun" in globalThis) { |
| 64 | 64 | frames = frames.filter((frame) => |
| 65 | 65 | frame.file !== "native" || ![ |
| 66 | "moduleEvaluation", | |
| 67 | 66 | "moduleEvaluation", |
| 68 | 67 | "loadAndEvaluateModule", |
| 69 | 68 | "processTicksAndRejections", |
| 70 | ].includes(frame.fn) | |
| 69 | ].includes(frame.fn ?? "") | |
| 71 | 70 | ); |
| 72 | 71 | } |
| 73 | 72 | if (frames.length) { |
| ... | ... | @@ -77,7 +76,10 @@ export function format(error: Error, colors = false) { |
| 77 | 76 | return headingLine + payloadLines + frameLines + "\n"; |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | export function formatFrame({ fn, file, line, col }: Frame, colors: boolean) { | |
| 79 | export function formatFrame( | |
| 80 | { fn, file, line, col }: Frame, | |
| 81 | colors: boolean, | |
| 82 | ): string { | |
| 81 | 83 | let out = ""; |
| 82 | 84 | if (file === "native") file = null; |
| 83 | 85 | const internal = !file || file.startsWith("node:") || |
| ... | ... | @@ -102,7 +104,7 @@ export function formatFrame({ fn, file, line, col }: Frame, colors: boolean) { |
| 102 | 104 | |
| 103 | 105 | if (colors) { |
| 104 | 106 | if (root) { |
| 105 | const [pathTo, project, sub] = root; | |
| 107 | const [pathTo, project] = root; | |
| 106 | 108 | out += ansi.dim + pathTo + |
| 107 | 109 | ansi.mergeStyles(ansi.resetWeight + ansi.fgCyan) + |
| 108 | 110 | project + ansi.fgReset; |
| ... | ... | @@ -312,7 +314,7 @@ function parseV8OrIe(stack: string): Frame[] { |
| 312 | 314 | : locationParts[0]; |
| 313 | 315 | |
| 314 | 316 | return { |
| 315 | fn: functionName, | |
| 317 | fn: functionName ?? null, | |
| 316 | 318 | file: fileName, |
| 317 | 319 | line: 0 | locationParts[1], |
| 318 | 320 | col: 0 | locationParts[2], |
| ... | ... | @@ -322,8 +324,8 @@ function parseV8OrIe(stack: string): Frame[] { |
| 322 | 324 | |
| 323 | 325 | function parseJscOrSpidermonkey(stack: string): Frame[] { |
| 324 | 326 | // Using string literal "\n" does not work in Safari. |
| 325 | return stack.split(/\n/g).map((source, i) => { | |
| 326 | let fn = ""; | |
| 327 | return stack.split(/\n/g).map((source) => { | |
| 328 | let fn: string | null = ""; | |
| 327 | 329 | let file: string | null = null; |
| 328 | 330 | let line: number | null = null; |
| 329 | 331 | let col: number | null = null; |
lib/packaging.ts created+131| ... | ... | @@ -0,0 +1,131 @@ |
| 1 | // Tools that `lib` uses to package itself for NPM. | |
| 2 | // This depends on an installation of `ts-to-jsdoc` available as a resolvable node module. | |
| 3 | ||
| 4 | export async function updateJsrPackageExportsToAll( | |
| 5 | absPath: string, | |
| 6 | p: progress.Ref, | |
| 7 | ) { | |
| 8 | using _ = p.start("update deno.json"); | |
| 9 | const manifestPath = path.join(absPath, "deno.json"); | |
| 10 | const deno = JSON.parse( | |
| 11 | await fs.readFile(manifestPath, "utf-8"), | |
| 12 | ); | |
| 13 | const newExports: Record<string, string> = {}; | |
| 14 | for (const subPath of await fs.readdir(absPath, { recursive: true })) { | |
| 15 | if (!subPath.match(/\.tsx?$/)) continue; | |
| 16 | if (subPath.match(/\.(test|sample)\.tsx?$/)) continue; | |
| 17 | if (subPath.startsWith("dist")) continue; | |
| 18 | newExports["./" + subPath] = "./" + subPath; | |
| 19 | } | |
| 20 | deno.exports = Object.fromEntries( | |
| 21 | Object.entries(newExports).sort(([a], [b]) => a.localeCompare(b)), | |
| 22 | ) as typeof deno.exports; | |
| 23 | await fs.writeFile(manifestPath, JSON.stringify(deno, null, 2)); | |
| 24 | } | |
| 25 | ||
| 26 | interface TsToJsdoc { | |
| 27 | transpileFile: (opts: { code: string }) => string; | |
| 28 | } | |
| 29 | ||
| 30 | export async function transpileForNpm( | |
| 31 | absPath: string, | |
| 32 | p: progress.Ref, | |
| 33 | packageJson: Record<string, unknown>, | |
| 34 | tsToJsdoc?: TsToJsdoc, | |
| 35 | ) { | |
| 36 | try { | |
| 37 | // @ts-expect-error optional dependency | |
| 38 | tsToJsdoc ??= await import("ts-to-jsdoc") as TsToJsdoc; | |
| 39 | } catch { | |
| 40 | // @ts-expect-error unsupported import specifier | |
| 41 | tsToJsdoc ??= await import("npm:ts-to-jsdoc@2.4.0") as TsToJsdoc; | |
| 42 | } | |
| 43 | const { transpileFile } = tsToJsdoc; | |
| 44 | ||
| 45 | using node = p.start("transpile into jsdoc for npm"); | |
| 46 | const manifestPath = path.join(absPath, "deno.json"); | |
| 47 | const deno = JSON.parse( | |
| 48 | await fs.readFile(manifestPath, "utf-8"), | |
| 49 | ); | |
| 50 | const distPath = path.join(absPath, "dist-npm"); | |
| 51 | await fs.rm(distPath, { recursive: true, force: true }); | |
| 52 | await fs.mkdir(distPath, { recursive: true }); | |
| 53 | ||
| 54 | const files: string[] = []; | |
| 55 | const exports: Record<string, string> = {}; | |
| 56 | for (const subPath of await fs.readdir(absPath, { recursive: true })) { | |
| 57 | if (!subPath.match(/\.tsx?$/)) continue; | |
| 58 | if (subPath.startsWith("dist")) continue; | |
| 59 | files.push(subPath); | |
| 60 | } | |
| 61 | node.estimate = Object.keys(exports).length; | |
| 62 | for (const subPath of files) { | |
| 63 | using _ = node.start(subPath); | |
| 64 | const targetSubPath = subPath.replace(/\.tsx?$/, ".js"); | |
| 65 | if (!subPath.match(/\.(test|sample)\.tsx?$/)) { | |
| 66 | exports["./" + subPath] = "./" + targetSubPath; | |
| 67 | } | |
| 68 | ||
| 69 | let code = transpileFile({ | |
| 70 | code: await fs.readFile(path.join(absPath, subPath), "utf-8"), | |
| 71 | }); | |
| 72 | code = code.replace( | |
| 73 | / from "lib\/([^"]+)"/g, | |
| 74 | (_, src) => { | |
| 75 | return ' from "./' + path.relative( | |
| 76 | path.dirname(subPath), | |
| 77 | src.replace(/\.tsx?$/, ".js"), | |
| 78 | ) + '"'; | |
| 79 | }, | |
| 80 | ); | |
| 81 | if (packageJson.homepage) { | |
| 82 | code = | |
| 83 | "// This file is transpiled from TypeScript from paper clover's sitegen\n" + | |
| 84 | "// " + packageJson.homepage + "/" + subPath + "\n" + | |
| 85 | code; | |
| 86 | } | |
| 87 | const out = path.join(distPath, targetSubPath); | |
| 88 | await fs.mkdir(path.dirname(out), { recursive: true }); | |
| 89 | await fs.writeFile(out, code); | |
| 90 | node.value += 1; | |
| 91 | } | |
| 92 | await fs.cp( | |
| 93 | path.join(absPath, "readme.npm.md"), | |
| 94 | path.join(distPath, "readme.md"), | |
| 95 | ).catch((e) => { | |
| 96 | if (e.code !== "ENOENT") throw e; | |
| 97 | }); | |
| 98 | await fs.cp( | |
| 99 | path.join(absPath, "readme.changes.md"), | |
| 100 | path.join(distPath, "readme.changes.md"), | |
| 101 | ).catch((e) => { | |
| 102 | if (e.code !== "ENOENT") throw e; | |
| 103 | }); | |
| 104 | const { name, description, ...rest } = packageJson; | |
| 105 | await fs.writeFile( | |
| 106 | path.join(distPath, "package.json"), | |
| 107 | JSON.stringify({ | |
| 108 | name, | |
| 109 | description, | |
| 110 | version: deno.version, | |
| 111 | type: "module", | |
| 112 | ...rest, | |
| 113 | }), | |
| 114 | ); | |
| 115 | } | |
| 116 | ||
| 117 | if (import.meta.main) { | |
| 118 | updateJsrPackageExportsToAll(import.meta.dirname!, progress) | |
| 119 | .then(() => | |
| 120 | transpileForNpm(import.meta.dirname!, progress, { | |
| 121 | name: "@paperclover/lib", | |
| 122 | description: "high quality typescript libraries", | |
| 123 | homepage: | |
| 124 | "https://git.paperclover.net/clo/sitegen/src/branch/master/lib", | |
| 125 | }) | |
| 126 | ); | |
| 127 | } | |
| 128 | ||
| 129 | import * as progress from "lib/log/progress.ts"; | |
| 130 | import * as path from "node:path"; | |
| 131 | import * as fs from "node:fs/promises"; |
lib/readme.changes.md created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | # notable changes in clover's typescript library | |
| 2 | ||
| 3 | ## v1 | |
| 4 | ||
| 5 | - new library `assert` | |
| 6 | - new library `log` | |
| 7 | - new library `packaging` | |
| 8 | - new library `queue` | |
| 9 | - new library `string` | |
| 10 | - new library `ts` |
lib/readme.md+19-7| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | # clover's typescript library | |
| 1 | # [clover's typescript library] | |
| 2 | 2 | |
| 3 | 3 | `lib` is a collection of high-quality typescript libraries for things missing in |
| 4 | 4 | either browsers or node.js. originally, these were helper functions used to |
| 5 | 5 | create my website, <https://paperclover.net>, but i started wanting them across |
| 6 | projects. | |
| 6 | projects and at work. | |
| 7 | 7 | |
| 8 | 8 | all top-level namespaces stand alone as their own projects, and generally do not |
| 9 | depend on each other. no external dependencies == easy to audit. | |
| 9 | depend on each other. there are no external dependencies; code is easy to audit. | |
| 10 | 10 | |
| 11 | 11 | the public api is simply all of the code. an overview: |
| 12 | 12 | |
| ... | ... | @@ -18,15 +18,27 @@ the public api is simply all of the code. an overview: |
| 18 | 18 | <!-- - `subprocess` - rebuilt api for `node:child_process` --> |
| 19 | 19 | <!-- - `testing` --> |
| 20 | 20 | |
| 21 | - `string` | |
| 21 | - `assert` | |
| 22 | 22 | - `log` - logging, terminal i/o, interactive widgets |
| 23 | 23 | - `log/ansi` - cursor and color constants |
| 24 | 24 | - `log/headless` - use `log` and `log/progress` without a tty |
| 25 | 25 | - `log/progress` - progress bar, spinner, and tree |
| 26 | - `log/stack` - stack trace parse and formatter | |
| 27 | - `packaging` - workflows used for `lib`'s publications | |
| 28 | - `queue` - priority queue with rescheduling | |
| 29 | - `string` | |
| 26 | 30 | - `ts` typescript types and general purpose code |
| 27 | 31 | |
| 28 | 32 | these libraries are published as is, **without versioning or maintainance |
| 29 | guarantees**. note that on package registries where a semantic version is | |
| 30 | required, a major version bump is done on each publication. | |
| 33 | guarantees**. every version is a breaking major release. please upgrade your | |
| 34 | libraries with intent, considering api changes in [readme.changes.md]. | |
| 35 | individual modules may annotate their intended api and usage stability. | |
| 36 | ||
| 37 | keep in mind there are [known bugs and missing features] in this release. | |
| 38 | ||
| 39 | to contribute, please send bug reports or patches to <dev@paperclover.net>. new | |
| 40 | features may not be accepted if they are complex and don't further my use cases. | |
| 31 | 41 | |
| 32 | to contribute bug fixes, please send patches to <git@paperclover.net>. | |
| 42 | [readme.changes.md]: ./readme.changes.md | |
| 43 | [known bugs and missing features]: https://git.paperclover.net/clo/sitegen/issues?state=open&labels=4 | |
| 44 | [clover's typescript library]: https://git.paperclover.net/clo/sitegen/src/branch/master/lib |
lib/readme.npm.md created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | # [clover's typescript library] | |
| 2 | ||
| 3 | `lib` is a collection of high-quality typescript libraries for things missing in | |
| 4 | either browsers or node.js. originally, these were helper functions used to | |
| 5 | create my website, <https://paperclover.net>, but i started wanting them across | |
| 6 | projects and at work. | |
| 7 | ||
| 8 | ```sh | |
| 9 | # alias install "lib" using "@paperclover/lib" | |
| 10 | npm install lib@npm:@paperclover/lib | |
| 11 | ``` | |
| 12 | ||
| 13 | all top-level namespaces stand alone as their own projects, and generally do not | |
| 14 | depend on each other. there are no external dependencies; code is easy to audit. | |
| 15 | ||
| 16 | the public api is simply all of the code. an overview: | |
| 17 | ||
| 18 | <!-- - `async` --> | |
| 19 | <!-- - `error` - interop with the `unknown` type in error handlers --> | |
| 20 | <!-- - `fs` - rebuilt api for `node:fs` --> | |
| 21 | <!-- - `lru` - least recently used cache --> | |
| 22 | <!-- - `mime` - trimmed database of mime types --> | |
| 23 | <!-- - `subprocess` - rebuilt api for `node:child_process` --> | |
| 24 | <!-- - `testing` --> | |
| 25 | ||
| 26 | - `assert` | |
| 27 | - `log` - logging, terminal i/o, interactive widgets | |
| 28 | - `log/ansi` - cursor and color constants | |
| 29 | - `log/headless` - use `log` and `log/progress` without a tty | |
| 30 | - `log/progress` - progress bar, spinner, and tree | |
| 31 | - `log/stack` - stack trace parse and formatter | |
| 32 | - `packaging` - workflows used for `lib`'s publications | |
| 33 | - `queue` - priority queue with rescheduling | |
| 34 | - `string` | |
| 35 | - `ts` typescript types and general purpose code | |
| 36 | ||
| 37 | these libraries are published as is, **without versioning or maintainance | |
| 38 | guarantees**. every version is a breaking major release. please upgrade your | |
| 39 | libraries with intent, considering api changes in [readme.changes.md]. | |
| 40 | individual modules may annotate their intended api and usage stability. | |
| 41 | ||
| 42 | keep in mind there are [known bugs and missing features] in this release. | |
| 43 | ||
| 44 | to contribute, please send bug reports or patches to <dev@paperclover.net>. new | |
| 45 | features may not be accepted if they are complex and don't further my use cases. | |
| 46 | ||
| 47 | [readme.changes.md]: ./readme.changes.md | |
| 48 | [known bugs and missing features]: https://git.paperclover.net/clo/sitegen/issues?state=open&labels=4 | |
| 49 | [clover's typescript library]: https://git.paperclover.net/clo/sitegen/src/branch/master/lib |
package-lock.json+327| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | "puppeteer": "^24.10.1", |
| 21 | 21 | "sharp": "^0.34.2", |
| 22 | 22 | "source-map-support": "^0.5.21", |
| 23 | "ts-to-jsdoc": "^2.4.0", | |
| 23 | 24 | "unique-names-generator": "^4.7.1", |
| 24 | 25 | "vscode-oniguruma": "^2.0.1", |
| 25 | 26 | "vscode-textmate": "^9.2.0" |
| ... | ... | @@ -1560,6 +1561,41 @@ |
| 1560 | 1561 | "win32" |
| 1561 | 1562 | ] |
| 1562 | 1563 | }, |
| 1564 | "node_modules/@nodelib/fs.scandir": { | |
| 1565 | "version": "2.1.5", | |
| 1566 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", | |
| 1567 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", | |
| 1568 | "license": "MIT", | |
| 1569 | "dependencies": { | |
| 1570 | "@nodelib/fs.stat": "2.0.5", | |
| 1571 | "run-parallel": "^1.1.9" | |
| 1572 | }, | |
| 1573 | "engines": { | |
| 1574 | "node": ">= 8" | |
| 1575 | } | |
| 1576 | }, | |
| 1577 | "node_modules/@nodelib/fs.stat": { | |
| 1578 | "version": "2.0.5", | |
| 1579 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", | |
| 1580 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", | |
| 1581 | "license": "MIT", | |
| 1582 | "engines": { | |
| 1583 | "node": ">= 8" | |
| 1584 | } | |
| 1585 | }, | |
| 1586 | "node_modules/@nodelib/fs.walk": { | |
| 1587 | "version": "1.2.8", | |
| 1588 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", | |
| 1589 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", | |
| 1590 | "license": "MIT", | |
| 1591 | "dependencies": { | |
| 1592 | "@nodelib/fs.scandir": "2.1.5", | |
| 1593 | "fastq": "^1.6.0" | |
| 1594 | }, | |
| 1595 | "engines": { | |
| 1596 | "node": ">= 8" | |
| 1597 | } | |
| 1598 | }, | |
| 1563 | 1599 | "node_modules/@paperclover/console": { |
| 1564 | 1600 | "resolved": "git+https://git.paperclover.net/clo/console.git#1a6ac2b79fdd8a21a1c57d25723975872bc07e3e", |
| 1565 | 1601 | "dependencies": { |
| ... | ... | @@ -1607,6 +1643,18 @@ |
| 1607 | 1643 | "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", |
| 1608 | 1644 | "license": "MIT" |
| 1609 | 1645 | }, |
| 1646 | "node_modules/@ts-morph/common": { | |
| 1647 | "version": "0.24.0", | |
| 1648 | "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.24.0.tgz", | |
| 1649 | "integrity": "sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==", | |
| 1650 | "license": "MIT", | |
| 1651 | "dependencies": { | |
| 1652 | "fast-glob": "^3.3.2", | |
| 1653 | "minimatch": "^9.0.4", | |
| 1654 | "mkdirp": "^3.0.1", | |
| 1655 | "path-browserify": "^1.0.1" | |
| 1656 | } | |
| 1657 | }, | |
| 1610 | 1658 | "node_modules/@types/debug": { |
| 1611 | 1659 | "version": "4.1.12", |
| 1612 | 1660 | "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", |
| ... | ... | @@ -1765,6 +1813,12 @@ |
| 1765 | 1813 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" |
| 1766 | 1814 | } |
| 1767 | 1815 | }, |
| 1816 | "node_modules/arg": { | |
| 1817 | "version": "5.0.2", | |
| 1818 | "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", | |
| 1819 | "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", | |
| 1820 | "license": "MIT" | |
| 1821 | }, | |
| 1768 | 1822 | "node_modules/argparse": { |
| 1769 | 1823 | "version": "2.0.1", |
| 1770 | 1824 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", |
| ... | ... | @@ -1808,6 +1862,12 @@ |
| 1808 | 1862 | "url": "https://github.com/sponsors/wooorm" |
| 1809 | 1863 | } |
| 1810 | 1864 | }, |
| 1865 | "node_modules/balanced-match": { | |
| 1866 | "version": "1.0.2", | |
| 1867 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", | |
| 1868 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", | |
| 1869 | "license": "MIT" | |
| 1870 | }, | |
| 1811 | 1871 | "node_modules/bare-events": { |
| 1812 | 1872 | "version": "2.6.0", |
| 1813 | 1873 | "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz", |
| ... | ... | @@ -1895,6 +1955,27 @@ |
| 1895 | 1955 | "integrity": "sha512-cRygWd7kGBQO3VEhPiTgq4Wc43ctsM+o46urrmPOiuAe+07fzlSB9OJVdpgDL0jPqXUVQ9ht7aq7kxOeJHRK+w==", |
| 1896 | 1956 | "license": "MIT" |
| 1897 | 1957 | }, |
| 1958 | "node_modules/brace-expansion": { | |
| 1959 | "version": "2.0.2", | |
| 1960 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", | |
| 1961 | "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", | |
| 1962 | "license": "MIT", | |
| 1963 | "dependencies": { | |
| 1964 | "balanced-match": "^1.0.0" | |
| 1965 | } | |
| 1966 | }, | |
| 1967 | "node_modules/braces": { | |
| 1968 | "version": "3.0.3", | |
| 1969 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", | |
| 1970 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", | |
| 1971 | "license": "MIT", | |
| 1972 | "dependencies": { | |
| 1973 | "fill-range": "^7.1.1" | |
| 1974 | }, | |
| 1975 | "engines": { | |
| 1976 | "node": ">=8" | |
| 1977 | } | |
| 1978 | }, | |
| 1898 | 1979 | "node_modules/browserslist": { |
| 1899 | 1980 | "version": "4.25.1", |
| 1900 | 1981 | "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.1.tgz", |
| ... | ... | @@ -2081,6 +2162,12 @@ |
| 2081 | 2162 | "node": ">=8" |
| 2082 | 2163 | } |
| 2083 | 2164 | }, |
| 2165 | "node_modules/code-block-writer": { | |
| 2166 | "version": "13.0.3", | |
| 2167 | "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", | |
| 2168 | "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", | |
| 2169 | "license": "MIT" | |
| 2170 | }, | |
| 2084 | 2171 | "node_modules/codemirror": { |
| 2085 | 2172 | "version": "6.0.2", |
| 2086 | 2173 | "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz", |
| ... | ... | @@ -2633,6 +2720,31 @@ |
| 2633 | 2720 | "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", |
| 2634 | 2721 | "license": "MIT" |
| 2635 | 2722 | }, |
| 2723 | "node_modules/fast-glob": { | |
| 2724 | "version": "3.3.3", | |
| 2725 | "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", | |
| 2726 | "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", | |
| 2727 | "license": "MIT", | |
| 2728 | "dependencies": { | |
| 2729 | "@nodelib/fs.stat": "^2.0.2", | |
| 2730 | "@nodelib/fs.walk": "^1.2.3", | |
| 2731 | "glob-parent": "^5.1.2", | |
| 2732 | "merge2": "^1.3.0", | |
| 2733 | "micromatch": "^4.0.8" | |
| 2734 | }, | |
| 2735 | "engines": { | |
| 2736 | "node": ">=8.6.0" | |
| 2737 | } | |
| 2738 | }, | |
| 2739 | "node_modules/fastq": { | |
| 2740 | "version": "1.19.1", | |
| 2741 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", | |
| 2742 | "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", | |
| 2743 | "license": "ISC", | |
| 2744 | "dependencies": { | |
| 2745 | "reusify": "^1.0.4" | |
| 2746 | } | |
| 2747 | }, | |
| 2636 | 2748 | "node_modules/fd-slicer": { |
| 2637 | 2749 | "version": "1.1.0", |
| 2638 | 2750 | "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", |
| ... | ... | @@ -2642,6 +2754,18 @@ |
| 2642 | 2754 | "pend": "~1.2.0" |
| 2643 | 2755 | } |
| 2644 | 2756 | }, |
| 2757 | "node_modules/fill-range": { | |
| 2758 | "version": "7.1.1", | |
| 2759 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", | |
| 2760 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", | |
| 2761 | "license": "MIT", | |
| 2762 | "dependencies": { | |
| 2763 | "to-regex-range": "^5.0.1" | |
| 2764 | }, | |
| 2765 | "engines": { | |
| 2766 | "node": ">=8" | |
| 2767 | } | |
| 2768 | }, | |
| 2645 | 2769 | "node_modules/gensync": { |
| 2646 | 2770 | "version": "1.0.0-beta.2", |
| 2647 | 2771 | "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", |
| ... | ... | @@ -2689,6 +2813,18 @@ |
| 2689 | 2813 | "node": ">= 14" |
| 2690 | 2814 | } |
| 2691 | 2815 | }, |
| 2816 | "node_modules/glob-parent": { | |
| 2817 | "version": "5.1.2", | |
| 2818 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", | |
| 2819 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", | |
| 2820 | "license": "ISC", | |
| 2821 | "dependencies": { | |
| 2822 | "is-glob": "^4.0.1" | |
| 2823 | }, | |
| 2824 | "engines": { | |
| 2825 | "node": ">= 6" | |
| 2826 | } | |
| 2827 | }, | |
| 2692 | 2828 | "node_modules/hast-util-to-estree": { |
| 2693 | 2829 | "version": "3.1.3", |
| 2694 | 2830 | "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", |
| ... | ... | @@ -2897,6 +3033,15 @@ |
| 2897 | 3033 | "url": "https://github.com/sponsors/wooorm" |
| 2898 | 3034 | } |
| 2899 | 3035 | }, |
| 3036 | "node_modules/is-extglob": { | |
| 3037 | "version": "2.1.1", | |
| 3038 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", | |
| 3039 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", | |
| 3040 | "license": "MIT", | |
| 3041 | "engines": { | |
| 3042 | "node": ">=0.10.0" | |
| 3043 | } | |
| 3044 | }, | |
| 2900 | 3045 | "node_modules/is-fullwidth-code-point": { |
| 2901 | 3046 | "version": "3.0.0", |
| 2902 | 3047 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", |
| ... | ... | @@ -2906,6 +3051,18 @@ |
| 2906 | 3051 | "node": ">=8" |
| 2907 | 3052 | } |
| 2908 | 3053 | }, |
| 3054 | "node_modules/is-glob": { | |
| 3055 | "version": "4.0.3", | |
| 3056 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", | |
| 3057 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", | |
| 3058 | "license": "MIT", | |
| 3059 | "dependencies": { | |
| 3060 | "is-extglob": "^2.1.1" | |
| 3061 | }, | |
| 3062 | "engines": { | |
| 3063 | "node": ">=0.10.0" | |
| 3064 | } | |
| 3065 | }, | |
| 2909 | 3066 | "node_modules/is-hexadecimal": { |
| 2910 | 3067 | "version": "2.0.1", |
| 2911 | 3068 | "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", |
| ... | ... | @@ -2916,6 +3073,15 @@ |
| 2916 | 3073 | "url": "https://github.com/sponsors/wooorm" |
| 2917 | 3074 | } |
| 2918 | 3075 | }, |
| 3076 | "node_modules/is-number": { | |
| 3077 | "version": "7.0.0", | |
| 3078 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", | |
| 3079 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", | |
| 3080 | "license": "MIT", | |
| 3081 | "engines": { | |
| 3082 | "node": ">=0.12.0" | |
| 3083 | } | |
| 3084 | }, | |
| 2919 | 3085 | "node_modules/is-plain-obj": { |
| 2920 | 3086 | "version": "4.1.0", |
| 2921 | 3087 | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", |
| ... | ... | @@ -3243,6 +3409,15 @@ |
| 3243 | 3409 | "url": "https://opencollective.com/unified" |
| 3244 | 3410 | } |
| 3245 | 3411 | }, |
| 3412 | "node_modules/merge2": { | |
| 3413 | "version": "1.4.1", | |
| 3414 | "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", | |
| 3415 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", | |
| 3416 | "license": "MIT", | |
| 3417 | "engines": { | |
| 3418 | "node": ">= 8" | |
| 3419 | } | |
| 3420 | }, | |
| 3246 | 3421 | "node_modules/micromark": { |
| 3247 | 3422 | "version": "4.0.2", |
| 3248 | 3423 | "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", |
| ... | ... | @@ -3839,12 +4014,55 @@ |
| 3839 | 4014 | ], |
| 3840 | 4015 | "license": "MIT" |
| 3841 | 4016 | }, |
| 4017 | "node_modules/micromatch": { | |
| 4018 | "version": "4.0.8", | |
| 4019 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", | |
| 4020 | "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", | |
| 4021 | "license": "MIT", | |
| 4022 | "dependencies": { | |
| 4023 | "braces": "^3.0.3", | |
| 4024 | "picomatch": "^2.3.1" | |
| 4025 | }, | |
| 4026 | "engines": { | |
| 4027 | "node": ">=8.6" | |
| 4028 | } | |
| 4029 | }, | |
| 4030 | "node_modules/minimatch": { | |
| 4031 | "version": "9.0.5", | |
| 4032 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", | |
| 4033 | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", | |
| 4034 | "license": "ISC", | |
| 4035 | "dependencies": { | |
| 4036 | "brace-expansion": "^2.0.1" | |
| 4037 | }, | |
| 4038 | "engines": { | |
| 4039 | "node": ">=16 || 14 >=14.17" | |
| 4040 | }, | |
| 4041 | "funding": { | |
| 4042 | "url": "https://github.com/sponsors/isaacs" | |
| 4043 | } | |
| 4044 | }, | |
| 3842 | 4045 | "node_modules/mitt": { |
| 3843 | 4046 | "version": "3.0.1", |
| 3844 | 4047 | "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", |
| 3845 | 4048 | "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", |
| 3846 | 4049 | "license": "MIT" |
| 3847 | 4050 | }, |
| 4051 | "node_modules/mkdirp": { | |
| 4052 | "version": "3.0.1", | |
| 4053 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", | |
| 4054 | "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", | |
| 4055 | "license": "MIT", | |
| 4056 | "bin": { | |
| 4057 | "mkdirp": "dist/cjs/src/bin.js" | |
| 4058 | }, | |
| 4059 | "engines": { | |
| 4060 | "node": ">=10" | |
| 4061 | }, | |
| 4062 | "funding": { | |
| 4063 | "url": "https://github.com/sponsors/isaacs" | |
| 4064 | } | |
| 4065 | }, | |
| 3848 | 4066 | "node_modules/ms": { |
| 3849 | 4067 | "version": "2.1.3", |
| 3850 | 4068 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", |
| ... | ... | @@ -4008,6 +4226,12 @@ |
| 4008 | 4226 | "url": "https://github.com/sponsors/sindresorhus" |
| 4009 | 4227 | } |
| 4010 | 4228 | }, |
| 4229 | "node_modules/path-browserify": { | |
| 4230 | "version": "1.0.1", | |
| 4231 | "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", | |
| 4232 | "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", | |
| 4233 | "license": "MIT" | |
| 4234 | }, | |
| 4011 | 4235 | "node_modules/pend": { |
| 4012 | 4236 | "version": "1.2.0", |
| 4013 | 4237 | "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", |
| ... | ... | @@ -4020,6 +4244,18 @@ |
| 4020 | 4244 | "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", |
| 4021 | 4245 | "license": "ISC" |
| 4022 | 4246 | }, |
| 4247 | "node_modules/picomatch": { | |
| 4248 | "version": "2.3.1", | |
| 4249 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", | |
| 4250 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", | |
| 4251 | "license": "MIT", | |
| 4252 | "engines": { | |
| 4253 | "node": ">=8.6" | |
| 4254 | }, | |
| 4255 | "funding": { | |
| 4256 | "url": "https://github.com/sponsors/jonschlinkert" | |
| 4257 | } | |
| 4258 | }, | |
| 4023 | 4259 | "node_modules/progress": { |
| 4024 | 4260 | "version": "2.0.3", |
| 4025 | 4261 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", |
| ... | ... | @@ -4121,6 +4357,26 @@ |
| 4121 | 4357 | "node": ">=18" |
| 4122 | 4358 | } |
| 4123 | 4359 | }, |
| 4360 | "node_modules/queue-microtask": { | |
| 4361 | "version": "1.2.3", | |
| 4362 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", | |
| 4363 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", | |
| 4364 | "funding": [ | |
| 4365 | { | |
| 4366 | "type": "github", | |
| 4367 | "url": "https://github.com/sponsors/feross" | |
| 4368 | }, | |
| 4369 | { | |
| 4370 | "type": "patreon", | |
| 4371 | "url": "https://www.patreon.com/feross" | |
| 4372 | }, | |
| 4373 | { | |
| 4374 | "type": "consulting", | |
| 4375 | "url": "https://feross.org/support" | |
| 4376 | } | |
| 4377 | ], | |
| 4378 | "license": "MIT" | |
| 4379 | }, | |
| 4124 | 4380 | "node_modules/raptor-async": { |
| 4125 | 4381 | "version": "1.1.3", |
| 4126 | 4382 | "resolved": "https://registry.npmjs.org/raptor-async/-/raptor-async-1.1.3.tgz", |
| ... | ... | @@ -4289,6 +4545,39 @@ |
| 4289 | 4545 | "node": ">=8" |
| 4290 | 4546 | } |
| 4291 | 4547 | }, |
| 4548 | "node_modules/reusify": { | |
| 4549 | "version": "1.1.0", | |
| 4550 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", | |
| 4551 | "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", | |
| 4552 | "license": "MIT", | |
| 4553 | "engines": { | |
| 4554 | "iojs": ">=1.0.0", | |
| 4555 | "node": ">=0.10.0" | |
| 4556 | } | |
| 4557 | }, | |
| 4558 | "node_modules/run-parallel": { | |
| 4559 | "version": "1.2.0", | |
| 4560 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", | |
| 4561 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", | |
| 4562 | "funding": [ | |
| 4563 | { | |
| 4564 | "type": "github", | |
| 4565 | "url": "https://github.com/sponsors/feross" | |
| 4566 | }, | |
| 4567 | { | |
| 4568 | "type": "patreon", | |
| 4569 | "url": "https://www.patreon.com/feross" | |
| 4570 | }, | |
| 4571 | { | |
| 4572 | "type": "consulting", | |
| 4573 | "url": "https://feross.org/support" | |
| 4574 | } | |
| 4575 | ], | |
| 4576 | "license": "MIT", | |
| 4577 | "dependencies": { | |
| 4578 | "queue-microtask": "^1.2.2" | |
| 4579 | } | |
| 4580 | }, | |
| 4292 | 4581 | "node_modules/self-closing-tags": { |
| 4293 | 4582 | "version": "1.0.1", |
| 4294 | 4583 | "resolved": "https://registry.npmjs.org/self-closing-tags/-/self-closing-tags-1.0.1.tgz", |
| ... | ... | @@ -4598,6 +4887,18 @@ |
| 4598 | 4887 | "b4a": "^1.6.4" |
| 4599 | 4888 | } |
| 4600 | 4889 | }, |
| 4890 | "node_modules/to-regex-range": { | |
| 4891 | "version": "5.0.1", | |
| 4892 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", | |
| 4893 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", | |
| 4894 | "license": "MIT", | |
| 4895 | "dependencies": { | |
| 4896 | "is-number": "^7.0.0" | |
| 4897 | }, | |
| 4898 | "engines": { | |
| 4899 | "node": ">=8.0" | |
| 4900 | } | |
| 4901 | }, | |
| 4601 | 4902 | "node_modules/trim-lines": { |
| 4602 | 4903 | "version": "3.0.1", |
| 4603 | 4904 | "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", |
| ... | ... | @@ -4618,6 +4919,32 @@ |
| 4618 | 4919 | "url": "https://github.com/sponsors/wooorm" |
| 4619 | 4920 | } |
| 4620 | 4921 | }, |
| 4922 | "node_modules/ts-morph": { | |
| 4923 | "version": "23.0.0", | |
| 4924 | "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-23.0.0.tgz", | |
| 4925 | "integrity": "sha512-FcvFx7a9E8TUe6T3ShihXJLiJOiqyafzFKUO4aqIHDUCIvADdGNShcbc2W5PMr3LerXRv7mafvFZ9lRENxJmug==", | |
| 4926 | "license": "MIT", | |
| 4927 | "dependencies": { | |
| 4928 | "@ts-morph/common": "~0.24.0", | |
| 4929 | "code-block-writer": "^13.0.1" | |
| 4930 | } | |
| 4931 | }, | |
| 4932 | "node_modules/ts-to-jsdoc": { | |
| 4933 | "version": "2.4.0", | |
| 4934 | "resolved": "https://registry.npmjs.org/ts-to-jsdoc/-/ts-to-jsdoc-2.4.0.tgz", | |
| 4935 | "integrity": "sha512-RiI9ipxkLjXESp5+YjXIQJ5GgtjwWTZU4uDahxsIdr1HKLFaC/nQOtgkGRJ+AFxqHrrhwrXtPh093r0nXQwKmw==", | |
| 4936 | "license": "MIT", | |
| 4937 | "dependencies": { | |
| 4938 | "arg": "^5.0.1", | |
| 4939 | "ts-morph": "^23.0.0" | |
| 4940 | }, | |
| 4941 | "bin": { | |
| 4942 | "ts-to-jsdoc": "bin/ts-to-jsdoc" | |
| 4943 | }, | |
| 4944 | "optionalDependencies": { | |
| 4945 | "typescript": "*" | |
| 4946 | } | |
| 4947 | }, | |
| 4621 | 4948 | "node_modules/tslib": { |
| 4622 | 4949 | "version": "2.8.1", |
| 4623 | 4950 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", |
package.json+1| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | "puppeteer": "^24.10.1", |
| 17 | 17 | "sharp": "^0.34.2", |
| 18 | 18 | "source-map-support": "^0.5.21", |
| 19 | "ts-to-jsdoc": "^2.4.0", | |
| 19 | 20 | "unique-names-generator": "^4.7.1", |
| 20 | 21 | "vscode-oniguruma": "^2.0.1", |
| 21 | 22 | "vscode-textmate": "^9.2.0" |
tsconfig.json+2-1| ... | ... | @@ -15,7 +15,8 @@ |
| 15 | 15 | "strict": true, |
| 16 | 16 | "verbatimModuleSyntax": true, |
| 17 | 17 | "target": "es2024", |
| 18 | "noUncheckedIndexedAccess": true | |
| 18 | "noUncheckedIndexedAccess": true, | |
| 19 | "resolveJsonModule": true | |
| 19 | 20 | }, |
| 20 | 21 | "include": ["framework/**/*", "src/**/*", "lib/**/*"] |
| 21 | 22 | } |