Skip to content

feat(env): print setup instructions after prismic env set - #424

Merged
angeloashmore merged 15 commits into
mainfrom
claude/env-set-setup-steps
Oct 14, 2026
Merged

angeloashmore merged 15 commits into
mainfrom
claude/env-set-setup-steps

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Resolves:

Description

Before this PR, prismic env set only 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 set prints any remaining setup instructions, like prismic preview add does. 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/env declares it (#418). The change works for all frameworks.

Checklist

  • 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

In a project without <PrismicPreview>, run prismic 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 set now prints framework-specific setup instructions after switching environments, matching behavior already used by prismic 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

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

@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
@angeloashmore angeloashmore changed the title feat(env): print open setup steps after prismic env set feat(env): print setup instructions after prismic env set Oct 14, 2026
claude added 10 commits October 14, 2026 19:18
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
Base automatically changed from claude/installed-major-fallback to main October 14, 2026 19:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L53y5wowGHwtT4aZJ3UsHY
@angeloashmore
angeloashmore merged commit 26c9426 into main Oct 14, 2026
16 checks passed
@angeloashmore
angeloashmore deleted the claude/env-set-setup-steps branch October 14, 2026 19:43
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.

2 participants