Skip to content

build: invoke protobufjs CLI explicitly in build:json#108

Open
BitHighlander wants to merge 1 commit into
masterfrom
fix/build-json-protobufjs-cli
Open

build: invoke protobufjs CLI explicitly in build:json#108
BitHighlander wants to merge 1 commit into
masterfrom
fix/build-json-protobufjs-cli

Conversation

@BitHighlander

Copy link
Copy Markdown
Collaborator

Problem

npm run build (and prepublishOnly) fails at build:json:

Error: Expected = but found 3
  at parse (.../protocol-buffers-schema/parse.js)
  at exports.parseSchema (.../pbjs/index.js)

package.json declares both protobufjs@^6.8.8 and an unrelated pbjs@^0.0.5. The latter wins the node_modules/.bin/pbjs symlink (-> ../pbjs/cli.js), so bare pbjs invokes the wrong tool, which can't parse the protos.

This is latent until a clean build actually runs — which keepkey-vault now does on every release build (it rebuilds device-protocol's gitignored lib/ from source), so it currently breaks the release pipeline.

Fix

Invoke protobufjs's CLI explicitly: node node_modules/protobufjs/bin/pbjs. One line, no dependency/lockfile change.

Test plan

  • npm run build regenerates a valid 137KB lib/proto.json (verified locally)
  • proto set unchanged (still includes messages-zcash.proto)

Follow-up (not here): the pbjs@^0.0.5 devDependency is dead weight that shadows protobufjs's bin — worth removing.

Bare 'pbjs' resolves to node_modules/.bin/pbjs -> ../pbjs/cli.js (the unrelated
pbjs@0.0.5 dependency), not protobufjs's CLI, so 'npm run build:json' fails
parsing the protos ('Expected = but found 3'). Invoke node_modules/protobufjs/bin/pbjs
directly. Verified: npm run build now regenerates a valid lib/proto.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant