delta icon indicating copy to clipboard operation
delta copied to clipboard

Refactor to provide a library crate

Open dandavison opened this issue 5 years ago • 6 comments

@MarcoIeni this is a partial progress towards refactoring Delta as a library crate with a binary (#317).

This branch in its current form passes all tests and exposes a public library as well as a binary. I believe that, if this branch were published to crates.io, then delta would be available as a library. However, I don't want to actually do that right now, because the library API in this branch is not ready yet.

What I would ideally like to do is merge this branch into master now (so the refactoring is in master), but without actually publishing a library to crates.io for now, because this branch has not yet finalized the library API.

So I was thinking we could make one small change to this branch, something like

rename lib.rs -> delta_lib.rs

Does that make sense and can you suggest what change I should make?

dandavison avatar Nov 22 '20 17:11 dandavison

We can chat in gitter by the way, if that's convenient: https://gitter.im/dandavison-delta/community

dandavison avatar Nov 22 '20 17:11 dandavison

Are you able to do that rename? I tried it but modules declarations fail. From what I've seen if you don't have a lib.rs you have to move those modules declaration inside main.rs again.

But maybe I am missing something.

marcoieni avatar Nov 22 '20 20:11 marcoieni

The simplest solution would be to keep everything as it is but place big warnings in the documentation where we say that everything is experimental and it is going to change really soon.

marcoieni avatar Nov 22 '20 20:11 marcoieni

you have to move those modules declaration inside main.rs again.

Thanks, maybe this is what I want to do -- create one commit that will basically be reverted when the library API is finalized.

I'd prefer not to have a library published to crates.io if it is not the correct API, even with warnings in the docs.

dandavison avatar Nov 22 '20 21:11 dandavison

Any updates on this?

hnorkowski avatar Mar 28 '24 18:03 hnorkowski

Possibly superseded by https://github.com/dandavison/delta/pull/1013 and https://github.com/dandavison/delta/pull/1017

rmacklin avatar Apr 29 '24 01:04 rmacklin