fix(pgpm): use workspace-level module detection for export flow #509
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.
fix(pgpm): use workspace-level module detection for export flow
Summary
Fixes "Not inside a module" error when running
pgpm exportfrom workspace root.The previous implementation called
getInstalledModules()which requires being inside a module directory. This PR:getWorkspaceInstalledModules()method toPgpmPackagethat scansworkspace/extensions/directly without requiring module contextdetectMissingModules()- workspace-level detection + user prompt (before module creation)installMissingModules()- module-level installation (after module creation)preparePackage()to return the module directory path for use in installationEXTENSIONS_DIRconstant to centralize the extensions directory nameUpdates since last revision
EXTENSIONS_DIRconstant at module level to avoid hardcoding'extensions'string in multiple placesinstallModules(),getInstalledModules(), andgetWorkspaceInstalledModules()to use the constantReview & Testing Checklist for Human
pgpm exportfrom workspace root and verify it no longer throws "Not inside a module" errorgetWorkspaceInstalledModules()correctly detects packages like@pgpm/base32inextensions/@pgpm/base32/package.jsonpreparePackage()returningvoidRecommended test plan:
pgpm exportwith a database that has migrationsNotes
Link to Devin run: https://app.devin.ai/sessions/7e7813472a0643aa88ccb509b288050a
Requested by: Dan Lynch (@pyramation)