Skip to content

feat: add default UID field to new repeatable types#184

Open
angeloashmore wants to merge 2 commits into
mainfrom
feat/type-create-default-uid
Open

feat: add default UID field to new repeatable types#184
angeloashmore wants to merge 2 commits into
mainfrom
feat/type-create-default-uid

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented May 11, 2026

Resolves:

Description

prismic type create now seeds repeatable types with a default UID field in the Main tab. Singletons are unchanged.

This behavior matches the Type Builder and 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

  1. prismic type create "Blog Post" --format page
  2. Inspect customtypes/blog_post/index.json and confirm Main.uid exists.
  3. prismic type create Settings --single and confirm Main.uid is absent.

Note

Low Risk
Low risk: small change to prismic type create JSON scaffolding plus test updates; only affects newly created repeatable types and should not impact existing custom type models.

Overview
prismic type create now auto-adds a Main.uid field (type: "UID") when creating repeatable types (both custom and page formats); singleton (--single) types remain unchanged.

Tests are updated to assert the presence of the default UID field for repeatable types and its absence for singletons.

Reviewed by Cursor Bugbot for commit 9929bcb. Bugbot is set up for automated code reviews on this repo. Configure here.


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

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.

Repeatable types need a UID for routing and references. Adding it by default removes a manual step after `prismic type create`.

Co-Authored-By: Claude Opus 4.7 (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.

Reviewed by Cursor Bugbot for commit c65daee. Configure here.

Comment thread src/commands/type-create.ts Outdated
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@xrutayisire xrutayisire left a comment

Choose a reason for hiding this comment

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

LGTM, nice catch!

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