@mermanjs/node-wasm 0.9.2 → 0.10.0-alpha.1

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.d.ts CHANGED
@@ -5,10 +5,11 @@ export type MermanResourceProfile =
5
5
  | "unbounded-for-trusted-input";
6
6
 
7
7
  export interface MermanBindingOptions {
8
- version?: 2;
8
+ version?: 3;
9
9
  runtime_policy?: "deterministic";
10
10
  environment?: {
11
- text_measurement?: "deterministic";
11
+ theme_portability?: "best-effort" | "require-portable";
12
+ text_measurement?: "deterministic" | null;
12
13
  [key: string]: unknown;
13
14
  };
14
15
  resources?: {
@@ -18,8 +19,15 @@ export interface MermanBindingOptions {
18
19
  [key: string]: unknown;
19
20
  }
20
21
 
22
+ /** One host-loaded Iconify pack, admitted once into an immutable engine-local registry. */
23
+ export interface MermanIconPack {
24
+ json: string;
25
+ registrationName?: string;
26
+ }
27
+
21
28
  export interface CreateNodeEngineOptions {
22
29
  bindingOptions?: MermanBindingOptions;
30
+ iconPacks?: readonly MermanIconPack[];
23
31
  concurrency?: number;
24
32
  maxQueue?: number;
25
33
  }
@@ -252,12 +260,21 @@ export interface MermanCancellationErrorDetails {
252
260
  readonly [key: string]: unknown;
253
261
  }
254
262
 
263
+ export interface MermanIconRegistryErrorDetails {
264
+ readonly kind_id: string;
265
+ readonly pack_index: number | null;
266
+ readonly registration_name: string | null;
267
+ }
268
+
255
269
  export declare class MermanOperationError extends MermanError {
256
270
  readonly status: number | null;
257
271
  readonly codeName: string | null;
258
272
  readonly kind: "generic" | "unknown-operation" | "missing-capability" | string;
259
273
  readonly capabilityId: string | null;
274
+ /** Complete core-owned details, including versioned theme_authoring diagnostics. */
275
+ readonly details: Readonly<Record<string, unknown>> | null;
260
276
  readonly resourceDetails: MermanResourceErrorDetails | null;
277
+ readonly iconRegistryDetails: MermanIconRegistryErrorDetails | null;
261
278
  readonly diagnosticDetails: MermanDiagnosticErrorDetails | null;
262
279
  readonly cancellationDetails: MermanCancellationErrorDetails | null;
263
280
  }
package/dist/index.mjs CHANGED
@@ -16,11 +16,11 @@ export { MermanEngine };
16
16
 
17
17
  export function createNodeEngine(options) {
18
18
  return createEngineWithTransport(options, {
19
- loadTransport: (optionsJson) =>
19
+ loadTransport: (optionsJson, iconPacksJson) =>
20
20
  loadNodeWasmTransport(optionsJson, {
21
21
  modulePath: wasmBindingPath,
22
22
  loadModule: () => Promise.resolve(requireFromPackage(wasmBindingPath)),
23
- }),
23
+ }, iconPacksJson),
24
24
  });
25
25
  }
26
26
 
@@ -11,6 +11,8 @@ import {
11
11
  const TARGET_PACKAGES = Object.freeze({
12
12
  "darwin-arm64": "@mermanjs/node-darwin-arm64",
13
13
  "darwin-x64": "@mermanjs/node-darwin-x64",
14
+ "linux-arm64-gnu": "@mermanjs/node-linux-arm64-gnu",
15
+ "linux-arm64-musl": "@mermanjs/node-linux-arm64-musl",
14
16
  "linux-x64-gnu": "@mermanjs/node-linux-x64-gnu",
15
17
  "linux-x64-musl": "@mermanjs/node-linux-x64-musl",
16
18
  "win32-x64-msvc": "@mermanjs/node-win32-x64-msvc",
@@ -59,9 +61,9 @@ export function resolveNodeTarget({
59
61
  return `darwin-${arch}`;
60
62
  }
61
63
  if (platform === "win32" && arch === "x64") return "win32-x64-msvc";
62
- if (platform === "linux" && arch === "x64") {
63
- const libc = linuxLibc(report);
64
- return `linux-x64-${libc}`;
64
+ if (platform === "linux" && (arch === "arm64" || arch === "x64")) {
65
+ const libc = linuxLibc(report, arch);
66
+ return `linux-${arch}-${libc}`;
65
67
  }
66
68
  throw new MermanUnsupportedTargetError({ platform, arch });
67
69
  }
@@ -87,7 +89,7 @@ export function loadNativeBinding({
87
89
  }
88
90
  }
89
91
 
90
- function linuxLibc(report) {
92
+ function linuxLibc(report, arch) {
91
93
  if (report?.header?.glibcVersionRuntime) return "gnu";
92
94
  if (
93
95
  Array.isArray(report?.sharedObjects) &&
@@ -97,7 +99,7 @@ function linuxLibc(report) {
97
99
  }
98
100
  throw new MermanUnsupportedTargetError({
99
101
  platform: "linux",
100
- arch: "x64",
102
+ arch,
101
103
  reason:
102
104
  "Cannot determine Linux libc from process.report; refusing to guess a platform package.",
103
105
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mermanjs/node-wasm",
3
- "version": "0.9.2",
3
+ "version": "0.10.0-alpha.1",
4
4
  "description": "Explicit Node-targeted WebAssembly rendering package for Merman.",
5
5
  "type": "module",
6
6
  "engines": {