@crossbind/port-expat 2.0.0-beta.62 → 2.0.0-beta.64

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/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
  **Precompiled Expat XML parser library built with crossbind for seamless integration in JavaScript, WebAssembly and React Native projects.**
3
3
 
4
4
  <a href="https://www.npmjs.com/package/@crossbind/port-expat">
5
- <img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/port-expat?style=for-the-badge" />
5
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/port-expat/beta?style=for-the-badge" />
6
6
  </a>
7
7
  <a href="https://github.com/libexpat/libexpat">
8
- <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Funpkg.com%2F%40crossbind%2Fport-expat%2Fpackage.json&query=%24.nativeVersion&style=for-the-badge&label=Expat" />
8
+ <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2F%40crossbind%2Fport-expat%2Fbeta&query=%24.nativeVersion&style=for-the-badge&label=Expat" />
9
9
  </a>
10
10
  <a href="https://github.com/libexpat/libexpat/blob/master/COPYING">
11
- <img alt="License" src="https://img.shields.io/npm/l/%40crossbind%2Fport-expat?style=for-the-badge" />
11
+ <img alt="License" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2F%40crossbind%2Fport-expat%2Fbeta&query=%24.license&style=for-the-badge&label=license" />
12
12
  </a>
13
13
 
14
14
  > Use it together with **[crossbind](https://crossbind.dev)** — the toolchain for using C++ libraries from JavaScript, TypeScript, WebAssembly, Node.js and React Native. Learn more at **[crossbind.dev](https://crossbind.dev)**.
@@ -26,7 +26,7 @@ Their C++ wrappers, and the self-check the site build runs against results compu
26
26
  Install the main package together with the platform builds:
27
27
 
28
28
  ```sh
29
- npm install @crossbind/port-expat @crossbind/port-expat-wasm @crossbind/port-expat-android @crossbind/port-expat-ios
29
+ npm install @crossbind/port-expat@beta @crossbind/port-expat-wasm@beta @crossbind/port-expat-android@beta @crossbind/port-expat-ios@beta
30
30
  ```
31
31
 
32
32
  Then import all three platforms in `crossbind.config.js` — crossbind compiles only the one matching each build target:
@@ -48,7 +48,7 @@ export default {
48
48
  };
49
49
  ```
50
50
 
51
- A native Node.js addon links the build of its platform: `crossbind build -p darwin`, `-p linux` or `-p win32` takes `@crossbind/port-expat-darwin`, `-linux` or `-win32`. Install it and import its `crossbind.config.js` the same way.
51
+ A native Node.js addon (`crossbind build -e node`) links the build of its platform: `-p darwin`, `-p linux`, `-p linuxmusl` or `-p win32` takes `@crossbind/port-expat-darwin`, `-linux`, `-linuxmusl` or `-win32`; `-linuxmusl` is the one for Alpine and other musl distributions. Install it and import its `crossbind.config.js` the same way.
52
52
 
53
53
  ## Usage
54
54
  crossbind binds your C++ headers to JavaScript, so the usual pattern is a small wrapper around the library. This one turns XML into plain objects with Expat's element and character data handlers, and reports errors with their line and column. Put it in your project's native folder (`src/native/` by default):
@@ -180,13 +180,13 @@ try {
180
180
  - For large documents, pass a path instead of a string and let Expat read the file in pieces: the streaming example below does that.
181
181
 
182
182
  ### More examples
183
- Each one runs in your browser on [crossbind.dev/ports/expat](https://crossbind.dev/ports/expat/#usage), next to the code shown there:
183
+ Each one runs in your browser on [crossbind.dev/ports/expat](https://crossbind.dev/ports/expat/#examples), next to the code shown there:
184
184
 
185
185
  - [Stream a file through Expat](https://crossbind.dev/ports/expat/#02-stream): `XML_GetBuffer` and `XML_ParseBuffer`, 64 KiB at a time.
186
186
  - [Read namespaced XML whatever the prefixes](https://crossbind.dev/ports/expat/#03-namespaces): `XML_ParserCreateNS` and `XML_SetStartNamespaceDeclHandler`.
187
187
  - [Expand entities without a billion laughs](https://crossbind.dev/ports/expat/#04-limits): `XML_SetBillionLaughsAttackProtectionMaximumAmplification` and `XML_SetBillionLaughsAttackProtectionActivationThreshold`.
188
188
 
189
- Setup and differences per platform: [WebAssembly](https://crossbind.dev/ports/expat/wasm/) · [Android](https://crossbind.dev/ports/expat/android/) · [iOS](https://crossbind.dev/ports/expat/ios/) · [macOS](https://crossbind.dev/ports/expat/darwin/) · [Linux](https://crossbind.dev/ports/expat/linux/) · [Windows](https://crossbind.dev/ports/expat/win32/) · [WASI](https://crossbind.dev/ports/expat/wasi/), which also has a command-line program built with `crossbind build -p wasi`.
189
+ Setup for every platform: [crossbind.dev/ports/expat](https://crossbind.dev/ports/expat/#install). The same page has [a command-line program](https://crossbind.dev/ports/expat/#wasi-program) built with `crossbind build -p wasi -e wasi`.
190
190
 
191
191
  ## What this build includes
192
192
  - Expat 2.8.5 as a static library, built with upstream's CMake defaults: DTD and general entity support (`XML_DTD`, `XML_GE`), namespaces (`XML_NS`) and 1,024 bytes of context (`XML_CONTEXT_BYTES`). The API speaks UTF-8.
@@ -206,9 +206,11 @@ This is the main package; the precompiled binaries are shipped per platform:
206
206
  | iOS | [`@crossbind/port-expat-ios`](https://www.npmjs.com/package/@crossbind/port-expat-ios) | device (`arm64`), simulator (`arm64`) |
207
207
  | macOS | [`@crossbind/port-expat-darwin`](https://www.npmjs.com/package/@crossbind/port-expat-darwin) | `arm64` (Apple silicon), `x64` (Intel) — native Node.js addons |
208
208
  | Linux | [`@crossbind/port-expat-linux`](https://www.npmjs.com/package/@crossbind/port-expat-linux) | `x64`, `arm64` — glibc 2.28 or later, native Node.js addons |
209
+ | Linux (musl) | [`@crossbind/port-expat-linuxmusl`](https://www.npmjs.com/package/@crossbind/port-expat-linuxmusl) | `x64`, `arm64` — musl 1.2.5 or later (Alpine 3.21 and later), native Node.js addons |
209
210
  | Windows | [`@crossbind/port-expat-win32`](https://www.npmjs.com/package/@crossbind/port-expat-win32) | `x64`, `arm64` — Windows 10 or later, native Node.js addons |
210
211
  | WASI library | [`@crossbind/port-expat-wasi`](https://www.npmjs.com/package/@crossbind/port-expat-wasi) | `wasm32-wasip3` — single-threaded |
211
- | WASI command | [`@crossbind/port-expat-bin-wasi`](https://www.npmjs.com/package/@crossbind/port-expat-bin-wasi) | the upstream `xmlwf` well-formedness checker as an `xmlwf-wasi` command (wasmtime 47+) |
212
+ | WASI command | [`@crossbind/port-expat-standalone-wasi`](https://www.npmjs.com/package/@crossbind/port-expat-standalone-wasi) | the upstream `xmlwf` well-formedness checker as an `xmlwf-wasi` command (wasmtime 47+) |
213
+ | Node.js, ready-made | [`@crossbind/port-expat-standalone-napi`](https://www.npmjs.com/package/@crossbind/port-expat-standalone-napi) | prebuilt addons for macOS, Linux (glibc and musl) and Windows, `arm64` and `x64`: nothing to build |
212
214
 
213
215
  ## License
214
216
  This project includes the precompiled Expat library, which is distributed under the [MIT License](https://github.com/libexpat/libexpat/blob/master/COPYING).
package/build.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
- sha256: '920dde485e15eda0cce8d2310b41d492c534e5e3d89ad407a0b4176dd2ff88fe', // expat-2.8.5.tar.gz
2
+ sha256: '16afbb9cefead2aa278105cf27d9f597bde7fbf3dbb85015857ca7ca6a4e89ba', // expat-2.9.0.tar.gz
3
3
  getURL: (version) => `https://github.com/libexpat/libexpat/releases/download/R_${version.replaceAll('.', '_')}/expat-${version}.tar.gz`,
4
4
  buildType: 'cmake',
5
5
  getBuildParams: () => [
package/mergeConfig.mjs CHANGED
@@ -6,7 +6,7 @@ export default (newConfig = {}) => ({
6
6
  },
7
7
  export: {
8
8
  type: 'cmake',
9
- bundle: false,
9
+ publicHeaders: ['expat.h'],
10
10
  // expat.h declares its limit setters (XML_SetBillionLaughsAttackProtection*,
11
11
  // XML_SetAllocTracker*) only when XML_DTD or XML_GE is set, which expat_config.h does.
12
12
  headerPrelude: ['expat_config.h'],
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@crossbind/port-expat",
3
- "version": "2.0.0-beta.62",
4
- "nativeVersion": "2.8.5",
3
+ "version": "2.0.0-beta.64",
4
+ "nativeVersion": "2.9.0",
5
5
  "description": "This package provides the precompiled Expat XML parser library, built using crossbind, for seamless integration into JavaScript, WebAssembly, and React Native projects. It enables fast and efficient parsing of XML data, making it ideal for applications requiring robust XML handling across platforms. Perfect for web, server-side, and mobile development environments.",
6
- "homepage": "https://github.com/crossbind/crossbind/tree/main/ports/expat#readme",
6
+ "homepage": "https://crossbind.dev/ports/expat/",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/crossbind/crossbind.git"