mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 11:19:27 +08:00
refactor-clt-skills-using-progressive-disclosure
This commit is contained in:
parent
d1f5eb9d69
commit
6be588acf5
@ -56,39 +56,8 @@ Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the
|
||||
- **Object type validation**: the CLT root is validated to ensure `lightning:type` is exactly `lightning__objectType`.
|
||||
|
||||
## Primitive Types & Constraints
|
||||
- `lightning__textType`
|
||||
- Max length 255
|
||||
- `lightning__multilineTextType`
|
||||
- Max length 2000
|
||||
- `lightning__richTextType`
|
||||
- Max length 100000
|
||||
- `lightning__urlType`
|
||||
- Max length 2000
|
||||
- Optional `lightning:allowedUrlSchemes` enum values: `https`, `http`, `relative`, `mailto`, `tel`
|
||||
- `lightning__dateType`
|
||||
- Data pattern: YYYY-MM-DD
|
||||
- `lightning__timeType`
|
||||
- Data pattern: HH:MM:SS.sssZ
|
||||
- `lightning__dateTimeType`
|
||||
- Data shape is an object with required `dateTime` and optional `timeZone`
|
||||
- `lightning__numberType`
|
||||
- Decimal numbers; optional `maximum`, `minimum`, `multipleOf`
|
||||
- `lightning__integerType`
|
||||
- Whole numbers only; optional `maximum`, `minimum`
|
||||
- `lightning__booleanType`
|
||||
- true/false
|
||||
|
||||
## Allowed Property-Level Keywords
|
||||
When strict validation is enabled (`unevaluatedProperties: false`), keep each property minimal and prefer only keywords known to be allowed:
|
||||
- `title`, `description`, `einstein:description`
|
||||
- `type` (when used, ensure it matches the chosen `lightning:type`)
|
||||
- `lightning:type`
|
||||
- `maximum`, `minimum`, `multipleOf` (numeric)
|
||||
- `maxLength`, `minLength` (string)
|
||||
- `const`, `enum`
|
||||
- `lightning:textIndexed`, `lightning:supportsPersonalization`, `lightning:localizable`
|
||||
- `lightning:uiOptions`, `lightning:allowedUrlSchemes`
|
||||
- `lightning:tags` (metaschema restricts values; currently `flow` is the only known allowed tag)
|
||||
When you need the full list of supported primitive types, their constraints, and allowed property-level keywords, read `assets/primitive-types-and-constraints.md`.
|
||||
|
||||
## Generation Workflow
|
||||
1. **Confirm the CLT approach**
|
||||
@ -164,11 +133,6 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
|
||||
</targets>
|
||||
</LightningComponentBundle>
|
||||
```
|
||||
7. **Deploy and validate**
|
||||
- Run a final schema sanity check before deploy: valid `lightning:type` names, required fields present, and no disallowed keywords.
|
||||
- Deploy the bundle using your org's standard metadata deployment flow (e.g. Salesforce CLI or IDE). The MCP client or tooling in use should provide or integrate with the appropriate deploy/retrieve commands for Lightning Type bundles.
|
||||
- Validate incrementally: if deployment fails, remove disallowed keywords first (especially `examples`, `items`, nested `lightning:type`).
|
||||
|
||||
## Common Deployment Errors
|
||||
| Error / Symptom | Likely Cause | Fix |
|
||||
|---|---|---|
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
# Primitive Types & Constraints
|
||||
|
||||
Reference for all supported Lightning primitive types and their allowed constraints.
|
||||
|
||||
## Supported Types
|
||||
|
||||
- `lightning__textType`
|
||||
- Max length 255
|
||||
- `lightning__multilineTextType`
|
||||
- Max length 2000
|
||||
- `lightning__richTextType`
|
||||
- Max length 100000
|
||||
- `lightning__urlType`
|
||||
- Max length 2000
|
||||
- Optional `lightning:allowedUrlSchemes` enum values: `https`, `http`, `relative`, `mailto`, `tel`
|
||||
- `lightning__dateType`
|
||||
- Data pattern: YYYY-MM-DD
|
||||
- `lightning__timeType`
|
||||
- Data pattern: HH:MM:SS.sssZ
|
||||
- `lightning__dateTimeType`
|
||||
- Data shape is an object with required `dateTime` and optional `timeZone`
|
||||
- `lightning__numberType`
|
||||
- Decimal numbers; optional `maximum`, `minimum`, `multipleOf`
|
||||
- `lightning__integerType`
|
||||
- Whole numbers only; optional `maximum`, `minimum`
|
||||
- `lightning__booleanType`
|
||||
- true/false
|
||||
|
||||
## Allowed Property-Level Keywords
|
||||
|
||||
When strict validation is enabled (`unevaluatedProperties: false`), keep each property minimal and prefer only keywords known to be allowed:
|
||||
|
||||
- `title`, `description`, `einstein:description`
|
||||
- `type` (when used, ensure it matches the chosen `lightning:type`)
|
||||
- `lightning:type`
|
||||
- `maximum`, `minimum`, `multipleOf` (numeric)
|
||||
- `maxLength`, `minLength` (string)
|
||||
- `const`, `enum`
|
||||
- `lightning:textIndexed`, `lightning:supportsPersonalization`, `lightning:localizable`
|
||||
- `lightning:uiOptions`, `lightning:allowedUrlSchemes`
|
||||
- `lightning:tags` (metaschema restricts values; currently `flow` is the only known allowed tag)
|
||||
Loading…
Reference in New Issue
Block a user