feat(pgpm): add --boilerplate flag to prompt for boilerplate selection #488
+2,668
−7,259
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 a
--boilerplateflag topgpm initthat scans the template repository for available boilerplates and presents an autocomplete selection prompt to the user, instead of defaulting to 'module'.When running
pgpm init --boilerplatewithout a positional argument:fromPathininspectTemplate)resolveBoilerplateBaseDirandscanBoilerplatesfromPathThe
--boilerplateflow is now separated into a dedicatedhandleBoilerplateInitfunction for cleaner code organization.--dirOverride BehaviorWhen
--diris specified, it now bypasses.boilerplates.jsonresolution entirely:useBoilerplatesConfig: falseoption fromcreate-gen-appto explicitly disable.boilerplates.jsonfallbackresolvedTemplatePathdirectly instead of reading.boilerplates.json.boilerplates.jsonis missing or has nodirproperty, defaults to repo root (.)Error Handling
--no-tty), throws an error if no positional<fromPath>is providedUpdates since last revision
useBoilerplatesConfigAPI: Replaced brittle post-hoc string comparison validation with the newuseBoilerplatesConfigoption fromcreate-gen-app. When--diris specified, passesuseBoilerplatesConfig: falseto bypass.boilerplates.jsonresolution at the source.create-gen-appdependency to^0.9.0: This version includes the newuseBoilerplatesConfigoption.inspectTemplateandscaffoldTemplateby removing the validation logic that checked ifcreate-gen-appfell back to.boilerplates.json.Review & Testing Checklist for Human
create-gen-appfirst: This PR requirescreate-gen-app@^0.9.0with theuseBoilerplatesConfigoption. See companion PR: feat(create-gen-app): add useBoilerplatesConfig option to control .boilerplates.json resolution dev-utils#36--dirbypass: Runpgpm init module --dir supabaseand verify it does NOT fall back to.boilerplates.json(should error ifsupabase/moduledoesn't exist)pgpm init --boilerplateand verify autocomplete prompt appears with available boilerplates--boilerplatewith--dir: Runpgpm init --boilerplate --dir supabaseand verify it scans thesupabase/directory, notdefault/CI=true pgpm init --boilerplateand verify it throws an actionable error messageRecommended test plan:
Notes
Dependency: This PR depends on constructive-io/dev-utils#36 being merged and
create-gen-app@0.9.0being published first. CI will fail until then.Requested by: Dan Lynch (@pyramation)
Link to Devin run: https://app.devin.ai/sessions/36e9a9f44158421996d176f2ce90d280