Repository navigation
fix: use prepare instead of postinstall for buf generate - #142
Merged
Merged
Conversation
Installing the published package fails for consumers: `postinstall` runs `npx buf generate`, but neither `buf.gen.yaml` nor the `.proto` sources are in the published tarball, and `@bufbuild/buf` is a devDependency that isn't installed for consumers. npx then fails with "could not determine executable to run", aborting the install. `prepare` still runs for local development (`npm install` / `npm ci`, so CI is unaffected), for git-URL installs, and before `npm publish` — but not when the package is installed as a dependency from a tarball. Dropping `npx` also means the local `buf` binary from node_modules/.bin is used directly rather than resolved from the registry. Consumers can now install without needing `--ignore-scripts`.
Owner
|
Good catch, thank you! |
Contributor
Author
|
Thank YOU. Using this to parse propresenter slide data for a translation
app so we can broadcast the slides in different languages at my church.
All the best,
Ben
…On Tue, Aug 11, 2026 at 4:06 PM Chris Barr ***@***.***> wrote:
Merged #142 <#142>
into main.
—
Reply to this email directly, view it on GitHub
<#142?email_source=notifications&email_token=ANIGNLXAIDRLGNRL5WE23MD5JN4C5A5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOJTGAZDEMRWGY4TTJTSMVQXG33OUZQXK5DIN5ZKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#event-29302226699>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANIGNLVXLEQYISAWCL2JFX35JN4C5AVCNFSNUABFKJSXA33TNF2G64TZHM3DKMRXGEZTIMBXHNEXG43VMU5TKMBZGE2DIOBTGM4KC5QC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Issue #141.
postinstall runs for anyone installing the published package, but
buf.gen.yaml, the.protosources, and@bufbuild/buf(a devDependency) are all absent from the tarball — sonpx buf generatefails with could not determine executable to run and aborts the install. Consumers have to use--ignore-scripts, which is awkward in CI/Docker and disables postinstall for every other dependency too.prepare runs in exactly the cases that need codegen — local npm install/npm ci (so CI is unchanged), git-URL installs, and before npm publish — and not for tarball consumers. Dropping npx also uses the local node_modules/.bin/buf directly instead of resolving from the registry.
Verified:
npm cistill generatessrc/v7/gen;lint, all 82 tests, and both builds pass.yarn add propresenter-parser@1.1.0reproduces the failure; yarn add of a tarball packed from this branch installs cleanly and loads all 6 exports.Context: using this in a real project for PP7 parsing — thanks for the recent v7 support.