Closed keepsimple1 closed 1 year ago
Can we not make the proc-macro for
radicle-git-ext
instead? Or did you explore that route already?
I tried but it didn't work. To demonstrate such errors, I added a test pub fn in git-ref-format-macro
crate, and got this error message:
error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]`
--> git-ref-format/macro/src/lib.rs:170:1
|
170 | pub fn this_is_a_test() {
| ^^^^^^^^^^^^^^^^^^^^^^^
This is one possible way to move
git-ref-format
crate to underradicle-git-ext
, as proposed in issue #114 . The changes are:git-ref-format
becomes an "internal" crate ofradicle-git-ext
, i.e. it is no longer intended to be used directly. Instead, should do this:use radicle_git_ext::git_ref_format
.git-ref-format-macro
crate now has a few places importing fromradicle_git_ext::git_ref_format
.git-ref-format
are moved underradicle-git-ext/t
.Why did I keep
git-ref-format
as a (internal) crate instead of merging intoradicle-git-ext
completely? The reason is thatgit-ref-format-macro
is a proc-macro crate that cannot easily merge into a regular crate.On the other hand, this means we would still need to publish more than one crate. So the benefit of this patch is debatable. Please let me know what you think.