The home of the CUE language! Validate and define text-based and dynamic configuration
This release includes changes to the evaluator and modules experiments, as well as a number of other improvements and fixes.
Following the introduction of the new evaluator experiment in v0.8.0-alpha.2 via CUE_EXPERIMENT=evalv3
, this release includes a number of fixes to known bugs in the new evaluator, as well as significant work towards supporting the new evaluator experiment via the Go API and not just cmd/cue
.
Subscribe to the Performance umbrella issue for updates, and see the Evaluator Roadmap project for the planned work ahead.
CL 1194090 adds the --dry-run
, --json
, and --out
flags to cue mod publish
to inspect what would be published as part of a module version.
CL 1194106 adds the cue mod resolve
command to show how a module path resolves to a registry in the form of an OCI reference.
As a reminder, the ongoing and planned work can be seen in the Modules Roadmap, and we continue to hold regular Modules feedback sessions.
CL 1193759 teaches cue/format
to collapse empty lists and structs to a single line for consistent formatting.
CL 1193690 fixes math.MultipleOf
as it had an incorrect implementation which could easily return bad results.
cmd/cue
CL 1193778 adds a cue fmt --diff
flag which displays diffs instead of updating files.
CL 1193934 improves cue fmt
so that it does not write to files on disk which are already well formatted.
This release includes a single fix for cue get go
: CL 1193892 fixes a regression introduced in cue get go
in v0.8.1
which caused transitive package dependencies to no longer be generated.
This release includes changes to the evaluator and modules experiments, as well as a number of other improvements and fixes. A special thanks to Noam Dolovich for numerous contributions to this release!
As a reminder: users can register their projects with Unity, our regression and performance testing setup. Unity is used to ensure that a project's CUE evaluations do not unexpectedly stop working or regress in performance. Adding your project to Unity not only guarantees that we will not break your tests unexpectedly, but it also helps to improve the quality of each CUE release. Follow this link to learn more about Unity, install it, or get in touch with any questions.
Following the introduction of the new evaluator experiment in the last alpha release via CUE_EXPERIMENT=evalv3
, this release includes a few fixes to known bugs and panics in the new evaluator.
Subscribe to the Performance umbrella issue for updates, and see the Evaluator Roadmap project for the planned work ahead.
cue mod publish
now requires source
to publish a module, as described in Proposal 3017. The cue mod init --source
flag is added to create a new module with this field.
The cue mod edit
command is added, which allows some automatic editing of cue.mod/module.cue
from the command line.
The CUE schema for cue.mod/module.cue
is now dictated by the declared language.version
value, which is now mandatory. This allows us to change or tighten the schema with future CUE versions without breaking existing users.
CLs 1193705 and 1193706 teach cue mod publish
to include VCS metadata in published module versions, as described in Proposal 3057.
CL 1193289 teaches $CUE_REGISTRY
about a special none
registry, causing any matching modules to refuse to fetch or resolve.
As a reminder, the ongoing and planned work can be seen in the Modules Roadmap, and we continue to hold regular Modules feedback sessions.
CLs 1193257, 1193394, 1193576, and 1193577 greatly speed up internal/filetypes
, used when loading files from disk in cue/load
or when encoding/decoding files in cmd/cue
.
CL 1193678 teaches cue/load
to cache loading files from directories, which avoids repeated work when loading parent directories to form instances.
The changes above, plus cue.Value.IsNull
below, should result in a significant speed-up for any cmd/cue
command involving many CUE packages or directories. For example, on the main CUE repository, cue fmt ./...
went from ~14s to ~0.1s, and cue vet ./...
went from ~5s to ~2s.
CL 1193639 teaches internal/filetypes
to only load its embedded CUE on first use, allowing any Go programs to skip the ~6ms load time until the first call to a cue/load
API, if any.
As a reminder, the ongoing and planned work can be seen in the Encodings Roadmap, and we also use the #encodings
channel on Slack.
CL 1193405 adds a cue.Value.IsNull
method to mirror cue.Value.Null
without constructing error values, making cue.Value.Decode
faster in many scenarios, including its use in cue/load
via internal/filetypes
.
CL 1193585 fixes a bug where cue/format
would print trailing commas for list elements after any inline comments, causing broken syntax.
CL 1193515 fixes an edge case where cue/format
would vertically align fields at different struct levels.
CL 1193242 teaches encoding/yaml.Unmarshal
to reject trailing input, just like encoding/json.Unmarshal
already did.
CL 1184631 fixes using math.MultipleOf
as a validator function.
cmd/cue
CL 1193699 fixes a regression introduced in cue get go
in v0.8.0-alpha.1
which caused transitive package dependencies to no longer be generated.
CL 1193702 ensures that cue get go
always generates CUE code from Go time.Duration
types and values in a way that is fully compatible with Go's encoding/json
library.
CL 1193386 fixes cue fmt --simplify
to no longer break complex labels by unquoting string literals within them.
This release includes the first experimental version of the new evaluator, as well as many other changes including the ongoing modules experiment. More details below.
As a reminder: users can register their projects with Unity, our regression and performance testing setup. Unity is used to ensure that a project's CUE evaluations do not unexpectedly stop working or regress in performance. Adding your project to Unity not only guarantees that we will not break your tests unexpectedly, but it also helps to improve the quality of each CUE release. Follow this link to learn more about Unity, install it, or get in touch with any questions.
The new evaluator can now be enabled via CUE_EXPERIMENT=evalv3
. It is not yet complete, and some known bugs remain, but over 95% of the existing tests are passing and the performance already looks promising. Disjunctions and initial structure sharing are now implemented as well.
Work on this new evaluator will continue during the v0.9 release cycle. We will only turn on the new evaluator by default once we are reasonably confident that there are no significant regressions, which may happen in a future release cycle like v0.10. In the meantime, testing via CUE_EXPERIMENT=evalv3
and bug reports are welcome.
We have also published a more detailed update on the performance umbrella issue, which you can subscribe to for updates. You can also take a look at the Evaluator Roadmap project to see the planned work remaining.
CL 1186144 fixes a number of Environment.up
panics involving calls to Value.Expr
, which affected users of the Go API as well as the openapi
encoding.
CL 1185458 ensures we detect permanent errors for undefined fields earlier, necessary for the permanent errors fix in tools/flow
below.
cmd/cue
now supports OAuth2 refresh tokens when interacting with $CUE_REGISTRY
, so that the user doesn't have to re-run cue login
once their access token expires.
CL 1191618 changes the modules client to treat "forbidden" errors as "not found" when finding which OCI repository contains a CUE module. This should resolve some unexpected "forbidden" failures when dealing with certain OCI registry services.
CL 1192905 adds initial support for the source
field in cue.mod/module.cue
files, which will soon be used as part of the proposal to determine what files go into a CUE module.
As a reminder, the ongoing and planned work can be seen in the Modules Roadmap, and we continue to hold regular Modules feedback sessions.
The Encodings project was kicked off at the last CUE Community Update call. As part of this, we now have an #encodings
channel on Slack, as well as an Encodings Roadmap project on GitHub where the ongoing and planned work can be seen.
In this release, the new YAML decoder is available in experimental form and enabled by default, given that all of our tests are already passing. You can disable it via CUE_EXPERIMENT=yamlv3decoder=0
. The old YAML decoder will be removed in a future release once we're reasonably confident that no significant regressions are present.
CL 1187452 teaches tools/flow
to fail when a task encounters a permanent error, which were being ignored before.
CL 1191227 adds a cue/token.File.Lines
getter method, much like go/token.File.Lines
was added in Go 1.21.
CL 1191226 teaches cue/literal.ParseNum
to support both positive and negative signs for consistency.
CL 1193030 ensures that cue/load.Instances
always returns instances in a deterministic order, in particular when multiple instances share the same directory.
CL 1185361 deprecates cue/load.Config.StdRoot
, which has not worked as advertised for some time.
cmd/cue
CL 1189314 adds a cue fmt --check
flag to list badly formatted files rather than modifying them directly.
CL 1192180 speeds up cue fmt
by ensuring that it only processes each CUE file once, rather than formatting files from parent directories as well.
cue
and cue cmd
via testscript by @mvdan in 39d27074f9271a1d3509e238f790234ff4fcbe41This release includes a number of fixes detailed below:
CL 1186144 fixes a number of evaluator panics which could be triggered by calling the cue.Value.Expr
method, which also happened when using the OpenAPI encoder.
CL 1173100 fixes cue get go
panics which might occur when any Go packages are vendored or use imported alias declarations.
CL 1185281 fixes a regression introduced in v0.8.0
which led to some incorrect failures in tools/flow
and cue cmd
.
This release adds initial support for the CUE Central Registry (details below) and includes a number of fixes and improvements.
As a reminder: users can register their projects with Unity, our regression and performance testing setup. Unity is used to ensure that a project's CUE evaluations do not unexpectedly stop working, or regress in terms of performance. It continues to catch multiple issues with each release. Adding your project to Unity not only guarantees that we will not break your tests (if we do, we will work with you to fix your CUE code), but it also helps to improve the quality of each CUE release. Follow this link to learn more about Unity, install it, or get in touch with any questions.
This release includes experimental support for the CUE Central Registry at registry.cue.works
. We have added a cue login
command to log into the Central Registry via a GitHub account, and other commands know how to use these credentials when talking to the registry.
We will share more details about the Central Registry and support for other login mechanisms in the future. For now, we are looking to get early feedback.
To get started with the Central Registry, we have published a tutorial on working with modules and the central registry as well.
CL 1185280 adds cue help modules
as a high-level overview of CUE modules as well.
CL 1185281 reverts a change in v0.8.0 to fix valid uses of tools/flow
involving task inputs derived from the evaluation of other tasks.
CL 1185684 removes the last remaining bits of API which supported quoted identifiers, which had already been deprecated and largely unsupported for years.
cmd/cue
CL 1173100 fixes cue get go
to avoid panics when dealing with vendored packages or any type aliases which refer to indirectly imported packages.
CL 1185356 tweaks cue/load
so that cue fmt
is able to format CUE files given directly as arguments even when they belong to different packages.
CL 1185473 deprecates the short-form cue somecmd
in favor of cue cmd somecmd
, as the former caused a number of bugs and slowness when working out which subcommand to execute.
cue somecmd
in favor of cue cmd somecmd
by @mvdan in e8ecf236513a337f13b22dd32aaaa5a3db187f0dThis release includes experimental support for CUE Modules (more details below), as well as a number of improvements and fixes.
More CLs and refactors have also landed for the core evaluator's performance work. These aren't enabled yet as the work isn't complete; subscribe to the performance umbrella issue to read regular updates.
As a reminder: users can register their projects with Unity, our regression and performance testing setup. Unity is used to ensure that a project's CUE evaluations do not unexpectedly stop working, or regress in terms of performance. It continues to catch multiple issues with each release. Adding your project to Unity not only guarantees that we will not break your tests (if we do, we will work with you to fix your CUE code), but it also helps to improve the quality of each CUE release. Follow this link to learn more about Unity, install it, or get in touch with any questions.
This release includes experimental support for CUE modules in cmd/cue
, as outlined in the updated Modules and package management proposal v3.
Alongside this release, we have published a tutorial on the new website which shows how to publish and fetch modules with a custom module registry.
We have also published the first version of the Modules reference documentation, the canonical documentation page describing how CUE modules work in detail.
Note that support for CUE modules is still experimental and subject to change, and needs to be explicitly enabled via CUE_EXPERIMENT=modules
. See cue help environment
for more information on the environment variables used below.
CUE maps modules to registries via $CUE_REGISTRY
, which supports a simple string configuration format as well as a more detailed CUE configuration format which can be read from disk. See cue help registryconfig
for more details.
The new cue mod tidy
command rewrites cue.mod/module.cue
in its canonical format, adds any missing module dependency requirements, and removes unused ones.
The new cue mod publish
command publishes the current module to a module registry.
The new cue mod get
command can add a new module dependency, update an existing one, or downgrade an existing one as long as it does not cause any conflict.
When running commands like cue export
with CUE_EXPERIMENT=modules
, dependencies are automatically fetched from module registries following $CUE_REGISTRY
and cached on disk inside $CUE_CACHE_DIR
.
This release includes the first early version of an experimental Language Server Protocol (LSP) implementation for CUE. Whilst it remains experimental, the cmd/cuepls
binary is separate from cmd/cue
. However at a later date it will most likely to become a subcommand of cmd/cue
like cue lsp serve
.
We are working on updating the VSCode plugin to use cmd/cuepls
, as well as supporting an initial version of a plugin for Neovim. For JetBrains users, we are working with the author of the CUE plugin to understand how best to integrate cmd/cuepls
with JetBrains.
We will share announcements once the editor integrations are ready for use, and once more LSP features beyond formatting files are available. Subscribe to the LSP announce discussion, or join us in #cuepls
on CUE Slack.
Note that this version of CUE requires Go 1.21 or later, following our policy to support the latest two stable Go releases just like upstream.
The cue/load
package supports the CUE Modules experiment out of the box with the environment variable CUE_EXPERIMENT=modules
. Alternatively, a custom registry and authorizer can be configured with the Config.Registry
field via the modconfig.NewRegistry
API.
cue/load
also has a new Config.Env
struct field to provide the environment variables used to load CUE modules from registries. It defaults to using os.Environ
.
We have also added new Go examples to the cue/load
package, including an example demonstrating the use of a CUE modules registry.
CL 1173271 drops support for legacy pkg
directories, which have been deprecated since the transition to a cue.mod
directory in 2019.
CL 1174069 replaces a few more uses of the deprecated cue.Instance
type with cue.InstanceOrValue
.
CL 1175779 deprecates the FileOffset
and File.Base
APIs in cue/token
, which were inherited from go/token
but never had any effect.
There are no changes to the language in this version.
CL 1173197 makes the use of the term "builtin function" consistent across the document.
CL 1173262 fixes a regression introduced by v0.7.0's upgrade to github.com/cockroachdb/apd/v3
where some arithmetic operations would result in an extra 0
digit.
CL 1173689 fixes the YAML encoder so that strings looking like hexadecimal numbers are properly quoted.
CL 1173735 replaces the uses of Go's net
package with net/netip
when dealing with IP addresses, which makes them immutable, comparable, and take less memory.
CL 1173926 adds an IPv6
API to net
to check that a value is a valid IPv6 address, mirroring IPv4
and taking advantage of the switch to the Go net/netip
package.
CL 1174339 fixes tool/exec
so that it correctly applies env
defaults in CUE values.
CL 1174623 fixes tool/exec
so that it accepts env
list values as documented.
cmd/cue
CL 1176194 adds a language.version
field to cue.mod/module.cue
to track what CUE language version a module was written for. This will become necessary to make future language changes as smooth as possible for CUE users. For example, running cue mod init
or cue mod tidy
with the v0.8.0 release should add language: version: "v0.8.0"
when the field isn't present.
CL 1173892 adds a cue help environment
section to document the environment variables used by the CLI, such as CUE_EXPERIMENT
and CUE_REGISTRY
.
CL 1176665 fixes cue cmd
so that legacy commands always get the corresponding CUE schema unified.
CL 1177330 fixes a bug where some evaluation errors in tools/flow
and cue cmd
were omitted, causing unintended results.
CL 1177546 tweaks cmd/cue
so that it obeys the --package
flag when the output format is CUE.
@v0
with the experiment by @mvdan in 24f93c9b616a3870c753ecb916037928d97fdd31cue mod init modpath@version
" by @mvdan in b1e40aefdbf240a3fc1d2cbe293dc78c37ded1f0cue mod init modpath@version
by @mvdan in 94a444fe9ce568e4e7e90f6aca142de605874b16cue mod tidy
to pass by @mvdan in bd966600bfc1a9fed729ee9bd2520a6bffe09047cue mod publish
by @mvdan in 2930a8ea50835be296fadcf12493552f03cb38cbcue mod tidy
by @mvdan in 34db9eb3f3109337b860f497f5d48374f5aac807cue mod init modpath@version
by @mvdan in 7855e15cb70165ba9b09d6c654fb90aa2a12a082This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1
.
cue mod tidy
gained a --check
flag, which succeeds only if the module file contains exactly the required dependencies and also contains a canonical CUE language version.
cmd/cue
and cue/load
now send a detailed HTTP User-Agent string to CUE registries when sending HTTP requests, including the CUE and Go versions, rather than Go's default net/http user agent string.
cmd/cue
now supports CUE_DEBUG=http
to print HTTP logging information to stderr in JSON format.
Local builds of cmd/cue
, such as running go install ./cmd/cue
, now include a proper CUE version, allowing cue mod init
and cue mod tidy
to insert language.version
as expected.
cue mod init modpath@version
" by @mvdan in b1e40aefdbf240a3fc1d2cbe293dc78c37ded1f0This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1
.
A new cue mod get
command is added, which can add a new module dependency, update an existing one, or downgrade an existing one as long as it does not cause any conflict.
The cue/load
package has a new Config.Env
struct field to provide the environment variables used to load CUE modules from registries.
A new cue help registryconfig
documentation section has been added, explaining how $CUE_REGISTRY
works as well as the configuration file schema it supports.
This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1
.
Thank you to @kharf, @mvdan, @myitcv, @nickfiggins, and @rogpeppe for contributing to this release!
The cue/load
package now supports loading CUE instances using the CUE Modules experiment, which was first added to cmd/cue
in v0.8.0-alpha.1
.
cue/load
supports the CUE Modules experiment out of the box with the environment variable CUE_EXPERIMENT=modules
. Alternatively, a custom registry and authorizer can be configured with the Config.Registry
field via the modconfig.NewRegistry
API.
We have also added new Go examples to the cue/load
package, including an example demonstrating the use of a CUE modules registry.
CL 1177330 fixes a bug where some evaluation errors in tools/flow
and cue cmd
were omitted, causing unintended results.
CL 1177546 tweaks cmd/cue
so that it obeys the --package
flag when the output format is CUE.
cue mod init modpath@version
by @mvdan in 94a444fe9ce568e4e7e90f6aca142de605874b16