Skip to content

feat: add prismic init --no-setup to skip framework scaffolding#206

Merged
angeloashmore merged 2 commits into
mainfrom
feat/init-no-setup
Jul 2, 2026
Merged

feat: add prismic init --no-setup to skip framework scaffolding#206
angeloashmore merged 2 commits into
mainfrom
feat/init-no-setup

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Jul 1, 2026

Copy link
Copy Markdown
Member

Resolves: #202

Description

Adds a --no-setup flag to prismic init that runs the full init flow but skips the framework scaffolding step, so it does not add the @prismicio/* packages or generate the framework files. This is for projects that write the Prismic client, pages, and route handlers by hand.

--no-setup skips exactly what prismic gen setup does: Adapter.setupProject() and dependency installation. Everything else still runs — creating or connecting the repository, writing prismic.config.json, migrating a legacy slicemachine.config.json, syncing models, and generating types.

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 --no-setup in a project. It should create the repository and prismic.config.json, sync models, and generate types, without adding @prismicio/* packages or creating framework files.


Note

Low Risk
Opt-in CLI flag with default init behavior unchanged; only skips scaffolding and install when explicitly requested.

Overview
Adds prismic init --no-setup for hand-rolled Prismic integrations: init still connects or creates the repo, writes prismic.config.json, migrates legacy Slice Machine config when present, syncs models, and generates types, but skips framework scaffolding and npm install.

Adapter.initProject now accepts { setup?: boolean } (default true). When setup is false, setupProject() is not called; slice index creation and onProjectInitialized() still run.

An integration test asserts --no-setup leaves prismic.config.json in place and does not add @prismicio/client or run install (no package-lock.json).

Reviewed by Cursor Bugbot for commit 3677d2d. 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.

Runs init normally but skips `Adapter.setupProject()` and dependency
installation, so no `@prismicio/*` packages are added and no framework
files are created. The repository, prismic.config.json, model sync, and
type generation still run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@jomifepe jomifepe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@angeloashmore angeloashmore merged commit 5877f6e into main Jul 2, 2026
16 checks passed
@angeloashmore angeloashmore deleted the feat/init-no-setup branch July 2, 2026 01:21
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.

Feature request: prismic init --no-setup to skip project scaffolding

3 participants