Skip to content

feat: show legacy slices in slice list and type view - #390

Merged
lihbr merged 2 commits into
mainfrom
claude/focused-pascal-2fffvf-legacy
Oct 1, 2026
Merged

lihbr merged 2 commits into
mainfrom
claude/focused-pascal-2fffvf-legacy

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Related: DT-3535

Description

Before this PR, the CLI ignored legacy slices, the slices that the Legacy Builder defines inside a type. For example, slice list did not show them, and slice view hero on a legacy slice failed as a CLI bug.

After this PR, slice list and type view mark legacy slices, and slice list --legacy lists only them. Commands that edit a slice say when it is a legacy slice.

NAME      ID        DEFINED IN
Hero *    hero      blog_post
Quote *   quote     blog_post

* Legacy slice. The CLI cannot edit legacy slices.

Upgrading legacy slices is in #388, which builds on this PR.

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 with legacy slices, run npx prismic slice list, npx prismic slice list --legacy --json, and npx prismic type view <type>.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H4jg7fmGVLhLJjo27eC7Mj


Note

Low Risk
Read-only listing and clearer errors for slice lookup; no changes to model sync, auth, or write paths beyond messaging.

Overview
Legacy Builder slices embedded in custom types are no longer invisible in the CLI. getLegacySlices scans slice zones for non-SharedSlice choices and powers the new behavior.

prismic slice list merges shared slices with legacy ones in a table (NAME, ID, DEFINED IN), marks legacy rows with *, and adds --legacy (including JSON with definedIn / sliceZone). prismic type view lists each slice zone’s choices and asterisks legacy entries, with a short footnote when the type contains any.

Adapter.getSlice now detects a legacy ID and fails with a CommandError explaining that the CLI cannot edit legacy slices (e.g. slice view hero), instead of a generic not-found error.

Reviewed by Cursor Bugbot for commit 5d5a697. 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. ↩

`slice list` marks legacy slices with * and shows the type that defines
them. `slice list --legacy` lists only legacy slices. `type view` lists
the slices in each slice zone and marks legacy ones. Commands that edit
a slice now say when the slice is a legacy slice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H4jg7fmGVLhLJjo27eC7Mj
@angeloashmore angeloashmore mentioned this pull request Oct 1, 2026
1 of 3 tasks
@angeloashmore
angeloashmore marked this pull request as ready for review October 1, 2026 01:01
@lihbr
lihbr merged commit f48e90b into main Oct 1, 2026
16 checks passed
@lihbr
lihbr deleted the claude/focused-pascal-2fffvf-legacy branch October 1, 2026 01:59
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.

3 participants