@adapt-toolkit/sdk 0.1.1 → 0.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"mufl-bindings.d.ts","sourceRoot":"","sources":["../../src/wasm/mufl-bindings.js"],"names":[],"mappings":";AAKA,8EAOC"}
1
+ {"version":3,"file":"mufl-bindings.d.ts","sourceRoot":"","sources":["../../src/wasm/mufl-bindings.js"],"names":[],"mappings":";AA0CA,8EAOC"}
@@ -1,3 +1,39 @@
1
+ // Node-ESM compatibility shim. Prepended to mufl-bindings.js by the wasm
2
+ // build scripts so the Emscripten output below (compiled with multi-environment
3
+ // support including `node`) can run under Node's ESM loader, where `require`,
4
+ // `__filename`, and `__dirname` are not globals. The Emscripten Node branch
5
+ // does `if (!(typeof process === "object" && typeof require === "function"))
6
+ // throw new Error("not compiled for this environment ...")`; this shim
7
+ // polyfills those identifiers on globalThis from `import.meta.url` so the
8
+ // check succeeds and the rest of the Node branch (loading `fs`/`path`,
9
+ // locating `mufl-bindings.wasm` from `__dirname`) works.
10
+ //
11
+ // In the browser there is no `process`, so the shim is a no-op and the
12
+ // browser branch of the Emscripten output runs unchanged. The variable names
13
+ // for the dynamic `import()` specifiers are held in locals so browser bundlers
14
+ // don't try to statically resolve `node:*` modules.
15
+ try {
16
+ if (typeof process === 'object' &&
17
+ process !== null &&
18
+ process.versions &&
19
+ typeof process.versions.node === 'string' &&
20
+ typeof globalThis.require !== 'function') {
21
+ const __mod_id = 'node:module';
22
+ const __url_id = 'node:url';
23
+ const __path_id = 'node:path';
24
+ const [__m, __u, __p] = await Promise.all([
25
+ import(__mod_id),
26
+ import(__url_id),
27
+ import(__path_id),
28
+ ]);
29
+ globalThis.require = __m.createRequire(import.meta.url);
30
+ globalThis.__filename = __u.fileURLToPath(import.meta.url);
31
+ globalThis.__dirname = __p.dirname(globalThis.__filename);
32
+ }
33
+ }
34
+ catch {
35
+ // Best-effort shim; ignore failures (e.g. when bundled for the browser).
36
+ }
1
37
  var createEMSCModule = (() => {
2
38
  var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
3
39
  if (typeof __filename !== 'undefined')