Skip to content

Commit a5294fa

Browse files
updated napi crate from v2 to v3 (#2228)
@sxlijin <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Update `napi` crate from v2 to v3, adjusting dependencies and code to accommodate API changes. > > - **Dependencies**: > - Update `napi` to version `3.1.3` and `napi-derive` to `3.1.1` in `Cargo.toml`. > - Update `@napi-rs/cli` to `3.0.4` in `package.json`. > - **Code Changes**: > - Replace `JsUnknown` with `Unknown` in `parse_ts_types.rs`, `log_collector.rs`, and `request.rs`. > - Update function signatures to use `Function` and `FunctionRef` for callbacks in `runtime.rs` and `function_result_stream.rs`. > - Modify `serde_value_to_js` to return `Unknown` instead of `JsUnknown` in `log_collector.rs`. > - Use `napi_derive::module_init` instead of `napi::module_init` in `lib.rs`. > - **Miscellaneous**: > - Add `compat-mode` feature to `napi` in `Cargo.toml`. > - Update checksum values in `Cargo.lock` for updated dependencies. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for f2bc26c. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN --> --------- Co-authored-by: Antonio Sarosi <[email protected]>
1 parent 21f7d62 commit a5294fa

16 files changed

+945
-827
lines changed

engine/Cargo.lock

Lines changed: 50 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/language_client_typescript/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ internal-baml-codegen.workspace = true
3434
log.workspace = true
3535
once_cell.workspace = true
3636
stream-cancel = "0.8"
37-
napi = { version = "2", features = [
37+
napi = { version = "3.1.3", features = [
3838
"anyhow",
3939
"async",
4040
"napi5",
4141
"serde-json",
4242
"tokio_rt",
4343
] }
44-
napi-derive = "2"
44+
napi-derive = "3.1.1"
4545
serde.workspace = true
4646
serde_json.workspace = true
4747
tokio = { version = "1", features = ["full"] }
@@ -52,4 +52,4 @@ tracing-subscriber = { version = "0.3.18", features = [
5252
] }
5353

5454
[build-dependencies]
55-
napi-build = "2.1.3"
55+
napi-build = "2.2.3"

engine/language_client_typescript/native.d.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,20 @@ export interface BamlLogEvent {
253253
startTime: string
254254
}
255255

256-
export declare export declare function get_version(): string
256+
export declare function get_version(): string
257257

258-
export declare export declare function getLogLevel(): string
258+
export declare function getLogLevel(): string
259259

260-
export declare export declare function invoke_runtime_cli(params: Array<string>): number
260+
export declare function invoke_runtime_cli(params: Array<string>): number
261261

262262
export interface LogEventMetadata {
263263
eventId: string
264264
parentId?: string
265265
rootEventId: string
266266
}
267267

268-
export declare export declare function setLogJsonMode(useJson: boolean): void
268+
export declare function setLogJsonMode(useJson: boolean): void
269269

270-
export declare export declare function setLogLevel(level: string): void
271-
272-
export declare export declare function setLogMaxChunkLength(length: number): void
270+
export declare function setLogLevel(level: string): void
273271

272+
export declare function setLogMaxChunkLength(length: number): void

0 commit comments

Comments
 (0)