Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Dec 13, 2025

Summary

Updates all call sites of findAndRequirePackageJson() to pass __dirname as a required parameter. This fixes a bug where the function was finding the wrong package.json (the helper package's own package.json instead of the caller's).

The root cause was that __dirname inside the helper function pointed to the compiled helper's location (node_modules/find-and-require-package-json/dist/), not the caller's location. This caused errors like:

Plugin [email protected] requires graphile-plugin-connection-filter@^2.0.0 (not found)

Updated packages:

  • graphile-many-to-many
  • graphile-plugin-connection-filter-postgis
  • graphile-plugin-connection-filter
  • graphile-postgis
  • packages/cli
  • packages/pgpm

Also includes dependency version bumps (pg, @types/pg, lru-cache, etc.) and adds find-and-require-package-json@^0.8.0 as a dependency to the affected graphile packages.

Review & Testing Checklist for Human

  • Verify all graphile plugins load correctly and report their own version (not find-and-require-package-json's version)
  • Test pgpm --version and lql --version commands return correct package versions
  • Confirm CI passes for the build and test jobs that were previously failing

Recommended test plan: Run the graphile plugins in a test environment and verify the version checking logic works correctly (e.g., the "requires graphile-build-pg@^4.4.0" dependency check should pass).

Notes

Related PR: constructive-io/dev-utils#19 (fix in find-and-require-package-json package)

Link to Devin run: https://app.devin.ai/sessions/69206214490a4b479dabb13c55a4a44f
Requested by: Dan Lynch ([email protected]) / @pyramation

@devin-ai-integration devin-ai-integration bot changed the title fix pkg fix: pass __dirname to findAndRequirePackageJson for correct package.json resolution Dec 13, 2025
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.

2 participants