Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Dec 31, 2025

Summary

Adds the remaining required template fields (repoName and username) to the answers object in preparePackage to prevent interactive prompts when exportMigrations is called programmatically.

This is a follow-up to PR #533 which added fullName and email. After that fix, the module boilerplate template was still prompting for repoName. Inspection of the boilerplate config at pgpm-boilerplates/default/module/.boilerplate.json revealed these additional required fields.

Review & Testing Checklist for Human

  • Verify hardcoded username: 'constructive-io' is acceptable - This value is hardcoded rather than derived from workspace config or author info. Consider if this should be configurable or derived from somewhere else.
  • Test export functionality end-to-end - Run the introspection export test in constructive-db to verify no more interactive prompts appear
  • Verify repoName: name is correct - Using the module name as the repo name may not always be appropriate

Recommended test plan:

  1. Merge this PR and publish a new version of @pgpmjs/core
  2. Update constructive-db to use the new version
  3. Run pnpm test in packages/introspection to verify introspect_export.test.ts passes without interactive prompts

Notes

This fix was discovered by cloning pgpm-boilerplates and inspecting the .boilerplate.json questions. The template requires: fullName, email, moduleName, moduleDesc, repoName, username, access, and license.

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


Note

Ensures non-interactive module initialization during exports by completing required template answers.

  • Update preparePackage to pass answers with repoName: name and username: 'constructive-io' to project.initModule
  • Prevents template from prompting for missing fields when exportMigrations is run programmatically

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

The module boilerplate template requires repoName and username fields
in addition to fullName, email, moduleName, moduleDesc, access, and license.
Without these fields, the scaffolder prompts for interactive input which
breaks programmatic usage.
@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

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

...(email && { email })
...(email && { email }),
repoName: name,
username: 'constructive-io'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded organization-specific username in template answers

The username template answer is hardcoded to 'constructive-io' instead of being derived from available inputs or made configurable. Unlike fullName and email which are properly extracted from the author parameter via parseAuthor(), this value will be incorrect for any user or organization other than Constructive IO. Test snapshots show username is expected to be user-specific (e.g., "tester"). Generated modules will have incorrect ownership metadata, potentially affecting repository URLs or package attribution.

Fix in Cursor Fix in Web

- Add repoName and username to ExportOptions, ExportMigrationsToDiskOptions, and PreparePackageOptions interfaces
- Thread parameters through exportMigrations -> exportMigrationsToDisk -> preparePackage
- Use sensible defaults: repoName defaults to module name, username is optional
- Callers can now pass their own values for non-interactive use
@pyramation pyramation merged commit 905ef24 into main Dec 31, 2025
35 checks passed
@pyramation pyramation deleted the devin/1767154440-add-missing-template-answers branch December 31, 2025 04:29
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