Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Dec 31, 2025

Summary

When exportMigrations is called programmatically (e.g., from tests in constructive-db), it was prompting for interactive input:

Enter author full name (--fullName) [Dan Lynch]
>

This happened because preparePackage calls initModule with an author string (e.g., 'Constructive <developers@constructive.io>'), but the module template expects separate fullName and email fields in the answers.

This PR:

  1. Adds a parseAuthorString helper that extracts fullName and email from the author string
  2. Passes these fields to the answers object when calling initModule
  3. Sets noTty: true to disable interactive prompts for programmatic use

Review & Testing Checklist for Human

  • Verify the regex handles edge cases: Test with author strings like "John Doe" (no email), "Name <email>", and "Name With Spaces <email@domain.com>"
  • Check if noTty: true has unintended side effects: Ensure this doesn't suppress prompts that should still appear in CLI usage
  • Verify CI passes: I couldn't build locally due to workspace dependency issues

Recommended test plan:

  1. Run the introspection export test in constructive-db after this is merged and the dependency is updated
  2. Manually test pgpm export from CLI to ensure interactive prompts still work when needed

Notes

This fix is needed to unblock the introspection package tests in constructive-db PR #159.

Link to Devin run: https://app.devin.ai/sessions/cf99eca9a417440f98c23cd9db41555b
Requested by: Dan Lynch (@pyramation)


Note

Ensures programmatic exports don't trigger interactive prompts during module scaffolding.

  • Adds parseAuthorString(author) to extract fullName and optional email from strings like "Name <email@domain>"
  • Updates preparePackage to pass fullName/email in initModule answers and sets noTty: true
  • Minor cleanup: preserve existing overwrite logic; no behavior changes elsewhere

Written by Cursor Bugbot for commit cf6e9d7. This will update automatically on new commits. Configure here.

When exportMigrations calls initModule, it now:
1. Parses the author string (e.g., 'Constructive <developers@constructive.io>')
   to extract fullName and email components
2. Passes fullName and email in the answers object to satisfy template questions
3. Sets noTty: true to disable interactive prompts for programmatic use

This allows exportMigrations to work non-interactively when called from
tests or other programmatic contexts.
@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

- Create shared parseAuthor utility in pgpm/core/src/utils/author.ts
- Update export-migrations.ts to use shared utility and remove noTty: true
- Update writer.ts to use shared utility (preserves fallback email behavior)

This allows exportMigrations to work non-interactively by providing
fullName and email in the answers object, without hardcoding noTty.
@pyramation pyramation merged commit 2d560b8 into main Dec 31, 2025
35 checks passed
@pyramation pyramation deleted the devin/1767151598-fix-export-interactive-prompt branch December 31, 2025 03:57
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