@salesforce/templates 66.7.7 → 66.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/templates/project/reactexternalapp/CHANGELOG.md +75 -0
- package/lib/templates/project/reactexternalapp/README.md +15 -8
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package-lock.json +17203 -0
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package.json +9 -3
- package/lib/templates/project/reactexternalapp/package.json +1 -1
- package/lib/templates/project/reactexternalapp/scripts/org-setup.config.json +6 -0
- package/lib/templates/project/reactexternalapp/scripts/org-setup.mjs +90 -12
- package/lib/templates/project/reactinternalapp/CHANGELOG.md +75 -0
- package/lib/templates/project/reactinternalapp/README.md +5 -3
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package-lock.json +17126 -0
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package.json +9 -3
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/AgentforceConversationClient.tsx +2 -1
- package/lib/templates/project/reactinternalapp/package.json +1 -1
- package/lib/templates/project/reactinternalapp/scripts/org-setup.config.json +6 -0
- package/lib/templates/project/reactinternalapp/scripts/org-setup.mjs +90 -12
- package/lib/templates/uiBundles/reactbasic/package-lock.json +17107 -0
- package/lib/templates/uiBundles/reactbasic/package.json +9 -3
- package/package.json +8 -8
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.59.0",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"dev": "vite",
|
|
8
11
|
"dev:design": "vite --mode design",
|
|
@@ -15,8 +18,8 @@
|
|
|
15
18
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
16
19
|
},
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@salesforce/sdk-data": "^1.
|
|
19
|
-
"@salesforce/ui-bundle": "^1.
|
|
21
|
+
"@salesforce/sdk-data": "^1.120.6",
|
|
22
|
+
"@salesforce/ui-bundle": "^1.120.6",
|
|
20
23
|
"@tailwindcss/vite": "^4.1.17",
|
|
21
24
|
"class-variance-authority": "^0.7.1",
|
|
22
25
|
"clsx": "^2.1.1",
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
44
47
|
"@graphql-tools/utils": "^11.0.0",
|
|
45
48
|
"@playwright/test": "^1.49.0",
|
|
46
|
-
"@salesforce/vite-plugin-ui-bundle": "^1.
|
|
49
|
+
"@salesforce/vite-plugin-ui-bundle": "^1.120.6",
|
|
47
50
|
"@testing-library/jest-dom": "^6.6.3",
|
|
48
51
|
"@testing-library/react": "^16.1.0",
|
|
49
52
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -66,5 +69,8 @@
|
|
|
66
69
|
"vite": "^7.2.4",
|
|
67
70
|
"vite-plugin-graphql-codegen": "^3.6.3",
|
|
68
71
|
"vitest": "^4.0.17"
|
|
72
|
+
},
|
|
73
|
+
"overrides": {
|
|
74
|
+
"lodash": "^4.18.1"
|
|
69
75
|
}
|
|
70
76
|
}
|
|
@@ -14,10 +14,22 @@
|
|
|
14
14
|
* 1. login — sf org login web only if org not already connected (skip with --skip-login)
|
|
15
15
|
* 2. uiBundle — (all UI bundles) npm install && npm run build so dist exists for deploy (skip with --skip-ui-bundle-build)
|
|
16
16
|
* 3. deploy — sf project deploy start --target-org <alias> (requires dist for entity deployment)
|
|
17
|
-
* 4. permset —
|
|
17
|
+
* 4. permset — assign permsets per org-setup.config.json (skip with --skip-permset; override via --permset-name)
|
|
18
18
|
* 5. data — prepare unique fields + sf data import tree (skipped if no data dir/plan)
|
|
19
19
|
* 6. graphql — (in UI bundle) npm run graphql:schema then npm run graphql:codegen
|
|
20
20
|
* 7. dev — (in UI bundle) npm run dev — launch dev server (skip with --skip-dev)
|
|
21
|
+
*
|
|
22
|
+
* Permset assignment config (scripts/org-setup.config.json):
|
|
23
|
+
* {
|
|
24
|
+
* "permsetAssignments": {
|
|
25
|
+
* "defaultAssignee": "currentUser",
|
|
26
|
+
* "assignments": {
|
|
27
|
+
* "Guest_Permset": { "assignee": "guest@mysite.example.com" },
|
|
28
|
+
* "Internal_Only": { "assignee": "skip" }
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* Assignee values: "currentUser" (default), "skip", or a specific username.
|
|
21
33
|
*/
|
|
22
34
|
|
|
23
35
|
import { spawnSync } from 'node:child_process';
|
|
@@ -127,6 +139,20 @@ Options:
|
|
|
127
139
|
--skip-dev Do not launch the dev server at the end
|
|
128
140
|
-y, --yes Skip interactive step picker; run all enabled steps immediately
|
|
129
141
|
-h, --help Show this help
|
|
142
|
+
|
|
143
|
+
Permset config (scripts/org-setup.config.json):
|
|
144
|
+
Control per-permset assignment via a config file. Example:
|
|
145
|
+
{
|
|
146
|
+
"permsetAssignments": {
|
|
147
|
+
"defaultAssignee": "currentUser",
|
|
148
|
+
"assignments": {
|
|
149
|
+
"Guest_Permset": { "assignee": "guest@mysite.example.com" },
|
|
150
|
+
"Internal_Only": { "assignee": "skip" }
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
Assignee values: "currentUser" (default), "skip", or a specific username.
|
|
155
|
+
Without this file, all discovered permsets are assigned to the current user.
|
|
130
156
|
`);
|
|
131
157
|
process.exit(0);
|
|
132
158
|
}
|
|
@@ -181,6 +207,51 @@ function discoverPermissionSetNames() {
|
|
|
181
207
|
return names.sort();
|
|
182
208
|
}
|
|
183
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Load permset assignment configuration from org-setup.config.json.
|
|
212
|
+
*
|
|
213
|
+
* Config shape:
|
|
214
|
+
* {
|
|
215
|
+
* "permsetAssignments": {
|
|
216
|
+
* "defaultAssignee": "currentUser", // "currentUser" (default) or "skip"
|
|
217
|
+
* "assignments": {
|
|
218
|
+
* "My_Guest_Permset": { "assignee": "guest@mysite.example.com" },
|
|
219
|
+
* "Internal_Only": { "assignee": "skip" }
|
|
220
|
+
* }
|
|
221
|
+
* }
|
|
222
|
+
* }
|
|
223
|
+
*
|
|
224
|
+
* Assignee values:
|
|
225
|
+
* "currentUser" — assign to the user running the script (default)
|
|
226
|
+
* "skip" — do not assign this permset
|
|
227
|
+
* "<username>" — assign to a specific user via --on-behalf-of
|
|
228
|
+
*
|
|
229
|
+
* Returns { defaultAssignee: string, assignments: Record<string, { assignee: string }> }
|
|
230
|
+
*/
|
|
231
|
+
function loadPermsetConfig() {
|
|
232
|
+
const configPath = resolve(__dirname, 'org-setup.config.json');
|
|
233
|
+
const defaults = { defaultAssignee: 'currentUser', assignments: {} };
|
|
234
|
+
if (!existsSync(configPath)) return defaults;
|
|
235
|
+
try {
|
|
236
|
+
const raw = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
237
|
+
const section = raw?.permsetAssignments;
|
|
238
|
+
if (!section) return defaults;
|
|
239
|
+
return {
|
|
240
|
+
defaultAssignee: section.defaultAssignee || 'currentUser',
|
|
241
|
+
assignments: section.assignments || {},
|
|
242
|
+
};
|
|
243
|
+
} catch (err) {
|
|
244
|
+
console.warn(`Warning: failed to parse org-setup.config.json: ${err.message}; using defaults.`);
|
|
245
|
+
return defaults;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Resolve the effective assignee for a given permset name. */
|
|
250
|
+
function resolveAssignee(permsetName, permsetConfig) {
|
|
251
|
+
const override = permsetConfig.assignments[permsetName];
|
|
252
|
+
return override?.assignee || permsetConfig.defaultAssignee;
|
|
253
|
+
}
|
|
254
|
+
|
|
184
255
|
function isOrgConnected(targetOrg) {
|
|
185
256
|
const result = spawnSync('sf', ['org', 'display', '--target-org', targetOrg, '--json'], {
|
|
186
257
|
cwd: ROOT,
|
|
@@ -422,28 +493,35 @@ async function main() {
|
|
|
422
493
|
}
|
|
423
494
|
|
|
424
495
|
if (!skipPermset) {
|
|
496
|
+
const permsetConfig = loadPermsetConfig();
|
|
425
497
|
if (permsetNames.length === 0) {
|
|
426
498
|
console.log('\n--- Assign permission sets ---');
|
|
427
499
|
console.log('No permission sets found under permissionsets/ and none passed via --permset-name; skipping.');
|
|
428
500
|
} else {
|
|
429
501
|
console.log('\n--- Assign permission sets ---');
|
|
430
502
|
for (const permsetName of permsetNames) {
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
503
|
+
const assignee = resolveAssignee(permsetName, permsetConfig);
|
|
504
|
+
if (assignee === 'skip') {
|
|
505
|
+
console.log(`Permission set "${permsetName}" — skipped (config).`);
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
const sfArgs = ['org', 'assign', 'permset', '--name', permsetName, '--target-org', targetOrg];
|
|
509
|
+
if (assignee !== 'currentUser') {
|
|
510
|
+
sfArgs.push('--on-behalf-of', assignee);
|
|
511
|
+
}
|
|
512
|
+
const assigneeLabel = assignee === 'currentUser' ? 'current user' : assignee;
|
|
513
|
+
const permsetResult = spawnSync('sf', sfArgs, {
|
|
514
|
+
cwd: ROOT,
|
|
515
|
+
stdio: 'pipe',
|
|
516
|
+
shell: true,
|
|
517
|
+
});
|
|
440
518
|
if (permsetResult.status === 0) {
|
|
441
|
-
console.log(`Permission set "${permsetName}" assigned.`);
|
|
519
|
+
console.log(`Permission set "${permsetName}" assigned to ${assigneeLabel}.`);
|
|
442
520
|
} else {
|
|
443
521
|
const out =
|
|
444
522
|
(permsetResult.stderr?.toString() || '') + (permsetResult.stdout?.toString() || '');
|
|
445
523
|
if (out.includes('Duplicate') && out.includes('PermissionSet')) {
|
|
446
|
-
console.log(`Permission set "${permsetName}" already assigned; skipping.`);
|
|
524
|
+
console.log(`Permission set "${permsetName}" already assigned to ${assigneeLabel}; skipping.`);
|
|
447
525
|
} else if (out.includes('not found') && out.includes('target org')) {
|
|
448
526
|
console.log(`Permission set "${permsetName}" not in org; skipping.`);
|
|
449
527
|
} else {
|
|
@@ -3,6 +3,81 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.120.6](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.120.5...v1.120.6) (2026-04-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.120.5](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.120.4...v1.120.5) (2026-04-07)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.120.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.120.3...v1.120.4) (2026-04-07)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* make tenant owner of own record ([#414](https://github.com/salesforce-experience-platform-emu/webapps/issues/414)) ([bf1f289](https://github.com/salesforce-experience-platform-emu/webapps/commit/bf1f289a8d56a381adde51e642e67db38099f193))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [1.120.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.120.2...v1.120.3) (2026-04-02)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [1.120.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.120.1...v1.120.2) (2026-04-01)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [1.120.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.120.0...v1.120.1) (2026-04-01)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# [1.120.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.6...v1.120.0) (2026-04-01)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [1.119.6](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.5...v1.119.6) (2026-04-01)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## [1.119.5](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.4...v1.119.5) (2026-03-31)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
6
81
|
## [1.119.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.119.3...v1.119.4) (2026-03-31)
|
|
7
82
|
|
|
8
83
|
|
|
@@ -6,9 +6,11 @@ An internal React starter template for the Salesforce platform. Includes an Agen
|
|
|
6
6
|
|
|
7
7
|
This project ships the UI Bundle only. No additional Salesforce metadata (objects, classes, etc.) is included — bring your own data model.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
```
|
|
10
|
+
force-app/main/default/
|
|
11
|
+
└── uibundles/
|
|
12
|
+
└── reactinternalapp/ # React UI Bundle (source, config, tests)
|
|
13
|
+
```
|
|
12
14
|
|
|
13
15
|
## Getting started
|
|
14
16
|
|