stem-mqtt 0.8.0 → 0.8.3
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 +4 -6
- package/broker/mqtt_broker-ffi.js +5 -4
- package/client/mqtt_client-ffi.js +10 -9
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -24,14 +24,12 @@ hand-written napi-rs addon `stem-mqtt-client`, which had no broker.
|
|
|
24
24
|
- Node.js 16+ (ESM — use `"type": "module"` or `.mjs`). **Server-side only**; there is no browser build
|
|
25
25
|
(browsers can talk to the broker's WebSocket port with any MQTT.js client instead).
|
|
26
26
|
- The native libraries come in one package per platform, installed automatically: `stem-mqtt` lists
|
|
27
|
-
`stem-mqtt-linux-x64-gnu`, `stem-mqtt-linux-arm64-gnu`, `stem-mqtt-darwin-x64
|
|
28
|
-
|
|
27
|
+
`stem-mqtt-linux-x64-gnu`, `stem-mqtt-linux-arm64-gnu`, `stem-mqtt-darwin-x64`, `stem-mqtt-darwin-arm64`
|
|
28
|
+
and `@greenspand/stem-mqtt-win32-x64-msvc` (scoped: npmjs.org's spam detection rejects the unscoped
|
|
29
|
+
Windows name) as optional dependencies, each restricted to its `os` / `cpu` (and glibc), so
|
|
29
30
|
npm installs only the one your machine needs. On any other platform `npm install` fails up front
|
|
30
31
|
(`EBADPLATFORM`). With `--omit=optional` (or a lockfile made on another OS) the platform package is
|
|
31
32
|
missing: install it explicitly, e.g. `npm install stem-mqtt-linux-x64-gnu`.
|
|
32
|
-
- **Windows is not on npmjs.org yet**: npm's spam detection rejects the Windows package's name. Until
|
|
33
|
-
that is cleared, use the `x86_64-pc-windows-msvc` libraries from the GitHub release (see
|
|
34
|
-
`EBADPLATFORM` under Troubleshooting) or the package from GitHub Packages.
|
|
35
33
|
- No compiler is needed at install time: `koffi` ships prebuilt binaries.
|
|
36
34
|
|
|
37
35
|
## Quick start
|
|
@@ -178,7 +176,7 @@ The end-to-end test is [`tests/bindings/node/smoke.mjs`](https://github.com/sori
|
|
|
178
176
|
`libmqtt_client.*` / `libmqtt_broker.*` into `client/prebuilds/<platform>-<arch>/` and
|
|
179
177
|
`broker/prebuilds/<platform>-<arch>/` of the installed package.
|
|
180
178
|
- **`Failed to load shared library`** — the platform package was not installed (optional dependencies
|
|
181
|
-
omitted); `npm install stem-mqtt-<platform>-<arch>[-gnu]` of the same version.
|
|
179
|
+
omitted); `npm install stem-mqtt-<platform>-<arch>[-gnu]` (on Windows `@greenspand/stem-mqtt-win32-x64-msvc`) of the same version.
|
|
182
180
|
- **`Duplicate type name 'RustBuffer'`** — you are using separately generated components; the published
|
|
183
181
|
package shares one `runtime/` between client and broker precisely to avoid this.
|
|
184
182
|
- **`SyntaxError: Cannot use import statement`** — the file isn't ESM; use `.mjs` or `"type": "module"`.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createRequire as uniffiCreateRequire } from "node:module";
|
|
2
2
|
|
|
3
|
-
// stem-mqtt: the native library ships in a per-platform package (an optional dependency)
|
|
4
|
-
|
|
3
|
+
// stem-mqtt: the native library ships in a per-platform package (an optional dependency).
|
|
4
|
+
const uniffiPlatformPackages = {"darwin-arm64":"stem-mqtt-darwin-arm64","darwin-x64":"stem-mqtt-darwin-x64","linux-arm64-gnu":"stem-mqtt-linux-arm64-gnu","linux-x64-gnu":"stem-mqtt-linux-x64-gnu","win32-x64":"@greenspand/stem-mqtt-win32-x64-msvc"};
|
|
5
5
|
function uniffiPlatformLibrary(target, filename) {
|
|
6
|
-
const name = target
|
|
6
|
+
const name = uniffiPlatformPackages[target];
|
|
7
|
+
if (name === undefined) return null;
|
|
7
8
|
try {
|
|
8
|
-
const manifest = uniffiCreateRequire(import.meta.url).resolve(
|
|
9
|
+
const manifest = uniffiCreateRequire(import.meta.url).resolve(`${name}/package.json`);
|
|
9
10
|
return join(dirname(manifest), "broker", filename);
|
|
10
11
|
} catch {
|
|
11
12
|
return null;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createRequire as uniffiCreateRequire } from "node:module";
|
|
2
2
|
|
|
3
|
-
// stem-mqtt: the native library ships in a per-platform package (an optional dependency)
|
|
4
|
-
|
|
3
|
+
// stem-mqtt: the native library ships in a per-platform package (an optional dependency).
|
|
4
|
+
const uniffiPlatformPackages = {"darwin-arm64":"stem-mqtt-darwin-arm64","darwin-x64":"stem-mqtt-darwin-x64","linux-arm64-gnu":"stem-mqtt-linux-arm64-gnu","linux-x64-gnu":"stem-mqtt-linux-x64-gnu","win32-x64":"@greenspand/stem-mqtt-win32-x64-msvc"};
|
|
5
5
|
function uniffiPlatformLibrary(target, filename) {
|
|
6
|
-
const name = target
|
|
6
|
+
const name = uniffiPlatformPackages[target];
|
|
7
|
+
if (name === undefined) return null;
|
|
7
8
|
try {
|
|
8
|
-
const manifest = uniffiCreateRequire(import.meta.url).resolve(
|
|
9
|
+
const manifest = uniffiCreateRequire(import.meta.url).resolve(`${name}/package.json`);
|
|
9
10
|
return join(dirname(manifest), "client", filename);
|
|
10
11
|
} catch {
|
|
11
12
|
return null;
|
|
@@ -50,9 +51,9 @@ export const ffiIntegrity = Object.freeze({
|
|
|
50
51
|
expectedContractVersion: 30,
|
|
51
52
|
checksums: Object.freeze({
|
|
52
53
|
|
|
53
|
-
"uniffi_mqtt_client_checksum_method_mqttclient_connect":
|
|
54
|
+
"uniffi_mqtt_client_checksum_method_mqttclient_connect": 57287,
|
|
54
55
|
|
|
55
|
-
"uniffi_mqtt_client_checksum_method_mqttclient_disconnect":
|
|
56
|
+
"uniffi_mqtt_client_checksum_method_mqttclient_disconnect": 25891,
|
|
56
57
|
|
|
57
58
|
"uniffi_mqtt_client_checksum_method_mqttclient_enable_message_queue": 30293,
|
|
58
59
|
|
|
@@ -62,15 +63,15 @@ export const ffiIntegrity = Object.freeze({
|
|
|
62
63
|
|
|
63
64
|
"uniffi_mqtt_client_checksum_method_mqttclient_next_message": 55769,
|
|
64
65
|
|
|
65
|
-
"uniffi_mqtt_client_checksum_method_mqttclient_publish":
|
|
66
|
+
"uniffi_mqtt_client_checksum_method_mqttclient_publish": 22052,
|
|
66
67
|
|
|
67
68
|
"uniffi_mqtt_client_checksum_method_mqttclient_set_auth_handler": 59903,
|
|
68
69
|
|
|
69
70
|
"uniffi_mqtt_client_checksum_method_mqttclient_set_message_listener": 56130,
|
|
70
71
|
|
|
71
|
-
"uniffi_mqtt_client_checksum_method_mqttclient_subscribe":
|
|
72
|
+
"uniffi_mqtt_client_checksum_method_mqttclient_subscribe": 17479,
|
|
72
73
|
|
|
73
|
-
"uniffi_mqtt_client_checksum_method_mqttclient_unsubscribe":
|
|
74
|
+
"uniffi_mqtt_client_checksum_method_mqttclient_unsubscribe": 3320,
|
|
74
75
|
|
|
75
76
|
"uniffi_mqtt_client_checksum_method_mqttauthhandler_respond": 51113,
|
|
76
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stem-mqtt",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "MQTT 3.1.1 / 5.0 client and broker (Rust core, UniFFI Node bindings)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -44,14 +44,16 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
47
|
-
"stem-mqtt-darwin-arm64": "0.8.
|
|
48
|
-
"stem-mqtt-darwin-x64": "0.8.
|
|
49
|
-
"stem-mqtt-linux-arm64-gnu": "0.8.
|
|
50
|
-
"stem-mqtt-linux-x64-gnu": "0.8.
|
|
47
|
+
"stem-mqtt-darwin-arm64": "0.8.3",
|
|
48
|
+
"stem-mqtt-darwin-x64": "0.8.3",
|
|
49
|
+
"stem-mqtt-linux-arm64-gnu": "0.8.3",
|
|
50
|
+
"stem-mqtt-linux-x64-gnu": "0.8.3",
|
|
51
|
+
"@greenspand/stem-mqtt-win32-x64-msvc": "0.8.3"
|
|
51
52
|
},
|
|
52
53
|
"os": [
|
|
53
54
|
"darwin",
|
|
54
|
-
"linux"
|
|
55
|
+
"linux",
|
|
56
|
+
"win32"
|
|
55
57
|
],
|
|
56
58
|
"cpu": [
|
|
57
59
|
"arm64",
|