diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 933453d..5513256 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,8 +42,6 @@ jobs: RUSTDOCFLAGS: "-D warnings" - run: cargo package --locked - run: npm run check:wasm - env: - RUSTDOCFLAGS: "-D warnings" - run: npm run build:wasm # Upload the built pkg/ files for the cross-OS matrix. - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 @@ -94,6 +92,8 @@ jobs: node-version-file: ".node-version" cache: "npm" - run: cargo build --locked --release + env: + RUSTFLAGS: "-D warnings" # Check that Cargo built the native dynamic library for this OS. - run: node --input-type=module -e "import assert from 'node:assert/strict'; import fs from 'node:fs'; const stat = fs.statSync(process.env.CDYLIB); assert.ok(stat.isFile() && stat.size > 0);" env: diff --git a/AGENTS.md b/AGENTS.md index 748604b..c7c1ba7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -93,7 +93,7 @@ this file, rustdoc, code comments, TypeScript comments and commit messages. Run these Cargo checks in a POSIX shell (`sh`, `bash` or `zsh`): ```sh -cargo build --locked --release +cargo rustc --locked --lib --release -- -D warnings cargo fmt --check cargo clippy --locked --lib -- -D warnings RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps @@ -105,13 +105,12 @@ RUSTDOCFLAGS="-D warnings" cargo doc --locked --release --no-deps --target wasm3 If you run `cargo package --locked` before a commit, add `--allow-dirty`. -In PowerShell on Windows, set `RUSTDOCFLAGS` in the environment before `cargo doc` and `npm run check:wasm`: +In PowerShell on Windows, set `RUSTDOCFLAGS` in the environment before `cargo doc`: ```powershell $env:RUSTDOCFLAGS = "-D warnings" cargo doc --locked --no-deps cargo doc --locked --release --no-deps --target wasm32-unknown-unknown --features wasm -npm run check:wasm Remove-Item Env:RUSTDOCFLAGS ``` @@ -125,7 +124,7 @@ checks the `tunelet` and `@bytelandtechnology/tunelet` archives: ```sh npm ci -RUSTDOCFLAGS="-D warnings" npm run check:wasm +npm run check:wasm npm run verify:pack ``` diff --git a/README.md b/README.md index 66060d8..1378c44 100644 --- a/README.md +++ b/README.md @@ -617,10 +617,10 @@ To build the crate and check the format, the lints, the documentation and the archive, run these commands: ```sh -cargo build --locked --release +cargo rustc --locked --lib --release -- -D warnings cargo fmt --check cargo clippy --locked --lib -- -D warnings -cargo doc --locked --no-deps +cargo rustdoc --locked --lib -- -D warnings cargo package --locked ``` @@ -630,7 +630,7 @@ these commands: ```sh rustup target add wasm32-unknown-unknown cargo clippy --locked --release --lib --target wasm32-unknown-unknown --features wasm -- -D warnings -cargo doc --locked --release --no-deps --target wasm32-unknown-unknown --features wasm +cargo rustdoc --locked --release --lib --target wasm32-unknown-unknown --features wasm -- -D warnings ``` Native Rust builds and these Wasm checks use Cargo and do not need Node.js diff --git a/package.json b/package.json index 3758794..7718ec4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "build": "npm run build:wasm && npm run build:ts", "build:wasm": "wasm-pack build --target web --out-dir pkg --release --no-pack --features wasm --locked && node scripts/postbuild-wasm.mjs && node scripts/normalize-jsdoc.mjs", "build:ts": "tsc", - "check:wasm": "cargo clippy --locked --release --lib --target wasm32-unknown-unknown --features wasm -- -D warnings && cargo doc --locked --release --no-deps --target wasm32-unknown-unknown --features wasm", + "check:wasm": "cargo clippy --locked --release --lib --target wasm32-unknown-unknown --features wasm -- -D warnings && cargo rustdoc --locked --release --lib --target wasm32-unknown-unknown --features wasm -- -D warnings", "prepack": "npm run build", "prepare": "git config core.hooksPath .githooks || true", "verify:pack": "node scripts/verify-pack.mjs"