From 1bfb8d4369e06df84b9ee459212a14a783afe2aa Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Mon, 7 Jun 2021 11:53:03 +0200 Subject: [PATCH 1/3] cmd/doc: fixed outputs label Signed-off-by: Sam Alba --- cmd/dagger/cmd/doc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/dagger/cmd/doc.go b/cmd/dagger/cmd/doc.go index d823165e..25560883 100644 --- a/cmd/dagger/cmd/doc.go +++ b/cmd/dagger/cmd/doc.go @@ -149,7 +149,6 @@ func loadCode(packageName string) (*compiler.Value, error) { // printValuesText (text) formats an array of Values on stdout func printValuesText(iw io.Writer, libName string, values []*compiler.Value) { - fmt.Fprintf(iw, "\n%sInputs:\n", textPadding) w := tabwriter.NewWriter(iw, 0, 4, len(textPadding), ' ', 0) for _, i := range values { docStr := terminalTrim(common.ValueDocString(i)) @@ -261,6 +260,7 @@ func PrintDoc(ctx context.Context, w io.Writer, packageName string, val *compile fmt.Fprintf(w, "\n%sInputs: none\n", textPadding) break } + fmt.Fprintf(w, "\n%sInputs:\n", textPadding) printValuesText(w, name, inp) case markdownFormat: fmt.Fprintf(w, "#### %s Inputs\n\n", mdEscape(name)) @@ -281,6 +281,7 @@ func PrintDoc(ctx context.Context, w io.Writer, packageName string, val *compile fmt.Fprintf(w, "\n%sOutputs: none\n", textPadding) break } + fmt.Fprintf(w, "\n%sOutputs:\n", textPadding) printValuesText(w, name, out) case markdownFormat: fmt.Fprintf(w, "#### %s Outputs\n\n", mdEscape(name)) From 872822baa679a311892db61a6c11d31cd8b14b9a Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Mon, 7 Jun 2021 13:26:47 +0200 Subject: [PATCH 2/3] stdlib: fixed yarn outputs Signed-off-by: Sam Alba --- stdlib/js/yarn/yarn.cue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/js/yarn/yarn.cue b/stdlib/js/yarn/yarn.cue index cefb2f29..47393166 100644 --- a/stdlib/js/yarn/yarn.cue +++ b/stdlib/js/yarn/yarn.cue @@ -17,16 +17,16 @@ import ( // Extra alpine packages to install package: { - [string]: true | false | string @dagger(input) - } + [string]: true | false | string + } @dagger(input) // working directory to use cwd: *"." | string @dagger(input) // Environment variables env: { - [string]: string @dagger(input) - } + [string]: string + } @dagger(input) // Write the contents of `environment` to this file, // in the "envfile" format. From a7f4cd069fb1eca21a746e483fd321f5dc49d7a0 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Mon, 7 Jun 2021 13:27:40 +0200 Subject: [PATCH 3/3] cmd/output: do not display cue code when value is a struct Signed-off-by: Sam Alba --- cmd/dagger/cmd/common/common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/dagger/cmd/common/common.go b/cmd/dagger/cmd/common/common.go index 712757f2..b2f2f847 100644 --- a/cmd/dagger/cmd/common/common.go +++ b/cmd/dagger/cmd/common/common.go @@ -112,6 +112,10 @@ func FormatValue(val *compiler.Value) string { if val.IsConcreteR() != nil { return val.IncompleteKindString() } + if val.IncompleteKindString() == "struct" { + return "struct" + } + // value representation in Cue valStr := fmt.Sprintf("%v", val.Cue()) // escape \n