Commit graph

2248 commits

Author SHA1 Message Date
LongYinan
d0a9cbfa86
Merge pull request #1228 from Hywan/fix-option-t-null
fix(napi) `undefined` is recognized as a valid `None` for `Option<T>`
2022-07-07 22:30:07 +08:00
Ivan Enderlin
1259ce1ba4 fix(napi) undefined is recognized as a valid None for Option<T>. 2022-07-07 15:50:55 +02:00
LongYinan
087b3ed594
Release independent packages
napi@2.6.1
2022-07-07 00:17:02 +08:00
LongYinan
523bcc3068
Merge pull request #1227 from napi-rs/buffer-drop
fix(napi): drop buffer inner data only when Reference count is 0
2022-07-07 00:14:20 +08:00
LongYinan
bffc49f11a
fix(napi): drop buffer inner data only when Reference count is 0 2022-07-07 00:01:16 +08:00
LongYinan
661b418eb6
Release independent packages
napi@2.6.0
napi-derive@2.6.0
2022-07-06 23:33:50 +08:00
LongYinan
2d97986657
chore: publish
- @napi-rs/cli@2.10.1
2022-07-06 23:32:26 +08:00
LongYinan
60ed3ab474
Merge pull request #1225 from napi-rs/upgrade-dependencies
chore(cli): upgrade npm dependencies
2022-07-06 21:46:05 +08:00
LongYinan
5cfff2ad5c
chore(cli): upgrade npm dependencies 2022-07-06 21:18:00 +08:00
LongYinan
2bc9218547
Merge pull request #1224 from napi-rs/clone-ref
feat(napi): clone reference for TypedArray/Buffer
2022-07-06 19:49:06 +08:00
LongYinan
1a7cff167e
feat(napi): clone reference for TypedArray/Buffer 2022-07-06 19:15:16 +08:00
LongYinan
1ac7fcf2ce
Merge pull request #1223 from napi-rs/strict-check-optional
fix(napi): validate fn for Option<T>
2022-07-06 14:34:30 +08:00
LongYinan
cc3086d804
fix(napi): validate fn for Option<T> 2022-07-06 14:01:32 +08:00
LongYinan
20577a117f
Merge pull request #1221 from napi-rs/inject-this
feat(napi-derive): allow injecting this in class method
2022-07-06 11:16:28 +08:00
LongYinan
87fd74cbb6
feat(napi-derive): allow injecting this in class method 2022-07-05 23:09:40 +08:00
LongYinan
c3b59c8a12
Merge pull request #1219 from napi-rs/return-if-invalid
feat(napi-derive): support return_if_invalid
2022-07-05 20:07:57 +08:00
LongYinan
2e53bf7f9a
feat(napi-derive): support return_if_invalid 2022-07-05 18:39:12 +08:00
LongYinan
dface0c6a7
Merge pull request #1200 from Hywan/feat-either-n-up-to-26
feat(napi) Implement `Either3` to `Either26`.
2022-07-05 17:35:15 +08:00
LongYinan
53cab27bc4
refactor(napi): Either now perform ValidateNapiValue::validate rather than type_of 2022-07-05 17:01:21 +08:00
Ivan Enderlin
81b07ce5a6
feat(napi) implement Either3 to Either26.
This patch introduces a new macro: `either_n!` that generates the types
`Either{n}` where $3 \leq n \leq 26$. Manual implementations for
`Either3`, `Either4` and `Either5` are removed by this patch too.

The `either_n!` macro is quite classical. There is no particular
trick, except `count_idents!` which simply turns, e.g. `A, B, C` into
`3`. This macro is used by `either_n!` to implement the
`debug_assert!` inside `from_napi_value`.
2022-07-05 17:01:12 +08:00
LongYinan
496fc3e54a
chore: add team members into FUNDING.yml 2022-06-30 19:43:37 +08:00
LongYinan
227de9efe0
fix(cli): android CI template 2022-06-30 19:43:37 +08:00
Jonas Platte
7cf87eaf20
chore(napi): replace lazy_static with once_cell (#1213) 2022-06-25 11:19:45 +08:00
LongYinan
f879a05b7f
ci: fix docker images 2022-06-14 14:58:03 +08:00
LongYinan
df5bb1ae30
chore: publish
- @napi-rs/cli@2.10.0
2022-06-10 18:24:43 +08:00
LongYinan
90184ef552
Merge pull request #1209 from napi-rs/cli-template-upgrade
feat(cli): upgrade new project template to yarn3
2022-06-10 18:22:40 +08:00
LongYinan
8f6a10c89a
feat(cli): upgrade new project template to yarn3 2022-06-10 18:07:05 +08:00
LongYinan
2e7f3affe1
Release independent packages
napi@2.5.0
napi-derive@2.5.0
napi-build@2.0.1
2022-06-10 15:37:27 +08:00
LongYinan
357e6bf0d5
Merge pull request #1207 from napi-rs/fix-android-build
fix: android builds broken by actions default ndk version bump
2022-06-10 15:34:03 +08:00
LongYinan
18dc3df5ba
style: clippy 2022-06-10 15:20:06 +08:00
forehalo
f90d63ccde
fix(build): broken android target build caused by ndk upgrade 2022-06-10 15:19:56 +08:00
LongYinan
548f358fdb
Merge pull request #1202 from napi-rs/misc
Misc fix
2022-06-04 01:56:41 +08:00
LongYinan
8bb4db349d
chore: upgrade dependencies 2022-06-04 01:26:35 +08:00
LongYinan
fe4cc74743
build: fix debian-aarch64 image 2022-06-04 01:26:35 +08:00
LongYinan
04a865270c
Merge pull request #1201 from napi-rs/class-instance
feat(napi): support into_instance in class struct
2022-06-04 01:26:16 +08:00
LongYinan
c1e07b3c12
feat(napi): support into_instance in class struct 2022-06-04 01:07:47 +08:00
LongYinan
717f96acfc
ci: fix debian image 2022-05-31 12:53:49 +08:00
LongYinan
67cf075f86 Merge pull request #1198 from Hywan/feat-tonapivalue-vec-numbers 2022-05-30 23:50:24 +08:00
Ivan Enderlin
94e95e87e7 feat(napi) Extend #1195 to Vec<T>.
This patch is the sequel of
https://github.com/napi-rs/napi-rs/pull/1195 where `ToNapiValue` and
`FromNapiValue` are implemented for all `Vec<T>` where `T` is a 8 or
16 bits number.
2022-05-30 16:29:44 +02:00
Sunli
5cdfc8cb7e feat(napi) implement From<Infallible> for napi::Error 2022-05-30 21:44:03 +08:00
Ivan Enderlin
56e71a76d3 feat(napi) Return an error instead of panicking. 2022-05-25 14:43:23 +08:00
Ivan Enderlin
cb2a407228 feat(napi) Implement ToNapiValue for 8 and 16-bits numbers.
`napi` only supports numbers in 16 and 32-bits. To support Rust
numbers with 8 and 16-bits, we can cast them to 32-bits. To convert
from 8 and 16-bits to 32-bits, we use their `Into` implementation. To
convert from 32-bits to 8 and 16-bits, we use their `TryInto`, we
should theorically not fail, but in case of, an `except` message is
appended.

The code has also been re-indented as it was containing a mix of 2
spaces, 4 spaces and tabs identation.
2022-05-25 14:43:23 +08:00
Jose Acevedo
796ba363f5 test(napi-derive): add trybuild negative macro tests 2022-05-23 11:55:19 +08:00
messense
beb75111fc
fix(cli): parse host target triple from rustc -vV (#1191) 2022-05-22 13:43:35 +08:00
Jose L
5be415d3d9
feat(napi-derive): add ts_arg_type attribute to override individual args on functions (#1192) 2022-05-22 13:43:11 +08:00
messense
5cbeac59dc
Add rust-version field to Cargo.tomls (#1190) 2022-05-20 16:23:10 +08:00
LongYinan
a2b993acd2
chore: upgrade npm dependencies (#1182) 2022-05-14 18:56:50 +08:00
LongYinan
b797a243e2
chore: publish
- @napi-rs/cli@2.9.0
2022-05-14 17:03:09 +08:00
messense
1399288df5
feat(cli): allow specifying an alternative cargo binary via CARGO env var (#1181) 2022-05-14 15:03:31 +08:00
Devon Govett
d6c755c4eb
fix(napi-derive): js_name support for getters and setters (#1179) 2022-05-13 12:55:54 +08:00