Skip to content

refactor(init): reorganize starter handoff per file organization conventions - #250

Open
angeloashmore wants to merge 4 commits into
jp/instant-start-github-starterfrom
aa/starter-file-organization
Open

refactor(init): reorganize starter handoff per file organization conventions#250
angeloashmore wants to merge 4 commits into
jp/instant-start-github-starterfrom
aa/starter-file-organization

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Jul 31, 2026

Copy link
Copy Markdown
Member

Resolves:

Description

Reorganizes the starter handoff code from #245 to follow the AGENTS.md file organization rules:

  • src/lib/starter.ts is removed and its logic moved into src/commands/init.ts, its only caller. The lib layer must stay application-unaware, and this code throws CommandError and prints CLI remediation messages.
  • hasPreviewByURL and removePreviewsByURL are removed from the core client. Clients hold network calls only; the URL filtering and removal fan-out now live at the call site in init.ts (also saving a duplicate previews fetch).
  • test/starter-handoff.test.ts and test/repository-client.test.ts (mock-fetch unit tests importing from src/) are replaced with e2e scenarios in test/init.test.ts, plus a createInstantStartRepository test helper that calls POST /website-generator/instant-start.

The unsafe-model-changes e2e test runs today. The three starter-provenance tests (full handoff, package-name mismatch, no-models error) are skipped until prismicio/obelix#1703 deploys, since only that backend change makes the endpoint write the starter metadata the handoff reads.

No behavior change intended.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

Run prismic init --repo <starter-repo> in a starter project and confirm the handoff still configures the local preview, simulator, and onboarding step. Once obelix#1703 is deployed, unskip the three starter tests in test/init.test.ts and run npx vitest run test/init.test.ts.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

angeloashmore and others added 2 commits July 31, 2026 20:05
Per AGENTS.md file organization rules:
- Move src/lib/starter.ts logic into src/commands/init.ts, its only
  caller. The lib layer must stay application-unaware; this code throws
  CommandError and prints CLI remediation messages.
- Remove hasPreviewByURL/removePreviewsByURL from the core client and
  inline the orchestration at the call site. Clients are network calls
  only.
- Remove test/starter-handoff.test.ts and test/repository-client.test.ts.
  Tests mirror src/commands/ one-to-one and never import from src/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the removed mocked unit tests with e2e scenarios in
test/init.test.ts. The unsafe-model-changes test runs today; the three
starter-provenance tests are skipped until prismicio/obelix#1703 deploys
the /website-generator/instant-start provenance changes to production.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angeloashmore angeloashmore changed the title refactor(init): inline starter handoff into the init command refactor(init): reorganize starter handoff per file organization conventions Jul 31, 2026
angeloashmore and others added 2 commits July 31, 2026 20:35
Exercises the canonicalized equality check: a same-id model with
different content must count as an update and block the automatic sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angeloashmore
angeloashmore marked this pull request as ready for review July 31, 2026 20:46
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.

1 participant