From e9f8c253c9917d9660cdcb955501bfe2de37eabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 14 Aug 2024 16:18:25 +0100 Subject: [PATCH] update site to v0.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And enable rendering of the `cue help embed` page. Note that a number of jsonschema files are imported differently, and we are also more strict about the schema version strings too. The other changes are varied, including some CUE formatting fixes and some changes to help texts. DO NOT MERGE: to update once v0.10.0 is tagged Preprocessor-No-Write-Cache: true Signed-off-by: Daniel Martí Change-Id: I392c68336c800c95dba7eac695e64410b8f94bcc Dispatch-Trailer: {"type":"trybot","CL":1199504,"patchset":2,"ref":"refs/changes/04/1199504/2","targetBranch":"master"} --- .../docs/concept/cue-language-version/en.md | 2 +- .../how-cue-enables-data-validation/en.md | 2 +- .../how-cue-works-with-json-schema/en.md | 2 +- .../concept/how-cue-works-with-openapi/en.md | 4 +- content/docs/howto/write-a-type-switch/en.md | 4 +- .../composite-schemas/en.md | 4 +- .../templating/comprehensions/en.md | 8 ++-- .../templating/references/en.md | 2 +- content/docs/reference/command/commands.cue | 3 +- .../reference/command/cue-help-embed/en.md | 12 +++++ .../reference/command/cue-help-embed/page.cue | 4 ++ content/docs/reference/spec/en.md | 7 ++- .../converting-json-schema-to-cue/en.md | 10 ++-- hugo/config/_default/params.toml | 4 +- .../concept/cue-language-version/index.md | 2 +- .../how-cue-enables-data-validation/index.md | 2 +- .../concept/how-cue-works-with-go/index.md | 12 ++--- .../how-cue-works-with-json-schema/index.md | 4 +- .../how-cue-works-with-openapi/index.md | 4 +- .../embed-files-in-cue-evaluation/index.md | 2 +- .../docs/howto/handle-errors-go-api/index.md | 4 +- .../en/docs/howto/validate-go-cuego/index.md | 4 +- .../howto/validate-json-using-go-api/index.md | 4 +- .../howto/walk-schemas-using-go-api/index.md | 4 +- .../docs/howto/write-a-type-switch/index.md | 4 +- .../composite-schemas/index.md | 4 +- .../templating/comprehensions/index.md | 8 ++-- .../templating/references/index.md | 2 +- .../reference/command/cue-help-embed/index.md | 47 +++++++++++++++++++ .../command/cue-help-environment/index.md | 3 ++ .../command/cue-help-filetypes/index.md | 3 +- .../reference/command/cue-help-get/index.md | 13 +++-- .../command/cue-help-import/index.md | 5 +- .../command/cue-help-injection/index.md | 16 ++++++- .../command/cue-help-inputs/index.md | 42 +++++++++++++---- .../command/cue-help-mod-edit/index.md | 11 +++-- .../command/cue-help-mod-init/index.md | 10 ++-- .../command/cue-help-mod-resolve/index.md | 6 ++- .../command/cue-help-modules/index.md | 12 +++++ .../command/cue-help-registryconfig/index.md | 4 +- .../reference/command/cue-help-trim/index.md | 1 + .../reference/command/cue-help-vet/index.md | 1 + .../docs/reference/command/cue-help/index.md | 5 +- hugo/content/en/docs/reference/spec/index.md | 7 ++- .../converting-json-schema-to-cue/index.md | 14 +++--- .../docs/tutorial/loading-cue-go-api/index.md | 6 +-- .../index.md | 4 +- .../using-modules-with-go-api/index.md | 6 +-- .../index.md | 6 +-- .../index.md | 4 +- .../cmd/preprocessor/cmd/_docker/Dockerfile | 23 ++++----- .../preprocessor/cmd/gen_dockerimagetag.go | 2 +- .../testdata/execute_multistagescript.txtar | 20 ++++---- .../src/config/gen_cuelang_org_go_version.ts | 2 +- site.cue | 4 +- 55 files changed, 267 insertions(+), 138 deletions(-) create mode 100644 content/docs/reference/command/cue-help-embed/en.md create mode 100644 content/docs/reference/command/cue-help-embed/page.cue create mode 100644 hugo/content/en/docs/reference/command/cue-help-embed/index.md diff --git a/content/docs/concept/cue-language-version/en.md b/content/docs/concept/cue-language-version/en.md index 901404613..8f07bb574 100644 --- a/content/docs/concept/cue-language-version/en.md +++ b/content/docs/concept/cue-language-version/en.md @@ -72,7 +72,7 @@ but in more recent CUE versions, this has been changed to: {{{with code "en" "a2"}}} -- in.cue -- - let x = 5 +let x = 5 {{{end}}} If the language were never to be changed in a backwards incompatible diff --git a/content/docs/concept/how-cue-enables-data-validation/en.md b/content/docs/concept/how-cue-enables-data-validation/en.md index effecb5af..c6f9bd38e 100644 --- a/content/docs/concept/how-cue-enables-data-validation/en.md +++ b/content/docs/concept/how-cue-enables-data-validation/en.md @@ -391,7 +391,7 @@ Let's include a JSON Schema file that adds some constraints to a couple of {{{with upload "en" "schema.json"}}} -- schema.json -- { - "$schema": "http://json-schema.org/draft-07/schema", + "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "ExampleType": { "type": "object", diff --git a/content/docs/concept/how-cue-works-with-json-schema/en.md b/content/docs/concept/how-cue-works-with-json-schema/en.md index bb0db0913..447ed5474 100644 --- a/content/docs/concept/how-cue-works-with-json-schema/en.md +++ b/content/docs/concept/how-cue-works-with-json-schema/en.md @@ -107,7 +107,7 @@ import "strings" @jsonschema(schema="http://json-schema.org/draft-07/schema#") // What is this person called? - name: strings.MinRunes(1) + name!: strings.MinRunes(1) // Where does this person live? address?: strings.MinRunes(1) & strings.MaxRunes(200) diff --git a/content/docs/concept/how-cue-works-with-openapi/en.md b/content/docs/concept/how-cue-works-with-openapi/en.md index 4a1915ff9..822452022 100644 --- a/content/docs/concept/how-cue-works-with-openapi/en.md +++ b/content/docs/concept/how-cue-works-with-openapi/en.md @@ -167,8 +167,8 @@ info: { // A Pet is a pet that we handle. #Pet: { // A pet has a name. - name: string - kind: #Kind + name!: string + kind!: #Kind // Centenarian pets are not handled. age?: int & >=0 & <100 diff --git a/content/docs/howto/write-a-type-switch/en.md b/content/docs/howto/write-a-type-switch/en.md index b1eae1a0a..5c2eacda9 100644 --- a/content/docs/howto/write-a-type-switch/en.md +++ b/content/docs/howto/write-a-type-switch/en.md @@ -55,8 +55,8 @@ output: [for v in input { // Here, isANumber is implemented as a switch. Other, simpler, // representations are also possible. isANumber: [ - if (v & number) != _|_ {true}, - if (v & number) == _|_ {false}, + if (v & number) != _|_ {true}, + if (v & number) == _|_ {false}, ][0] }] -- out -- diff --git a/content/docs/language-guide/schemas-and-validation/composite-schemas/en.md b/content/docs/language-guide/schemas-and-validation/composite-schemas/en.md index 027976f8e..4aab40ce4 100644 --- a/content/docs/language-guide/schemas-and-validation/composite-schemas/en.md +++ b/content/docs/language-guide/schemas-and-validation/composite-schemas/en.md @@ -70,11 +70,11 @@ definition. name?: string } #Mammal: { - #Base// embedded + #Base // embedded lungCapacityL: number } #Dog: { - #Mammal// embedded + #Mammal // embedded kind!: "dog" house: string } diff --git a/content/docs/language-guide/templating/comprehensions/en.md b/content/docs/language-guide/templating/comprehensions/en.md index ea336e181..dc0493999 100644 --- a/content/docs/language-guide/templating/comprehensions/en.md +++ b/content/docs/language-guide/templating/comprehensions/en.md @@ -129,11 +129,11 @@ CUE has no switch or if-else construct, but these can be simulated using lists. {{{with code "en" "switch-if-else-pattern"}}} -- in.cue -- -mem: 2Gi +mem: 2Gi footprint: [// select first - if mem < 1Gi {"small"}, - if mem < 4Gi {"medium"}, - "large", + if mem < 1Gi {"small"}, + if mem < 4Gi {"medium"}, + "large", ][0] -- out.cue -- mem: 2147483648 diff --git a/content/docs/language-guide/templating/references/en.md b/content/docs/language-guide/templating/references/en.md index 620812652..1e2f5057d 100644 --- a/content/docs/language-guide/templating/references/en.md +++ b/content/docs/language-guide/templating/references/en.md @@ -176,7 +176,7 @@ merging two maps. {{{with code "en" "let-expressions"}}} #norun open lists not implemented yet -- in.cue -- - let X = {list: []} +let X = {list: []} a: X b: X c: X diff --git a/content/docs/reference/command/commands.cue b/content/docs/reference/command/commands.cue index a7a70ca57..dbd780991 100644 --- a/content/docs/reference/command/commands.cue +++ b/content/docs/reference/command/commands.cue @@ -53,8 +53,7 @@ cue: { commands: _ completion: _ def: _ - // TODO: once CUE v0.10.0 is out, include `cue help embed`. - // embed: _ + embed: _ environment: _ eval: _ export: _ diff --git a/content/docs/reference/command/cue-help-embed/en.md b/content/docs/reference/command/cue-help-embed/en.md new file mode 100644 index 000000000..3ac069302 --- /dev/null +++ b/content/docs/reference/command/cue-help-embed/en.md @@ -0,0 +1,12 @@ +--- +WARNING: "Code generated site_tool.cue; DO NOT EDIT." +title: "cue help embed" +aliases: ["/docs/reference/cli/cue-embed/"] +weight: 1000 +tags: +- cue command +--- + +{{{with script "en" "cue cli help text"}}} +cue help embed +{{{end}}} diff --git a/content/docs/reference/command/cue-help-embed/page.cue b/content/docs/reference/command/cue-help-embed/page.cue new file mode 100644 index 000000000..db1e35b96 --- /dev/null +++ b/content/docs/reference/command/cue-help-embed/page.cue @@ -0,0 +1,4 @@ +// Code generated site_tool.cue; DO NOT EDIT. +package site + +{"content":{"docs":{"reference":{"command":{"cue-help-embed":{"page":{}}}}}}} diff --git a/content/docs/reference/spec/en.md b/content/docs/reference/spec/en.md index 8e41a0d40..272c6ef31 100644 --- a/content/docs/reference/spec/en.md +++ b/content/docs/reference/spec/en.md @@ -2994,7 +2994,12 @@ PackageClause = "package" PackageName . PackageName = identifier . ``` -The PackageName must not be the blank identifier or a definition identifier. +The PackageName must not be a definition identifier. + +If the PackageName is the blank identifier (`_`), it is treated the same +as if there were no package clause. This can be useful to allow adding +package level attributes or doc comments to a CUE file without a package +name. ``` package math diff --git a/content/docs/tutorial/converting-json-schema-to-cue/en.md b/content/docs/tutorial/converting-json-schema-to-cue/en.md index 27d74a85e..cccda35d3 100644 --- a/content/docs/tutorial/converting-json-schema-to-cue/en.md +++ b/content/docs/tutorial/converting-json-schema-to-cue/en.md @@ -128,13 +128,13 @@ package cuisine #restaurant: { @jsonschema(schema="http://json-schema.org/draft-07/schema#") - name: string - cuisine: string - tables: [...#table] + name!: string + cuisine!: string + tables!: [...#table] #table: { - seats: >=2 & <=10 - view?: bool + seats!: >=2 & <=10 + view?: bool } } {{{end}}} diff --git a/hugo/config/_default/params.toml b/hugo/config/_default/params.toml index 12a5621aa..d3b01d11c 100644 --- a/hugo/config/_default/params.toml +++ b/hugo/config/_default/params.toml @@ -17,9 +17,9 @@ logo = "svg/logo.svg" # Add a site-wide notification-bar # Contents allows for markdown, leave out the button if you don't want a button [notification] - type = 'cue-minor-release-v0.9' + type = 'cue-minor-release-v0.10' - content = '**CUE v0.9 is now available** -- learn more about its [new features and improvements](https://github.com/cue-lang/cue/releases/tag/v0.9.0)' + content = '**CUE v0.10 is now available** -- learn more about its [new features and improvements](https://github.com/cue-lang/cue/releases/tag/v0.10.0)' [notification.button] link = '/docs/introduction/installation/' icon = 'download' diff --git a/hugo/content/en/docs/concept/cue-language-version/index.md b/hugo/content/en/docs/concept/cue-language-version/index.md index 23cc9a3b1..f1bbcead6 100644 --- a/hugo/content/en/docs/concept/cue-language-version/index.md +++ b/hugo/content/en/docs/concept/cue-language-version/index.md @@ -69,7 +69,7 @@ x = 5 // Don't use this old alias syntax! but in more recent CUE versions, this has been changed to: ```cue - let x = 5 +let x = 5 ``` If the language were never to be changed in a backwards incompatible diff --git a/hugo/content/en/docs/concept/how-cue-enables-data-validation/index.md b/hugo/content/en/docs/concept/how-cue-enables-data-validation/index.md index 389a18cb9..5986b5813 100644 --- a/hugo/content/en/docs/concept/how-cue-enables-data-validation/index.md +++ b/hugo/content/en/docs/concept/how-cue-enables-data-validation/index.md @@ -397,7 +397,7 @@ Let's include a JSON Schema file that adds some constraints to a couple of {{< code-tabs >}} {{< code-tab name="schema.json" language="json" area="top-left" >}} { - "$schema": "http://json-schema.org/draft-07/schema", + "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "ExampleType": { "type": "object", diff --git a/hugo/content/en/docs/concept/how-cue-works-with-go/index.md b/hugo/content/en/docs/concept/how-cue-works-with-go/index.md index aa6f4096a..a5499223d 100644 --- a/hugo/content/en/docs/concept/how-cue-works-with-go/index.md +++ b/hugo/content/en/docs/concept/how-cue-works-with-go/index.md @@ -156,8 +156,8 @@ func main() { Before running, we add a dependency on the `cuelang.org/go` module and tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... @@ -237,8 +237,8 @@ age: 99 We finish by adding a dependency on the `cuelang.org/go` module, tidying, and running the program: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQpnbyBydW4gLg==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQpnbyBydW4gLg==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... @@ -312,8 +312,8 @@ func main() { This time we see that CUE correctly caught a problem in our data: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQpnbyBydW4gLg==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQpnbyBydW4gLg==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/concept/how-cue-works-with-json-schema/index.md b/hugo/content/en/docs/concept/how-cue-works-with-json-schema/index.md index c635e5183..67a7f7523 100644 --- a/hugo/content/en/docs/concept/how-cue-works-with-json-schema/index.md +++ b/hugo/content/en/docs/concept/how-cue-works-with-json-schema/index.md @@ -97,7 +97,7 @@ import "strings" @jsonschema(schema="http://json-schema.org/draft-07/schema#") // What is this person called? - name: strings.MinRunes(1) + name!: strings.MinRunes(1) // Where does this person live? address?: strings.MinRunes(1) & strings.MaxRunes(200) @@ -140,7 +140,7 @@ command validates our data against the `#Person` constraint: $ cue vet -d '#Person' schema.cue good.json bad.json name: conflicting values strings.MinRunes(1) and ["Charlie","Cartwright"] (mismatched types string and list): ./bad.json:2:13 - ./schema.cue:10:8 + ./schema.cue:10:9 ``` The `cue vet` command can also validate the data using the JSON Schema directly: diff --git a/hugo/content/en/docs/concept/how-cue-works-with-openapi/index.md b/hugo/content/en/docs/concept/how-cue-works-with-openapi/index.md index a47b25330..d8e195222 100644 --- a/hugo/content/en/docs/concept/how-cue-works-with-openapi/index.md +++ b/hugo/content/en/docs/concept/how-cue-works-with-openapi/index.md @@ -146,8 +146,8 @@ info: { // A Pet is a pet that we handle. #Pet: { // A pet has a name. - name: string - kind: #Kind + name!: string + kind!: #Kind // Centenarian pets are not handled. age?: int & >=0 & <100 diff --git a/hugo/content/en/docs/howto/embed-files-in-cue-evaluation/index.md b/hugo/content/en/docs/howto/embed-files-in-cue-evaluation/index.md index 33a27dbd6..30c05b178 100644 --- a/hugo/content/en/docs/howto/embed-files-in-cue-evaluation/index.md +++ b/hugo/content/en/docs/howto/embed-files-in-cue-evaluation/index.md @@ -28,7 +28,7 @@ This guide demonstrates the following version: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24=" } $ cue version -cue version v0.10.0-rc.1 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... ``` diff --git a/hugo/content/en/docs/howto/handle-errors-go-api/index.md b/hugo/content/en/docs/howto/handle-errors-go-api/index.md index 0366f6773..bde7b68fe 100644 --- a/hugo/content/en/docs/howto/handle-errors-go-api/index.md +++ b/hugo/content/en/docs/howto/handle-errors-go-api/index.md @@ -122,8 +122,8 @@ func main() { {{< step stepNumber="6" >}} Add a dependency on `cuelang.org/go` and ensure the Go module is tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/howto/validate-go-cuego/index.md b/hugo/content/en/docs/howto/validate-go-cuego/index.md index 6d857997c..46cd41704 100644 --- a/hugo/content/en/docs/howto/validate-go-cuego/index.md +++ b/hugo/content/en/docs/howto/validate-go-cuego/index.md @@ -84,8 +84,8 @@ and prints the validation result for each instance. {{< step stepNumber="3" >}} Add a dependency on `cuelang.org/go` and ensure the Go module is tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/howto/validate-json-using-go-api/index.md b/hugo/content/en/docs/howto/validate-json-using-go-api/index.md index 8f3c347c8..885df298f 100644 --- a/hugo/content/en/docs/howto/validate-json-using-go-api/index.md +++ b/hugo/content/en/docs/howto/validate-json-using-go-api/index.md @@ -143,8 +143,8 @@ single JSON file, printing the validation result to its standard output stream. {{< step stepNumber="6" >}} Add a dependency on `cuelang.org/go` and ensure the Go module is tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/howto/walk-schemas-using-go-api/index.md b/hugo/content/en/docs/howto/walk-schemas-using-go-api/index.md index c94751421..6f2075617 100644 --- a/hugo/content/en/docs/howto/walk-schemas-using-go-api/index.md +++ b/hugo/content/en/docs/howto/walk-schemas-using-go-api/index.md @@ -155,8 +155,8 @@ func structToType(name cue.Selector, val cue.Value) { {{< step stepNumber="6" >}} Add a dependency on `cuelang.org/go` and ensure the Go module is tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/howto/write-a-type-switch/index.md b/hugo/content/en/docs/howto/write-a-type-switch/index.md index 2728790ce..2f33fa534 100644 --- a/hugo/content/en/docs/howto/write-a-type-switch/index.md +++ b/hugo/content/en/docs/howto/write-a-type-switch/index.md @@ -51,8 +51,8 @@ output: [for v in input { // Here, isANumber is implemented as a switch. Other, simpler, // representations are also possible. isANumber: [ - if (v & number) != _|_ {true}, - if (v & number) == _|_ {false}, + if (v & number) != _|_ {true}, + if (v & number) == _|_ {false}, ][0] }] {{< /code-tab >}} diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md index 8ed457a32..a94ecf394 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md @@ -71,11 +71,11 @@ definition. name?: string } #Mammal: { - #Base// embedded + #Base // embedded lungCapacityL: number } #Dog: { - #Mammal// embedded + #Mammal // embedded kind!: "dog" house: string } diff --git a/hugo/content/en/docs/language-guide/templating/comprehensions/index.md b/hugo/content/en/docs/language-guide/templating/comprehensions/index.md index 582d82584..b1631a6df 100644 --- a/hugo/content/en/docs/language-guide/templating/comprehensions/index.md +++ b/hugo/content/en/docs/language-guide/templating/comprehensions/index.md @@ -137,11 +137,11 @@ CUE has no switch or if-else construct, but these can be simulated using lists. {{< code-tabs >}} {{< code-tab name="CUE" language="cue" area="top-left" >}} -mem: 2Gi +mem: 2Gi footprint: [// select first - if mem < 1Gi {"small"}, - if mem < 4Gi {"medium"}, - "large", + if mem < 1Gi {"small"}, + if mem < 4Gi {"medium"}, + "large", ][0] {{< /code-tab >}} {{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} diff --git a/hugo/content/en/docs/language-guide/templating/references/index.md b/hugo/content/en/docs/language-guide/templating/references/index.md index 2929c810e..f1fa48fa1 100644 --- a/hugo/content/en/docs/language-guide/templating/references/index.md +++ b/hugo/content/en/docs/language-guide/templating/references/index.md @@ -181,7 +181,7 @@ merging two maps. {{< code-tabs >}} {{< code-tab name="CUE" language="cue" area="top-left" >}} - let X = {list: []} +let X = {list: []} a: X b: X c: X diff --git a/hugo/content/en/docs/reference/command/cue-help-embed/index.md b/hugo/content/en/docs/reference/command/cue-help-embed/index.md new file mode 100644 index 000000000..f07004a29 --- /dev/null +++ b/hugo/content/en/docs/reference/command/cue-help-embed/index.md @@ -0,0 +1,47 @@ +--- +WARNING: "Code generated site_tool.cue; DO NOT EDIT." +title: "cue help embed" +aliases: ["/docs/reference/cli/cue-embed/"] +weight: 1000 +tags: +- cue command +--- + +```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgZW1iZWQ=" } +$ cue help embed +The @embed attribute can be used to load files as part of CUE evaluation. +Embedding must be enabled by a file-level @extern(embed) attribute. + +Embed a single file as follows, which must exist when evaluating: + + @extern(embed) + + package foo + + a: _ @embed(file=foo.json) + +Embed many files of the same type with a glob pattern, +which inserts one field per file matched: + + b: _ @embed(glob=images/*.*, type=binary) + b: [string]: bytes + +Note that "**" glob patterns are not supported at this time. + +If the file extension in "file" or "glob" does not imply a file type, +it must be specified with the "type" encoding as shown above. +See the "filetypes" help topic for more. + +Files containing multiple documents cannot be embedded directly. +For NDJSON or multi-document YAML files, embed as type=text +and use APIs like yaml.Extract to decode as a list. + +Note that embedding cue files is not supported at this time. + +Note: support for embed is experimental, and is enabled via +CUE_EXPERIMENT=embed. + +For more details and discussion, see the proposal linked from +https://cuelang.org/discussion/3264. + +``` diff --git a/hugo/content/en/docs/reference/command/cue-help-environment/index.md b/hugo/content/en/docs/reference/command/cue-help-environment/index.md index 8f6f04230..94c510cb0 100644 --- a/hugo/content/en/docs/reference/command/cue-help-environment/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-environment/index.md @@ -48,6 +48,9 @@ If an environment variable is unset or empty, sensible default setting is used. evalv3 Enable the new CUE evaluator, addressing performance issues and bringing a better disjunction algorithm. + embed + Enable support for embedded data files as described in + https://cuelang.org/discussion/3264. CUE_DEBUG Comma-separated list of debug flags to enable or disable, such as: diff --git a/hugo/content/en/docs/reference/command/cue-help-filetypes/index.md b/hugo/content/en/docs/reference/command/cue-help-filetypes/index.md index 2e9c05985..8ec3e1890 100644 --- a/hugo/content/en/docs/reference/command/cue-help-filetypes/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-filetypes/index.md @@ -15,7 +15,8 @@ The cue tools supports the following file types: cue .cue CUE source files. json .json JSON files. yaml .yaml/.yml YAML files. - jsonl .jsonl/.ldjson Line-separated JSON values. + toml .toml TOML files + jsonl .jsonl/.ndjson Line-separated JSON values. jsonschema JSON Schema. openapi OpenAPI schema. pb Use Protobuf mappings (e.g. json+pb) diff --git a/hugo/content/en/docs/reference/command/cue-help-get/index.md b/hugo/content/en/docs/reference/command/cue-help-get/index.md index 53a9c357c..c703457ba 100644 --- a/hugo/content/en/docs/reference/command/cue-help-get/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-get/index.md @@ -9,16 +9,19 @@ tags: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgZ2V0" } $ cue help get -Get downloads packages or modules for CUE or another language +Get downloads packages or modules for non-CUE languages to include them in the module's pkg directory. Get requires an additional language field to determine for which -language definitions should be fetched. If get fetches definitions -for a language other than CUE, the definitions are extracted from -the source of the respective language and stored. -The specifics on how dependencies are fechted and converted vary +language definitions should be fetched. Definitions are extracted +from the source of the respective language and stored. +The specifics on how dependencies are fetched and converted vary per language and are documented in the respective subcommands. +For information on native CUE modules: + + cue help modules + Usage: cue get [packages] [flags] cue get [command] diff --git a/hugo/content/en/docs/reference/command/cue-help-import/index.md b/hugo/content/en/docs/reference/command/cue-help-import/index.md index 32eea575a..4a6b23bfe 100644 --- a/hugo/content/en/docs/reference/command/cue-help-import/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-import/index.md @@ -18,8 +18,9 @@ more info). This behavior can be overridden by specifying one of the following modes: Mode Extensions - json Look for JSON files (.json, .jsonl, .ldjson). + json Look for JSON files (.json .jsonl .ndjson). yaml Look for YAML files (.yaml .yml). + toml Look for TOML files (.toml). text Look for text files (.txt). binary Look for files with extensions specified by --ext and interpret them as binary. @@ -219,7 +220,7 @@ Usage: cue import [mode] [inputs] [flags] Flags: - --dry-run only run simulation + --dry-run show what files would be created --ext stringArray match files with these extensions --files split multiple entries into different files -f, --force force overwriting existing files diff --git a/hugo/content/en/docs/reference/command/cue-help-injection/index.md b/hugo/content/en/docs/reference/command/cue-help-injection/index.md index 59a5ffe03..78229d1cf 100644 --- a/hugo/content/en/docs/reference/command/cue-help-injection/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-injection/index.md @@ -18,7 +18,8 @@ Injecting files A "build" attribute defines a boolean expression that causes a file to only be included in a build if its expression evaluates to true. There may only be a single @if attribute per file and it must -appear before a package clause. +appear before a package clause, or before any CUE declarations +if there is no package clause. The expression is a subset of CUE consisting only of identifiers and the operators &&, ||, !, where identifiers refer to tags @@ -32,6 +33,19 @@ if the user includes the flag "-t prod" on the command line. package foo +Ignoring files + +An "ignore" attribute causes a file to be unconditionally excluded +from a build. The @ignore attribute must appear before a package +clause or before any other CUE syntax if there is no package clause. + +For example: + + @ignore() + + // This file will be excluded for all purposes. + + package foo Injecting values diff --git a/hugo/content/en/docs/reference/command/cue-help-inputs/index.md b/hugo/content/en/docs/reference/command/cue-help-inputs/index.md index 391f40982..e16150ed0 100644 --- a/hugo/content/en/docs/reference/command/cue-help-inputs/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-inputs/index.md @@ -19,21 +19,43 @@ the package in the current directory, provided there is a single named package in this directory. CUE packages are specified as an import path. An import path -that is a rooted path --one that begins with a "." or ".." -element-- is interpreted as a file system path and denotes the +that begins with a "." or ".." element is a relative import path, +is interpreted as a file system path, and denotes the package instance in that directory. -Otherwise, the import path P denotes an external package found -in cue.mod/{pkg|gen|usr}/P. +Otherwise, the import path P is absolute and denotes a package that +may be external, usually found in an external registry. It may also +refer to a package in cue.mod/{pkg|gen|usr}/P - this is legacy +behavior that might be removed at a later date. -An import path may contain one or more "..." to match any -subdirectory: pkg/... matches all packages below pkg, including -pkg itself, while foo/.../bar matches all directories named bar -within foo. In all cases, directories containing cue.mod -directories are excluded from the result. +An absolute import path is of the form P or P@vN where vN is the major +version of the module containing the package. An import path is mapped +to a registry location by consulting cue.mod/module.cue and the +registry configuration (see "cue help modules" and "cue help +registryconfig" for more details). + +An import may contain a ":name" suffix to indicate a specific +package to load within a given path. It is necessary to specify this +when there is more than one package at the path. + +For example, the following import path specifies a package +named "other" in some external module with major version v1. + + foo.example/bar/baz@v1:other + +A local import path may contain one or more "..." to match any +subdirectory: pkg/... matches all packages below pkg, including pkg +itself, while foo/.../bar matches all directories named bar within +foo. In all cases, directories containing cue.mod directories are +excluded from the result. "..." is not currently supported in external +import paths. Directory and file names that begin with "." or "_" are ignored, -unless explicitly listed as inputs. +unless explicitly listed as inputs. File with names ending "_tool.cue" +are ignored unless running "cue cmd" and they are in packages +explicitly mentioned on the command line. Files with names ending +"_test.cue" are ignored for the time being; they are reserved for +future testing functionality. A package may also be specified as a list of .cue files. The special symbol '-' denotes stdin or stdout and defaults to diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-edit/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-edit/index.md index 54650684f..e91531703 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-edit/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-edit/index.md @@ -32,11 +32,12 @@ Usage: cue mod edit [flags] Flags: - --drop-require string remove a requirement - --drop-source remove the source field (default ) - --module string set the module path - --require string add a required module@version - --source string set the source field + --drop-require string remove a requirement + --drop-source remove the source field (default ) + --language-version string set language.version ('current' means current language version) + --module string set the module path + --require string add a required module@version + --source string set the source field Global Flags: -E, --all-errors print all available errors diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-init/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-init/index.md index a0db30bad..e047aae61 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-init/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-init/index.md @@ -14,16 +14,16 @@ creating a new module rooted at the current directory. The cue.mod directory must not already exist. A legacy cue.mod file in the current directory is moved to the new subdirectory. -A module name is optional, but if it is not given, a package -within the module cannot import another package defined -in the module. +If the module name is not provided, a default module path (cue.example) will be +used. Usage: cue mod init [module] [flags] Flags: - -f, --force force moving old-style cue.mod file - --source string set the source field + -f, --force force moving old-style cue.mod file + --language-version string set the language version ('current' means current language version) (default "current") + --source string set the source field Global Flags: -E, --all-errors print all available errors diff --git a/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md b/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md index d7fa7a2f4..b6bb9a5bf 100644 --- a/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-mod-resolve/index.md @@ -21,10 +21,14 @@ with respect to the registry configuration (see "cue help registryconfig") and does not make any network calls to check whether the module exists. +If no arguments are provided, the current module path is used. +This is equivalent to specifying "." as an argument, which +also refers to the current module. + Note that this command is not yet stable and may be changed. Usage: - cue mod resolve [@] ... [flags] + cue mod resolve [[@] ...] [flags] Global Flags: -E, --all-errors print all available errors diff --git a/hugo/content/en/docs/reference/command/cue-help-modules/index.md b/hugo/content/en/docs/reference/command/cue-help-modules/index.md index baeebee5f..af06be4d7 100644 --- a/hugo/content/en/docs/reference/command/cue-help-modules/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-modules/index.md @@ -15,10 +15,22 @@ A module is a collection of packages that are released, versioned, and distributed together. Modules are downloaded from OCI-compliant artifact registries. +The Central Registry for CUE modules (registry.cue.works) is +used as the source for external modules by default. + For a detailed reference on modules: https://cuelang.org/docs/reference/modules/ +For information on commands that interact with modules: + + cue help mod + +For tutorials on how to use the Central Registry, see: + + https://cuelang.org/docs/tutorial/working-with-the-central-registry/ + https://cuelang.org/docs/tutorial/publishing-modules-to-the-central-registry/ + For a tutorial on how to work with a custom OCI registry for CUE modules: https://cuelang.org/docs/tutorial/working-with-a-custom-module-registry/ diff --git a/hugo/content/en/docs/reference/command/cue-help-registryconfig/index.md b/hugo/content/en/docs/reference/command/cue-help-registryconfig/index.md index c988a8ff3..aa3053490 100644 --- a/hugo/content/en/docs/reference/command/cue-help-registryconfig/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-registryconfig/index.md @@ -16,8 +16,8 @@ Given a particular registry configuration, it's possible to work what registry a given module is stored in, and what repository within that registry, without making any network calls. -If no explicit registry configuration is present, a default central registry -(registry.cue.works) will be used for all modules. +If no explicit registry configuration is present, a default Central Registry +(registry.cue.works) is used for all modules. The simplest way of specifying a registry configuration is to set $CUE_REGISTRY to the hostname of that registry. diff --git a/hugo/content/en/docs/reference/command/cue-help-trim/index.md b/hugo/content/en/docs/reference/command/cue-help-trim/index.md index 0607853dc..662a2446a 100644 --- a/hugo/content/en/docs/reference/command/cue-help-trim/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-trim/index.md @@ -60,6 +60,7 @@ Usage: cue trim [flags] Flags: + -n, --dry-run only run simulation -f, --force force overwriting existing files -o, --outfile string filename or - for stdout with optional file prefix (run 'cue filetypes' for more info) diff --git a/hugo/content/en/docs/reference/command/cue-help-vet/index.md b/hugo/content/en/docs/reference/command/cue-help-vet/index.md index effe14aee..766d4f05f 100644 --- a/hugo/content/en/docs/reference/command/cue-help-vet/index.md +++ b/hugo/content/en/docs/reference/command/cue-help-vet/index.md @@ -23,6 +23,7 @@ currently supported: Format Extensions JSON .json .jsonl .ndjson YAML .yaml .yml + TOML .toml TEXT .txt (validate a single string value) To activate this mode, the non-cue files must be explicitly mentioned on the diff --git a/hugo/content/en/docs/reference/command/cue-help/index.md b/hugo/content/en/docs/reference/command/cue-help/index.md index 0d79de1d2..04cc7bf42 100644 --- a/hugo/content/en/docs/reference/command/cue-help/index.md +++ b/hugo/content/en/docs/reference/command/cue-help/index.md @@ -40,8 +40,8 @@ Available Commands: export output data in a standard format fix rewrite packages to latest standards fmt formats CUE configuration files - get add dependencies to the current module - help Help about any command + get add non-CUE dependencies to the current module + help show help text for a command or topic import convert other formats to CUE files login log into a CUE registry mod module maintenance @@ -59,6 +59,7 @@ Flags: Additional help topics: cue commands user-defined commands + cue embed file embedding cue environment environment variables cue filetypes supported file types and qualifiers cue flags common flags for composing packages diff --git a/hugo/content/en/docs/reference/spec/index.md b/hugo/content/en/docs/reference/spec/index.md index 8e41a0d40..272c6ef31 100644 --- a/hugo/content/en/docs/reference/spec/index.md +++ b/hugo/content/en/docs/reference/spec/index.md @@ -2994,7 +2994,12 @@ PackageClause = "package" PackageName . PackageName = identifier . ``` -The PackageName must not be the blank identifier or a definition identifier. +The PackageName must not be a definition identifier. + +If the PackageName is the blank identifier (`_`), it is treated the same +as if there were no package clause. This can be useful to allow adding +package level attributes or doc comments to a CUE file without a package +name. ``` package math diff --git a/hugo/content/en/docs/tutorial/converting-json-schema-to-cue/index.md b/hugo/content/en/docs/tutorial/converting-json-schema-to-cue/index.md index bf0055a26..90c3bf3fe 100644 --- a/hugo/content/en/docs/tutorial/converting-json-schema-to-cue/index.md +++ b/hugo/content/en/docs/tutorial/converting-json-schema-to-cue/index.md @@ -43,7 +43,7 @@ This tutorial is written using the following version of `cue`: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24=" } $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... ``` @@ -123,13 +123,13 @@ package cuisine #restaurant: { @jsonschema(schema="http://json-schema.org/draft-07/schema#") - name: string - cuisine: string - tables: [...#table] + name!: string + cuisine!: string + tables!: [...#table] #table: { - seats: >=2 & <=10 - view?: bool + seats!: >=2 & <=10 + view?: bool } } {{< /code-tab >}}{{< /code-tabs >}} @@ -174,7 +174,7 @@ Validate the data using the schema and constraints: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZldCAtZCAnI3Jlc3RhdXJhbnQnIHNjaGVtYS5jdWUgKi55bWw=" } $ cue vet -d '#restaurant' schema.cue *.yml tables.0.seats: invalid value 100 (out of bound <=10): - ./schema.cue:10:16 + ./schema.cue:10:17 ./pomodoro.yml:4:12 ``` diff --git a/hugo/content/en/docs/tutorial/loading-cue-go-api/index.md b/hugo/content/en/docs/tutorial/loading-cue-go-api/index.md index 659a98c39..a5e324ec3 100644 --- a/hugo/content/en/docs/tutorial/loading-cue-go-api/index.md +++ b/hugo/content/en/docs/tutorial/loading-cue-go-api/index.md @@ -30,7 +30,7 @@ This tutorial is written using the following versions of `go` and `cue`: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24KZ28gdmVyc2lvbg==" } $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go version go version go1.23.0 linux/amd64 @@ -128,8 +128,8 @@ func main() { {{< step stepNumber="6" >}} Add a dependency on `cuelang.org/go` and ensure the Go module is tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/tutorial/publishing-modules-to-the-central-registry/index.md b/hugo/content/en/docs/tutorial/publishing-modules-to-the-central-registry/index.md index da08e1a50..32986d25b 100644 --- a/hugo/content/en/docs/tutorial/publishing-modules-to-the-central-registry/index.md +++ b/hugo/content/en/docs/tutorial/publishing-modules-to-the-central-registry/index.md @@ -51,7 +51,7 @@ This tutorial is written using the following version of `cue`: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24=" } $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... ``` @@ -267,7 +267,7 @@ We can see that the dependencies have now been added to the $ cat cue.mod/module.cue module: "github.com/cueckoo/frostyapp@v0" language: { - version: "v0.9.2" + version: "v0.10.0" } source: { kind: "git" diff --git a/hugo/content/en/docs/tutorial/using-modules-with-go-api/index.md b/hugo/content/en/docs/tutorial/using-modules-with-go-api/index.md index 5f6b6e2b6..098330829 100644 --- a/hugo/content/en/docs/tutorial/using-modules-with-go-api/index.md +++ b/hugo/content/en/docs/tutorial/using-modules-with-go-api/index.md @@ -39,7 +39,7 @@ This tutorial uses the following version of CUE: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24=" } $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... ``` @@ -192,8 +192,8 @@ and then prints a message based on the `config` field. {{< step stepNumber="8" >}} Add a dependency on `cuelang.org/go` and ensure the Go module is tidy: -```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjkuMgpnbyBtb2QgdGlkeQ==" } -$ go get cuelang.org/go@v0.9.2 +```text { title="TERMINAL" type="terminal" codeToCopy="Z28gZ2V0IGN1ZWxhbmcub3JnL2dvQHYwLjEwLjAtcmMuMS4wLjIwMjQwODE0MTAwMzAzLWRjM2JhMzAzMjJjYQpnbyBtb2QgdGlkeQ==" } +$ go get cuelang.org/go@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... $ go mod tidy ... diff --git a/hugo/content/en/docs/tutorial/working-with-a-custom-module-registry/index.md b/hugo/content/en/docs/tutorial/working-with-a-custom-module-registry/index.md index 10bcb9881..0258dc83a 100644 --- a/hugo/content/en/docs/tutorial/working-with-a-custom-module-registry/index.md +++ b/hugo/content/en/docs/tutorial/working-with-a-custom-module-registry/index.md @@ -41,7 +41,7 @@ This tutorial is written using the following version of `cmd/cue`: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24=" } $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... ``` @@ -296,7 +296,7 @@ We can see that the dependencies have now been added to the $ cat cue.mod/module.cue module: "glacial-tech.example/frostyapp@v0" language: { - version: "v0.9.2" + version: "v0.10.0" } source: { kind: "git" @@ -446,7 +446,7 @@ Here is what the `cue.mod/module.cue` file now looks like: $ cat cue.mod/module.cue module: "glacial-tech.example/frostyapp@v0" language: { - version: "v0.9.2" + version: "v0.10.0" } source: { kind: "git" diff --git a/hugo/content/en/docs/tutorial/working-with-the-central-registry/index.md b/hugo/content/en/docs/tutorial/working-with-the-central-registry/index.md index 956752eca..653e54bbd 100644 --- a/hugo/content/en/docs/tutorial/working-with-the-central-registry/index.md +++ b/hugo/content/en/docs/tutorial/working-with-the-central-registry/index.md @@ -24,7 +24,7 @@ Note that this guide depends on a pre-release version of CUE: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIHZlcnNpb24=" } $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca ... ``` @@ -108,7 +108,7 @@ We can see that the dependencies have now been added to the `cue.mod/module.cue` $ cat cue.mod/module.cue module: "glacial-tech.example/frostyapp@v0" language: { - version: "v0.9.2" + version: "v0.10.0" } deps: { "github.com/cue-labs/examples/frostyconfig@v0": { diff --git a/internal/cmd/preprocessor/cmd/_docker/Dockerfile b/internal/cmd/preprocessor/cmd/_docker/Dockerfile index 3ccd18b50..a0f0eb439 100644 --- a/internal/cmd/preprocessor/cmd/_docker/Dockerfile +++ b/internal/cmd/preprocessor/cmd/_docker/Dockerfile @@ -21,13 +21,7 @@ RUN \ --mount=type=cache,target=/cache/gocache \ --mount=type=cache,target=/cache/gomodcache \ export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache && \ - GOBIN=/cues/v0.10.0-rc.1 go install -trimpath cuelang.org/go/cmd/cue@v0.10.0-rc.1 - -RUN \ - --mount=type=cache,target=/cache/gocache \ - --mount=type=cache,target=/cache/gomodcache \ - export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache && \ - GOBIN=/cues/v0.9.2 go install -trimpath cuelang.org/go/cmd/cue@v0.9.2 + GOBIN=/cues/v0.10.0-rc.1.0.20240814100303-dc3ba30322ca go install -trimpath cuelang.org/go/cmd/cue@v0.10.0-rc.1.0.20240814100303-dc3ba30322ca RUN git clone https://github.com/cue-lang/libcue.git /libcue RUN git -C /libcue reset --hard 1c861cc9cdc5584f5d26b0a7112aa2afee74d4cf @@ -43,14 +37,14 @@ ENV LC_ALL=C.UTF-8 # Default to the default value of CUE. Guides can fix to a different # version explicitly -ENV PATH="/cues/v0.9.2:${PATH}" +ENV PATH="/cues/v0.10.0-rc.1.0.20240814100303-dc3ba30322ca:${PATH}" ENV PATH="/go/bin:/usr/local/go/bin:${PATH}" -ENV CUELANG_CUE_LATEST="v0.9.2" -ENV CUELANG_CUE_PRERELEASE="v0.10.0-rc.1" -ENV CUELANG_CUE_TIP="v0.10.0-rc.1" -ENV CUELANG_CUE_DEFAULT="v0.9.2" -ENV CUELANG_CUE_PLAYGROUND="v0.9.2" +ENV CUELANG_CUE_LATEST="v0.10.0-rc.1.0.20240814100303-dc3ba30322ca" +ENV CUELANG_CUE_PRERELEASE="v0.10.0-rc.1.0.20240814100303-dc3ba30322ca" +ENV CUELANG_CUE_TIP="v0.10.0-rc.1.0.20240814100303-dc3ba30322ca" +ENV CUELANG_CUE_DEFAULT="v0.10.0-rc.1.0.20240814100303-dc3ba30322ca" +ENV CUELANG_CUE_PLAYGROUND="v0.10.0-rc.1.0.20240814100303-dc3ba30322ca" WORKDIR / @@ -63,8 +57,7 @@ RUN chmod 755 /usr/bin/entrypoint.sh RUN chown root:root /usr/bin/entrypoint.sh COPY --from=build /go/bin/testscript /go/bin -COPY --from=build /cues/v0.10.0-rc.1/cue /cues/v0.10.0-rc.1/cue -COPY --from=build /cues/v0.9.2/cue /cues/v0.9.2/cue +COPY --from=build /cues/v0.10.0-rc.1.0.20240814100303-dc3ba30322ca/cue /cues/v0.10.0-rc.1.0.20240814100303-dc3ba30322ca/cue COPY --from=build /libcue/libcue.so /usr/local/lib/ ENV LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" diff --git a/internal/cmd/preprocessor/cmd/gen_dockerimagetag.go b/internal/cmd/preprocessor/cmd/gen_dockerimagetag.go index 118c6b960..cabd3f779 100644 --- a/internal/cmd/preprocessor/cmd/gen_dockerimagetag.go +++ b/internal/cmd/preprocessor/cmd/gen_dockerimagetag.go @@ -2,4 +2,4 @@ package cmd -const dockerImageTag = "preprocessor:6dc1dbef277ff1c955a57c8f9b09a85471a3c2f8bf9abe011b384ea5bb79d3e9" +const dockerImageTag = "preprocessor:117e462be5c3b7548885d9f976575dbb26873783e6d4df3bb734ffd53985e1eb" diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_multistagescript.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_multistagescript.txtar index ffd5253db..cadfb5e6d 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_multistagescript.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_multistagescript.txtar @@ -258,17 +258,17 @@ hello ```text { title="TERMINAL" type="terminal" codeToCopy="ZXhwb3J0IE1ZVkFSPXZhbHVlCmN1ZSB2ZXJzaW9u" } $ export MYVAR=value $ cue version -cue version v0.9.2 +cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca go version go1.23.0 -buildmode exe -compiler gc -trimpath true - DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1 + DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1 CGO_ENABLED 0 GOARCH amd64 GOOS linux -cue.lang.version v0.9.2 +cue.lang.version v0.10.0 ``` ```text { title="TERMINAL" type="terminal" codeToCopy="bm9uZXhpc3RlbnQgY29tbWFuZA==" } $ nonexistent command @@ -292,12 +292,12 @@ package site page: { cache: { upload: { - "hidden file": "snCOihpLT5b1MXRX3mU1j3DzwbbIiKMhcPC2DAeemIQ=" - "upload-some-cue": "NXriwkn3N/ysVShF1n7DN2tRrXof3PGbVneEK/KsOrI=" - "in-subdir": "UNEq3fovzVRJaDkAGL5+LB7Tt7fkaX6unvrhJ8uxR8Q=" + "hidden file": "yMlXlGoGVkTrWOdoBSUTdytAiUGalSWceubGzFSz9SE=" + "upload-some-cue": "GAldkCM8NF2Ff9zSTfRuacSZ5iuE4uQ9pSrdkamAs4Q=" + "in-subdir": "LCLvxyGwIGCw2EdOx7nKWE4Qcz2eeGLejtmydzNKoDk=" } multi_step: { - hash: "MLKEF3HRI2IDIKB8G2UEKC8R601SBIQB0JNA7RPPHV02D8IE67TG====" + hash: "OI2PMH79AI5GE40K5JRLOKB5N2S385P339EL4VOPBPQ5JENHBL1G====" scriptHash: "RTE18RDQ3BFG4B5U2VR92496OPO5NOT61C424QBCDDT1RAAGPOUG====" steps: [{ doc: "" @@ -359,17 +359,17 @@ package site cmd: "cue version" exitCode: 0 output: """ - cue version v0.9.2 + cue version v0.10.0-rc.1.0.20240814100303-dc3ba30322ca go version go1.23.0 -buildmode exe -compiler gc -trimpath true - DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1 + DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1 CGO_ENABLED 0 GOARCH amd64 GOOS linux - cue.lang.version v0.9.2 + cue.lang.version v0.10.0 """ }, { diff --git a/playground/src/config/gen_cuelang_org_go_version.ts b/playground/src/config/gen_cuelang_org_go_version.ts index c3cf1f642..5a82ea44f 100644 --- a/playground/src/config/gen_cuelang_org_go_version.ts +++ b/playground/src/config/gen_cuelang_org_go_version.ts @@ -1,3 +1,3 @@ // Code generated site_tool.cue; DO NOT EDIT. -export const CUEVersion = 'v0.9.2'; +export const CUEVersion = 'v0.10.0-rc.1.0.20240814100303-dc3ba30322ca'; diff --git a/site.cue b/site.cue index d908e0494..20ac209bd 100644 --- a/site.cue +++ b/site.cue @@ -15,10 +15,10 @@ versions: { cue: { [x=string]: var: "CUELANG_CUE_\(strings.ToUpper(x))" latest: { - v: "v0.9.2" + v: "v0.10.0-rc.1.0.20240814100303-dc3ba30322ca" majorDotMinor: strings.Join(list.Take(strings.Split(v, "."), 2), ".") } - prerelease: v: "v0.10.0-rc.1" + prerelease: v: latest.v tip: v: prerelease.v default: v: latest.v playground: v: latest.v