@orkestrel/timeout 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/core/index.cjs
CHANGED
|
@@ -34,14 +34,16 @@ var Timeout = class {
|
|
|
34
34
|
id;
|
|
35
35
|
ms;
|
|
36
36
|
#parent;
|
|
37
|
+
#listener;
|
|
37
38
|
#controller = new AbortController();
|
|
38
39
|
#handle;
|
|
39
|
-
#
|
|
40
|
+
#linked = false;
|
|
40
41
|
#expired = false;
|
|
41
42
|
constructor(options) {
|
|
42
43
|
this.id = (0, _orkestrel_contract.isString)(options.id) ? options.id : crypto.randomUUID();
|
|
43
44
|
this.ms = options.ms;
|
|
44
45
|
this.#parent = options.signal;
|
|
46
|
+
this.#listener = this.clear.bind(this);
|
|
45
47
|
}
|
|
46
48
|
get signal() {
|
|
47
49
|
return this.#controller.signal;
|
|
@@ -58,9 +60,10 @@ var Timeout = class {
|
|
|
58
60
|
this.#detach();
|
|
59
61
|
this.#expired = false;
|
|
60
62
|
if (this.#controller.signal.aborted) this.#controller = new AbortController();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
if (this.#parent !== void 0) {
|
|
64
|
+
this.#parent.addEventListener("abort", this.#listener, { once: true });
|
|
65
|
+
this.#linked = true;
|
|
66
|
+
}
|
|
64
67
|
this.#handle = setTimeout(() => {
|
|
65
68
|
this.#handle = void 0;
|
|
66
69
|
this.#expired = true;
|
|
@@ -78,9 +81,9 @@ var Timeout = class {
|
|
|
78
81
|
if (this.#controller.signal.aborted) this.#controller = new AbortController();
|
|
79
82
|
}
|
|
80
83
|
#detach() {
|
|
81
|
-
if (this.#
|
|
84
|
+
if (this.#linked) {
|
|
82
85
|
this.#parent?.removeEventListener("abort", this.#listener);
|
|
83
|
-
this.#
|
|
86
|
+
this.#linked = false;
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["#parent","#controller","#expired","#handle","#detach","#
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["#parent","#listener","#controller","#expired","#handle","#detach","#linked"],"sources":["../../../src/core/Timeout.ts","../../../src/core/factories.ts"],"sourcesContent":["import type { TimeoutInterface, TimeoutOptions } from './types.js'\nimport { isString } from '@orkestrel/contract'\n\n/**\n * A deadline handle — a controllable `setTimeout` wrapper that exposes an\n * `AbortSignal` which fires when the timeout expires, for racing against work.\n *\n * @remarks\n * - **Deadline signal.** `start()` arms a `setTimeout` for `ms`; on expiry it\n * flips `expired` and aborts the controller, firing `signal`. Race `signal`\n * against work to bound how long it may run.\n * - **Controllable.** `clear()` cancels a pending expiry WITHOUT firing `signal`,\n * and resets `expired` back to `false` (the §10 reset) — a cleared timeout\n * reports `expired === false` and a non-aborted `signal`.\n * - **Reusable.** Re-`start()` after an expiry swaps in a fresh controller and\n * resets `expired`, so `signal` / `expired` reflect the new run — the handle is\n * reusable across deadlines without re-construction.\n * - **Parent linking.** A parent `signal` does NOT expire this timeout — it\n * CLEARS it: the parent listener is attached only while a timer is armed (added\n * on `start()`, removed on expiry or `clear()`), so a parent abort during the\n * timing window cancels the pending expiry and a later `start()` is a no-op once\n * the parent has aborted. An idle handle holds no parent listener.\n * - **Event-free.** A pure functional primitive — no Emitter, no events.\n *\n * @example\n * ```ts\n * const timeout = new Timeout({ ms: 5_000 })\n * timeout.start()\n * timeout.signal.addEventListener('abort', () => giveUp(), { once: true })\n * timeout.clear() // cancels the deadline before it fires\n * ```\n */\nexport class Timeout implements TimeoutInterface {\n\treadonly id: string\n\treadonly ms: number\n\treadonly #parent: AbortSignal | undefined\n\treadonly #listener: () => void\n\t#controller = new AbortController()\n\t#handle: ReturnType<typeof setTimeout> | undefined\n\t#linked = false\n\t#expired = false\n\n\tconstructor(options: TimeoutOptions) {\n\t\t// Construction is the defensive JS boundary — validate here so the\n\t\t// start()/clear() hot paths stay dependency-free.\n\t\tthis.id = isString(options.id) ? options.id : crypto.randomUUID()\n\t\tthis.ms = options.ms\n\t\tthis.#parent = options.signal\n\t\tthis.#listener = this.clear.bind(this)\n\t}\n\n\tget signal(): AbortSignal {\n\t\treturn this.#controller.signal\n\t}\n\n\tget expired(): boolean {\n\t\treturn this.#expired\n\t}\n\n\tstart(): void {\n\t\t// Once the parent has aborted, the deadline must never fire.\n\t\tif (this.#parent?.aborted === true) return\n\t\t// Re-arm cleanly: drop any pending timer + parent listener from a prior run.\n\t\tif (this.#handle !== undefined) {\n\t\t\tclearTimeout(this.#handle)\n\t\t\tthis.#handle = undefined\n\t\t}\n\t\tthis.#detach()\n\t\tthis.#expired = false\n\t\t// Swap in a fresh controller only when the current one has already fired, so a\n\t\t// re-armed run gets a clean `signal` while a listener attached before the FIRST\n\t\t// `start()` (on the construction-time signal) survives to fire on expiry.\n\t\tif (this.#controller.signal.aborted) this.#controller = new AbortController()\n\t\t// Link the parent only for the lifetime of this timer — a parent abort CLEARS\n\t\t// the timeout (so it never expires); the listener is removed when the timer settles.\n\t\tif (this.#parent !== undefined) {\n\t\t\tthis.#parent.addEventListener('abort', this.#listener, { once: true })\n\t\t\tthis.#linked = true\n\t\t}\n\t\tthis.#handle = setTimeout(() => {\n\t\t\tthis.#handle = undefined\n\t\t\tthis.#expired = true\n\t\t\tthis.#controller.abort()\n\t\t\t// The timer fired — drop the parent listener so a later parent abort can no\n\t\t\t// longer reach `clear()` and un-expire this legitimate expiry.\n\t\t\tthis.#detach()\n\t\t}, this.ms)\n\t}\n\n\tclear(): void {\n\t\tif (this.#handle !== undefined) {\n\t\t\tclearTimeout(this.#handle)\n\t\t\tthis.#handle = undefined\n\t\t}\n\t\tthis.#detach()\n\t\tthis.#expired = false\n\t\t// If the controller had already fired, swap a fresh one so a cleared timeout\n\t\t// reports `expired === false` AND a non-aborted `signal`, consistently.\n\t\tif (this.#controller.signal.aborted) this.#controller = new AbortController()\n\t}\n\n\t// Remove the parent-abort listener if one is currently attached.\n\t#detach(): void {\n\t\tif (this.#linked) {\n\t\t\tthis.#parent?.removeEventListener('abort', this.#listener)\n\t\t\tthis.#linked = false\n\t\t}\n\t}\n}\n","import type { TimeoutInterface, TimeoutOptions } from './types.js'\nimport { Timeout } from './Timeout.js'\n\n/**\n * Create a deadline handle — a controllable `setTimeout` wrapper that exposes an\n * `AbortSignal` which fires when the timeout expires, for racing against work.\n *\n * @remarks\n * Call `start()` to arm the deadline for `ms` milliseconds; on expiry the handle's\n * `signal` fires and `expired` flips `true`. Call `clear()` to cancel a pending\n * deadline without firing. When `options.signal` is given, a parent abort CLEARS\n * the timeout (it never expires) rather than firing it. Pass `options.id` to label\n * the handle for tracing, or let it default to a random UUID. `ms` must be a\n * non-negative finite number; the host `setTimeout` clamps a negative or `NaN`\n * value to roughly `0` (firing on the next macrotask) rather than throwing.\n *\n * @param options - `ms` (the deadline in milliseconds, a non-negative finite\n * number), an optional `id` (a trace label; defaults to a random UUID), and an\n * optional parent `signal` whose abort clears the timeout\n * @returns A working {@link TimeoutInterface}\n *\n * @example\n * ```ts\n * import { createTimeout } from '@src/core'\n *\n * const timeout = createTimeout({ ms: 5_000 })\n * timeout.start()\n * const result = await Promise.race([\n * \twork(),\n * \tnew Promise((_, reject) =>\n * \t\ttimeout.signal.addEventListener('abort', () => reject(new Error('timed out')), {\n * \t\t\tonce: true,\n * \t\t}),\n * \t),\n * ])\n * timeout.clear() // work finished first — cancel the deadline\n * ```\n */\nexport function createTimeout(options: TimeoutOptions): TimeoutInterface {\n\treturn new Timeout(options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAa,UAAb,MAAiD;CAChD;CACA;CACA;CACA;CACA,cAAc,IAAI,gBAAgB;CAClC;CACA,UAAU;CACV,WAAW;CAEX,YAAY,SAAyB;EAGpC,KAAK,MAAA,GAAA,oBAAA,SAAA,CAAc,QAAQ,EAAE,IAAI,QAAQ,KAAK,OAAO,WAAW;EAChE,KAAK,KAAK,QAAQ;EAClB,KAAKA,UAAU,QAAQ;EACvB,KAAKC,YAAY,KAAK,MAAM,KAAK,IAAI;CACtC;CAEA,IAAI,SAAsB;EACzB,OAAO,KAAKC,YAAY;CACzB;CAEA,IAAI,UAAmB;EACtB,OAAO,KAAKC;CACb;CAEA,QAAc;EAEb,IAAI,KAAKH,SAAS,YAAY,MAAM;EAEpC,IAAI,KAAKI,YAAY,KAAA,GAAW;GAC/B,aAAa,KAAKA,OAAO;GACzB,KAAKA,UAAU,KAAA;EAChB;EACA,KAAKC,QAAQ;EACb,KAAKF,WAAW;EAIhB,IAAI,KAAKD,YAAY,OAAO,SAAS,KAAKA,cAAc,IAAI,gBAAgB;EAG5E,IAAI,KAAKF,YAAY,KAAA,GAAW;GAC/B,KAAKA,QAAQ,iBAAiB,SAAS,KAAKC,WAAW,EAAE,MAAM,KAAK,CAAC;GACrE,KAAKK,UAAU;EAChB;EACA,KAAKF,UAAU,iBAAiB;GAC/B,KAAKA,UAAU,KAAA;GACf,KAAKD,WAAW;GAChB,KAAKD,YAAY,MAAM;GAGvB,KAAKG,QAAQ;EACd,GAAG,KAAK,EAAE;CACX;CAEA,QAAc;EACb,IAAI,KAAKD,YAAY,KAAA,GAAW;GAC/B,aAAa,KAAKA,OAAO;GACzB,KAAKA,UAAU,KAAA;EAChB;EACA,KAAKC,QAAQ;EACb,KAAKF,WAAW;EAGhB,IAAI,KAAKD,YAAY,OAAO,SAAS,KAAKA,cAAc,IAAI,gBAAgB;CAC7E;CAGA,UAAgB;EACf,IAAI,KAAKI,SAAS;GACjB,KAAKN,SAAS,oBAAoB,SAAS,KAAKC,SAAS;GACzD,KAAKK,UAAU;EAChB;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtEA,SAAgB,cAAc,SAA2C;CACxE,OAAO,IAAI,QAAQ,OAAO;AAC3B"}
|
package/dist/src/core/index.js
CHANGED
|
@@ -33,14 +33,16 @@ var Timeout = class {
|
|
|
33
33
|
id;
|
|
34
34
|
ms;
|
|
35
35
|
#parent;
|
|
36
|
+
#listener;
|
|
36
37
|
#controller = new AbortController();
|
|
37
38
|
#handle;
|
|
38
|
-
#
|
|
39
|
+
#linked = false;
|
|
39
40
|
#expired = false;
|
|
40
41
|
constructor(options) {
|
|
41
42
|
this.id = isString(options.id) ? options.id : crypto.randomUUID();
|
|
42
43
|
this.ms = options.ms;
|
|
43
44
|
this.#parent = options.signal;
|
|
45
|
+
this.#listener = this.clear.bind(this);
|
|
44
46
|
}
|
|
45
47
|
get signal() {
|
|
46
48
|
return this.#controller.signal;
|
|
@@ -57,9 +59,10 @@ var Timeout = class {
|
|
|
57
59
|
this.#detach();
|
|
58
60
|
this.#expired = false;
|
|
59
61
|
if (this.#controller.signal.aborted) this.#controller = new AbortController();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
if (this.#parent !== void 0) {
|
|
63
|
+
this.#parent.addEventListener("abort", this.#listener, { once: true });
|
|
64
|
+
this.#linked = true;
|
|
65
|
+
}
|
|
63
66
|
this.#handle = setTimeout(() => {
|
|
64
67
|
this.#handle = void 0;
|
|
65
68
|
this.#expired = true;
|
|
@@ -77,9 +80,9 @@ var Timeout = class {
|
|
|
77
80
|
if (this.#controller.signal.aborted) this.#controller = new AbortController();
|
|
78
81
|
}
|
|
79
82
|
#detach() {
|
|
80
|
-
if (this.#
|
|
83
|
+
if (this.#linked) {
|
|
81
84
|
this.#parent?.removeEventListener("abort", this.#listener);
|
|
82
|
-
this.#
|
|
85
|
+
this.#linked = false;
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["#parent","#controller","#expired","#handle","#detach","#
|
|
1
|
+
{"version":3,"file":"index.js","names":["#parent","#listener","#controller","#expired","#handle","#detach","#linked"],"sources":["../../../src/core/Timeout.ts","../../../src/core/factories.ts"],"sourcesContent":["import type { TimeoutInterface, TimeoutOptions } from './types.js'\nimport { isString } from '@orkestrel/contract'\n\n/**\n * A deadline handle — a controllable `setTimeout` wrapper that exposes an\n * `AbortSignal` which fires when the timeout expires, for racing against work.\n *\n * @remarks\n * - **Deadline signal.** `start()` arms a `setTimeout` for `ms`; on expiry it\n * flips `expired` and aborts the controller, firing `signal`. Race `signal`\n * against work to bound how long it may run.\n * - **Controllable.** `clear()` cancels a pending expiry WITHOUT firing `signal`,\n * and resets `expired` back to `false` (the §10 reset) — a cleared timeout\n * reports `expired === false` and a non-aborted `signal`.\n * - **Reusable.** Re-`start()` after an expiry swaps in a fresh controller and\n * resets `expired`, so `signal` / `expired` reflect the new run — the handle is\n * reusable across deadlines without re-construction.\n * - **Parent linking.** A parent `signal` does NOT expire this timeout — it\n * CLEARS it: the parent listener is attached only while a timer is armed (added\n * on `start()`, removed on expiry or `clear()`), so a parent abort during the\n * timing window cancels the pending expiry and a later `start()` is a no-op once\n * the parent has aborted. An idle handle holds no parent listener.\n * - **Event-free.** A pure functional primitive — no Emitter, no events.\n *\n * @example\n * ```ts\n * const timeout = new Timeout({ ms: 5_000 })\n * timeout.start()\n * timeout.signal.addEventListener('abort', () => giveUp(), { once: true })\n * timeout.clear() // cancels the deadline before it fires\n * ```\n */\nexport class Timeout implements TimeoutInterface {\n\treadonly id: string\n\treadonly ms: number\n\treadonly #parent: AbortSignal | undefined\n\treadonly #listener: () => void\n\t#controller = new AbortController()\n\t#handle: ReturnType<typeof setTimeout> | undefined\n\t#linked = false\n\t#expired = false\n\n\tconstructor(options: TimeoutOptions) {\n\t\t// Construction is the defensive JS boundary — validate here so the\n\t\t// start()/clear() hot paths stay dependency-free.\n\t\tthis.id = isString(options.id) ? options.id : crypto.randomUUID()\n\t\tthis.ms = options.ms\n\t\tthis.#parent = options.signal\n\t\tthis.#listener = this.clear.bind(this)\n\t}\n\n\tget signal(): AbortSignal {\n\t\treturn this.#controller.signal\n\t}\n\n\tget expired(): boolean {\n\t\treturn this.#expired\n\t}\n\n\tstart(): void {\n\t\t// Once the parent has aborted, the deadline must never fire.\n\t\tif (this.#parent?.aborted === true) return\n\t\t// Re-arm cleanly: drop any pending timer + parent listener from a prior run.\n\t\tif (this.#handle !== undefined) {\n\t\t\tclearTimeout(this.#handle)\n\t\t\tthis.#handle = undefined\n\t\t}\n\t\tthis.#detach()\n\t\tthis.#expired = false\n\t\t// Swap in a fresh controller only when the current one has already fired, so a\n\t\t// re-armed run gets a clean `signal` while a listener attached before the FIRST\n\t\t// `start()` (on the construction-time signal) survives to fire on expiry.\n\t\tif (this.#controller.signal.aborted) this.#controller = new AbortController()\n\t\t// Link the parent only for the lifetime of this timer — a parent abort CLEARS\n\t\t// the timeout (so it never expires); the listener is removed when the timer settles.\n\t\tif (this.#parent !== undefined) {\n\t\t\tthis.#parent.addEventListener('abort', this.#listener, { once: true })\n\t\t\tthis.#linked = true\n\t\t}\n\t\tthis.#handle = setTimeout(() => {\n\t\t\tthis.#handle = undefined\n\t\t\tthis.#expired = true\n\t\t\tthis.#controller.abort()\n\t\t\t// The timer fired — drop the parent listener so a later parent abort can no\n\t\t\t// longer reach `clear()` and un-expire this legitimate expiry.\n\t\t\tthis.#detach()\n\t\t}, this.ms)\n\t}\n\n\tclear(): void {\n\t\tif (this.#handle !== undefined) {\n\t\t\tclearTimeout(this.#handle)\n\t\t\tthis.#handle = undefined\n\t\t}\n\t\tthis.#detach()\n\t\tthis.#expired = false\n\t\t// If the controller had already fired, swap a fresh one so a cleared timeout\n\t\t// reports `expired === false` AND a non-aborted `signal`, consistently.\n\t\tif (this.#controller.signal.aborted) this.#controller = new AbortController()\n\t}\n\n\t// Remove the parent-abort listener if one is currently attached.\n\t#detach(): void {\n\t\tif (this.#linked) {\n\t\t\tthis.#parent?.removeEventListener('abort', this.#listener)\n\t\t\tthis.#linked = false\n\t\t}\n\t}\n}\n","import type { TimeoutInterface, TimeoutOptions } from './types.js'\nimport { Timeout } from './Timeout.js'\n\n/**\n * Create a deadline handle — a controllable `setTimeout` wrapper that exposes an\n * `AbortSignal` which fires when the timeout expires, for racing against work.\n *\n * @remarks\n * Call `start()` to arm the deadline for `ms` milliseconds; on expiry the handle's\n * `signal` fires and `expired` flips `true`. Call `clear()` to cancel a pending\n * deadline without firing. When `options.signal` is given, a parent abort CLEARS\n * the timeout (it never expires) rather than firing it. Pass `options.id` to label\n * the handle for tracing, or let it default to a random UUID. `ms` must be a\n * non-negative finite number; the host `setTimeout` clamps a negative or `NaN`\n * value to roughly `0` (firing on the next macrotask) rather than throwing.\n *\n * @param options - `ms` (the deadline in milliseconds, a non-negative finite\n * number), an optional `id` (a trace label; defaults to a random UUID), and an\n * optional parent `signal` whose abort clears the timeout\n * @returns A working {@link TimeoutInterface}\n *\n * @example\n * ```ts\n * import { createTimeout } from '@src/core'\n *\n * const timeout = createTimeout({ ms: 5_000 })\n * timeout.start()\n * const result = await Promise.race([\n * \twork(),\n * \tnew Promise((_, reject) =>\n * \t\ttimeout.signal.addEventListener('abort', () => reject(new Error('timed out')), {\n * \t\t\tonce: true,\n * \t\t}),\n * \t),\n * ])\n * timeout.clear() // work finished first — cancel the deadline\n * ```\n */\nexport function createTimeout(options: TimeoutOptions): TimeoutInterface {\n\treturn new Timeout(options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAa,UAAb,MAAiD;CAChD;CACA;CACA;CACA;CACA,cAAc,IAAI,gBAAgB;CAClC;CACA,UAAU;CACV,WAAW;CAEX,YAAY,SAAyB;EAGpC,KAAK,KAAK,SAAS,QAAQ,EAAE,IAAI,QAAQ,KAAK,OAAO,WAAW;EAChE,KAAK,KAAK,QAAQ;EAClB,KAAKA,UAAU,QAAQ;EACvB,KAAKC,YAAY,KAAK,MAAM,KAAK,IAAI;CACtC;CAEA,IAAI,SAAsB;EACzB,OAAO,KAAKC,YAAY;CACzB;CAEA,IAAI,UAAmB;EACtB,OAAO,KAAKC;CACb;CAEA,QAAc;EAEb,IAAI,KAAKH,SAAS,YAAY,MAAM;EAEpC,IAAI,KAAKI,YAAY,KAAA,GAAW;GAC/B,aAAa,KAAKA,OAAO;GACzB,KAAKA,UAAU,KAAA;EAChB;EACA,KAAKC,QAAQ;EACb,KAAKF,WAAW;EAIhB,IAAI,KAAKD,YAAY,OAAO,SAAS,KAAKA,cAAc,IAAI,gBAAgB;EAG5E,IAAI,KAAKF,YAAY,KAAA,GAAW;GAC/B,KAAKA,QAAQ,iBAAiB,SAAS,KAAKC,WAAW,EAAE,MAAM,KAAK,CAAC;GACrE,KAAKK,UAAU;EAChB;EACA,KAAKF,UAAU,iBAAiB;GAC/B,KAAKA,UAAU,KAAA;GACf,KAAKD,WAAW;GAChB,KAAKD,YAAY,MAAM;GAGvB,KAAKG,QAAQ;EACd,GAAG,KAAK,EAAE;CACX;CAEA,QAAc;EACb,IAAI,KAAKD,YAAY,KAAA,GAAW;GAC/B,aAAa,KAAKA,OAAO;GACzB,KAAKA,UAAU,KAAA;EAChB;EACA,KAAKC,QAAQ;EACb,KAAKF,WAAW;EAGhB,IAAI,KAAKD,YAAY,OAAO,SAAS,KAAKA,cAAc,IAAI,gBAAgB;CAC7E;CAGA,UAAgB;EACf,IAAI,KAAKI,SAAS;GACjB,KAAKN,SAAS,oBAAoB,SAAS,KAAKC,SAAS;GACzD,KAAKK,UAAU;EAChB;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtEA,SAAgB,cAAc,SAA2C;CACxE,OAAO,IAAI,QAAQ,OAAO;AAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orkestrel/timeout",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A typed, controllable setTimeout wrapper — an AbortSignal deadline with start/clear lifecycle and parent-signal linking. Part of the @orkestrel line.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"abort-signal",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "git+https://github.com/orkestrel/timeout.git"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist",
|
|
21
|
+
"dist/src",
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"type": "module",
|
|
@@ -43,19 +43,20 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"clean": "node -e \"
|
|
46
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
47
47
|
"copy": "node -e \"const fs=require('node:fs'),p=require('node:path'),a=process.argv[1],b=process.argv[2];fs.mkdirSync(p.dirname(b),{recursive:true});fs.cpSync(a,b,{force:true});console.log('Copied: '+a+' to '+b)\"",
|
|
48
|
-
"
|
|
49
|
-
"lint": "oxlint --config .oxlintrc.json --fix .",
|
|
48
|
+
"scaffold": "scaffold",
|
|
49
|
+
"lint": "oxlint --config .oxlintrc.json --fix --deny-warnings .",
|
|
50
50
|
"check": "tsc --noEmit --project tsconfig.json && npm run check:src",
|
|
51
51
|
"check:src": "npm run check:src:core",
|
|
52
52
|
"check:src:core": "tsc --noEmit -p configs/src/tsconfig.core.json",
|
|
53
53
|
"format": "oxfmt --config .oxfmtrc.json --write .",
|
|
54
54
|
"format:check": "oxfmt --config .oxfmtrc.json --check .",
|
|
55
|
-
"lint:check": "oxlint --config .oxlintrc.json .",
|
|
56
|
-
"test": "npm run test:src && npm run test:guides",
|
|
55
|
+
"lint:check": "oxlint --config .oxlintrc.json --deny-warnings .",
|
|
56
|
+
"test": "npm run test:src && npm run test:policy && npm run test:guides",
|
|
57
57
|
"test:src": "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:core",
|
|
58
58
|
"test:src:core": "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:core",
|
|
59
|
+
"test:policy": "vitest run --config vite.config.ts --no-cache --reporter=dot --project policy",
|
|
59
60
|
"test:guides": "vitest run --config vite.config.ts --reporter=dot --project guides",
|
|
60
61
|
"build": "npm run clean && npm run build:src",
|
|
61
62
|
"build:src": "npm run build:src:core",
|
|
@@ -63,20 +64,22 @@
|
|
|
63
64
|
"prepublishOnly": "npm run format:check && npm run lint:check && npm run check && npm run build && npm test"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@orkestrel/contract": "^0.0.
|
|
67
|
+
"@orkestrel/contract": "^0.0.8"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@microsoft/api-extractor": "^7.58.
|
|
70
|
+
"@microsoft/api-extractor": "^7.58.12",
|
|
70
71
|
"@orkestrel/guide": "^0.0.5",
|
|
71
|
-
"@
|
|
72
|
-
"
|
|
73
|
-
"
|
|
72
|
+
"@orkestrel/scaffold": "^0.0.6",
|
|
73
|
+
"@types/node": "^26.1.2",
|
|
74
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
75
|
+
"oxfmt": "^0.61.0",
|
|
76
|
+
"oxlint": "^1.76.0",
|
|
74
77
|
"typescript": "^6.0.3",
|
|
75
78
|
"vite": "^8.1.5",
|
|
76
79
|
"vite-plugin-dts": "^5.0.3",
|
|
77
80
|
"vitest": "^4.1.10"
|
|
78
81
|
},
|
|
79
82
|
"engines": {
|
|
80
|
-
"node": ">=22"
|
|
83
|
+
"node": ">=22.12.0"
|
|
81
84
|
}
|
|
82
85
|
}
|