feat(instant-start): setup starter provisioned repo on init - #245
feat(instant-start): setup starter provisioned repo on init#245jomifepe wants to merge 20 commits into
Conversation
Provide a single CLI flow to provision or export an Instant Start repository, download the starter, and set up local development. Co-authored-by: Cursor <cursoragent@cursor.com>
Inline the command handler, use synchronous ZIP extraction, and drop the mock-heavy orchestration test while keeping focused API and filesystem coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: José Pereira <jomifepe@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Restore the standalone init command and move the paired starter handoff into a dedicated starter download namespace with repository validation, pinned GitHub download, local preview setup, and post-extract documents cleanup. Co-authored-by: Cursor <cursoragent@cursor.com>
Check for an existing localhost preview before adding one so rerunning the command does not create duplicate preview configs. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep starter download independent from Website Generator while incorporating the latest CLI improvements. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve the GitHub archive URL from persisted starter provenance instead of a hardcoded commit, and reject repositories without recorded revision metadata. Co-authored-by: Cursor <cursoragent@cursor.com>
Build the GitHub archive URL directly from repository metadata and only reject repositories without starter provenance. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort 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 31e452e. Configure here.
Mark the Instant Start onboarding step complete only after the starter has been downloaded and configured locally, without failing setup if tracking fails. Co-authored-by: Cursor <cursoragent@cursor.com>
Read the deployment URL from repository starter metadata so download removes the exact preview configured during provisioning. Co-authored-by: Cursor <cursoragent@cursor.com>
Move Instant Start local setup to `prismic init --repo` for existing projects, removing the dedicated starter download command and zip flow. Co-authored-by: Cursor <cursoragent@cursor.com>
These exports were removed during the starter download cleanup but are still required by completeStarterHandoff, which broke TypeScript and runtime preview setup. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Nice work on this! I found a few implementation issues, but the overall behavior checks out.
| export const starterLocalPreviewURL = "http://localhost:3000/api/preview"; | ||
| const starterLocalPreviewConfig = { | ||
| name: "Development", | ||
| websiteURL: "http://localhost:3000", | ||
| resolverPath: "/api/preview", | ||
| }; | ||
| const starterLocalSimulatorURL = "http://localhost:3000/slice-simulator"; |
There was a problem hiding this comment.
nextjs.ts sets the same ones during setup). Two sources of truth will drift. The handoff should get these from the adapter (or the server if that's where we want to store them), even if that means a small adapter reorg to expose them standalone.
| async function removeStarterDocuments(starter: NonNullable<Repository["starter"]>): Promise<void> { | ||
| const packageJson = await readPackageJson(); | ||
| const starterPackageName = starter.id.split("/").at(-1); | ||
| if (!starterPackageName || packageJson.name !== starterPackageName) { |
There was a problem hiding this comment.
💡 #idea: The name-vs-starter-id check for deleting documents/ is good. As a follow-up, once the handoff completes we could rewrite name to the repo name so the project gets its own identity instead of the starter's.

Summary
prismic init --repoto complete Instant Start local handoff for existing degit'd projects: reconnect config, sync models, removedocuments/, configure previews/simulator, and mark the onboarding step donestarter.id,starter.revision,starter.deploymentUrl)prismic starter downloadcommand and GitHub archive zip extraction flowTest plan
npm run test(lint, types, unit)npm run unit -- test/starter-handoff.test.ts test/repository-client.test.ts test/init.test.tsMade with Cursor