Sorry if this is documented somewhere, I looked but couldn't find anything :sweat_smile:
I want to convert my tiny tui code into a package, bundle it, and allow people to use it via the url package thing. It depends on the basics_cli platform.
My best guess was to create a tui.roc
file in the dir I'm working in and put this in it
package "tui"
exposes [
Term,
Term.Unicode
]
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.2.0/8tCohJeXMBUnjo_zdMq0jSaqdYoCWJkWazBd4wa8cQU.tar.br" }
And then maybe run roc build tui.roc
? Doesn't seem quite right, and that command also hangs.
Is there a script or process that I could check out on how to prepare the necessary .tar.br
?
Bonus points, I would also love to generate docs for it :dancer:
Ahhh, just found roc build --bundle=.tar.br
!
So, I think the issue is just that roc build tui.roc
hangs.
Running with the --bundle
produces this error
Maybe I need to create a directory or something? :thinking:
definitely seems like a compiler bug! is there a link to the code I can use to reproduce?
Yes! Just made it public here: https://github.com/mdgriffith/roc-tui
Does term depend on basic_cli?
If so, i think that is the issue
I don't think a package can depend on a platform
Ah, interesting, ok
Is that a design constraint or something that hasn't been implemented yet?
Design constraint
I don't think there is any plan to change that, but I could have missed something.
Ok, good to know!
Packages can't directly depend on platforms. They need to depend on a shared type or use other abstractions to convert to the platform types and effects.
This keeps effects out of the packages.
Hmm....That said, given effects are changing and becoming pure tag unions, I guess that would enable packages to use them directly...hmmm
so yeah, things may change some.
Awesome :sunglasses: For now I can make it pure and have them pass in the Stdout stuff!
#ideas > effects in packages I think this discussed it some and fancier abstractions.
yeah it should be possible in the future but it's not yet :big_smile:
(packages depending on platforms I mean)
once https://github.com/roc-lang/roc/pull/5093 lands we might be able to start converting platforms over to that representation though!
Oh, that's getting close. So exciting. Hopefully the rebasing for updating the glue stuff I have worked on isn't too painful.
it should not be too bad I think. mostly it just needs the glue gen for function types
Last updated: Jul 06 2025 at 12:14 UTC