mhx 2026.1.8 → 2026.1.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/npm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as mhx from "../dist/index.js";
1
+ import * as mhx from "../dist/index.mjs";
2
2
 
3
3
  export const init_mhx = mhx.init_mhx;
4
4
  export const process = mhx.process;
package/npm/postbuild.mjs CHANGED
@@ -8,12 +8,14 @@ const buildFfi = join(root, "src/ffi/mhx_ffi.js");
8
8
 
9
9
  mkdirSync(distDir, { recursive: true });
10
10
 
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;
11
+ const rawMainJs = readFileSync(buildMain, "utf8");
12
+ let esmMainJs = rawMainJs;
13
+ const ffiHeader =
14
+ 'import mhxFfi from "./mhx_ffi.js";\nconst mhx_ffi = mhxFfi;\n';
15
+ if (!esmMainJs.startsWith('import mhxFfi from "./mhx_ffi.js";')) {
16
+ esmMainJs = ffiHeader + esmMainJs;
15
17
  }
16
- mainJs = mainJs.replace(
18
+ esmMainJs = esmMainJs.replace(
17
19
  /\(\(\)\s*=>\s*\{[\s\S]*?moonbitlang\$async\$\$run_async_main[\s\S]*?\}\)\(\);/g,
18
20
  "",
19
21
  );
@@ -27,8 +29,9 @@ export const on_fetch_success = f4ah6o$mhx$network$$on_fetch_success;
27
29
  export const on_fetch_error = f4ah6o$mhx$network$$on_fetch_error;
28
30
  export const on_mutation_observed = f4ah6o$mhx$core$$on_mutation_observed;
29
31
  `;
30
- if (!mainJs.includes("export const init_mhx")) {
31
- mainJs += `\n${exportsBlock}`;
32
+ if (!esmMainJs.includes("export const init_mhx")) {
33
+ esmMainJs += `\n${exportsBlock}`;
32
34
  }
33
- writeFileSync(join(distDir, "index.js"), mainJs);
35
+ writeFileSync(join(distDir, "index.js"), rawMainJs);
36
+ writeFileSync(join(distDir, "index.mjs"), esmMainJs);
34
37
  copyFileSync(buildFfi, join(distDir, "mhx_ffi.js"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mhx",
3
- "version": "2026.1.8",
3
+ "version": "2026.1.11",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./npm/index.js",