is there a document on package management and modules in general? I want to clarify a couple of things:
app
,module
,package
,platform
,hosted
- so many types of modules are enlisted in the docs. is this separation inevitable? is it possible to optimize it somehow?(1) -- you can only import packages (a platform is a special kind of package and there must be exactly one) in the app header using URL. Modules are imported using import Foo.Bar exposing [thing]
where Bar.roc
is located at the directory /Foo/Bar.roc
(2) you can have multiple versions of the same package (except platforms) and alias them to help migration.
(3) I'm not sure... as in the package imports another package. That is ok (though not implemented yet in either rust or zig compiler)
(4) I think it works nicely to separate these things as they have different requirements/use cases. Note hosted
wont be required in future.
(5) I'm not sure
(5) I think you can modify a roc file in your cache and that will work, like this file for example:
/home/username/.cache/roc/packages/github.com/lukewilliamboswell/roc-json/releases/download/0.13.0/RqendgZw5e1RsQa3kFhgtnMP8efWoqGRsAvubx4-zus/StringFormat.roc
I thought of a package overloading system where roc can automatically copy the package contents to the app folder and resolve package from there
(if it decides to fetch them again for some reason)
I'm not 100% sure but I don't think it will.
I thought of a package overloading system where roc can automatically copy the package contents to the app folder and resolve package from there
How would this be triggered?
I remember in python you could just go to source for e.g. a package in the IDE and modify it right there, that worked well
How would this be triggered?
there's smth similar here: https://pnpm.io/cli/patch
though it's not very ergonomic in my opinion
it may be roc patch <full url to the package>
which fetches the package to .patches/<package>
and then compiler resolves imports from there.
after the modifications, you can either add them to index, or (e.g.) run roc patch shrink
that creates a .patches/<package>.diff
you can also add to the index.
it's a real world problem of a bug somewhere deep in dependencies. sometimes you need to just make it work not waiting for a new release (and a release of depended package)
basically, vendoring
it's a real world problem of a bug somewhere deep in dependencies. sometimes you need to just make it work not waiting for a new release (and a release of depended package)
Yeah, agreed!
it may be
roc patch <full url to the package>
which fetches the package to.patches/<package>
and then compiler resolves imports from there.
That seems reasonable, I personally would not put it in a hidden folder but that's a detail. Can you make a post in #ideas ?
yeah I actually have thought about some sort of roc vendor
command
Last updated: Jul 06 2025 at 12:14 UTC