Skip to content

feat: add gen setup command#73

Merged
angeloashmore merged 2 commits intomainfrom
aa/gen-setup
Mar 25, 2026
Merged

feat: add gen setup command#73
angeloashmore merged 2 commits intomainfrom
aa/gen-setup

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented Mar 25, 2026

Resolves: #53

Description

Allow users to regenerate framework-specific setup files (Prismic client, slice simulator, preview routes, etc.) without re-running full project initialization.

This extracts the setup logic from onProjectInitialized into a new setupProject abstract method on the Adapter class, then exposes it as prismic gen setup. Supports --no-install to skip dependency installation. Skips files that already exist.

Replaces prismic status: The gen setup command replaces the status command from the proof-of-concept CLI. With gen setup, developers and agents can quickly generate all necessary files without first running status and manually generating the necessary files. status may come back for a different use later, but it it not needed now.

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


Note

Medium Risk
Introduces a new CLI command that writes framework setup files and modifies the Adapter initialization contract, so existing init flows could change behavior if any adapters or callers aren’t updated. File generation and dependency installation are relatively contained but can impact local project state.

Overview
Adds a new prismic gen setup command to regenerate framework-specific Prismic setup (client file, slice simulator, preview/revalidate routes, etc.) and optionally install dependencies via --no-install.

Refactors adapter initialization by extracting framework setup work from onProjectInitialized into a new required setupProject() method, called both by Adapter.initProject() and the new command; Next.js/Nuxt/SvelteKit adapters are updated accordingly (leaving onProjectInitialized as a no-op).

Adds tests covering help output, file generation, skipping existing files, and skipping dependency installation, and adjusts Vitest config to apply retries per project.

Written by Cursor Bugbot for commit 1d8c330. This will update automatically on new commits. 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.

angeloashmore and others added 2 commits March 25, 2026 13:16
Extract framework setup logic into a standalone `setupProject` method
on the Adapter class so it can be called independently via
`prismic gen setup`. This lets users regenerate setup files (Prismic
client, slice simulator, preview routes) without re-running full
project initialization.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Retry was set globally but should be per-project to ensure it only
applies to runtime tests, not type-check tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore merged commit 9f1abb9 into main Mar 25, 2026
12 checks passed
@angeloashmore angeloashmore deleted the aa/gen-setup branch March 25, 2026 23:26
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.

Re-enable status command

1 participant