From 0f8c1d3bc42ca532ca81ff90cd7852f38a0d34b6 Mon Sep 17 00:00:00 2001 From: jiftechnify Date: Fri, 12 Dec 2025 21:22:17 +0900 Subject: [PATCH 1/3] add CHANGELOG.md --- CHANGELOG.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9c9d601 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,52 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.0] - 2025-12-12 + +### Added + +- **Deserialization operator (`>>`)** for deserializing queried values into arbitrary types ([#46](https://github.com/jiftechnify/valq/pull/46)) + - Deserialize queried values into any type implementing `serde::Deserialize` + - Syntax: `query_value!(obj.field >> (Type))` + - Don't forget to wrap the destination type with parentheses! + +- **Null coalescing operator (`??`)** for unwrapping query results with default values ([#50](https://github.com/jiftechnify/valq/pull/50)) + - `... ?? ` to provide a custom default value + - `... ?? default` to use `Default::default()` as the fallback + +### Changed + +- **Arbitrary type conversion with `->` operator** ([#46](https://github.com/jiftechnify/valq/pull/46)) + - No longer limited to hard-coded conversions! + - Any `as_xxx()` method available on the value type can be used + +- **Made syntax more JS-like** ([#47](https://github.com/jiftechnify/valq/pull/47)) + - More flexible bracket notation `[...]` + - Put arbitrary Rust expressions and enjoy unlimited dynamic queries! + - Removed `."key"` syntax in favor of revamped bracket notation + - `??` operator for unwrapping `Option`s + +### Documentation + +- Removed tedious enumeration of macro matching patterns from documentation ([#49](https://github.com/jiftechnify/valq/pull/49)) +- Added comprehensive examples for all major features +- Clarified query syntax specification + +## [0.1.0] - 2021-12-19 + +Initial release with basic query functionality. + +### Added + +- `query_value!` macro for querying semi-structured data + - Dot notation for accessing object properties (`.field`) + - Bracket notation for array/object indexing (`[index]`) + - Mutable reference extraction with `mut` prefix + - Basic type conversion using `as_***()` methods with `->` operator + +[0.2.0]: https://github.com/jiftechnify/valq/compare/0.1.0...0.2.0 +[0.1.0]: https://github.com/jiftechnify/valq/releases/tag/0.1.0 From 93d3330d2c8879f09595df54ae0736fd98ed81af Mon Sep 17 00:00:00 2001 From: jiftechnify Date: Fri, 12 Dec 2025 21:40:22 +0900 Subject: [PATCH 2/3] run publish.yml only when PR from release/* to main closed --- .github/workflows/publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0f34128..7410c1d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,13 +1,17 @@ name: Publish to crates.io on: - push: - tags: ["*.*.*"] + pull_request: + branches: + - main + types: + - closed jobs: publish: runs-on: ubuntu-latest permissions: id-token: write + if: ${{ github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/') }} steps: - uses: actions/checkout@v6 - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3 From 2b00250fa14de46fb44154075ab218c856fbfb2f Mon Sep 17 00:00:00 2001 From: jiftechnify Date: Fri, 12 Dec 2025 21:41:36 +0900 Subject: [PATCH 3/3] 0.2.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3fe009..9af9fed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "valq" -version = "0.1.0" +version = "0.2.0" dependencies = [ "paste", "serde", diff --git a/Cargo.toml b/Cargo.toml index d298490..d2fc16c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "valq" -version = "0.1.0" +version = "0.2.0" authors = ["jiftechnify "] edition = "2021" license = "MIT"