Skip to content

Commit

Permalink
Update dependencies and cleanup version (#74)
Browse files Browse the repository at this point in the history
* `cargo update` all dependencies

* Update Vite to v5 and fix proxy target to ipv4

* Run `npm update`

* Make test less obnoxious

* Fix Dockerfile warnings about mismatched case
  • Loading branch information
ekzhang authored Jul 18, 2024
1 parent 14dde3c commit cf94862
Show file tree
Hide file tree
Showing 9 changed files with 3,071 additions and 4,347 deletions.
1,454 changes: 843 additions & 611 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"rustpad-server",
"rustpad-wasm",
]
resolver = "2"
members = ["rustpad-server", "rustpad-wasm"]
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM rust:alpine as backend
FROM rust:alpine AS backend
WORKDIR /home/rust/src
RUN apk --no-cache add musl-dev openssl-dev
COPY . .
RUN cargo test --release
RUN cargo build --release

FROM amd64/rust:alpine as wasm
FROM amd64/rust:alpine AS wasm
WORKDIR /home/rust/src
RUN apk --no-cache add curl musl-dev
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . .
RUN wasm-pack build --target web rustpad-wasm

FROM amd64/node:lts-alpine as frontend
FROM amd64/node:lts-alpine AS frontend
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
COPY --from=wasm /home/rust/src/rustpad-wasm/pkg rustpad-wasm/pkg
Expand Down
5,934 changes: 2,216 additions & 3,718 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "rustpad",
"type": "module",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down Expand Up @@ -28,7 +29,7 @@
"@vitejs/plugin-react": "^1.1.3",
"monaco-editor": "^0.31.1",
"prettier": "2.5.1",
"typescript": "~4.5.4",
"vite": "^2.7.7"
"typescript": "~5.5.3",
"vite": "^5.3.4"
}
}
2 changes: 1 addition & 1 deletion rustpad-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pretty_env_logger = "0.4.0"
rand = "0.8.3"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.64"
sqlx = { version = "0.5.9", features = ["runtime-tokio-rustls", "sqlite"] }
sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "sqlite"] }
tokio = { version = "1.6.1", features = ["full", "test-util"] }
tokio-stream = "0.1.6"
warp = "0.3.1"
Expand Down
1 change: 1 addition & 0 deletions rustpad-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ impl Drop for Document {
}
}

#[allow(dead_code)]
#[derive(Debug)]
struct CustomReject(anyhow::Error);

Expand Down
7 changes: 1 addition & 6 deletions rustpad-server/tests/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,11 @@ async fn test_persist() -> Result<()> {

// Give SQLite some time to actually update the database.
time::resume();
time::sleep(Duration::from_millis(50)).await;
time::sleep(Duration::from_millis(150)).await;
time::pause();

time::advance(3 * hour).await;
expect_text(&filter, "persist", "hello").await;

for _ in 0..50 {
time::advance(10000 * hour).await;
expect_text(&filter, "persist", "hello").await;
}

Ok(())
}
2 changes: 1 addition & 1 deletion vite.config.js → vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineConfig({
server: {
proxy: {
"/api": {
target: "http://localhost:3030",
target: "http://127.0.0.1:3030",
changeOrigin: true,
secure: false,
ws: true,
Expand Down

0 comments on commit cf94862

Please sign in to comment.