Skip to content

Commit 5768a5c

Browse files
committed
feat: upgrade napi to v3 stable
1 parent ddd905f commit 5768a5c

File tree

32 files changed

+2275
-2443
lines changed

32 files changed

+2275
-2443
lines changed

.github/workflows/CI.yaml

Lines changed: 98 additions & 189 deletions
Large diffs are not rendered by default.

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ansible.python.interpreterPath": "/usr/bin/python3"
3+
}

.yarn/releases/yarn-4.5.0.cjs

Lines changed: 0 additions & 925 deletions
This file was deleted.

.yarn/releases/yarn-4.9.4.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ enableGlobalCache: false
44

55
nodeLinker: node-modules
66

7-
yarnPath: .yarn/releases/yarn-4.5.0.cjs
7+
yarnPath: .yarn/releases/yarn-4.9.4.cjs

Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
lz4_flex = { version = "0.11.3" }
14-
napi = "2"
15-
napi-derive = "2"
14+
napi = { version = "3.0.0", features = ["napi5", "serde-json"] }
15+
napi-derive = { version = "3.0.0" }
1616

17-
[target.'cfg(all(any(windows, unix), target_arch = "x86_64", not(target_env = "musl")))'.dependencies]
18-
mimalloc = { version = "0.1" }
17+
[target.'cfg(all(not(target_os = "linux"), not(target_family = "wasm")))'.dependencies]
18+
mimalloc-safe = { version = "0.1", features = ["skip_collect_on_exit"] }
19+
20+
[target.'cfg(all(target_os = "linux", not(target_env = "ohos"), not(target_env = "musl")))'.dependencies]
21+
mimalloc-safe = { version = "0.1", features = ["local_dynamic_tls", "skip_collect_on_exit"] }
1922

2023
[build-dependencies]
2124
napi-build = "2.0.1"

index.d.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
/* auto-generated by NAPI-RS */
22
/* eslint-disable */
3-
export declare function compress(
4-
data: string | Buffer,
5-
dict?: string | Buffer | undefined | null,
6-
): Promise<Buffer> | Promise<Buffer>
7-
export declare function compressFrame(data: string | Buffer): Promise<Buffer>
3+
export declare function compress(data: string | Uint8Array, dict?: string | Uint8Array | undefined | null): Promise<Buffer>
4+
5+
export declare function compressFrame(data: string | Uint8Array): Promise<Buffer>
6+
87
export declare function compressFrameSync(data: string | Buffer): Buffer
8+
99
export declare function compressSync(data: string | Buffer, dict?: string | Buffer | undefined | null): Buffer
10-
export declare function decompressFrame(data: string | Buffer): Promise<Buffer>
10+
11+
export declare function decompressFrame(data: string | Uint8Array): Promise<Buffer>
12+
1113
export declare function decompressFrameSync(data: string | Buffer): Buffer
12-
export declare function uncompress(
13-
data: string | Buffer,
14-
dict?: string | Buffer | undefined | null,
15-
): Promise<Buffer> | Promise<Buffer>
16-
export declare function uncompressSync(data: string | Buffer, dict?: string | Buffer | undefined | null): Buffer
14+
15+
export declare function uncompress(data: string | Uint8Array, dict?: string | Uint8Array | undefined | null): Promise<Buffer>
16+
17+
export declare function uncompressSync(data: string | Uint8Array, dict?: string | Uint8Array | undefined | null): Buffer

0 commit comments

Comments
 (0)