terrazzoapp / terrazzo

Use DTCG tokens JSON to generate code for web, mobile, native apps, and more
https://terrazzo.app
MIT License
147 stars 25 forks source link

Terrazzo not building json files into one token.json #283

Closed mikeokijohn closed 4 weeks ago

mikeokijohn commented 1 month ago

Hi :)

We're migrating from Cobalt CLI to Terrazzo CLI, and trying to make the terrazzo config work correctly.

Currently we have an array of json files in the tokens property, and as the docs say, this should be possible.

image

But when building, we can see that the tokens we get are only the ones from the first json file.

It seems like the build step from Cobalt CLI is not 1:1 with Terrazzo, or are we doing something wrong? :)

drwpow commented 1 month ago

Oh that’s a bug; planned but not implemented yet. It has to do with the specific file + line error messages; just a bit more work is needed to handle multiple files and point to the correct file and line in case of an error. But is planned for stable release

drwpow commented 1 month ago

Started working on adding this! There are 3 medium-ish (not big, but not small) things left: multiple files, YAML support, and tokens linting, that are still TODO for the core CLI. So this will knock out 1/3 of what’s left (and of course, minor bugfixes, but bugfixes are a constant)

After that, it’s just updating the remaining plugins and Terrazzo should match all Cobalt can do and much more!

Sidenote: my original plan was to get the functionality in Terrazzo stable, but not release the stable version until the DTCG spec was finalized later. But will adjust that as-needed (especially if the DTCG stable version is delayed). In either case, eager to hear your feedback on the beta once this feature is in!

ramiejleh commented 1 month ago

@drwpow thanks for the update! I'm on the same team as @mikeokijohn and working on implementing Terrazzo as well and looking forward for the beta to test it. For now, we have written our own bundling script just until Terrazzo has the support for it like Cobalt did.

I'd like to hear though if you know anything about the timeline for DTCG finalising and whether we know when we can expect a stable version?

drwpow commented 1 month ago

For now, we have written our own bundling script just until Terrazzo has the support for it like Cobalt did.

That will work! The thing I was working on that’s taking a little more time is just keeping original filenames & line numbers in error reporting. It’s a minor thing, but just something I really wanted to have 🙂

I'd like to hear though if you know anything about the timeline for DTCG finalising and whether we know when we can expect a stable version?

The original goal for the DTCG spec was end of year 2024. We are making progress! And I am doing what I can to attend the meetings and push it forward. Consensus is just slow, but it’s shaping toward a stable version. Also trying to improve communication and transparency so it’s clearer to everyone what the remaining roadmap is