Repository navigation
feat(env): print setup instructions after prismic env set - #424
Merged
Merged
Conversation
@prismicio/svelte v2 requires Svelte 5, so the Svelte 4 code that SvelteKit setup generated did not work. Setup, slice components, and setup instructions now always use Svelte 5 syntax. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
getInstalledMajor assumed the newest major when a package was not in node_modules. It now reads a simple range like "^15.0.0" from package.json first. The helper moves to lib/packageJson, next to the other package.json helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
A new environment has no effect until the project setup is finished. prismic env set now prints the open setup steps, like prismic preview add. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
1 of 3 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
getAdapter detects frameworks from peer dependencies too, so getInstalledMajor now reads a peer range when the package is not a dependency or dev dependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
The test for a project without node_modules now checks only that setup works. A separate test checks that setup uses the declared Next.js version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY # Conflicts: # test/gen-setup.test.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
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
Before this PR,
prismic env setonly confirmed the change. If the project setup was not finished, the website could ignore the new environment, and nothing told the user why.After this PR,
prismic env setprints any remaining setup instructions, likeprismic preview adddoes. A project with a finished setup sees no extra output.This matters most for SvelteKit 3, where the website reads the environment only after
src/envdeclares it (#418). The change works for all frameworks.Checklist
Preview
How to QA 1
In a project without
<PrismicPreview>, runprismic env set <your-repository>. Make sure that the output asks you to add<PrismicPreview>.🤖 Generated with Claude Code
https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
Note
Low Risk
CLI output-only change after environment switching; no auth or data-path changes.
Overview
prismic env setnow prints framework-specific setup instructions after switching environments, matching behavior already used byprismic preview add.The command no longer returns early when resetting to production; it always runs
getSetupInstructions()and prints the result when non-empty, so users see reminders (e.g. adding<PrismicPreview>) when setup is incomplete.A test asserts that stdout includes the preview setup message after
env set.Reviewed by Cursor Bugbot for commit e202308. 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. ↩