2778 Commits

Author SHA1 Message Date
CPunisher
c459f0acf6
feat: support structured enum with discriminated unions (#2222)
* Structured enum

* Type indent

* Add test example

* Remove trailing commas

* discriminant

* discriminant conflict

* more test

* typo
2024-08-22 14:59:50 +08:00
CPunisher
e02ec1e87c
Replace self for Result<T> (#2224) 2024-08-22 14:59:00 +08:00
LongYinan
8df3f0f596
docs: remove dev protocal badge 2024-08-22 10:45:32 +08:00
renovate[bot]
650ce155e2
chore(deps): update dependency electron to v32 (#2221) 2024-08-20 19:42:26 +08:00
renovate[bot]
fa43fe13c9
chore(deps): update dependency webdriverio to v9 (#2218) 2024-08-19 09:40:15 +08:00
Mark Kovalenko
b5a5b032f6
fix(ci): bump FreeBSD version to 13.3 (#2220) 2024-08-18 22:02:06 +08:00
sjh
09a79edfb7
fix(napi,napi-derive): ffi lifetime and pointer sound issues (#2216)
* The ownership of the CString will be taken in map function

* for empty struct like `#[napi] struct A;`, the `value_ref` will be `0x1`, and it will be overwritten by the others instance of the same class
2024-08-18 18:21:13 +08:00
LongYinan
2e5bf773e3
fix(napi-derive): warning in empty enum codegen (#2214) 2024-08-10 22:30:50 +08:00
LongYinan
d84fc42832
fix(napi-derive): string enum validate logic (#2213) 2024-08-10 21:27:17 +08:00
renovate[bot]
4abda0ed37
chore(deps): lock file maintenance (#2202)
* chore(deps): lock file maintenance

* Switch to @inquirer/prompts

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-08-10 16:49:26 +08:00
LongYinan
82675fb068
ci: fix Address Sanitizer check (#2212) 2024-08-10 14:37:02 +08:00
CPunisher
a154612019
fix(napi-derive): add more cases for typegen of function args (#2210)
* Handle more arg pat

* Update testcase

* Revert
2024-08-08 11:07:21 +08:00
renovate[bot]
fd2409fd5f
chore(deps): update dependency oxlint to ^0.7.0 (#2208)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-06 02:28:15 +00:00
Louis
164ef2a9f3
chore: implement serde::Serialize for Either (#2209)
This adds an implementation of serde::Serialize for all the Either types.
Long term, we might want to use the either crate, but for now this makes this
implementation usable with serde.
2024-08-05 18:05:49 +08:00
LongYinan
282ce1c00a
fix(napi): allow ThreadsafeFunction in Either (#2204) 2024-08-03 13:22:09 +08:00
renovate[bot]
cacf6e4587
chore(deps): update yarn to v4.4.0 (#2205) 2024-08-03 11:35:20 +08:00
Cong-Cong Pan
327998d0ac
fix(napi-derive): error for missing impl FromNapiValue since object_from_js = false (#2197) 2024-07-25 12:18:13 +08:00
LongYinan
3f6822d9cd
test: skip unstable test in WASI env (#2196) 2024-07-24 12:09:08 +08:00
LongYinan
22dba74813
Release independent packages
- napi-derive@3.0.0-alpha.7
napi-derive@3.0.0-alpha.7
2024-07-23 22:07:15 +08:00
Louis
f88b90f71e
fix(napi-derive): call flush on the BufWriter (#2195)
This is mandated by the Rust doc of the BufWriter. We've also seen bugs where
the data doesn't seem to be flushed properly, and thus the CLI fails to parse
JSONs emitted by napi-derive. This might be it, or not, but flushing shouldn't
hurt.
2024-07-23 21:08:13 +08:00
LongYinan
0adb1a4992
chore(cli): add empty line in created pacakge.json file (#2194) 2024-07-23 13:36:42 +08:00
LongYinan
09ad8e762e
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.62
 - @napi-rs/triples@2.0.0-alpha.24
@napi-rs/cli@3.0.0-alpha.62 @napi-rs/triples@2.0.0-alpha.24
2024-07-21 14:01:37 +08:00
LongYinan
3284f881a6
fix(cli): should not log errors if everything fine 2024-07-21 14:01:16 +08:00
LongYinan
b884f62f7b
Release independent packages
- napi@3.0.0-alpha.8
napi@3.0.0-alpha.8
2024-07-18 14:26:43 +08:00
LongYinan
cf5f7bcd84
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.61
 - @napi-rs/triples@2.0.0-alpha.23
@napi-rs/cli@3.0.0-alpha.61 @napi-rs/triples@2.0.0-alpha.23
2024-07-18 14:24:54 +08:00
LongYinan
6acd3b94fb
chore: add fail reason to assert (#2192) 2024-07-18 14:19:50 +08:00
Hana
ba345be957
perf(napi): reduce allocation for ToNapiValue of &str (#2191) 2024-07-18 13:08:02 +08:00
LongYinan
0f7c40354f
Release independent packages
- napi-derive@3.0.0-alpha.6
napi-derive@3.0.0-alpha.6
2024-07-16 13:06:00 +08:00
LongYinan
ac75ffb7fc
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.60
 - @napi-rs/triples@2.0.0-alpha.22
@napi-rs/cli@3.0.0-alpha.60 @napi-rs/triples@2.0.0-alpha.22
2024-07-16 13:05:21 +08:00
LongYinan
6078bb7cce
fix(cli): bundle @octokit/rest into cjs entry (#2190) 2024-07-16 13:04:27 +08:00
Cong-Cong Pan
782d6ac5f8
fix(napi-derive): napi getter macros (#2188)
* fix: napi getter macros

* chore: cargo fmt
2024-07-16 12:48:38 +08:00
LongYinan
68f63882a9
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.59
 - @napi-rs/triples@2.0.0-alpha.21
@napi-rs/cli@3.0.0-alpha.59 @napi-rs/triples@2.0.0-alpha.21
2024-07-15 22:12:14 +08:00
LongYinan
e8608228b8
fix(cli): bundle lodash-es in cjs output (#2189) 2024-07-15 22:11:18 +08:00
LongYinan
2fccedbaba
Release independent packages
- napi@3.0.0-alpha.7
napi@3.0.0-alpha.7
2024-07-14 23:29:08 +08:00
LongYinan
54ec4897ea
fix(napi): PromiseRaw throw error logic (#2187) 2024-07-14 23:28:36 +08:00
LongYinan
13c18388f5
fix(cli): worker files format (#2186) 2024-07-14 22:23:34 +08:00
LongYinan
727f5a831a
test: skip memory exhausting test in wasi env (#2185) 2024-07-13 02:34:04 +08:00
renovate[bot]
d965e5c3cc
chore(deps): update dependency oxlint to ^0.6.0 (#2183)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-11 23:00:29 +08:00
Jade-fu
9e36daf559
fix(napi): reexport feature should be align (#2184) 2024-07-11 23:00:08 +08:00
LongYinan
119b2055a2
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.58
 - @napi-rs/triples@2.0.0-alpha.20
@napi-rs/cli@3.0.0-alpha.58 @napi-rs/triples@2.0.0-alpha.20
2024-07-11 17:32:00 +08:00
LongYinan
5976f04e54
fix(cli): wasm binding files destination (#2182) 2024-07-11 17:31:19 +08:00
renovate[bot]
4d39940fa0
chore(deps): update vitest monorepo to v2 (major) (#2177)
* chore(deps): update vitest monorepo to v2

* Fix lockfile

* Add playwright

* Update snapshots

* Fix vitest

* Fix vitest

* Fix wasi test

* Fix worker test condition

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-07-11 14:58:46 +08:00
renovate[bot]
9800ea7350
fix(deps): update dependency inquirer to v10 (#2173)
* fix(deps): update dependency inquirer to v10

* Fix for api changes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-07-10 23:49:19 +08:00
LongYinan
488762791d
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.57
 - @napi-rs/triples@2.0.0-alpha.19
@napi-rs/cli@3.0.0-alpha.57 @napi-rs/triples@2.0.0-alpha.19
2024-07-09 15:20:21 +08:00
LongYinan
731dced1bb
fix(cli): update wasi js binding files on any builds (#2179) 2024-07-09 14:01:23 +08:00
LongYinan
a040416f9f
chore(napi): reduce Node-API call in AsyncTask (#2176) 2024-07-08 16:57:53 +08:00
LongYinan
45a404c30b
ci: use shell to run tests in Docker (#2175) 2024-07-08 15:18:50 +08:00
LongYinan
349996b699
test: update snapshots 2024-07-07 22:34:36 +08:00
LongYinan
8891c43ef7
Release independent packages
- napi-derive@3.0.0-alpha.5
napi-derive@3.0.0-alpha.5
2024-07-07 21:03:40 +08:00
LongYinan
38d041569a
fix(napi-derive): PromiseRaw typegen 2024-07-07 21:03:14 +08:00