fix(plpgsql-deparser): move libpg-query to dependencies - #347
Merged
Conversation
src/hydrate.ts imports parseSync/scanSync from libpg-query, so it is a
runtime dependency of the published package, but it was declared only in
devDependencies. Consumers therefore resolved it by accident — via whatever
hoisted copy a sibling (plpgsql-parser, which does declare it) happened to
leave reachable — and any tree without that copy fails at import time with
MODULE_NOT_FOUND on require('libpg-query'), taking down every dependent up
the chain (plpgsql-parser, @pgsql/semantics, @pgpmjs/*, pgpm).
Pinned to 18.1.4, matching every sibling package that declares it.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
plpgsql-deparserships a runtime import oflibpg-querybut declares it as a devDependency, so the published package has an undeclared dependency:It has been loading by accident:
plpgsql-parser(andpgsql-parser,pgsql-parse,@pgsql/lint,plpgsql-parse— every sibling that imports it) does declarelibpg-query: 18.1.4, so a hoisted copy is usually reachable fromplpgsql-deparser's own directory. In any tree where it isn't — pnpm without the hidden hoist, a pruned install —require('libpg-query')throws at import time and takes the whole chain down with it, since nothing above can be loaded either:That is how it surfaced:
pgpmis unusable in an affected install (it broke alerna publishinconstructive-platform, whoseversionlifecycle runspgpm sync-versions).plpgsql-deparserwas the only package in this repo importinglibpg-queryfromsrc/without declaring it — verified across all packages.Pinned to
18.1.4, exactly matching every sibling, so no consumer gains a second copy.Verified:
pnpm install --frozen-lockfileaccepts the hand-minimized lockfile edit (the dependency graph is unchanged, the edge just moves importer sections), the builtdist/package.json— the manifest actually published — now carrieslibpg-queryunderdependencies, andplpgsql-deparsertests pass (115 tests, 79 snapshots, 252/252 round-trip fixtures).Release note: dependents pin
plpgsql-deparserexactly (plpgsql-parser@18.5.7 → plpgsql-deparser@18.2.7), so consumers only pick this up once lerna's conventional-commit cascade republishesplpgsql-parserand friends along with thefix:patch here.Link to Devin session: https://app.devin.ai/sessions/d1f8e59e2aeb44bcb6dbeb0edd1145c6
Requested by: @pyramation