@vielzeug/ore 2.1.0 → 2.2.0

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.
@@ -1,2 +1,2 @@
1
- const e=require("../errors.cjs"),t=require("../runtime.cjs");var n=1e3;async function r(r={}){let{logger:i}=r;i?.(`[flush] draining pending component work (scheduled mount callbacks)`);let a=0;for(;t.hasPendingWork();){if(++a>n)throw new e.OreTimeoutError(`flush(): pending component work did not settle after ${n} microtask turns — check for a component whose onMounted callback keeps re-registering itself.`);i?.(`[flush] pending work remains, turn ${a}`),await Promise.resolve()}i?.(`[flush] draining requestAnimationFrame`),await new Promise(e=>typeof requestAnimationFrame<`u`?requestAnimationFrame(()=>e()):e()),i?.(`[flush] final microtask pass`),await Promise.resolve(),i?.(`[flush] complete`)}async function i(){return r({logger:console.debug})}exports.debugFlush=i,exports.flush=r;
1
+ const e=require("../errors.cjs"),t=require("../runtime.cjs");var n=class extends e.OreError{},r=1e3;async function i(e={}){let{logger:i}=e;i?.(`[flush] draining pending component work (scheduled mount callbacks)`);let a=0;for(;t.hasPendingWork();){if(++a>r)throw new n(`flush(): pending component work did not settle after ${r} microtask turns — check for a component whose onMounted callback keeps re-registering itself.`);i?.(`[flush] pending work remains, turn ${a}`),await Promise.resolve()}i?.(`[flush] draining requestAnimationFrame`),await new Promise(e=>typeof requestAnimationFrame<`u`?requestAnimationFrame(()=>e()):e()),i?.(`[flush] final microtask pass`),await Promise.resolve(),i?.(`[flush] complete`)}async function a(){return i({logger:console.debug})}exports.OreTimeoutError=n,exports.debugFlush=a,exports.flush=i;
2
2
  //# sourceMappingURL=flush.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"flush.cjs","names":[],"sources":["../../src/testing/flush.ts"],"sourcesContent":["/**\n * Reactive update flushing utilities for test environments.\n */\n\nimport { OreTimeoutError } from '../errors';\nimport { hasPendingWork } from '../runtime';\n\n// Defensive cap against a genuine bug (e.g. an onMounted callback that always registers\n// another onMounted, looping forever) — not a \"how much is normally enough\" guess like the\n// old fixed turn count was. Microtask polls are cheap, so this is generous.\nconst MAX_FLUSH_ITERATIONS = 1000;\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\n/**\n * Options for flushing pending reactive updates.\n */\nexport interface FlushOptions {\n /**\n * Logger function called with each diagnostic message during the flush.\n * Pass `console.debug` or any `(msg: string) => void` to enable output.\n * Omit (or pass `undefined`) to disable all logging.\n *\n * Prefer `debugFlush()` (also from `@vielzeug/ore/testing`) over wiring this manually.\n */\n logger?: (msg: string) => void;\n}\n\n// ─── Core ────────────────────────────────────────────────────────────────────\n\n/**\n * Flush pending reactive updates: waits for every tracked in-flight component\n * operation (scheduled `onMounted` microtasks — including ones registered by other\n * `onMounted` callbacks) to settle, then yields one animation frame and one final\n * microtask pass for rAF-scheduled work.\n *\n * This is deterministic, not a fixed number of guessed turns — `@vielzeug/ripple`'s\n * reactive graph itself settles synchronously on every signal write, so the only real\n * asynchrony to wait for is ore's own component scheduling (see `runtime.ts`'s\n * `hasPendingWork()`). There is no \"deep\" variant to reach for anymore: `flush()` waits\n * for exactly as much work as is actually pending, however deep that turns out to be.\n *\n * @example\n * ```ts\n * // Standard flush — waits for whatever is actually pending, shallow or deep\n * await flush();\n *\n * // Debug timing issues\n * await flush({ logger: console.debug });\n * ```\n *\n * @throws `OreTimeoutError` if pending work never settles within {@link MAX_FLUSH_ITERATIONS}\n * microtask turns — almost always a sign of a genuine bug (e.g. an `onMounted` callback that\n * keeps re-registering itself), not a case for raising a limit.\n */\nexport async function flush(options: FlushOptions = {}): Promise<void> {\n const { logger } = options;\n\n logger?.('[flush] draining pending component work (scheduled mount callbacks)');\n\n let turns = 0;\n\n while (hasPendingWork()) {\n if (++turns > MAX_FLUSH_ITERATIONS) {\n throw new OreTimeoutError(\n `flush(): pending component work did not settle after ${MAX_FLUSH_ITERATIONS} microtask turns — ` +\n `check for a component whose onMounted callback keeps re-registering itself.`,\n );\n }\n\n logger?.(`[flush] pending work remains, turn ${turns}`);\n await Promise.resolve();\n }\n\n logger?.('[flush] draining requestAnimationFrame');\n\n await new Promise<void>((resolve) =>\n typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(() => resolve()) : resolve(),\n );\n\n logger?.('[flush] final microtask pass');\n\n await Promise.resolve();\n\n logger?.('[flush] complete');\n}\n\n/**\n * `flush()` with debug logging pre-wired to `console.debug`. Logs each phase and pending-work\n * turn so you can diagnose unexpected update order or timing issues.\n *\n * @example\n * ```ts\n * import { debugFlush } from '@vielzeug/ore/testing';\n *\n * // in a test\n * await debugFlush();\n * // [flush] draining pending component work (scheduled mount callbacks)\n * // [flush] pending work remains, turn 1\n * // ...\n * ```\n */\nexport async function debugFlush(): Promise<void> {\n return flush({ logger: console.debug });\n}\n"],"mappings":"6DAUA,IAAM,EAAuB,IA6C7B,eAAsB,EAAM,EAAwB,CAAC,EAAkB,CACrE,GAAM,CAAE,UAAW,EAEnB,IAAS,qEAAqE,EAE9E,IAAI,EAAQ,EAEZ,KAAO,EAAA,eAAe,GAAG,CACvB,GAAI,EAAE,EAAQ,EACZ,MAAM,IAAI,EAAA,gBACR,wDAAwD,EAAqB,+FAE/E,EAGF,IAAS,sCAAsC,GAAO,EACtD,MAAM,QAAQ,QAAQ,CACxB,CAEA,IAAS,wCAAwC,EAEjD,MAAM,IAAI,QAAe,GACvB,OAAO,sBAA0B,IAAc,0BAA4B,EAAQ,CAAC,EAAI,EAAQ,CAClG,EAEA,IAAS,8BAA8B,EAEvC,MAAM,QAAQ,QAAQ,EAEtB,IAAS,kBAAkB,CAC7B,CAiBA,eAAsB,GAA4B,CAChD,OAAO,EAAM,CAAE,OAAQ,QAAQ,KAAM,CAAC,CACxC"}
1
+ {"version":3,"file":"flush.cjs","names":[],"sources":["../../src/testing/flush.ts"],"sourcesContent":["/**\n * Reactive update flushing utilities for test environments.\n */\n\nimport { OreError } from '../errors';\nimport { hasPendingWork } from '../runtime';\n\n/** Thrown by `flush()` when pending component work doesn't settle within the timeout. */\nexport class OreTimeoutError extends OreError {}\n\n// Defensive cap against a genuine bug (e.g. an onMounted callback that always registers\n// another onMounted, looping forever) — not a \"how much is normally enough\" guess like the\n// old fixed turn count was. Microtask polls are cheap, so this is generous.\nconst MAX_FLUSH_ITERATIONS = 1000;\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\n/**\n * Options for flushing pending reactive updates.\n */\nexport interface FlushOptions {\n /**\n * Logger function called with each diagnostic message during the flush.\n * Pass `console.debug` or any `(msg: string) => void` to enable output.\n * Omit (or pass `undefined`) to disable all logging.\n *\n * Prefer `debugFlush()` (also from `@vielzeug/ore/testing`) over wiring this manually.\n */\n logger?: (msg: string) => void;\n}\n\n// ─── Core ────────────────────────────────────────────────────────────────────\n\n/**\n * Flush pending reactive updates: waits for every tracked in-flight component\n * operation (scheduled `onMounted` microtasks — including ones registered by other\n * `onMounted` callbacks) to settle, then yields one animation frame and one final\n * microtask pass for rAF-scheduled work.\n *\n * This is deterministic, not a fixed number of guessed turns — `@vielzeug/ripple`'s\n * reactive graph itself settles synchronously on every signal write, so the only real\n * asynchrony to wait for is ore's own component scheduling (see `runtime.ts`'s\n * `hasPendingWork()`). There is no \"deep\" variant to reach for anymore: `flush()` waits\n * for exactly as much work as is actually pending, however deep that turns out to be.\n *\n * @example\n * ```ts\n * // Standard flush — waits for whatever is actually pending, shallow or deep\n * await flush();\n *\n * // Debug timing issues\n * await flush({ logger: console.debug });\n * ```\n *\n * @throws `OreTimeoutError` if pending work never settles within {@link MAX_FLUSH_ITERATIONS}\n * microtask turns — almost always a sign of a genuine bug (e.g. an `onMounted` callback that\n * keeps re-registering itself), not a case for raising a limit.\n */\nexport async function flush(options: FlushOptions = {}): Promise<void> {\n const { logger } = options;\n\n logger?.('[flush] draining pending component work (scheduled mount callbacks)');\n\n let turns = 0;\n\n while (hasPendingWork()) {\n if (++turns > MAX_FLUSH_ITERATIONS) {\n throw new OreTimeoutError(\n `flush(): pending component work did not settle after ${MAX_FLUSH_ITERATIONS} microtask turns — ` +\n `check for a component whose onMounted callback keeps re-registering itself.`,\n );\n }\n\n logger?.(`[flush] pending work remains, turn ${turns}`);\n await Promise.resolve();\n }\n\n logger?.('[flush] draining requestAnimationFrame');\n\n await new Promise<void>((resolve) =>\n typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(() => resolve()) : resolve(),\n );\n\n logger?.('[flush] final microtask pass');\n\n await Promise.resolve();\n\n logger?.('[flush] complete');\n}\n\n/**\n * `flush()` with debug logging pre-wired to `console.debug`. Logs each phase and pending-work\n * turn so you can diagnose unexpected update order or timing issues.\n *\n * @example\n * ```ts\n * import { debugFlush } from '@vielzeug/ore/testing';\n *\n * // in a test\n * await debugFlush();\n * // [flush] draining pending component work (scheduled mount callbacks)\n * // [flush] pending work remains, turn 1\n * // ...\n * ```\n */\nexport async function debugFlush(): Promise<void> {\n return flush({ logger: console.debug });\n}\n"],"mappings":"6DAQA,IAAa,EAAb,cAAqC,EAAA,QAAS,CAAC,EAKzC,EAAuB,IA6C7B,eAAsB,EAAM,EAAwB,CAAC,EAAkB,CACrE,GAAM,CAAE,UAAW,EAEnB,IAAS,qEAAqE,EAE9E,IAAI,EAAQ,EAEZ,KAAO,EAAA,eAAe,GAAG,CACvB,GAAI,EAAE,EAAQ,EACZ,MAAM,IAAI,EACR,wDAAwD,EAAqB,+FAE/E,EAGF,IAAS,sCAAsC,GAAO,EACtD,MAAM,QAAQ,QAAQ,CACxB,CAEA,IAAS,wCAAwC,EAEjD,MAAM,IAAI,QAAe,GACvB,OAAO,sBAA0B,IAAc,0BAA4B,EAAQ,CAAC,EAAI,EAAQ,CAClG,EAEA,IAAS,8BAA8B,EAEvC,MAAM,QAAQ,QAAQ,EAEtB,IAAS,kBAAkB,CAC7B,CAiBA,eAAsB,GAA4B,CAChD,OAAO,EAAM,CAAE,OAAQ,QAAQ,KAAM,CAAC,CACxC"}
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * Reactive update flushing utilities for test environments.
3
3
  */
4
+ import { OreError } from '../errors';
5
+ /** Thrown by `flush()` when pending component work doesn't settle within the timeout. */
6
+ export declare class OreTimeoutError extends OreError {
7
+ }
4
8
  /**
5
9
  * Options for flushing pending reactive updates.
6
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"flush.d.ts","sourceRoot":"","sources":["../../src/testing/flush.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhD"}
1
+ {"version":3,"file":"flush.d.ts","sourceRoot":"","sources":["../../src/testing/flush.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,yFAAyF;AACzF,qBAAa,eAAgB,SAAQ,QAAQ;CAAG;AAShD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhD"}
@@ -1,2 +1,2 @@
1
- import{OreTimeoutError as e}from"../errors.js";import{hasPendingWork as t}from"../runtime.js";var n=1e3;async function r(r={}){let{logger:i}=r;i?.(`[flush] draining pending component work (scheduled mount callbacks)`);let a=0;for(;t();){if(++a>n)throw new e(`flush(): pending component work did not settle after ${n} microtask turns — check for a component whose onMounted callback keeps re-registering itself.`);i?.(`[flush] pending work remains, turn ${a}`),await Promise.resolve()}i?.(`[flush] draining requestAnimationFrame`),await new Promise(e=>typeof requestAnimationFrame<`u`?requestAnimationFrame(()=>e()):e()),i?.(`[flush] final microtask pass`),await Promise.resolve(),i?.(`[flush] complete`)}async function i(){return r({logger:console.debug})}export{i as debugFlush,r as flush};
1
+ import{OreError as e}from"../errors.js";import{hasPendingWork as t}from"../runtime.js";var n=class extends e{},r=1e3;async function i(e={}){let{logger:i}=e;i?.(`[flush] draining pending component work (scheduled mount callbacks)`);let a=0;for(;t();){if(++a>r)throw new n(`flush(): pending component work did not settle after ${r} microtask turns — check for a component whose onMounted callback keeps re-registering itself.`);i?.(`[flush] pending work remains, turn ${a}`),await Promise.resolve()}i?.(`[flush] draining requestAnimationFrame`),await new Promise(e=>typeof requestAnimationFrame<`u`?requestAnimationFrame(()=>e()):e()),i?.(`[flush] final microtask pass`),await Promise.resolve(),i?.(`[flush] complete`)}async function a(){return i({logger:console.debug})}export{n as OreTimeoutError,a as debugFlush,i as flush};
2
2
  //# sourceMappingURL=flush.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flush.js","names":[],"sources":["../../src/testing/flush.ts"],"sourcesContent":["/**\n * Reactive update flushing utilities for test environments.\n */\n\nimport { OreTimeoutError } from '../errors';\nimport { hasPendingWork } from '../runtime';\n\n// Defensive cap against a genuine bug (e.g. an onMounted callback that always registers\n// another onMounted, looping forever) — not a \"how much is normally enough\" guess like the\n// old fixed turn count was. Microtask polls are cheap, so this is generous.\nconst MAX_FLUSH_ITERATIONS = 1000;\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\n/**\n * Options for flushing pending reactive updates.\n */\nexport interface FlushOptions {\n /**\n * Logger function called with each diagnostic message during the flush.\n * Pass `console.debug` or any `(msg: string) => void` to enable output.\n * Omit (or pass `undefined`) to disable all logging.\n *\n * Prefer `debugFlush()` (also from `@vielzeug/ore/testing`) over wiring this manually.\n */\n logger?: (msg: string) => void;\n}\n\n// ─── Core ────────────────────────────────────────────────────────────────────\n\n/**\n * Flush pending reactive updates: waits for every tracked in-flight component\n * operation (scheduled `onMounted` microtasks — including ones registered by other\n * `onMounted` callbacks) to settle, then yields one animation frame and one final\n * microtask pass for rAF-scheduled work.\n *\n * This is deterministic, not a fixed number of guessed turns — `@vielzeug/ripple`'s\n * reactive graph itself settles synchronously on every signal write, so the only real\n * asynchrony to wait for is ore's own component scheduling (see `runtime.ts`'s\n * `hasPendingWork()`). There is no \"deep\" variant to reach for anymore: `flush()` waits\n * for exactly as much work as is actually pending, however deep that turns out to be.\n *\n * @example\n * ```ts\n * // Standard flush — waits for whatever is actually pending, shallow or deep\n * await flush();\n *\n * // Debug timing issues\n * await flush({ logger: console.debug });\n * ```\n *\n * @throws `OreTimeoutError` if pending work never settles within {@link MAX_FLUSH_ITERATIONS}\n * microtask turns — almost always a sign of a genuine bug (e.g. an `onMounted` callback that\n * keeps re-registering itself), not a case for raising a limit.\n */\nexport async function flush(options: FlushOptions = {}): Promise<void> {\n const { logger } = options;\n\n logger?.('[flush] draining pending component work (scheduled mount callbacks)');\n\n let turns = 0;\n\n while (hasPendingWork()) {\n if (++turns > MAX_FLUSH_ITERATIONS) {\n throw new OreTimeoutError(\n `flush(): pending component work did not settle after ${MAX_FLUSH_ITERATIONS} microtask turns — ` +\n `check for a component whose onMounted callback keeps re-registering itself.`,\n );\n }\n\n logger?.(`[flush] pending work remains, turn ${turns}`);\n await Promise.resolve();\n }\n\n logger?.('[flush] draining requestAnimationFrame');\n\n await new Promise<void>((resolve) =>\n typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(() => resolve()) : resolve(),\n );\n\n logger?.('[flush] final microtask pass');\n\n await Promise.resolve();\n\n logger?.('[flush] complete');\n}\n\n/**\n * `flush()` with debug logging pre-wired to `console.debug`. Logs each phase and pending-work\n * turn so you can diagnose unexpected update order or timing issues.\n *\n * @example\n * ```ts\n * import { debugFlush } from '@vielzeug/ore/testing';\n *\n * // in a test\n * await debugFlush();\n * // [flush] draining pending component work (scheduled mount callbacks)\n * // [flush] pending work remains, turn 1\n * // ...\n * ```\n */\nexport async function debugFlush(): Promise<void> {\n return flush({ logger: console.debug });\n}\n"],"mappings":"8FAUA,IAAM,EAAuB,IA6C7B,eAAsB,EAAM,EAAwB,CAAC,EAAkB,CACrE,GAAM,CAAE,UAAW,EAEnB,IAAS,qEAAqE,EAE9E,IAAI,EAAQ,EAEZ,KAAO,EAAe,GAAG,CACvB,GAAI,EAAE,EAAQ,EACZ,MAAM,IAAI,EACR,wDAAwD,EAAqB,+FAE/E,EAGF,IAAS,sCAAsC,GAAO,EACtD,MAAM,QAAQ,QAAQ,CACxB,CAEA,IAAS,wCAAwC,EAEjD,MAAM,IAAI,QAAe,GACvB,OAAO,sBAA0B,IAAc,0BAA4B,EAAQ,CAAC,EAAI,EAAQ,CAClG,EAEA,IAAS,8BAA8B,EAEvC,MAAM,QAAQ,QAAQ,EAEtB,IAAS,kBAAkB,CAC7B,CAiBA,eAAsB,GAA4B,CAChD,OAAO,EAAM,CAAE,OAAQ,QAAQ,KAAM,CAAC,CACxC"}
1
+ {"version":3,"file":"flush.js","names":[],"sources":["../../src/testing/flush.ts"],"sourcesContent":["/**\n * Reactive update flushing utilities for test environments.\n */\n\nimport { OreError } from '../errors';\nimport { hasPendingWork } from '../runtime';\n\n/** Thrown by `flush()` when pending component work doesn't settle within the timeout. */\nexport class OreTimeoutError extends OreError {}\n\n// Defensive cap against a genuine bug (e.g. an onMounted callback that always registers\n// another onMounted, looping forever) — not a \"how much is normally enough\" guess like the\n// old fixed turn count was. Microtask polls are cheap, so this is generous.\nconst MAX_FLUSH_ITERATIONS = 1000;\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\n/**\n * Options for flushing pending reactive updates.\n */\nexport interface FlushOptions {\n /**\n * Logger function called with each diagnostic message during the flush.\n * Pass `console.debug` or any `(msg: string) => void` to enable output.\n * Omit (or pass `undefined`) to disable all logging.\n *\n * Prefer `debugFlush()` (also from `@vielzeug/ore/testing`) over wiring this manually.\n */\n logger?: (msg: string) => void;\n}\n\n// ─── Core ────────────────────────────────────────────────────────────────────\n\n/**\n * Flush pending reactive updates: waits for every tracked in-flight component\n * operation (scheduled `onMounted` microtasks — including ones registered by other\n * `onMounted` callbacks) to settle, then yields one animation frame and one final\n * microtask pass for rAF-scheduled work.\n *\n * This is deterministic, not a fixed number of guessed turns — `@vielzeug/ripple`'s\n * reactive graph itself settles synchronously on every signal write, so the only real\n * asynchrony to wait for is ore's own component scheduling (see `runtime.ts`'s\n * `hasPendingWork()`). There is no \"deep\" variant to reach for anymore: `flush()` waits\n * for exactly as much work as is actually pending, however deep that turns out to be.\n *\n * @example\n * ```ts\n * // Standard flush — waits for whatever is actually pending, shallow or deep\n * await flush();\n *\n * // Debug timing issues\n * await flush({ logger: console.debug });\n * ```\n *\n * @throws `OreTimeoutError` if pending work never settles within {@link MAX_FLUSH_ITERATIONS}\n * microtask turns — almost always a sign of a genuine bug (e.g. an `onMounted` callback that\n * keeps re-registering itself), not a case for raising a limit.\n */\nexport async function flush(options: FlushOptions = {}): Promise<void> {\n const { logger } = options;\n\n logger?.('[flush] draining pending component work (scheduled mount callbacks)');\n\n let turns = 0;\n\n while (hasPendingWork()) {\n if (++turns > MAX_FLUSH_ITERATIONS) {\n throw new OreTimeoutError(\n `flush(): pending component work did not settle after ${MAX_FLUSH_ITERATIONS} microtask turns — ` +\n `check for a component whose onMounted callback keeps re-registering itself.`,\n );\n }\n\n logger?.(`[flush] pending work remains, turn ${turns}`);\n await Promise.resolve();\n }\n\n logger?.('[flush] draining requestAnimationFrame');\n\n await new Promise<void>((resolve) =>\n typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(() => resolve()) : resolve(),\n );\n\n logger?.('[flush] final microtask pass');\n\n await Promise.resolve();\n\n logger?.('[flush] complete');\n}\n\n/**\n * `flush()` with debug logging pre-wired to `console.debug`. Logs each phase and pending-work\n * turn so you can diagnose unexpected update order or timing issues.\n *\n * @example\n * ```ts\n * import { debugFlush } from '@vielzeug/ore/testing';\n *\n * // in a test\n * await debugFlush();\n * // [flush] draining pending component work (scheduled mount callbacks)\n * // [flush] pending work remains, turn 1\n * // ...\n * ```\n */\nexport async function debugFlush(): Promise<void> {\n return flush({ logger: console.debug });\n}\n"],"mappings":"uFAQA,IAAa,EAAb,cAAqC,CAAS,CAAC,EAKzC,EAAuB,IA6C7B,eAAsB,EAAM,EAAwB,CAAC,EAAkB,CACrE,GAAM,CAAE,UAAW,EAEnB,IAAS,qEAAqE,EAE9E,IAAI,EAAQ,EAEZ,KAAO,EAAe,GAAG,CACvB,GAAI,EAAE,EAAQ,EACZ,MAAM,IAAI,EACR,wDAAwD,EAAqB,+FAE/E,EAGF,IAAS,sCAAsC,GAAO,EACtD,MAAM,QAAQ,QAAQ,CACxB,CAEA,IAAS,wCAAwC,EAEjD,MAAM,IAAI,QAAe,GACvB,OAAO,sBAA0B,IAAc,0BAA4B,EAAQ,CAAC,EAAI,EAAQ,CAClG,EAEA,IAAS,8BAA8B,EAEvC,MAAM,QAAQ,QAAQ,EAEtB,IAAS,kBAAkB,CAC7B,CAiBA,eAAsB,GAA4B,CAChD,OAAO,EAAM,CAAE,OAAQ,QAAQ,KAAM,CAAC,CACxC"}
@@ -6,9 +6,8 @@
6
6
  * This barrel re-exports the full testing API for convenience.
7
7
  * For tree-shaking, import directly from the focused sub-modules.
8
8
  */
9
- export { OreTimeoutError } from '../errors';
10
9
  export { walkFlatTree } from './dom';
11
- export { debugFlush, type FlushOptions, flush } from './flush';
10
+ export { debugFlush, type FlushOptions, flush, OreTimeoutError } from './flush';
12
11
  export { installFormInternalsPolyfill } from './form-internals-polyfill';
13
12
  export { cleanup, type Fixture, type MountOptions, type MountSetup, mock, mount, mountComponent } from './mount';
14
13
  export { type HookFixture, renderHook } from './render-hook';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,KAAK,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,EAAE,OAAO,GAAE,cAAmB,GAAG,IAAI,CAInG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,KAAK,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,EAAE,OAAO,GAAE,cAAmB,GAAG,IAAI,CAInG"}
package/dist/testing.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./errors.cjs"),t=require("./testing/dom.cjs"),n=require("./testing/form-internals-polyfill.cjs"),r=require("./testing/flush.cjs"),i=require("./testing/render-hook.cjs"),a=require("./testing/reset.cjs"),o=require("./testing/mount.cjs");function s(e,t={}){e(o.cleanup),t.formInternals&&n.installFormInternalsPolyfill()}exports.OreTimeoutError=e.OreTimeoutError,exports.cleanup=o.cleanup,exports.debugFlush=r.debugFlush,exports.flush=r.flush,exports.install=s,exports.installFormInternalsPolyfill=n.installFormInternalsPolyfill,exports.mock=o.mock,exports.mount=o.mount,exports.mountComponent=o.mountComponent,exports.renderHook=i.renderHook,exports.resetOreForTests=a.resetOreForTests,exports.walkFlatTree=t.walkFlatTree;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./testing/dom.cjs"),t=require("./testing/form-internals-polyfill.cjs"),n=require("./testing/flush.cjs"),r=require("./testing/render-hook.cjs"),i=require("./testing/reset.cjs"),a=require("./testing/mount.cjs");function o(e,n={}){e(a.cleanup),n.formInternals&&t.installFormInternalsPolyfill()}exports.OreTimeoutError=n.OreTimeoutError,exports.cleanup=a.cleanup,exports.debugFlush=n.debugFlush,exports.flush=n.flush,exports.install=o,exports.installFormInternalsPolyfill=t.installFormInternalsPolyfill,exports.mock=a.mock,exports.mount=a.mount,exports.mountComponent=a.mountComponent,exports.renderHook=r.renderHook,exports.resetOreForTests=i.resetOreForTests,exports.walkFlatTree=e.walkFlatTree;
2
2
  //# sourceMappingURL=testing.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.cjs","names":[],"sources":["../src/testing/index.ts"],"sourcesContent":["/**\n * Testing utilities for Ore components\n *\n * ⚠️ Requires DOM environment (browser / jsdom / happy-dom)\n *\n * This barrel re-exports the full testing API for convenience.\n * For tree-shaking, import directly from the focused sub-modules.\n */\n\nimport { installFormInternalsPolyfill } from './form-internals-polyfill';\nimport { cleanup } from './mount';\n\n// Testing-only error: flush() is its only thrower in this package (a pending-work timeout —\n// see flush.ts). Exported here (not from the main `.` entry) so components with no interest\n// in the testing sub-path don't carry a testing-only error class in their public type surface.\n// Generic DOM interaction helpers belong to @vielzeug/assay, not this Ore-specific test API.\nexport { OreTimeoutError } from '../errors';\nexport { walkFlatTree } from './dom';\nexport { debugFlush, type FlushOptions, flush } from './flush';\nexport { installFormInternalsPolyfill } from './form-internals-polyfill';\nexport { cleanup, type Fixture, type MountOptions, type MountSetup, mock, mount, mountComponent } from './mount';\nexport { type HookFixture, renderHook } from './render-hook';\nexport { resetOreForTests } from './reset';\n\nexport type InstallOptions = {\n /**\n * Polyfill the jsdom/happy-dom gaps in `ElementInternals`/`FormData`/`<form>.reset()`\n * that `useField()` needs (see `installFormInternalsPolyfill`). Global monkey-patches,\n * so opt in only when the suite tests form-associated components.\n * @default false\n */\n formInternals?: boolean;\n};\n\n/**\n * Register auto-cleanup after each test. Call once in your test setup file.\n * Pass `{ formInternals: true }` when testing form-associated (`useField`) components.\n *\n * @example\n * // vitest.setup.ts\n * import { afterEach } from 'vitest';\n * import { install } from '@vielzeug/ore/testing';\n * install(afterEach, { formInternals: true });\n */\nexport function install(afterEachHook: (fn: () => void) => void, options: InstallOptions = {}): void {\n afterEachHook(cleanup);\n\n if (options.formInternals) installFormInternalsPolyfill();\n}\n"],"mappings":"+TA4CA,SAAgB,EAAQ,EAAyC,EAA0B,CAAC,EAAS,CACnG,EAAc,EAAA,OAAO,EAEjB,EAAQ,eAAe,EAAA,6BAA6B,CAC1D"}
1
+ {"version":3,"file":"testing.cjs","names":[],"sources":["../src/testing/index.ts"],"sourcesContent":["/**\n * Testing utilities for Ore components\n *\n * ⚠️ Requires DOM environment (browser / jsdom / happy-dom)\n *\n * This barrel re-exports the full testing API for convenience.\n * For tree-shaking, import directly from the focused sub-modules.\n */\n\nimport { installFormInternalsPolyfill } from './form-internals-polyfill';\nimport { cleanup } from './mount';\n\n// Testing-only error: flush() is its only thrower in this package (a pending-work timeout —\n// see flush.ts). Exported here (not from the main `.` entry) so components with no interest\n// in the testing sub-path don't carry a testing-only error class in their public type surface.\n// Generic DOM interaction helpers belong to @vielzeug/assay, not this Ore-specific test API.\nexport { walkFlatTree } from './dom';\nexport { debugFlush, type FlushOptions, flush, OreTimeoutError } from './flush';\nexport { installFormInternalsPolyfill } from './form-internals-polyfill';\nexport { cleanup, type Fixture, type MountOptions, type MountSetup, mock, mount, mountComponent } from './mount';\nexport { type HookFixture, renderHook } from './render-hook';\nexport { resetOreForTests } from './reset';\n\nexport type InstallOptions = {\n /**\n * Polyfill the jsdom/happy-dom gaps in `ElementInternals`/`FormData`/`<form>.reset()`\n * that `useField()` needs (see `installFormInternalsPolyfill`). Global monkey-patches,\n * so opt in only when the suite tests form-associated components.\n * @default false\n */\n formInternals?: boolean;\n};\n\n/**\n * Register auto-cleanup after each test. Call once in your test setup file.\n * Pass `{ formInternals: true }` when testing form-associated (`useField`) components.\n *\n * @example\n * // vitest.setup.ts\n * import { afterEach } from 'vitest';\n * import { install } from '@vielzeug/ore/testing';\n * install(afterEach, { formInternals: true });\n */\nexport function install(afterEachHook: (fn: () => void) => void, options: InstallOptions = {}): void {\n afterEachHook(cleanup);\n\n if (options.formInternals) installFormInternalsPolyfill();\n}\n"],"mappings":"qSA2CA,SAAgB,EAAQ,EAAyC,EAA0B,CAAC,EAAS,CACnG,EAAc,EAAA,OAAO,EAEjB,EAAQ,eAAe,EAAA,6BAA6B,CAC1D"}
package/dist/testing.js CHANGED
@@ -1,2 +1,2 @@
1
- import{OreTimeoutError as e}from"./errors.js";import{walkFlatTree as t}from"./testing/dom.js";import{installFormInternalsPolyfill as n}from"./testing/form-internals-polyfill.js";import{debugFlush as r,flush as i}from"./testing/flush.js";import{renderHook as a}from"./testing/render-hook.js";import{resetOreForTests as o}from"./testing/reset.js";import{cleanup as s,mock as c,mount as l,mountComponent as u}from"./testing/mount.js";function d(e,t={}){e(s),t.formInternals&&n()}export{e as OreTimeoutError,s as cleanup,r as debugFlush,i as flush,d as install,n as installFormInternalsPolyfill,c as mock,l as mount,u as mountComponent,a as renderHook,o as resetOreForTests,t as walkFlatTree};
1
+ import{walkFlatTree as e}from"./testing/dom.js";import{installFormInternalsPolyfill as t}from"./testing/form-internals-polyfill.js";import{OreTimeoutError as n,debugFlush as r,flush as i}from"./testing/flush.js";import{renderHook as a}from"./testing/render-hook.js";import{resetOreForTests as o}from"./testing/reset.js";import{cleanup as s,mock as c,mount as l,mountComponent as u}from"./testing/mount.js";function d(e,n={}){e(s),n.formInternals&&t()}export{n as OreTimeoutError,s as cleanup,r as debugFlush,i as flush,d as install,t as installFormInternalsPolyfill,c as mock,l as mount,u as mountComponent,a as renderHook,o as resetOreForTests,e as walkFlatTree};
2
2
  //# sourceMappingURL=testing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","names":[],"sources":["../src/testing/index.ts"],"sourcesContent":["/**\n * Testing utilities for Ore components\n *\n * ⚠️ Requires DOM environment (browser / jsdom / happy-dom)\n *\n * This barrel re-exports the full testing API for convenience.\n * For tree-shaking, import directly from the focused sub-modules.\n */\n\nimport { installFormInternalsPolyfill } from './form-internals-polyfill';\nimport { cleanup } from './mount';\n\n// Testing-only error: flush() is its only thrower in this package (a pending-work timeout —\n// see flush.ts). Exported here (not from the main `.` entry) so components with no interest\n// in the testing sub-path don't carry a testing-only error class in their public type surface.\n// Generic DOM interaction helpers belong to @vielzeug/assay, not this Ore-specific test API.\nexport { OreTimeoutError } from '../errors';\nexport { walkFlatTree } from './dom';\nexport { debugFlush, type FlushOptions, flush } from './flush';\nexport { installFormInternalsPolyfill } from './form-internals-polyfill';\nexport { cleanup, type Fixture, type MountOptions, type MountSetup, mock, mount, mountComponent } from './mount';\nexport { type HookFixture, renderHook } from './render-hook';\nexport { resetOreForTests } from './reset';\n\nexport type InstallOptions = {\n /**\n * Polyfill the jsdom/happy-dom gaps in `ElementInternals`/`FormData`/`<form>.reset()`\n * that `useField()` needs (see `installFormInternalsPolyfill`). Global monkey-patches,\n * so opt in only when the suite tests form-associated components.\n * @default false\n */\n formInternals?: boolean;\n};\n\n/**\n * Register auto-cleanup after each test. Call once in your test setup file.\n * Pass `{ formInternals: true }` when testing form-associated (`useField`) components.\n *\n * @example\n * // vitest.setup.ts\n * import { afterEach } from 'vitest';\n * import { install } from '@vielzeug/ore/testing';\n * install(afterEach, { formInternals: true });\n */\nexport function install(afterEachHook: (fn: () => void) => void, options: InstallOptions = {}): void {\n afterEachHook(cleanup);\n\n if (options.formInternals) installFormInternalsPolyfill();\n}\n"],"mappings":"+aA4CA,SAAgB,EAAQ,EAAyC,EAA0B,CAAC,EAAS,CACnG,EAAc,CAAO,EAEjB,EAAQ,eAAe,EAA6B,CAC1D"}
1
+ {"version":3,"file":"testing.js","names":[],"sources":["../src/testing/index.ts"],"sourcesContent":["/**\n * Testing utilities for Ore components\n *\n * ⚠️ Requires DOM environment (browser / jsdom / happy-dom)\n *\n * This barrel re-exports the full testing API for convenience.\n * For tree-shaking, import directly from the focused sub-modules.\n */\n\nimport { installFormInternalsPolyfill } from './form-internals-polyfill';\nimport { cleanup } from './mount';\n\n// Testing-only error: flush() is its only thrower in this package (a pending-work timeout —\n// see flush.ts). Exported here (not from the main `.` entry) so components with no interest\n// in the testing sub-path don't carry a testing-only error class in their public type surface.\n// Generic DOM interaction helpers belong to @vielzeug/assay, not this Ore-specific test API.\nexport { walkFlatTree } from './dom';\nexport { debugFlush, type FlushOptions, flush, OreTimeoutError } from './flush';\nexport { installFormInternalsPolyfill } from './form-internals-polyfill';\nexport { cleanup, type Fixture, type MountOptions, type MountSetup, mock, mount, mountComponent } from './mount';\nexport { type HookFixture, renderHook } from './render-hook';\nexport { resetOreForTests } from './reset';\n\nexport type InstallOptions = {\n /**\n * Polyfill the jsdom/happy-dom gaps in `ElementInternals`/`FormData`/`<form>.reset()`\n * that `useField()` needs (see `installFormInternalsPolyfill`). Global monkey-patches,\n * so opt in only when the suite tests form-associated components.\n * @default false\n */\n formInternals?: boolean;\n};\n\n/**\n * Register auto-cleanup after each test. Call once in your test setup file.\n * Pass `{ formInternals: true }` when testing form-associated (`useField`) components.\n *\n * @example\n * // vitest.setup.ts\n * import { afterEach } from 'vitest';\n * import { install } from '@vielzeug/ore/testing';\n * install(afterEach, { formInternals: true });\n */\nexport function install(afterEachHook: (fn: () => void) => void, options: InstallOptions = {}): void {\n afterEachHook(cleanup);\n\n if (options.formInternals) installFormInternalsPolyfill();\n}\n"],"mappings":"sZA2CA,SAAgB,EAAQ,EAAyC,EAA0B,CAAC,EAAS,CACnG,EAAc,CAAO,EAEjB,EAAQ,eAAe,EAA6B,CAC1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielzeug/ore",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Custom element authoring primitives — reactive templates, signals, slots, and automatic lifecycle management",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,8 +53,8 @@
53
53
  "test:types": "tsc -p tsconfig.json --noEmit"
54
54
  },
55
55
  "peerDependencies": {
56
- "@vielzeug/assay": "^2.1.1",
57
- "@vielzeug/ripple": "^2.2.4"
56
+ "@vielzeug/assay": "^2.2.0",
57
+ "@vielzeug/ripple": "^2.3.0"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@vielzeug/assay": {
@@ -63,8 +63,8 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@types/node": "^26.2.0",
66
- "@vielzeug/assay": "2.1.1",
67
- "@vielzeug/ripple": "2.2.4",
66
+ "@vielzeug/assay": "2.2.0",
67
+ "@vielzeug/ripple": "2.3.0",
68
68
  "axe-core": "^4.13.0",
69
69
  "jsdom": "^30.0.1",
70
70
  "typescript": "^6.0.3",