mhx 2026.1.7 → 2026.1.10

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/npm/index.js CHANGED
@@ -1,15 +1,5 @@
1
- import * as mhxFfi from "../dist/mhx_ffi.js";
2
1
  import * as mhx from "../dist/index.js";
3
2
 
4
- globalThis.mhx_ffi = mhxFfi;
5
- if (mhxFfi.initMhxFfi) {
6
- mhxFfi.initMhxFfi({
7
- on_fetch_success: mhx.on_fetch_success,
8
- on_fetch_error: mhx.on_fetch_error,
9
- on_mutation_observed: mhx.on_mutation_observed,
10
- });
11
- }
12
-
13
3
  export const init_mhx = mhx.init_mhx;
14
4
  export const process = mhx.process;
15
5
  export const handle_event = mhx.handle_event;
package/npm/postbuild.mjs CHANGED
@@ -9,6 +9,10 @@ const buildFfi = join(root, "src/ffi/mhx_ffi.js");
9
9
  mkdirSync(distDir, { recursive: true });
10
10
 
11
11
  let mainJs = readFileSync(buildMain, "utf8");
12
+ const ffiHeader = 'import mhxFfi from "./mhx_ffi.js";\nconst mhx_ffi = mhxFfi;\n';
13
+ if (!mainJs.startsWith('import mhxFfi from "./mhx_ffi.js";')) {
14
+ mainJs = ffiHeader + mainJs;
15
+ }
12
16
  mainJs = mainJs.replace(
13
17
  /\(\(\)\s*=>\s*\{[\s\S]*?moonbitlang\$async\$\$run_async_main[\s\S]*?\}\)\(\);/g,
14
18
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mhx",
3
- "version": "2026.1.7",
3
+ "version": "2026.1.10",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./npm/index.js",