Skip to content

Commit b0d255b

Browse files
committed
docs(spec): key the fieldPatches example option by a value crm_account.industry stores
The documented example patched option `tech`, which crm_account.industry does not store, so a copy was refused at os validate and install. Re-key it as `technology: { label: 'Tech' }` in the schema description, TSDoc, the option-list refusal text, the object-extensions guide and the two unreleased changesets that carried it. Claude-Session: https://claude.ai/code/session_01ADHkmQfYHca8dfoXTJfeKp Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1617b7f commit b0d255b

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎.changeset/28560-field-patch-slot.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ objectExtensions: [{
1616
industry: {
1717
label: 'Sector',
1818
inlineHelpText: 'The market the account sells into',
19-
options: { tech: { label: 'Technology' } },
19+
options: { technology: { label: 'Tech' } },
2020
},
2121
},
2222
}]

‎.changeset/28565-field-patch-applied.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ADR-0146 D10's second rule, live. The per-field display patch an object extensio
1717
objectExtensions: [{
1818
extend: 'crm_account',
1919
fieldPatches: {
20-
industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { tech: { label: 'Technology' } } },
20+
industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { technology: { label: 'Tech' } } },
2121
},
2222
}]
2323
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the documented `fieldPatches` example keys its option by a value `crm_account.industry` really stores
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `fieldPatches` description, its TSDoc example and the refusal text for an option list under `options` showed `options: { tech: { label: 'Technology' } }`. `crm_account.industry` stores `technology`, not `tech`, so a copy of that example was refused at `os validate` and at install as naming an option the field does not have. The example now reads `options: { technology: { label: 'Tech' } }`, the same spelling the published skill uses. Prose only: no schema accepts or refuses anything differently.

‎content/docs/data-modeling/object-extensions.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const AccountWordingExtension = defineObjectExtension({
110110
industry: {
111111
label: 'Sector',
112112
inlineHelpText: 'The market the account sells into.',
113-
options: { tech: { label: 'Technology' } }, // addressed by the stored value
113+
options: { technology: { label: 'Tech' } }, // addressed by the stored value
114114
},
115115
},
116116
});

‎packages/spec/src/data/object.zod.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4835,7 +4835,7 @@ const FieldDisplayPatchSchema = lazySchema(() => {
48354835
error: (issue) =>
48364836
issue.code === 'invalid_type' && Array.isArray(issue.input)
48374837
? 'A field patch\'s `options` is a map keyed by each option\'s stored value — ' +
4838-
'`options: { tech: { label: \'Technology\' } }` — not the field\'s option list: which options ' +
4838+
'`options: { technology: { label: \'Tech\' } }` — not the field\'s option list: which options ' +
48394839
'exist stays the vendor\'s (ADR-0146 D6).'
48404840
: undefined,
48414841
}).optional().describe(
@@ -4879,7 +4879,7 @@ function refuseExtensionFieldPatchKeys(fieldPatches: unknown, ctx: z.RefinementC
48794879
* fields: { sales_stage: Field.select([...]) },
48804880
* // A base field's display properties only (ADR-0146 D10), applied by the
48814881
* // registry merge (`mergeObjectDefinitions`) — see `fieldPatches`.
4882-
* fieldPatches: { industry: { label: 'Sector', options: { tech: { label: 'Technology' } } } },
4882+
* fieldPatches: { industry: { label: 'Sector', options: { technology: { label: 'Tech' } } } },
48834883
* }]
48844884
* ```
48854885
*/
@@ -4963,8 +4963,8 @@ export const ObjectExtensionSchema = lazySchema(() => strictObject({
49634963
'the additive merges, on every object read: a tenant\'s own text keeps winning, and between two ' +
49644964
'extensions the higher `priority` wins. A patch naming a field or option value the target does not ' +
49654965
'have is refused at install and by `os validate`. Example: `fieldPatches: { industry: { label: ' +
4966-
'\'Sector\', inlineHelpText: \'The market the account sells into\', options: { tech: { label: ' +
4967-
'\'Technology\' } } } }`.',
4966+
'\'Sector\', inlineHelpText: \'The market the account sells into\', options: { technology: { label: ' +
4967+
'\'Tech\' } } } }`.',
49684968
),
49694969

49704970
/** Override label */

0 commit comments

Comments
 (0)