Compare commits

..
25 Commits
Author SHA1 Message Date
prorail b060ced878 build: Docs ook met release vlag bouwen
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 17:34:17 +02:00
prorail 463fac575a build: Release vlag voor cargo check
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 17:31:59 +02:00
prorail bc231a8e91 build: Cargo check meer gespecificeerd
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 17:29:24 +02:00
prorail 5f864a86f8 build: Trailing forward slash voor artifact folder
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 17:26:01 +02:00
prorail 930b896d58 docs: README naar docs laten verwijzen
gitea/double-pendulum/pipeline/head There was a failure building this commit
2026-09-08 17:23:05 +02:00
prorail c3e6ea7b88 build: Docs bouwen en publiceren 2026-09-08 17:22:50 +02:00
prorail 61ca20a5e1 docs: Root lib docs toegevoegd voor nu 2026-09-08 17:13:18 +02:00
prorail 6ee793765b chore: wasm build dirs in gitignore
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 16:53:06 +02:00
prorail 0d04ed5f12 build: Alle inhoud van de pkg folder kopiëren, niet het hele ding
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 16:48:15 +02:00
prorail 9d942b1ea5 build: Iets nettere deploy setup
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 16:45:35 +02:00
prorail b05af111ad build: Fix archive path
gitea/double-pendulum/pipeline/head There was a failure building this commit
2026-09-08 16:40:07 +02:00
prorail 96e8169707 build: Fixed aanhalingsteken
gitea/double-pendulum/pipeline/head There was a failure building this commit
2026-09-08 16:35:34 +02:00
prorail 5d462f9963 build: Andere bouwmanier proberen
gitea/double-pendulum/pipeline/head There was a failure building this commit
2026-09-08 16:34:32 +02:00
prorail 96d6e69b3a chore: Rust-toolchain gepind 2026-09-08 16:34:14 +02:00
prorail ba06b988af build: Package folder eerst aanmaken
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 16:03:59 +02:00
prorail 855d67b1fa docs: Correctie op readme
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 15:50:47 +02:00
prorail 4e7260ff92 Used internal build tooling to pack index
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-08 14:57:18 +02:00
flip 0630e77b17 docs: Readme uitgebreid
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 18:38:27 +02:00
flip a26c829f58 chore: Pkg pad aangepast
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 18:30:03 +02:00
flip 38fe7b38bd fix: Correcte pad voor gebouwde js-bestand
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 18:12:44 +02:00
flip a8c01e6ad7 build: Index wordt nu ook naar proj web gezet
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 18:01:10 +02:00
flip 61dc5cc9c3 build: Bouwstap van code toegevoegd
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 17:53:49 +02:00
flip 26a9a9b8d0 feat: index.html toegevoegd die gebouwde wasm kan gebruiken
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 17:49:34 +02:00
flip db021cb24b feat: Bouwende wasm content toegevoegd
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 17:37:16 +02:00
flip fbd8c9f990 build: Fix van Jenkinsfile check
gitea/double-pendulum/pipeline/head This commit looks good
2026-09-05 15:27:50 +02:00
10 changed files with 304 additions and 13 deletions
+2
View File
@@ -21,3 +21,5 @@ target/
# Added by cargo
/target
pkg/
Generated
+172
View File
@@ -0,0 +1,172 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "bumpalo"
version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
[[package]]
name = "cfg-if"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "double-pendulum-wasm"
version = "0.1.0"
dependencies = [
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "futures-core"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
[[package]]
name = "futures-task"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
[[package]]
name = "futures-util"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
dependencies = [
"futures-core",
"futures-task",
"pin-project-lite",
"slab",
]
[[package]]
name = "js-sys"
version = "0.3.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e"
dependencies = [
"cfg-if",
"futures-util",
"wasm-bindgen",
]
[[package]]
name = "once_cell"
version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]]
name = "pin-project-lite"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
[[package]]
name = "slab"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "syn"
version = "3.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]]
name = "wasm-bindgen"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e"
dependencies = [
"unicode-ident",
]
[[package]]
name = "web-sys"
version = "0.3.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8"
dependencies = [
"js-sys",
"wasm-bindgen",
]
+10 -1
View File
@@ -1,6 +1,15 @@
[package]
name = "double-pendulum"
authors = ["Philippe Zwietering"]
name = "double-pendulum-wasm"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "0.2.128"
[dependencies.web-sys]
version = "0.3.105"
features = ['Document', 'Element', 'HtmlElement', 'Node', 'Window']
Vendored
+40 -8
View File
@@ -1,13 +1,45 @@
pipeline {
agent any
stages {
stage('Check') {
sh 'cargo check'
}
}
post {
cleanup {
cleanWs()
}
stage('Check') {
steps {
sh 'cargo check -r --target wasm32-unknown-unknown'
sh 'cargo tree -e features --target wasm32-unknown-unknown'
}
}
stage('Build') {
steps {
sh 'wasm-pack build --target web'
archiveArtifacts artifacts: 'pkg/'
}
}
stage('Build docs') {
steps {
sh 'cargo doc -r'
archiveArtifacts artifacts: 'target/doc/'
}
}
stage('Deploy') {
steps {
sh 'rm -r /var/www/zwietering.eu/projects/double-pendulum'
sh 'mkdir /var/www/zwietering.eu/projects/double-pendulum'
sh 'cp -r ./pkg/* /var/www/zwietering.eu/projects/double-pendulum'
}
}
stage('Deploy docs') {
steps {
sh 'cp -r ./target/doc/ /var/www/zwietering.eu/projects/double-pendulum'
}
}
}
post {
cleanup {
cleanWs()
}
}
}
+30 -1
View File
@@ -1,3 +1,32 @@
# double-pendulum
Double Pendulum chaotic sim in rust + webassembly
[Docs](https://zwietering.eu/projects/double-pendulum/doc/double_pendulum_wasm)
<!--toc:start-->
- [double-pendulum](#double-pendulum)
- [Prereqs](#prereqs)
- [Build](#build)
<!--toc:end-->
Double Pendulum chaotic sim in rust + webassembly (WIP)
## Prereqs
- Rust toolchain (`rustup`, `cargo`, `rustc`)
- Install [`wasm-pack`](https://github.com/wasm-bindgen/wasm-pack)
## Build
Package can be built using:
```bash
wasm-pack build --target web
```
Result can be viewed by hosting the directory, e.g. using:
```bash
cd pkg && python -m http.server 8080
```
+11
View File
@@ -0,0 +1,11 @@
use std::fs;
fn main() {
println!("cargo:rerun-if-changed=index.html");
let _ = fs::create_dir_all("pkg");
if let Err(e) = fs::copy("index.html", "pkg/index.html") {
eprintln!("Error: Couldn't copy index.html: {}", e);
}
}
+16
View File
@@ -0,0 +1,16 @@
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
</head>
<body>
<script type="module">
import init from './double_pendulum_wasm.js';
async function run() {
await init();
}
run();
</script>
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.94.0"
targets = ["wasm32-unknown-unknown"]
+20
View File
@@ -0,0 +1,20 @@
//! WASM implementation of a double pendulum simulation
//!
//! See README.md for installation / build instructions.
//! This implementation is just a stub for now.
use wasm_bindgen::prelude::*;
#[wasm_bindgen(start)]
fn main() -> Result<(), JsValue> {
let window = web_sys::window().expect("No global `window` exists");
let document = window.document().expect("No `document` on `window`");
let body = document.body().expect("Document should have a body");
let content = document.create_element("p")?;
content.set_inner_html("Hoi vanuit rust!");
body.append_child(&content)?;
Ok(())
}
-3
View File
@@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}