@rotorsoft/act 1.32.2 → 1.32.3
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/dist/index.js
CHANGED
|
@@ -1391,7 +1391,16 @@ var SettleOptionsSchema = DrainOptionsSchema.extend({
|
|
|
1391
1391
|
debounceMs: z2.number().min(0).optional(),
|
|
1392
1392
|
// `maxPasses` defaults to Infinity (no cap) when omitted; a present value is
|
|
1393
1393
|
// a non-negative integer — `0` is legal and means "run no passes".
|
|
1394
|
-
|
|
1394
|
+
//
|
|
1395
|
+
// `Infinity` is accepted explicitly. It is the documented default
|
|
1396
|
+
// (`Act.settle`'s doc-comment and `SettleOptions.maxPasses` both name it),
|
|
1397
|
+
// and `settle.ts` destructures `maxPasses = Infinity`, so the one value the
|
|
1398
|
+
// docs advertise was the one value `z.number().int()` refused — Zod 4
|
|
1399
|
+
// rejects `±Infinity`, and an integer check cannot pass it either. Wrapper
|
|
1400
|
+
// code normalizing an optional cap (`maxPasses: opts.maxPasses ?? Infinity`)
|
|
1401
|
+
// is the natural way to hit it. Accepting it also honors this module's own
|
|
1402
|
+
// rule that a value which works today is never newly rejected (#1711).
|
|
1403
|
+
maxPasses: z2.union([z2.number().int().min(0), z2.literal(Number.POSITIVE_INFINITY)]).optional()
|
|
1395
1404
|
}).loose();
|
|
1396
1405
|
function resolveSettleConfig(options) {
|
|
1397
1406
|
if (options === void 0) return void 0;
|
|
@@ -5379,12 +5388,19 @@ function act() {
|
|
|
5379
5388
|
);
|
|
5380
5389
|
}
|
|
5381
5390
|
};
|
|
5391
|
+
const closed = (method) => {
|
|
5392
|
+
throw new Error(
|
|
5393
|
+
`act().${method}() was called after build(); the registry is already classified. Register everything before build() \u2014 build() itself may be called repeatedly (e.g. once per tenant with ActOptions.scoped).`
|
|
5394
|
+
);
|
|
5395
|
+
};
|
|
5382
5396
|
const builder = {
|
|
5383
5397
|
withState: (state2) => {
|
|
5398
|
+
if (_built) closed("withState");
|
|
5384
5399
|
register_state(state2, states, registry.actions, registry.events);
|
|
5385
5400
|
return builder;
|
|
5386
5401
|
},
|
|
5387
5402
|
withSlice: (input) => {
|
|
5403
|
+
if (_built) closed("withSlice");
|
|
5388
5404
|
for (const s of input.states.values()) {
|
|
5389
5405
|
register_state(s, states, registry.actions, registry.events);
|
|
5390
5406
|
}
|
|
@@ -5405,6 +5421,7 @@ function act() {
|
|
|
5405
5421
|
return builder;
|
|
5406
5422
|
},
|
|
5407
5423
|
withProjection: (proj) => {
|
|
5424
|
+
if (_built) closed("withProjection");
|
|
5408
5425
|
record_projection_reactions(proj);
|
|
5409
5426
|
merge_projection(proj, registry.events);
|
|
5410
5427
|
register_batch_handler(proj, batch_handlers);
|
|
@@ -5414,10 +5431,14 @@ function act() {
|
|
|
5414
5431
|
},
|
|
5415
5432
|
withActor: () => builder,
|
|
5416
5433
|
withLane: (config2) => {
|
|
5434
|
+
if (_built) closed("withLane");
|
|
5417
5435
|
register_lane(resolveLaneConfig(config2), lanes);
|
|
5418
5436
|
return builder;
|
|
5419
5437
|
},
|
|
5420
|
-
on: (event) =>
|
|
5438
|
+
on: (event) => {
|
|
5439
|
+
if (_built) closed("on");
|
|
5440
|
+
return reaction_on(event, registry.events, builder);
|
|
5441
|
+
},
|
|
5421
5442
|
build: (options) => {
|
|
5422
5443
|
resolveActConfig(options);
|
|
5423
5444
|
const patch_fn = options?.validateFoldedState === true ? validating_patch : bare_patch;
|