Skip to content

feat: support Slice Machine projects#84

Merged
angeloashmore merged 4 commits intomainfrom
aa/slice-machine-compat
Apr 2, 2026
Merged

feat: support Slice Machine projects#84
angeloashmore merged 4 commits intomainfrom
aa/slice-machine-compat

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented Apr 1, 2026

Resolves: https://prismic-team.slack.com/archives/C02L3FN3AJK/p1775006811713959

Description

Make the CLI compatible with all Slice Machine repositories, not just those using the Type Builder. This lets users and AI agents benefit from the CLI immediately rather than waiting for the Type Builder rollout to reach their repository.

Non-modeling commands (e.g. init, sync) will work with any Slice Machine project. Modeling commands still require the Type Builder. Users whose repositories haven't been upgraded are given a clear message directing them to continue using Slice Machine.

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

🤖 Generated with Claude Code


Note

Medium Risk
Introduces new auth parsing/writing behavior and new remote feature-flag/repository checks that can block init/sync, so failures or API/flag issues could impact core CLI workflows.

Overview
Adds Slice Machine compatibility by teaching auth to read/write Slice Machine-style .prismic files (base/cookies) when a slicemachine.config.json is present, and by falling back to legacy config to derive the repository name.

Gates prismic init and prismic sync behind a new checkIsTypeBuilderEnabled check (Amplitude flag + repository quota, overridable via PRISMIC_TYPE_BUILDER_ENABLED), with a dedicated TypeBuilderRequiredError message surfaced in the CLI.

Introduces a new getRepository client plus an amplitude flag-evaluation helper, and updates E2E tests to cover the new gating and Slice Machine auth format.

Written by Cursor Bugbot for commit 0e1fab2. 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 April 1, 2026 12:29
Support Slice Machine projects by reading legacy auth format (cookies/base)
from ~/.prismic and falling back to slicemachine.config.json for repository
name resolution. Gate init and sync commands behind a Type Builder feature
flag to direct users to Slice Machine when their repository hasn't been
upgraded yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore marked this pull request as ready for review April 1, 2026 23:50
@angeloashmore angeloashmore changed the title feat: support Slice Machine backward compatibility feat: support Slice Machine projects Apr 1, 2026
Comment thread src/commands/init.ts
Comment thread src/auth.ts Outdated
Comment thread src/auth.ts Outdated
Comment thread src/project.ts
Fix stale token after login in init, cookie value truncation with `=` chars,
empty host string fallback using `||`, and config error propagation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread src/project.ts
…ling

Use PRISMIC_TYPE_BUILDER_ENABLED env var instead of TEST to control
the Type Builder gate, allowing explicit testing of both enabled and
disabled states. Fix whoami Slice Machine auth test to use login
fixture for token instead of env var.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/commands/init.ts
@angeloashmore angeloashmore merged commit 6daa538 into main Apr 2, 2026
13 checks passed
@angeloashmore angeloashmore deleted the aa/slice-machine-compat branch April 2, 2026 01:11
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.

1 participant