diff --git a/buf.work.yaml b/buf.work.yaml index 1878b341be..7053a4dd60 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,3 +1,3 @@ version: v1 directories: - - proto + - proto/buf diff --git a/make/buf/all.mk b/make/buf/all.mk index 83cb17f65e..2bd5efcdba 100644 --- a/make/buf/all.mk +++ b/make/buf/all.mk @@ -165,12 +165,12 @@ bufgenerateclean:: \ .PHONY: bufgenerateprotogo bufgenerateprotogo: - $(BUF_BIN) generate proto --template data/template/buf.go.gen.yaml + $(BUF_BIN) generate proto/buf --template data/template/buf.go.gen.yaml $(BUF_BIN) generate buf.build/grpc/grpc --type grpc.reflection.v1.ServerReflection --template data/template/buf.go.gen.yaml .PHONY: bufgenerateprotogoclient bufgenerateprotogoclient: - $(BUF_BIN) generate proto --template data/template/buf.go-client.gen.yaml + $(BUF_BIN) generate proto/buf --template data/template/buf.go-client.gen.yaml .PHONY: bufgeneratebuflinttestdata bufgeneratebuflinttestdata: diff --git a/private/bufpkg/bufwkt/cmd/wkt-go-data/main.go b/private/bufpkg/bufwkt/cmd/wkt-go-data/main.go index f92aa68f41..fb421c986e 100644 --- a/private/bufpkg/bufwkt/cmd/wkt-go-data/main.go +++ b/private/bufpkg/bufwkt/cmd/wkt-go-data/main.go @@ -148,16 +148,18 @@ func getProtosourceFiles( container appflag.Container, bucket storage.ReadBucket, ) ([]protosource.File, error) { - // TODO: why is this not working? this is the path that should be used, not NewModuleForBucket - //module, err := bufmodulebuild.NewModuleBucketBuilder(container.Logger()).BuildForBucket( - //ctx, - //bucket, - //&bufmoduleconfig.Config{}, - //) - module, err := bufmodule.NewModuleForBucket(ctx, bucket) + moduleSet, err := bufmodule.NewModuleSetBuilder( + ctx, + bufmodule.NopModuleDataProvider, + ).AddLocalModule( + bucket, + ".", + true, + ).Build() if err != nil { return nil, err } + module := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet) image, fileAnnotations, err := bufimage.BuildImage( ctx, module, diff --git a/proto/LICENSE b/proto/buf/LICENSE similarity index 100% rename from proto/LICENSE rename to proto/buf/LICENSE diff --git a/proto/buf.yaml b/proto/buf/buf.yaml similarity index 100% rename from proto/buf.yaml rename to proto/buf/buf.yaml diff --git a/proto/buf/alpha/audit/v1alpha1/event.proto b/proto/buf/buf/alpha/audit/v1alpha1/event.proto similarity index 100% rename from proto/buf/alpha/audit/v1alpha1/event.proto rename to proto/buf/buf/alpha/audit/v1alpha1/event.proto diff --git a/proto/buf/alpha/audit/v1alpha1/service.proto b/proto/buf/buf/alpha/audit/v1alpha1/service.proto similarity index 100% rename from proto/buf/alpha/audit/v1alpha1/service.proto rename to proto/buf/buf/alpha/audit/v1alpha1/service.proto diff --git a/proto/buf/alpha/breaking/v1/config.proto b/proto/buf/buf/alpha/breaking/v1/config.proto similarity index 100% rename from proto/buf/alpha/breaking/v1/config.proto rename to proto/buf/buf/alpha/breaking/v1/config.proto diff --git a/proto/buf/alpha/image/v1/image.proto b/proto/buf/buf/alpha/image/v1/image.proto similarity index 100% rename from proto/buf/alpha/image/v1/image.proto rename to proto/buf/buf/alpha/image/v1/image.proto diff --git a/proto/buf/alpha/lint/v1/config.proto b/proto/buf/buf/alpha/lint/v1/config.proto similarity index 100% rename from proto/buf/alpha/lint/v1/config.proto rename to proto/buf/buf/alpha/lint/v1/config.proto diff --git a/proto/buf/alpha/module/v1alpha1/module.proto b/proto/buf/buf/alpha/module/v1alpha1/module.proto similarity index 100% rename from proto/buf/alpha/module/v1alpha1/module.proto rename to proto/buf/buf/alpha/module/v1alpha1/module.proto diff --git a/proto/buf/alpha/registry/v1alpha1/admin.proto b/proto/buf/buf/alpha/registry/v1alpha1/admin.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/admin.proto rename to proto/buf/buf/alpha/registry/v1alpha1/admin.proto diff --git a/proto/buf/alpha/registry/v1alpha1/authn.proto b/proto/buf/buf/alpha/registry/v1alpha1/authn.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/authn.proto rename to proto/buf/buf/alpha/registry/v1alpha1/authn.proto diff --git a/proto/buf/alpha/registry/v1alpha1/authz.proto b/proto/buf/buf/alpha/registry/v1alpha1/authz.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/authz.proto rename to proto/buf/buf/alpha/registry/v1alpha1/authz.proto diff --git a/proto/buf/alpha/registry/v1alpha1/convert.proto b/proto/buf/buf/alpha/registry/v1alpha1/convert.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/convert.proto rename to proto/buf/buf/alpha/registry/v1alpha1/convert.proto diff --git a/proto/buf/alpha/registry/v1alpha1/display.proto b/proto/buf/buf/alpha/registry/v1alpha1/display.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/display.proto rename to proto/buf/buf/alpha/registry/v1alpha1/display.proto diff --git a/proto/buf/alpha/registry/v1alpha1/doc.proto b/proto/buf/buf/alpha/registry/v1alpha1/doc.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/doc.proto rename to proto/buf/buf/alpha/registry/v1alpha1/doc.proto diff --git a/proto/buf/alpha/registry/v1alpha1/download.proto b/proto/buf/buf/alpha/registry/v1alpha1/download.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/download.proto rename to proto/buf/buf/alpha/registry/v1alpha1/download.proto diff --git a/proto/buf/alpha/registry/v1alpha1/git_metadata.proto b/proto/buf/buf/alpha/registry/v1alpha1/git_metadata.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/git_metadata.proto rename to proto/buf/buf/alpha/registry/v1alpha1/git_metadata.proto diff --git a/proto/buf/alpha/registry/v1alpha1/github.proto b/proto/buf/buf/alpha/registry/v1alpha1/github.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/github.proto rename to proto/buf/buf/alpha/registry/v1alpha1/github.proto diff --git a/proto/buf/alpha/registry/v1alpha1/image.proto b/proto/buf/buf/alpha/registry/v1alpha1/image.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/image.proto rename to proto/buf/buf/alpha/registry/v1alpha1/image.proto diff --git a/proto/buf/alpha/registry/v1alpha1/jsonschema.proto b/proto/buf/buf/alpha/registry/v1alpha1/jsonschema.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/jsonschema.proto rename to proto/buf/buf/alpha/registry/v1alpha1/jsonschema.proto diff --git a/proto/buf/alpha/registry/v1alpha1/labels.proto b/proto/buf/buf/alpha/registry/v1alpha1/labels.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/labels.proto rename to proto/buf/buf/alpha/registry/v1alpha1/labels.proto diff --git a/proto/buf/alpha/registry/v1alpha1/module.proto b/proto/buf/buf/alpha/registry/v1alpha1/module.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/module.proto rename to proto/buf/buf/alpha/registry/v1alpha1/module.proto diff --git a/proto/buf/alpha/registry/v1alpha1/organization.proto b/proto/buf/buf/alpha/registry/v1alpha1/organization.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/organization.proto rename to proto/buf/buf/alpha/registry/v1alpha1/organization.proto diff --git a/proto/buf/alpha/registry/v1alpha1/owner.proto b/proto/buf/buf/alpha/registry/v1alpha1/owner.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/owner.proto rename to proto/buf/buf/alpha/registry/v1alpha1/owner.proto diff --git a/proto/buf/alpha/registry/v1alpha1/plugin_curation.proto b/proto/buf/buf/alpha/registry/v1alpha1/plugin_curation.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/plugin_curation.proto rename to proto/buf/buf/alpha/registry/v1alpha1/plugin_curation.proto diff --git a/proto/buf/alpha/registry/v1alpha1/push.proto b/proto/buf/buf/alpha/registry/v1alpha1/push.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/push.proto rename to proto/buf/buf/alpha/registry/v1alpha1/push.proto diff --git a/proto/buf/alpha/registry/v1alpha1/recommendation.proto b/proto/buf/buf/alpha/registry/v1alpha1/recommendation.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/recommendation.proto rename to proto/buf/buf/alpha/registry/v1alpha1/recommendation.proto diff --git a/proto/buf/alpha/registry/v1alpha1/reference.proto b/proto/buf/buf/alpha/registry/v1alpha1/reference.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/reference.proto rename to proto/buf/buf/alpha/registry/v1alpha1/reference.proto diff --git a/proto/buf/alpha/registry/v1alpha1/repository.proto b/proto/buf/buf/alpha/registry/v1alpha1/repository.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/repository.proto rename to proto/buf/buf/alpha/registry/v1alpha1/repository.proto diff --git a/proto/buf/alpha/registry/v1alpha1/repository_branch.proto b/proto/buf/buf/alpha/registry/v1alpha1/repository_branch.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/repository_branch.proto rename to proto/buf/buf/alpha/registry/v1alpha1/repository_branch.proto diff --git a/proto/buf/alpha/registry/v1alpha1/repository_commit.proto b/proto/buf/buf/alpha/registry/v1alpha1/repository_commit.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/repository_commit.proto rename to proto/buf/buf/alpha/registry/v1alpha1/repository_commit.proto diff --git a/proto/buf/alpha/registry/v1alpha1/repository_tag.proto b/proto/buf/buf/alpha/registry/v1alpha1/repository_tag.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/repository_tag.proto rename to proto/buf/buf/alpha/registry/v1alpha1/repository_tag.proto diff --git a/proto/buf/alpha/registry/v1alpha1/resolve.proto b/proto/buf/buf/alpha/registry/v1alpha1/resolve.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/resolve.proto rename to proto/buf/buf/alpha/registry/v1alpha1/resolve.proto diff --git a/proto/buf/alpha/registry/v1alpha1/resource.proto b/proto/buf/buf/alpha/registry/v1alpha1/resource.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/resource.proto rename to proto/buf/buf/alpha/registry/v1alpha1/resource.proto diff --git a/proto/buf/alpha/registry/v1alpha1/role.proto b/proto/buf/buf/alpha/registry/v1alpha1/role.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/role.proto rename to proto/buf/buf/alpha/registry/v1alpha1/role.proto diff --git a/proto/buf/alpha/registry/v1alpha1/schema.proto b/proto/buf/buf/alpha/registry/v1alpha1/schema.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/schema.proto rename to proto/buf/buf/alpha/registry/v1alpha1/schema.proto diff --git a/proto/buf/alpha/registry/v1alpha1/scim_token.proto b/proto/buf/buf/alpha/registry/v1alpha1/scim_token.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/scim_token.proto rename to proto/buf/buf/alpha/registry/v1alpha1/scim_token.proto diff --git a/proto/buf/alpha/registry/v1alpha1/search.proto b/proto/buf/buf/alpha/registry/v1alpha1/search.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/search.proto rename to proto/buf/buf/alpha/registry/v1alpha1/search.proto diff --git a/proto/buf/alpha/registry/v1alpha1/studio.proto b/proto/buf/buf/alpha/registry/v1alpha1/studio.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/studio.proto rename to proto/buf/buf/alpha/registry/v1alpha1/studio.proto diff --git a/proto/buf/alpha/registry/v1alpha1/studio_request.proto b/proto/buf/buf/alpha/registry/v1alpha1/studio_request.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/studio_request.proto rename to proto/buf/buf/alpha/registry/v1alpha1/studio_request.proto diff --git a/proto/buf/alpha/registry/v1alpha1/sync.proto b/proto/buf/buf/alpha/registry/v1alpha1/sync.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/sync.proto rename to proto/buf/buf/alpha/registry/v1alpha1/sync.proto diff --git a/proto/buf/alpha/registry/v1alpha1/token.proto b/proto/buf/buf/alpha/registry/v1alpha1/token.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/token.proto rename to proto/buf/buf/alpha/registry/v1alpha1/token.proto diff --git a/proto/buf/alpha/registry/v1alpha1/user.proto b/proto/buf/buf/alpha/registry/v1alpha1/user.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/user.proto rename to proto/buf/buf/alpha/registry/v1alpha1/user.proto diff --git a/proto/buf/alpha/registry/v1alpha1/verification_status.proto b/proto/buf/buf/alpha/registry/v1alpha1/verification_status.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/verification_status.proto rename to proto/buf/buf/alpha/registry/v1alpha1/verification_status.proto diff --git a/proto/buf/alpha/registry/v1alpha1/webhook.proto b/proto/buf/buf/alpha/registry/v1alpha1/webhook.proto similarity index 100% rename from proto/buf/alpha/registry/v1alpha1/webhook.proto rename to proto/buf/buf/alpha/registry/v1alpha1/webhook.proto diff --git a/proto/buf/alpha/studio/v1alpha1/invoke.proto b/proto/buf/buf/alpha/studio/v1alpha1/invoke.proto similarity index 100% rename from proto/buf/alpha/studio/v1alpha1/invoke.proto rename to proto/buf/buf/alpha/studio/v1alpha1/invoke.proto diff --git a/proto/buf/alpha/wasmplugin/v1/wasmplugin.proto b/proto/buf/buf/alpha/wasmplugin/v1/wasmplugin.proto similarity index 100% rename from proto/buf/alpha/wasmplugin/v1/wasmplugin.proto rename to proto/buf/buf/alpha/wasmplugin/v1/wasmplugin.proto diff --git a/proto/buf/alpha/webhook/v1alpha1/event.proto b/proto/buf/buf/alpha/webhook/v1alpha1/event.proto similarity index 100% rename from proto/buf/alpha/webhook/v1alpha1/event.proto rename to proto/buf/buf/alpha/webhook/v1alpha1/event.proto