@hypen-space/core 0.4.5 → 0.4.11
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/app.js +171 -171
- package/dist/app.js.map +4 -4
- package/dist/components/builtin.js +171 -171
- package/dist/components/builtin.js.map +4 -4
- package/dist/context.js +1 -1
- package/dist/context.js.map +1 -1
- package/dist/discovery.js +171 -171
- package/dist/discovery.js.map +4 -4
- package/dist/disposable.js +1 -1
- package/dist/disposable.js.map +1 -1
- package/dist/engine.browser.js +1 -1
- package/dist/engine.browser.js.map +1 -1
- package/dist/engine.js +1 -1
- package/dist/engine.js.map +1 -1
- package/dist/events.js +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.browser.js +171 -171
- package/dist/index.browser.js.map +4 -4
- package/dist/index.js +171 -171
- package/dist/index.js.map +4 -4
- package/dist/loader.js +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/logger.js +245 -0
- package/dist/logger.js.map +10 -0
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/remote/client.js +1 -1
- package/dist/remote/client.js.map +1 -1
- package/dist/remote/index.js +171 -171
- package/dist/remote/index.js.map +4 -4
- package/dist/remote/server.js +171 -171
- package/dist/remote/server.js.map +4 -4
- package/dist/renderer.js +1 -1
- package/dist/renderer.js.map +1 -1
- package/dist/router.js +1 -1
- package/dist/router.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +9 -0
- package/package.json +1 -1
- package/src/types.ts +1 -1
- package/wasm-browser/hypen_engine.d.ts +3 -3
- package/wasm-browser/hypen_engine.js +73 -66
- package/wasm-browser/hypen_engine_bg.wasm +0 -0
- package/wasm-browser/hypen_engine_bg.wasm.d.ts +3 -3
- package/wasm-browser/package.json +1 -1
- package/wasm-node/hypen_engine.js +74 -66
- package/wasm-node/hypen_engine_bg.wasm +0 -0
- package/wasm-node/hypen_engine_bg.wasm.d.ts +3 -3
- package/wasm-node/package.json +1 -1
package/dist/remote/index.js
CHANGED
|
@@ -275,176 +275,6 @@ var init_state = __esm(() => {
|
|
|
275
275
|
RAW_TARGET = Symbol.for("hypen.rawTarget");
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
// src/result.ts
|
|
279
|
-
function Ok(value) {
|
|
280
|
-
return { ok: true, value };
|
|
281
|
-
}
|
|
282
|
-
function Err(error) {
|
|
283
|
-
return { ok: false, error };
|
|
284
|
-
}
|
|
285
|
-
function isOk(result) {
|
|
286
|
-
return result.ok;
|
|
287
|
-
}
|
|
288
|
-
function isErr(result) {
|
|
289
|
-
return !result.ok;
|
|
290
|
-
}
|
|
291
|
-
async function fromPromise(promise, mapError) {
|
|
292
|
-
try {
|
|
293
|
-
const value = await promise;
|
|
294
|
-
return Ok(value);
|
|
295
|
-
} catch (e) {
|
|
296
|
-
if (mapError) {
|
|
297
|
-
return Err(mapError(e));
|
|
298
|
-
}
|
|
299
|
-
return Err(e);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function fromTry(fn, mapError) {
|
|
303
|
-
try {
|
|
304
|
-
return Ok(fn());
|
|
305
|
-
} catch (e) {
|
|
306
|
-
if (mapError) {
|
|
307
|
-
return Err(mapError(e));
|
|
308
|
-
}
|
|
309
|
-
return Err(e);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
function map(result, fn) {
|
|
313
|
-
if (result.ok) {
|
|
314
|
-
return Ok(fn(result.value));
|
|
315
|
-
}
|
|
316
|
-
return result;
|
|
317
|
-
}
|
|
318
|
-
function mapErr(result, fn) {
|
|
319
|
-
if (!result.ok) {
|
|
320
|
-
return Err(fn(result.error));
|
|
321
|
-
}
|
|
322
|
-
return result;
|
|
323
|
-
}
|
|
324
|
-
function flatMap(result, fn) {
|
|
325
|
-
if (result.ok) {
|
|
326
|
-
return fn(result.value);
|
|
327
|
-
}
|
|
328
|
-
return result;
|
|
329
|
-
}
|
|
330
|
-
function unwrap(result) {
|
|
331
|
-
if (result.ok) {
|
|
332
|
-
return result.value;
|
|
333
|
-
}
|
|
334
|
-
throw result.error;
|
|
335
|
-
}
|
|
336
|
-
function unwrapOr(result, defaultValue) {
|
|
337
|
-
if (result.ok) {
|
|
338
|
-
return result.value;
|
|
339
|
-
}
|
|
340
|
-
return defaultValue;
|
|
341
|
-
}
|
|
342
|
-
function unwrapOrElse(result, fn) {
|
|
343
|
-
if (result.ok) {
|
|
344
|
-
return result.value;
|
|
345
|
-
}
|
|
346
|
-
return fn(result.error);
|
|
347
|
-
}
|
|
348
|
-
function match(result, handlers) {
|
|
349
|
-
if (result.ok) {
|
|
350
|
-
return handlers.ok(result.value);
|
|
351
|
-
}
|
|
352
|
-
return handlers.err(result.error);
|
|
353
|
-
}
|
|
354
|
-
function all(results) {
|
|
355
|
-
const values = [];
|
|
356
|
-
for (const result of results) {
|
|
357
|
-
if (!result.ok) {
|
|
358
|
-
return result;
|
|
359
|
-
}
|
|
360
|
-
values.push(result.value);
|
|
361
|
-
}
|
|
362
|
-
return Ok(values);
|
|
363
|
-
}
|
|
364
|
-
function classifyEngineError(err) {
|
|
365
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
366
|
-
if (message.startsWith("Parse error:")) {
|
|
367
|
-
return new ParseError(message);
|
|
368
|
-
}
|
|
369
|
-
if (message.startsWith("Invalid state:") || message.startsWith("Invalid state patch:")) {
|
|
370
|
-
return new StateError(message);
|
|
371
|
-
}
|
|
372
|
-
if (message.startsWith("Parent node not found:")) {
|
|
373
|
-
return new RenderError(message);
|
|
374
|
-
}
|
|
375
|
-
return new RenderError(message);
|
|
376
|
-
}
|
|
377
|
-
var HypenError, ActionError, ConnectionError, StateError, ParseError, RenderError;
|
|
378
|
-
var init_result = __esm(() => {
|
|
379
|
-
HypenError = class HypenError extends Error {
|
|
380
|
-
code;
|
|
381
|
-
context;
|
|
382
|
-
cause;
|
|
383
|
-
constructor(code, message, options) {
|
|
384
|
-
super(message);
|
|
385
|
-
this.name = "HypenError";
|
|
386
|
-
this.code = code;
|
|
387
|
-
this.context = options?.context;
|
|
388
|
-
this.cause = options?.cause;
|
|
389
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
ActionError = class ActionError extends HypenError {
|
|
393
|
-
actionName;
|
|
394
|
-
constructor(actionName, cause) {
|
|
395
|
-
super("ACTION_ERROR", `Action handler "${actionName}" failed: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
396
|
-
context: { actionName },
|
|
397
|
-
cause: cause instanceof Error ? cause : undefined
|
|
398
|
-
});
|
|
399
|
-
this.name = "ActionError";
|
|
400
|
-
this.actionName = actionName;
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
ConnectionError = class ConnectionError extends HypenError {
|
|
404
|
-
url;
|
|
405
|
-
attempt;
|
|
406
|
-
constructor(url, cause, attempt) {
|
|
407
|
-
super("CONNECTION_ERROR", `Connection to "${url}" failed${attempt ? ` (attempt ${attempt})` : ""}: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
408
|
-
context: { url, attempt },
|
|
409
|
-
cause: cause instanceof Error ? cause : undefined
|
|
410
|
-
});
|
|
411
|
-
this.name = "ConnectionError";
|
|
412
|
-
this.url = url;
|
|
413
|
-
this.attempt = attempt;
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
StateError = class StateError extends HypenError {
|
|
417
|
-
path;
|
|
418
|
-
constructor(message, path, cause) {
|
|
419
|
-
super("STATE_ERROR", message, {
|
|
420
|
-
context: { path },
|
|
421
|
-
cause: cause instanceof Error ? cause : undefined
|
|
422
|
-
});
|
|
423
|
-
this.name = "StateError";
|
|
424
|
-
this.path = path;
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
ParseError = class ParseError extends HypenError {
|
|
428
|
-
source;
|
|
429
|
-
constructor(message, source, cause) {
|
|
430
|
-
super("PARSE_ERROR", message, {
|
|
431
|
-
context: { source },
|
|
432
|
-
cause: cause instanceof Error ? cause : undefined
|
|
433
|
-
});
|
|
434
|
-
this.name = "ParseError";
|
|
435
|
-
this.source = source;
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
|
-
RenderError = class RenderError extends HypenError {
|
|
439
|
-
constructor(message, cause) {
|
|
440
|
-
super("RENDER_ERROR", message, {
|
|
441
|
-
cause: cause instanceof Error ? cause : undefined
|
|
442
|
-
});
|
|
443
|
-
this.name = "RenderError";
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
});
|
|
447
|
-
|
|
448
278
|
// src/logger.ts
|
|
449
279
|
function isProduction() {
|
|
450
280
|
if (typeof process !== "undefined" && process.env) {
|
|
@@ -644,6 +474,176 @@ var init_logger = __esm(() => {
|
|
|
644
474
|
};
|
|
645
475
|
});
|
|
646
476
|
|
|
477
|
+
// src/result.ts
|
|
478
|
+
function Ok(value) {
|
|
479
|
+
return { ok: true, value };
|
|
480
|
+
}
|
|
481
|
+
function Err(error) {
|
|
482
|
+
return { ok: false, error };
|
|
483
|
+
}
|
|
484
|
+
function isOk(result) {
|
|
485
|
+
return result.ok;
|
|
486
|
+
}
|
|
487
|
+
function isErr(result) {
|
|
488
|
+
return !result.ok;
|
|
489
|
+
}
|
|
490
|
+
async function fromPromise(promise, mapError) {
|
|
491
|
+
try {
|
|
492
|
+
const value = await promise;
|
|
493
|
+
return Ok(value);
|
|
494
|
+
} catch (e) {
|
|
495
|
+
if (mapError) {
|
|
496
|
+
return Err(mapError(e));
|
|
497
|
+
}
|
|
498
|
+
return Err(e);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function fromTry(fn, mapError) {
|
|
502
|
+
try {
|
|
503
|
+
return Ok(fn());
|
|
504
|
+
} catch (e) {
|
|
505
|
+
if (mapError) {
|
|
506
|
+
return Err(mapError(e));
|
|
507
|
+
}
|
|
508
|
+
return Err(e);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function map(result, fn) {
|
|
512
|
+
if (result.ok) {
|
|
513
|
+
return Ok(fn(result.value));
|
|
514
|
+
}
|
|
515
|
+
return result;
|
|
516
|
+
}
|
|
517
|
+
function mapErr(result, fn) {
|
|
518
|
+
if (!result.ok) {
|
|
519
|
+
return Err(fn(result.error));
|
|
520
|
+
}
|
|
521
|
+
return result;
|
|
522
|
+
}
|
|
523
|
+
function flatMap(result, fn) {
|
|
524
|
+
if (result.ok) {
|
|
525
|
+
return fn(result.value);
|
|
526
|
+
}
|
|
527
|
+
return result;
|
|
528
|
+
}
|
|
529
|
+
function unwrap(result) {
|
|
530
|
+
if (result.ok) {
|
|
531
|
+
return result.value;
|
|
532
|
+
}
|
|
533
|
+
throw result.error;
|
|
534
|
+
}
|
|
535
|
+
function unwrapOr(result, defaultValue) {
|
|
536
|
+
if (result.ok) {
|
|
537
|
+
return result.value;
|
|
538
|
+
}
|
|
539
|
+
return defaultValue;
|
|
540
|
+
}
|
|
541
|
+
function unwrapOrElse(result, fn) {
|
|
542
|
+
if (result.ok) {
|
|
543
|
+
return result.value;
|
|
544
|
+
}
|
|
545
|
+
return fn(result.error);
|
|
546
|
+
}
|
|
547
|
+
function match(result, handlers) {
|
|
548
|
+
if (result.ok) {
|
|
549
|
+
return handlers.ok(result.value);
|
|
550
|
+
}
|
|
551
|
+
return handlers.err(result.error);
|
|
552
|
+
}
|
|
553
|
+
function all(results) {
|
|
554
|
+
const values = [];
|
|
555
|
+
for (const result of results) {
|
|
556
|
+
if (!result.ok) {
|
|
557
|
+
return result;
|
|
558
|
+
}
|
|
559
|
+
values.push(result.value);
|
|
560
|
+
}
|
|
561
|
+
return Ok(values);
|
|
562
|
+
}
|
|
563
|
+
function classifyEngineError(err) {
|
|
564
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
565
|
+
if (message.startsWith("Parse error:")) {
|
|
566
|
+
return new ParseError(message);
|
|
567
|
+
}
|
|
568
|
+
if (message.startsWith("Invalid state:") || message.startsWith("Invalid state patch:")) {
|
|
569
|
+
return new StateError(message);
|
|
570
|
+
}
|
|
571
|
+
if (message.startsWith("Parent node not found:")) {
|
|
572
|
+
return new RenderError(message);
|
|
573
|
+
}
|
|
574
|
+
return new RenderError(message);
|
|
575
|
+
}
|
|
576
|
+
var HypenError, ActionError, ConnectionError, StateError, ParseError, RenderError;
|
|
577
|
+
var init_result = __esm(() => {
|
|
578
|
+
HypenError = class HypenError extends Error {
|
|
579
|
+
code;
|
|
580
|
+
context;
|
|
581
|
+
cause;
|
|
582
|
+
constructor(code, message, options) {
|
|
583
|
+
super(message);
|
|
584
|
+
this.name = "HypenError";
|
|
585
|
+
this.code = code;
|
|
586
|
+
this.context = options?.context;
|
|
587
|
+
this.cause = options?.cause;
|
|
588
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
ActionError = class ActionError extends HypenError {
|
|
592
|
+
actionName;
|
|
593
|
+
constructor(actionName, cause) {
|
|
594
|
+
super("ACTION_ERROR", `Action handler "${actionName}" failed: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
595
|
+
context: { actionName },
|
|
596
|
+
cause: cause instanceof Error ? cause : undefined
|
|
597
|
+
});
|
|
598
|
+
this.name = "ActionError";
|
|
599
|
+
this.actionName = actionName;
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
ConnectionError = class ConnectionError extends HypenError {
|
|
603
|
+
url;
|
|
604
|
+
attempt;
|
|
605
|
+
constructor(url, cause, attempt) {
|
|
606
|
+
super("CONNECTION_ERROR", `Connection to "${url}" failed${attempt ? ` (attempt ${attempt})` : ""}: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
607
|
+
context: { url, attempt },
|
|
608
|
+
cause: cause instanceof Error ? cause : undefined
|
|
609
|
+
});
|
|
610
|
+
this.name = "ConnectionError";
|
|
611
|
+
this.url = url;
|
|
612
|
+
this.attempt = attempt;
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
StateError = class StateError extends HypenError {
|
|
616
|
+
path;
|
|
617
|
+
constructor(message, path, cause) {
|
|
618
|
+
super("STATE_ERROR", message, {
|
|
619
|
+
context: { path },
|
|
620
|
+
cause: cause instanceof Error ? cause : undefined
|
|
621
|
+
});
|
|
622
|
+
this.name = "StateError";
|
|
623
|
+
this.path = path;
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
ParseError = class ParseError extends HypenError {
|
|
627
|
+
source;
|
|
628
|
+
constructor(message, source, cause) {
|
|
629
|
+
super("PARSE_ERROR", message, {
|
|
630
|
+
context: { source },
|
|
631
|
+
cause: cause instanceof Error ? cause : undefined
|
|
632
|
+
});
|
|
633
|
+
this.name = "ParseError";
|
|
634
|
+
this.source = source;
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
RenderError = class RenderError extends HypenError {
|
|
638
|
+
constructor(message, cause) {
|
|
639
|
+
super("RENDER_ERROR", message, {
|
|
640
|
+
cause: cause instanceof Error ? cause : undefined
|
|
641
|
+
});
|
|
642
|
+
this.name = "RenderError";
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
});
|
|
646
|
+
|
|
647
647
|
// src/app.ts
|
|
648
648
|
var exports_app = {};
|
|
649
649
|
__export(exports_app, {
|
|
@@ -2433,4 +2433,4 @@ export {
|
|
|
2433
2433
|
RemoteEngine
|
|
2434
2434
|
};
|
|
2435
2435
|
|
|
2436
|
-
//# debugId=
|
|
2436
|
+
//# debugId=6490411AAAF0974364756E2164756E21
|