Skip to content

Commit ae89d7f

Browse files
authored
Add private/README.md (#4060)
1 parent d1858f8 commit ae89d7f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

private/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Package structure
2+
3+
- `private/pkg` contains utility packages that are not Buf-company-specific. In theory, any of these packages could be split into a separate repository in the future, and not depend on Buf types or concepts.
4+
- `private/bufpkg` contains utility packages that *are* Buf-company-specific, but not specific to github.com/bufbuild/buf. These packages could be split into separate repositories in the future.
5+
- `private/buf` contains packages specific to github.com/bufbuild/buf. In other repositories, this should be named after that specific repository, for example `github.com/bufbuild/foo` would contain `private/foo`.
6+
7+
There's a strict dependency graph imposed at this level:
8+
9+
- `cmd/{binary}` packages must be `main` packages, and any sub-packages must be `internal`. `cmd/{binary}` packages can import from any `private` package.
10+
- `private/buf` packages can import from `private/bufpkg` and `private/pkg` packages, but not `cmd` packages.
11+
- `private/bufpkg` packages can import from `private/pkg` packages, but not `cmd` or `private/bufpkg` packages.
12+
- `private/pkg` packages can only import from other `private/pkg` packages.
13+
14+
That is, the ordering is strictly `cmd -> private/buf -> private/bufpkg -> private/pkg`. This is enforced by linting tools.

0 commit comments

Comments
 (0)