refactor(init): reorganize starter handoff per file organization conventions - #250
Open
angeloashmore wants to merge 4 commits into
Open
refactor(init): reorganize starter handoff per file organization conventions#250angeloashmore wants to merge 4 commits into
angeloashmore wants to merge 4 commits into
Conversation
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>
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
marked this pull request as ready for review
July 31, 2026 20:46
2 tasks
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:
Description
Reorganizes the starter handoff code from #245 to follow the AGENTS.md file organization rules:
src/lib/starter.tsis removed and its logic moved intosrc/commands/init.ts, its only caller. The lib layer must stay application-unaware, and this code throwsCommandErrorand prints CLI remediation messages.hasPreviewByURLandremovePreviewsByURLare removed from the core client. Clients hold network calls only; the URL filtering and removal fan-out now live at the call site ininit.ts(also saving a duplicate previews fetch).test/starter-handoff.test.tsandtest/repository-client.test.ts(mock-fetch unit tests importing fromsrc/) are replaced with e2e scenarios intest/init.test.ts, plus acreateInstantStartRepositorytest helper that callsPOST /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
startermetadata the handoff reads.No behavior change intended.
Checklist
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 intest/init.test.tsand runnpx vitest run test/init.test.ts.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. ↩