@rust-js/resources 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builtins/Cargo.toml +20 -0
- package/builtins/build.sh +20 -0
- package/builtins/src/lib.rs +264 -0
- package/package.json +32 -0
- package/react/Cargo.toml +27 -0
- package/react/build.rs +59 -0
- package/react/build.sh +44 -0
- package/react/cfg.js +60 -0
- package/react/src/dom.rs +542 -0
- package/react/src/elements.rs +8556 -0
- package/react/src/event.rs +238 -0
- package/react/src/lib.rs +1065 -0
- package/react/versions.json +2103 -0
- package/rust-toolchain.toml +4 -0
- package/serde/Cargo.lock +107 -0
- package/serde/Cargo.toml +15 -0
- package/serde/src/lib.rs +1 -0
- package/webapi/Cargo.toml +23 -0
- package/webapi/build.sh +32 -0
- package/webapi/src/lib.rs +6822 -0
package/serde/Cargo.lock
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "itoa"
|
|
7
|
+
version = "1.0.18"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "memchr"
|
|
13
|
+
version = "2.8.3"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "proc-macro2"
|
|
19
|
+
version = "1.0.107"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
22
|
+
dependencies = [
|
|
23
|
+
"unicode-ident",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "quote"
|
|
28
|
+
version = "1.0.47"
|
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"proc-macro2",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "rust-js-serde"
|
|
37
|
+
version = "0.0.0"
|
|
38
|
+
dependencies = [
|
|
39
|
+
"serde",
|
|
40
|
+
"serde_json",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[[package]]
|
|
44
|
+
name = "serde"
|
|
45
|
+
version = "1.0.229"
|
|
46
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
47
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
48
|
+
dependencies = [
|
|
49
|
+
"serde_core",
|
|
50
|
+
"serde_derive",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "serde_core"
|
|
55
|
+
version = "1.0.229"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
58
|
+
dependencies = [
|
|
59
|
+
"serde_derive",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[[package]]
|
|
63
|
+
name = "serde_derive"
|
|
64
|
+
version = "1.0.229"
|
|
65
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
67
|
+
dependencies = [
|
|
68
|
+
"proc-macro2",
|
|
69
|
+
"quote",
|
|
70
|
+
"syn",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "serde_json"
|
|
75
|
+
version = "1.0.151"
|
|
76
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
+
checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
|
|
78
|
+
dependencies = [
|
|
79
|
+
"itoa",
|
|
80
|
+
"memchr",
|
|
81
|
+
"serde",
|
|
82
|
+
"serde_core",
|
|
83
|
+
"zmij",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[[package]]
|
|
87
|
+
name = "syn"
|
|
88
|
+
version = "3.0.6"
|
|
89
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
+
checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
|
|
91
|
+
dependencies = [
|
|
92
|
+
"proc-macro2",
|
|
93
|
+
"quote",
|
|
94
|
+
"unicode-ident",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[[package]]
|
|
98
|
+
name = "unicode-ident"
|
|
99
|
+
version = "1.0.26"
|
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
101
|
+
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
|
|
102
|
+
|
|
103
|
+
[[package]]
|
|
104
|
+
name = "zmij"
|
|
105
|
+
version = "1.0.23"
|
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
package/serde/Cargo.toml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# serde, serde_derive and serde_json, built with rust-js's pinned toolchain,
|
|
2
|
+
# for a crate rust-js compiles to depend on (ADR 0077). `serde/build.sh`
|
|
3
|
+
# builds them and prints the `--extern` flags that find them.
|
|
4
|
+
[package]
|
|
5
|
+
name = "rust-js-serde"
|
|
6
|
+
version = "0.0.0"
|
|
7
|
+
edition = "2024"
|
|
8
|
+
publish = false
|
|
9
|
+
|
|
10
|
+
[dependencies]
|
|
11
|
+
serde = { version = "1", features = ["derive"] }
|
|
12
|
+
serde_json = "1"
|
|
13
|
+
|
|
14
|
+
# Standalone: not part of the rust-js package one directory up.
|
|
15
|
+
[workspace]
|
package/serde/src/lib.rs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//! Nothing: this package only builds its dependencies (see `Cargo.toml`).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# The webapi crate as a Cargo dependency (ADR 0101): rustc checks it, as
|
|
2
|
+
# webapi/build.sh does, and rust-js reads its metadata (ADR 0024).
|
|
3
|
+
[package]
|
|
4
|
+
name = "rust-js-webapi"
|
|
5
|
+
version = "0.0.1"
|
|
6
|
+
edition = "2024"
|
|
7
|
+
description = "The web platform for rust-js programs: DOM bindings generated from WebIDL"
|
|
8
|
+
license = "MIT"
|
|
9
|
+
repository = "https://github.com/rust-js-lang/rust-js"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
# Its Rust, not the repository's tools that build or generate it.
|
|
12
|
+
include = ["src", "README.md"]
|
|
13
|
+
|
|
14
|
+
[lib]
|
|
15
|
+
name = "webapi"
|
|
16
|
+
path = "src/lib.rs"
|
|
17
|
+
|
|
18
|
+
[dependencies]
|
|
19
|
+
js = { package = "rust-js-builtins", path = "../builtins", version = "~0.0.1" }
|
|
20
|
+
|
|
21
|
+
# rust-js compiles with `--cfg=rust_js` (ADR 0113): a `cfg` Cargo checks for.
|
|
22
|
+
[lints.rust]
|
|
23
|
+
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(rust_js)"] }
|
package/webapi/build.sh
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Compile the webapi crate's metadata, which is all programs need (ADR 0024),
|
|
3
|
+
# and the js crate's beside it, which it uses (ADR 0102), for the target
|
|
4
|
+
# rust-js checks programs for (ADR 0090):
|
|
5
|
+
#
|
|
6
|
+
# webapi/build.sh -o target/libwebapi.rmeta
|
|
7
|
+
#
|
|
8
|
+
# Then compile a program with
|
|
9
|
+
# `rust-js app.rs -- --extern webapi=<that file> --extern js=<dir>/libjs.rmeta -L <dir>`.
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
[ "${1:-}" = "-o" ] && [ -n "${2:-}" ] || {
|
|
12
|
+
echo "usage: webapi/build.sh -o <dir>/libwebapi.rmeta [rustc flags]" >&2
|
|
13
|
+
exit 1
|
|
14
|
+
}
|
|
15
|
+
out=$2
|
|
16
|
+
shift 2
|
|
17
|
+
mkdir -p "$(dirname "$out")"
|
|
18
|
+
dir=$(cd "$(dirname "$out")" && pwd)
|
|
19
|
+
cd "$(dirname "$0")"
|
|
20
|
+
../builtins/build.sh -o "$dir/libjs.rmeta" "$@"
|
|
21
|
+
target=(--target=wasm32-unknown-unknown)
|
|
22
|
+
for arg in "$@"; do
|
|
23
|
+
case "$arg" in --target | --target=*) target=() ;; esac
|
|
24
|
+
done
|
|
25
|
+
# rust-js compiles it, as rustc with rust-js's tool, `rust_js`, known (ADR
|
|
26
|
+
# 0112): $RUST_JS_COMPILER, or this repository's own build.
|
|
27
|
+
compiler=${RUST_JS_COMPILER:-$PWD/../target/debug/rust-js}
|
|
28
|
+
# A packaged one is a JS launcher, run by the JS runtime the build is.
|
|
29
|
+
rust_js=("$compiler")
|
|
30
|
+
case "$compiler" in *.js) rust_js=("${RUST_JS_JS_RUNTIME:-node}" "$compiler") ;; esac
|
|
31
|
+
exec "${rust_js[@]}" --rustc --edition=2024 --crate-type=lib --crate-name=webapi --emit=metadata ${target[@]+"${target[@]}"} src/lib.rs \
|
|
32
|
+
--extern js="$dir/libjs.rmeta" -o "$dir/$(basename "$out")" "$@"
|