From 40e5f7af814d12a04c8aa963158ddfc2e4e54724 Mon Sep 17 00:00:00 2001 From: Angelo Ashmore Date: Fri, 10 Apr 2026 22:44:54 +0000 Subject: [PATCH 1/2] feat: improve `content-relationship` help text Co-Authored-By: Claude Opus 4.6 (1M context) --- .../field-add-content-relationship.ts | 28 ++++++++++++++++--- src/commands/field-add.ts | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/commands/field-add-content-relationship.ts b/src/commands/field-add-content-relationship.ts index c93b592..e79d084 100644 --- a/src/commands/field-add-content-relationship.ts +++ b/src/commands/field-add-content-relationship.ts @@ -9,19 +9,39 @@ import { getRepositoryName } from "../project"; const config = { name: "prismic field add content-relationship", - description: - "Add a content relationship field to a slice or custom type. Use for querying and displaying data from related documents (e.g. an author or category). For navigational links, use link instead.", + description: ` + Add a content relationship field to a slice or custom type. + + Content relationships fetch and display data from related documents + (e.g. an author's name, a category's label). They are not navigational + links -- use the link field type for URLs, documents, or media that + the user clicks to visit. + + Use --custom-type and --tag to restrict which documents can be + selected. These filters define exactly which documents are queryable + through this field. If neither is specified, all documents are allowed. + `, + sections: { + "FIELD CONSTRAINTS": ` + --custom-type and --tag narrow which documents editors can select + and which documents the API returns for this field. Adding or + removing a custom type or tag that is referenced by an existing + content relationship changes which documents are queryable -- any + code that depends on a specific document type being returned may + break if that type is removed from the constraint list. + `, + }, positionals: { id: { description: "Field ID", required: true }, }, options: { ...TARGET_OPTIONS, label: { type: "string", description: "Field label" }, - tag: { type: "string", multiple: true, description: "Allowed tag (can be repeated)" }, + tag: { type: "string", multiple: true, description: "Restrict to documents with this tag (can be repeated)" }, "custom-type": { type: "string", multiple: true, - description: "Allowed custom type (can be repeated)", + description: "Restrict to documents of this type (can be repeated)", }, }, } satisfies CommandConfig; diff --git a/src/commands/field-add.ts b/src/commands/field-add.ts index 46f88b2..eb5bc43 100644 --- a/src/commands/field-add.ts +++ b/src/commands/field-add.ts @@ -31,7 +31,7 @@ export default createCommandRouter({ }, "content-relationship": { handler: fieldAddContentRelationship, - description: "Add a content relationship field for querying linked documents (e.g. author, category)", + description: "Add a content relationship field for fetching data from related documents (not for navigation -- use link)", }, date: { handler: fieldAddDate, From 1f9d32d2d0c960cab49565b5b7d5b50114ed2f8f Mon Sep 17 00:00:00 2001 From: Angelo Ashmore Date: Fri, 10 Apr 2026 22:49:14 +0000 Subject: [PATCH 2/2] chore: drop FIELD CONSTRAINTS section from content-relationship help Co-Authored-By: Claude Opus 4.6 (1M context) --- src/commands/field-add-content-relationship.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/commands/field-add-content-relationship.ts b/src/commands/field-add-content-relationship.ts index e79d084..93e71b3 100644 --- a/src/commands/field-add-content-relationship.ts +++ b/src/commands/field-add-content-relationship.ts @@ -21,16 +21,6 @@ const config = { selected. These filters define exactly which documents are queryable through this field. If neither is specified, all documents are allowed. `, - sections: { - "FIELD CONSTRAINTS": ` - --custom-type and --tag narrow which documents editors can select - and which documents the API returns for this field. Adding or - removing a custom type or tag that is referenced by an existing - content relationship changes which documents are queryable -- any - code that depends on a specific document type being returned may - break if that type is removed from the constraint list. - `, - }, positionals: { id: { description: "Field ID", required: true }, },