Replies: 5 comments 1 reply
-
Not sure if you're still looking at this, but I've been writing encoders / decoders that work on either the cue Syntax tree or Value tree for python and markdown. I've done it using cue/cue and having a look at cue's own parser, it's not been too bad. I imagine that, generally, the translators for various languages will look very similar. Can you share your experience of doing it with cue/cmd? |
Beta Was this translation helpful? Give feedback.
-
Well, I believe I am looking into a similar problem: manipulating CUE files via a gui tool. The gui tool would be used to build the structure of elements we are defining. As our model schemas are defined in CUE, we would like to produce a representation tat can be managed by the visual tool (javascript). I would be interested in pointers to where to start from. Ideally, there would alredy be something fully/half available. |
Beta Was this translation helpful? Give feedback.
-
You can use the Cue This is essentially what my https://github.com/hofstadter-io/hof does behind the scenes using the Cue Go API. You could do the same with pure Cue too. We use the Go API because it opens up more possibilities and is more efficient when purpose built for this task. |
Beta Was this translation helpful? Give feedback.
-
In addition, we are moving much of the functionality of the In that vain, ik makes sense to also allow adaptors for different file types of some kind that can be added to the |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#482. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm investigating using Cue as the source schema to define the shape of various entities within a system I am building.
Using Cue, I can validate YAML and JSON documents that contain objects that are defined by the schema I provide.
However, I wish to provide integrations that allow other tools to then consume these schemas too. Initial proof of concept requires GraphQL (Schema) and Rust (Struct)
Example:
I know this is old Cue, I need to update soon.
Should output GraphQL like such:
and Rust, like such:
I'm currently looking into how I can use
cue/cmd
to do this, and I've received a few tips from @myitcv.Starting this discussion to see if others are doing the same and could potentially provide some examples to speed me up.
Also to discuss these encodings being part of Cue, if others are looking for this.
Beta Was this translation helpful? Give feedback.
All reactions