From 92fddf0b847fda765b7400e113e99300c5f0f5d1 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 6 Oct 2026 01:13:29 +1300 Subject: [PATCH] Align shared project conventions and release v0.3.1. --- .github/workflows/publish.yml | 1 + .github/workflows/test.yml | 14 ++++++++++++++ Cargo.lock | 30 ++++++++---------------------- Cargo.toml | 5 ++++- bake/Cargo.toml | 4 ++-- context/markdown-normalization.md | 23 ++++------------------- license.md | 20 ++++---------------- readme.md | 25 ++++++++++++++----------- releases.md | 13 +++++++++++-- 9 files changed, 62 insertions(+), 73 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b01c33c..f89fbb7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,6 +41,7 @@ jobs: - name: Run Clippy run: cargo clippy --workspace --all-targets --locked -- -D warnings - name: Run tests + if: github.event_name == 'push' run: cargo test --workspace --locked publish: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91ec612..ea1814c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,9 @@ name: Test on: push: + branches: [main] pull_request: + branches: [main] workflow_dispatch: permissions: @@ -26,3 +28,15 @@ jobs: - run: cargo clippy --workspace --all-targets --locked -- -D warnings - name: Run tests and require complete region coverage run: cargo bake --locked test:coverage --package bake-markdown --all-targets true --all-features true + + test-result: + if: always() + needs: [test] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Require successful tests and coverage + env: + JOB_RESULTS: ${{ toJSON(needs) }} + run: | + echo "$JOB_RESULTS" | jq -e 'all(.[]; .result == "success")' diff --git a/Cargo.lock b/Cargo.lock index ca6bc3e..79d7a35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,7 +83,7 @@ dependencies = [ [[package]] name = "bake-markdown" -version = "0.3.0" +version = "0.3.1" dependencies = [ "bake", "socketry-markdown 0.3.0", @@ -194,7 +194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -520,7 +520,7 @@ dependencies = [ "getrandom 0.2.17", "libc", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -533,7 +533,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -673,14 +673,15 @@ dependencies = [ [[package]] name = "socketry-project" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f3a4391b29d2fcfe7522e3fdf651aaff9fd3de6c530a90412060b6bd1ad4e4" +checksum = "c2d4af345d5695d21119455e14c348b42267bc0c18eea584b44599d24f42d33e" dependencies = [ "bake", "bake-agent-context", "bake-cargo", "bake-license", + "bake-markdown", "bake-readme", "bake-releases", "bake-test-rust", @@ -741,7 +742,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -875,12 +876,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - [[package]] name = "windows-sys" version = "0.52.0" @@ -890,15 +885,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index 4362b13..25a6903 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bake-markdown" -version = "0.3.0" +version = "0.3.1" edition = "2024" rust-version = "1.85" license = "MIT" @@ -25,3 +25,6 @@ socketry-markdown = "0.3.0" [dev-dependencies] tempfile = "3.27" + +[patch.crates-io] +bake-markdown = { path = "." } diff --git a/bake/Cargo.toml b/bake/Cargo.toml index 24eef03..c971e1d 100644 --- a/bake/Cargo.toml +++ b/bake/Cargo.toml @@ -5,6 +5,6 @@ edition = "2024" publish = false [dependencies] -bake = ">=0.19.0" +bake = "0.19" bake-markdown = { path = ".." } -socketry-project = ">=0.3.3" +socketry-project = ">=0.3.7" diff --git a/context/markdown-normalization.md b/context/markdown-normalization.md index f84e8fb..f87d084 100644 --- a/context/markdown-normalization.md +++ b/context/markdown-normalization.md @@ -1,31 +1,16 @@ # Markdown Normalization -`bake-markdown` exposes `normalize_document` for Rust callers and the -`markdown:normalize` Bake task for project files. Normalization parses -CommonMark, GitHub Flavored Markdown, YAML and TOML front matter, and math, -then serializes it with soft source line breaks joined as spaces. This keeps -inline code and other parsed syntax such as tables, task list state, footnotes, -strikethrough, code blocks, and math in the syntax tree for serialization. -Rust callers can select another syntax with `normalize_document_with_options`, -such as MDX. +`bake-markdown` exposes `normalize_document` for Rust callers and the `markdown:normalize` Bake task for project files. Normalization parses CommonMark, GitHub Flavored Markdown, YAML and TOML front matter, and math, then serializes it with soft source line breaks joined as spaces. This keeps inline code and other parsed syntax such as tables, task list state, footnotes, strikethrough, code blocks, and math in the syntax tree for serialization. Rust callers can select another syntax with `normalize_document_with_options`, such as MDX. -The serializer preserves explicit Markdown hard breaks, code contents, and -block boundaries. YAML and TOML front matter are parsed as front matter so -their delimiters and content remain intact. The serializer canonicalizes -line endings to LF and emits a trailing newline for non-empty documents. The -normalizer does not wrap paragraphs to a target line width. It uses the -serializer's default `-` marker for unordered lists. +The serializer preserves explicit Markdown hard breaks, code contents, and block boundaries. YAML and TOML front matter are parsed as front matter so their delimiters and content remain intact. The serializer canonicalizes line endings to LF and emits a trailing newline for non-empty documents. The normalizer does not wrap paragraphs to a target line width. It uses the serializer's default `-` marker for unordered lists. -The task accepts one or more positional paths, resolved relative to the Bake -project root. For example, the shell expands a glob before Bake receives the -paths: +The task accepts one or more positional paths, resolved relative to the Bake project root. For example, the shell expands a glob before Bake receives the paths: ```sh cargo bake markdown:normalize **/*.md ``` -Use `::` before another task because the variadic path list consumes all -positional values up to the end of the command: +Use `::` before another task because the variadic path list consumes all positional values up to the end of the command: ```sh cargo bake markdown:normalize **/*.md :: null diff --git a/license.md b/license.md index e589fcc..17fbb94 100644 --- a/license.md +++ b/license.md @@ -1,21 +1,9 @@ # MIT License -Copyright, 2026, by Samuel Williams. +Copyright, 2026, by Samuel Williams. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/readme.md b/readme.md index ad52beb..f54d6a8 100644 --- a/readme.md +++ b/readme.md @@ -1,14 +1,10 @@ # `bake-markdown` -Markdown normalization for Bake projects. It joins soft source line breaks in -Markdown files while preserving explicit hard breaks, code, and block -boundaries. +Markdown normalization for Bake projects. It joins soft source line breaks in Markdown files while preserving explicit hard breaks, code, and block boundaries. ## Motivation -Hard-wrapped paragraphs are difficult to edit consistently. This crate uses -the `socketry-markdown` syntax tree and serializer so normalization follows -Markdown structure instead of changing lines with regular expressions. +Hard-wrapped paragraphs are difficult to edit consistently. This crate uses the `socketry-markdown` syntax tree and serializer so normalization follows Markdown structure instead of changing lines with regular expressions. ## Usage @@ -34,8 +30,19 @@ Rust callers can use `bake_markdown::normalize_document` directly. ## Releases + See [releases.md](releases.md) for the full release history. +### v0.3.1 + +- Resolve development task dependencies to the current checkout. + +- Adopt `socketry-project` 0.3.7 for shared project tasks and Markdown normalization. + +- Require the aggregate test and coverage result for pull request merges. + +- Avoid duplicate ordinary test runs in pull request publishing checks. + ### v0.3.0 - Normalize unordered Markdown lists with hyphen markers. @@ -44,10 +51,6 @@ See [releases.md](releases.md) for the full release history. - Accept Markdown paths as positional arguments to `markdown:normalize`. -### v0.1.0 - -- Add the `markdown:normalize` task to join soft source line breaks in Markdown - files while preserving explicit hard breaks, code, and block boundaries. ## See Also @@ -60,4 +63,4 @@ Please open an issue or pull request on [GitHub](https://github.com/socketry/bak ### Agent Context -Before contributing, read `.agents/context/index.md` and the relevant context files it links. If the index is missing or out of date, run `cargo bake agent:context:install` to install context from dependencies and refresh the index. +Run `cargo bake agent:context:install` to install shared context and skills. Read `.agents/context/index.md` to find relevant guides, follow `agents.md` if present, and apply skills under `.agents/skills/`. The installer preserves repository-owned `agents.md`; it does not create or regenerate that file. diff --git a/releases.md b/releases.md index a96ee26..d07d692 100644 --- a/releases.md +++ b/releases.md @@ -1,5 +1,15 @@ # Releases +## v0.3.1 + +- Resolve development task dependencies to the current checkout. + +- Adopt `socketry-project` 0.3.7 for shared project tasks and Markdown normalization. + +- Require the aggregate test and coverage result for pull request merges. + +- Avoid duplicate ordinary test runs in pull request publishing checks. + ## v0.3.0 - Normalize unordered Markdown lists with hyphen markers. @@ -10,5 +20,4 @@ ## v0.1.0 -- Add the `markdown:normalize` task to join soft source line breaks in Markdown - files while preserving explicit hard breaks, code, and block boundaries. +- Add the `markdown:normalize` task to join soft source line breaks in Markdown files while preserving explicit hard breaks, code, and block boundaries.