forceios 13.2.0-alpha.1 → 13.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forceios",
3
- "version": "13.2.0-alpha.1",
3
+ "version": "13.2.0",
4
4
  "description": "Utilities for creating mobile apps based on the Salesforce Mobile SDK for iOS",
5
5
  "keywords": [ "mobilesdk", "ios", "salesforce", "mobile", "sdk" ],
6
6
  "homepage": "https://github.com/forcedotcom/SalesforceMobileSDK-iOS",
@@ -28,7 +28,7 @@
28
28
  var path = require('path'),
29
29
  shelljs = require('shelljs');
30
30
 
31
- var VERSION= '13.2.0-alpha.1';
31
+ var VERSION= '13.2.0';
32
32
 
33
33
  module.exports = {
34
34
  version: VERSION,
@@ -40,11 +40,11 @@ module.exports = {
40
40
  },
41
41
  node: {
42
42
  checkCmd: 'node --version',
43
- minVersion: '12.0'
43
+ minVersion: '20'
44
44
  },
45
45
  npm: {
46
46
  checkCmd: 'npm -v',
47
- minVersion: '3.10'
47
+ minVersion: '10'
48
48
  },
49
49
  yarn: {
50
50
  checkCmd: 'yarn -v',
@@ -60,9 +60,9 @@ module.exports = {
60
60
  },
61
61
  cordova: {
62
62
  checkCmd: 'cordova -v',
63
- pluginRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#dev', // dev
64
- minVersion: '12.0.0',
65
- // pluginRepoUri: 'salesforce-mobilesdk-cordova-plugin@v' + VERSION, // GA
63
+ // pluginRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#dev', // dev
64
+ minVersion: '13.0.0',
65
+ pluginRepoUri: 'salesforce-mobilesdk-cordova-plugin@v' + VERSION, // GA
66
66
  platformVersion: {
67
67
  ios: '7.1.1',
68
68
  android: '14.0.1'
@@ -79,8 +79,8 @@ module.exports = {
79
79
  android: 'Android Studio'
80
80
  },
81
81
 
82
- templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#dev', // dev
83
- // templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v' + VERSION, // GA
82
+ // templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#dev', // dev
83
+ templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v' + VERSION, // GA
84
84
 
85
85
  forceclis: {
86
86
  forceios: {
@@ -112,6 +112,11 @@ function createHybridApp(config) {
112
112
  // Run cordova prepare
113
113
  utils.runProcessThrowError('cordova prepare', config.projectDir);
114
114
 
115
+ // Remove CordovaLib subproject from iOS workspace to fix archiving issue
116
+ if (config.platform.split(',').includes('ios')) {
117
+ removeCordovaLibFromWorkspace(config.projectDir, config.appname);
118
+ }
119
+
115
120
  // Add theme for Android API 35
116
121
  if (config.platform.split(',').includes('android')) {
117
122
  createAndroidAPI35Theme(config.projectDir);
@@ -121,9 +126,103 @@ function createHybridApp(config) {
121
126
  return prepareResult;
122
127
  }
123
128
 
129
+ //
130
+ // Remove CordovaLib subproject from iOS project
131
+ // This fixes the "Generic Xcode Archive" issue when archiving
132
+ //
133
+ function removeCordovaLibFromWorkspace(projectDir, appname) {
134
+ const projectPath = path.join(projectDir, 'platforms', 'ios', appname + '.xcodeproj');
135
+ const pbxprojPath = path.join(projectPath, 'project.pbxproj');
136
+
137
+ if (!fs.existsSync(pbxprojPath)) {
138
+ utils.logDebug('Project file not found, skipping CordovaLib removal: ' + pbxprojPath);
139
+ return;
140
+ }
141
+
142
+ try {
143
+ // Read the project file
144
+ let content = fs.readFileSync(pbxprojPath, 'utf8');
145
+ const originalContent = content;
146
+
147
+ // Step 1: Find and store the CordovaLib file reference ID
148
+ const fileRefMatch = content.match(/([A-F0-9]+)\s*\/\*\s*CordovaLib\.xcodeproj\s*\*\/\s*=\s*\{isa\s*=\s*PBXFileReference[^}]*CordovaLib\/CordovaLib\.xcodeproj[^}]*\}/);
149
+ if (!fileRefMatch) {
150
+ utils.logDebug('CordovaLib file reference not found in project');
151
+ return;
152
+ }
153
+ const cordovaLibId = fileRefMatch[1];
154
+
155
+ // Step 2: Find all PBXContainerItemProxy IDs that reference CordovaLib (need to track for PBXReferenceProxy removal)
156
+ const containerProxyIds = [];
157
+ const proxyRegex = /([A-F0-9]+)\s*\/\*\s*PBXContainerItemProxy\s*\*\/\s*=\s*\{[^}]*containerPortal\s*=\s*[A-F0-9]+[^}]*remoteInfo\s*=\s*CordovaLib[^}]*\}/g;
158
+ let match;
159
+ while ((match = proxyRegex.exec(content)) !== null) {
160
+ containerProxyIds.push(match[1]);
161
+ }
162
+
163
+ // Step 3: Find all PBXTargetDependency IDs that reference CordovaLib (we need to track these)
164
+ const targetDepIds = [];
165
+ const targetDepRegex = /([A-F0-9]+)\s*\/\*\s*PBXTargetDependency\s*\*\/\s*=\s*\{[^}]*name\s*=\s*CordovaLib;[^}]*\}/g;
166
+ while ((match = targetDepRegex.exec(content)) !== null) {
167
+ targetDepIds.push(match[1]);
168
+ }
169
+
170
+ // Step 4: Find the Products group ID from projectReferences
171
+ const productsGroupMatch = content.match(/ProductGroup\s*=\s*([A-F0-9]+)\s*\/\*\s*Products\s*\*\/\s*;\s*ProjectRef\s*=\s*[A-F0-9]+\s*\/\*\s*CordovaLib\.xcodeproj/);
172
+ const productsGroupId = productsGroupMatch ? productsGroupMatch[1] : null;
173
+
174
+ // Step 5: Remove all PBXContainerItemProxy entries that reference CordovaLib
175
+ content = content.replace(new RegExp(`\\s*[A-F0-9]+\\s*\\/\\*\\s*PBXContainerItemProxy\\s*\\*\\/\\s*=\\s*\\{[^}]*containerPortal\\s*=\\s*${cordovaLibId}[^}]*\\};?`, 'g'), '');
176
+
177
+ // Step 6: Remove PBXReferenceProxy entries that reference the deleted PBXContainerItemProxy
178
+ containerProxyIds.forEach(id => {
179
+ content = content.replace(new RegExp(`\\s*[A-F0-9]+\\s*\\/\\*\\s*[^*]+\\*\\/\\s*=\\s*\\{[^}]*remoteRef\\s*=\\s*${id}[^}]*\\};?`, 'g'), '');
180
+ });
181
+
182
+ // Step 7: Remove the Products group if it exists and references deleted proxies
183
+ if (productsGroupId) {
184
+ content = content.replace(new RegExp(`\\s*${productsGroupId}\\s*\\/\\*\\s*Products\\s*\\*\\/\\s*=\\s*\\{[^}]*\\};?`, 'g'), '');
185
+ }
186
+
187
+ // Step 8: Remove PBXTargetDependency entries that reference CordovaLib
188
+ content = content.replace(/\s*[A-F0-9]+\s*\/\*\s*PBXTargetDependency\s*\*\/\s*=\s*\{[^}]*name\s*=\s*CordovaLib;[^}]*\};?/g, '');
189
+
190
+ // Step 9: Remove references to PBXTargetDependency IDs from dependencies arrays
191
+ targetDepIds.forEach(id => {
192
+ content = content.replace(new RegExp(`\\s*${id}\\s*\\/\\*\\s*PBXTargetDependency\\s*\\*\\/\\s*,?`, 'g'), '');
193
+ });
194
+
195
+ // Step 10: Remove the PBXFileReference entry for CordovaLib.xcodeproj
196
+ content = content.replace(new RegExp(`\\s*${cordovaLibId}\\s*\\/\\*\\s*CordovaLib\\.xcodeproj\\s*\\*\\/\\s*=\\s*\\{[^}]*\\};?`, 'g'), '');
197
+
198
+ // Step 11: Remove references to CordovaLib ID from arrays (children, projectReferences, etc.)
199
+ content = content.replace(new RegExp(`\\s*${cordovaLibId}\\s*\\/\\*\\s*CordovaLib\\.xcodeproj\\s*\\*\\/\\s*,?`, 'g'), '');
200
+
201
+ // Step 12: Remove entire projectReferences array entries that contain CordovaLib (including ones with empty ProjectRef)
202
+ content = content.replace(/\s*\{\s*ProductGroup\s*=\s*[A-F0-9]+\s*\/\*\s*Products\s*\*\/\s*;\s*ProjectRef\s*=\s*([A-F0-9]*)\s*(\/\*\s*CordovaLib\.xcodeproj\s*\*\/)?\s*;\s*\}\s*,?/g, '');
203
+
204
+ // Step 13: Remove the entire projectReferences property if it becomes empty
205
+ content = content.replace(/\s*projectReferences\s*=\s*\(\s*\);?/g, '');
206
+
207
+ // Step 14: Clean up any resulting empty lines or trailing commas
208
+ content = content.replace(/,(\s*\))/g, '$1'); // Remove trailing commas before closing parentheses
209
+ content = content.replace(/\n\s*\n\s*\n/g, '\n\n'); // Reduce multiple blank lines to double
210
+
211
+ // Only write back if something was changed
212
+ if (content !== originalContent) {
213
+ fs.writeFileSync(pbxprojPath, content, 'utf8');
214
+ utils.log('Removed CordovaLib subproject from Xcode project');
215
+ } else {
216
+ utils.logDebug('No CordovaLib references found to remove');
217
+ }
218
+ } catch (error) {
219
+ utils.logError('Failed to remove CordovaLib from project', error);
220
+ }
221
+ }
222
+
124
223
  //
125
224
  // Add Android API 35 theme file
126
- //
225
+ //
127
226
  function createAndroidAPI35Theme(projectDir) {
128
227
  const dirPath = path.join(projectDir, 'platforms', 'android', 'app', 'src', 'main', 'res', 'values-v35');
129
228
  const filePath = path.join(dirPath, 'themes.xml');