mhx 2026.1.15 → 2026.1.17

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
@@ -9616,6 +9616,3 @@ function f4ah6o$mhx$core$$Mhx$init_mhx(self) {
9616
9616
  function f4ah6o$mhx$core$$init_mhx() {
9617
9617
  f4ah6o$mhx$core$$Mhx$init_mhx(f4ah6o$mhx$core$$global_mhx);
9618
9618
  }
9619
- (() => {
9620
- moonbitlang$async$$run_async_main((_cont, _err_cont) => new Result$Ok$16$(f4ah6o$mhx$core$$init_mhx()));
9621
- })();
package/dist/index.mjs CHANGED
@@ -9618,9 +9618,6 @@ function f4ah6o$mhx$core$$Mhx$init_mhx(self) {
9618
9618
  function f4ah6o$mhx$core$$init_mhx() {
9619
9619
  f4ah6o$mhx$core$$Mhx$init_mhx(f4ah6o$mhx$core$$global_mhx);
9620
9620
  }
9621
- (() => {
9622
- moonbitlang$async$$run_async_main((_cont, _err_cont) => new Result$Ok$16$(f4ah6o$mhx$core$$init_mhx()));
9623
- })();
9624
9621
 
9625
9622
 
9626
9623
  const process = (root) =>
@@ -9636,7 +9633,7 @@ const get_instance = () => f4ah6o$mhx$core$$global_mhx;
9636
9633
 
9637
9634
  export const init_mhx = f4ah6o$mhx$core$$init_mhx;
9638
9635
  export { process, handle_event, get_instance };
9639
- export const version = f4ah6o$mhx$$version;
9636
+ export const version = "2026.1.17";
9640
9637
  export const on_fetch_success = f4ah6o$mhx$network$$on_fetch_success;
9641
9638
  export const on_fetch_error = f4ah6o$mhx$network$$on_fetch_error;
9642
9639
  export const on_mutation_observed = f4ah6o$mhx$core$$on_mutation_observed;
package/npm/postbuild.mjs CHANGED
@@ -1,4 +1,9 @@
1
- import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
1
+ import {
2
+ copyFileSync,
3
+ mkdirSync,
4
+ readFileSync,
5
+ writeFileSync,
6
+ } from "node:fs";
2
7
  import { join } from "node:path";
3
8
 
4
9
  const root = process.cwd();
@@ -9,7 +14,13 @@ const buildFfi = join(root, "src/ffi/mhx_ffi.js");
9
14
  mkdirSync(distDir, { recursive: true });
10
15
 
11
16
  const rawMainJs = readFileSync(buildMain, "utf8");
12
- let esmMainJs = rawMainJs;
17
+ const packageJson = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
18
+ const packageVersion = String(packageJson.version ?? "0.0.0");
19
+
20
+ const autorunRe =
21
+ /\(\(\)\s*=>\s*\{\s*moonbitlang\$async\$\$run_async_main\([\s\S]*?\);\s*\}\)\(\);\s*/;
22
+ const rawMainJsNoAutorun = rawMainJs.replace(autorunRe, "");
23
+ let esmMainJs = rawMainJsNoAutorun;
13
24
  const ffiHeader =
14
25
  'import mhxFfi from "./mhx_ffi.js";\nconst mhx_ffi = mhxFfi;\n';
15
26
  const stableExports = `
@@ -29,7 +40,7 @@ if (!esmMainJs.startsWith('import mhxFfi from "./mhx_ffi.js";')) {
29
40
  const exportsBlock = `
30
41
  export const init_mhx = f4ah6o$mhx$core$$init_mhx;
31
42
  export { process, handle_event, get_instance };
32
- export const version = f4ah6o$mhx$$version;
43
+ export const version = ${JSON.stringify(packageVersion)};
33
44
  export const on_fetch_success = f4ah6o$mhx$network$$on_fetch_success;
34
45
  export const on_fetch_error = f4ah6o$mhx$network$$on_fetch_error;
35
46
  export const on_mutation_observed = f4ah6o$mhx$core$$on_mutation_observed;
@@ -41,6 +52,6 @@ if (!hasStableExports) {
41
52
  if (!esmMainJs.includes("export const init_mhx")) {
42
53
  esmMainJs += `\n${exportsBlock}`;
43
54
  }
44
- writeFileSync(join(distDir, "index.js"), rawMainJs);
55
+ writeFileSync(join(distDir, "index.js"), rawMainJsNoAutorun);
45
56
  writeFileSync(join(distDir, "index.mjs"), esmMainJs);
46
57
  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.15",
3
+ "version": "2026.1.17",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./npm/index.js",