Commit graph

2643 commits

Author SHA1 Message Date
LongYinan
cd3a850dcb
ci: improve test speed (#2057) 2024-04-19 16:00:20 +08:00
LongYinan
22c751ced0
fix(napi-derive): bail the unexpected factory directive (#2051)
- Close https://github.com/napi-rs/napi-rs/issues/2048
2024-04-18 00:14:00 +08:00
LongYinan
8f5d7e5274
fix(napi): handle panic in async block (#2050)
- Close https://github.com/napi-rs/napi-rs/issues/2047
2024-04-17 23:34:47 +08:00
LongYinan
3187e30d5b
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.50
 - @napi-rs/triples@2.0.0-alpha.12
2024-04-17 20:23:19 +08:00
LongYinan
7e33eb729f
feat(cli): optimize wasm output binary (#2049) 2024-04-17 20:13:02 +08:00
LongYinan
27134b8ca4
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.49
 - @napi-rs/triples@2.0.0-alpha.11
2024-04-16 18:24:34 +08:00
LongYinan
0e60651149
chore: dedupe electron 2024-04-16 18:24:25 +08:00
LongYinan
b3dd94649a
feat(cli): allow to define dtsHeader in napi config (#2045) 2024-04-16 17:40:41 +08:00
LongYinan
a2d78fadf9
fix(cli): wasi targets linker envs (#2044) 2024-04-16 16:43:44 +08:00
renovate[bot]
6871b67589
chore(deps): update dependency electron to v30 (#2043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-16 14:17:22 +08:00
LongYinan
dacfeac1f5
Release independent packages
napi@3.0.0-alpha.2
2024-04-15 23:59:37 +08:00
LongYinan
e3a403b441
feat(napi): allow user defined tokio runtime (#2040) 2024-04-15 23:58:28 +08:00
LongYinan
4544095425
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.48
 - @napi-rs/triples@2.0.0-alpha.10
2024-04-15 23:20:08 +08:00
Louis
19dbadefba
fix(ThreadsafeFunction): ensure CalleeHandled works as expected (#2039)
This was refactored in 4719caa643. This codepath
was swapped, as the fatal exception must be the normal codepath when the callee
handled field is false. This fixes it by swapping this if statement, all the
other calls have been checked and seem fine.
2024-04-15 23:19:15 +08:00
LongYinan
cc937e1dba
feat(cli): allow control the wasm Memory options via napi config (#2038) 2024-04-15 23:19:02 +08:00
翠 / green
923b82aee9
feat(napi): allow &External to be created from napi value (#2037) 2024-04-15 17:54:10 +08:00
LongYinan
af625fc7df
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.47
 - @napi-rs/triples@2.0.0-alpha.9
2024-04-13 19:01:15 +08:00
LongYinan
7999475f76
Release independent packages
napi-build@2.1.3
2024-04-13 18:55:53 +08:00
LongYinan
16f0d49284
chore: increase wasi memory limits (#2035) 2024-04-13 18:35:08 +08:00
LongYinan
f1b8ab5e64
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.46
 - @napi-rs/triples@2.0.0-alpha.8
2024-04-10 17:03:00 +08:00
LongYinan
63c8ab3f20
Release independent packages
napi@3.0.0-alpha.1
napi-derive@3.0.0-alpha.1
napi-sys@2.4.0
2024-04-10 17:03:00 +08:00
LongYinan
e274cf7ae6
feat(napi-derive): enhance the error messages in object validator (#2034) 2024-04-10 16:52:23 +08:00
LongYinan
67f03a7fd4
ci: fix flaky tests (#2033)
* ci: fix flaky tests

* chore: remove useless deps

* chore: decresse worker_threads counts
2024-04-10 15:43:05 +08:00
Ranger
e86e3add2b
fix(napi): napi_adjust_external_memory should be hidden with wasm target (#2031) 2024-04-10 14:57:04 +08:00
LongYinan
5570d8b4f7
chore: use oxlint (#2032) 2024-04-10 14:26:34 +08:00
LongYinan
4c7d06fc72
feat(cli): support wasm32-wasipxx targets (#2030)
* chore(examples): update wasi binding template

* wasm32-wasip1
2024-04-10 09:08:57 +08:00
renovate[bot]
2e5ddb6957
chore(deps): lock file maintenance (#2018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-09 18:29:18 +08:00
翠 / green
a394984f5d
docs: update platform support in README (#2029)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-04-09 18:29:04 +08:00
翠 / green
2e0f983ccf
feat(target): add support for s390x-unknown-linux-gnu (#2028)
* feat(target): add support for s390x-unknown-linux-gnu

* chore: rerun CI
2024-04-09 14:16:09 +08:00
翠 / green
0fa755d30a
feat(target): add support for powerpc64le-unknown-linux-gnu (#2023)
* refactor: remove unused ci.ts

* feat(target): add support for powerpc64le-unknown-linux-gnu
2024-04-09 11:27:48 +08:00
翠 / green
7ae562352a
feat(cli): add support for armv7-unknown-linux-muslebihf (#2019) 2024-04-08 21:04:57 +08:00
翠 / green
71a528535a
fix(napi): create_bigint_from_*128 returned incorrect word_count (#2024)
The value of `word_count` was inconsistent between the node side and rust side when calling `create_bigint_from_i128`/`create_bigint_from_u128`.
2024-04-08 10:43:23 +09:00
dependabot[bot]
c87944c7f4
chore(deps-dev): bump vite from 5.1.4 to 5.1.7 (#2025) 2024-04-05 08:57:45 +09:00
renovate[bot]
e4ad4767ef
fix(deps): update dependency emnapi to v1.1.1 (#2017)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-30 10:44:57 +00:00
LongYinan
f5b6854731
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.45
2024-03-28 11:54:21 +08:00
LongYinan
77399ff130
fix(cli): wasi Node.js worker template (#2015) 2024-03-28 10:08:17 +08:00
LongYinan
f2e5094345
feat(napi-sys): support load Node-API symbols dynamically (#2014) 2024-03-27 14:35:16 +08:00
LongYinan
0550c56fcf
fix(napi): External should impl FromNapiRef rather than FromNapiValue (#2013)
- Close https://github.com/napi-rs/napi-rs/issues/1994
2024-03-25 15:11:11 +08:00
LongYinan
be610c9353
style: clippy fix (#2012) 2024-03-23 19:35:58 +08:00
Louis
15521fb90f
fix(napi): no panic when caller stops listening (#2010)
This fix is similar to the one in 5b5f616d81.

In both the then_callback & catch_callback, expect was being called in case
the send failed. This means that if we call a function that returns a promise
and the received gets closed (the calling thread stopped at the wrong time),
this will panic.

In such scenarios, it is fine not to panic. If the receiver doesn't care about
the output, we should just let it be.
2024-03-22 22:03:19 +08:00
LongYinan
35b9637151
chore(release): publish
- @napi-rs/cli@3.0.0-alpha.44
 - @napi-rs/wasm-runtime@0.1.2
2024-03-21 15:08:50 +08:00
LongYinan
6a29446dfb
chore(wasm-runtime): upgrade emnapi (#2008) 2024-03-21 14:41:05 +08:00
LongYinan
2a7c000275
Release independent packages
- napi@3.0.0-alpha.0
- napi-derive@3.0.0-alpha.0
2024-03-20 22:46:59 +08:00
renovate[bot]
e2b1a3e3d9
fix(deps): update dependency emnapi to v1.1.0 (#2006)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-20 22:30:58 +08:00
LongYinan
13651c5ff1
chore(napi): add Send and Sync to Reference (#2007) 2024-03-20 22:30:45 +08:00
LongYinan
4719caa643
feat(napi): support Return generic of ThreadsafeFunction (#1997)
* feat(napi): support to use tuple with either (#1993)

`Either` uses `ValidateNapiValue` + `TypeName` to validate and report error on value not being matched. So there's no way to remove these super traits from it. So I implemented these types to `Tuple` types.

* feat(napi): support `Return` generic of ThreadsafeFunction

* depracate JsFunction

* CalleeHandled tsfn should handle Result in callback

* Pass env to call_with_return_value callback

* Fix compile

* clippy fix

* Fix electron test

* Function args

---------

Co-authored-by: Hana <andywangsy@gmail.com>
2024-03-20 21:37:08 +08:00
Louis
693f0ac269
feat(napi): implement From<String> for Buffer (#2002) 2024-03-17 22:43:01 +08:00
dependabot[bot]
50623ca26b
chore(deps): bump follow-redirects from 1.15.5 to 1.15.6 (#2004)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
<details>
<summary>Commits</summary>
<ul>
<li><a href="35a517c586"><code>35a517c</code></a> Release version 1.15.6 of the npm package.</li>
<li><a href="c4f847f851"><code>c4f847f</code></a> Drop Proxy-Authorization across hosts.</li>
<li><a href="8526b4a1b2"><code>8526b4a</code></a> Use GitHub for disclosure.</li>
<li>See full diff in <a href="https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.15.5&new-version=1.15.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/napi-rs/napi-rs/network/alerts).

</details>
2024-03-17 16:04:41 +08:00
Hana
97746b79a9
feat(napi): support to use tuple with either (#1993)
`Either` uses `ValidateNapiValue` + `TypeName` to validate and report error on value not being matched. So there's no way to remove these super traits from it. So I implemented these types to `Tuple` types.
2024-03-13 13:29:06 +08:00
Andrew Toth
6b1058a268
feat(napi-derive): add optional enum_string case conversion (#1995) 2024-03-11 20:10:00 +08:00