Fix real codegen bugs: unused proto import, missing runtime deps, no barrel index
protoc warned that print_job.proto imported template.proto without using it - removed. ts-types/package.json was missing protobufjs and long, which the ts-proto-generated code imports at runtime - tsc failed with 'cannot find module'. src/index.ts also re-exports './generated' as a namespace, but ts-proto wasn't configured to emit an index barrel file for it - added outputIndex=true to the protoc invocation. Verified with a clean 'bun run build' (both TS and Rust codegen) and 'tsc -b'.
This commit is contained in:
@@ -3,6 +3,10 @@ dist/
|
|||||||
target/
|
target/
|
||||||
*.log
|
*.log
|
||||||
.env
|
.env
|
||||||
|
bun.lockb
|
||||||
|
bun.lock
|
||||||
|
Cargo.lock
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
packages/ts-types/src/generated/*
|
packages/ts-types/src/generated/*
|
||||||
!packages/ts-types/src/generated/.gitkeep
|
!packages/ts-types/src/generated/.gitkeep
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:ts": "protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=packages/ts-types/src/generated --ts_proto_opt=esModuleInterop=true,outputServices=false,useOptionals=messages -I proto $(find proto -name '*.proto')",
|
"build:ts": "protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=packages/ts-types/src/generated --ts_proto_opt=esModuleInterop=true,outputServices=false,useOptionals=messages,outputIndex=true -I proto $(find proto -name '*.proto')",
|
||||||
"build:rust": "cargo build -p continuum-rust-types --manifest-path packages/rust-types/Cargo.toml",
|
"build:rust": "cargo build -p continuum-rust-types --manifest-path packages/rust-types/Cargo.toml",
|
||||||
"build": "npm run build:ts && npm run build:rust",
|
"build": "npm run build:ts && npm run build:rust",
|
||||||
"typecheck": "tsc -b"
|
"typecheck": "tsc -b"
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sinclair/typebox": "^0.32.0"
|
"@sinclair/typebox": "^0.32.0",
|
||||||
|
"protobufjs": "^7.4.0",
|
||||||
|
"long": "^5.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package continuum.v1;
|
package continuum.v1;
|
||||||
|
|
||||||
import "continuum/v1/template.proto";
|
|
||||||
|
|
||||||
enum PrintJobStatus {
|
enum PrintJobStatus {
|
||||||
PRINT_JOB_STATUS_UNSPECIFIED = 0;
|
PRINT_JOB_STATUS_UNSPECIFIED = 0;
|
||||||
PRINT_JOB_STATUS_QUEUED = 1;
|
PRINT_JOB_STATUS_QUEUED = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user