One would like to be able to import freja internals for use with plugins, without having to use relative paths. This is because the relative paths makes it impossible to run plugins in directories other than the freja root folder.
The alternatives I can come up with are:
use absolute imports, like (import src/state)
1.1 this is nice since one would be able to use e.g. linting and tests outside of freja
1.2 the drawback is that it's not 100% apparent how to make freja and the plugin use the same modules
1.2.1 probably best solution here would be to jpm install freja, then all internals would be available for any code
1.2.2 however if one were to run a standalone freja binary, the plugin would stop working
do something tricky, like (freja-import src/state)
2.1 same amount of code as above, but would only work withing freja
magically make symbols available when loading files inside of freja
3.1 easy to get started, but annoying to not have control of symbols in environment
3.2 might mess with non-plugin programs being run inside freja
I think I'll need to wait for https://github.com/janet-lang/janet/issues/710 to get fixed before trying out how it would work with a binary freja, and how to use the same dependencies as binary freja.
One would like to be able to import freja internals for use with plugins, without having to use relative paths. This is because the relative paths makes it impossible to run plugins in directories other than the freja root folder. The alternatives I can come up with are:
(import src/state)
1.1 this is nice since one would be able to use e.g. linting and tests outside of freja 1.2 the drawback is that it's not 100% apparent how to make freja and the plugin use the same modules 1.2.1 probably best solution here would be tojpm install freja
, then all internals would be available for any code 1.2.2 however if one were to run a standalone freja binary, the plugin would stop working(freja-import src/state)
2.1 same amount of code as above, but would only work withing frejaI think I'll need to wait for https://github.com/janet-lang/janet/issues/710 to get fixed before trying out how it would work with a binary freja, and how to use the same dependencies as binary freja.