@opetope/react 0.1.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.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/README.ru.md +266 -0
- package/dist/command-hook-controller.d.ts +33 -0
- package/dist/command-hook.d.ts +13 -0
- package/dist/command.d.ts +26 -0
- package/dist/commands-hook.d.ts +10 -0
- package/dist/contribution-frame-1td5XTES.js +2 -0
- package/dist/contribution-frame-1td5XTES.js.map +1 -0
- package/dist/contribution-frame.d.ts +38 -0
- package/dist/errors.d.ts +9 -0
- package/dist/feature-boundary.d.ts +29 -0
- package/dist/feature-demand.d.ts +21 -0
- package/dist/idle-subscription.d.ts +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +5 -0
- package/dist/integration.js +2 -0
- package/dist/integration.js.map +1 -0
- package/dist/model-binding.d.ts +21 -0
- package/dist/model-hook.d.ts +12 -0
- package/dist/model-selection-snapshot.d.ts +32 -0
- package/dist/model-selection-store.d.ts +17 -0
- package/dist/mount-context.d.ts +4 -0
- package/dist/mount-frame.d.ts +56 -0
- package/dist/mount-provider.d.ts +6 -0
- package/dist/readable-hooks.d.ts +3 -0
- package/dist/requires-models.d.ts +17 -0
- package/dist/resource-hook.d.ts +4 -0
- package/dist/scenario-diagnostics.d.ts +13 -0
- package/dist/scenario-mount.d.ts +17 -0
- package/dist/scenario-slot.d.ts +29 -0
- package/dist/scenario-types.d.ts +57 -0
- package/dist/scenario-wait.d.ts +20 -0
- package/dist/scenario.d.ts +5 -0
- package/dist/slot.d.ts +40 -0
- package/dist/testing.d.ts +5 -0
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Readable } from '@opetope/core';
|
|
2
|
+
export declare function useSelector<Value, Selected>(readable: Readable<Value>, selector: (value: Value) => Selected, isEqual?: (left: Selected, right: Selected) => boolean): Selected;
|
|
3
|
+
export declare function useReadable<Value>(readable: Readable<Value>): Value;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { ModelIdentity } from '@opetope/core/internal';
|
|
3
|
+
type AnyModel = ModelIdentity;
|
|
4
|
+
/**
|
|
5
|
+
* The marker a component uses to state which UI models of its contribution it reads. `slot` checks by type that the
|
|
6
|
+
* contribution grants every model of this list — it may grant more, because the mount serves its whole instance.
|
|
7
|
+
*
|
|
8
|
+
* The runtime authority is the mount frame, not this marker: `useModel` resolves against what the mount was given
|
|
9
|
+
* and refuses anything else. The lint rule `opetope/require-declared-models` checks visible contribution sites and
|
|
10
|
+
* each reader of a per-mount model within the same module. Imported implementations and dynamic declaration lists
|
|
11
|
+
* remain unknown to this syntactic check (D85, D158, D250).
|
|
12
|
+
*/
|
|
13
|
+
type ComponentRequiringModels<Props, Models extends readonly AnyModel[]> = FunctionComponent<Props> & {
|
|
14
|
+
readonly requires: Models;
|
|
15
|
+
};
|
|
16
|
+
declare function requiresModels<const Models extends readonly AnyModel[]>(models: Models): <Props>(component: FunctionComponent<Props>) => ComponentRequiringModels<Props, Models>;
|
|
17
|
+
export { requiresModels };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Resource, ResourceSnapshot } from '@opetope/runtime';
|
|
2
|
+
import type { ResourceRequestKey } from '@opetope/runtime/internal';
|
|
3
|
+
declare function useResource<Data, Key extends ResourceRequestKey>(resource: Resource<Data, Key>): ResourceSnapshot<Data, Key>;
|
|
4
|
+
export { useResource };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RuntimeGraphSnapshot } from '@opetope/runtime/internal';
|
|
2
|
+
import type { ScenarioOwnership } from './scenario-types.js';
|
|
3
|
+
/** D206: the failure carries the producer's same data-only graph/activity facts, without product payloads. */
|
|
4
|
+
declare class ScenarioTimeoutError extends Error {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly timeoutMs: number;
|
|
7
|
+
readonly snapshot: RuntimeGraphSnapshot;
|
|
8
|
+
readonly history: readonly RuntimeGraphSnapshot[];
|
|
9
|
+
readonly code = "timeout";
|
|
10
|
+
constructor(label: string, timeoutMs: number, snapshot: RuntimeGraphSnapshot, history: readonly RuntimeGraphSnapshot[]);
|
|
11
|
+
}
|
|
12
|
+
declare function scenarioOwnership(snapshot: RuntimeGraphSnapshot, successfullyClosed: boolean): ScenarioOwnership;
|
|
13
|
+
export { scenarioOwnership, ScenarioTimeoutError };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ScenarioHostMount } from './scenario-types.js';
|
|
2
|
+
/** A reservation exists before the host callback, so reentrant close also owns a mount returned later. */
|
|
3
|
+
declare class ScenarioMountLease<Mounted extends ScenarioHostMount> {
|
|
4
|
+
private readonly released;
|
|
5
|
+
get closed(): boolean;
|
|
6
|
+
private available;
|
|
7
|
+
private completion;
|
|
8
|
+
private handle;
|
|
9
|
+
private reject;
|
|
10
|
+
private resolve;
|
|
11
|
+
constructor(released: (failed: boolean, error?: unknown) => void);
|
|
12
|
+
readonly close: () => Promise<void>;
|
|
13
|
+
provide(handle: Mounted | undefined): void;
|
|
14
|
+
private finish;
|
|
15
|
+
private releaseAvailable;
|
|
16
|
+
}
|
|
17
|
+
export { ScenarioMountLease };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { Call } from '@opetope/core';
|
|
3
|
+
import type { ModelFixture } from './contribution-frame.js';
|
|
4
|
+
import type { SlotComponentProperties, SlotContribution, SlotProperties, SlotTarget } from './slot.js';
|
|
5
|
+
/**
|
|
6
|
+
* Two forms, as `renderRoot` had (D19): without `contribution` the harness mounts what the target published, with it
|
|
7
|
+
* the harness mounts one fixture contribution so a component test needs no generation.
|
|
8
|
+
*/
|
|
9
|
+
type SlotTestFixture<Props extends SlotProperties> = {
|
|
10
|
+
readonly contribution?: SlotContribution<Props>;
|
|
11
|
+
readonly models?: readonly ModelFixture[];
|
|
12
|
+
readonly props?: SlotComponentProperties<Props>;
|
|
13
|
+
};
|
|
14
|
+
interface SlotTestHarness<Props extends SlotProperties> {
|
|
15
|
+
readonly Slot: FC;
|
|
16
|
+
readonly updateProps: (props: SlotComponentProperties<Props>) => void;
|
|
17
|
+
}
|
|
18
|
+
/** A command a fixture publishes: the test writes the body, the harness gives it the identity a model requires. */
|
|
19
|
+
declare function command<Input, Output>(run: (input: Input) => Output | PromiseLike<Output>): Call<Input, Output>;
|
|
20
|
+
/**
|
|
21
|
+
* Mounts the contributions of one slot the way a host does, with optional model fixtures for a component test. D19 and D85: the same
|
|
22
|
+
* ContributionMount is shared by component tests and the application scenario harness (D206).
|
|
23
|
+
*/
|
|
24
|
+
declare function createSlotHarness<Props extends SlotProperties>(target: SlotTarget<Props>, fixture?: SlotTestFixture<Props>): SlotTestHarness<Props> & {
|
|
25
|
+
readonly close: () => void;
|
|
26
|
+
};
|
|
27
|
+
declare function renderSlot<Props extends SlotProperties>(target: SlotTarget<Props>, fixture?: SlotTestFixture<Props>): SlotTestHarness<Props>;
|
|
28
|
+
export { command, createSlotHarness, renderSlot };
|
|
29
|
+
export type { SlotTestFixture, SlotTestHarness };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { Application } from '@opetope/runtime';
|
|
3
|
+
import type { OpenApplicationOptions, RuntimeGraphSnapshot } from '@opetope/runtime/internal';
|
|
4
|
+
import type { SlotComponentProperties, SlotProperties, SlotTarget } from './slot.js';
|
|
5
|
+
type ScenarioFeatures = Application extends Application<infer Features> ? Features : never;
|
|
6
|
+
interface ScenarioHostMount {
|
|
7
|
+
unmount(): PromiseLike<void> | void;
|
|
8
|
+
}
|
|
9
|
+
/** The test owns its renderer; the package has no dependency on a DOM renderer or a test runner. */
|
|
10
|
+
interface ScenarioHost<Mounted extends ScenarioHostMount> {
|
|
11
|
+
mount(Component: FC): Mounted;
|
|
12
|
+
}
|
|
13
|
+
type ScenarioOptions<Features extends ScenarioFeatures, Mounted extends ScenarioHostMount> = OpenApplicationOptions<Features> & {
|
|
14
|
+
readonly activityCapacity?: number;
|
|
15
|
+
readonly historyCapacity?: number;
|
|
16
|
+
readonly host: ScenarioHost<Mounted>;
|
|
17
|
+
readonly timeoutMs?: number;
|
|
18
|
+
};
|
|
19
|
+
interface ScenarioWaitOptions {
|
|
20
|
+
readonly label?: string;
|
|
21
|
+
/** Polls a predicate that also reads external UI state; inspection notifications always wake it immediately. */
|
|
22
|
+
readonly pollIntervalMs?: number;
|
|
23
|
+
readonly timeoutMs?: number;
|
|
24
|
+
}
|
|
25
|
+
interface ScenarioMount<Props extends SlotProperties, Mounted extends ScenarioHostMount> {
|
|
26
|
+
readonly host: Mounted;
|
|
27
|
+
readonly unmount: () => Promise<void>;
|
|
28
|
+
readonly updateProps: (props: SlotComponentProperties<Props>) => void;
|
|
29
|
+
}
|
|
30
|
+
type ScenarioMountArguments<Props extends SlotProperties> = [Props] extends [undefined] ? [options?: {
|
|
31
|
+
readonly props?: never;
|
|
32
|
+
}] : [options: {
|
|
33
|
+
readonly props: SlotComponentProperties<Props>;
|
|
34
|
+
}];
|
|
35
|
+
type ScenarioOwnership = Readonly<{
|
|
36
|
+
calls: 'unknown' | number;
|
|
37
|
+
closed: boolean;
|
|
38
|
+
features: 'unknown' | number;
|
|
39
|
+
reasons: readonly string[];
|
|
40
|
+
resources: 'unknown' | number;
|
|
41
|
+
/** This is not a GC leak assertion and does not claim coverage of arbitrary host or UI resources. */
|
|
42
|
+
scope: 'registered-runtime';
|
|
43
|
+
status: 'complete' | 'unknown';
|
|
44
|
+
}>;
|
|
45
|
+
interface Scenario<Mounted extends ScenarioHostMount> {
|
|
46
|
+
close(): Promise<void>;
|
|
47
|
+
getSnapshot(): RuntimeGraphSnapshot;
|
|
48
|
+
history(): readonly RuntimeGraphSnapshot[];
|
|
49
|
+
mount<Props extends SlotProperties>(target: SlotTarget<Props>, ...arguments_: ScenarioMountArguments<Props>): ScenarioMount<Props, Mounted>;
|
|
50
|
+
/** Wakes predicates after an external fixture changes; it publishes no runtime event. */
|
|
51
|
+
notify(): void;
|
|
52
|
+
ownership(): ScenarioOwnership;
|
|
53
|
+
/** A deadline does not close the application: a test can inspect a loading body and then release its fixture. */
|
|
54
|
+
readonly ready: Promise<void>;
|
|
55
|
+
waitFor(predicate: (snapshot: RuntimeGraphSnapshot) => boolean, options?: ScenarioWaitOptions): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export type { Scenario, ScenarioFeatures, ScenarioHost, ScenarioHostMount, ScenarioMount, ScenarioOptions, ScenarioOwnership, ScenarioWaitOptions, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RuntimeGraphSnapshot } from '@opetope/runtime/internal';
|
|
2
|
+
import type { ScenarioWaitOptions } from './scenario-types.js';
|
|
3
|
+
declare function positiveDuration(value: number, label: string): number;
|
|
4
|
+
interface ScenarioWaitSource {
|
|
5
|
+
readonly getSnapshot: () => RuntimeGraphSnapshot;
|
|
6
|
+
readonly history: () => readonly RuntimeGraphSnapshot[];
|
|
7
|
+
readonly timeoutMs: number;
|
|
8
|
+
}
|
|
9
|
+
declare class ScenarioWaiters {
|
|
10
|
+
private readonly source;
|
|
11
|
+
private readonly listeners;
|
|
12
|
+
private readonly pending;
|
|
13
|
+
constructor(source: ScenarioWaitSource);
|
|
14
|
+
cancel(): void;
|
|
15
|
+
deadline<Value>(result: PromiseLike<Value>, label: string, timeoutMs?: number): Promise<Value>;
|
|
16
|
+
readonly notify: () => void;
|
|
17
|
+
waitFor(predicate: (snapshot: RuntimeGraphSnapshot) => boolean, options: ScenarioWaitOptions): Promise<void>;
|
|
18
|
+
private timeout;
|
|
19
|
+
}
|
|
20
|
+
export { positiveDuration, ScenarioWaiters };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Application } from '@opetope/runtime';
|
|
2
|
+
import type { Scenario, ScenarioFeatures, ScenarioHostMount, ScenarioOptions } from './scenario-types.js';
|
|
3
|
+
/** D206: one real application, its existing inspection session and renderer-owned Slot ingress. */
|
|
4
|
+
declare function createScenario<const Features extends ScenarioFeatures, Mounted extends ScenarioHostMount>(application: Application<Features>, options: ScenarioOptions<Features, Mounted>): Scenario<Mounted>;
|
|
5
|
+
export { createScenario };
|
package/dist/slot.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { DeclarationId } from '@opetope/core';
|
|
3
|
+
import type { ContributionTarget } from '@opetope/core/internal';
|
|
4
|
+
import type { ContributionModel } from '@opetope/runtime/internal';
|
|
5
|
+
type SlotProperties = object | undefined;
|
|
6
|
+
type EmptySlotProperties = Readonly<Record<string, never>>;
|
|
7
|
+
type SlotComponentProperties<Props extends SlotProperties> = [Props] extends [undefined] ? EmptySlotProperties : Extract<Props, object>;
|
|
8
|
+
/**
|
|
9
|
+
* What a contribution publishes: the component, the optional props adapter and the optional UI models the mount
|
|
10
|
+
* creates. Without an adapter the component takes the slot props; with one it takes exactly the adapter result (D85).
|
|
11
|
+
*/
|
|
12
|
+
type SlotContribution<Props extends SlotProperties = undefined> = {
|
|
13
|
+
readonly Component: ComponentType<never>;
|
|
14
|
+
readonly models?: readonly ContributionModel[];
|
|
15
|
+
readonly props?: (slotProps: SlotComponentProperties<Props>) => object;
|
|
16
|
+
};
|
|
17
|
+
type SlotTarget<Props extends SlotProperties = undefined> = ContributionTarget<SlotContribution<Props>>;
|
|
18
|
+
type SwitchSlotTarget<Route extends string, Props extends SlotProperties = undefined> = ((route: Route) => SlotTarget<Props>) & {
|
|
19
|
+
readonly id: DeclarationId;
|
|
20
|
+
};
|
|
21
|
+
type SlotRenderProps<Props extends SlotProperties> = [Props] extends [undefined] ? {
|
|
22
|
+
readonly props?: never;
|
|
23
|
+
readonly target: SlotTarget<Props>;
|
|
24
|
+
} : {
|
|
25
|
+
readonly props: SlotComponentProperties<Props>;
|
|
26
|
+
readonly target: SlotTarget<Props>;
|
|
27
|
+
};
|
|
28
|
+
declare function defineSlot<Props extends SlotProperties = undefined>(options: {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
}): SlotTarget<Props>;
|
|
31
|
+
declare function defineSwitchSlot<Route extends string, Props extends SlotProperties = undefined>(options: {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
}): SwitchSlotTarget<Route, Props>;
|
|
34
|
+
/**
|
|
35
|
+
* Every contribution renders inside its own mount: the models its generation owns plus the UI models it declared,
|
|
36
|
+
* created on mount and closed on unmount (D70, D85).
|
|
37
|
+
*/
|
|
38
|
+
declare function Slot<Props extends SlotProperties>(options: SlotRenderProps<Props>): ReactNode;
|
|
39
|
+
export { defineSlot, defineSwitchSlot, Slot };
|
|
40
|
+
export type { SlotComponentProperties, SlotContribution, SlotProperties, SlotTarget, SwitchSlotTarget };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createScenario } from './scenario.js';
|
|
2
|
+
export { ScenarioTimeoutError } from './scenario-diagnostics.js';
|
|
3
|
+
export { command, renderSlot } from './scenario-slot.js';
|
|
4
|
+
export type { SlotTestFixture, SlotTestHarness } from './scenario-slot.js';
|
|
5
|
+
export type { Scenario, ScenarioHost, ScenarioHostMount, ScenarioMount, ScenarioOptions, ScenarioOwnership, ScenarioWaitOptions, } from './scenario-types.js';
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{defineCallTarget as x,createAggregateError as _}from"@opetope/core/internal";import{openApplication as N}from"@opetope/runtime";import{createInspectionSession as q}from"@opetope/runtime/internal";import{createElement as B}from"react";import{d as H,a as F,c as D,M as L}from"./contribution-frame-1td5XTES.js";function U(e){if(e.state.kind==="ready")return[];const t=e.state.kind==="waiting"?` (${e.state.reason})`:"";return[`Feature ${e.label}: ${e.state.kind}${t}.`]}function W(e){if(e.lane===null)return`Call ${e.declaration}: ${e.state}; lane parallel; blockers none (parallel).`;const t=e.lane.blockedBy==="unknown"?"unknown":e.lane.blockedBy.join(", ");return`Call ${e.declaration}: ${e.state}; lane ${e.lane.declaration}; blockers ${t}.`}function G(e){if(e===void 0)return["Runtime activity: unknown."];const t=[];return(e.freshness==="stale"||e.truncated)&&t.push(`Activity: ${e.freshness}${e.truncated?", truncated":""}; completeness unknown.`),[...t,...e.features.map(n=>`Feature ${n.feature}: ${n.phase}; body ${n.body}; host demand unknown.`),...e.calls.map(W),...e.resources.map(n=>`Resource ${n.id}: ${n.state}; retainers ${String(n.retainers)}.`)]}function J(e){const t=[...e.runtime.conditions.flatMap(n=>n.state.kind==="true"?[]:[`Condition ${n.label}: ${n.state.kind}.`]),...e.runtime.instances.flatMap(U),...G(e.activity)];return t.length===0?"No registered runtime blocker observed; external UI and host work are unknown.":t.join(`
|
|
2
|
+
`)}class E extends Error{label;timeoutMs;snapshot;history;code="timeout";constructor(t,n,r,o){super(`Scenario timed out after ${String(n)}ms: ${t}.
|
|
3
|
+
${J(r)}`),this.label=t,this.timeoutMs=n,this.snapshot=r,this.history=o,this.name="ScenarioTimeoutError"}}function K(e,t){return!t||e===void 0?!1:e.closed&&!e.truncated}function Q(e,t,n){if(e===void 0)return["Runtime activity is unavailable."];const r=[];return e.truncated&&r.push("The activity snapshot is truncated."),e.freshness==="stale"&&!t&&r.push("The activity snapshot is stale."),n||r.push("Successful application and mount cleanup has not been observed."),Object.freeze(r)}function V(e,t){return e===void 0||e.truncated||e.freshness==="stale"&&!t?{calls:"unknown",features:"unknown",resources:"unknown"}:{calls:e.calls.length,features:e.features.length,resources:e.resources.length}}function X(e,t){const n=e.activity,r=K(n,t);return Object.freeze({...V(n,r),closed:t,reasons:Q(n,r,t),scope:"registered-runtime",status:r?"complete":"unknown"})}class Y{released;get closed(){return this.completion!==void 0}available=!1;completion;handle;reject;resolve;constructor(t){this.released=t}close=()=>this.completion!==void 0?this.completion:(this.completion=new Promise((t,n)=>{this.resolve=t,this.reject=n}),this.available&&this.releaseAvailable(),this.completion);provide(t){this.available=!0,this.handle=t,this.closed&&this.releaseAvailable()}finish(t,n){const r=this.resolve,o=this.reject;this.resolve=void 0,this.reject=void 0,this.released(t,n),t?o==null||o(n):r==null||r()}releaseAvailable(){const t=this.handle;this.handle=void 0,this.available=!1;try{Promise.resolve(t==null?void 0:t.unmount()).then(()=>this.finish(!1),n=>this.finish(!0,n))}catch(n){this.finish(!0,n)}}}let T=0;function Z(e){return T+=1,H(x({id:`testing.command.${String(T)}`,run:e}))}function R(e,t={}){const n=t.models??[];let r=t.props??{};const o=new Set,m={getSnapshot:()=>r,subscribe:s=>(o.add(s),()=>o.delete(s))},c=t.contribution;return Object.freeze({close:()=>{r={},o.clear()},Slot:()=>{const s=F(e.entries),f=F(m);return(c===void 0?s.map(i=>[i.id,i.value,D(i)]):[["testing.contribution",c,void 0]]).map(([i,S,v])=>B(L,{authority:v,contribution:S,fixtures:n,key:i,slotProps:f}))},updateProps:s=>{r=s;for(const f of[...o])f()}})}function ee(e,t={}){const n=R(e,t);return Object.freeze({Slot:n.Slot,updateProps:n.updateProps})}function j(e,t){if(!Number.isFinite(e)||e<=0||e>2147483647)throw new RangeError(`${t} must be a finite duration from 0 (exclusive) to 2147483647ms.`);return e}class te{source;listeners=new Set;pending=new Set;constructor(t){this.source=t}cancel(){for(const t of[...this.pending])t(new Error("Scenario is closing."))}deadline(t,n,r=this.source.timeoutMs){return j(r,"Scenario timeoutMs"),new Promise((o,m)=>{const c=setTimeout(()=>m(this.timeout(n,r)),r);Promise.resolve(t).then(l=>{clearTimeout(c),o(l)},l=>{clearTimeout(c),m(l)})})}notify=()=>{for(const t of[...this.listeners])t()};waitFor(t,n){const r=j(n.timeoutMs??this.source.timeoutMs,"Scenario timeoutMs"),o=j(n.pollIntervalMs??10,"Scenario pollIntervalMs");return new Promise((m,c)=>{let l=!1,s=()=>{};const f=(h,k=h!==void 0)=>{l||(l=!0,s(),k?c(h):m())},b=()=>{if(!l)try{t(this.source.getSnapshot())&&f()}catch(h){f(h,!0)}},i=h=>f(h),S=setTimeout(()=>f(this.timeout(n.label??"waitFor",r)),r),v=setInterval(b,o);s=()=>{clearTimeout(S),clearInterval(v),this.listeners.delete(b),this.pending.delete(i)},this.listeners.add(b),this.pending.add(i),b()})}timeout(t,n){return new E(t,n,this.source.getSnapshot(),this.source.history())}}function z(e,t){if(!Number.isSafeInteger(e)||e<1||e>1e4)throw new RangeError(`${t} must be an integer from 1 to 10000.`);return e}function ne(e){if(e===null||typeof e!="object"||!("mount"in e)||typeof e.mount!="function")throw new TypeError("Scenario requires a host.mount(Component) adapter.")}function re(e,t){const n=j(t.timeoutMs??1e3,"Scenario timeoutMs"),r=z(t.historyCapacity??64,"Scenario historyCapacity"),o=z(t.activityCapacity??256,"Scenario activityCapacity");let m=t.host;ne(m);let c=N(e,{...t.cleanupFailure===void 0?{}:{cleanupFailure:t.cleanupFailure},conditions:t.conditions,imports:t.imports}),l;try{l=q(c,{activityCapacity:o,ringCapacity:r})}catch(u){throw c.ready.catch(()=>{}),c.close().catch(()=>{}),u}let s="open",f=!1,b=!1;const i=[],S=new Set,v=[],h=()=>l.getSnapshot(),k=()=>Object.freeze([...i]),$=new te({getSnapshot:h,history:k,timeoutMs:n}),C=()=>{if(!b){b=!0;try{const u=h(),p=i[i.length-1];((p==null?void 0:p.stateRevision)!==u.stateRevision||p.activity!==u.activity)&&(i.push(u),i.length>r&&i.shift())}finally{b=!1}$.notify()}},A=l.subscribe(C);C();const P=$.deadline(c.ready,"application ready");P.catch(()=>{});let M,g;const I=()=>{if(M!==void 0)return M;let u,p;M=new Promise((a,d)=>{u=a,p=d}),s="closing",$.cancel();const y=[];try{y.push(c.close())}catch(a){y.push(Promise.reject(a))}return y.push(...[...S].map(a=>a.close())),Promise.allSettled(y).then(a=>{const d=[...new Set([...v,...a.flatMap(w=>w.status==="rejected"?[w.reason]:[])])];v.length=0,s="closed";try{C()}catch(w){d.push(w)}finally{A(),l.close(),S.clear(),c=void 0,m=void 0}f=d.length===0,d.length===0?u():p(_(d,"Scenario cleanup failed."))}),M};return Object.freeze({close:()=>{if(g!==void 0)return g;const u=I();return g!==void 0||(g=$.deadline(u,"scenario close"),g.catch(()=>{s==="closing"&&(g=void 0)})),g},getSnapshot:h,history:k,mount:(u,p={})=>{if(s!=="open")throw new Error("Scenario is closing.");const y=R(u,p),a=new Y((w,O)=>{S.delete(a),y.close(),w&&v.push(O)});S.add(a);let d;try{if(d=m.mount(y.Slot),d===null||typeof d!="object"||typeof d.unmount!="function")throw new TypeError("Scenario host.mount must return an unmount() handle.");a.provide(d)}catch(w){throw a.provide(void 0),a.close().catch(()=>{}),w}return Object.freeze({host:d,unmount:a.close,updateProps:w=>{if(s!=="open"||a.closed)throw new Error("Scenario mount is closed.");y.updateProps(w),$.notify()}})},notify:()=>{s==="open"&&$.notify()},ownership:()=>X(h(),f),ready:P,waitFor:(u,p={})=>s!=="open"?Promise.reject(new Error("Scenario is closing.")):$.waitFor(u,p)})}export{E as ScenarioTimeoutError,Z as command,re as createScenario,ee as renderSlot};
|
|
4
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sources":["../src/scenario-diagnostics.ts","../src/scenario-mount.ts","../src/scenario-slot.tsx","../src/scenario-wait.ts","../src/scenario.ts"],"sourcesContent":["import type { RuntimeActivitySnapshot, RuntimeGraphSnapshot } from '@opetope/runtime/internal';\n\nimport type { ScenarioOwnership } from './scenario-types';\n\nfunction instanceFacts(instance: RuntimeGraphSnapshot['runtime']['instances'][number]): readonly string[] {\n if (instance.state.kind === 'ready') return [];\n\n const waiting = instance.state.kind === 'waiting' ? ` (${instance.state.reason})` : '';\n\n return [`Feature ${instance.label}: ${instance.state.kind}${waiting}.`];\n}\n\nfunction callFact(call: RuntimeActivitySnapshot['calls'][number]): string {\n if (call.lane === null) return `Call ${call.declaration}: ${call.state}; lane parallel; blockers none (parallel).`;\n\n const blockers = call.lane.blockedBy === 'unknown' ? 'unknown' : call.lane.blockedBy.join(', ');\n\n return `Call ${call.declaration}: ${call.state}; lane ${call.lane.declaration}; blockers ${blockers}.`;\n}\n\nfunction activityFacts(activity: RuntimeActivitySnapshot | undefined): readonly string[] {\n if (activity === undefined) return ['Runtime activity: unknown.'];\n\n const facts: string[] = [];\n\n if (activity.freshness === 'stale' || activity.truncated) {\n facts.push(`Activity: ${activity.freshness}${activity.truncated ? ', truncated' : ''}; completeness unknown.`);\n }\n\n return [\n ...facts,\n ...activity.features.map(\n feature => `Feature ${feature.feature}: ${feature.phase}; body ${feature.body}; host demand unknown.`,\n ),\n ...activity.calls.map(callFact),\n ...activity.resources.map(\n resource => `Resource ${resource.id}: ${resource.state}; retainers ${String(resource.retainers)}.`,\n ),\n ];\n}\n\nfunction explainSnapshot(snapshot: RuntimeGraphSnapshot): string {\n const facts = [\n ...snapshot.runtime.conditions.flatMap(condition =>\n condition.state.kind === 'true' ? [] : [`Condition ${condition.label}: ${condition.state.kind}.`],\n ),\n ...snapshot.runtime.instances.flatMap(instanceFacts),\n ...activityFacts(snapshot.activity),\n ];\n\n return facts.length === 0\n ? 'No registered runtime blocker observed; external UI and host work are unknown.'\n : facts.join('\\n');\n}\n\n/** D206: the failure carries the producer's same data-only graph/activity facts, without product payloads. */\nclass ScenarioTimeoutError extends Error {\n readonly code = 'timeout';\n\n constructor(\n readonly label: string,\n readonly timeoutMs: number,\n readonly snapshot: RuntimeGraphSnapshot,\n readonly history: readonly RuntimeGraphSnapshot[],\n ) {\n super(`Scenario timed out after ${String(timeoutMs)}ms: ${label}.\\n${explainSnapshot(snapshot)}`);\n this.name = 'ScenarioTimeoutError';\n }\n}\n\nfunction ownershipComplete(activity: RuntimeActivitySnapshot | undefined, successfullyClosed: boolean): boolean {\n if (!successfullyClosed || activity === undefined) return false;\n\n return activity.closed && !activity.truncated;\n}\n\nfunction ownershipReasons(\n activity: RuntimeActivitySnapshot | undefined,\n complete: boolean,\n successfullyClosed: boolean,\n): readonly string[] {\n if (activity === undefined) return ['Runtime activity is unavailable.'];\n\n const reasons: string[] = [];\n\n if (activity.truncated) reasons.push('The activity snapshot is truncated.');\n\n if (activity.freshness === 'stale' && !complete) reasons.push('The activity snapshot is stale.');\n\n if (!successfullyClosed) reasons.push('Successful application and mount cleanup has not been observed.');\n\n return Object.freeze(reasons);\n}\n\nfunction ownershipCounts(\n activity: RuntimeActivitySnapshot | undefined,\n complete: boolean,\n): Pick<ScenarioOwnership, 'calls' | 'features' | 'resources'> {\n if (activity === undefined || activity.truncated || (activity.freshness === 'stale' && !complete)) {\n return { calls: 'unknown', features: 'unknown', resources: 'unknown' };\n }\n\n return { calls: activity.calls.length, features: activity.features.length, resources: activity.resources.length };\n}\n\nfunction scenarioOwnership(snapshot: RuntimeGraphSnapshot, successfullyClosed: boolean): ScenarioOwnership {\n const activity = snapshot.activity;\n const complete = ownershipComplete(activity, successfullyClosed);\n\n return Object.freeze({\n ...ownershipCounts(activity, complete),\n closed: successfullyClosed,\n reasons: ownershipReasons(activity, complete, successfullyClosed),\n scope: 'registered-runtime',\n status: complete ? 'complete' : 'unknown',\n });\n}\n\nexport { scenarioOwnership, ScenarioTimeoutError };\n","import type { ScenarioHostMount } from './scenario-types';\n\n/** A reservation exists before the host callback, so reentrant close also owns a mount returned later. */\nclass ScenarioMountLease<Mounted extends ScenarioHostMount> {\n get closed(): boolean {\n return this.completion !== undefined;\n }\n private available = false;\n private completion: Promise<void> | undefined;\n private handle: Mounted | undefined;\n private reject: ((error: unknown) => void) | undefined;\n\n private resolve: (() => void) | undefined;\n\n constructor(private readonly released: (failed: boolean, error?: unknown) => void) {}\n\n readonly close = (): Promise<void> => {\n if (this.completion !== undefined) return this.completion;\n\n this.completion = new Promise<void>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n\n if (this.available) this.releaseAvailable();\n\n return this.completion;\n };\n\n provide(handle: Mounted | undefined): void {\n this.available = true;\n this.handle = handle;\n\n if (this.closed) this.releaseAvailable();\n }\n\n private finish(failed: boolean, error?: unknown): void {\n const resolve = this.resolve;\n const reject = this.reject;\n this.resolve = undefined;\n this.reject = undefined;\n this.released(failed, error);\n\n if (!failed) resolve?.();\n else reject?.(error);\n }\n\n private releaseAvailable(): void {\n const handle = this.handle;\n this.handle = undefined;\n this.available = false;\n try {\n Promise.resolve(handle?.unmount()).then(\n () => this.finish(false),\n (error: unknown) => this.finish(true, error),\n );\n } catch (error) {\n this.finish(true, error);\n }\n }\n}\n\nexport { ScenarioMountLease };\n","import { createElement } from 'react';\nimport type { FC, ReactNode } from 'react';\n\nimport type { Call } from '@opetope/core';\nimport { defineCallTarget } from '@opetope/core/internal';\n\nimport { bindCommand } from './command';\nimport { contributionAuthority, ContributionMount } from './contribution-frame';\nimport type { ContributionValue, ModelFixture } from './contribution-frame';\nimport { useReadable } from './readable-hooks';\nimport type { SlotComponentProperties, SlotContribution, SlotProperties, SlotTarget } from './slot';\n\n/**\n * Two forms, as `renderRoot` had (D19): without `contribution` the harness mounts what the target published, with it\n * the harness mounts one fixture contribution so a component test needs no generation.\n */\ntype SlotTestFixture<Props extends SlotProperties> = {\n readonly contribution?: SlotContribution<Props>;\n readonly models?: readonly ModelFixture[];\n readonly props?: SlotComponentProperties<Props>;\n};\n\ninterface SlotTestHarness<Props extends SlotProperties> {\n readonly Slot: FC;\n readonly updateProps: (props: SlotComponentProperties<Props>) => void;\n}\n\nlet fixtureSequence = 0;\n\n/** A command a fixture publishes: the test writes the body, the harness gives it the identity a model requires. */\nfunction command<Input, Output>(run: (input: Input) => Output | PromiseLike<Output>): Call<Input, Output> {\n fixtureSequence += 1;\n\n return bindCommand(defineCallTarget<Input, Output>({ id: `testing.command.${String(fixtureSequence)}`, run }));\n}\n\n/**\n * Mounts the contributions of one slot the way a host does, with optional model fixtures for a component test. D19 and D85: the same\n * ContributionMount is shared by component tests and the application scenario harness (D206).\n */\nfunction createSlotHarness<Props extends SlotProperties>(\n target: SlotTarget<Props>,\n fixture: SlotTestFixture<Props> = {},\n): SlotTestHarness<Props> & { readonly close: () => void } {\n const fixtures = fixture.models ?? [];\n let current: object = fixture.props ?? {};\n const listeners = new Set<() => void>();\n const props = {\n getSnapshot: (): object => current,\n subscribe: (listener: () => void): (() => void) => {\n listeners.add(listener);\n\n return () => listeners.delete(listener);\n },\n };\n\n const supplied = fixture.contribution;\n const Mounted: FC = (): ReactNode => {\n const published = useReadable(target.entries);\n const slotProps = useReadable(props);\n const entries =\n supplied === undefined\n ? published.map(\n entry => [entry.id as string, entry.value as ContributionValue, contributionAuthority(entry)] as const,\n )\n : [['testing.contribution', supplied as unknown as ContributionValue, undefined] as const];\n\n return entries.map(([key, contribution, authority]) =>\n createElement(ContributionMount, { authority, contribution, fixtures, key, slotProps }),\n );\n };\n\n return Object.freeze({\n close: (): void => {\n current = {};\n listeners.clear();\n },\n Slot: Mounted,\n updateProps: (next: SlotComponentProperties<Props>): void => {\n current = next;\n\n for (const listener of [...listeners]) listener();\n },\n });\n}\n\nfunction renderSlot<Props extends SlotProperties>(\n target: SlotTarget<Props>,\n fixture: SlotTestFixture<Props> = {},\n): SlotTestHarness<Props> {\n const harness = createSlotHarness(target, fixture);\n\n return Object.freeze({ Slot: harness.Slot, updateProps: harness.updateProps });\n}\n\nexport { command, createSlotHarness, renderSlot };\nexport type { SlotTestFixture, SlotTestHarness };\n","import type { RuntimeGraphSnapshot } from '@opetope/runtime/internal';\n\nimport { ScenarioTimeoutError } from './scenario-diagnostics';\nimport type { ScenarioWaitOptions } from './scenario-types';\n\nfunction positiveDuration(value: number, label: string): number {\n if (!Number.isFinite(value) || value <= 0 || value > 2_147_483_647) {\n throw new RangeError(`${label} must be a finite duration from 0 (exclusive) to 2147483647ms.`);\n }\n\n return value;\n}\n\ninterface ScenarioWaitSource {\n readonly getSnapshot: () => RuntimeGraphSnapshot;\n readonly history: () => readonly RuntimeGraphSnapshot[];\n readonly timeoutMs: number;\n}\n\nclass ScenarioWaiters {\n private readonly listeners = new Set<() => void>();\n private readonly pending = new Set<(error: Error) => void>();\n\n constructor(private readonly source: ScenarioWaitSource) {}\n\n cancel(): void {\n for (const reject of [...this.pending]) reject(new Error('Scenario is closing.'));\n }\n\n deadline<Value>(result: PromiseLike<Value>, label: string, timeoutMs = this.source.timeoutMs): Promise<Value> {\n positiveDuration(timeoutMs, 'Scenario timeoutMs');\n\n return new Promise<Value>((resolve, reject) => {\n const timer = setTimeout(() => reject(this.timeout(label, timeoutMs)), timeoutMs);\n Promise.resolve(result).then(\n value => {\n clearTimeout(timer);\n resolve(value);\n },\n (error: unknown) => {\n clearTimeout(timer);\n reject(error);\n },\n );\n });\n }\n\n readonly notify = (): void => {\n for (const listener of [...this.listeners]) listener();\n };\n\n waitFor(predicate: (snapshot: RuntimeGraphSnapshot) => boolean, options: ScenarioWaitOptions): Promise<void> {\n const timeoutMs = positiveDuration(options.timeoutMs ?? this.source.timeoutMs, 'Scenario timeoutMs');\n const pollIntervalMs = positiveDuration(options.pollIntervalMs ?? 10, 'Scenario pollIntervalMs');\n\n return new Promise<void>((resolve, reject) => {\n let done = false;\n let dispose = (): void => undefined;\n const finish = (error?: unknown, failed = error !== undefined): void => {\n if (done) return;\n\n done = true;\n dispose();\n\n if (!failed) resolve();\n else reject(error);\n };\n const check = (): void => {\n if (done) return;\n\n try {\n if (predicate(this.source.getSnapshot())) finish();\n } catch (error) {\n finish(error, true);\n }\n };\n const cancel = (error: Error): void => finish(error);\n const deadline = setTimeout(() => finish(this.timeout(options.label ?? 'waitFor', timeoutMs)), timeoutMs);\n const poll = setInterval(check, pollIntervalMs);\n dispose = (): void => {\n clearTimeout(deadline);\n clearInterval(poll);\n this.listeners.delete(check);\n this.pending.delete(cancel);\n };\n this.listeners.add(check);\n this.pending.add(cancel);\n check();\n });\n }\n\n private timeout(label: string, timeoutMs: number): ScenarioTimeoutError {\n return new ScenarioTimeoutError(label, timeoutMs, this.source.getSnapshot(), this.source.history());\n }\n}\n\nexport { positiveDuration, ScenarioWaiters };\n","import { createAggregateError } from '@opetope/core/internal';\nimport { openApplication } from '@opetope/runtime';\nimport type { Application, ApplicationExecution } from '@opetope/runtime';\nimport { createInspectionSession } from '@opetope/runtime/internal';\nimport type { RuntimeGraphSnapshot, RuntimeInspectionSession } from '@opetope/runtime/internal';\n\nimport { scenarioOwnership } from './scenario-diagnostics';\nimport { ScenarioMountLease } from './scenario-mount';\nimport { createSlotHarness } from './scenario-slot';\nimport type {\n Scenario,\n ScenarioFeatures,\n ScenarioHost,\n ScenarioHostMount,\n ScenarioMount,\n ScenarioOptions,\n ScenarioWaitOptions,\n} from './scenario-types';\nimport { positiveDuration, ScenarioWaiters } from './scenario-wait';\nimport type { SlotComponentProperties, SlotProperties, SlotTarget } from './slot';\n\nfunction boundedCapacity(value: number, label: string): number {\n if (!Number.isSafeInteger(value) || value < 1 || value > 10_000) {\n throw new RangeError(`${label} must be an integer from 1 to 10000.`);\n }\n\n return value;\n}\n\nfunction validateHost(host: unknown): void {\n if (host === null || typeof host !== 'object' || !('mount' in host) || typeof host.mount !== 'function') {\n throw new TypeError('Scenario requires a host.mount(Component) adapter.');\n }\n}\n\n/** D206: one real application, its existing inspection session and renderer-owned Slot ingress. */\nfunction createScenario<const Features extends ScenarioFeatures, Mounted extends ScenarioHostMount>(\n application: Application<Features>,\n options: ScenarioOptions<Features, Mounted>,\n): Scenario<Mounted> {\n const timeoutMs = positiveDuration(options.timeoutMs ?? 1_000, 'Scenario timeoutMs');\n const historyCapacity = boundedCapacity(options.historyCapacity ?? 64, 'Scenario historyCapacity');\n const activityCapacity = boundedCapacity(options.activityCapacity ?? 256, 'Scenario activityCapacity');\n let host: ScenarioHost<Mounted> | undefined = options.host;\n\n validateHost(host);\n\n let execution: ApplicationExecution | undefined = openApplication(application, {\n ...(options.cleanupFailure === undefined ? {} : { cleanupFailure: options.cleanupFailure }),\n conditions: options.conditions,\n imports: options.imports,\n });\n let session: RuntimeInspectionSession;\n try {\n session = createInspectionSession(execution, { activityCapacity, ringCapacity: historyCapacity });\n } catch (error) {\n void execution.ready.catch(() => undefined);\n void execution.close().catch(() => undefined);\n throw error;\n }\n\n let phase: 'closed' | 'closing' | 'open' = 'open';\n let successfullyClosed = false;\n let capturing = false;\n const records: RuntimeGraphSnapshot[] = [];\n const mounts = new Set<ScenarioMountLease<Mounted>>();\n const mountFailures: unknown[] = [];\n const getSnapshot = (): RuntimeGraphSnapshot => session.getSnapshot();\n const history = (): readonly RuntimeGraphSnapshot[] => Object.freeze([...records]);\n const waiters = new ScenarioWaiters({ getSnapshot, history, timeoutMs });\n const capture = (): void => {\n if (capturing) return;\n\n capturing = true;\n try {\n const snapshot = getSnapshot();\n const previous = records[records.length - 1];\n\n if (previous?.stateRevision !== snapshot.stateRevision || previous.activity !== snapshot.activity) {\n records.push(snapshot);\n\n if (records.length > historyCapacity) records.shift();\n }\n } finally {\n capturing = false;\n }\n waiters.notify();\n };\n const release = session.subscribe(capture);\n capture();\n const ready = waiters.deadline(execution.ready, 'application ready');\n // A test may deliberately inspect loading without awaiting ready; rejection remains observable to that caller.\n void ready.catch(() => undefined);\n\n let physicalClose: Promise<void> | undefined;\n let closeAttempt: Promise<void> | undefined;\n const startClose = (): Promise<void> => {\n if (physicalClose !== undefined) return physicalClose;\n\n let resolve!: () => void;\n let reject!: (error: unknown) => void;\n physicalClose = new Promise<void>((accept, refuse) => {\n resolve = accept;\n reject = refuse;\n });\n phase = 'closing';\n waiters.cancel();\n const drains: Promise<void>[] = [];\n // Fence before any foreign unmount callback can reenter UI ingress; join all physical drains afterwards.\n try {\n drains.push(execution!.close());\n } catch (error) {\n drains.push(Promise.reject(error));\n }\n drains.push(...[...mounts].map(mount => mount.close()));\n void Promise.allSettled(drains).then(results => {\n const failures = [\n ...new Set([\n ...mountFailures,\n ...results.flatMap(result => (result.status === 'rejected' ? [result.reason as unknown] : [])),\n ]),\n ];\n mountFailures.length = 0;\n phase = 'closed';\n try {\n capture();\n } catch (error) {\n failures.push(error);\n } finally {\n release();\n session.close();\n mounts.clear();\n execution = undefined;\n host = undefined;\n }\n successfullyClosed = failures.length === 0;\n\n if (failures.length === 0) resolve();\n else reject(createAggregateError(failures, 'Scenario cleanup failed.'));\n });\n\n return physicalClose;\n };\n\n const close = (): Promise<void> => {\n if (closeAttempt !== undefined) return closeAttempt;\n\n const drain = startClose();\n\n // A nested close during unmount may have installed the same attempt already.\n if (closeAttempt !== undefined) return closeAttempt;\n\n closeAttempt = waiters.deadline(drain, 'scenario close');\n void closeAttempt.catch(() => {\n // A deadline cannot cancel physical work. A later close can await that same drain with a new deadline.\n if (phase === 'closing') closeAttempt = undefined;\n });\n\n return closeAttempt;\n };\n\n const mount: Scenario<Mounted>['mount'] = <Props extends SlotProperties>(\n target: SlotTarget<Props>,\n fixture: { readonly props?: SlotComponentProperties<Props> } = {},\n ): ScenarioMount<Props, Mounted> => {\n if (phase !== 'open') throw new Error('Scenario is closing.');\n\n const slot = createSlotHarness(target, fixture);\n const lease = new ScenarioMountLease<Mounted>((failed, error) => {\n mounts.delete(lease);\n slot.close();\n\n if (failed) mountFailures.push(error);\n });\n mounts.add(lease);\n let mounted: Mounted;\n try {\n mounted = host!.mount(slot.Slot);\n\n if (mounted === null || typeof mounted !== 'object' || typeof mounted.unmount !== 'function') {\n throw new TypeError('Scenario host.mount must return an unmount() handle.');\n }\n\n lease.provide(mounted);\n } catch (error) {\n lease.provide(undefined);\n void lease.close().catch(() => undefined);\n throw error;\n }\n\n return Object.freeze({\n host: mounted,\n unmount: lease.close,\n updateProps: (props: SlotComponentProperties<Props>): void => {\n if (phase !== 'open' || lease.closed) throw new Error('Scenario mount is closed.');\n\n slot.updateProps(props);\n waiters.notify();\n },\n });\n };\n\n return Object.freeze({\n close,\n getSnapshot,\n history,\n mount,\n notify: (): void => {\n if (phase === 'open') waiters.notify();\n },\n ownership: () => scenarioOwnership(getSnapshot(), successfullyClosed),\n ready,\n waitFor: (predicate: (snapshot: RuntimeGraphSnapshot) => boolean, waitOptions: ScenarioWaitOptions = {}) => {\n if (phase !== 'open') return Promise.reject(new Error('Scenario is closing.'));\n\n return waiters.waitFor(predicate, waitOptions);\n },\n });\n}\n\nexport { createScenario };\n"],"names":["instanceFacts","instance","waiting","callFact","call","blockers","activityFacts","activity","facts","feature","resource","explainSnapshot","snapshot","condition","ScenarioTimeoutError","label","timeoutMs","history","ownershipComplete","successfullyClosed","ownershipReasons","complete","reasons","ownershipCounts","scenarioOwnership","ScenarioMountLease","released","resolve","reject","handle","failed","error","fixtureSequence","command","run","bindCommand","defineCallTarget","createSlotHarness","target","fixture","fixtures","current","listeners","props","listener","supplied","published","useReadable","slotProps","entry","contributionAuthority","key","contribution","authority","createElement","ContributionMount","next","renderSlot","harness","positiveDuration","value","ScenarioWaiters","source","result","timer","predicate","options","pollIntervalMs","done","dispose","finish","check","cancel","deadline","poll","boundedCapacity","validateHost","host","createScenario","application","historyCapacity","activityCapacity","execution","openApplication","session","createInspectionSession","phase","capturing","records","mounts","mountFailures","getSnapshot","waiters","capture","previous","release","ready","physicalClose","closeAttempt","startClose","accept","refuse","drains","mount","results","failures","createAggregateError","drain","slot","lease","mounted","waitOptions"],"mappings":"2TAIA,SAASA,EAAcC,EAA8D,CACnF,GAAIA,EAAS,MAAM,OAAS,QAAS,MAAO,CAAA,EAE5C,MAAMC,EAAUD,EAAS,MAAM,OAAS,UAAY,KAAKA,EAAS,MAAM,MAAM,IAAM,GAEpF,MAAO,CAAC,WAAWA,EAAS,KAAK,KAAKA,EAAS,MAAM,IAAI,GAAGC,CAAO,GAAG,CACxE,CAEA,SAASC,EAASC,EAA8C,CAC9D,GAAIA,EAAK,OAAS,KAAM,MAAO,QAAQA,EAAK,WAAW,KAAKA,EAAK,KAAK,6CAEtE,MAAMC,EAAWD,EAAK,KAAK,YAAc,UAAY,UAAYA,EAAK,KAAK,UAAU,KAAK,IAAI,EAE9F,MAAO,QAAQA,EAAK,WAAW,KAAKA,EAAK,KAAK,UAAUA,EAAK,KAAK,WAAW,cAAcC,CAAQ,GACrG,CAEA,SAASC,EAAcC,EAA6C,CAClE,GAAI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,YAAYjE,CAAK,EACtBiD,EAAQ,OAAM,CAChB,CACD,CAAA,CACH,EAOE,OAAQ,IAAW,CACbN,IAAU,QAAQM,EAAQ,OAAM,CACtC,EACA,UAAW,IAAMpE,EAAkBmE,EAAW,EAAIxE,CAAkB,EACpE,MAAA6E,EACA,QAAS,CAAC/B,EAAwD8C,EAAmC,KAC/FzB,IAAU,OAAe,QAAQ,OAAO,IAAI,MAAM,sBAAsB,CAAC,EAEtEM,EAAQ,QAAQ3B,EAAW8C,CAAW,CAEhD,CAAA,CACH"}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opetope/react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=20.19.0"
|
|
6
|
+
},
|
|
7
|
+
"browserslist": [
|
|
8
|
+
"Chrome >= 82",
|
|
9
|
+
"Firefox >= 110",
|
|
10
|
+
"Safari >= 15",
|
|
11
|
+
"iOS >= 15",
|
|
12
|
+
"Android >= 82"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"README.ru.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"CHANGELOG.md"
|
|
21
|
+
],
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./integration": {
|
|
30
|
+
"types": "./dist/integration.d.ts",
|
|
31
|
+
"import": "./dist/integration.js"
|
|
32
|
+
},
|
|
33
|
+
"./testing": {
|
|
34
|
+
"types": "./dist/testing.d.ts",
|
|
35
|
+
"import": "./dist/testing.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rollup --config rollup.config.cjs",
|
|
40
|
+
"ci:eslint": "eslint src --quiet",
|
|
41
|
+
"ci:pack-smoke": "node ../../tooling/stress/scripts/check-built-dependencies.mjs core runtime react && node --test ./scripts/opetope-pack-smoke.test.mjs",
|
|
42
|
+
"ci:size-limit": "size-limit",
|
|
43
|
+
"ci:type": "node ../../tooling/typecheck.mjs --noEmit",
|
|
44
|
+
"ci:test": "node --expose-gc --experimental-vm-modules ../../node_modules/jest/bin/jest.js && npm run ci:pack-smoke"
|
|
45
|
+
},
|
|
46
|
+
"size-limit": [
|
|
47
|
+
{
|
|
48
|
+
"path": "dist/**/*.js",
|
|
49
|
+
"limit": "18kb"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@opetope/core": "0.1.0",
|
|
54
|
+
"@opetope/runtime": "0.1.0",
|
|
55
|
+
"@testing-library/react": "16.3.3",
|
|
56
|
+
"@types/react": "19.2.18",
|
|
57
|
+
"react": "19.2.8",
|
|
58
|
+
"react-dom": "19.2.8"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@opetope/core": "0.1.0",
|
|
62
|
+
"@opetope/runtime": "0.1.0",
|
|
63
|
+
"react": ">=19.0.0 <20"
|
|
64
|
+
},
|
|
65
|
+
"sideEffects": false,
|
|
66
|
+
"description": "React integration for Opetope models and feature contributions.",
|
|
67
|
+
"license": "MIT",
|
|
68
|
+
"author": "Aleksei Berezin",
|
|
69
|
+
"repository": {
|
|
70
|
+
"type": "git",
|
|
71
|
+
"url": "git+https://github.com/telchardev/opetope.git",
|
|
72
|
+
"directory": "packages/react"
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"access": "public"
|
|
76
|
+
}
|
|
77
|
+
}
|