Description
Hi
Trying to summarize the question is something like
How to write a pure reusable distributed proto packages with arbitrary depth of transitive dependencies.
E.g A
, B
->A
, C
->(A
,B
) : where A
,B
,C
- are all separated repos with a proto declarations. The same time in a way it works for google/protobuf/empty.proto
.
I'm not sure how better to structure the entire question. Instead there's a batch of tiny ones that looks contradicting the subject intention or just confusing the hole picture vision.
- All the examples shows a package naming as "foo.bar.baz". Still
google/protobuf/empty.proto
is imported as some url(fs) path. - When referring
import "some/other/mod.proto"
does it really mean the referring (linking) on an initial photo-source level or at the compiled to target language one. As we can seegoogle/protobuf/empty.proto
as a source reference. Still the result compilation refers the real golang "google.golang.org/protobuf/types/known/emptypb" module. - The most resources say the only (best) composition for protos is a subtree/submodule linking
3.1 So that how to keep code clean and consistent that case. As I can see every level of repo reference adds additional fs tree nesting to a target
E.g.
repoA
a.proto
repoB
A(->repoA)
a.proto
B
b.proto
repoC
A(->repoA)
a.proto
B(->repoB)
A(->repoA)
a.proto
B
b.proto
C
c.proto
3.2 As well. How to avoid a code duplication in case of C
->(B
, A
) if B
is just a black box that doesn't leak it's dependancies and to compose all the reps within C
as flat set.
3.3 Anyway in case of google/protobuf/empty.proto
we don't subtree/fetch/declare whatever manually at all. So how to achieve. the same with custom repos.
4. How to make it even fluent and language agnostic in different packaging managers, e.g. go mod
, npm
etc. as the mentioned google/protobuf/empty.proto
does.
Thank you