rojo icon indicating copy to clipboard operation
rojo copied to clipboard

Split Rojo library

Open jeparlefrancais opened this issue 3 years ago • 5 comments

Hey 👋

I'd like to have a way to depend on rojo, without bringing the whole library into my other project (darklua).

I am currently prototyping path imports. I think I am mostly interested in the ProjectNode struct.

My idea would be to create a smaller library within Rojo, like memofs that other tools like darklua, selene, Roblox LSP could use to get information on how files are put in the DataModel.

If you are ok with the idea in general, I can start creating a prototype and draft a PR as a proposal 🙂

jeparlefrancais avatar Dec 09 '21 20:12 jeparlefrancais

It's sort of unintuitive, but if you want to try this today you actually can depend on Rojo:

[dependencies]
rojo = "=7.0.0"

...and then use it via the name librojo:

fn main() {
    librojo::cli::DocCommand {}.run().unwrap()
}

See: https://docs.rs/rojo/latest/librojo/index.html

There aren't any guarantees that the API will be stable so I recommend using an exact dependency. If we can figure out an API that's helpful and also semi-stable, I would be open to publishing this as a separate crate.

LPGhatguy avatar Apr 19 '22 20:04 LPGhatguy

Does the "newly" introduced rojo sourcemap solve your problem?

sasial-dev avatar Aug 13 '22 05:08 sasial-dev

Yes I think it does 👍

Thanks for the followup!

jeparlefrancais avatar Aug 18 '22 00:08 jeparlefrancais

Please do close this issue then!

sasial-dev avatar Aug 18 '22 05:08 sasial-dev

I think that, though the original use case was solved, I think we should still split Rojo into a library!

LPGhatguy avatar Aug 24 '22 07:08 LPGhatguy