Skip to content

Commit ee8b960

Browse files
authored
Merge branch 'master' into build-examples
2 parents 4e731f8 + b41a957 commit ee8b960

File tree

15 files changed

+109
-92
lines changed

15 files changed

+109
-92
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions-rs/clippy-check@v1
3030
with:
3131
token: ${{ secrets.GITHUB_TOKEN }}
32-
args: --all-targets -- -D warnings
32+
args: --all-targets
3333

3434
- name: Setup | Toolchain (rustfmt)
3535
uses: actions-rs/toolchain@v1

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe
1414
- Updated gloo-worker example to use gloo-worker crate v2.1.
1515
- Our website (trunkrs.dev) now only updates on new releases.
1616
- Additional attributes are now passed through script tags (fixes #429)
17+
- Updated internal http stack to axum v0.6.0.
18+
- Updated CLI argument parser to clap v0.4.
1719
### fixed
1820
- Nested WS proxies - if `backend=ws://localhost:8000/ws` is set, queries for `ws://localhost:8080/ws/entityX` will be linked with `ws://localhost:8000/ws/entityX`
1921
- Updated all dependencies in both Trunk and its examples, to fix currently open security advisories for old dependencies.

Cargo.lock

Lines changed: 32 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ panic = "abort"
1818
[dependencies]
1919
ansi_term = "0.12"
2020
anyhow = "1"
21-
axum = { version = "0.5", features = ["ws"] }
21+
axum = { version = "0.6", features = ["ws"] }
2222
bytes = "1"
2323
cargo-lock = "8"
2424
cargo_metadata = "0.15"
25-
clap = { version = "3", features = ["derive", "env"] }
25+
clap = { version = "4", features = ["derive", "env"] }
2626
console = "0.15"
2727
directories = "4"
2828
dunce = "1"

src/cmd/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use crate::config::{ConfigOpts, ConfigOptsBuild};
88

99
/// Build the Rust WASM app and all of its assets.
1010
#[derive(Clone, Debug, Args)]
11-
#[clap(name = "build")]
11+
#[command(name = "build")]
1212
pub struct Build {
13-
#[clap(flatten)]
13+
#[command(flatten)]
1414
pub build: ConfigOptsBuild,
1515
}
1616

src/cmd/clean.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ use crate::tools::cache_dir;
1111

1212
/// Clean output artifacts.
1313
#[derive(Args)]
14-
#[clap(name = "clean")]
14+
#[command(name = "clean")]
1515
pub struct Clean {
16-
#[clap(flatten)]
16+
#[command(flatten)]
1717
pub clean: ConfigOptsClean,
1818
/// Optionally clean any cached tools used by Trunk
1919
///
2020
/// These tools are cached in a platform dependent "projects" dir. Removing them will cause
2121
/// them to be downloaded by Trunk next time they are needed.
22-
#[clap(short, long)]
22+
#[arg(short, long)]
2323
pub tools: bool,
2424
}
2525

src/cmd/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use crate::config::ConfigOpts;
77

88
/// Trunk config controls.
99
#[derive(Clone, Debug, Args)]
10-
#[clap(name = "config")]
10+
#[command(name = "config")]
1111
pub struct Config {
12-
#[clap(subcommand)]
12+
#[command(subcommand)]
1313
action: ConfigSubcommands,
1414
}
1515

src/cmd/serve.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ use crate::serve::ServeSystem;
99

1010
/// Build, watch & serve the Rust WASM app and all of its assets.
1111
#[derive(Args)]
12-
#[clap(name = "serve")]
12+
#[command(name = "serve")]
1313
pub struct Serve {
14-
#[clap(flatten)]
14+
#[command(flatten)]
1515
pub build: ConfigOptsBuild,
16-
#[clap(flatten)]
16+
#[command(flatten)]
1717
pub watch: ConfigOptsWatch,
18-
#[clap(flatten)]
18+
#[command(flatten)]
1919
pub serve: ConfigOptsServe,
2020
}
2121

src/cmd/watch.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use crate::watch::WatchSystem;
99

1010
/// Build & watch the Rust WASM app and all of its assets.
1111
#[derive(Args)]
12-
#[clap(name = "watch")]
12+
#[command(name = "watch")]
1313
pub struct Watch {
14-
#[clap(flatten)]
14+
#[command(flatten)]
1515
pub build: ConfigOptsBuild,
16-
#[clap(flatten)]
16+
#[command(flatten)]
1717
pub watch: ConfigOptsWatch,
1818
}
1919

src/common.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Common functionality and types.
22
3+
use std::convert::Infallible;
34
use std::ffi::OsStr;
45
use std::fmt::Debug;
56
use std::fs::Metadata;
@@ -22,10 +23,10 @@ static CWD: Lazy<PathBuf> =
2223
Lazy::new(|| std::env::current_dir().expect("error getting current dir"));
2324

2425
/// Ensure the given value for `--public-url` is formatted correctly.
25-
pub fn parse_public_url(val: &str) -> String {
26+
pub fn parse_public_url(val: &str) -> Result<String, Infallible> {
2627
let prefix = if !val.starts_with('/') { "/" } else { "" };
2728
let suffix = if !val.ends_with('/') { "/" } else { "" };
28-
format!("{}{}{}", prefix, val, suffix)
29+
Ok(format!("{}{}{}", prefix, val, suffix))
2930
}
3031

3132
/// A utility function to recursively copy a directory.

0 commit comments

Comments
 (0)