3104 Commits

Author SHA1 Message Date
LongYinan
e2f70bf66d
fix(cli): watch trigger (#2446) 2025-01-26 17:04:29 +08:00
LongYinan
1ec9082160
fix(cli): add -gcc-toolchain flag to cross-compile (#2445) 2025-01-26 17:01:28 +08:00
renovate[bot]
7cd7aa81e3
chore(deps): update cross-platform-actions/action action to v0.27.0 (#2443)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-22 09:08:28 +00:00
lghuahua
cc4d8bfa84
fix(napi-derive): enable tuple fields to support js_name attribute (#2439)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-01-22 12:10:26 +08:00
dependabot[bot]
33807debbb
chore(deps): bump undici from 6.21.0 to 6.21.1 (#2442) 2025-01-22 08:42:39 +08:00
renovate[bot]
64f2928f07
chore(deps): update dependency vite to v6.0.9 [security] (#2441)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 21:55:17 +00:00
LongYinan
b55b3c0ba1
chore: update @oxc-node/core (#2437) 2025-01-20 13:16:23 +08:00
renovate[bot]
98e16fad8b
chore(deps): update dependency @oxc-node/core to ^0.0.19 (#2438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 04:23:42 +00:00
LongYinan
ecd855e4b7
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.68
 - @napi-rs/triples@2.0.0-alpha.30
@napi-rs/cli@3.0.0-alpha.68 @napi-rs/triples@2.0.0-alpha.30
2025-01-20 11:40:58 +08:00
LongYinan
64bed9af13
ci: fix s390x and ppc64le test (#2435) 2025-01-20 11:40:24 +08:00
renovate[bot]
1b24837445
chore(deps): update dependency @oxc-node/core to ^0.0.18 (#2434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 02:57:22 +00:00
LongYinan
1868b0a214
chore: clippy fix (#2433) 2025-01-20 10:45:44 +08:00
renovate[bot]
8ce7f77e5d
chore(deps): update dependency electron to v34 (#2428)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 09:48:41 +08:00
LongYinan
e3828bc77d
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.67
 - @napi-rs/triples@2.0.0-alpha.29
@napi-rs/cli@3.0.0-alpha.67 @napi-rs/triples@2.0.0-alpha.29
2025-01-19 22:22:08 +08:00
LongYinan
978a00069b
fix(cli): s390x cross toolchain path (#2432) 2025-01-19 22:21:11 +08:00
LongYinan
c796918787
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.66
 - @napi-rs/triples@2.0.0-alpha.28
@napi-rs/cli@3.0.0-alpha.66 @napi-rs/triples@2.0.0-alpha.28
2025-01-19 21:32:18 +08:00
LongYinan
75eaff85ae
fix(triples): file style 2025-01-19 21:29:41 +08:00
LongYinan
0ad7e10022
feat(cli): update cross-toolchain to support s390x 2025-01-19 21:23:31 +08:00
renovate[bot]
63b8ace192
chore(deps): update dependency vite-plugin-node-polyfills to ^0.23.0 (#2431)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-19 07:33:06 +00:00
renovate[bot]
e8d48e14d4
chore(deps): update vitest monorepo to v3 (#2429)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-17 15:19:49 +08:00
renovate[bot]
f03807e465
chore(deps): update dependency @oxc-node/core to ^0.0.17 (#2427)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-13 04:59:26 +00:00
LongYinan
1312763b11
Release independent packages
- napi-derive@3.0.0-alpha.25
napi-derive@3.0.0-alpha.25
2025-01-12 22:36:59 +08:00
LongYinan
ea05ad3845
fix(napi-derive): hide the lifetime recursively in codegen (#2426) 2025-01-12 22:36:14 +08:00
LongYinan
55846053f7
Release independent packages
- napi@3.0.0-alpha.27
- napi-derive@3.0.0-alpha.24
napi-derive@3.0.0-alpha.24 napi@3.0.0-alpha.27
2025-01-12 20:40:29 +08:00
LongYinan
24e6bd38f3
chore: remove ts-node in examples/napi test (#2425) 2025-01-12 19:22:37 +08:00
LongYinan
05572bf1d4
feat(napi): allow create ReadableStream from polyfill (#2424) 2025-01-12 15:32:12 +08:00
LongYinan
cf0f03eee4
Revert "fix(deps): update rust crate convert_case to 0.7 (#2422)"
This reverts commit 68a39b4fba1aa5b73fdff52f3debf62f1f88a85c.
2025-01-12 12:36:11 +08:00
renovate[bot]
68a39b4fba
fix(deps): update rust crate convert_case to 0.7 (#2422)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-12 03:57:04 +00:00
LongYinan
73d5c1d803
fix(napi): add back Buffer/TypedArray custom gc on wasi (#2421) 2025-01-12 11:45:50 +08:00
LongYinan
8ebc851fce
Release independent packages
napi@3.0.0-alpha.26

napi-derive@3.0.0-alpha.26
napi@3.0.0-alpha.26
2025-01-04 20:07:20 +08:00
LongYinan
35ebf8f7d4
fix(napi): remove feature flag on Object::new 2025-01-04 20:06:40 +08:00
LongYinan
a24993b773
Release independent packages
- napi@3.0.0-alpha.25
- napi@3.0.0-alpha.23
napi-derive@3.0.0-alpha.23 napi@3.0.0-alpha.25
2025-01-04 15:23:37 +08:00
LongYinan
98cb7671d3
feat(napi): impl ReadableStream and AsyncGenerator (#2418)
* feat(napi): impl ReadableStream and AsyncGenerator

* clippy fix

* Into<Vec<u8>> trait

* Skip node18 stream test due to Node.js bug

* Cleanup

* Also skip wasi test

* Merge test

* Skip wasi

* Useless expect-error
2025-01-03 17:09:42 +08:00
LongYinan
aad71cdb00
docs: update badge and matrix 2025-01-02 17:52:39 +08:00
LongYinan
bd131ad2b0
ci: move FreeBSD test into github (#2417) 2025-01-02 09:50:51 +00:00
lghuahua
31cd07c8c2
feat(napi-derive): support type on #[napi] (#2416)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-01-02 17:15:07 +08:00
richerfu
a7c41f33ec
feat(napi): add get and try_get for FunctionCallContext (#2409)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-01-02 17:14:53 +08:00
richerfu
5f7415c1fe
fix(napi): Function call with empty tuple should generate empty arguments (#2407)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-01-02 17:10:53 +08:00
LongYinan
480f8cecd9
style(napi): code format 2025-01-02 16:59:36 +08:00
Stanisław Czech
b4b74d6f1f
refactor!(napi): arguments tuple behavior (#2401)
* Implement FromNapiValue trait as macro

Code behavior should remain the same, with much less copy-pasting of the same code.
Additionally, this commit adds a unit tests for test for FromNapiValue
for tuple trait which appears to be currently missing.

* Simplify macro arr_get

Rewrite the macro to reduce the size of expanded code of the macro
(from 4088 to 2429 lines). Although this is a minor change,
this may help reduce the size of compiled library.

* Refactor typegen Type::Path

Removes the need for keeping mutable variable, as its only assigned once.

* [API BREAKING] Update api for calling functions.

This commit introduces new type FnArgs,
that is created with the goal of distinguishing between
calling JS function from rust with tuple as argument
and calling with multiple arguments.

Currently there is no possibility to add ToNapiValue value,
as tuple is used to call callback functions with more than one
argument from rust.

With this change, callbacks with multiple arguments,
should be called, with converting tuple of argument
into FnArgs struct, either by calling into() on such
tuple, or by creating FnArgs struct directly.

* Add support for FnArgs when generating TS types

Updated the macro for generating typescript types,
to correctly handle FnArgs struct. This is now treated
as passthrough type and generates the output from the
type inside of FnArgs struct.

* Implement ToNapiValue trait for tuple

With the changes to callback calling API, it's now possible
to safely add this change. This change allows to pass tuple
from rust code to JS to match the existing FromNapiValue trait
currently existing in the library.
2025-01-02 16:58:58 +08:00
renovate[bot]
e99e20e905
chore(deps): update yarn to v4.6.0 (#2410) 2025-01-01 13:03:00 +08:00
renovate[bot]
3ff7198da8
chore(deps): lock file maintenance (#2413) 2025-01-01 12:42:09 +08:00
LongYinan
a8a1a29fa9
ci: update FreeBSD to 14.2 2024-12-23 15:00:02 +08:00
LongYinan
74013507a7
ci: stop auto build docker images 2024-12-20 21:56:09 +08:00
Cong-Cong Pan
24da4e6ffb
perf(napi): JsStringUtf8 take & into_owned & as_str fn (#2404) 2024-12-20 12:58:41 +08:00
ganthern
b1400e3263
docs: update MSRV in README.md (#2402) 2024-12-19 22:21:28 +08:00
LongYinan
8027aa0602
Release independent packages
- napi@3.0.0-alpha.24
- napi-derive@3.0.0-alpha.22
- napi-sys@3.0.0-alpha.1
- napi-build@2.1.4
napi-build@2.1.4 napi-derive@3.0.0-alpha.22 napi-sys@3.0.0-alpha.1 napi@3.0.0-alpha.24
2024-12-18 23:52:09 +08:00
LongYinan
d23290f9c1
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.65
 - @napi-rs/triples@2.0.0-alpha.27
 - @napi-rs/wasm-runtime@0.2.6
@napi-rs/cli@3.0.0-alpha.65 @napi-rs/triples@2.0.0-alpha.27 @napi-rs/wasm-runtime@0.2.6
2024-12-18 23:49:55 +08:00
LongYinan
a72c49b92e
feat(cli): add --no-dts-cache option to build command (#2400) 2024-12-18 23:49:22 +08:00
LongYinan
8fffa49282
fix(napi): resuse threads worker on Node.js (#2399) 2024-12-18 23:48:30 +08:00