@trebired/logger 2.2.0 → 2.3.0
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/CHANGELOG.md +4 -1
- package/README.md +4 -1
- package/dist/storage/backend/native.d.ts +2 -1
- package/dist/storage/backend/native.d.ts.map +1 -1
- package/dist/storage/backend/native.js +8 -9
- package/dist/storage/backend/native.js.map +1 -1
- package/native/linux-arm64-gnu.node +0 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,10 @@ All notable changes to `@trebired/logger` will be documented here.
|
|
|
4
4
|
|
|
5
5
|
This project follows semantic versioning once published.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 2.3.0
|
|
8
|
+
|
|
9
|
+
- Changed native storage loading to try the bundled native backend by default in all runtimes, fall back to the JS backend automatically on load failure, and use `TB_LOGGER_DISABLE_NATIVE=1` as the explicit opt-out switch.
|
|
10
|
+
- Added Linux ARM64 GNU to the bundled native release matrix for npm publish and package verification.
|
|
8
11
|
|
|
9
12
|
## 2.2.0
|
|
10
13
|
|
package/README.md
CHANGED
|
@@ -15,11 +15,14 @@ The package can use bundled native binaries for supported Linux and macOS target
|
|
|
15
15
|
dist/
|
|
16
16
|
native/
|
|
17
17
|
linux-x64-gnu.node
|
|
18
|
+
linux-arm64-gnu.node
|
|
18
19
|
darwin-arm64.node
|
|
19
20
|
darwin-x64.node
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
At runtime the JS wrapper
|
|
23
|
+
At runtime the JS wrapper always tries the matching `.node` file first when one is bundled for the current platform, and falls back to the built-in JS backend if native loading is unavailable or fails. Bundled native binaries are currently published for Linux GNU (`x64` and `arm64`) and macOS targets. End users do not need Rust installed.
|
|
24
|
+
|
|
25
|
+
Set `TB_LOGGER_DISABLE_NATIVE=1` only when you explicitly want to force the JS backend.
|
|
23
26
|
|
|
24
27
|
```sh
|
|
25
28
|
npm install @trebired/logger
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { StorageBackend } from "./types.js";
|
|
2
2
|
declare function nativeBinaryBasenameForCurrentPlatform(): string | null;
|
|
3
3
|
declare function nativeAddonCandidatePathsForCurrentPlatform(): string[];
|
|
4
|
+
declare function resetNativeBindingForTests(): void;
|
|
4
5
|
declare function nativeStorageBackend(): StorageBackend | null;
|
|
5
|
-
export { nativeAddonCandidatePathsForCurrentPlatform, nativeBinaryBasenameForCurrentPlatform, nativeStorageBackend, };
|
|
6
|
+
export { nativeAddonCandidatePathsForCurrentPlatform, nativeBinaryBasenameForCurrentPlatform, nativeStorageBackend, resetNativeBindingForTests, };
|
|
6
7
|
//# sourceMappingURL=native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/storage/backend/native.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAsB,cAAc,EAAuB,MAAM,YAAY,CAAC;AAkB1F,iBAAS,sCAAsC,IAAI,MAAM,GAAG,IAAI,CAa/D;AAED,iBAAS,2CAA2C,IAAI,MAAM,EAAE,CAgB/D;
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/storage/backend/native.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAsB,cAAc,EAAuB,MAAM,YAAY,CAAC;AAkB1F,iBAAS,sCAAsC,IAAI,MAAM,GAAG,IAAI,CAa/D;AAED,iBAAS,2CAA2C,IAAI,MAAM,EAAE,CAgB/D;AAwBD,iBAAS,0BAA0B,IAAI,IAAI,CAE1C;AAED,iBAAS,oBAAoB,IAAI,cAAc,GAAG,IAAI,CAgBrD;AAED,OAAO,EACL,2CAA2C,EAC3C,sCAAsC,EACtC,oBAAoB,EACpB,0BAA0B,GAC3B,CAAC"}
|
|
@@ -33,8 +33,8 @@ function nativeBinaryBasenameForCurrentPlatform() {
|
|
|
33
33
|
function nativeAddonCandidatePathsForCurrentPlatform() {
|
|
34
34
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
35
35
|
const binaryName = nativeBinaryBasenameForCurrentPlatform();
|
|
36
|
-
const envOverride = process.env.
|
|
37
|
-
? path.resolve(process.env.
|
|
36
|
+
const envOverride = process.env.TB_LOGGER_NATIVE_BINARY
|
|
37
|
+
? path.resolve(process.env.TB_LOGGER_NATIVE_BINARY)
|
|
38
38
|
: "";
|
|
39
39
|
return [
|
|
40
40
|
envOverride,
|
|
@@ -47,13 +47,9 @@ function nativeAddonCandidatePathsForCurrentPlatform() {
|
|
|
47
47
|
].filter(Boolean);
|
|
48
48
|
}
|
|
49
49
|
function loadBinding() {
|
|
50
|
-
if (cachedBinding)
|
|
50
|
+
if (cachedBinding !== undefined)
|
|
51
51
|
return cachedBinding;
|
|
52
|
-
if (process.env.
|
|
53
|
-
cachedBinding = null;
|
|
54
|
-
return cachedBinding;
|
|
55
|
-
}
|
|
56
|
-
if (typeof Bun !== "undefined" && process.env.TREBIRED_LOGGER_ENABLE_BUN_NATIVE !== "1") {
|
|
52
|
+
if (process.env.TB_LOGGER_DISABLE_NATIVE === "1") {
|
|
57
53
|
cachedBinding = null;
|
|
58
54
|
return cachedBinding;
|
|
59
55
|
}
|
|
@@ -71,6 +67,9 @@ function loadBinding() {
|
|
|
71
67
|
cachedBinding = null;
|
|
72
68
|
return cachedBinding;
|
|
73
69
|
}
|
|
70
|
+
function resetNativeBindingForTests() {
|
|
71
|
+
cachedBinding = undefined;
|
|
72
|
+
}
|
|
74
73
|
function nativeStorageBackend() {
|
|
75
74
|
const binding = loadBinding();
|
|
76
75
|
if (!binding)
|
|
@@ -88,5 +87,5 @@ function nativeStorageBackend() {
|
|
|
88
87
|
},
|
|
89
88
|
};
|
|
90
89
|
}
|
|
91
|
-
export { nativeAddonCandidatePathsForCurrentPlatform, nativeBinaryBasenameForCurrentPlatform, nativeStorageBackend, };
|
|
90
|
+
export { nativeAddonCandidatePathsForCurrentPlatform, nativeBinaryBasenameForCurrentPlatform, nativeStorageBackend, resetNativeBindingForTests, };
|
|
92
91
|
//# sourceMappingURL=native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/storage/backend/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAUzC,IAAI,aAA+C,CAAC;AAEpD,SAAS,gBAAgB;IACvB,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnG,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAwD,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9H,IAAI,MAAM,EAAE,mBAAmB;QAAE,OAAO,KAAK,CAAC;IAC9C,IAAI,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;QAAE,OAAO,MAAM,CAAC;IACxD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,sCAAsC;IAC7C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;QAChC,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK;YAAE,OAAO,aAAa,IAAI,OAAO,CAAC;QAC5D,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO;YAAE,OAAO,eAAe,IAAI,OAAO,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK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KAAK;YAC/B,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,KAAK,CAAC,aAAa,CAAC,KAAyB;YAC3C,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EACL,2CAA2C,EAC3C,sCAAsC,EACtC,oBAAoB,EACpB,0BAA0B,GAC3B,CAAC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trebired/logger",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Local-first JSONL logger with durable writes, partitions, export archives, native storage acceleration, redaction, query helpers, and browser runtimes.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"keywords": [
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"demo": "bun run examples/dummy.ts",
|
|
63
63
|
"prepublishOnly": "bun run typecheck && bun test && bun run build && node ./scripts/verify-publish.mjs",
|
|
64
64
|
"publish:npm": "bun run build:native:matrix && npm publish",
|
|
65
|
-
"publish:npm:host": "bun run build:native &&
|
|
65
|
+
"publish:npm:host": "bun run build:native && TB_LOGGER_ALLOW_HOST_ONLY_PUBLISH=1 npm publish",
|
|
66
66
|
"test": "bun test",
|
|
67
67
|
"typecheck": "tsc --noEmit",
|
|
68
68
|
"verify:pack": "node ./scripts/verify-pack.mjs"
|