Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update buf CLI and make use of the clean option #1187

Merged
merged 9 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 32 additions & 35 deletions package-lock.json

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

9 changes: 6 additions & 3 deletions packages/connect-conformance/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
version: v1
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- plugin: es
- local: protoc-gen-es
out: src/gen
opt: ts_nocheck=false,target=ts
- plugin: connect-es
- local: protoc-gen-connect-es
out: src/gen
opt: ts_nocheck=false,target=ts
2 changes: 1 addition & 1 deletion packages/connect-conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"connectconformance": "bin/connectconformance.cjs"
},
"scripts": {
"pregenerate": "rm -rf src/gen/*",
"generate": "buf generate buf.build/connectrpc/conformance:v1.0.2",
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
Expand All @@ -30,6 +29,7 @@
"undici": "^5.28.4"
},
"devDependencies": {
"@bufbuild/buf": "^1.36.0",
"@types/node-forge": "^1.3.9",
"@types/tar-stream": "^3.1.3",
"@types/debug": "^4.1.12"
Expand Down
4 changes: 4 additions & 0 deletions packages/connect-web-bench/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- local: protoc-gen-es
out: src/gen/connectweb
Expand All @@ -19,3 +21,5 @@ plugins:
strategy: all
opt: target=ts
out: src/gen
inputs:
- module: buf.build/bufbuild/registry:f2077dee5ad44f7d9b660b32bf0958ee
4 changes: 2 additions & 2 deletions packages/connect-web-bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"private": true,
"scripts": {
"bundle-size": "tsx src/report.ts",
"pregenerate": "rm -rf src/gen/*",
"generate": "buf generate buf.build/bufbuild/registry:f2077dee5ad44f7d9b660b32bf0958ee",
"generate": "buf generate",
"postgenerate": "license-header ."
},
"dependencies": {
"@bufbuild/buf": "^1.36.0",
"@bufbuild/protobuf": "^1.10.0",
"@bufbuild/protoc-gen-es": "^1.10.0",
"@connectrpc/connect-web": "1.4.0",
Expand Down
12 changes: 8 additions & 4 deletions packages/connect-web/browserstack/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
version: v1
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- name: es
- local: protoc-gen-es
out: browserstack/gen
opt: target=ts
- name: connect-es
- local: protoc-gen-connect-es
out: browserstack/gen
opt: target=ts

inputs:
- module: buf.build/connectrpc/eliza
4 changes: 2 additions & 2 deletions packages/connect-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"conformance:client:node:promise": "connectconformance --mode client --conf ./conformance/conformance-web-node.yaml -v -- ./conformance/client.ts --browser node",
"conformance:client:node:callback": "connectconformance --mode client --conf ./conformance/conformance-web-node.yaml -v --known-failing @./conformance/known-failing-callback-client.txt -- ./conformance/client.ts --browser node --useCallbackClient",
"jasmine": "jasmine --config=jasmine.json",
"pregenerate": "rm -rf browserstack/gen/*",
"generate": "buf generate buf.build/connectrpc/eliza --template browserstack/buf.gen.yaml",
"generate": "buf generate --template browserstack/buf.gen.yaml",
"karma:browserstack": "karma start browserstack/karma.browserstack.conf.cjs"
},
"type": "module",
Expand All @@ -37,6 +36,7 @@
},
"devDependencies": {
"webdriverio": "^8.39.1",
"@bufbuild/buf": "^1.36.0",
"@bufbuild/protoc-gen-es": "^1.10.0",
"@connectrpc/protoc-gen-connect-es": "^1.4.0",
"@connectrpc/connect-conformance": "^1.4.0",
Expand Down
11 changes: 7 additions & 4 deletions packages/connect/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# buf.gen.yaml defines a local generation template.
# For details, see https://docs.buf.build/configuration/v1/buf-gen-yaml
version: v1
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
timostamm marked this conversation as resolved.
Show resolved Hide resolved
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- plugin: es
- local: protoc-gen-es
out: src/protocol-grpc/gen
opt: target=ts
inputs:
- directory: src/protocol-grpc/proto
4 changes: 2 additions & 2 deletions packages/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
},
"scripts": {
"clean": "rm -rf ./dist/*",
"pregenerate": "rm -rf src/protocol-grpc/gen/*",
"generate": "buf generate src/protocol-grpc/proto",
"generate": "buf generate",
"build": "npm run build:cjs && npm run build:esm && node scripts/update-user-agent.mjs",
"build:cjs": "tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
Expand Down Expand Up @@ -63,6 +62,7 @@
"@bufbuild/protobuf": "^1.10.0"
},
"devDependencies": {
"@bufbuild/buf": "^1.36.0",
"@bufbuild/protoc-gen-es": "^1.10.0",
"@types/jasmine": "^5.0.0",
"jasmine": "^5.2.0",
Expand Down
11 changes: 6 additions & 5 deletions packages/example/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# buf.gen.yaml defines a local generation template.
# For details, see https://docs.buf.build/configuration/v1/buf-gen-yaml
version: v1
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml
version: v2
# Deletes the directories specified in the `out` field for all plugins before running code generation.
clean: true
plugins:
- plugin: es
- local: protoc-gen-es
opt: target=ts
out: src/gen
- plugin: connect-es
- local: protoc-gen-connect-es
opt: target=ts
out: src/gen
3 changes: 1 addition & 2 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"lint": "tsc --noEmit",
"start": "tsx src/server.ts",
"client": "tsx src/client.ts",
"pregenerate": "rm -rf src/gen/*",
"generate": "buf generate"
},
"engines": {
Expand All @@ -19,7 +18,7 @@
"tsx": "^4.16.5"
},
"devDependencies": {
"@bufbuild/buf": "^1.35.1",
timostamm marked this conversation as resolved.
Show resolved Hide resolved
timostamm marked this conversation as resolved.
Show resolved Hide resolved
"@bufbuild/buf": "^1.36.0",
"@bufbuild/protoc-gen-es": "^1.10.0",
"@connectrpc/protoc-gen-connect-es": "^1.4.0",
"@types/express": "^4.17.18",
Expand Down