Skip to content

Commit

Permalink
fix: api/gen/go -> api/ (#3)
Browse files Browse the repository at this point in the history
This PR moves the generated files in `api/` to live alongside their
respective `.proto` spec files. This fixes an issue with the Go module
path not matching what was defined in the `.proto` files and also
simplifies the file structure overall.
  • Loading branch information
jgkawell authored Jun 20, 2024
1 parent 71e3557 commit 322abd0
Show file tree
Hide file tree
Showing 94 changed files with 327 additions and 511 deletions.
1 change: 0 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN go install github.com/envoyproxy/[email protected]
RUN go install github.com/srikrsna/[email protected]

# WEB
# TODO: should we have versions on these?
RUN npm install typescript tsx
RUN npm install @bufbuild/buf \
@bufbuild/protobuf \
Expand Down
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To use the generated files locally, you will need to add a `replace` to the proj
```go.mod
...
replace github.com/steady-bytes/draft/api => ../../../api/gen/go
replace github.com/steady-bytes/draft/api => ../../../api
...
```
6 changes: 3 additions & 3 deletions api/buf.gen.go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ version: v1
plugins:
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- name: go
out: gen/go
out: .
opt:
- paths=source_relative
# go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
- plugin: connect-go
out: gen/go
out: .
opt:
- paths=source_relative
# go install github.com/envoyproxy/protoc-gen-validate
- name: validate
out: gen/go
out: .
opt:
- paths=source_relative
- lang=go
2 changes: 1 addition & 1 deletion api/buf.gen.gotag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins:
- name: gotag
out: .
opt:
- outdir=gen/go
- outdir=.
- paths=source_relative
- xxx=pg+"-" bun+"-" json+"-" yaml+"-" csv+"-"
- auto=pg-as-lower_snake+bun-as-lower_snake+yaml-as-lower_snake+csv-as-lower_snake+json-as-lower_snake
12 changes: 6 additions & 6 deletions api/buf.gen.web.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
version: v1
plugins:
- plugin: es
out: gen/web
out: .
opt:
- target=ts
- plugin: es
out: gen/web
out: .
opt:
- target=js
- plugin: connect-es
out: gen/web
out: .
opt:
- target=ts
- plugin: connect-es
out: gen/web
out: .
opt:
- target=js
- name: connect-query
out: gen/web
out: .
opt: target=ts
- name: connect-query
out: gen/web
out: .
opt: target=js
4 changes: 2 additions & 2 deletions api/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ deps:
- remote: buf.build
owner: envoyproxy
repository: protoc-gen-validate
commit: 89818263b32b46d39c9ecb5984bd2850
digest: shake256:8f3653779e824957a4fe3d18cdb73531f7f7ed1393848082dfe1f90026fd187da9534e759b5833f4e5487be0d34cfa7d4ff149af9a2694863773387d61d09fce
commit: daf171c6cdb54629b5f51e345a79e4dd
digest: shake256:4ae167d7eed10da5f83a3f5df8c670d249170f11b1f2fd19afda06be2cff4d47dcc95e9e4a15151ecc8ce2d3d3614caf9a04d3ad82fb768a3870dedfa9455f36
- remote: buf.build
owner: googleapis
repository: googleapis
Expand Down
1 change: 0 additions & 1 deletion api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ lint:
allow_comment_ignores: true
build:
excludes:
- gen/
- vendor/
deps:
- buf.build/googleapis/googleapis
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 322abd0

Please sign in to comment.