From 537f9c8200a4108007d52e248c1be667bcee2a3a Mon Sep 17 00:00:00 2001 From: Hal Blackburn Date: Tue, 23 Jul 2024 02:55:36 +0000 Subject: [PATCH 1/3] docs: update examples/jb-cli.sh to reflect API changes API hasn't changed recently, but this example was not updated with the last round of changes. --- examples/jb-cli.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/jb-cli.sh b/examples/jb-cli.sh index 08ea1b4..386fd92 100755 --- a/examples/jb-cli.sh +++ b/examples/jb-cli.sh @@ -31,11 +31,11 @@ Example: json.org https://json.org/example.html EOT printf "\njson.bash jb CLI:\n" -# jb's @=/file references combined with shell process substitution allow jb +# jb's @/file references combined with shell process substitution allow jb # calls to nest: -jb menu:json@=<( - jb id=file value=File popup:json@=<( - jb menuitem:json[]@=<( +jb menu:json@<( + jb id=file value=File popup:json@<( + jb menuitem:json[]@<( jb value=New onclick="CreateNewDoc()"; \ jb value=Open onclick="OpenDoc()"; \ jb value=Close onclick="CloseDoc()" @@ -46,7 +46,7 @@ jb menu:json@=<( # Or nest jb calls with command substitution jb menu:json="$( jb id=file value=File popup:json="$( - jb menuitem:json[]="$( + jb menuitem:json[$'\n']="$( jb value=New onclick="CreateNewDoc()"; \ jb value=Open onclick="OpenDoc()"; \ jb value=Close onclick="CloseDoc()" @@ -62,7 +62,7 @@ export menuitems=$( ) # Or temporary files tmp=$(mktemp -d) -jb menuitem:json[]@=menuitems > "${tmp:?}/popup" # the filename is used as the key +jb menuitem:json[$'\n']@menuitems > "${tmp:?}/popup" # the filename is used as the key export menu=$(jb id=file value=File @"${tmp:?}"/popup:json) # Environment variables can be explicitly passed without exporting globally menu=${menu:?} jb @menu:json @@ -92,9 +92,9 @@ Example: https://datatracker.ietf.org/doc/html/rfc8259#section-13 EOT printf "\njson.bash jb CLI:\n" -jb Image:json@=<( +jb Image:json@<( jb Width:number=800 Height:number=600 Title="View from 15th Floor" \ - Thumbnail:json@=<( + Thumbnail:json@<( jb url="http://www.example.com/image/481989943" height:number=125 \ width:number=100 ) \ From ca9a46a09d5c2ae310822fe09985c4879969d325 Mon Sep 17 00:00:00 2001 From: Hal Blackburn Date: Tue, 23 Jul 2024 05:02:03 +0000 Subject: [PATCH 2/3] chore: add copyright/license note to json.bash --- json.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/json.bash b/json.bash index e264411..72768e0 100755 --- a/json.bash +++ b/json.bash @@ -1,5 +1,7 @@ #!/usr/bin/env bash # shellcheck disable=SC2120 +# Copyright 2023-2024 json.bash contributors. MIT license. +# https://github.com/h4l/json.bash shopt -s extglob # required to match our auto glob patterns JSON_BASH_VERSION=0.2.3-dev From 74686b6ebedea0911f43a5030c91c2c984330e3e Mon Sep 17 00:00:00 2001 From: Hal Blackburn Date: Tue, 23 Jul 2024 05:00:49 +0000 Subject: [PATCH 3/3] chore(release): bump version to 0.3.0 --- CHANGELOG.md | 9 +++++++++ docker-bake.hcl | 2 +- json.bash | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 280bb62..2f94a31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to ## [Unreleased] +Nothing yet. + +## [0.3.0] — 2024-07-23 + ### BREAKING CHANGES > [!NOTE] @@ -47,6 +51,10 @@ and this project adheres to [kseistrup](https://aur.archlinux.org/account/kseistrup) - `--help` text uses `:json` instead of `:raw` in one of the examples (https://github.com/h4l/json.bash/pull/9) +- Updated `examples/jb-cli.sh` to use the current argument syntax — it was out + of date. +- `json.bash` now has a copyright/license/url comment in at the top. This should + make its origin clear when vendored into a downstream project as a dependency. ## [0.2.2] — 2023-08-07 @@ -96,6 +104,7 @@ No functional changes, `0.2.0` wasn't published because of a CI fail. Initial release. [unreleased]: https://github.com/h4l/json.bash/compare/v0.2.2...HEAD +[0.3.0]: https://github.com/h4l/json.bash/compare/v0.2.2...v0.3.0 [0.2.2]: https://github.com/h4l/json.bash/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/h4l/json.bash/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/h4l/json.bash/compare/v0.1.0...v0.2.0 diff --git a/docker-bake.hcl b/docker-bake.hcl index 0bee425..9bd1d69 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -7,7 +7,7 @@ NOW = "${timestamp()}" variable CI { default = "false" } -_DEFAULT_JSON_BASH_VERSION = "0.2.3-dev" +_DEFAULT_JSON_BASH_VERSION = "0.3.1-dev" variable JSON_BASH_VERSION { default = "" } diff --git a/json.bash b/json.bash index 72768e0..55aa232 100755 --- a/json.bash +++ b/json.bash @@ -4,7 +4,7 @@ # https://github.com/h4l/json.bash shopt -s extglob # required to match our auto glob patterns -JSON_BASH_VERSION=0.2.3-dev +JSON_BASH_VERSION=0.3.0 declare -g -A _json_defaults=()