@hypen-space/core 0.4.3 → 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/README.md +1 -1
- package/dist/app.d.ts +79 -22
- package/dist/app.js +248 -155
- package/dist/app.js.map +5 -5
- package/dist/components/builtin.js +251 -158
- package/dist/components/builtin.js.map +6 -6
- package/dist/context.js +1 -1
- package/dist/context.js.map +1 -1
- package/dist/discovery.d.ts +1 -1
- package/dist/discovery.js +249 -156
- package/dist/discovery.js.map +6 -6
- package/dist/disposable.js +1 -1
- package/dist/disposable.js.map +1 -1
- package/dist/engine.browser.d.ts +6 -0
- package/dist/engine.browser.js +192 -5
- package/dist/engine.browser.js.map +5 -4
- package/dist/engine.d.ts +6 -0
- package/dist/engine.js +192 -5
- package/dist/engine.js.map +5 -4
- package/dist/events.js +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.js +248 -155
- package/dist/index.browser.js.map +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +254 -158
- package/dist/index.js.map +7 -7
- 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/managed-router.d.ts +3 -4
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/remote/client.js +34 -2
- package/dist/remote/client.js.map +3 -3
- package/dist/remote/index.js +609 -163
- package/dist/remote/index.js.map +8 -7
- package/dist/remote/server.d.ts +46 -15
- package/dist/remote/server.js +609 -163
- package/dist/remote/server.js.map +8 -7
- package/dist/renderer.js +1 -1
- package/dist/renderer.js.map +1 -1
- package/dist/result.d.ts +18 -0
- 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/app.ts +162 -41
- package/src/components/builtin.ts +3 -4
- package/src/discovery.ts +2 -2
- package/src/engine.browser.ts +27 -4
- package/src/engine.ts +27 -4
- package/src/index.browser.ts +0 -2
- package/src/index.ts +3 -2
- package/src/managed-router.ts +5 -6
- package/src/remote/server.ts +116 -21
- package/src/result.ts +48 -0
- 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/module-registry.d.ts +0 -42
- package/src/module-registry.ts +0 -76
|
@@ -24,9 +24,72 @@ function getStringFromWasm0(ptr, len) {
|
|
|
24
24
|
return decodeText(ptr, len);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
let WASM_VECTOR_LEN = 0;
|
|
28
|
+
|
|
29
|
+
const cachedTextEncoder = new TextEncoder();
|
|
30
|
+
|
|
31
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
32
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
33
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
34
|
+
view.set(buf);
|
|
35
|
+
return {
|
|
36
|
+
read: arg.length,
|
|
37
|
+
written: buf.length
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
43
|
+
|
|
44
|
+
if (realloc === undefined) {
|
|
45
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
46
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
47
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
48
|
+
WASM_VECTOR_LEN = buf.length;
|
|
49
|
+
return ptr;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let len = arg.length;
|
|
53
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
54
|
+
|
|
55
|
+
const mem = getUint8ArrayMemory0();
|
|
56
|
+
|
|
57
|
+
let offset = 0;
|
|
58
|
+
|
|
59
|
+
for (; offset < len; offset++) {
|
|
60
|
+
const code = arg.charCodeAt(offset);
|
|
61
|
+
if (code > 0x7F) break;
|
|
62
|
+
mem[ptr + offset] = code;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (offset !== len) {
|
|
66
|
+
if (offset !== 0) {
|
|
67
|
+
arg = arg.slice(offset);
|
|
68
|
+
}
|
|
69
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
70
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
71
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
72
|
+
|
|
73
|
+
offset += ret.written;
|
|
74
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
WASM_VECTOR_LEN = offset;
|
|
78
|
+
return ptr;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let cachedDataViewMemory0 = null;
|
|
82
|
+
|
|
83
|
+
function getDataViewMemory0() {
|
|
84
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
85
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
86
|
+
}
|
|
87
|
+
return cachedDataViewMemory0;
|
|
88
|
+
}
|
|
89
|
+
|
|
27
90
|
function addToExternrefTable0(obj) {
|
|
28
91
|
const idx = wasm.__externref_table_alloc();
|
|
29
|
-
wasm.
|
|
92
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
30
93
|
return idx;
|
|
31
94
|
}
|
|
32
95
|
|
|
@@ -48,15 +111,6 @@ function isLikeNone(x) {
|
|
|
48
111
|
return x === undefined || x === null;
|
|
49
112
|
}
|
|
50
113
|
|
|
51
|
-
let cachedDataViewMemory0 = null;
|
|
52
|
-
|
|
53
|
-
function getDataViewMemory0() {
|
|
54
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
55
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
56
|
-
}
|
|
57
|
-
return cachedDataViewMemory0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
114
|
function debugString(val) {
|
|
61
115
|
// primitive types
|
|
62
116
|
const type = typeof val;
|
|
@@ -122,62 +176,8 @@ function debugString(val) {
|
|
|
122
176
|
return className;
|
|
123
177
|
}
|
|
124
178
|
|
|
125
|
-
let WASM_VECTOR_LEN = 0;
|
|
126
|
-
|
|
127
|
-
const cachedTextEncoder = new TextEncoder();
|
|
128
|
-
|
|
129
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
130
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
131
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
132
|
-
view.set(buf);
|
|
133
|
-
return {
|
|
134
|
-
read: arg.length,
|
|
135
|
-
written: buf.length
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
141
|
-
|
|
142
|
-
if (realloc === undefined) {
|
|
143
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
144
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
145
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
146
|
-
WASM_VECTOR_LEN = buf.length;
|
|
147
|
-
return ptr;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
let len = arg.length;
|
|
151
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
152
|
-
|
|
153
|
-
const mem = getUint8ArrayMemory0();
|
|
154
|
-
|
|
155
|
-
let offset = 0;
|
|
156
|
-
|
|
157
|
-
for (; offset < len; offset++) {
|
|
158
|
-
const code = arg.charCodeAt(offset);
|
|
159
|
-
if (code > 0x7F) break;
|
|
160
|
-
mem[ptr + offset] = code;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (offset !== len) {
|
|
164
|
-
if (offset !== 0) {
|
|
165
|
-
arg = arg.slice(offset);
|
|
166
|
-
}
|
|
167
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
168
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
169
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
170
|
-
|
|
171
|
-
offset += ret.written;
|
|
172
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
WASM_VECTOR_LEN = offset;
|
|
176
|
-
return ptr;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
179
|
function takeFromExternrefTable0(idx) {
|
|
180
|
-
const value = wasm.
|
|
180
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
181
181
|
wasm.__externref_table_dealloc(idx);
|
|
182
182
|
return value;
|
|
183
183
|
}
|
|
@@ -468,6 +468,14 @@ exports.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
|
|
|
468
468
|
return ret;
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
+
exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
472
|
+
const ret = String(arg1);
|
|
473
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
const len1 = WASM_VECTOR_LEN;
|
|
475
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
476
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
477
|
+
};
|
|
478
|
+
|
|
471
479
|
exports.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
|
|
472
480
|
const ret = arg0.call(arg1);
|
|
473
481
|
return ret;
|
|
@@ -733,7 +741,7 @@ exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
|
733
741
|
};
|
|
734
742
|
|
|
735
743
|
exports.__wbindgen_init_externref_table = function() {
|
|
736
|
-
const table = wasm.
|
|
744
|
+
const table = wasm.__wbindgen_export_4;
|
|
737
745
|
const offset = table.grow(4);
|
|
738
746
|
table.set(0, undefined);
|
|
739
747
|
table.set(offset + 0, undefined);
|
|
Binary file
|
|
@@ -20,11 +20,11 @@ export const patchesToJson: (a: any) => [number, number, number, number];
|
|
|
20
20
|
export const parseToJson: (a: number, b: number) => [number, number, number, number];
|
|
21
21
|
export const main: () => void;
|
|
22
22
|
export const wasmengine_renderSource: (a: number, b: number, c: number) => [number, number];
|
|
23
|
-
export const __wbindgen_exn_store: (a: number) => void;
|
|
24
|
-
export const __externref_table_alloc: () => number;
|
|
25
|
-
export const __wbindgen_export_2: WebAssembly.Table;
|
|
26
23
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
27
24
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
25
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
26
|
+
export const __externref_table_alloc: () => number;
|
|
27
|
+
export const __wbindgen_export_4: WebAssembly.Table;
|
|
28
28
|
export const __externref_table_dealloc: (a: number) => void;
|
|
29
29
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
30
30
|
export const __wbindgen_start: () => void;
|
package/wasm-node/package.json
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module Registry — maps component names to module definitions.
|
|
3
|
-
*
|
|
4
|
-
* Used by the import resolution pipeline and ManagedRouter to look up
|
|
5
|
-
* module definitions by their component name (e.g., "HomePage", "ProfilePage").
|
|
6
|
-
*/
|
|
7
|
-
import type { HypenModuleDefinition } from "./app.js";
|
|
8
|
-
export declare class ModuleRegistry {
|
|
9
|
-
private definitions;
|
|
10
|
-
/**
|
|
11
|
-
* Register a module definition under a component name.
|
|
12
|
-
*/
|
|
13
|
-
register(name: string, definition: HypenModuleDefinition): void;
|
|
14
|
-
/**
|
|
15
|
-
* Get a module definition by component name.
|
|
16
|
-
*/
|
|
17
|
-
get(name: string): HypenModuleDefinition | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Check if a module definition exists.
|
|
20
|
-
*/
|
|
21
|
-
has(name: string): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get all registered definitions.
|
|
24
|
-
*/
|
|
25
|
-
getAll(): Map<string, HypenModuleDefinition>;
|
|
26
|
-
/**
|
|
27
|
-
* Get all registered component names.
|
|
28
|
-
*/
|
|
29
|
-
getNames(): string[];
|
|
30
|
-
/**
|
|
31
|
-
* Unregister a module definition.
|
|
32
|
-
*/
|
|
33
|
-
unregister(name: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Number of registered definitions.
|
|
36
|
-
*/
|
|
37
|
-
get size(): number;
|
|
38
|
-
/**
|
|
39
|
-
* Clear all registered definitions.
|
|
40
|
-
*/
|
|
41
|
-
clear(): void;
|
|
42
|
-
}
|
package/src/module-registry.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module Registry — maps component names to module definitions.
|
|
3
|
-
*
|
|
4
|
-
* Used by the import resolution pipeline and ManagedRouter to look up
|
|
5
|
-
* module definitions by their component name (e.g., "HomePage", "ProfilePage").
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { HypenModuleDefinition } from "./app.js";
|
|
9
|
-
import { createLogger } from "./logger.js";
|
|
10
|
-
|
|
11
|
-
const log = createLogger("ModuleRegistry");
|
|
12
|
-
|
|
13
|
-
export class ModuleRegistry {
|
|
14
|
-
private definitions = new Map<string, HypenModuleDefinition>();
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Register a module definition under a component name.
|
|
18
|
-
*/
|
|
19
|
-
register(name: string, definition: HypenModuleDefinition): void {
|
|
20
|
-
if (this.definitions.has(name)) {
|
|
21
|
-
log.warn(`Module "${name}" is already registered. Overwriting.`);
|
|
22
|
-
}
|
|
23
|
-
this.definitions.set(name, definition);
|
|
24
|
-
log.debug(`Registered module definition: ${name}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get a module definition by component name.
|
|
29
|
-
*/
|
|
30
|
-
get(name: string): HypenModuleDefinition | undefined {
|
|
31
|
-
return this.definitions.get(name);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Check if a module definition exists.
|
|
36
|
-
*/
|
|
37
|
-
has(name: string): boolean {
|
|
38
|
-
return this.definitions.has(name);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Get all registered definitions.
|
|
43
|
-
*/
|
|
44
|
-
getAll(): Map<string, HypenModuleDefinition> {
|
|
45
|
-
return new Map(this.definitions);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Get all registered component names.
|
|
50
|
-
*/
|
|
51
|
-
getNames(): string[] {
|
|
52
|
-
return Array.from(this.definitions.keys());
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Unregister a module definition.
|
|
57
|
-
*/
|
|
58
|
-
unregister(name: string): void {
|
|
59
|
-
this.definitions.delete(name);
|
|
60
|
-
log.debug(`Unregistered module definition: ${name}`);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Number of registered definitions.
|
|
65
|
-
*/
|
|
66
|
-
get size(): number {
|
|
67
|
-
return this.definitions.size;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Clear all registered definitions.
|
|
72
|
-
*/
|
|
73
|
-
clear(): void {
|
|
74
|
-
this.definitions.clear();
|
|
75
|
-
}
|
|
76
|
-
}
|