github cue-lang/cue v0.2.2

latest releases: v0.11.0-rc.1, v0.11.0-alpha.5, v0.11.0-alpha.4...
3 years ago

This is the last release before commencing the move to the new evaluator.

Backwards incompatible changes

yaml.Validate

This now uses Unification again. This brings it in line with the json package.

This change was done to facilitate moving to the new evaluator. This seems no longer necessary. Either way, using subsumption for validation seems wrong. It is better if the desired validation can be specified in the language itself.

Language feature support override

This is the last version that supports :: under the hood and the last release that will allow moving from :: to new-style definitions using cue fix. The cue tool now supports the CUE_SYNTAX_OVERRIDE environment variable to specify the features to allow at a specific version. So even though this feature disallows :: by default, it can be allowed again by setting this environment variable to v0.1.0, for instance.

This will not re-enable features that have been permanently removed.

OpenAPI fixes

OpenAPI is not always compatible with JSON Schema. For instance, it may use an older version. CUE used the new interpretation of exclusive ranges, whereas OpenAPI v3.0.0 and before required the old interpretation. Both interpretations are now supported and are switched based on the selected version (an API feature).

cue completion

This release exposes the Cobra command completion feature. This is currently only tested for bash and is known to not work, for instance, for Fish.

cue get go

This will now generate unexported constants using the _# prefix.

API

Fill

Now allows a cue.Value to be set anywhere in a Go value.

Builtins

list.SliceRunes

Allow slicing of strings per rune.

Embedding in NewStruct

Added ast.Embed helper to specify embeddings in ast.NewStruct.

Testing

Most txtar-based tests now support the CUE_UPDATE environment variable for updating tests. This allows running

CUE_UPDATE=1 go test ./...

to update all these tests at once. It is not possible to use the --update flag for a bulk update, because not all tests implement it, causing such tests to fail.

Changelog

29fa119 cmd/cue/cmd: allow overriding syntax limitation
ab43a15 cmd/cue/cmd: include tool and test files in fix
94db2eb cmd/cue/cmd: include unexported constants for get go
f0f62b8 cue/ast: allow use of Embed in NewStruct
10fbc21 cue/ast: fix typo
a20e1d4 cue/errors: don't equate error messages without line info
0ccdee2 cue/gen.go: fix bug in generation.
1784fca cue: add test cases
097cf16 cue: allow Value to be set at any path in Fill
8f07f84 cue: print hex numbers correctly
ed61df2 cue: return empty struct for disallowed unification
21ca371 doc/ref/spec.md: alternative definitions for closedness and friends
ecfbd72 encoding/openapi: date-time & string format
616d9e8 encoding/openapi: fix generation bug in CRD path
d3c0096 encoding/openapi: update tests
c615c91 encoding/yaml: fix bug where an empty document is not treated as null
9ebfa80 feat: add completion command
16a2b89 internal/cuetxtar: add Load function
97b215f internal/cuetxtar: allow CUE_UPDATE env variable.
8a0ac3e internal: add ToStruct helper.
57f8242 pkg/encoding/yaml: validate concreteness instead of instance of for Validate
f01cfc5 pkg/strings: add SliceRunes

Don't miss a new cue release

NewReleases is sending notifications on new releases.