feat(pgpm): add interactive prompts for export flow #508
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
Adds interactive prompts to the
pgpm exportcommand for two scenarios:The
prompterparameter is now threaded throughexportMigrations→exportMigrationsToDisk→preparePackageandpromptAndInstallMissingModules. When no prompter is provided (non-interactive mode), the existing behavior is preserved.Code Organization
PGPM_MODULE_MAPandgetMissingInstallableModules()extracted topgpm/core/src/modules/modules.tsfor reusabilityDB_REQUIRED_EXTENSIONSandSERVICE_REQUIRED_EXTENSIONSconstants hoisted to top ofexport-migrations.tsgetInstalledModules()for accurate detection of installed npm packagesUpdates since last revision
PGPM_MODULE_MAPand detection logic tomodules/modules.ts(more generic location near module installation code)MissingModuleinterface for type safetyDB_REQUIRED_EXTENSIONS,SERVICE_REQUIRED_EXTENSIONS) per code review feedbackcheckAndInstallMissingModules→promptAndInstallMissingModulesfor claritygetModuleMap()togetInstalledModules()for more accurate installed module detectionReview & Testing Checklist for Human
project.getInstalledModules()return value: The code compares againstinstalledarray which should contain npm package names (e.g.,@pgpm/base32) - verify this matches actual behaviorproject.installModules()with npm package names: The code passes@pgpm/base32style names - verify this is the expected formatpgpm exporton a database with existing modules and verify:Notes
Export cancelled: Module "X" already exists.) - consider if this is the desired UXRequested by: Dan Lynch (@pyramation)
Devin session: https://app.devin.ai/sessions/7e7813472a0643aa88ccb509b288050a