@salesforce/ui-bundle-template-app-react-template-b2e 11.1.0 → 11.1.1

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/dist/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
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
+ ## [11.1.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.1.0...v11.1.1) (2026-06-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **template:** consolidate per-app data prep into feature package @W-22910624@ ([#677](https://github.com/salesforce-experience-platform-emu/webapps/issues/677)) ([6a98367](https://github.com/salesforce-experience-platform-emu/webapps/commit/6a98367b5c3542bb4fd5090ba3fbcf7b12b71616))
12
+
13
+
14
+
6
15
  ## [11.1.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.0.0...v11.1.0) (2026-06-26)
7
16
 
8
17
  **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
@@ -18,8 +18,8 @@
18
18
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@salesforce/platform-sdk": "^11.1.0",
22
- "@salesforce/ui-bundle": "^11.1.0",
21
+ "@salesforce/platform-sdk": "^11.1.1",
22
+ "@salesforce/ui-bundle": "^11.1.1",
23
23
  "@tailwindcss/vite": "^4.1.17",
24
24
  "class-variance-authority": "^0.7.1",
25
25
  "clsx": "^2.1.1",
@@ -45,8 +45,8 @@
45
45
  "@graphql-eslint/eslint-plugin": "^4.1.0",
46
46
  "@graphql-tools/utils": "^11.0.0",
47
47
  "@playwright/test": "^1.49.0",
48
- "@salesforce/graphiti": "^11.1.0",
49
- "@salesforce/vite-plugin-ui-bundle": "^11.1.0",
48
+ "@salesforce/graphiti": "^11.1.1",
49
+ "@salesforce/vite-plugin-ui-bundle": "^11.1.1",
50
50
  "@testing-library/jest-dom": "^6.6.3",
51
51
  "@testing-library/react": "^16.1.0",
52
52
  "@testing-library/user-event": "^14.5.2",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "11.1.0",
3
+ "version": "11.1.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
9
- "version": "11.1.0",
9
+ "version": "11.1.1",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "devDependencies": {
12
12
  "@lwc/eslint-plugin-lwc": "^3.3.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "11.1.0",
3
+ "version": "11.1.1",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
@@ -1217,20 +1217,15 @@ async function main() {
1217
1217
  const dataStep = stepDefs.find((s) => s.key === 'data');
1218
1218
  if (doData) {
1219
1219
  await runStep(dataStep, targetOrg, () => {
1220
- // Prepare data for uniqueness (run before import so repeat imports don't conflict)
1221
- const prepareScript = resolve(__dirname, 'prepare-import-unique-fields.js');
1222
- run('Prepare data (unique fields)', 'node', [prepareScript, '--data-dir', DATA_DIR], {
1223
- cwd: ROOT,
1224
- });
1225
- // Normalize Lease__c Tenant refs to 1–15 so all refs resolve (Tenant__c.json has 15 records)
1226
- const leasePath = resolve(DATA_DIR, 'Lease__c.json');
1227
- if (existsSync(leasePath)) {
1228
- let leaseContent = readFileSync(leasePath, 'utf8');
1229
- leaseContent = leaseContent.replace(/@TenantRef(\d+)/g, (_m, n) => {
1230
- const k = ((parseInt(n, 10) - 1) % 15) + 1;
1231
- return `@TenantRef${k}`;
1220
+ // Prepare data for uniqueness (run before import so repeat imports don't conflict).
1221
+ // Per-app data normalization (reference remapping, unique-field mangling) ships with
1222
+ // the app's seed data as data/prepare-import-unique-fields.js this script stays
1223
+ // object-agnostic and simply runs it if present.
1224
+ const prepareScript = resolve(DATA_DIR, 'prepare-import-unique-fields.js');
1225
+ if (existsSync(prepareScript)) {
1226
+ run('Prepare data (unique fields)', 'node', [prepareScript, '--data-dir', DATA_DIR], {
1227
+ cwd: ROOT,
1232
1228
  });
1233
- writeFileSync(leasePath, leaseContent);
1234
1229
  }
1235
1230
 
1236
1231
  // Delete existing records so every run inserts the full dataset without duplicate conflicts.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-app-react-template-b2e",
3
- "version": "11.1.0",
3
+ "version": "11.1.1",
4
4
  "description": "Salesforce React internal app template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -1,122 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Updates unique fields in data JSON files so "sf data import tree" can be run
4
- * repeatedly (e.g. after org already has data). Run before data import.
5
- *
6
- * Usage:
7
- * node scripts/prepare-import-unique-fields.js
8
- * node scripts/prepare-import-unique-fields.js --data-dir /path/to/<sfdx-source>/data
9
- *
10
- * Expects data dir to contain (optional) JSON files:
11
- * Contact.json (Email with unique domain per run, LastName, FirstName, Phone — standard Contact)
12
- * Agent__c.json (License_Number__c — unique per record)
13
- * Property_Management_Company__c.json (Company_Code__c, max 10 chars)
14
- * Property_Owner__c.json (Email__c)
15
- * Missing files are skipped. Customize this script for your app's objects/fields.
16
- */
17
-
18
- const fs = require('fs');
19
- const path = require('path');
20
-
21
- function resolveSfdxSource() {
22
- const sfdxPath = path.resolve(__dirname, '..', 'sfdx-project.json');
23
- if (!fs.existsSync(sfdxPath)) {
24
- console.error('Error: sfdx-project.json not found at project root.');
25
- process.exit(1);
26
- }
27
- const sfdxProject = JSON.parse(fs.readFileSync(sfdxPath, 'utf8'));
28
- const pkgDir = sfdxProject?.packageDirectories?.[0]?.path;
29
- if (!pkgDir) {
30
- console.error('Error: No packageDirectories[].path found in sfdx-project.json.');
31
- process.exit(1);
32
- }
33
- return path.resolve(__dirname, '..', pkgDir, 'main', 'default');
34
- }
35
-
36
- const DEFAULT_DATA_DIR = path.resolve(resolveSfdxSource(), 'data');
37
-
38
- function parseArgs() {
39
- const args = process.argv.slice(2);
40
- let dataDir = DEFAULT_DATA_DIR;
41
- for (let i = 0; i < args.length; i++) {
42
- if (args[i] === '--data-dir' && args[i + 1]) {
43
- dataDir = path.resolve(args[++i]);
44
- break;
45
- }
46
- }
47
- return dataDir;
48
- }
49
-
50
- const dataDir = parseArgs();
51
- const runId = Date.now();
52
- const runSuffix2 = String(runId % 100).padStart(2, '0'); // 00-99 for Company_Code__c (10-char limit)
53
-
54
- // Contact: Email (unique domain + local), LastName, FirstName, Phone — avoid duplicate rules
55
- const contactPath = path.join(dataDir, 'Contact.json');
56
- if (fs.existsSync(contactPath)) {
57
- let contact = JSON.parse(fs.readFileSync(contactPath, 'utf8'));
58
- if (contact.records) {
59
- contact.records.forEach((r, i) => {
60
- if (r.Email && r.Email.includes('@')) {
61
- const parts = r.Email.replace(/\+[0-9]+@/, '@').split('@');
62
- const local = (parts[0] || 'user') + '+' + runId;
63
- const domain = 'run' + runId + '.example.com';
64
- r.Email = local + '@' + domain;
65
- }
66
- if (r.LastName)
67
- r.LastName = String(r.LastName).replace(/-[0-9]+$/, '') + '-' + runId;
68
- if (r.FirstName)
69
- r.FirstName = String(r.FirstName).replace(/-[0-9]+$/, '') + '-' + (i + 1);
70
- if (r.Phone)
71
- r.Phone = String(r.Phone).replace(/\d{2}$/, runSuffix2);
72
- });
73
- fs.writeFileSync(contactPath, JSON.stringify(contact, null, 2));
74
- console.log('Updated Contact.json (Email, LastName, FirstName, Phone)');
75
- }
76
- }
77
-
78
- // Agent__c: License_Number__c — unique per record (field is often unique in org)
79
- const agentPath = path.join(dataDir, 'Agent__c.json');
80
- if (fs.existsSync(agentPath)) {
81
- let agent = JSON.parse(fs.readFileSync(agentPath, 'utf8'));
82
- if (agent.records) {
83
- agent.records.forEach((r, i) => {
84
- if (r.License_Number__c) {
85
- const base = r.License_Number__c.replace(/-[0-9]+(-[0-9]+)?$/, '');
86
- r.License_Number__c = base + '-' + runId + '-' + (i + 1);
87
- }
88
- });
89
- fs.writeFileSync(agentPath, JSON.stringify(agent, null, 2));
90
- console.log('Updated Agent__c.json (License_Number__c)');
91
- }
92
- }
93
-
94
- // Property_Management_Company__c: Company_Code__c — max 10 chars, use 8-char base + 2-digit suffix
95
- const companyPath = path.join(dataDir, 'Property_Management_Company__c.json');
96
- if (fs.existsSync(companyPath)) {
97
- let company = JSON.parse(fs.readFileSync(companyPath, 'utf8'));
98
- if (company.records) {
99
- company.records.forEach((r) => {
100
- if (r.Company_Code__c)
101
- r.Company_Code__c = r.Company_Code__c.slice(0, 8) + runSuffix2;
102
- });
103
- fs.writeFileSync(companyPath, JSON.stringify(company, null, 2));
104
- console.log('Updated Property_Management_Company__c.json (Company_Code__c)');
105
- }
106
- }
107
-
108
- // Property_Owner__c: Email__c — add +runId before @
109
- const ownerPath = path.join(dataDir, 'Property_Owner__c.json');
110
- if (fs.existsSync(ownerPath)) {
111
- let owner = JSON.parse(fs.readFileSync(ownerPath, 'utf8'));
112
- if (owner.records) {
113
- owner.records.forEach((r) => {
114
- if (r.Email__c && r.Email__c.includes('@'))
115
- r.Email__c = r.Email__c.replace(/\+[0-9]+@/, '@').replace('@', '+' + runId + '@');
116
- });
117
- fs.writeFileSync(ownerPath, JSON.stringify(owner, null, 2));
118
- console.log('Updated Property_Owner__c.json (Email__c)');
119
- }
120
- }
121
-
122
- console.log('Unique fields updated: runId=%s companySuffix=%s', runId, runSuffix2);