partforge 0.26.0 → 0.26.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/package.json
CHANGED
|
@@ -12,7 +12,16 @@
|
|
|
12
12
|
// capability (Manifold can't do toSTEP; both backends now define shape2d, so
|
|
13
13
|
// that stub is dead in practice — kept as a safety net for a future backend).
|
|
14
14
|
// The per-Solid twin of this layer is addSugar() in solid-sugar.js.
|
|
15
|
-
|
|
15
|
+
// opentype.js 2.x ships no `exports` map: bundlers take its `module` field (real
|
|
16
|
+
// ESM, named `parse`), while Node ESM takes `main` (a UMD/CJS bundle, whose named
|
|
17
|
+
// exports Node cannot statically detect — the namespace holds only `default`).
|
|
18
|
+
// So `import * as opentype` gives a working `.parse` in the browser and `undefined`
|
|
19
|
+
// under Node, which broke every headless text2d build (`opentype.parse is not a
|
|
20
|
+
// function`) while the browser stayed green. Normalize both interop shapes here.
|
|
21
|
+
import * as opentypeNamespace from "opentype.js";
|
|
22
|
+
const opentype = typeof opentypeNamespace.parse === "function"
|
|
23
|
+
? opentypeNamespace
|
|
24
|
+
: (opentypeNamespace.default ?? opentypeNamespace);
|
|
16
25
|
import { KernelCapabilityError } from "./errors.js";
|
|
17
26
|
import { isPlainOptions, KERNEL_OP_SPECS } from "./op-options.js";
|
|
18
27
|
import { textGlyphs } from "./text2d.js";
|