Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Dec 26, 2025

feat(pgpm): improve export command UX with smart defaults

Summary

This PR improves the UX of the pgpm export command by:

  1. Changing multi-select to single-select - Both databases and database_ids prompts now use list type instead of checkbox, since only one selection was actually being used
  2. Fixing a selection bug - The original code mapped ALL options in database_ids instead of just the selected one
  3. Adding smart defaults - metaExtensionName now defaults to {databaseName}-service instead of just svc
  4. Skipping boilerplate prompts - Passes answers object to initModule with moduleName, moduleDesc, and access to skip redundant prompts during export
  5. Auto-generating descriptions - DB package gets {name} database schema for {databaseName}, meta package gets {metaExtensionName} service utilities for managing domains, APIs, and services

Updates since last revision

  • Changed default access from 'public' to 'restricted' per feedback
  • Removed packageIdentifier from answers (no longer required per feedback)

Review & Testing Checklist for Human

  • Verify the non-null assertion on line 82 (selectedDatabase!.id) - if dbsResult.rows.find() returns undefined, this will throw. Consider whether error handling is needed.
  • Confirm access: 'restricted' is the desired default - This was changed from 'public' per feedback; verify this is correct for exported packages.
  • Test the export command end-to-end - Run pgpm export in a workspace with a database to verify:
    • Single-select prompts work correctly
    • Defaults are populated as expected
    • No boilerplate prompts appear for moduleName/moduleDesc/access
    • Generated packages have correct descriptions and access: restricted
  • Verify answers field names match boilerplate template - The fields moduleName, moduleDesc, access should match what the module boilerplate template expects

Notes

- Change databases and database_ids prompts from checkbox to list (single-select)
- Fix selection bug that mapped all options instead of just selected ones
- Update metaExtensionName default to be more descriptive (e.g., 'minimal-service')
- Pass answers to initModule to skip boilerplate prompts (moduleName, moduleDesc, packageIdentifier, access)
- Add smart descriptions for both db and meta extension packages
- Add databaseName to dbInfo for better description generation
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit f23c8fb into main Dec 27, 2025
34 checks passed
@pyramation pyramation deleted the devin/1766785649-improve-export-ux branch December 27, 2025 00:58
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