mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-09 00:42:46 +08:00
remove whitespace
This commit is contained in:
parent
4ff2be05c5
commit
6a3640d0ed
@ -4,13 +4,11 @@ description: Use this skill when users need to create or configure a Salesforce
|
|||||||
---
|
---
|
||||||
|
|
||||||
# Digital Experience Site for React Web Applications
|
# Digital Experience Site for React Web Applications
|
||||||
|
|
||||||
Create and configure Digital Experience Sites that host React web applications on Salesforce. This skill generates the minimum necessary site infrastructure — Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and the `sfdc_cms__site` content type — so a React app can be served from Salesforce.
|
Create and configure Digital Experience Sites that host React web applications on Salesforce. This skill generates the minimum necessary site infrastructure — Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and the `sfdc_cms__site` content type — so a React app can be served from Salesforce.
|
||||||
|
|
||||||
React sites differ from standard LWR sites: they don't need routes, views, theme layouts, or branding sets. The site acts as a thin container (`appContainer: true`) that delegates rendering to the React application referenced by `appSpace`.
|
React sites differ from standard LWR sites: they don't need routes, views, theme layouts, or branding sets. The site acts as a thin container (`appContainer: true`) that delegates rendering to the React application referenced by `appSpace`.
|
||||||
|
|
||||||
## Required Properties
|
## Required Properties
|
||||||
|
|
||||||
Resolve all five properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found.
|
Resolve all five properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found.
|
||||||
|
|
||||||
| Property | Format | How to Resolve |
|
| Property | Format | How to Resolve |
|
||||||
@ -24,13 +22,10 @@ Resolve all five properties before generating any metadata. Each has a fallback
|
|||||||
The `appNamespace` and `appDevName` properties connect the site to the correct React application. Getting these wrong means the site deploys but shows a blank page, so take care to resolve them from real project data.
|
The `appNamespace` and `appDevName` properties connect the site to the correct React application. Getting these wrong means the site deploys but shows a blank page, so take care to resolve them from real project data.
|
||||||
|
|
||||||
## Generation Workflow
|
## Generation Workflow
|
||||||
|
|
||||||
### Step 1: Resolve All Required Properties
|
### Step 1: Resolve All Required Properties
|
||||||
|
|
||||||
Determine values for all five properties before constructing anything. Use the resolution strategies in the table above, falling through each option until a value is found.
|
Determine values for all five properties before constructing anything. Use the resolution strategies in the table above, falling through each option until a value is found.
|
||||||
|
|
||||||
### Step 2: Create the Project Structure
|
### Step 2: Create the Project Structure
|
||||||
|
|
||||||
Call the `get_metadata_api_context` MCP tool to retrieve schemas for `Network`, `CustomSite`, `DigitalExperienceConfig`, and `DigitalExperienceBundle` metadata types. These schemas define the valid XML structure for each file.
|
Call the `get_metadata_api_context` MCP tool to retrieve schemas for `Network`, `CustomSite`, `DigitalExperienceConfig`, and `DigitalExperienceBundle` metadata types. These schemas define the valid XML structure for each file.
|
||||||
|
|
||||||
Create any files and directories that don't already exist, using these paths:
|
Create any files and directories that don't already exist, using these paths:
|
||||||
@ -46,11 +41,9 @@ Create any files and directories that don't already exist, using these paths:
|
|||||||
The DigitalExperience directory contains only `_meta.json` and `content.json`. Do not create any directories other than `sfdc_cms__site` inside the bundle.
|
The DigitalExperience directory contains only `_meta.json` and `content.json`. Do not create any directories other than `sfdc_cms__site` inside the bundle.
|
||||||
|
|
||||||
### Step 3: Populate All Metadata Fields
|
### Step 3: Populate All Metadata Fields
|
||||||
|
|
||||||
Use the templates below. Values in `{braces}` are resolved property references — substitute them with the actual values from Step 1.
|
Use the templates below. Values in `{braces}` are resolved property references — substitute them with the actual values from Step 1.
|
||||||
|
|
||||||
#### Network
|
#### Network
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Network xmlns="http://soap.sforce.com/2006/04/metadata">
|
<Network xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
@ -114,7 +107,6 @@ Use the templates below. Values in `{braces}` are resolved property references
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### CustomSite
|
#### CustomSite
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
|
<CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
@ -147,7 +139,6 @@ Use the templates below. Values in `{braces}` are resolved property references
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### DigitalExperienceConfig
|
#### DigitalExperienceConfig
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<DigitalExperienceConfig xmlns="http://soap.sforce.com/2006/04/metadata">
|
<DigitalExperienceConfig xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
@ -160,7 +151,6 @@ Use the templates below. Values in `{braces}` are resolved property references
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### DigitalExperienceBundle
|
#### DigitalExperienceBundle
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<DigitalExperienceBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
<DigitalExperienceBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
@ -169,7 +159,6 @@ Use the templates below. Values in `{braces}` are resolved property references
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### DigitalExperience — `_meta.json`
|
#### DigitalExperience — `_meta.json`
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"apiName": "{siteName}1",
|
"apiName": "{siteName}1",
|
||||||
@ -179,7 +168,6 @@ Use the templates below. Values in `{braces}` are resolved property references
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### DigitalExperience — `content.json`
|
#### DigitalExperience — `content.json`
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "sfdc_cms__site",
|
"type": "sfdc_cms__site",
|
||||||
@ -196,11 +184,9 @@ Use the templates below. Values in `{braces}` are resolved property references
|
|||||||
The `appContainer: true` and `appSpace` fields are what make this a React site rather than a standard LWR site. The `appSpace` value follows the format `{namespace}__{developerName}` and must match a deployed `WebApplication` metadata record.
|
The `appContainer: true` and `appSpace` fields are what make this a React site rather than a standard LWR site. The `appSpace` value follows the format `{namespace}__{developerName}` and must match a deployed `WebApplication` metadata record.
|
||||||
|
|
||||||
### Step 4: Resolve Additional Configurations
|
### Step 4: Resolve Additional Configurations
|
||||||
|
|
||||||
Address any extra configurations the user requests. Use the schemas returned by `get_metadata_api_context` in Step 2 to understand each field's purpose, and update only the minimum necessary fields.
|
Address any extra configurations the user requests. Use the schemas returned by `get_metadata_api_context` in Step 2 to understand each field's purpose, and update only the minimum necessary fields.
|
||||||
|
|
||||||
## Verification Checklist
|
## Verification Checklist
|
||||||
|
|
||||||
Before deploying, confirm:
|
Before deploying, confirm:
|
||||||
|
|
||||||
- [ ] All five required properties are resolved
|
- [ ] All five required properties are resolved
|
||||||
@ -208,7 +194,6 @@ Before deploying, confirm:
|
|||||||
- [ ] All metadata fields are populated per the templates and user requests
|
- [ ] All metadata fields are populated per the templates and user requests
|
||||||
- [ ] `appSpace` in `content.json` matches an existing `WebApplication` metadata record
|
- [ ] `appSpace` in `content.json` matches an existing `WebApplication` metadata record
|
||||||
- [ ] Deployment validates successfully:
|
- [ ] Deployment validates successfully:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org ${usernameOrAlias}
|
sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org ${usernameOrAlias}
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user