diff --git a/internal/filetypes/filetypes.go b/internal/filetypes/filetypes.go index 8c5f3a9c6..b813e6f32 100644 --- a/internal/filetypes/filetypes.go +++ b/internal/filetypes/filetypes.go @@ -320,7 +320,7 @@ func parseType(scope string, mode Mode) (modeVal, fileVal cue.Value, _ error) { if ok { fileVal = fileVal.FillPath(cue.MakePath(cue.Str("tags"), cue.Str(tagName)), tagVal) } else { - info := typesValue.LookupPath(cue.MakePath(cue.Str("tags"), cue.Str(tag))) + info := typesValue.LookupPath(cue.MakePath(cue.Str("tagInfo"), cue.Str(tag))) if !info.Exists() { return cue.Value{}, cue.Value{}, errors.Newf(token.NoPos, "unknown filetype %s", tag) } diff --git a/internal/filetypes/types.cue b/internal/filetypes/types.cue index 6fc5b7e20..e30141d1e 100644 --- a/internal/filetypes/types.cue +++ b/internal/filetypes/types.cue @@ -26,6 +26,7 @@ package build encoding!: #Encoding interpretation?: #Interpretation form?: #Form + // Note: tags includes values for non-boolean tags only. tags?: [string]: string } @@ -162,23 +163,23 @@ modes: [string]: { // extensions maps a file extension to its associated default file properties. extensions: { // "": _ - ".cue": tags.cue - ".json": tags.json - ".jsonl": tags.jsonl - ".ldjson": tags.jsonl - ".ndjson": tags.jsonl - ".yaml": tags.yaml - ".yml": tags.yaml - ".toml": tags.toml - ".txt": tags.text - ".go": tags.go - ".wasm": tags.binary - ".proto": tags.proto - ".textproto": tags.textproto - ".textpb": tags.textproto // perhaps also pbtxt + ".cue": tagInfo.cue + ".json": tagInfo.json + ".jsonl": tagInfo.jsonl + ".ldjson": tagInfo.jsonl + ".ndjson": tagInfo.jsonl + ".yaml": tagInfo.yaml + ".yml": tagInfo.yaml + ".toml": tagInfo.toml + ".txt": tagInfo.text + ".go": tagInfo.go + ".wasm": tagInfo.binary + ".proto": tagInfo.proto + ".textproto": tagInfo.textproto + ".textpb": tagInfo.textproto // perhaps also pbtxt // TODO: jsonseq, - // ".pb": tags.binpb // binarypb + // ".pb": tagInfo.binpb // binarypb } // encodings: "": error("no encoding specified") @@ -327,8 +328,8 @@ interpretations: pb: { stream: true } -// tags maps command line tags to file properties. -tags: { +// tagInfo maps command line tags to file properties. +tagInfo: { schema: form: "schema" graph: form: "graph" dag: form: "dag"