@vielzeug/clockwork 3.0.0 → 26.10.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.
- package/README.md +1 -1
- package/dist/_dev.cjs +1 -1
- package/dist/_dev.cjs.map +1 -1
- package/dist/_dev.js +1 -5
- package/dist/_dev.js.map +1 -1
- package/dist/clockwork.cjs +1 -1
- package/dist/clockwork.cjs.map +1 -1
- package/dist/clockwork.iife.js +1 -1
- package/dist/clockwork.iife.js.map +1 -1
- package/dist/clockwork.js +1 -1
- package/dist/clockwork.js.map +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +11 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -12
- package/dist/errors.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/interpret.cjs +1 -1
- package/dist/interpret.cjs.map +1 -1
- package/dist/interpret.d.ts.map +1 -1
- package/dist/interpret.js +1 -262
- package/dist/interpret.js.map +1 -1
- package/dist/types.d.ts +20 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -5
- package/dist/_context.cjs +0 -2
- package/dist/_context.cjs.map +0 -1
- package/dist/_context.d.ts +0 -2
- package/dist/_context.d.ts.map +0 -1
- package/dist/_context.js +0 -10
- package/dist/_context.js.map +0 -1
- package/dist/definition.cjs +0 -2
- package/dist/definition.cjs.map +0 -1
- package/dist/definition.d.ts +0 -19
- package/dist/definition.d.ts.map +0 -1
- package/dist/definition.js +0 -123
- package/dist/definition.js.map +0 -1
package/dist/definition.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { ClockworkError as e } from "./errors.js";
|
|
2
|
-
import { isContextRecord as t } from "./_context.js";
|
|
3
|
-
//#region src/definition.ts
|
|
4
|
-
var n = 2147483647, r = (e) => {
|
|
5
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
6
|
-
let t = Object.getPrototypeOf(e);
|
|
7
|
-
return t === Object.prototype || t === null;
|
|
8
|
-
}, i = (t, n, r) => {
|
|
9
|
-
throw new e(t, n, r);
|
|
10
|
-
}, a = (e, t, n) => (Array.isArray(e) || i("INVALID_DEFINITION", t, n), e), o = (e, t, n) => a(e, `${t} must be an array`, {
|
|
11
|
-
...n,
|
|
12
|
-
phase: t
|
|
13
|
-
}).map((e, r) => (typeof e != "function" && i("INVALID_EFFECT", `${t} entry at index ${r} must be a function`, {
|
|
14
|
-
...n,
|
|
15
|
-
index: r,
|
|
16
|
-
phase: t
|
|
17
|
-
}), e)), s = (e, t, n) => typeof t != "string" || !e.has(t) ? i("UNKNOWN_TARGET", `target "${String(t)}" is not a declared state`, {
|
|
18
|
-
...n,
|
|
19
|
-
target: t
|
|
20
|
-
}) : t, c = (e, t, n) => {
|
|
21
|
-
let a = r(e) ? e : i("INVALID_TRANSITION", "a transition must be an object", n), c = s(t, a.target, n);
|
|
22
|
-
return a.guard !== void 0 && typeof a.guard != "function" && i("INVALID_TRANSITION", "transition guard must be a function", {
|
|
23
|
-
...n,
|
|
24
|
-
phase: "guard"
|
|
25
|
-
}), a.reduce !== void 0 && typeof a.reduce != "function" && i("INVALID_TRANSITION", "transition reducer must be a function", {
|
|
26
|
-
...n,
|
|
27
|
-
phase: "reduce"
|
|
28
|
-
}), {
|
|
29
|
-
effects: a.effects === void 0 ? void 0 : o(a.effects, "effects", n),
|
|
30
|
-
guard: a.guard,
|
|
31
|
-
reduce: a.reduce,
|
|
32
|
-
target: c
|
|
33
|
-
};
|
|
34
|
-
}, l = (e, t, n) => {
|
|
35
|
-
let r = Array.isArray(e) ? e : [e];
|
|
36
|
-
return r.length === 0 && i("INVALID_TRANSITION", "a transition array must not be empty", n), r.map((e, r) => c(e, t, {
|
|
37
|
-
...n,
|
|
38
|
-
transitionIndex: r
|
|
39
|
-
}));
|
|
40
|
-
}, u = (e, t, a, c) => {
|
|
41
|
-
let l = r(e) ? e : i("INVALID_TRANSITION", `state "${c}" after entries must be objects`, {
|
|
42
|
-
index: a,
|
|
43
|
-
state: c
|
|
44
|
-
}), u = l.delay;
|
|
45
|
-
(typeof u != "number" || !Number.isFinite(u) || u < 0 || u > n) && i("INVALID_AFTER_DELAY", `state "${c}" after delay must be between 0 and ${n}`, {
|
|
46
|
-
delay: u,
|
|
47
|
-
index: a,
|
|
48
|
-
state: c
|
|
49
|
-
});
|
|
50
|
-
let d = {
|
|
51
|
-
delay: u,
|
|
52
|
-
index: a,
|
|
53
|
-
state: c
|
|
54
|
-
};
|
|
55
|
-
return l.guard !== void 0 && typeof l.guard != "function" && i("INVALID_TRANSITION", "after guard must be a function", {
|
|
56
|
-
...d,
|
|
57
|
-
phase: "guard"
|
|
58
|
-
}), l.reduce !== void 0 && typeof l.reduce != "function" && i("INVALID_TRANSITION", "after reducer must be a function", {
|
|
59
|
-
...d,
|
|
60
|
-
phase: "reduce"
|
|
61
|
-
}), { definition: {
|
|
62
|
-
delay: u,
|
|
63
|
-
effects: l.effects === void 0 ? void 0 : o(l.effects, "effects", d),
|
|
64
|
-
guard: l.guard,
|
|
65
|
-
reduce: l.reduce,
|
|
66
|
-
target: s(t, l.target, d)
|
|
67
|
-
} };
|
|
68
|
-
}, d = (e, t) => a(e, `state "${t}" invoke must be an array`, { state: t }).map((e, n) => {
|
|
69
|
-
let a = r(e) ? e : i("INVALID_INVOKE", "invoke entry must be an object", {
|
|
70
|
-
index: n,
|
|
71
|
-
state: t
|
|
72
|
-
});
|
|
73
|
-
return typeof a.src != "function" && i("INVALID_INVOKE", "invoke src must be a function", {
|
|
74
|
-
index: n,
|
|
75
|
-
phase: "src",
|
|
76
|
-
state: t
|
|
77
|
-
}), a.onDone !== void 0 && typeof a.onDone != "function" && i("INVALID_INVOKE", "invoke onDone must be a function", {
|
|
78
|
-
index: n,
|
|
79
|
-
phase: "onDone",
|
|
80
|
-
state: t
|
|
81
|
-
}), a.onError !== void 0 && typeof a.onError != "function" && i("INVALID_INVOKE", "invoke onError must be a function", {
|
|
82
|
-
index: n,
|
|
83
|
-
phase: "onError",
|
|
84
|
-
state: t
|
|
85
|
-
}), {
|
|
86
|
-
onDone: a.onDone,
|
|
87
|
-
onError: a.onError,
|
|
88
|
-
src: a.src
|
|
89
|
-
};
|
|
90
|
-
}), f = (e) => {
|
|
91
|
-
let n = e, s = r(n) ? n : i("INVALID_DEFINITION", "machine definition must be an object", {}), c = r(s.states) ? s.states : i("INVALID_DEFINITION", "machine states must be an object", {}), f = Object.entries(c), p = new Map(f);
|
|
92
|
-
(typeof s.initial != "string" || !p.has(s.initial)) && i("INVALID_INITIAL_STATE", `initial state "${String(s.initial)}" is not declared`, { initial: s.initial }), s.context !== void 0 && !t(s.context) && i("INVALID_CONTEXT", "machine context must be a non-array object record", {});
|
|
93
|
-
let m = /* @__PURE__ */ new Map();
|
|
94
|
-
for (let [e, t] of f) {
|
|
95
|
-
let n = r(t) ? t : i("INVALID_DEFINITION", `state "${e}" must be an object`, { state: e });
|
|
96
|
-
("states" in n || "initial" in n) && i("INVALID_DEFINITION", `state "${e}" must be flat and cannot declare child states`, { state: e });
|
|
97
|
-
let s = /* @__PURE__ */ new Map();
|
|
98
|
-
if (n.on !== void 0) {
|
|
99
|
-
let t = r(n.on) ? n.on : i("INVALID_TRANSITION", `state "${e}" on must be an object`, { state: e });
|
|
100
|
-
for (let [n, r] of Object.entries(t)) s.set(n, l(r, p, {
|
|
101
|
-
state: e,
|
|
102
|
-
type: n
|
|
103
|
-
}));
|
|
104
|
-
}
|
|
105
|
-
let c = n.after === void 0 ? [] : a(n.after, `state "${e}" after must be an array`, { state: e }).map((t, n) => u(t, p, n, e));
|
|
106
|
-
m.set(e, {
|
|
107
|
-
after: c,
|
|
108
|
-
entry: n.entry === void 0 ? [] : o(n.entry, "entry", { state: e }),
|
|
109
|
-
exit: n.exit === void 0 ? [] : o(n.exit, "exit", { state: e }),
|
|
110
|
-
invoke: n.invoke === void 0 ? [] : d(n.invoke, e),
|
|
111
|
-
on: s
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
context: s.context ?? {},
|
|
116
|
-
initial: s.initial,
|
|
117
|
-
states: m
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
//#endregion
|
|
121
|
-
export { f as compileDefinition };
|
|
122
|
-
|
|
123
|
-
//# sourceMappingURL=definition.js.map
|
package/dist/definition.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","names":[],"sources":["../src/definition.ts"],"sourcesContent":["import { isContextRecord } from './_context.js';\nimport { ClockworkError } from './errors.js';\nimport type { After, Effect, Invoke, MachineConfig, MachineEvent, Transition } from './types.js';\n\nexport type CompiledAfter<State extends string, Context extends Record<string, unknown>, Event extends MachineEvent> = {\n readonly definition: After<State, Context, Event>;\n};\n\nexport type CompiledState<State extends string, Context extends Record<string, unknown>, Event extends MachineEvent> = {\n readonly after: readonly CompiledAfter<State, Context, Event>[];\n readonly entry: readonly Effect<Context, Event>[];\n readonly exit: readonly Effect<Context, Event>[];\n readonly invoke: readonly Invoke<Context, Event>[];\n readonly on: ReadonlyMap<string, readonly Transition<State, Context, Event>[]>;\n};\n\nexport type CompiledMachine<\n State extends string,\n Context extends Record<string, unknown>,\n Event extends MachineEvent,\n> = {\n readonly context: Context;\n readonly initial: State;\n readonly states: ReadonlyMap<State, CompiledState<State, Context, Event>>;\n};\n\nconst MAX_TIMER_MS = 2_147_483_647;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return false;\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n};\n\nconst fail = (code: ClockworkError['code'], message: string, details: Record<string, unknown>): never => {\n throw new ClockworkError(code, message, details);\n};\n\nconst array = (value: unknown, message: string, details: Record<string, unknown>): readonly unknown[] => {\n if (!Array.isArray(value)) fail('INVALID_DEFINITION', message, details);\n\n return value as readonly unknown[];\n};\n\nconst functions = <Value>(\n value: unknown,\n phase: 'effects' | 'entry' | 'exit',\n details: Record<string, unknown>,\n): readonly Value[] => {\n const values = array(value, `${phase} must be an array`, { ...details, phase });\n\n return values.map((candidate, index) => {\n if (typeof candidate !== 'function') {\n fail('INVALID_EFFECT', `${phase} entry at index ${index} must be a function`, { ...details, index, phase });\n }\n\n return candidate as Value;\n });\n};\n\nconst validateTarget = <State extends string>(\n states: ReadonlyMap<State, unknown>,\n target: unknown,\n details: Record<string, unknown>,\n): State => {\n if (typeof target !== 'string' || !states.has(target as State)) {\n return fail('UNKNOWN_TARGET', `target \"${String(target)}\" is not a declared state`, { ...details, target });\n }\n\n return target as State;\n};\n\nconst compileTransition = <State extends string, Context extends Record<string, unknown>, Event extends MachineEvent>(\n input: unknown,\n states: ReadonlyMap<State, unknown>,\n details: Record<string, unknown>,\n): Transition<State, Context, Event> => {\n const transition = isRecord(input) ? input : fail('INVALID_TRANSITION', 'a transition must be an object', details);\n const target = validateTarget(states, transition.target, details);\n\n if (transition.guard !== undefined && typeof transition.guard !== 'function') {\n fail('INVALID_TRANSITION', 'transition guard must be a function', { ...details, phase: 'guard' });\n }\n\n if (transition.reduce !== undefined && typeof transition.reduce !== 'function') {\n fail('INVALID_TRANSITION', 'transition reducer must be a function', { ...details, phase: 'reduce' });\n }\n\n return {\n effects:\n transition.effects === undefined\n ? undefined\n : functions<Effect<Context, Event>>(transition.effects, 'effects', details),\n guard: transition.guard as Transition<State, Context, Event>['guard'],\n reduce: transition.reduce as Transition<State, Context, Event>['reduce'],\n target,\n };\n};\n\nconst compileTransitions = <State extends string, Context extends Record<string, unknown>, Event extends MachineEvent>(\n input: unknown,\n states: ReadonlyMap<State, unknown>,\n details: Record<string, unknown>,\n): readonly Transition<State, Context, Event>[] => {\n const values = Array.isArray(input) ? input : [input];\n\n if (values.length === 0) fail('INVALID_TRANSITION', 'a transition array must not be empty', details);\n\n return values.map((value, transitionIndex) =>\n compileTransition<State, Context, Event>(value, states, { ...details, transitionIndex }),\n );\n};\n\nconst compileAfter = <State extends string, Context extends Record<string, unknown>, Event extends MachineEvent>(\n input: unknown,\n states: ReadonlyMap<State, unknown>,\n index: number,\n state: State,\n): CompiledAfter<State, Context, Event> => {\n const after = isRecord(input)\n ? input\n : fail('INVALID_TRANSITION', `state \"${state}\" after entries must be objects`, { index, state });\n const delay = after.delay;\n\n if (typeof delay !== 'number' || !Number.isFinite(delay) || delay < 0 || delay > MAX_TIMER_MS) {\n fail('INVALID_AFTER_DELAY', `state \"${state}\" after delay must be between 0 and ${MAX_TIMER_MS}`, {\n delay,\n index,\n state,\n });\n }\n\n const details = { delay, index, state };\n\n if (after.guard !== undefined && typeof after.guard !== 'function') {\n fail('INVALID_TRANSITION', 'after guard must be a function', { ...details, phase: 'guard' });\n }\n\n if (after.reduce !== undefined && typeof after.reduce !== 'function') {\n fail('INVALID_TRANSITION', 'after reducer must be a function', { ...details, phase: 'reduce' });\n }\n\n return {\n definition: {\n delay: delay as number,\n effects:\n after.effects === undefined ? undefined : functions<Effect<Context, Event>>(after.effects, 'effects', details),\n guard: after.guard as After<State, Context, Event>['guard'],\n reduce: after.reduce as After<State, Context, Event>['reduce'],\n target: validateTarget(states, after.target, details),\n },\n };\n};\n\nconst compileInvokes = <Context extends Record<string, unknown>, Event extends MachineEvent>(\n value: unknown,\n state: string,\n): readonly Invoke<Context, Event>[] =>\n array(value, `state \"${state}\" invoke must be an array`, { state }).map((value, index) => {\n const candidate = isRecord(value)\n ? value\n : fail('INVALID_INVOKE', 'invoke entry must be an object', { index, state });\n\n if (typeof candidate.src !== 'function') {\n fail('INVALID_INVOKE', 'invoke src must be a function', { index, phase: 'src', state });\n }\n\n if (candidate.onDone !== undefined && typeof candidate.onDone !== 'function') {\n fail('INVALID_INVOKE', 'invoke onDone must be a function', { index, phase: 'onDone', state });\n }\n\n if (candidate.onError !== undefined && typeof candidate.onError !== 'function') {\n fail('INVALID_INVOKE', 'invoke onError must be a function', { index, phase: 'onError', state });\n }\n\n return {\n onDone: candidate.onDone as Invoke<Context, Event>['onDone'],\n onError: candidate.onError as Invoke<Context, Event>['onError'],\n src: candidate.src as Invoke<Context, Event>['src'],\n };\n });\n\n/** Validates and structurally compiles a flat machine definition once. */\nexport const compileDefinition = <\n State extends string,\n Context extends Record<string, unknown>,\n Event extends MachineEvent,\n>(\n definition: MachineConfig<State, Context, Event>,\n): CompiledMachine<State, Context, Event> => {\n const raw = definition as unknown;\n const machine = isRecord(raw) ? raw : fail('INVALID_DEFINITION', 'machine definition must be an object', {});\n const rawStates = isRecord(machine.states)\n ? machine.states\n : fail('INVALID_DEFINITION', 'machine states must be an object', {});\n const rawStateEntries = Object.entries(rawStates) as [State, unknown][];\n const rawStateMap = new Map<State, unknown>(rawStateEntries);\n\n if (typeof machine.initial !== 'string' || !rawStateMap.has(machine.initial as State)) {\n fail('INVALID_INITIAL_STATE', `initial state \"${String(machine.initial)}\" is not declared`, {\n initial: machine.initial,\n });\n }\n\n if (machine.context !== undefined && !isContextRecord(machine.context)) {\n fail('INVALID_CONTEXT', 'machine context must be a non-array object record', {});\n }\n\n const states = new Map<State, CompiledState<State, Context, Event>>();\n\n for (const [state, rawNodeValue] of rawStateEntries) {\n const rawNode = isRecord(rawNodeValue)\n ? rawNodeValue\n : fail('INVALID_DEFINITION', `state \"${state}\" must be an object`, { state });\n\n if ('states' in rawNode || 'initial' in rawNode) {\n fail('INVALID_DEFINITION', `state \"${state}\" must be flat and cannot declare child states`, { state });\n }\n\n const on = new Map<string, readonly Transition<State, Context, Event>[]>();\n\n if (rawNode.on !== undefined) {\n const rawOn = isRecord(rawNode.on)\n ? rawNode.on\n : fail('INVALID_TRANSITION', `state \"${state}\" on must be an object`, { state });\n\n for (const [type, transition] of Object.entries(rawOn)) {\n on.set(type, compileTransitions<State, Context, Event>(transition, rawStateMap, { state, type }));\n }\n }\n\n const after =\n rawNode.after === undefined\n ? []\n : array(rawNode.after, `state \"${state}\" after must be an array`, { state }).map((entry, index) =>\n compileAfter<State, Context, Event>(entry, rawStateMap, index, state),\n );\n\n states.set(state, {\n after,\n entry: rawNode.entry === undefined ? [] : functions<Effect<Context, Event>>(rawNode.entry, 'entry', { state }),\n exit: rawNode.exit === undefined ? [] : functions<Effect<Context, Event>>(rawNode.exit, 'exit', { state }),\n invoke: rawNode.invoke === undefined ? [] : compileInvokes<Context, Event>(rawNode.invoke, state),\n on,\n });\n }\n\n return {\n context: (machine.context ?? {}) as Context,\n initial: machine.initial as State,\n states,\n };\n};\n"],"mappings":";;;AA0BA,IAAM,IAAe,YAEf,KAAY,MAAqD;CACrE,IAAI,OAAO,KAAU,aAAY,KAAkB,MAAM,QAAQ,CAAK,GAAG,OAAO;CAEhF,IAAM,IAAY,OAAO,eAAe,CAAK;CAC7C,OAAO,MAAc,OAAO,aAAa,MAAc;AACzD,GAEM,KAAQ,GAA8B,GAAiB,MAA4C;CACvG,MAAM,IAAI,EAAe,GAAM,GAAS,CAAO;AACjD,GAEM,KAAS,GAAgB,GAAiB,OACzC,MAAM,QAAQ,CAAK,KAAG,EAAK,sBAAsB,GAAS,CAAO,GAE/D,IAGH,KACJ,GACA,GACA,MAEe,EAAM,GAAO,GAAG,EAAM,oBAAoB;CAAE,GAAG;CAAS;AAAM,CAEtE,CAAA,CAAO,KAAK,GAAW,OACxB,OAAO,KAAc,cACvB,EAAK,kBAAkB,GAAG,EAAM,kBAAkB,EAAM,sBAAsB;CAAE,GAAG;CAAS;CAAO;AAAM,CAAC,GAGrG,EACR,GAGG,KACJ,GACA,GACA,MAEI,OAAO,KAAW,YAAY,CAAC,EAAO,IAAI,CAAe,IACpD,EAAK,kBAAkB,WAAW,OAAO,CAAM,EAAE,4BAA4B;CAAE,GAAG;CAAS;AAAO,CAAC,IAGrG,GAGH,KACJ,GACA,GACA,MACsC;CACtC,IAAM,IAAa,EAAS,CAAK,IAAI,IAAQ,EAAK,sBAAsB,kCAAkC,CAAO,GAC3G,IAAS,EAAe,GAAQ,E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