-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xtask task for custom wasm-bindgen build
- Loading branch information
Showing
53 changed files
with
354 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[alias] | ||
xtask = "run --package xtask --" | ||
|
||
[target.wasm32-unknown-unknown] | ||
runner = "wasm-bindgen-test-runner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ Cargo.lock | |
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
node_modules/** | ||
**/node_modules/** | ||
.direnv/** | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,34 @@ | ||
[package] | ||
name = "diesel-wasm-sqlite" | ||
version = "0.0.1" | ||
edition = "2021" | ||
[workspace] | ||
members = [ | ||
"diesel-wasm-sqlite", | ||
"xtask" | ||
] | ||
resolver = "2" | ||
authors = ["XMTP Labs <[email protected]>"] | ||
description = "SQLite WebAssembly backend for Diesel" | ||
homepage = "https://xmtp.org/" | ||
repository = "https://github.com/xmtp/libxmtp" | ||
license = "MIT" | ||
keywords = ["orm", "database", "sql", "wasm"] | ||
categories = ["database", "wasm"] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
targets = ["wasm32-unknown-unknown"] | ||
[workspace.package] | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
talc = { version = "4.4", default-features = false, features = ["lock_api"] } | ||
diesel = { version = "2.2", features = ["i-implement-a-third-party-backend-and-opt-into-breaking-changes"] } | ||
diesel_derives = "2.2" | ||
[workspace.dependencies] | ||
wasm-bindgen = "=0.2.95" | ||
wasm-bindgen-test = "=0.3.45" | ||
wasm-bindgen-futures = "0.4" | ||
serde-wasm-bindgen = "0.6" | ||
talc = { version = "4.4", default-features = false } | ||
web-sys = { version = "0.3", features = ["console"] } | ||
js-sys = { version = "0.3" } | ||
diesel = { version = "2.2" } | ||
diesel_derives = { version = "2.2", default-features = false } | ||
diesel_migrations = { version = "2.2", default-features = false } | ||
tracing = { version = "0.1", default-features = false } | ||
tokio = { version = "1.38", default-features = false, features = ["sync"] } | ||
serde = { version = "1.0", default-features = false, features = ["derive"] } | ||
serde-wasm-bindgen = "0.6" | ||
thiserror = "1" | ||
|
||
[dev-dependencies] | ||
wasm-bindgen-test = "=0.3.45" | ||
tracing-wasm = { version = "0.2", default-features = false } | ||
tracing-subscriber = { version = "0.3", default-features = false } | ||
console_error_panic_hook = { version = "0.1"} | ||
tokio = { version = "1.38", default-features = false } | ||
serde = { version = "1.0", default-features = false } | ||
thiserror = { version = "1" } | ||
chrono = { version = "0.4", default-features = false } | ||
rand = "0.8" | ||
getrandom = { version = "0.2", features = ["js"] } | ||
web-sys = { version = "0.3", features = ["console"] } | ||
chrono = { version = "0.4", features = ["wasmbind", "serde"] } | ||
diesel_migrations = "2.2" | ||
diesel = { version = "2.2", features = ["chrono"]} | ||
tracing-wasm = { version = "0.2" } | ||
tracing-subscriber = { version = "0.3", features = ["env-filter", "tracing-log"] } | ||
getrandom = "0.2" | ||
|
||
[patch.crates-io] | ||
diesel = { git = "https://github.com/diesel-rs/diesel", branch = "master" } | ||
|
@@ -50,16 +39,6 @@ diesel_migrations = { git = "https://github.com/diesel-rs/diesel", branch = "mas | |
opt-level = "s" | ||
lto = true | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
default = [] | ||
r2d2 = ["diesel/r2d2"] | ||
# enables a `DebugQueryWrapper` for diesel | ||
# but is unsafe because of mem::transmute | ||
unsafe-debug-query = [] | ||
|
||
[build] | ||
target = "wasm32-unknown-unknown" | ||
|
||
# for color-eyre to build faster in debug | ||
[profile.dev.package.backtrace] | ||
opt-level = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[package] | ||
name = "diesel-wasm-sqlite" | ||
edition = "2021" | ||
resolver = "2" | ||
authors = ["XMTP Labs <[email protected]>"] | ||
description = "SQLite WebAssembly backend for Diesel" | ||
homepage = "https://xmtp.org/" | ||
repository = "https://github.com/xmtp/diesel-wasm-sqlite" | ||
license = "MIT" | ||
keywords = ["orm", "database", "sql", "wasm"] | ||
categories = ["database", "wasm"] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
targets = ["wasm32-unknown-unknown"] | ||
|
||
[dependencies] | ||
talc = { workspace = true, default-features = false, features = ["lock_api"] } | ||
diesel = { workspace = true, features = ["i-implement-a-third-party-backend-and-opt-into-breaking-changes"] } | ||
diesel_derives.workspace = true | ||
wasm-bindgen.workspace = true | ||
wasm-bindgen-futures.workspace = true | ||
js-sys.workspace = true | ||
tracing.workspace = true | ||
tokio = { workspace = true, default-features = false, features = ["sync"] } | ||
serde = { workspace = true, default-features = false, features = ["derive"] } | ||
serde-wasm-bindgen.workspace = true | ||
thiserror.workspace = true | ||
|
||
tracing-wasm = { workspace = true, optional = true } | ||
tracing-subscriber = { workspace = true, features = ["env-filter", "tracing-log"], optional = true } | ||
web-sys = { workspace = true, features = ["console"], optional = true } | ||
console_error_panic_hook = { workspace = true, optional = true} | ||
|
||
[dev-dependencies] | ||
wasm-bindgen-test.workspace = true | ||
console_error_panic_hook = { workspace = true} | ||
rand.workspace = true | ||
getrandom = { workspace = true, features = ["js"] } | ||
web-sys = { workspace = true, features = ["console"] } | ||
chrono = { workspace = true, features = ["wasmbind", "serde"] } | ||
diesel_migrations.workspace = true | ||
diesel = { workspace = true, features = ["chrono"]} | ||
tracing-wasm = { workspace = true } | ||
tracing-subscriber = { workspace = true, features = ["env-filter", "tracing-log"] } | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
default = [] | ||
r2d2 = ["diesel/r2d2"] | ||
# enables a `DebugQueryWrapper` for diesel | ||
# but is unsafe because of mem::transmute | ||
unsafe-debug-query = [] | ||
test-utils = ["unsafe-debug-query", "tracing-wasm", "tracing-subscriber", "console_error_panic_hook", "web-sys"] | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#[cfg(any(feature = "test-utils", test))] | ||
pub use test::*; | ||
|
||
#[cfg(any(feature = "test-utils", test))] | ||
mod test { | ||
use tokio::sync::OnceCell; | ||
static INIT: OnceCell<()> = OnceCell::const_new(); | ||
|
||
pub async fn init() { | ||
INIT.get_or_init(|| async { | ||
web_sys::console::log_1(&"INIT".into()); | ||
let config = tracing_wasm::WASMLayerConfigBuilder::default() | ||
.set_console_config(tracing_wasm::ConsoleConfig::ReportWithoutConsoleColor) | ||
.build(); | ||
tracing_wasm::set_as_global_default_with_config(config); | ||
console_error_panic_hook::set_once(); | ||
}) | ||
.await; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
curl | ||
wasm-pack | ||
twiggy | ||
wasm-bindgen-cli | ||
# wasm-bindgen-cli | ||
binaryen | ||
linters | ||
cargo-nextest | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "xtask" | ||
edition = "2021" | ||
version.workspace = true | ||
|
||
[dependencies] | ||
color-eyre = "0.6" | ||
xshell = "0.2" | ||
tracing = { workspace = true } | ||
tracing-subscriber = { workspace = true, features = [ "env-filter" ] } |
Oops, something went wrong.