I want Pluto to use my current project Tibra.jl so I do Pkg.activate(.) then import my project.
Problem is I can’t access any of the exported types from my package in a Pluto cell so I try to use Reexport. I’m not sure if this is necessary.
@reexport using .Tibra
Now I am trying to write a function that uses one of the types from my project but im getting convert errors that it can’t convert from one workspace type to the other. Not sure why multiple workspaces are being created here.
Why do you want to do that, just convenience? Usually packages inside a package aren’t directly made available. But, I think you should be able to access them via Tibra.PackageName, because the symbol is defined within Tibra.
If you want Tibra to re-export, though, Tibra should use Reexport.jl internally.
So I have to individually @reexport every imported package in Tibra? That seems wrong.
I want to do it so I don’t have issues when importing the packages. It doesn’t seem to want to download packages after calling Pkg.develop()… or is that because I had run Pkg.activate() at some point? I have to check.
Unfortunately if you want to still use the integrated package manager you have to manually add all the packages that are used by your module to the notebook.
I understand your approach of using Pluto as a way of fast-track part of the development (especially at the beginning) and avoid having to always restart the kernel when you modify a struct (hopefully Revise will support that at some point).
I also find it useful to exploit Pluto reactivity to always see the outcome of my code modifications to internal functions automatically by putting some check cells that execute the function I am modifying.
That being said, I think it would be worth for you to look at the package I am developing:
It’s directly aimed at simplifying building packages from Pluto notebooks.
There is a @plutoinclude macro that can be used to include julia files or notebooks and have them accessible within the notebook, with the possibility of reloading them (manually) when you changed the code in those dependent files.
You can have a look at the readme and example in the package or also have a look at how I use it in another package of mine (GitHub - disberd/TelecomUtils.jl) where all the package is developed as part of interdependent notebooks.
I have been actually going through an upgrade of PlutoDevMacros to simplify the whole notebook inclusion or file inclusion so that it’s easier also to specify a path to a repo to include like you wanted to do in the original post.
It will be a new macro that to some extent will render @plutoinclude obsolete for most of my use cases.
It is still not finished though so you can’t use it yet.