diff --git a/.dockerignore b/.dockerignore index 710db6d..5b2acce 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,2 @@ # Do not send the `target` dirs to the Docker builder target -cli/target diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f35b288..bcd7949 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,13 @@ updates: schedule: interval: daily time: "03:00" + groups: + dev-dependencies: + dependency-type: "development" + minor-changes: + update-types: + - "minor" + - "patch" open-pull-requests-limit: 10 assignees: - slowli diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml new file mode 100644 index 0000000..972faa1 --- /dev/null +++ b/.github/workflows/build-reusable.yml @@ -0,0 +1,62 @@ +name: Build + +on: + workflow_call: + inputs: + rust_version: + type: string + description: Rust version to use in the build + required: false + default: stable + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ inputs.rust_version }} + components: rustfmt, clippy + - name: Install cargo-deny + uses: baptiste0928/cargo-install@v2 + with: + crate: cargo-deny + version: "^0.14" + + - name: Cache cargo build + uses: actions/cache@v3 + with: + path: target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo + + - name: Format + run: cargo fmt --all -- --check + - name: Clippy + run: cargo clippy --workspace --all-features --all-targets -- -D warnings + - name: Clippy (no features) + run: cargo clippy -p term-transcript --no-default-features --lib + - name: Clippy (features = svg) + run: cargo clippy -p term-transcript --no-default-features --features svg --lib -- -D warnings + - name: Clippy (features = test) + run: cargo clippy -p term-transcript --no-default-features --features test --lib -- -D warnings + + - name: Check dependencies + run: cargo deny --workspace --all-features check + + - name: Run tests + run: cargo test --workspace --all-features --all-targets + - name: Run doc tests + run: cargo test --workspace --all-features --doc + + - name: Generate snapshots + run: ./examples/generate-snapshots.sh + - name: Test CLI tracing + run: | + RUST_LOG=term_transcript=debug \ + cargo run -p term-transcript-cli --all-features -- \ + exec 'echo Hello' |& grep INFO diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d5acd5..23f099d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ env: # Minimum supported Rust version. msrv: 1.66.0 # Nightly Rust necessary for building docs. - nightly: nightly-2022-11-24 + nightly: nightly-2023-09-09 jobs: build-msrv: @@ -29,124 +29,24 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.msrv }} - override: true - - name: Generate lockfile - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile - name: Cache cargo build uses: actions/cache@v3 with: - path: | - target - cli/target + path: target key: ${{ runner.os }}${{ matrix.features }}-msrv-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}${{ matrix.features }}-msrv-cargo - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace ${{ matrix.features }} --all-targets - - name: Run CLI tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=cli/Cargo.toml ${{ matrix.features }} --all-targets + run: cargo test -p term-transcript ${{ matrix.features }} --all-targets - name: Run doc tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace ${{ matrix.features }} --doc + run: cargo test -p term-transcript ${{ matrix.features }} --doc build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt, clippy - - name: Generate lockfile - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile - - - name: Cache cargo build - uses: actions/cache@v3 - with: - path: | - target - cli/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo - - - name: Format - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - name: Clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --all-features --all-targets -- -D warnings - - name: Clippy CLI - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --manifest-path=cli/Cargo.toml --all-features --all-targets -- -D warnings - name: clippy (CLI) - - name: Clippy (no features) - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -p term-transcript --no-default-features --lib - name: clippy (no features) - - name: Clippy (features = svg) - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -p term-transcript --no-default-features --features svg --lib -- -D warnings - name: clippy (features = svg) - - name: Clippy (features = test) - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -p term-transcript --no-default-features --features test --lib -- -D warnings - name: clippy (features = test) - - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-features --all-targets - - name: Run CLI tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=cli/Cargo.toml --all-features --all-targets - - name: Run doc tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-features --doc - - - name: Generate snapshots - run: ./examples/generate-snapshots.sh - - name: Test CLI tracing - run: | - RUST_LOG=term_transcript=debug \ - cargo run --manifest-path=cli/Cargo.toml --all-features -- \ - exec 'echo Hello' |& grep INFO + uses: ./.github/workflows/build-reusable.yml build-docker: needs: @@ -164,7 +64,7 @@ jobs: uses: actions/cache@v3 with: path: target/docker - key: ${{ runner.os }}-docker-buildkit-${{ hashFiles('cli/Cargo.lock') }} + key: ${{ runner.os }}-docker-buildkit-${{ hashFiles('Cargo.lock') }} restore-keys: ${{ runner.os }}-docker-buildkit - name: Install `socat` @@ -268,15 +168,9 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.nightly }} - profile: minimal - override: true - - name: Generate lockfile - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile - name: Cache cargo build uses: actions/cache@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43168f4..d1c8a8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,7 @@ name: Release on: push: tags: [ "v*" ] + workflow_dispatch: {} defaults: run: @@ -40,25 +41,25 @@ jobs: fi - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal - override: true - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - name: Cache cargo build uses: actions/cache@v3 with: - path: cli/target - key: ${{ runner.os }}-release-cargo-${{ hashFiles('cli/Cargo.lock') }} + path: target + key: ${{ runner.os }}-release-cargo-${{ hashFiles('Cargo.lock') }} restore-keys: ${{ runner.os }}-release-cargo - name: Build CLI app - uses: actions-rs/cargo@v1 - with: - command: build - args: --manifest-path=cli/Cargo.toml --release --target=${{ matrix.target }} --all-features --locked + run: | + cargo build -p term-transcript-cli \ + --profile=executable \ + --target=${{ matrix.target }} \ + --all-features \ + --locked - name: Package archive id: package run: ./cli/package.sh ${REF#"refs/tags/"} @@ -68,7 +69,14 @@ jobs: REF: ${{ github.ref }} - name: Publish archive uses: softprops/action-gh-release@v1 + if: github.event_name == "push" with: draft: false files: ${{ steps.package.outputs.archive }} prerelease: ${{ steps.release-type.outputs.type == 'prerelease' }} + - name: Attach archive to action + uses: actions/upload-artifact@v3 + if: github.event_name == "workflow_dispatch" + with: + name: term-transcript-${{ matrix.target }} + path: ${{ steps.package.outputs.archive }} diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml new file mode 100644 index 0000000..335dd45 --- /dev/null +++ b/.github/workflows/scheduled.yml @@ -0,0 +1,9 @@ +name: Scheduled checks + +on: + schedule: + - cron: "0 2 * * MON" + +jobs: + build: + uses: ./.github/workflows/build-reusable.yml diff --git a/.gitignore b/.gitignore index 8d53010..c553ee3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Rust target -/Cargo.lock # IDE .idea diff --git a/cli/Cargo.lock b/Cargo.lock similarity index 62% rename from cli/Cargo.lock rename to Cargo.lock index f32e057..71f4e74 100644 --- a/cli/Cargo.lock +++ b/Cargo.lock @@ -2,32 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] @@ -38,35 +46,30 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] -name = "atty" -version = "0.2.14" +name = "assert_matches" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "autocfg" @@ -80,6 +83,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "block-buffer" version = "0.10.4" @@ -97,9 +106,12 @@ checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -109,24 +121,22 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.1" +version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" +checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ "anstream", "anstyle", - "bitflags", "clap_lex", "strsim", "terminal_size", @@ -134,21 +144,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.18", + "syn", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "colorchoice" @@ -158,9 +168,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -175,16 +185,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "diff" version = "0.1.13" @@ -201,21 +201,39 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "downcast-rs" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -230,12 +248,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "filedescriptor" @@ -248,6 +263,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -260,9 +284,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.7" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" dependencies = [ "log", "pest", @@ -273,25 +297,22 @@ dependencies = [ ] [[package]] -name = "heck" -version = "0.4.1" +name = "hashbrown" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "humantime" @@ -300,12 +321,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] -name = "instant" -version = "0.1.12" +name = "id-arena" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "cfg-if", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown", ] [[package]] @@ -314,9 +352,9 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -330,21 +368,29 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys 0.48.0", + "hermit-abi", + "rustix 0.38.13", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "lazy_static" @@ -354,9 +400,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "linux-raw-sys" @@ -364,11 +410,17 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" + [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matchers" @@ -376,14 +428,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -401,7 +453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset", @@ -420,9 +472,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "os_pipe" @@ -431,16 +483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" dependencies = [ "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "output_vt100" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" -dependencies = [ - "winapi", + "windows-sys", ] [[package]] @@ -449,21 +492,28 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pest" -version = "2.6.0" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.6.0" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" dependencies = [ "pest", "pest_generator", @@ -471,22 +521,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.6.0" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.18", + "syn", ] [[package]] name = "pest_meta" -version = "2.6.0" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" dependencies = [ "once_cell", "pest", @@ -495,9 +545,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -512,7 +562,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "806ee80c2a03dbe1a9fb9534f8d19e4c0546b790cde8fd1fea9d6390644cb0be" dependencies = [ "anyhow", - "bitflags", + "bitflags 1.3.2", "downcast-rs", "filedescriptor", "lazy_static", @@ -526,41 +576,66 @@ dependencies = [ "winreg", ] +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "itertools", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + [[package]] name = "pretty_assertions" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" dependencies = [ - "ctor", "diff", - "output_vt100", "yansi", ] [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] +[[package]] +name = "pulldown-cmark" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -571,16 +646,19 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.8.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ - "regex-syntax 0.7.2", + "aho-corasick", + "memchr", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -592,6 +670,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.5", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -600,61 +689,89 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", - "windows-sys 0.48.0", + "linux-raw-sys 0.3.8", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.38.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.7", + "windows-sys", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "serial" version = "0.4.0" @@ -699,9 +816,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", @@ -735,9 +852,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "strsim" @@ -747,20 +864,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "91e02e55d62894af2a08aca894c6577281f76769ba47c94d5756bec8ac6e7373" dependencies = [ "proc-macro2", "quote", @@ -769,24 +875,27 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.5.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix", - "windows-sys 0.45.0", + "rustix 0.38.13", + "windows-sys", ] [[package]] name = "term-transcript" version = "0.3.0" dependencies = [ - "atty", + "anyhow", + "assert_matches", "bytecount", + "doc-comment", "handlebars", + "is-terminal", "os_pipe", "portable-pty", "pretty_assertions", @@ -794,8 +903,12 @@ dependencies = [ "serde", "serde_json", "termcolor", + "test-casing", "tracing", + "tracing-capture", + "tracing-subscriber", "unicode-width", + "version-sync", ] [[package]] @@ -803,10 +916,10 @@ name = "term-transcript-cli" version = "0.3.0" dependencies = [ "anyhow", - "atty", "clap", "handlebars", "humantime", + "is-terminal", "serde_json", "tempfile", "term-transcript", @@ -814,6 +927,21 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "term-transcript-rainbow" +version = "0.0.0" +dependencies = [ + "anyhow", + "handlebars", + "pretty_assertions", + "tempfile", + "term-transcript", + "termcolor", + "test-casing", + "tracing", + "tracing-subscriber", +] + [[package]] name = "termcolor" version = "1.2.0" @@ -829,8 +957,8 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "rustix", - "windows-sys 0.48.0", + "rustix 0.37.23", + "windows-sys", ] [[package]] @@ -842,24 +970,44 @@ dependencies = [ "libc", ] +[[package]] +name = "test-casing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a368b60fd43dd855b44b15fd27238a569d58b524ef2b5dfdffe013e92e0e0c14" +dependencies = [ + "test-casing-macro", +] + +[[package]] +name = "test-casing-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4dc4744280091c8760f456b14c5598f5f7afe96851b4da30fe0933725dae0d3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn", ] [[package]] @@ -872,6 +1020,55 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.37" @@ -886,13 +1083,26 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn", +] + +[[package]] +name = "tracing-capture" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3b1b84b84d7f95504091cb9518dea662eacba7a3bc23f23e98fe5fafede344" +dependencies = [ + "id-arena", + "predicates", + "tracing-core", + "tracing-subscriber", + "tracing-tunnel", ] [[package]] @@ -934,23 +1144,57 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "tracing-tunnel" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507bbab1fc2c9e606543558f5656b62e8014ba7e0ffa68b9484511b6871019c5" +dependencies = [ + "serde", + "tracing-core", +] + [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] [[package]] name = "unicode-width" @@ -958,6 +1202,17 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + [[package]] name = "utf8parse" version = "0.2.1" @@ -970,6 +1225,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "version-sync" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835169da0173ea373ddf5987632aac1f918967fbbe58195e304342282efa6089" +dependencies = [ + "proc-macro2", + "pulldown-cmark", + "regex", + "semver", + "syn", + "toml", + "url", +] + [[package]] name = "version_check" version = "0.9.4" @@ -1007,137 +1277,80 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" +name = "winnow" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] [[package]] name = "winreg" diff --git a/Cargo.toml b/Cargo.toml index b667079..7ce7bfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ handlebars = { version = "4.0.0", optional = true } portable-pty = { version = "0.8.0", optional = true } # Private dependencies (not exposed in the public API). -atty = { version = "0.2.14", optional = true } +is-terminal = { version = "0.4.9", optional = true } bytecount = "0.6.2" os_pipe = "1.0.0" serde = { version = "1.0", optional = true, features = ["derive"] } @@ -47,7 +47,7 @@ default = ["pretty_assertions", "svg", "test"] # Rendering terminal transcripts into SVG snapshots svg = ["handlebars", "serde", "serde_json"] # Allows parsing transcripts from SVG snapshots and testing them -test = ["quick-xml", "atty"] +test = ["quick-xml", "is-terminal"] [[test]] name = "integration" @@ -55,5 +55,11 @@ path = "tests/integration.rs" required-features = ["tracing"] [workspace] -members = [".", "e2e-tests/rainbow"] -exclude = ["cli"] +members = [".", "cli", "e2e-tests/rainbow"] + +# Profile for workspace executables +[profile.executable] +inherits = "release" +strip = true +codegen-units = 1 +lto = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 6a328bc..2cf1c15 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -3,7 +3,6 @@ name = "term-transcript-cli" version = "0.3.0" authors = ["Alex Ostrovski "] edition = "2021" -rust-version = "1.66" readme = "README.md" license = "MIT OR Apache-2.0" keywords = ["snapshot", "terminal", "SVG"] @@ -17,10 +16,10 @@ path = "src/main.rs" [dependencies] anyhow = "1.0.40" -atty = "0.2.14" clap = { version = "4.0.30", features = ["derive", "env", "wrap_help"] } handlebars = "4.3.1" humantime = "2.1.0" +is-terminal = "0.4.9" serde_json = "1.0" termcolor = "1.1.2" tracing-subscriber = { version = "0.3.16", features = ["env-filter"], optional = true } @@ -36,9 +35,3 @@ default = [] portable-pty = ["term-transcript/portable-pty"] # Enables tracing for main operations. tracing = ["tracing-subscriber", "term-transcript/tracing"] - -[profile.release] -strip = true - -[workspace] -# Separate workspace since we need a lockfile diff --git a/cli/Dockerfile b/cli/Dockerfile index 7c47683..33d05a0 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -6,11 +6,11 @@ ADD .. ./ ARG FEATURES=portable-pty,tracing RUN --mount=type=cache,id=cargo-registry,target=/root/.cargo/registry \ --mount=type=cache,id=artifacts,target=/volume/target \ - cargo build --manifest-path=cli/Cargo.toml --release \ + cargo build -p term-transcript-cli --profile=executable \ --no-default-features --features=$FEATURES \ --target-dir /volume/target && \ # Move the resulting executable so it doesn't get unmounted together with the cache - mv /volume/target/x86_64-unknown-linux-musl/release/term-transcript /volume/term-transcript + mv /volume/target/x86_64-unknown-linux-musl/executable/term-transcript /volume/term-transcript FROM alpine:3.17 COPY --from=builder /volume/term-transcript /usr/local/bin diff --git a/cli/README.md b/cli/README.md index 4d52999..48b140c 100644 --- a/cli/README.md +++ b/cli/README.md @@ -2,7 +2,6 @@ [![Build Status](https://github.com/slowli/term-transcript/workflows/CI/badge.svg?branch=master)](https://github.com/slowli/term-transcript/actions) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%2FApache--2.0-blue)](https://github.com/slowli/term-transcript#license) -![rust 1.66+ required](https://img.shields.io/badge/rust-1.66+-blue.svg?label=Required%20Rust) This crate provides command-line interface for [`term-transcript`]. It allows capturing terminal output to SVG and testing the captured snapshots. @@ -23,6 +22,11 @@ or download a pre-built app binary for popular targets (x86_64 for Linux / macOS and AArch64 for macOS) from [GitHub Releases](https://github.com/slowli/term-transcript/releases). +### Minimum supported Rust version + +The crate supports the latest stable Rust version. It may support previous stable Rust versions, +but this is not guaranteed. + ### Crate feature: `portable-pty` Specify `--features portable-pty` in the installation command diff --git a/cli/package.sh b/cli/package.sh index 4776f0f..8a806f4 100755 --- a/cli/package.sh +++ b/cli/package.sh @@ -14,7 +14,8 @@ echo "Packaging term-transcript $VERSION for $TARGET..." CLI_DIR=$(dirname "$0") RELEASE_DIR="$CLI_DIR/release" -EXECUTABLE="$CLI_DIR/target/$TARGET/release/term-transcript" +ROOT_DIR="$CLI_DIR/.." +EXECUTABLE="$ROOT_DIR/target/$TARGET/executable/term-transcript" if [[ "$OS" == 'windows-latest' ]]; then EXECUTABLE="$EXECUTABLE.exe" diff --git a/cli/src/main.rs b/cli/src/main.rs index 4a8a3e6..eea1d17 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -2,6 +2,7 @@ use anyhow::Context; use clap::{Parser, Subcommand, ValueEnum}; +use is_terminal::IsTerminal; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; use std::{ @@ -293,7 +294,7 @@ impl From for ColorChoice { ColorPreference::Always => ColorChoice::Always, ColorPreference::Ansi => ColorChoice::AlwaysAnsi, ColorPreference::Auto => { - if atty::is(atty::Stream::Stdout) { + if io::stdout().is_terminal() { ColorChoice::Auto } else { ColorChoice::Never diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..387e879 --- /dev/null +++ b/deny.toml @@ -0,0 +1,45 @@ +# `cargo-deny` configuration. + +feature-depth = 1 + +[advisories] +db-urls = ["https://github.com/rustsec/advisory-db"] +vulnerability = "deny" +unmaintained = "deny" +unsound = "deny" +yanked = "deny" +notice = "warn" +severity-threshold = "Medium" + +[licenses] +unlicensed = "deny" +allow = [ + # Permissive open-source licenses + "MIT", + "Apache-2.0", + "Unicode-DFS-2016", +] +copyleft = "deny" +allow-osi-fsf-free = "neither" +default = "deny" +confidence-threshold = 0.8 + +[bans] +multiple-versions = "deny" +wildcards = "deny" +allow-wildcard-paths = true +skip = [ + # `bitflags` v1 is still used by many crates. Since it's largely a macro, + # having multiple versions seems OK. + { name = "bitflags", version = "^1" }, +] +skip-tree = [ + # Used by `tracing-subscriber` together with the new version :( + { name = "regex-automata", version = "^0.1" }, + # Used by `clap` via `terminal_size`; likely to get updated soon. + { name = "rustix", version = "^0.37" }, +] + +[sources] +unknown-registry = "deny" +unknown-git = "deny" diff --git a/examples/generate-snapshots.sh b/examples/generate-snapshots.sh index 8c48aef..c2f8ecc 100755 --- a/examples/generate-snapshots.sh +++ b/examples/generate-snapshots.sh @@ -11,7 +11,6 @@ EXTENSION=new.svg ROOT_DIR=$(dirname "$0") ROOT_DIR=$(realpath -L "$ROOT_DIR/..") TARGET_DIR="$ROOT_DIR/target/debug" -CLI_TARGET_DIR="$ROOT_DIR/cli/target/debug" # Common `term-transcript` CLI args TT_ARGS="-T 250ms" @@ -19,15 +18,15 @@ TT_ARGS="-T 250ms" ( cd "$ROOT_DIR" cargo build -p term-transcript-rainbow - cargo build --manifest-path=cli/Cargo.toml --all-features + cargo build -p term-transcript-cli --all-features ) -if [[ ! -x "$CLI_TARGET_DIR/term-transcript" ]]; then - echo "Executable term-transcript not found in expected location $CLI_TARGET_DIR" +if [[ ! -x "$TARGET_DIR/term-transcript" ]]; then + echo "Executable term-transcript not found in expected location $TARGET_DIR" exit 1 fi -export PATH=$PATH:$TARGET_DIR:$CLI_TARGET_DIR +export PATH=$PATH:$TARGET_DIR echo "Creating rainbow snapshot..." term-transcript exec $TT_ARGS --palette gjm8 rainbow \ diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 16d9cf7..c76ac53 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -32,7 +32,7 @@ impl fmt::Debug for StatusCheck { formatter .debug_struct("StatusCheck") .field("command", &self.command) - .finish() + .finish_non_exhaustive() } } @@ -74,7 +74,7 @@ impl fmt::Debug for ShellOptions { .field("init_timeout", &self.init_timeout) .field("init_commands", &self.init_commands) .field("status_check", &self.status_check) - .finish() + .finish_non_exhaustive() } } diff --git a/src/svg/mod.rs b/src/svg/mod.rs index 1c9dd88..f91c762 100644 --- a/src/svg/mod.rs +++ b/src/svg/mod.rs @@ -360,6 +360,7 @@ impl Default for Template { impl Template { /// Initializes the default template based on provided `options`. + #[allow(clippy::missing_panics_doc)] // Panic should never be triggered pub fn new(options: TemplateOptions) -> Self { let template = HandlebarsTemplate::compile(DEFAULT_TEMPLATE) .expect("Default template should be valid"); @@ -367,6 +368,7 @@ impl Template { } /// Initializes the pure SVG template based on provided `options`. + #[allow(clippy::missing_panics_doc)] // Panic should never be triggered pub fn pure_svg(options: TemplateOptions) -> Self { let template = HandlebarsTemplate::compile(PURE_TEMPLATE).expect("Pure template should be valid"); diff --git a/src/test/utils.rs b/src/test/utils.rs index b846823..d1ece53 100644 --- a/src/test/utils.rs +++ b/src/test/utils.rs @@ -1,3 +1,4 @@ +use is_terminal::IsTerminal; use termcolor::{Ansi, ColorChoice, ColorSpec, NoColor, StandardStream, WriteColor}; use std::{ @@ -113,7 +114,7 @@ impl ColorPrintlnWriter { ColorChoice::Never => false, ColorChoice::Always | ColorChoice::AlwaysAnsi => true, ColorChoice::Auto => { - if atty::is(atty::Stream::Stdout) { + if io::stdout().is_terminal() { StandardStream::stdout(color_choice).supports_color() } else { false diff --git a/src/write/svg.rs b/src/write/svg.rs index e97618a..d28ca8a 100644 --- a/src/write/svg.rs +++ b/src/write/svg.rs @@ -393,7 +393,9 @@ mod tests { let lines = writer.into_lines(); assert_eq!(lines.len(), 5); - let [first, second, third, ..] = lines.as_slice() else { unreachable!() }; + let [first, second, third, ..] = lines.as_slice() else { + unreachable!(); + }; assert!(first.background.is_none()); assert_eq!( first.foreground,