From 7d152f4b64f5b686c287239386791dc6d9ba76c0 Mon Sep 17 00:00:00 2001 From: Jonathan Matthews Date: Fri, 15 Nov 2024 17:25:23 +0000 Subject: [PATCH] internal/patch: fix tutorial gold content for tip This updates the patch that permits the site to build against the tip of cue-lang/cue to cope with changes from https://cuelang.org/cl/1202854 where an explicit `close()` can be included when importing JSON Schema documents. Manual changes to fix this problem (i.e. in the patch) are required as the preprocessor's --update flag doesn't currently cater for in-page use of manual "diff" commands. A comment will be left in cue-lang/cue#2798 requesting that any solution to that issue should consider scenarios like this. Signed-off-by: Jonathan Matthews Change-Id: I67de3abbff568b857c5215ccb5568c07bd19307a Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1204138 Reviewed-by: Paul Jolly TryBot-Result: CUEcueckoo --- internal/patch/tip.diff | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/internal/patch/tip.diff b/internal/patch/tip.diff index ced11b380..f79c455c1 100644 --- a/internal/patch/tip.diff +++ b/internal/patch/tip.diff @@ -11,3 +11,29 @@ index 771d24ec..ea3def82 100755 do rsync -a --relative --delete $td/$path@$version/internal/./$i/ ./internal/cuelang_org_go_internal/ find ./internal/cuelang_org_go_internal/$i -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} + +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 cccda35d..461cb965 100644 +--- a/content/docs/tutorial/converting-json-schema-to-cue/en.md ++++ b/content/docs/tutorial/converting-json-schema-to-cue/en.md +@@ -128,14 +128,16 @@ package cuisine + + #restaurant: { + @jsonschema(schema="http://json-schema.org/draft-07/schema#") +- name!: string +- cuisine!: string +- tables!: [...#table] ++ close({ ++ name!: string ++ cuisine!: string ++ tables!: [...#table] ++ }) + +- #table: { ++ #table: close({ + seats!: >=2 & <=10 + view?: bool +- } ++ }) + } + {{{end}}} +