feat: configure preview and simulator URL on init#183
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||
| const simulatorUrl = await getSimulatorUrl({ repo, token, host }); | ||
| if (!simulatorUrl) { | ||
| await setSimulatorUrl("http://localhost:5173/slice-simulator", { repo, token, host }); |
There was a problem hiding this comment.
💡 I always wondered why we don’t also use localhost:3000 for SvelteKit. I know 5173 is the default from Vite, but having 3000 everywhere could make things simpler and more consistent I guess.
There was a problem hiding this comment.
Also VITE since 5 is V in Roman numerals!
@xrutayisire: I always wondered why we don’t also use localhost:3000 for SvelteKit. I know 5173 is the default from Vite, but having 3000 everywhere could make things simpler and more consistent I guess.
It's better to follow each framework's conventions, in my opinion, rather than force our conventions. Developers will be less surprised and will have less to learn if we follow what they expect.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cf8c5b0. Configure here.

Resolves:
Description
When initializing a Prismic project, set a default slice simulator URL and a "Development" preview entry pointing at localhost, but only if the repository doesn't already have them configured. This applies to the Next.js, Nuxt, and SvelteKit adapters.
Without this change, developers need to manually configure previews in the repository. We already generate the necessary preview files in the project.
Checklist
Preview
How to QA 1
Need help on this PR? Tag
@codesmithwith what you need.Note
Medium Risk
Adds automatic repository configuration (simulator URL and preview configs) during
init, which introduces new network-side effects and could fail due to auth/permissions or overwrite expectations if the presence checks are wrong.Overview
Configures Prismic repository settings during
initfornext,nuxt, andsveltekit: ononProjectInitialized, it now sets a default Slice Simulator URL and creates a "Development" preview pointing at localhost only if the repository has no existing simulator URL or preview configs.Normalizes
--repo/legacy repository names to lowercase ininit, and extends integration tests to assert simulator/preview configuration is created for new repos and preserved for repos with pre-existing preview/simulator settings (including adding a test-onlysetSimulatorUrlhelper).Reviewed by Cursor Bugbot for commit c9d8479. Bugbot is set up for automated code reviews on this repo. 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. ↩