@almadar/runtime 5.8.0 → 5.8.1
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,5 +1,5 @@
|
|
|
1
|
-
import { createLogger, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, StateMachineManager, createContextFromBindings, validateEventPayload, formatPayloadValidationError, EffectExecutor } from './chunk-
|
|
2
|
-
export { InMemoryPersistence } from './chunk-
|
|
1
|
+
import { createLogger, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, StateMachineManager, createContextFromBindings, validateEventPayload, formatPayloadValidationError, EffectExecutor } from './chunk-GW5OOIRO.js';
|
|
2
|
+
export { InMemoryPersistence } from './chunk-GW5OOIRO.js';
|
|
3
3
|
import './chunk-PZ5AY32C.js';
|
|
4
4
|
import * as nodeModule from 'module';
|
|
5
5
|
import { evaluateGuard, evaluate } from '@almadar/evaluator';
|
|
@@ -2656,15 +2656,53 @@ function renameEntityInRenderUiConfig(node, oldName, newName) {
|
|
|
2656
2656
|
return next;
|
|
2657
2657
|
}
|
|
2658
2658
|
function renameEntityInEffects(effects, oldName, newName) {
|
|
2659
|
-
return effects.map((effect) =>
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2659
|
+
return effects.map((effect) => renameEntityInEffect(effect, oldName, newName));
|
|
2660
|
+
}
|
|
2661
|
+
var ENTITY_AT_POS_1 = /* @__PURE__ */ new Set(["fetch", "ref", "deref", "spawn"]);
|
|
2662
|
+
var ALL_ARGS_ARE_EFFECTS = /* @__PURE__ */ new Set([
|
|
2663
|
+
"do",
|
|
2664
|
+
"atomic",
|
|
2665
|
+
"async/race",
|
|
2666
|
+
"async/all",
|
|
2667
|
+
"async/sequence"
|
|
2668
|
+
]);
|
|
2669
|
+
var ARGS_FROM_POS_2_ARE_EFFECTS = /* @__PURE__ */ new Set([
|
|
2670
|
+
"if",
|
|
2671
|
+
"when",
|
|
2672
|
+
"let",
|
|
2673
|
+
"async/delay",
|
|
2674
|
+
"async/debounce",
|
|
2675
|
+
"async/throttle",
|
|
2676
|
+
"async/interval"
|
|
2677
|
+
]);
|
|
2678
|
+
function renameEntityInEffect(effect, oldName, newName) {
|
|
2679
|
+
if (!Array.isArray(effect) || effect.length === 0) return effect;
|
|
2680
|
+
const op = effect[0];
|
|
2681
|
+
if (typeof op !== "string") return effect;
|
|
2682
|
+
if (op === "render-ui" && effect.length >= 3) {
|
|
2683
|
+
const [, slot, config, ...rest] = effect;
|
|
2684
|
+
const nextConfig = renameEntityInRenderUiConfig(config, oldName, newName);
|
|
2685
|
+
return [op, slot, nextConfig, ...rest];
|
|
2686
|
+
}
|
|
2687
|
+
if (op === "persist" && effect.length >= 3 && effect[2] === oldName) {
|
|
2688
|
+
return [op, effect[1], newName, ...effect.slice(3)];
|
|
2689
|
+
}
|
|
2690
|
+
if (ENTITY_AT_POS_1.has(op) && effect[1] === oldName) {
|
|
2691
|
+
return [op, newName, ...effect.slice(2)];
|
|
2692
|
+
}
|
|
2693
|
+
const skipFirstNonEffectArg = ARGS_FROM_POS_2_ARE_EFFECTS.has(op);
|
|
2694
|
+
const recurseAll = ALL_ARGS_ARE_EFFECTS.has(op);
|
|
2695
|
+
if (recurseAll || skipFirstNonEffectArg) {
|
|
2696
|
+
const startIndex = skipFirstNonEffectArg ? 2 : 1;
|
|
2697
|
+
return effect.map((arg, i) => {
|
|
2698
|
+
if (i < startIndex) return arg;
|
|
2699
|
+
if (Array.isArray(arg)) {
|
|
2700
|
+
return renameEntityInEffect(arg, oldName, newName);
|
|
2701
|
+
}
|
|
2702
|
+
return arg;
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
return effect;
|
|
2668
2706
|
}
|
|
2669
2707
|
function applyLinkedEntityRename(trait, linkedEntity) {
|
|
2670
2708
|
const atomLinked = trait.linkedEntity;
|
|
@@ -2679,6 +2717,12 @@ function applyLinkedEntityRename(trait, linkedEntity) {
|
|
|
2679
2717
|
) : t.effects;
|
|
2680
2718
|
return { ...t, effects: nextEffects };
|
|
2681
2719
|
});
|
|
2720
|
+
refResolverLog.info("linkedEntity:rename", {
|
|
2721
|
+
trait: trait.name,
|
|
2722
|
+
from: atomLinked,
|
|
2723
|
+
to: linkedEntity,
|
|
2724
|
+
transitionCount: nextTransitions.length
|
|
2725
|
+
});
|
|
2682
2726
|
return {
|
|
2683
2727
|
...trait,
|
|
2684
2728
|
linkedEntity,
|
|
@@ -3433,5 +3477,5 @@ var InMemoryPersistence = class {
|
|
|
3433
3477
|
};
|
|
3434
3478
|
|
|
3435
3479
|
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, buildEmitsFromTraits, containsBindings, createContextFromBindings, createInitialTraitState, createLogger, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes };
|
|
3436
|
-
//# sourceMappingURL=chunk-
|
|
3437
|
-
//# sourceMappingURL=chunk-
|
|
3480
|
+
//# sourceMappingURL=chunk-GW5OOIRO.js.map
|
|
3481
|
+
//# sourceMappingURL=chunk-GW5OOIRO.js.map
|