diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37a4e74..fd96f1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,17 +9,17 @@ on: permissions: contents: read -env: - RUSTFLAGS: '-Dwarnings' - jobs: - test: - name: Test + lint: + name: Lint runs-on: ubuntu-latest + env: + RUSTFLAGS: '-Dwarnings' + steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -27,11 +27,40 @@ jobs: components: clippy, rustfmt target: wasm32-unknown-unknown + - name: Install Cargo Binary Install + uses: cargo-bins/cargo-binstall@main + + - name: Install crates + run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort + + - name: Lint + run: cargo clippy --locked + + - name: Check dependencies + run: cargo deny check + + - name: Check unused dependencies + run: cargo machete + + - name: Check manifest formatting + run: cargo sort --workspace --check . + - name: Check formatting run: cargo fmt --all --check - - name: Lint - run: cargo clippy --all-features --locked + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Set up Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy, rustfmt + target: wasm32-unknown-unknown - name: Test run: cargo test --all-features --locked --release diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 639a14e..7e39cd4 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -25,7 +25,6 @@ jobs: - name: Set up Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: - components: clippy, rustfmt target: wasm32-unknown-unknown - name: Install Cargo Binary Install @@ -35,7 +34,7 @@ jobs: run: cargo binstall --force -y trunk - name: Install Node.js dependencies - run: npm install + run: npm ci - name: Build Website run: trunk build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 030d177..d43de8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,39 @@ repos: + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + language: node + additional_dependencies: + - prettier@^3.6.2 + - repo: https://github.com/doublify/pre-commit-rust rev: v1.0 hooks: - id: fmt - id: clippy - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + - repo: https://github.com/EmbarkStudios/cargo-deny + rev: 0.18.4 hooks: - - id: prettier - language: node - additional_dependencies: - - prettier@^3.4.1 + - id: cargo-deny + + # - repo: https://github.com/bnjbvr/cargo-machete + # rev: ba1bcd4 + # hooks: + # - id: cargo-machete + - repo: local + hooks: + - id: cargo-machete + name: cargo-machete + language: rust + entry: cargo machete + types: [file, toml] + files: Cargo\.(toml|lock) + pass_filenames: false + + - repo: https://github.com/DevinR528/cargo-sort + rev: v2.0.1 + hooks: + - id: cargo-sort + args: ['.', '--workspace'] diff --git a/Cargo.lock b/Cargo.lock index 320dcda..9cbd07d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,6 +53,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bitflags" +version = "2.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" + [[package]] name = "bumpalo" version = "3.17.0" @@ -677,6 +683,17 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "io-uring" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + [[package]] name = "itoa" version = "1.0.15" @@ -720,6 +737,17 @@ dependencies = [ "adler2", ] +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + [[package]] name = "nanoid" version = "0.4.0" @@ -983,14 +1011,6 @@ dependencies = [ "yew-style", ] -[[package]] -name = "radix-yew-icons" -version = "0.0.2" -source = "git+https://github.com/RustForWeb/radix.git#dae3f19dbe2ef2fc9142659b31f093c47457fbdb" -dependencies = [ - "yew", -] - [[package]] name = "radix-yew-id" version = "0.0.2" @@ -1219,7 +1239,6 @@ dependencies = [ "console_error_panic_hook", "console_log", "log", - "radix-yew-icons", "radix-yew-themes", "yew", "yew-router", @@ -1357,12 +1376,16 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.1" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", + "io-uring", + "libc", + "mio", "pin-project-lite", + "slab", ] [[package]] @@ -1529,6 +1552,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index 28b108b..66f54e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/RustForWeb/rustforweb.github.io" console_error_panic_hook = "0.1.7" console_log = "1.0.0" log = "0.4.22" -radix-yew-icons = { git = "https://github.com/RustForWeb/radix.git" } +# radix-yew-icons = { git = "https://github.com/RustForWeb/radix.git" } radix-yew-themes = { git = "https://github.com/RustForWeb/radix.git" } yew = { version = "0.21.0", features = ["csr"] } yew-router = "0.18.0" diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..2e3b7c4 --- /dev/null +++ b/deny.toml @@ -0,0 +1,23 @@ +[graph] +all-features = true + +[advisories] +ignore = [ + { id = "RUSTSEC-2024-0370", reason = "No safe upgrade is available `proc-macro-error`." }, +] + +[bans] +allow-wildcard-paths = true +multiple-versions = "allow" +wildcards = "deny" + +[licenses] +allow = ["Apache-2.0", "BSL-1.0", "MIT", "Unicode-3.0", "Zlib"] +confidence-threshold = 1.0 + +[sources] +unknown-git = "deny" +unknown-registry = "deny" + +[sources.allow-org] +github = ["RustForWeb"] diff --git a/package-lock.json b/package-lock.json index adf5ef0..6e6e2a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "license": "MIT", "devDependencies": { "@radix-ui/themes": "^3.1.6", - "prettier": "^3.4.1" + "prettier": "^3.6.2" }, "engines": { "node": ">=20" @@ -1482,11 +1482,10 @@ } }, "node_modules/prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", - "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, - "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index c8f3c6d..45280ea 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": {}, "devDependencies": { "@radix-ui/themes": "^3.1.6", - "prettier": "^3.4.1" + "prettier": "^3.6.2" }, "engines": { "node": ">=20"