LongYinan
814bc79412
fix(napi-derive): using js_name generating wrong type defs ( #2700 )
...
This commit introduces two main changes:
1. Refactors the variable names used during the creation of
`NapiStruct` in `crates/macro/src/parser/mod.rs`. The goal is to
make the source of `NapiStruct.name` (the Rust identifier) and
`NapiStruct.js_name` (the JavaScript name, potentially from a
`#[napi(js_name = "...")]` attribute) more explicit. This change
is primarily for code readability and maintainability. The core
logic remains the same.
2. Adds a new test case to `examples/napi` to specifically verify
the behavior of `#[napi(js_name = "...")]` on structs. This
includes:
- A new Rust struct `OriginalRustNameForJsNamedStruct` in
`examples/napi/src/class.rs` decorated with
`#[napi(js_name = "MyJsNamedClass")]`.
- Corresponding tests in `examples/napi/__tests__/values.spec.ts`
that check for correct class instantiation, method calls, and
type alias generation (`OriginalRustNameForJsNamedStruct` as an
alias for `MyJsNamedClass`).
Note: I encountered some issues running the full build and tests for the example due to pre-commit hooks in the testing environment that I couldn't bypass. However, I believe the changes are correct based on static analysis and focused checks.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-08 17:14:57 +08:00
LongYinan
3f4338a907
fix(napi): memory leak in Object Property ( #2699 )
2025-06-07 22:24:05 +08:00
lyonbot
193b0e0043
fix: (wasm-runtime) fix race condition ( #2698 )
...
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-06-07 22:09:47 +08:00
renovate[bot]
c47d0e75f3
chore(deps): update dependency oxlint to ^0.18.0 ( #2697 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-06 23:59:20 +00:00
Hana
e31b898a35
feat(napi): support setting error_status of ThreadsafeFunctionBuilder ( #2695 )
2025-06-06 16:27:52 +08:00
Hana
0a90c8a8f2
feat(napi): support build_threadsafe_function variant with error status ( #2694 )
2025-06-05 21:35:18 +08:00
LongYinan
17cced98de
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.87
- @napi-rs/triples@2.0.0-alpha.49
@napi-rs/cli@3.0.0-alpha.87
@napi-rs/triples@2.0.0-alpha.49
2025-06-05 11:22:33 +08:00
LongYinan
21e5580f28
fix(cli): remove require in utils ( #2693 )
2025-06-05 11:08:05 +08:00
LongYinan
19146503ff
Release independent packages
...
- napi@3.0.0-beta.7
- napi-build@2.2.1
napi-build@2.2.1
napi@3.0.0-beta.7
2025-06-04 20:25:05 +08:00
LongYinan
3450c7af43
fix(napi-build): compatible with v2
2025-06-04 20:24:02 +08:00
LongYinan
4c771618b8
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.86
- @napi-rs/triples@2.0.0-alpha.48
@napi-rs/cli@3.0.0-alpha.86
@napi-rs/triples@2.0.0-alpha.48
2025-06-04 18:27:31 +08:00
LongYinan
fdbc070d6a
fix(cli): uses_default_features should also treat as enabled typeDef ( #2691 )
2025-06-04 18:27:03 +08:00
LongYinan
8256b9515e
Release independent packages
...
- napi@3.0.0-beta.6
- napi-derive@3.0.0-beta.6
- napi-build@3.0.0-beta.0
napi-build@3.0.0-alpha.0
napi-derive@3.0.0-beta.6
napi@3.0.0-beta.6
2025-06-04 18:24:11 +08:00
LongYinan
a8d39e98df
Release independent packages
...
- napi@3.0.0-beta.5
- napi-derive@3.0.0-beta.5
napi-derive@3.0.0-beta.5
napi@3.0.0-beta.5
2025-06-04 17:07:12 +08:00
LongYinan
0309ae9031
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.85
- @napi-rs/triples@2.0.0-alpha.47
@napi-rs/cli@3.0.0-alpha.85
@napi-rs/triples@2.0.0-alpha.47
2025-06-04 17:01:49 +08:00
liuyi
c9ff0ec464
feat(cli): detect type-def feature in cli ( #2690 )
2025-06-04 15:19:28 +08:00
liuyi
5a17b88636
fix: revalidate shared libs if type def not found ( #2689 )
2025-06-04 15:05:24 +08:00
Cong-Cong Pan
a6f133cf7f
perf(napi): PersistedPerInstanceHashMap can be thread local ( #2681 )
...
* perf: PersistedPerInstanceHashMap can be thread local
* fix
* fix
* fix cargo clippy
2025-06-04 11:46:36 +08:00
renovate[bot]
bce635862d
chore(deps): update yarn to v4.9.2 ( #2686 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-03 22:42:56 +00:00
LongYinan
1427056fe5
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.84
- @napi-rs/triples@2.0.0-alpha.46
@napi-rs/cli@3.0.0-alpha.84
@napi-rs/triples@2.0.0-alpha.46
2025-06-03 20:19:23 +08:00
LongYinan
375b32b2b1
chore: clippy fix
2025-06-03 20:18:57 +08:00
LongYinan
a79f9846b6
fix(cli): dtsHeader option merge orders
2025-06-03 19:59:52 +08:00
LongYinan
4629423a5f
chore: update tests fixture
2025-06-03 19:53:48 +08:00
LongYinan
fc62b69abc
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.83
- @napi-rs/triples@2.0.0-alpha.45
@napi-rs/cli@3.0.0-alpha.83
@napi-rs/triples@2.0.0-alpha.45
2025-06-03 19:50:46 +08:00
LongYinan
da42542f0a
fix(cli): dtsHeader content
2025-06-03 19:50:31 +08:00
LongYinan
9dd929db4a
chore: update napi-derive-backend version in napi-derive
2025-06-03 19:41:59 +08:00
LongYinan
2f64f200da
Release independent packages
...
- napi@3.0.0-beta.4
- napi-derive@3.0.0-beta.4
napi-derive@3.0.0-beta.4
napi-sys@3.0.0-alpha.3
napi@3.0.0-beta.4
2025-06-03 19:25:47 +08:00
LongYinan
b3a477cac0
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.82
- @napi-rs/triples@2.0.0-alpha.44
@napi-rs/cli@3.0.0-alpha.82
@napi-rs/triples@2.0.0-alpha.44
2025-06-03 19:22:17 +08:00
liuyi
d874a46647
fix: type generation for shared libs ( #2684 )
2025-06-03 19:19:29 +08:00
LongYinan
d5a16483c5
fix(napi-derive): Either<f64, u32> should generate number ts type ( #2683 )
2025-06-02 23:53:14 +08:00
LongYinan
b8d6e7bcee
fix(sys): napi10 types ( #2682 )
2025-06-02 23:37:16 +08:00
Hana
f4731bb566
feat!(napi): support custom tsfn result error code ( #2672 )
2025-06-02 22:47:50 +08:00
LongYinan
b93bdfd3eb
test: stress test on aarch64 linux gnu platform ( #2662 )
...
* test: stress test on aarch64 linux gnu platform
* remove configs in yarnrc
* clippy
2025-06-02 22:45:01 +08:00
renovate[bot]
23dbcd81fe
chore(deps): lock file maintenance ( #2678 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-02 12:36:03 +08:00
renovate[bot]
4ce77e1ef1
chore(deps): update dependency oxlint to ^0.17.0 ( #2675 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-30 23:28:25 +00:00
Cong-Cong Pan
6bbf25a3f3
perf(napi): hash map ( #2671 )
2025-05-30 23:38:17 +08:00
Cong-Cong Pan
9173e8eb28
feat!(napi): define propertes support symbol as name ( #2673 )
...
* feat: define properties support symbol as name
* fix
* fix
2025-05-30 23:37:19 +08:00
LongYinan
6fd2f0d962
Release independent packages
...
- napi@3.0.0-beta.3
- napi-sys@3.0.0-alpha.2
- napi-derive@3.0.0-beta.3
napi-derive@3.0.0-beta.3
napi-sys@3.0.0-alpha.2
napi@3.0.0-beta.3
2025-05-29 23:14:41 +08:00
LongYinan
a4cc0f58b4
feat(napi): add into_unknown on ToNapiValue ( #2669 )
2025-05-29 19:35:04 +08:00
LongYinan
5e4f6b5c95
chore(release): publish
...
- @napi-rs/cli@3.0.0-alpha.81
- @napi-rs/triples@2.0.0-alpha.43
@napi-rs/cli@3.0.0-alpha.81
@napi-rs/triples@2.0.0-alpha.43
2025-05-29 14:46:29 +08:00
LongYinan
29ae3ab604
fix(napi): use Arc in Reference because it is Send ( #2668 )
2025-05-29 09:12:02 +08:00
LongYinan
28829d2102
fix(cli): parse deps cargo metadata and find napi crates ( #2667 )
2025-05-28 23:25:16 +08:00
renovate[bot]
bdc57ef391
fix(deps): update dependency @octokit/rest to v22 ( #2663 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-28 00:02:41 +08:00
LongYinan
3a720f09cf
feat(sys): sync Node-API version changes ( #2661 )
...
* feat(sys): sync Node-API version changes
* upgrade electron
* move node_api_create_buffer_from_arraybuffer to experimental
2025-05-25 00:48:56 +08:00
LongYinan
9cccc46790
docs: update example in README ( #2660 )
2025-05-24 23:29:24 +08:00
LongYinan
f8fab45de7
feat(napi): serialize BigInt to serde::Value ( #2659 )
2025-05-24 23:18:40 +08:00
LongYinan
abf041542c
Release independent packages
...
- napi@3.0.0-beta.2
- napi-derive@3.0.0-beta.2
napi-derive@3.0.0-beta.2
napi@3.0.0-beta.2
2025-05-22 20:04:41 +08:00
LongYinan
c51008c4eb
feat(napi): set Error::reason to error message and stack in async context ( #2657 )
2025-05-22 19:42:45 +08:00
LongYinan
3c5f22001b
fix(napi): wrong error status in ThreadsafeFunction callback ( #2656 )
2025-05-22 17:24:46 +08:00
Cong-Cong Pan
6ef5e6e5cc
fix(napi): ClassInstance as_object lifecycle ( #2655 )
2025-05-21 14:21:03 +08:00