@directive-run/core 0.1.1 → 0.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.
- package/README.md +153 -9
- package/dist/adapter-utils.d.cts +1 -1
- package/dist/adapter-utils.d.ts +1 -1
- package/dist/index.cjs +20 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -35
- package/dist/index.d.ts +9 -35
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/migration.cjs +12 -12
- package/dist/migration.cjs.map +1 -1
- package/dist/migration.js +12 -12
- package/dist/migration.js.map +1 -1
- package/dist/plugins/index.d.cts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/{plugins-CcwEXXMS.d.cts → plugins-KKRG7lDP.d.cts} +11 -1
- package/dist/{plugins-CcwEXXMS.d.ts → plugins-KKRG7lDP.d.ts} +11 -1
- package/dist/testing.cjs +3 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -3
- package/dist/testing.js.map +1 -1
- package/dist/worker.cjs +3 -3
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +3 -3
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Schema, F as Facts, R as Requirement, a as RequirementOutput, b as RetryPolicy, B as BatchConfig, c as ResolverContext, d as SchemaType, e as FactsStore, M as ModuleSchema, T as TypedDerivationsDef, f as TypedEventsDef, E as EffectsDef, g as TypedConstraintsDef, h as TypedResolversDef, i as ModuleHooks, C as CrossModuleDeps, j as CrossModuleDerivationsDef, k as CrossModuleEffectsDef, l as CrossModuleConstraintsDef, m as ModuleDef, n as CreateSystemOptionsSingle, o as SingleModuleSystem, p as ModulesMap, q as CreateSystemOptionsNamed, N as NamespacedSystem, D as DerivationsSchema, r as TypedConstraintDef, s as RequirementOutput$1, I as InferRequirements, P as Plugin, t as DebugConfig, u as ErrorBoundaryConfig, v as InferFacts, w as ExtractSchema, x as RequirementWithId, y as RequirementKeyFn, z as ConstraintsDef, A as ConstraintState, G as ResolversDef, H as ResolverStatus, J as System, K as FactChange, L as FactsSnapshot, O as ReconcileResult, Q as Snapshot, U as DirectiveError, V as RecoveryStrategy, W as ErrorSource, X as RetryLaterConfig, Y as TimeTravelAPI, Z as SystemConfig } from './plugins-
|
|
2
|
-
export { _ as AnySystem, $ as BatchItemResult, a0 as BatchResolveResults, a1 as CircuitBreakerConfig, a2 as CircuitBreakerState, a3 as CrossModuleConstraintDef, a4 as CrossModuleDerivationFn, a5 as CrossModuleEffectDef, a6 as CrossModuleFactsWithSelf, a7 as DerivationKeys, a8 as DerivationReturnType, a9 as DeriveAccessor, aa as DispatchEventsFromSchema, ab as DistributableSnapshot, ac as DistributableSnapshotOptions, ad as EffectCleanup, ae as EventPayloadSchema, af as EventsAccessor, ag as EventsAccessorFromSchema, ah as EventsDef, ai as EventsSchema, aj as FactKeys, ak as FactReturnType, al as FlexibleEventHandler, am as InferDerivations, an as InferEventPayloadFromSchema, ao as InferEvents, ap as InferRequirementPayloadFromSchema, aq as InferRequirementTypes, ar as InferSchema, as as InferSchemaType, at as InferSelectorState, au as MutableNamespacedFacts, av as NamespacedDerivations, aw as NamespacedEventsAccessor, ax as NamespacedFacts, ay as ObservableKeys, az as RequirementExplanation, aA as RequirementPayloadSchema, aB as RequirementsSchema, aC as SnapshotMeta, aD as SystemEvent, aE as SystemInspection, aF as SystemMode, aG as SystemSnapshot, aH as TimeTravelState, aI as TypedResolverContext, aJ as TypedResolverDef, aK as UnionEvents, aL as isNamespacedSystem, aM as isSingleModuleSystem } from './plugins-
|
|
1
|
+
import { S as Schema, F as Facts, R as Requirement, a as RequirementOutput, b as RetryPolicy, B as BatchConfig, c as ResolverContext, d as SchemaType, e as FactsStore, M as ModuleSchema, T as TypedDerivationsDef, f as TypedEventsDef, E as EffectsDef, g as TypedConstraintsDef, h as TypedResolversDef, i as ModuleHooks, C as CrossModuleDeps, j as CrossModuleDerivationsDef, k as CrossModuleEffectsDef, l as CrossModuleConstraintsDef, m as ModuleDef, n as CreateSystemOptionsSingle, o as SingleModuleSystem, p as ModulesMap, q as CreateSystemOptionsNamed, N as NamespacedSystem, D as DerivationsSchema, r as TypedConstraintDef, s as RequirementOutput$1, I as InferRequirements, P as Plugin, t as DebugConfig, u as ErrorBoundaryConfig, v as InferFacts, w as ExtractSchema, x as RequirementWithId, y as RequirementKeyFn, z as ConstraintsDef, A as ConstraintState, G as ResolversDef, H as ResolverStatus, J as System, K as FactChange, L as FactsSnapshot, O as ReconcileResult, Q as Snapshot, U as DirectiveError, V as RecoveryStrategy, W as ErrorSource, X as RetryLaterConfig, Y as TimeTravelAPI, Z as SystemConfig } from './plugins-KKRG7lDP.cjs';
|
|
2
|
+
export { _ as AnySystem, $ as BatchItemResult, a0 as BatchResolveResults, a1 as CircuitBreakerConfig, a2 as CircuitBreakerState, a3 as CrossModuleConstraintDef, a4 as CrossModuleDerivationFn, a5 as CrossModuleEffectDef, a6 as CrossModuleFactsWithSelf, a7 as DerivationKeys, a8 as DerivationReturnType, a9 as DeriveAccessor, aa as DispatchEventsFromSchema, ab as DistributableSnapshot, ac as DistributableSnapshotOptions, ad as EffectCleanup, ae as EventPayloadSchema, af as EventsAccessor, ag as EventsAccessorFromSchema, ah as EventsDef, ai as EventsSchema, aj as FactKeys, ak as FactReturnType, al as FlexibleEventHandler, am as InferDerivations, an as InferEventPayloadFromSchema, ao as InferEvents, ap as InferRequirementPayloadFromSchema, aq as InferRequirementTypes, ar as InferSchema, as as InferSchemaType, at as InferSelectorState, au as MutableNamespacedFacts, av as NamespacedDerivations, aw as NamespacedEventsAccessor, ax as NamespacedFacts, ay as ObservableKeys, az as RequirementExplanation, aA as RequirementPayloadSchema, aB as RequirementsSchema, aC as SnapshotMeta, aD as SystemEvent, aE as SystemInspection, aF as SystemMode, aG as SystemSnapshot, aH as TimeTravelState, aI as TypedResolverContext, aJ as TypedResolverDef, aK as UnionEvents, aL as isNamespacedSystem, aM as isSingleModuleSystem } from './plugins-KKRG7lDP.cjs';
|
|
3
3
|
export { D as DistributableSnapshotLike, S as SignedSnapshot, a as SnapshotDiff, b as SnapshotDiffEntry, d as diffSnapshots, i as isSignedSnapshot, c as isSnapshotExpired, s as shallowEqual, e as signSnapshot, v as validateSnapshot, f as verifySnapshotSignature } from './utils-4JrY5fk9.cjs';
|
|
4
4
|
export { DirectiveModuleStructure, ReduxSliceConfig, XStateMachineConfig, ZustandStoreConfig, analyzeReduxSlice, analyzeXStateMachine, analyzeZustandStore, generateMigrationChecklist, generateModuleCode } from './migration.cjs';
|
|
5
5
|
|
|
@@ -13,28 +13,13 @@ interface TrackingContext {
|
|
|
13
13
|
track(key: string): void;
|
|
14
14
|
getDependencies(): Set<string>;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Legacy derivation definition function signature.
|
|
18
|
-
* Used internally by the engine.
|
|
19
|
-
*
|
|
20
|
-
* @deprecated For typed derivations, use TypedDerivationsDef from module.ts
|
|
21
|
-
*/
|
|
16
|
+
/** Derivation definition function signature. */
|
|
22
17
|
interface DerivationDef<S extends Schema, T, D extends DerivationsDef<S>> {
|
|
23
18
|
(facts: Facts<S>, derive: DerivedValues<S, D>): T;
|
|
24
19
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Legacy map of derivation definitions.
|
|
27
|
-
* Used internally by the engine.
|
|
28
|
-
*
|
|
29
|
-
* @deprecated For typed derivations, use TypedDerivationsDef from module.ts
|
|
30
|
-
*/
|
|
20
|
+
/** Map of derivation definitions. */
|
|
31
21
|
type DerivationsDef<S extends Schema> = Record<string, DerivationDef<S, unknown, DerivationsDef<S>>>;
|
|
32
|
-
/**
|
|
33
|
-
* Legacy computed derived values.
|
|
34
|
-
* Used internally by the engine.
|
|
35
|
-
*
|
|
36
|
-
* @deprecated For typed derivations, use InferDerivations from schema.ts
|
|
37
|
-
*/
|
|
22
|
+
/** Computed derived values. */
|
|
38
23
|
type DerivedValues<S extends Schema, D extends DerivationsDef<S>> = {
|
|
39
24
|
readonly [K in keyof D]: ReturnType<D[K]>;
|
|
40
25
|
};
|
|
@@ -364,21 +349,6 @@ declare const t: {
|
|
|
364
349
|
nonNull(): ChainableSchemaType<T> & /*elided*/ any;
|
|
365
350
|
hasKeys(...keys: string[]): ChainableSchemaType<T> & /*elided*/ any;
|
|
366
351
|
};
|
|
367
|
-
/**
|
|
368
|
-
* Create an any-typed schema (bypasses all validation).
|
|
369
|
-
*
|
|
370
|
-
* @deprecated Use specific types (`t.string()`, `t.object()`, `t.union()`) for type safety.
|
|
371
|
-
* This bypasses all runtime validation.
|
|
372
|
-
*
|
|
373
|
-
* @example
|
|
374
|
-
* ```typescript
|
|
375
|
-
* // Use when type is complex or external
|
|
376
|
-
* schema: {
|
|
377
|
-
* externalApiResponse: t.any<ExternalAPIResponse>(),
|
|
378
|
-
* }
|
|
379
|
-
* ```
|
|
380
|
-
*/
|
|
381
|
-
any<T>(): ExtendedSchemaType<T>;
|
|
382
352
|
/**
|
|
383
353
|
* Create an enum schema type for string literal unions.
|
|
384
354
|
*
|
|
@@ -623,6 +593,8 @@ interface ModuleConfig<M extends ModuleSchema> {
|
|
|
623
593
|
constraints?: TypedConstraintsDef<M>;
|
|
624
594
|
resolvers?: TypedResolversDef<M>;
|
|
625
595
|
hooks?: ModuleHooks<M>;
|
|
596
|
+
/** Events that create time-travel snapshots for undo/redo. Omit to snapshot all events. */
|
|
597
|
+
snapshotEvents?: Array<keyof (M["events"] extends Record<string, unknown> ? M["events"] : Record<string, never>) & string>;
|
|
626
598
|
}
|
|
627
599
|
/**
|
|
628
600
|
* Module configuration with cross-module dependencies for type-safe access
|
|
@@ -692,6 +664,8 @@ interface ModuleConfigWithDeps<M extends ModuleSchema, Deps extends CrossModuleD
|
|
|
692
664
|
/** Resolvers. Uses flat access (`ctx.facts.myFact`) to keep async mutations scoped to own module. */
|
|
693
665
|
resolvers?: TypedResolversDef<M>;
|
|
694
666
|
hooks?: ModuleHooks<M>;
|
|
667
|
+
/** Events that create time-travel snapshots for undo/redo. Omit to snapshot all events. */
|
|
668
|
+
snapshotEvents?: Array<keyof (M["events"] extends Record<string, unknown> ? M["events"] : Record<string, never>) & string>;
|
|
695
669
|
}
|
|
696
670
|
/**
|
|
697
671
|
* Create a module definition with full type inference.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Schema, F as Facts, R as Requirement, a as RequirementOutput, b as RetryPolicy, B as BatchConfig, c as ResolverContext, d as SchemaType, e as FactsStore, M as ModuleSchema, T as TypedDerivationsDef, f as TypedEventsDef, E as EffectsDef, g as TypedConstraintsDef, h as TypedResolversDef, i as ModuleHooks, C as CrossModuleDeps, j as CrossModuleDerivationsDef, k as CrossModuleEffectsDef, l as CrossModuleConstraintsDef, m as ModuleDef, n as CreateSystemOptionsSingle, o as SingleModuleSystem, p as ModulesMap, q as CreateSystemOptionsNamed, N as NamespacedSystem, D as DerivationsSchema, r as TypedConstraintDef, s as RequirementOutput$1, I as InferRequirements, P as Plugin, t as DebugConfig, u as ErrorBoundaryConfig, v as InferFacts, w as ExtractSchema, x as RequirementWithId, y as RequirementKeyFn, z as ConstraintsDef, A as ConstraintState, G as ResolversDef, H as ResolverStatus, J as System, K as FactChange, L as FactsSnapshot, O as ReconcileResult, Q as Snapshot, U as DirectiveError, V as RecoveryStrategy, W as ErrorSource, X as RetryLaterConfig, Y as TimeTravelAPI, Z as SystemConfig } from './plugins-
|
|
2
|
-
export { _ as AnySystem, $ as BatchItemResult, a0 as BatchResolveResults, a1 as CircuitBreakerConfig, a2 as CircuitBreakerState, a3 as CrossModuleConstraintDef, a4 as CrossModuleDerivationFn, a5 as CrossModuleEffectDef, a6 as CrossModuleFactsWithSelf, a7 as DerivationKeys, a8 as DerivationReturnType, a9 as DeriveAccessor, aa as DispatchEventsFromSchema, ab as DistributableSnapshot, ac as DistributableSnapshotOptions, ad as EffectCleanup, ae as EventPayloadSchema, af as EventsAccessor, ag as EventsAccessorFromSchema, ah as EventsDef, ai as EventsSchema, aj as FactKeys, ak as FactReturnType, al as FlexibleEventHandler, am as InferDerivations, an as InferEventPayloadFromSchema, ao as InferEvents, ap as InferRequirementPayloadFromSchema, aq as InferRequirementTypes, ar as InferSchema, as as InferSchemaType, at as InferSelectorState, au as MutableNamespacedFacts, av as NamespacedDerivations, aw as NamespacedEventsAccessor, ax as NamespacedFacts, ay as ObservableKeys, az as RequirementExplanation, aA as RequirementPayloadSchema, aB as RequirementsSchema, aC as SnapshotMeta, aD as SystemEvent, aE as SystemInspection, aF as SystemMode, aG as SystemSnapshot, aH as TimeTravelState, aI as TypedResolverContext, aJ as TypedResolverDef, aK as UnionEvents, aL as isNamespacedSystem, aM as isSingleModuleSystem } from './plugins-
|
|
1
|
+
import { S as Schema, F as Facts, R as Requirement, a as RequirementOutput, b as RetryPolicy, B as BatchConfig, c as ResolverContext, d as SchemaType, e as FactsStore, M as ModuleSchema, T as TypedDerivationsDef, f as TypedEventsDef, E as EffectsDef, g as TypedConstraintsDef, h as TypedResolversDef, i as ModuleHooks, C as CrossModuleDeps, j as CrossModuleDerivationsDef, k as CrossModuleEffectsDef, l as CrossModuleConstraintsDef, m as ModuleDef, n as CreateSystemOptionsSingle, o as SingleModuleSystem, p as ModulesMap, q as CreateSystemOptionsNamed, N as NamespacedSystem, D as DerivationsSchema, r as TypedConstraintDef, s as RequirementOutput$1, I as InferRequirements, P as Plugin, t as DebugConfig, u as ErrorBoundaryConfig, v as InferFacts, w as ExtractSchema, x as RequirementWithId, y as RequirementKeyFn, z as ConstraintsDef, A as ConstraintState, G as ResolversDef, H as ResolverStatus, J as System, K as FactChange, L as FactsSnapshot, O as ReconcileResult, Q as Snapshot, U as DirectiveError, V as RecoveryStrategy, W as ErrorSource, X as RetryLaterConfig, Y as TimeTravelAPI, Z as SystemConfig } from './plugins-KKRG7lDP.js';
|
|
2
|
+
export { _ as AnySystem, $ as BatchItemResult, a0 as BatchResolveResults, a1 as CircuitBreakerConfig, a2 as CircuitBreakerState, a3 as CrossModuleConstraintDef, a4 as CrossModuleDerivationFn, a5 as CrossModuleEffectDef, a6 as CrossModuleFactsWithSelf, a7 as DerivationKeys, a8 as DerivationReturnType, a9 as DeriveAccessor, aa as DispatchEventsFromSchema, ab as DistributableSnapshot, ac as DistributableSnapshotOptions, ad as EffectCleanup, ae as EventPayloadSchema, af as EventsAccessor, ag as EventsAccessorFromSchema, ah as EventsDef, ai as EventsSchema, aj as FactKeys, ak as FactReturnType, al as FlexibleEventHandler, am as InferDerivations, an as InferEventPayloadFromSchema, ao as InferEvents, ap as InferRequirementPayloadFromSchema, aq as InferRequirementTypes, ar as InferSchema, as as InferSchemaType, at as InferSelectorState, au as MutableNamespacedFacts, av as NamespacedDerivations, aw as NamespacedEventsAccessor, ax as NamespacedFacts, ay as ObservableKeys, az as RequirementExplanation, aA as RequirementPayloadSchema, aB as RequirementsSchema, aC as SnapshotMeta, aD as SystemEvent, aE as SystemInspection, aF as SystemMode, aG as SystemSnapshot, aH as TimeTravelState, aI as TypedResolverContext, aJ as TypedResolverDef, aK as UnionEvents, aL as isNamespacedSystem, aM as isSingleModuleSystem } from './plugins-KKRG7lDP.js';
|
|
3
3
|
export { D as DistributableSnapshotLike, S as SignedSnapshot, a as SnapshotDiff, b as SnapshotDiffEntry, d as diffSnapshots, i as isSignedSnapshot, c as isSnapshotExpired, s as shallowEqual, e as signSnapshot, v as validateSnapshot, f as verifySnapshotSignature } from './utils-4JrY5fk9.js';
|
|
4
4
|
export { DirectiveModuleStructure, ReduxSliceConfig, XStateMachineConfig, ZustandStoreConfig, analyzeReduxSlice, analyzeXStateMachine, analyzeZustandStore, generateMigrationChecklist, generateModuleCode } from './migration.js';
|
|
5
5
|
|
|
@@ -13,28 +13,13 @@ interface TrackingContext {
|
|
|
13
13
|
track(key: string): void;
|
|
14
14
|
getDependencies(): Set<string>;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Legacy derivation definition function signature.
|
|
18
|
-
* Used internally by the engine.
|
|
19
|
-
*
|
|
20
|
-
* @deprecated For typed derivations, use TypedDerivationsDef from module.ts
|
|
21
|
-
*/
|
|
16
|
+
/** Derivation definition function signature. */
|
|
22
17
|
interface DerivationDef<S extends Schema, T, D extends DerivationsDef<S>> {
|
|
23
18
|
(facts: Facts<S>, derive: DerivedValues<S, D>): T;
|
|
24
19
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Legacy map of derivation definitions.
|
|
27
|
-
* Used internally by the engine.
|
|
28
|
-
*
|
|
29
|
-
* @deprecated For typed derivations, use TypedDerivationsDef from module.ts
|
|
30
|
-
*/
|
|
20
|
+
/** Map of derivation definitions. */
|
|
31
21
|
type DerivationsDef<S extends Schema> = Record<string, DerivationDef<S, unknown, DerivationsDef<S>>>;
|
|
32
|
-
/**
|
|
33
|
-
* Legacy computed derived values.
|
|
34
|
-
* Used internally by the engine.
|
|
35
|
-
*
|
|
36
|
-
* @deprecated For typed derivations, use InferDerivations from schema.ts
|
|
37
|
-
*/
|
|
22
|
+
/** Computed derived values. */
|
|
38
23
|
type DerivedValues<S extends Schema, D extends DerivationsDef<S>> = {
|
|
39
24
|
readonly [K in keyof D]: ReturnType<D[K]>;
|
|
40
25
|
};
|
|
@@ -364,21 +349,6 @@ declare const t: {
|
|
|
364
349
|
nonNull(): ChainableSchemaType<T> & /*elided*/ any;
|
|
365
350
|
hasKeys(...keys: string[]): ChainableSchemaType<T> & /*elided*/ any;
|
|
366
351
|
};
|
|
367
|
-
/**
|
|
368
|
-
* Create an any-typed schema (bypasses all validation).
|
|
369
|
-
*
|
|
370
|
-
* @deprecated Use specific types (`t.string()`, `t.object()`, `t.union()`) for type safety.
|
|
371
|
-
* This bypasses all runtime validation.
|
|
372
|
-
*
|
|
373
|
-
* @example
|
|
374
|
-
* ```typescript
|
|
375
|
-
* // Use when type is complex or external
|
|
376
|
-
* schema: {
|
|
377
|
-
* externalApiResponse: t.any<ExternalAPIResponse>(),
|
|
378
|
-
* }
|
|
379
|
-
* ```
|
|
380
|
-
*/
|
|
381
|
-
any<T>(): ExtendedSchemaType<T>;
|
|
382
352
|
/**
|
|
383
353
|
* Create an enum schema type for string literal unions.
|
|
384
354
|
*
|
|
@@ -623,6 +593,8 @@ interface ModuleConfig<M extends ModuleSchema> {
|
|
|
623
593
|
constraints?: TypedConstraintsDef<M>;
|
|
624
594
|
resolvers?: TypedResolversDef<M>;
|
|
625
595
|
hooks?: ModuleHooks<M>;
|
|
596
|
+
/** Events that create time-travel snapshots for undo/redo. Omit to snapshot all events. */
|
|
597
|
+
snapshotEvents?: Array<keyof (M["events"] extends Record<string, unknown> ? M["events"] : Record<string, never>) & string>;
|
|
626
598
|
}
|
|
627
599
|
/**
|
|
628
600
|
* Module configuration with cross-module dependencies for type-safe access
|
|
@@ -692,6 +664,8 @@ interface ModuleConfigWithDeps<M extends ModuleSchema, Deps extends CrossModuleD
|
|
|
692
664
|
/** Resolvers. Uses flat access (`ctx.facts.myFact`) to keep async mutations scoped to own module. */
|
|
693
665
|
resolvers?: TypedResolversDef<M>;
|
|
694
666
|
hooks?: ModuleHooks<M>;
|
|
667
|
+
/** Events that create time-travel snapshots for undo/redo. Omit to snapshot all events. */
|
|
668
|
+
snapshotEvents?: Array<keyof (M["events"] extends Record<string, unknown> ? M["events"] : Record<string, never>) & string>;
|
|
695
669
|
}
|
|
696
670
|
/**
|
|
697
671
|
* Create a module definition with full type inference.
|