Skip to content

feat(instant-start): setup starter provisioned repo on init - #245

Open
jomifepe wants to merge 20 commits into
mainfrom
jp/instant-start-github-starter
Open

feat(instant-start): setup starter provisioned repo on init#245
jomifepe wants to merge 20 commits into
mainfrom
jp/instant-start-github-starter

Conversation

@jomifepe

@jomifepe jomifepe commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extend prismic init --repo to complete Instant Start local handoff for existing degit'd projects: reconnect config, sync models, remove documents/, configure previews/simulator, and mark the onboarding step done
  • read starter provenance from the Repository API (starter.id, starter.revision, starter.deploymentUrl)
  • remove the prismic starter download command and GitHub archive zip extraction flow
  • restore preview URL helpers used during hosted preview cleanup in handoff

Test plan

  • npm run test (lint, types, unit)
  • npm run unit -- test/starter-handoff.test.ts test/repository-client.test.ts test/init.test.ts

Made with Cursor

jomifepe and others added 15 commits July 20, 2026 17:45
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread src/lib/starter.ts Outdated
@jomifepe
jomifepe marked this pull request as draft July 30, 2026 12:34
jomifepe and others added 4 commits July 30, 2026 16:38
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>
@jomifepe jomifepe changed the title refactor(starter): download repository's pinned GitHub revision feat(instant-start): download repository's pinned GitHub revision Jul 31, 2026
@jomifepe jomifepe changed the title feat(instant-start): download repository's pinned GitHub revision feat(instant-start): setup starter provisioned repo on init Jul 31, 2026
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>
@jomifepe jomifepe self-assigned this Jul 31, 2026
@jomifepe
jomifepe marked this pull request as ready for review July 31, 2026 17:50

@angeloashmore angeloashmore left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this! I found a few implementation issues, but the overall behavior checks out.

⚠️ #issue: Some of the code/file organization doesn't follow the project standards. I realize these aren't written anywhere, so I opened #249 to add them. I also opened a PR on top of this one to apply the organization changes: #250.

Comment thread src/lib/starter.ts
Comment on lines +14 to +20
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";

@angeloashmore angeloashmore Jul 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

⚠️ #issue: The adapters already define the preview and simulator URLs (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.

Comment thread src/commands/init.ts
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) {

@angeloashmore angeloashmore Jul 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 #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.

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.

3 participants