release notes

This commit is contained in:
Mike Farah 2020-01-11 09:55:24 +11:00
parent 9361b8b3e9
commit 96955ffa9c
4 changed files with 32 additions and 17 deletions

View File

@ -1,12 +1,14 @@
Major release! Upgraded underlying yaml parser, re-written majority of yq. This has brought on a number of features that have been in demand for a while (see below).
This is in beta and needs some community feedback and testing :)
# New Features # New Features
- Keeps yaml comments and formatting (string blocks are saved, number formatting is preserved, so it won't drop off trailing 0s for values like 0.10, which is important when that's a version entry ) - Keeps yaml comments and formatting, can specify yaml tags when updating. https://github.com/mikefarah/yq/issues/19, https://github.com/mikefarah/yq/issues/169, https://github.com/mikefarah/yq/issues/107, https://github.com/mikefarah/yq/issues/171, https://github.com/mikefarah/yq/issues/245, https://github.com/mikefarah/yq/issues/303,https://github.com/mikefarah/yq/issues/308,https://github.com/mikefarah/yq/issues/314
- Handles anchors! https://github.com/mikefarah/yq/issues/310, https://github.com/mikefarah/yq/issues/178
- Handles anchors! (doc link) - Can print out matching paths and values when splatting https://github.com/mikefarah/yq/issues/20
- Can specify yaml tags (e.g. !!int), quoting values no longer sufficient, need to specify the tag value instead.
- Can print out matching paths and values when splatting (doc link)
- JSON output works for all commands! Yaml files with multiple documents are printed out as one JSON document per line. - JSON output works for all commands! Yaml files with multiple documents are printed out as one JSON document per line.
- Deep splat (**) to match arbitrary paths, (doc link) - Deep splat (**) to match arbitrary paths
# Breaking changes # Breaking changes
@ -14,6 +16,24 @@
## Update scripts file format has changed to be more powerful. ## Update scripts file format has changed to be more powerful.
Comments can be added, and delete commands have been introduced. Comments can be added, and delete commands have been introduced.
Before:
```yaml
b.e[+].name: Mike Farah
```
After:
```yaml
- command: update
path: b.e[+].thing
value:
#great
things: frog # wow!
- command: delete
path: b.d
```
https://github.com/mikefarah/yq/issues/305
## Reading and splatting, matching results are printed once per line. ## Reading and splatting, matching results are printed once per line.
e.g: e.g:
@ -27,7 +47,9 @@ parent:
there2: also matches there2: also matches
``` ```
```bash
yq r sample.yaml 'parent.*.there*' yq r sample.yaml 'parent.*.there*'
```
old old
```yaml ```yaml
@ -50,7 +72,3 @@ yq r --printMode pv sample.yaml 'parent.*.there*'
parent.childB.there: matches parent.childB.there: matches
parent.childB.there2: also matches parent.childB.there2: also matches
``` ```
# Merge command
- New flag 'autocreates' missing entries in target by default, new flag to turn that off.

View File

@ -3,8 +3,5 @@
value: value:
#great #great
things: frog # wow! things: frog # wow!
- command: update
path: b.e[+].name
value: Mike Farah
- command: delete - command: delete
path: b.d path: b.d

View File

@ -32,5 +32,5 @@ upload() {
done < <(find ./build -mindepth 1 -maxdepth 1 -print0) done < <(find ./build -mindepth 1 -maxdepth 1 -print0)
} }
release # release
upload upload

View File

@ -3,7 +3,7 @@
# This assumes that gonative and gox is installed as per the 'one time setup' instructions # This assumes that gonative and gox is installed as per the 'one time setup' instructions
# at https://github.com/inconshreveable/gonative # at https://github.com/inconshreveable/gonative
gox -ldflags "${LDFLAGS}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" gox -ldflags "${LDFLAGS}" -output="build/yq_{{.OS}}_{{.Arch}}"
# include non-default linux builds too # include non-default linux builds too
gox -ldflags "${LDFLAGS}" -os=linux -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" gox -ldflags "${LDFLAGS}" -os=linux -output="build/yq_{{.OS}}_{{.Arch}}"