Skip to content

Commit

Permalink
Support napi v2 (matrix-org#111)
Browse files Browse the repository at this point in the history
* Export a sensible user agent

* Completely rewrite rust portions to be napi v2 compatible

* Format rust files

* Only lint TS files when running lint-node

* Don't include autogenerated typings in the tree

* changelog

* Autofix generated rust dependencies due to a bug in napi@2

* Fix for multiple runs

* Fix format_util file name

* Make script generic

* lint
  • Loading branch information
Half-Shot authored Jan 2, 2022
1 parent 694d508 commit e6dd83a
Show file tree
Hide file tree
Showing 21 changed files with 392 additions and 491 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
node-version: 16
- run: yarn --ignore-scripts
- run: yarn lint
- run: yarn lint:js
lint-rust:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ public/
# Added by cargo
/target

book
# Generated during build
/src/libRs.d.ts

book
185 changes: 142 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "matrix-hookshot"
version = "0.1.0"
version = "1.0.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
napi = {version="1", features=["serde-json"]}
napi-derive = "1"
napi = {version="2", features=["serde-json"]}
napi-derive = "2"
url = "2"
serde_json = "1"
serde = "1"
Expand Down
5 changes: 2 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
extern crate napi_build;

fn main() {
napi_build::setup();
use napi_build::setup;
setup();
}
1 change: 1 addition & 0 deletions changelog.d/111.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update to npai-rs@2
Loading

0 comments on commit e6dd83a

Please sign in to comment.