Merged
Conversation
Extract framework setup logic into a standalone `setupProject` method on the Adapter class so it can be called independently via `prismic gen setup`. This lets users regenerate setup files (Prismic client, slice simulator, preview routes) without re-running full project initialization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Retry was set globally but should be per-project to ensure it only applies to runtime tests, not type-check tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves: #53
Description
Allow users to regenerate framework-specific setup files (Prismic client, slice simulator, preview routes, etc.) without re-running full project initialization.
This extracts the setup logic from
onProjectInitializedinto a newsetupProjectabstract method on the Adapter class, then exposes it asprismic gen setup. Supports--no-installto skip dependency installation. Skips files that already exist.Replaces
prismic status: Thegen setupcommand replaces thestatuscommand from the proof-of-concept CLI. Withgen setup, developers and agents can quickly generate all necessary files without first runningstatusand manually generating the necessary files.statusmay come back for a different use later, but it it not needed now.Checklist
Preview
How to QA 1
Note
Medium Risk
Introduces a new CLI command that writes framework setup files and modifies the Adapter initialization contract, so existing init flows could change behavior if any adapters or callers aren’t updated. File generation and dependency installation are relatively contained but can impact local project state.
Overview
Adds a new
prismic gen setupcommand to regenerate framework-specific Prismic setup (client file, slice simulator, preview/revalidate routes, etc.) and optionally install dependencies via--no-install.Refactors adapter initialization by extracting framework setup work from
onProjectInitializedinto a new requiredsetupProject()method, called both byAdapter.initProject()and the new command; Next.js/Nuxt/SvelteKit adapters are updated accordingly (leavingonProjectInitializedas a no-op).Adds tests covering help output, file generation, skipping existing files, and skipping dependency installation, and adjusts Vitest config to apply retries per project.
Written by Cursor Bugbot for commit 1d8c330. This will update automatically on new commits. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩