Skip to content

Commit 6eb10de

Browse files
chore: update project for developer edition and production org support (#33)
* chore: update project for developer edition and production org support * ci: update ci workflows to single deploy * ci: pin SF CLI to 2.142.6 to fix Node 22.23+ hang * ci: reorder scratch org steps to build before deploy * style: format new metadata files
1 parent 516e554 commit 6eb10de

11 files changed

Lines changed: 84 additions & 210 deletions

File tree

.github/workflows/ci-pr.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
# Install Salesforce CLI
127127
- name: "Install Salesforce CLI"
128128
run: |
129-
npm install @salesforce/cli --location=global
129+
npm install @salesforce/cli@2.142.6 --location=global
130130
nodeInstallPath=$(npm config get prefix)
131131
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
132132
cd "$nodeInstallPath/bin"
@@ -170,7 +170,7 @@ jobs:
170170
# Install Salesforce CLI
171171
- name: "Install Salesforce CLI"
172172
run: |
173-
npm install @salesforce/cli --location=global
173+
npm install @salesforce/cli@2.142.6 --location=global
174174
nodeInstallPath=$(npm config get prefix)
175175
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
176176
sf --version
@@ -200,37 +200,33 @@ jobs:
200200
if: ${{ !env.IS_PRERELEASE }}
201201
run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1
202202

203-
# Deploy shared metadata to scratch org
203+
# Install React app dependencies
204+
- name: "Install React app dependencies"
205+
run: npm ci --prefix force-app/main/react-recipes/uiBundles/reactRecipes
206+
207+
# Build React app
208+
- name: "Build React app"
209+
run: npm run build
210+
working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
211+
212+
# Deploy to scratch org
204213
- name: "Deploy source to scratch org"
205-
run: sf project deploy start -d force-app/main/default/objects -d force-app/main/default/classes -d force-app/main/default/permissionsets -d force-app/main/default/cspTrustedSites
214+
run: sf project deploy start
206215

207216
# Assign permissionset
208217
- name: "Assign permissionset to default user"
209218
run: sf org assign permset -n recipes
210219

211-
# Import sample data
212-
- name: "Import sample data"
213-
run: sf data tree import -p ./data/data-plan.json
214-
215-
# Install React app dependencies
216-
- name: "Install React app dependencies"
217-
run: npm ci --prefix force-app/main/react-recipes/uiBundles/reactRecipes
218-
219220
# Fetch GraphQL schema and run codegen
220221
- name: "GraphQL schema and codegen"
221222
run: |
222223
npm run graphql:schema
223224
npm run graphql:codegen
224225
working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
225226

226-
# Build React app
227-
- name: "Build React app"
228-
run: npm run build
229-
working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
230-
231-
# Deploy UI bundle to scratch org
232-
- name: "Deploy UI bundle"
233-
run: sf project deploy start --source-dir force-app/main/react-recipes/uiBundles/reactRecipes
227+
# Import sample data
228+
- name: "Import sample data"
229+
run: sf data tree import -p ./data/data-plan.json
234230

235231
# Run Apex tests in scratch org
236232
- name: "Run Apex tests"

.github/workflows/ci.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
# Install Salesforce CLI
110110
- name: "Install Salesforce CLI"
111111
run: |
112-
npm install @salesforce/cli --location=global
112+
npm install @salesforce/cli@2.142.6 --location=global
113113
nodeInstallPath=$(npm config get prefix)
114114
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
115115
cd "$nodeInstallPath/bin"
@@ -152,7 +152,7 @@ jobs:
152152
# Install Salesforce CLI
153153
- name: "Install Salesforce CLI"
154154
run: |
155-
npm install @salesforce/cli --location=global
155+
npm install @salesforce/cli@2.142.6 --location=global
156156
nodeInstallPath=$(npm config get prefix)
157157
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
158158
sf --version
@@ -176,37 +176,33 @@ jobs:
176176
- name: "Create scratch org"
177177
run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1
178178

179-
# Deploy shared metadata to scratch org
179+
# Install React app dependencies
180+
- name: "Install React app dependencies"
181+
run: npm ci --prefix force-app/main/react-recipes/uiBundles/reactRecipes
182+
183+
# Build React app
184+
- name: "Build React app"
185+
run: npm run build
186+
working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
187+
188+
# Deploy to scratch org
180189
- name: "Deploy source to scratch org"
181-
run: sf project deploy start -d force-app/main/default/objects -d force-app/main/default/classes -d force-app/main/default/permissionsets -d force-app/main/default/cspTrustedSites
190+
run: sf project deploy start
182191

183192
# Assign permissionset
184193
- name: "Assign permissionset to default user"
185194
run: sf org assign permset -n recipes
186195

187-
# Import sample data
188-
- name: "Import sample data"
189-
run: sf data tree import -p ./data/data-plan.json
190-
191-
# Install React app dependencies
192-
- name: "Install React app dependencies"
193-
run: npm ci --prefix force-app/main/react-recipes/uiBundles/reactRecipes
194-
195196
# Fetch GraphQL schema and run codegen
196197
- name: "GraphQL schema and codegen"
197198
run: |
198199
npm run graphql:schema
199200
npm run graphql:codegen
200201
working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
201202

202-
# Build React app
203-
- name: "Build React app"
204-
run: npm run build
205-
working-directory: force-app/main/react-recipes/uiBundles/reactRecipes
206-
207-
# Deploy UI bundle to scratch org
208-
- name: "Deploy UI bundle"
209-
run: sf project deploy start --source-dir force-app/main/react-recipes/uiBundles/reactRecipes
203+
# Import sample data
204+
- name: "Import sample data"
205+
run: sf data tree import -p ./data/data-plan.json
210206

211207
# Run Apex tests in scratch org
212208
- name: "Run Apex tests"

AGENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The full project plan lives in **PLAN.md**. This file covers what you need to kn
1414

1515
```
1616
multiframework-recipes/ # Repository root (Salesforce DX project)
17-
sfdx-project.json # Salesforce DX config (API v66.0)
17+
sfdx-project.json # Salesforce DX config (API v67.0)
1818
package.json # Root -- SFDX scripts only, NOT the React app
1919
data/ # Sample data for sf data import tree (planned)
2020
force-app/main/default/ # Shared metadata (objects, classes, etc.)
@@ -323,7 +323,7 @@ Global styles: `src/styles/global.css` (Tailwind + CSS variables), `src/styles/s
323323

324324
- **`ui-bundle.json`**: Output dir `dist/`, SPA fallback routing, trailing slash `never`
325325
- **`reactRecipes.uibundle-meta.xml`**: Metadata definition (v1, isActive)
326-
- **`sfdx-project.json`**: Package dir `force-app`, API version 66.0
326+
- **`sfdx-project.json`**: Package dir `force-app`, API version 67.0
327327
- Only one UI bundle can be deployed per metadata push
328328

329329
---

README.md

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ A collection of easy-to-digest code examples for building apps on the Salesforce
99

1010
This sample application is designed to run on the Salesforce Platform. It covers what a frontend developer needs to know about Salesforce, and what a Salesforce developer needs to know about modern frameworks — taught at the intersection.
1111

12-
> Multi-Framework currently supports **React**, with additional frameworks coming over time. The feature is in Beta and only available in Scratch Orgs and Sandboxes — not yet in Developer Edition orgs or Trailhead Playgrounds.
13-
>
14-
> There is a known limitation where orgs that do not use English (`en_US`) as the default language may experience issues. The scratch org definition in this project explicitly sets `"language": "en_US"` to work around this. If you are using a sandbox or other org type, ensure the default language is set to English.
12+
> Multi-Framework currently supports **React**, with additional frameworks coming over time.
1513
1614
**Learn more:** Read the [Salesforce Multi-Framework developer guide](https://developer.salesforce.com/docs/platform/einstein-for-devs/guide/reactdev-overview.html) for a comprehensive overview.
1715

@@ -28,9 +26,7 @@ graph LR
2826
## Table of Contents
2927

3028
- [Setting up a Scratch Org](#setting-up-a-scratch-org)
31-
- [Setting up a Sandbox](#setting-up-a-sandbox)
32-
- [Developer Edition](#developer-edition)
33-
- [Install & Deploy React Recipes](#install--deploy-react-recipes)
29+
- [Setting up a Developer Edition Org](#setting-up-a-developer-edition-org)
3430
- [Local Development](#local-development)
3531
- [Testing](#testing)
3632
- [Optional installation instructions](#optional-installation-instructions)
@@ -66,10 +62,21 @@ graph LR
6662
sf org create scratch -d -f config/project-scratch-def.json -a recipes
6763
```
6864

69-
1. Deploy shared metadata:
65+
1. Install dependencies, fetch the GraphQL schema, and build React Recipes:
7066

7167
```bash
72-
sf project deploy start -d force-app/main/default/objects -d force-app/main/default/classes -d force-app/main/default/permissionsets -d force-app/main/default/cspTrustedSites
68+
cd force-app/main/react-recipes/uiBundles/reactRecipes
69+
npm install
70+
npm run graphql:schema
71+
npm run graphql:codegen
72+
npm run build
73+
cd ../../../../..
74+
```
75+
76+
1. Deploy metadata and the UI bundle:
77+
78+
```bash
79+
sf project deploy start
7380
```
7481

7582
1. Assign the **recipes** permission set to the default user:
@@ -84,7 +91,13 @@ graph LR
8491
sf data tree import -p ./data/data-plan.json
8592
```
8693

87-
## Setting up a Sandbox
94+
1. Open the org and select the **React Recipes** app in App Launcher:
95+
96+
```bash
97+
sf org open
98+
```
99+
100+
## Setting up a Developer Edition Org
88101

89102
1. Set up your environment. Follow the steps in the [Quick Start: Lightning Web Components](https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/) Trailhead project. The steps include:
90103
- Install Salesforce CLI
@@ -95,10 +108,10 @@ graph LR
95108

96109
1. Make sure you have **Salesforce CLI v2.130.7+** installed. This version includes the UI Bundle plugin. Check your version with `sf --version` and update with `sf update` if needed.
97110

98-
1. Authorize your sandbox org and provide it with an alias (**mysandbox** in the command below):
111+
1. Authorize your Developer Edition org and provide it with an alias (**mydevorg** in the command below):
99112

100113
```bash
101-
sf org login web -a mysandbox
114+
sf org login web -a mydevorg
102115
```
103116

104117
1. Clone this repository:
@@ -108,53 +121,36 @@ graph LR
108121
cd multiframework-recipes
109122
```
110123

111-
1. Deploy shared metadata:
112-
113-
```bash
114-
sf project deploy start -d force-app/main/default/objects -d force-app/main/default/classes -d force-app/main/default/permissionsets -d force-app/main/default/cspTrustedSites
115-
```
116-
117-
1. Assign the **recipes** permission set to the default user:
118-
119-
```bash
120-
sf org assign permset -n recipes
121-
```
122-
123-
1. Import sample data:
124-
125-
```bash
126-
sf data tree import -p ./data/data-plan.json
127-
```
128-
129-
## Developer Edition
130-
131-
Developer Edition support is coming soon.
132-
133-
## Install & Deploy React Recipes
134-
135-
1. Install dependencies, fetch the GraphQL schema, and run codegen:
124+
1. Install dependencies, fetch the GraphQL schema, and build React Recipes:
136125

137126
```bash
138127
cd force-app/main/react-recipes/uiBundles/reactRecipes
139128
npm install
140129
npm run graphql:schema
141130
npm run graphql:codegen
131+
npm run build
132+
cd ../../../../..
142133
```
143134

144-
1. Build the app:
135+
1. Deploy metadata and the UI bundle:
145136

146137
```bash
147-
npm run build
138+
sf project deploy start
148139
```
149140

150-
1. Deploy the UI bundle to your org:
141+
1. Assign the **recipes** permission set to the default user:
151142

152143
```bash
153-
cd ../../../../..
154-
sf project deploy start --source-dir force-app/main/react-recipes/uiBundles/reactRecipes
144+
sf org assign permset -n recipes
145+
```
146+
147+
1. Import sample data:
148+
149+
```bash
150+
sf data tree import -p ./data/data-plan.json
155151
```
156152

157-
1. Open the scratch org and select the **React Recipes** app in App Launcher:
153+
1. Open the org and select the **React Recipes** app in App Launcher:
158154

159155
```bash
160156
sf org open

force-app/main/default/applications/reactRecipes.app-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
33
<brand>
44
<headerColor>#0070D2</headerColor>

force-app/main/default/classes/ContactResource.cls

Lines changed: 0 additions & 56 deletions
This file was deleted.

force-app/main/default/classes/ContactResource.cls-meta.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)