nativescript 9.0.4-dev.1 → 9.0.4-dev.3

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.
Files changed (329) hide show
  1. package/lib/android-tools-info.js +12 -0
  2. package/lib/base-package-manager.js +7 -0
  3. package/lib/bootstrap.js +5 -1
  4. package/lib/bun-package-manager.js +14 -1
  5. package/lib/color.js +4 -0
  6. package/lib/commands/add-platform.js +1 -0
  7. package/lib/commands/apple-login.js +1 -0
  8. package/lib/commands/appstore-list.js +1 -0
  9. package/lib/commands/appstore-upload.js +3 -0
  10. package/lib/commands/build.js +3 -2
  11. package/lib/commands/clean.js +22 -1
  12. package/lib/commands/command-base.js +1 -0
  13. package/lib/commands/config.js +5 -0
  14. package/lib/commands/create-project.js +6 -0
  15. package/lib/commands/debug.js +6 -1
  16. package/lib/commands/deploy.js +3 -2
  17. package/lib/commands/embedding/embed.js +7 -0
  18. package/lib/commands/extensibility/install-extension.js +1 -0
  19. package/lib/commands/extensibility/list-extensions.js +1 -0
  20. package/lib/commands/extensibility/uninstall-extension.js +1 -0
  21. package/lib/commands/fonts.js +1 -0
  22. package/lib/commands/generate-assets.js +1 -0
  23. package/lib/commands/generate-help.js +1 -0
  24. package/lib/commands/generate.js +48 -1
  25. package/lib/commands/hooks/common.js +2 -1
  26. package/lib/commands/hooks/hooks-lock.js +1 -0
  27. package/lib/commands/hooks/hooks.js +1 -0
  28. package/lib/commands/info.js +1 -0
  29. package/lib/commands/install.js +1 -0
  30. package/lib/commands/list-platforms.js +1 -0
  31. package/lib/commands/migrate.js +1 -0
  32. package/lib/commands/native-add.js +5 -0
  33. package/lib/commands/platform-clean.js +1 -0
  34. package/lib/commands/plugin/add-plugin.js +1 -0
  35. package/lib/commands/plugin/build-plugin.js +1 -0
  36. package/lib/commands/plugin/create-plugin.js +5 -0
  37. package/lib/commands/plugin/list-plugins.js +1 -0
  38. package/lib/commands/plugin/remove-plugin.js +2 -0
  39. package/lib/commands/plugin/update-plugin.js +1 -0
  40. package/lib/commands/post-install.js +6 -0
  41. package/lib/commands/prepare.js +4 -3
  42. package/lib/commands/preview.js +2 -0
  43. package/lib/commands/remove-platform.js +1 -0
  44. package/lib/commands/resources/resources-update.js +2 -0
  45. package/lib/commands/run.js +1 -0
  46. package/lib/commands/setup.js +1 -0
  47. package/lib/commands/start.js +1 -0
  48. package/lib/commands/test-init.js +4 -0
  49. package/lib/commands/test.js +9 -2
  50. package/lib/commands/typings.js +2 -1
  51. package/lib/commands/update-platform.js +5 -0
  52. package/lib/commands/update.js +2 -0
  53. package/lib/commands/widget.js +20 -1
  54. package/lib/common/bootstrap.js +1 -0
  55. package/lib/common/child-process.js +3 -0
  56. package/lib/common/codeGeneration/code-entity.js +1 -0
  57. package/lib/common/codeGeneration/code-printer.js +1 -0
  58. package/lib/common/command-params.js +1 -0
  59. package/lib/common/commands/analytics.js +3 -0
  60. package/lib/common/commands/autocompletion.js +3 -0
  61. package/lib/common/commands/device/device-log-stream.js +1 -0
  62. package/lib/common/commands/device/get-file.js +2 -0
  63. package/lib/common/commands/device/list-applications.js +1 -0
  64. package/lib/common/commands/device/list-devices.js +3 -0
  65. package/lib/common/commands/device/list-files.js +2 -0
  66. package/lib/common/commands/device/put-file.js +2 -0
  67. package/lib/common/commands/device/run-application.js +1 -0
  68. package/lib/common/commands/device/stop-application.js +1 -0
  69. package/lib/common/commands/device/uninstall-application.js +1 -0
  70. package/lib/common/commands/doctor.js +3 -2
  71. package/lib/common/commands/generate-messages.js +1 -0
  72. package/lib/common/commands/help.js +1 -0
  73. package/lib/common/commands/package-manager-get.js +1 -0
  74. package/lib/common/commands/package-manager-set.js +1 -0
  75. package/lib/common/commands/post-install.js +1 -0
  76. package/lib/common/commands/preuninstall.js +11 -2
  77. package/lib/common/commands/proxy/proxy-base.js +4 -0
  78. package/lib/common/commands/proxy/proxy-clear.js +1 -0
  79. package/lib/common/commands/proxy/proxy-get.js +1 -0
  80. package/lib/common/commands/proxy/proxy-set.js +1 -0
  81. package/lib/common/common-lib.js +1 -0
  82. package/lib/common/constants.js +11 -0
  83. package/lib/common/decorators.js +48 -0
  84. package/lib/common/dispatchers.js +10 -1
  85. package/lib/common/errors.js +13 -3
  86. package/lib/common/file-system.js +13 -2
  87. package/lib/common/header.js +3 -0
  88. package/lib/common/helpers.js +89 -3
  89. package/lib/common/host-info.js +4 -0
  90. package/lib/common/http-client.js +20 -0
  91. package/lib/common/logger/appenders/cli-appender.js +4 -0
  92. package/lib/common/logger/appenders/emit-appender.js +4 -0
  93. package/lib/common/logger/layouts/cli-layout.js +1 -0
  94. package/lib/common/logger/logger.js +5 -0
  95. package/lib/common/messages/messages.js +6 -0
  96. package/lib/common/mobile/android/android-application-manager.js +20 -1
  97. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
  98. package/lib/common/mobile/android/android-debug-bridge.js +6 -0
  99. package/lib/common/mobile/android/android-device-file-system.js +4 -0
  100. package/lib/common/mobile/android/android-device-hash-service.js +3 -0
  101. package/lib/common/mobile/android/android-device.js +8 -0
  102. package/lib/common/mobile/android/android-emulator-services.js +2 -1
  103. package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
  104. package/lib/common/mobile/android/android-log-filter.js +4 -0
  105. package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
  106. package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
  107. package/lib/common/mobile/android/genymotion/genymotion-service.js +6 -1
  108. package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
  109. package/lib/common/mobile/android/logcat-helper.js +13 -0
  110. package/lib/common/mobile/application-manager-base.js +6 -0
  111. package/lib/common/mobile/device-emitter.js +4 -0
  112. package/lib/common/mobile/device-log-emitter.js +1 -0
  113. package/lib/common/mobile/device-log-provider-base.js +1 -0
  114. package/lib/common/mobile/device-log-provider.js +23 -0
  115. package/lib/common/mobile/device-platforms-constants.js +1 -0
  116. package/lib/common/mobile/emulator-helper.js +3 -0
  117. package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
  118. package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
  119. package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
  120. package/lib/common/mobile/ios/device/ios-device.js +4 -0
  121. package/lib/common/mobile/ios/ios-device-base.js +1 -0
  122. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
  123. package/lib/common/mobile/ios/ios-log-filter.js +1 -0
  124. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
  125. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
  126. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
  127. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
  128. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
  129. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
  130. package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
  131. package/lib/common/mobile/log-filter.js +2 -0
  132. package/lib/common/mobile/logging-levels.js +1 -0
  133. package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
  134. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
  135. package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
  136. package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
  137. package/lib/common/mobile/mobile-core/devices-service.js +69 -0
  138. package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
  139. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
  140. package/lib/common/mobile/mobile-helper.js +1 -0
  141. package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
  142. package/lib/common/opener.js +1 -0
  143. package/lib/common/os-info.js +1 -0
  144. package/lib/common/plist-parser.js +1 -0
  145. package/lib/common/project-helper.js +1 -0
  146. package/lib/common/prompter.js +9 -1
  147. package/lib/common/queue.js +1 -0
  148. package/lib/common/resource-loader.js +1 -0
  149. package/lib/common/services/auto-completion-service.js +13 -1
  150. package/lib/common/services/cancellation.js +2 -1
  151. package/lib/common/services/commands-service.js +17 -6
  152. package/lib/common/services/help-service.js +11 -3
  153. package/lib/common/services/hooks-service.js +13 -0
  154. package/lib/common/services/ios-notification-service.js +1 -0
  155. package/lib/common/services/json-file-settings-service.js +6 -0
  156. package/lib/common/services/lock-service.js +6 -0
  157. package/lib/common/services/message-contract-generator.js +1 -0
  158. package/lib/common/services/messages-service.js +1 -0
  159. package/lib/common/services/micro-templating-service.js +6 -0
  160. package/lib/common/services/net-service.js +3 -0
  161. package/lib/common/services/project-files-manager.js +5 -0
  162. package/lib/common/services/project-files-provider-base.js +1 -0
  163. package/lib/common/services/proxy-service.js +1 -0
  164. package/lib/common/services/qr.js +1 -0
  165. package/lib/common/services/settings-service.js +1 -0
  166. package/lib/common/services/xcode-select-service.js +1 -0
  167. package/lib/common/utils.js +1 -0
  168. package/lib/common/validators/project-name-validator.js +1 -0
  169. package/lib/common/validators/validation-result.js +1 -0
  170. package/lib/common/verify-node-version.js +8 -1
  171. package/lib/common/yok.js +32 -11
  172. package/lib/config.js +22 -1
  173. package/lib/constants-provider.js +1 -0
  174. package/lib/constants.js +53 -0
  175. package/lib/controllers/build-controller.js +4 -3
  176. package/lib/controllers/debug-controller.js +8 -3
  177. package/lib/controllers/deploy-controller.js +1 -0
  178. package/lib/controllers/migrate-controller.js +90 -4
  179. package/lib/controllers/platform-controller.js +9 -1
  180. package/lib/controllers/prepare-controller.js +17 -4
  181. package/lib/controllers/run-controller.js +17 -1
  182. package/lib/controllers/update-controller-base.js +1 -0
  183. package/lib/controllers/update-controller.js +11 -0
  184. package/lib/data/build-data.js +1 -0
  185. package/lib/data/controller-data-base.js +1 -0
  186. package/lib/data/debug-data.js +1 -0
  187. package/lib/data/platform-data.js +1 -0
  188. package/lib/data/prepare-data.js +1 -0
  189. package/lib/data/run-data.js +1 -0
  190. package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
  191. package/lib/detached-processes/cleanup-process.js +18 -14
  192. package/lib/detached-processes/file-log-service.js +2 -1
  193. package/lib/device-path-provider.js +1 -0
  194. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
  195. package/lib/device-sockets/ios/notification.js +3 -0
  196. package/lib/device-sockets/ios/socket-request-executor.js +3 -0
  197. package/lib/helpers/android-bundle-validator-helper.js +2 -1
  198. package/lib/helpers/deploy-command-helper.js +1 -0
  199. package/lib/helpers/key-command-helper.js +4 -2
  200. package/lib/helpers/livesync-command-helper.js +4 -1
  201. package/lib/helpers/network-connectivity-validator.js +1 -0
  202. package/lib/helpers/options-track-helper.js +3 -2
  203. package/lib/helpers/package-path-helper.js +1 -0
  204. package/lib/helpers/platform-command-helper.js +7 -2
  205. package/lib/helpers/version-validator-helper.js +1 -0
  206. package/lib/key-commands/bootstrap.js +3 -2
  207. package/lib/key-commands/index.js +5 -4
  208. package/lib/nativescript-cli-lib-bootstrap.js +4 -0
  209. package/lib/nativescript-cli-lib.js +1 -0
  210. package/lib/nativescript-cli.js +11 -1
  211. package/lib/node/pbxproj-dom-xcode.js +1 -0
  212. package/lib/node/xcode.js +1 -0
  213. package/lib/node-package-manager.js +11 -1
  214. package/lib/options.js +144 -119
  215. package/lib/package-installation-manager.js +8 -1
  216. package/lib/package-manager.js +2 -0
  217. package/lib/platform-command-param.js +1 -0
  218. package/lib/pnpm-package-manager.js +4 -1
  219. package/lib/project-data.js +12 -0
  220. package/lib/providers/project-files-provider.js +1 -0
  221. package/lib/resolvers/livesync-service-resolver.js +1 -0
  222. package/lib/services/analytics/analytics-broker-process.js +10 -6
  223. package/lib/services/analytics/analytics-broker.js +2 -1
  224. package/lib/services/analytics/analytics-service.js +29 -25
  225. package/lib/services/analytics/google-analytics-provider.js +13 -12
  226. package/lib/services/analytics-settings-service.js +5 -0
  227. package/lib/services/android/android-bundle-tool-service.js +1 -0
  228. package/lib/services/android/gradle-build-args-service.js +3 -0
  229. package/lib/services/android/gradle-build-service.js +1 -0
  230. package/lib/services/android/gradle-command-service.js +1 -0
  231. package/lib/services/android-device-debug-service.js +6 -0
  232. package/lib/services/android-plugin-build-service.js +31 -2
  233. package/lib/services/android-project-service.js +71 -4
  234. package/lib/services/android-resources-migration-service.js +7 -0
  235. package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
  236. package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
  237. package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
  238. package/lib/services/apple-portal/srp/srp-wrapper.js +4 -1
  239. package/lib/services/assets-generation/assets-generation-service.js +10 -5
  240. package/lib/services/build-artifacts-service.js +2 -1
  241. package/lib/services/build-data-service.js +1 -0
  242. package/lib/services/build-info-file-service.js +1 -0
  243. package/lib/services/bundler/bundler-compiler-service.js +68 -1
  244. package/lib/services/bundler/bundler.js +1 -0
  245. package/lib/services/cleanup-service.js +13 -9
  246. package/lib/services/cocoapods-platform-manager.js +9 -0
  247. package/lib/services/cocoapods-service.js +21 -1
  248. package/lib/services/debug-data-service.js +1 -0
  249. package/lib/services/debug-service-base.js +7 -0
  250. package/lib/services/device/device-install-app-service.js +2 -1
  251. package/lib/services/doctor-service.js +21 -6
  252. package/lib/services/extensibility-service.js +8 -0
  253. package/lib/services/files-hash-service.js +1 -0
  254. package/lib/services/hmr-status-service.js +2 -0
  255. package/lib/services/info-service.js +1 -0
  256. package/lib/services/initialize-service.js +5 -1
  257. package/lib/services/ios/export-options-plist-service.js +4 -0
  258. package/lib/services/ios/ios-signing-service.js +4 -0
  259. package/lib/services/ios/spm-service.js +18 -0
  260. package/lib/services/ios/xcodebuild-args-service.js +16 -0
  261. package/lib/services/ios/xcodebuild-command-service.js +1 -0
  262. package/lib/services/ios/xcodebuild-service.js +2 -1
  263. package/lib/services/ios-debugger-port-service.js +1 -0
  264. package/lib/services/ios-device-debug-service.js +1 -0
  265. package/lib/services/ios-entitlements-service.js +1 -0
  266. package/lib/services/ios-extensions-service.js +1 -0
  267. package/lib/services/ios-log-filter.js +20 -0
  268. package/lib/services/ios-native-target-service.js +6 -4
  269. package/lib/services/ios-project-service.js +100 -1
  270. package/lib/services/ios-provision-service.js +3 -0
  271. package/lib/services/ios-watch-app-service.js +1 -0
  272. package/lib/services/ip-service.js +2 -0
  273. package/lib/services/itmstransporter-service.js +1 -0
  274. package/lib/services/karma-execution.js +2 -0
  275. package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
  276. package/lib/services/livesync/android-device-livesync-service.js +2 -0
  277. package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
  278. package/lib/services/livesync/android-livesync-service.js +1 -0
  279. package/lib/services/livesync/android-livesync-tool.js +4 -0
  280. package/lib/services/livesync/device-livesync-service-base.js +2 -0
  281. package/lib/services/livesync/ios-device-livesync-service.js +7 -0
  282. package/lib/services/livesync/ios-livesync-service.js +2 -0
  283. package/lib/services/livesync/livesync-socket.js +1 -0
  284. package/lib/services/livesync/platform-livesync-service-base.js +5 -0
  285. package/lib/services/livesync-process-data-service.js +1 -0
  286. package/lib/services/log-parser-service.js +1 -0
  287. package/lib/services/log-source-map-service.js +15 -0
  288. package/lib/services/marking-mode-service.js +8 -5
  289. package/lib/services/metadata-filtering-service.js +1 -0
  290. package/lib/services/npm-config-service.js +4 -0
  291. package/lib/services/pacote-service.js +7 -0
  292. package/lib/services/performance-service.js +3 -1
  293. package/lib/services/platform/add-platform-service.js +49 -2
  294. package/lib/services/platform/platform-validation-service.js +1 -0
  295. package/lib/services/platform/prepare-native-platform-service.js +5 -2
  296. package/lib/services/platform-environment-requirements.js +8 -3
  297. package/lib/services/platform-project-service-base.js +1 -0
  298. package/lib/services/platforms-data-service.js +1 -0
  299. package/lib/services/plugins-service.js +20 -2
  300. package/lib/services/prepare-data-service.js +1 -0
  301. package/lib/services/project-backup-service.js +4 -0
  302. package/lib/services/project-changes-service.js +14 -3
  303. package/lib/services/project-cleanup-service.js +2 -0
  304. package/lib/services/project-config-service.js +21 -2
  305. package/lib/services/project-data-service.js +36 -7
  306. package/lib/services/project-name-service.js +1 -0
  307. package/lib/services/project-service.js +10 -0
  308. package/lib/services/project-templates-service.js +3 -2
  309. package/lib/services/qr-code-terminal-service.js +1 -0
  310. package/lib/services/require-service.js +1 -0
  311. package/lib/services/start-service.js +1 -0
  312. package/lib/services/temp-service.js +3 -0
  313. package/lib/services/terminal-spinner-service.js +2 -0
  314. package/lib/services/test-execution-service.js +9 -2
  315. package/lib/services/test-initialization-service.js +4 -0
  316. package/lib/services/timeline-profiler-service.js +1 -0
  317. package/lib/services/user-settings-service.js +1 -0
  318. package/lib/services/versions-service.js +6 -4
  319. package/lib/services/watch-ignore-list-service.js +1 -0
  320. package/lib/services/xcconfig-service.js +2 -0
  321. package/lib/services/xcproj-service.js +1 -0
  322. package/lib/shared-event-bus.js +6 -0
  323. package/lib/sys-info.js +2 -1
  324. package/lib/tools/config-manipulation/config-transformer.js +12 -0
  325. package/lib/tools/node-modules/node-modules-builder.js +1 -0
  326. package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
  327. package/lib/yarn-package-manager.js +1 -0
  328. package/lib/yarn2-package-manager.js +3 -0
  329. package/package.json +1 -1
@@ -119,12 +119,17 @@ class ExtensibilityService {
119
119
  for (const extensionData of allExtensions) {
120
120
  const extensionName = extensionData.package.name;
121
121
  try {
122
+ // now get full package.json for the latest version of the package
122
123
  const registryData = await this.$packageManager.getRegistryPackageData(extensionName);
123
124
  const latestPackageData = registryData.versions[registryData["dist-tags"].latest];
124
125
  const commands = latestPackageData &&
125
126
  latestPackageData.nativescript &&
126
127
  latestPackageData.nativescript.commands;
127
128
  if (commands && commands.length) {
129
+ // For each default command we need to add its short syntax in the array of commands.
130
+ // For example in case there's a default command called devices list, the commands array will contain devices|*list.
131
+ // However, in case the user executes just ns devices, CLI will still execute the ns devices list command.
132
+ // So we need to add the devices command as well.
128
133
  _.filter(commands, (command) => command.indexOf(inputOpts.defaultCommandDelimiter) !== -1).forEach((defaultCommand) => {
129
134
  commands.push(defaultCommand.replace(defaultCommandRegExp, ""));
130
135
  });
@@ -146,6 +151,7 @@ class ExtensibilityService {
146
151
  }
147
152
  }
148
153
  catch (err) {
154
+ // We do not want to stop the whole process in case we are unable to find data for one of the extensions.
149
155
  this.$logger.trace(`Unable to get data for ${extensionName}. Error is: ${err}`);
150
156
  }
151
157
  }
@@ -178,6 +184,7 @@ class ExtensibilityService {
178
184
  this.assertExtensionsDirExists();
179
185
  if (!this.$fs.exists(this.pathToPackageJson)) {
180
186
  this.$logger.trace(`Creating ${this.pathToPackageJson}.`);
187
+ // create default package.json
181
188
  this.$fs.writeJson(this.pathToPackageJson, {
182
189
  name: "nativescript-extensibility",
183
190
  version: "1.0.0",
@@ -199,3 +206,4 @@ __decorate([
199
206
  (0, decorators_1.cache)()
200
207
  ], ExtensibilityService.prototype, "assertPackageJsonExists", null);
201
208
  yok_1.injector.register("extensibilityService", ExtensibilityService);
209
+ //# sourceMappingURL=extensibility-service.js.map
@@ -61,3 +61,4 @@ class FilesHashService {
61
61
  }
62
62
  exports.FilesHashService = FilesHashService;
63
63
  yok_1.injector.register("filesHashService", FilesHashService);
64
+ //# sourceMappingURL=files-hash-service.js.map
@@ -56,6 +56,7 @@ class HmrStatusService {
56
56
  name: "failedLiveSync",
57
57
  platform: this.$devicePlatformsConstants.iOS.toLowerCase(),
58
58
  });
59
+ // webpack5
59
60
  const statusStringMap = {
60
61
  success: constants_1.HmrConstants.HMR_SUCCESS_STATUS,
61
62
  failure: constants_1.HmrConstants.HMR_ERROR_STATUS,
@@ -126,3 +127,4 @@ __decorate([
126
127
  (0, decorators_1.cache)()
127
128
  ], HmrStatusService.prototype, "attachToHmrStatusEvent", null);
128
129
  yok_1.injector.register("hmrStatusService", HmrStatusService);
130
+ //# sourceMappingURL=hmr-status-service.js.map
@@ -12,3 +12,4 @@ class InfoService {
12
12
  }
13
13
  exports.InfoService = InfoService;
14
14
  yok_1.injector.register("infoService", InfoService);
15
+ //# sourceMappingURL=info-service.js.map
@@ -6,6 +6,8 @@ const _ = require("lodash");
6
6
  const constants_1 = require("../constants");
7
7
  const yok_1 = require("../common/yok");
8
8
  class InitializeService {
9
+ // NOTE: Do not inject anything here, use $injector.resolve in the code
10
+ // Injecting something may lead to logger initialization, but we want to initialize it from here.
9
11
  constructor($injector) {
10
12
  this.$injector = $injector;
11
13
  }
@@ -33,6 +35,7 @@ class InitializeService {
33
35
  }
34
36
  }
35
37
  if ($options.json) {
38
+ // speed up --json commands by not gathering system warnings...
36
39
  $logger.trace("Skipping system warnings for --json commands");
37
40
  }
38
41
  else {
@@ -44,7 +47,7 @@ class InitializeService {
44
47
  const systemWarnings = await $sysInfo.getSystemWarnings();
45
48
  _.each(systemWarnings, (systemWarning) => {
46
49
  const message = `${os_1.EOL}${systemWarning.message}${os_1.EOL}`;
47
- if (systemWarning.severity === "high") {
50
+ if (systemWarning.severity === "high" /* SystemWarningsSeverity.high */) {
48
51
  $logger.error(message);
49
52
  }
50
53
  else {
@@ -55,3 +58,4 @@ class InitializeService {
55
58
  }
56
59
  exports.InitializeService = InitializeService;
57
60
  yok_1.injector.register("initializeService", InitializeService);
61
+ //# sourceMappingURL=initialize-service.js.map
@@ -54,11 +54,13 @@ class ExportOptionsPlistService {
54
54
  plistTemplate += `
55
55
  </dict>
56
56
  </plist>`;
57
+ // Save the options...
57
58
  const exportOptionsPlistFilePath = await this.$tempService.path({
58
59
  prefix: "export-",
59
60
  suffix: ".plist",
60
61
  });
61
62
  this.$fs.writeFile(exportOptionsPlistFilePath, plistTemplate);
63
+ // The xcodebuild exportPath expects directory and writes the <project-name>.ipa at that directory.
62
64
  const exportFileDir = path.resolve(path.dirname(archivePath));
63
65
  const exportFilePath = path.join(exportFileDir, projectData.projectName + ".ipa");
64
66
  return { exportFileDir, exportFilePath, exportOptionsPlistFilePath };
@@ -96,6 +98,7 @@ class ExportOptionsPlistService {
96
98
  <false/>
97
99
  </dict>
98
100
  </plist>`;
101
+ // Save the options...
99
102
  const exportOptionsPlistFilePath = await this.$tempService.path({
100
103
  prefix: "export-",
101
104
  suffix: ".plist",
@@ -118,3 +121,4 @@ class ExportOptionsPlistService {
118
121
  }
119
122
  exports.ExportOptionsPlistService = ExportOptionsPlistService;
120
123
  yok_1.injector.register("exportOptionsPlistService", ExportOptionsPlistService);
124
+ //# sourceMappingURL=export-options-plist-service.js.map
@@ -46,6 +46,7 @@ class IOSSigningService {
46
46
  let shouldUpdateXcode = false;
47
47
  if (signing && signing.style === "Automatic") {
48
48
  if (signing.team !== teamId) {
49
+ // Maybe the provided team is name such as "Telerik AD" and we need to convert it to CH******37
49
50
  const teamIdsForName = await this.$iOSProvisionService.getTeamIdsWithName(teamId);
50
51
  if (!teamIdsForName.some((id) => id === signing.team)) {
51
52
  shouldUpdateXcode = true;
@@ -79,6 +80,7 @@ class IOSSigningService {
79
80
  }
80
81
  async setupSigningFromProvision(projectRoot, projectData, provision, mobileProvisionData) {
81
82
  if (!provision) {
83
+ // read uuid from Xcode an cache...
82
84
  return;
83
85
  }
84
86
  const xcode = this.$pbxprojDomXcode.Xcode.open(this.getPbxProjPath(projectData, projectRoot));
@@ -111,6 +113,7 @@ class IOSSigningService {
111
113
  this.$logger.trace(`Set Manual signing style and provisioning profile: ${configuration.name} (${configuration.uuid})`);
112
114
  });
113
115
  xcode.save();
116
+ // this.cache(uuid);
114
117
  }
115
118
  else {
116
119
  this.$logger.trace(`The specified provisioning profile is already set in the Xcode: ${provision}`);
@@ -273,3 +276,4 @@ class IOSSigningService {
273
276
  }
274
277
  exports.IOSSigningService = IOSSigningService;
275
278
  yok_1.injector.register("iOSSigningService", IOSSigningService);
279
+ //# sourceMappingURL=ios-signing-service.js.map
@@ -15,7 +15,15 @@ class SPMService {
15
15
  const spmPackages = this.$projectConfigService.getValue(`${platform}.SPMPackages`, []);
16
16
  return spmPackages;
17
17
  }
18
+ /**
19
+ * Merges plugin SPM packages with app SPM packages.
20
+ * App packages take precedence over plugin packages with the same name.
21
+ * @param appPackages - Array of app SPM packages (modified in place)
22
+ * @param pluginPackages - Array of plugin SPM packages to merge
23
+ */
18
24
  mergePluginSPMPackages(appPackages, pluginPackages) {
25
+ // include swift packages from plugin configs
26
+ // but allow app packages to override plugin packages with the same name
19
27
  const appPackageNames = new Set(appPackages.map(pkg => pkg.name));
20
28
  for (const pluginPkg of pluginPackages) {
21
29
  if (appPackageNames.has(pluginPkg.name)) {
@@ -26,6 +34,10 @@ class SPMService {
26
34
  }
27
35
  }
28
36
  }
37
+ // note: this is not used anywhere at the moment.
38
+ // public hasSPMPackages(projectData: IProjectData): boolean {
39
+ // return this.getSPMPackages(projectData).length > 0;
40
+ // }
29
41
  async applySPMPackages(platformData, projectData, pluginSpmPackages) {
30
42
  var _a;
31
43
  try {
@@ -44,17 +56,21 @@ class SPMService {
44
56
  enableAndroid: false,
45
57
  });
46
58
  await project.load();
59
+ // note: in trapeze both visionOS and iOS are handled by the ios project.
47
60
  if (!project.ios) {
48
61
  this.$logger.trace("SPM: no iOS project found via trapeze.");
49
62
  return;
50
63
  }
64
+ // todo: handle removing packages? Or just warn and require a clean?
51
65
  for (const pkg of spmPackages) {
52
66
  if ("path" in pkg) {
67
+ // resolve the path relative to the project root
53
68
  this.$logger.trace("SPM: resolving path for package: ", pkg.path);
54
69
  pkg.path = path.resolve(projectData.projectDir, pkg.path);
55
70
  }
56
71
  this.$logger.trace(`SPM: adding package ${pkg.name} to project.`, pkg);
57
72
  await project.ios.addSPMPackage(projectData.projectName, pkg);
73
+ // Add to other Targets if specified (like widgets, etc.)
58
74
  if ((_a = pkg.targets) === null || _a === void 0 ? void 0 : _a.length) {
59
75
  for (const target of pkg.targets) {
60
76
  await project.ios.addSPMPackage(target, pkg);
@@ -62,6 +78,7 @@ class SPMService {
62
78
  }
63
79
  }
64
80
  await project.commit();
81
+ // finally resolve the dependencies
65
82
  await this.resolveSPMDependencies(platformData, projectData);
66
83
  }
67
84
  catch (err) {
@@ -83,3 +100,4 @@ class SPMService {
83
100
  }
84
101
  exports.SPMService = SPMService;
85
102
  yok_1.injector.register("spmService", SPMService);
103
+ //# sourceMappingURL=spm-service.js.map
@@ -72,11 +72,18 @@ class XcodebuildArgsService {
72
72
  .concat(architectures)
73
73
  .concat(this.getBuildCommonArgs(platformData, projectData, isvisionOS ? ios_project_service_1.VisionDevicePlatformSdkName : ios_project_service_1.DevicePlatformSdkName))
74
74
  .concat(this.getBuildLoggingArgs());
75
+ // pbxproj-dom sets CODE_SIGN_IDENTITY[sdk=iphoneos*] which doesn't match
76
+ // the xros SDK used by visionOS builds — pass it explicitly as an override
77
+ if (isvisionOS) {
78
+ args.push(`CODE_SIGN_IDENTITY=${buildConfig.release ? "Apple Distribution" : "Apple Development"}`);
79
+ }
75
80
  return args;
76
81
  }
77
82
  async getArchitecturesArgs(buildConfig) {
78
83
  const args = [];
79
84
  if (this.$devicePlatformsConstants.isvisionOS(buildConfig.platform)) {
85
+ // visionOS builds (device/simulator) are arm64-only; rely on destination for arch
86
+ // and explicitly exclude x86_64 to avoid accidental selection
80
87
  args.push("ONLY_ACTIVE_ARCH=YES", "EXCLUDED_ARCHS=x86_64");
81
88
  return args;
82
89
  }
@@ -90,6 +97,8 @@ class XcodebuildArgsService {
90
97
  }
91
98
  getXcodeProjectArgs(platformData, projectData) {
92
99
  const xcworkspacePath = path.join(platformData.projectRoot, `${projectData.projectName}.xcworkspace`);
100
+ // Introduced in Xcode 14+
101
+ // ref: https://forums.swift.org/t/telling-xcode-14-beta-4-to-trust-build-tool-plugins-programatically/59305/5
93
102
  const skipPackageValidation = "-skipPackagePluginValidation";
94
103
  const extraArgs = [
95
104
  "-scheme",
@@ -97,6 +106,12 @@ class XcodebuildArgsService {
97
106
  skipPackageValidation,
98
107
  ];
99
108
  const BUILD_SETTINGS_FILE_PATH = path.join(projectData.appResourcesDirectoryPath, platformData.normalizedPlatformName, constants.BUILD_XCCONFIG_FILE_NAME);
109
+ // Only include explicit properties from build.xcconfig
110
+ // Note: we could include entire file via -xcconfig flag
111
+ // however doing so introduces unwanted side effects
112
+ // like cocoapods issues related to ASSETCATALOG_COMPILER_APPICON_NAME
113
+ // references: https://medium.com/@iostechset/why-cocoapods-eats-app-icons-79fe729808d4
114
+ // https://github.com/CocoaPods/CocoaPods/issues/7003
100
115
  const deployTargetProperty = "IPHONEOS_DEPLOYMENT_TARGET";
101
116
  const deployTargetVersion = this.$xcconfigService.readPropertyValue(BUILD_SETTINGS_FILE_PATH, deployTargetProperty);
102
117
  if (deployTargetVersion) {
@@ -146,3 +161,4 @@ class XcodebuildArgsService {
146
161
  }
147
162
  exports.XcodebuildArgsService = XcodebuildArgsService;
148
163
  yok_1.injector.register("xcodebuildArgsService", XcodebuildArgsService);
164
+ //# sourceMappingURL=xcodebuild-args-service.js.map
@@ -27,3 +27,4 @@ class XcodebuildCommandService {
27
27
  }
28
28
  exports.XcodebuildCommandService = XcodebuildCommandService;
29
29
  yok_1.injector.register("xcodebuildCommandService", XcodebuildCommandService);
30
+ //# sourceMappingURL=xcodebuild-command-service.js.map
@@ -64,7 +64,7 @@ class XcodebuildService {
64
64
  output.exportFileDir,
65
65
  "-exportOptionsPlist",
66
66
  output.exportOptionsPlistFilePath,
67
- provision ? "" : "-allowProvisioningUpdates",
67
+ provision ? "" : "-allowProvisioningUpdates", // no profiles specificed so let xcode decide.
68
68
  ];
69
69
  await this.$xcodebuildCommandService.executeCommand(args, {
70
70
  cwd: platformData.projectRoot,
@@ -74,3 +74,4 @@ class XcodebuildService {
74
74
  }
75
75
  exports.XcodebuildService = XcodebuildService;
76
76
  yok_1.injector.register("xcodebuildService", XcodebuildService);
77
+ //# sourceMappingURL=xcodebuild-service.js.map
@@ -125,3 +125,4 @@ __decorate([
125
125
  (0, decorators_1.cache)()
126
126
  ], IOSDebuggerPortService.prototype, "attachToAttachRequestEvent", null);
127
127
  yok_1.injector.register("iOSDebuggerPortService", IOSDebuggerPortService);
128
+ //# sourceMappingURL=ios-debugger-port-service.js.map
@@ -138,3 +138,4 @@ __decorate([
138
138
  (0, decorators_1.performanceLog)()
139
139
  ], IOSDeviceDebugService.prototype, "openAppInspector", null);
140
140
  yok_1.injector.register("iOSDeviceDebugService", IOSDeviceDebugService, false);
141
+ //# sourceMappingURL=ios-device-debug-service.js.map
@@ -67,3 +67,4 @@ class IOSEntitlementsService {
67
67
  exports.IOSEntitlementsService = IOSEntitlementsService;
68
68
  IOSEntitlementsService.DefaultEntitlementsName = "app.entitlements";
69
69
  yok_1.injector.register("iOSEntitlementsService", IOSEntitlementsService);
70
+ //# sourceMappingURL=ios-entitlements-service.js.map
@@ -50,3 +50,4 @@ class IOSExtensionsService {
50
50
  }
51
51
  exports.IOSExtensionsService = IOSExtensionsService;
52
52
  yok_1.injector.register("iOSExtensionsService", IOSExtensionsService);
53
+ //# sourceMappingURL=ios-extensions-service.js.map
@@ -5,8 +5,20 @@ const yok_1 = require("../common/yok");
5
5
  class IOSLogFilter {
6
6
  constructor($loggingLevels) {
7
7
  this.$loggingLevels = $loggingLevels;
8
+ // Used to recognize output related to the current project
9
+ // This looks for artifacts like: AppName[22432] or AppName(SomeTextHere)[23123]
8
10
  this.appOutputRegex = /([^\s\(\)]+)(?:\(([^\s]+)\))?\[[0-9]+\]/;
11
+ // Used to trim the passed messages to a simpler output
12
+ // Example:
13
+ // This: "May 24 15:54:52 Dragons-iPhone NativeScript250(NativeScript)[356] <Notice>: CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:3477:36: ORIGINAL STACKTRACE:"
14
+ // Becomes: CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:3477:36: ORIGINAL STACKTRACE:
9
15
  this.infoFilterRegex = new RegExp(`^.*(?:<Notice>:[ \t]?|<Error>:[ \t]?|<Warning>:[ \t]?|\\(NativeScript\\)[ \t]?|${this.appOutputRegex.source}:[ \t]?){1}`);
16
+ // Used to post filter messages that slip through but are not coming from NativeScript itself.
17
+ // Looks for text in parenthesis at the beginning
18
+ // Example:
19
+ // (RunningBoardServices) [com.apple.runningboard:connection] Identity resolved as application<...>
20
+ // ^(~~capture group~~~)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
+ // we then use this to filter out non-NativeScript lines
10
22
  this.postFilterRegex = /^\((.+)\) \[com\.apple.+\]/;
11
23
  this.filterActive = true;
12
24
  this.partialLine = null;
@@ -29,11 +41,15 @@ class IOSLogFilter {
29
41
  this.partialLine = currentLine;
30
42
  break;
31
43
  }
44
+ // Legacy filter moved to preFilter
32
45
  if (this.preFilter(data, currentLine)) {
33
46
  continue;
34
47
  }
35
48
  const matchResult = this.appOutputRegex.exec(currentLine);
36
49
  if (matchResult && matchResult.length > 1) {
50
+ // Check if the name of the app equals the name of the CLI project and turn on the filter if not.
51
+ // We call initializeProjectData in order to obtain the current project name as the instance
52
+ // of this filter may be used accross multiple projects.
37
53
  const projectName = loggingOptions && loggingOptions.projectName;
38
54
  this.filterActive = matchResult[1] !== projectName;
39
55
  if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[2]) {
@@ -48,8 +64,11 @@ class IOSLogFilter {
48
64
  currentLine = currentLine.replace(filteredLineInfo[0], "");
49
65
  }
50
66
  currentLine = currentLine
67
+ // remove lading space before CONSOLE
51
68
  .replace(/^\s*CONSOLE/, "CONSOLE")
69
+ // trim trailing spaces only to preserve indentation
52
70
  .trimEnd();
71
+ // post filtering: (<anything>) check if <anything> is not "NativeScript"
53
72
  const postFilterMatch = this.postFilterRegex.exec(currentLine);
54
73
  if (postFilterMatch && (postFilterMatch === null || postFilterMatch === void 0 ? void 0 : postFilterMatch[1]) !== "NativeScript") {
55
74
  continue;
@@ -68,3 +87,4 @@ class IOSLogFilter {
68
87
  }
69
88
  exports.IOSLogFilter = IOSLogFilter;
70
89
  yok_1.injector.register("iOSLogFilter", IOSLogFilter);
90
+ //# sourceMappingURL=ios-log-filter.js.map
@@ -58,8 +58,8 @@ class IOSNativeTargetService {
58
58
  setXcodeTargetBuildConfigurationProperties(properties, targetName, project) {
59
59
  properties.forEach((property) => {
60
60
  const buildNames = property.buildNames || [
61
- "Debug",
62
- "Release",
61
+ "Debug" /* BuildNames.debug */,
62
+ "Release" /* BuildNames.release */,
63
63
  ];
64
64
  buildNames.forEach((buildName) => {
65
65
  project.addBuildProperty(property.name, property.value, buildName, targetName);
@@ -76,6 +76,7 @@ class IOSNativeTargetService {
76
76
  project.addToBuildSettings("ASSETCATALOG_COMPILER_APPICON_NAME", configurationJson.assetcatalogCompilerAppiconName, targetUuid);
77
77
  }
78
78
  const properties = [];
79
+ // Set for both release and debug
79
80
  if (configurationJson.targetBuildConfigurationProperties) {
80
81
  _.forEach(configurationJson.targetBuildConfigurationProperties, (value, name) => properties.push({ value, name }));
81
82
  }
@@ -84,11 +85,11 @@ class IOSNativeTargetService {
84
85
  var buildName = null;
85
86
  switch (name) {
86
87
  case "debug": {
87
- buildName = "Debug";
88
+ buildName = "Debug" /* BuildNames.debug */;
88
89
  break;
89
90
  }
90
91
  case "release": {
91
- buildName = "Release";
92
+ buildName = "Release" /* BuildNames.release */;
92
93
  break;
93
94
  }
94
95
  default: {
@@ -106,3 +107,4 @@ class IOSNativeTargetService {
106
107
  }
107
108
  exports.IOSNativeTargetService = IOSNativeTargetService;
108
109
  yok_1.injector.register("iOSNativeTargetService", IOSNativeTargetService);
110
+ //# sourceMappingURL=ios-native-target-service.js.map
@@ -74,7 +74,10 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
74
74
  this._platformsDirCache = null;
75
75
  this._platformOverrideCache = null;
76
76
  this._platformData = null;
77
+ // Track added frameworks by name to prevent duplicates in monorepo/workspace setups
78
+ // where the same plugin may exist in multiple node_modules paths
77
79
  this._addedFrameworks = new Set();
80
+ // Track added static libraries by name to prevent duplicates in monorepo/workspace setups
78
81
  this._addedStaticLibs = new Set();
79
82
  }
80
83
  getPlatformData(projectData) {
@@ -143,7 +146,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
143
146
  ".ico",
144
147
  ".cur",
145
148
  ".xbm",
146
- ],
149
+ ], // https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/
147
150
  };
148
151
  this._platformsDirCache = projectData.platformsDir;
149
152
  this._platformOverrideCache = currentOverride;
@@ -192,8 +195,11 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
192
195
  this.$fs.ensureDirectoryExists(path.join(this.getPlatformData(projectData).projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER));
193
196
  shell.cp("-R", path.join(frameworkDir, "*"), this.getPlatformData(projectData).projectRoot);
194
197
  }
198
+ //TODO: plamen5kov: revisit this method, might have unnecessary/obsolete logic
195
199
  async interpolateData(projectData) {
196
200
  const projectRootFilePath = path.join(this.getPlatformData(projectData).projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER);
201
+ // Starting with NativeScript for iOS 1.6.0, the project Info.plist file resides not in the platform project,
202
+ // but in the hello-world app template as a platform specific resource.
197
203
  if (this.$fs.exists(path.join(projectRootFilePath, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER + "-Info.plist"))) {
198
204
  this.replaceFileName("-Info.plist", projectRootFilePath, projectData);
199
205
  }
@@ -283,6 +289,9 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
283
289
  return await isDynamicFrameworkBundle(frameworkPath, frameworkName);
284
290
  }
285
291
  }
292
+ /**
293
+ * Clears the framework and static library tracking sets. Should be called at the start of a new prepare cycle.
294
+ */
286
295
  clearFrameworksCache() {
287
296
  this._addedFrameworks.clear();
288
297
  this._addedStaticLibs.clear();
@@ -291,6 +300,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
291
300
  if (this.$hostInfo.isWindows) {
292
301
  return;
293
302
  }
303
+ // Check if framework with same name already added (prevents duplicate output errors in monorepos)
294
304
  const frameworkName = path.basename(frameworkPath);
295
305
  if (this._addedFrameworks.has(frameworkName)) {
296
306
  this.$logger.trace(`Framework ${frameworkName} already added, skipping duplicate from ${frameworkPath}`);
@@ -306,21 +316,38 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
306
316
  frameworkAddOptions["sign"] = true;
307
317
  }
308
318
  if (this.$options.hostProjectPath) {
319
+ // always mark xcframeworks for embedding
309
320
  frameworkAddOptions["embed"] = true;
310
321
  frameworkAddOptions["sign"] = false;
311
322
  }
323
+ // Note: we used to prepend "$(SRCROOT)/" to the framework path, but seems like it's not needed anymore
324
+ // "$(SRCROOT)/" +
312
325
  const frameworkRelativePath = this.getLibSubpathRelativeToProjectPath(frameworkPath, projectData);
313
326
  project.addFramework(frameworkRelativePath, frameworkAddOptions);
327
+ // filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath
328
+ // project.addBuildPhase(
329
+ // [],
330
+ // "PBXShellScriptBuildPhase",
331
+ // "Debug SRCROOT",
332
+ // undefined,
333
+ // {
334
+ // shellPath: "/bin/sh",
335
+ // shellScript: `echo "SRCROOT: $SRCROOT"`,
336
+ // }
337
+ // );
314
338
  this.savePbxProj(project, projectData);
315
339
  }
316
340
  async addStaticLibrary(staticLibPath, projectData) {
341
+ // Check if static library with same name already added (prevents duplicate errors in monorepos)
317
342
  const libraryName = path.basename(staticLibPath, ".a");
318
343
  if (this._addedStaticLibs.has(libraryName)) {
319
344
  this.$logger.trace(`Static library ${libraryName} already added, skipping duplicate from ${staticLibPath}`);
320
345
  return;
321
346
  }
322
347
  this._addedStaticLibs.add(libraryName);
348
+ // Copy files to lib folder.
323
349
  const headersSubpath = path.join(path.dirname(staticLibPath), "include", libraryName);
350
+ // Add static library to project file and setup header search paths
324
351
  const project = this.createPbxProj(projectData);
325
352
  const relativeStaticLibPath = this.getLibSubpathRelativeToProjectPath(staticLibPath, projectData);
326
353
  project.addFramework(relativeStaticLibPath);
@@ -355,10 +382,58 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
355
382
  filesRelativeToProject: true,
356
383
  uuid: "NATIVESCRIPTNATIVESCRIPT",
357
384
  });
385
+ /**
386
+ * 1. Add platforms/ios/{projectname}/app build to the host app
387
+ */
388
+ // Note: allow customization of this targetFolderName
389
+ // const targetFolderName = "app";
358
390
  const buildFolderPath = path.join(this.$options.hostProjectPath, projectData.projectName);
359
391
  project.addResourceFile(buildFolderPath, {}, "NATIVESCRIPTNATIVESCRIPT");
392
+ // filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath
393
+ // project.addBuildPhase(
394
+ // [],
395
+ // "PBXShellScriptBuildPhase",
396
+ // "Copy Metadata (DEBUG)",
397
+ // undefined,
398
+ // {
399
+ // shellPath: "/bin/sh",
400
+ // shellScript: `cp ./platforms/ios/build/Debug-iphonesimulator/metadata-arm64.bin $CONFIGURATION_BUILD_DIR`,
401
+ // outputPaths: [
402
+ // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-arm64.bin"),
403
+ // // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-arm64e.bin"),
404
+ // // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-i386.bin"),
405
+ // // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-x86_64.bin"),
406
+ // ],
407
+ // }
408
+ // );
360
409
  const metadataPath = path.relative(this.$options.hostProjectPath, buildFolderPath);
361
410
  project.addToOtherLinkerFlags(JSON.stringify(`-sectcreate __DATA __TNSMetadata "${metadataPath}/metadata-arm64.bin"`));
411
+ // // no shorthand way to get UUID of build phase that i can tell
412
+ // // methods return the phase as an object but ommitted the actual key (uuid we need)
413
+ // // this does it same way nativescript-dev-xcode does but gets the uuid we need
414
+ // const resourcesBuildPhaseKeys = Object.keys(
415
+ // project.hash.project.objects["PBXResourcesBuildPhase"]
416
+ // );
417
+ // // console.log('resourcesBuildPhaseKeys:', resourcesBuildPhaseKeys);
418
+ // const buildPhaseUUID = resourcesBuildPhaseKeys[0];
419
+ // const comment = `${targetFolderName} in Resources`;
420
+ // project.hash.project.objects["PBXResourcesBuildPhase"][
421
+ // buildPhaseUUID
422
+ // ].files.forEach((f: any) => {
423
+ // console.log(f);
424
+ // });
425
+ // if (
426
+ // !project.hash.project.objects["PBXResourcesBuildPhase"][
427
+ // buildPhaseUUID
428
+ // ].files.find((f: any) => f.comment === comment)
429
+ // ) {
430
+ // project.addResourceFile(buildFolderPath, {}, buildPhaseUUID);
431
+ // }
432
+ /**
433
+ * 2. Ensure metadata is copied as a file
434
+ * The apps metadata-{arch}.bin should be added as a file reference.
435
+ */
436
+ // TODO
362
437
  this.savePbxProj(project, projectData);
363
438
  }
364
439
  catch (err) {
@@ -411,10 +486,12 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
411
486
  this.$fs.deleteDirectory(platformsAppResourcesPath);
412
487
  this.$fs.ensureDirectoryExists(platformsAppResourcesPath);
413
488
  const platformAppResourcesPath = path.join(projectAppResourcesPath, platformData.normalizedPlatformName);
489
+ // this allows App_Resources/visionOS
414
490
  if (this.$fs.exists(platformAppResourcesPath)) {
415
491
  this.$fs.copyFile(path.join(platformAppResourcesPath, "*"), platformsAppResourcesPath);
416
492
  }
417
493
  else {
494
+ // otherwise falls back to App_Resources/iOS
418
495
  this.$fs.copyFile(path.join(projectAppResourcesPath, this.$devicePlatformsConstants.iOS, "*"), platformsAppResourcesPath);
419
496
  }
420
497
  this.$fs.deleteFile(path.join(platformsAppResourcesPath, platformData.configurationFileName));
@@ -513,6 +590,12 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
513
590
  getLibSubpathRelativeToProjectPath(targetPath, projectData) {
514
591
  const projectRoot = this.getPlatformData(projectData).projectRoot;
515
592
  const frameworkPath = path.relative(projectRoot, targetPath);
593
+ // console.log({
594
+ // targetPath,
595
+ // projectRoot,
596
+ // frameworkPath,
597
+ // resolved: path.resolve(projectRoot, frameworkPath),
598
+ // });
516
599
  return frameworkPath;
517
600
  }
518
601
  getPbxProjPath(projectData) {
@@ -550,6 +633,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
550
633
  this.$cocoapodsService.removePodfileFromProject(pluginData.name, this.$cocoapodsService.getPluginPodfilePath(pluginData), projectData, projectRoot);
551
634
  }
552
635
  async handleNativeDependenciesChange(projectData, opts) {
636
+ // Clear framework tracking for fresh duplicate detection
553
637
  this.clearFrameworksCache();
554
638
  const platformData = this.getPlatformData(projectData);
555
639
  const pluginsData = this.getAllProductionPlugins(projectData);
@@ -561,6 +645,10 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
561
645
  const projectPodfilePath = this.$cocoapodsService.getProjectPodfilePath(platformData.projectRoot);
562
646
  if (this.$fs.exists(projectPodfilePath)) {
563
647
  await this.$cocoapodsService.executePodInstall(platformData.projectRoot, this.$xcprojService.getXcodeprojPath(projectData, platformData.projectRoot));
648
+ // The `pod install` command adds a new target to the .pbxproject. This target adds additional build phases to Xcode project.
649
+ // Some of these phases relies on env variables (like PODS_PODFILE_DIR_PATH or PODS_ROOT).
650
+ // These variables are produced from merge of pod's xcconfig file and project's xcconfig file.
651
+ // So the correct order is `pod install` to be executed before merging pod's xcconfig file.
564
652
  await this.$cocoapodsService.mergePodXcconfigFile(projectData, platformData, opts);
565
653
  }
566
654
  const pluginSpmPackages = [];
@@ -586,6 +674,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
586
674
  const hasProvision = provision !== undefined;
587
675
  const hasTeamId = teamId !== undefined;
588
676
  if (hasProvision || hasTeamId) {
677
+ // Check if the native project's signing is set to the provided provision...
589
678
  const pbxprojPath = this.getPbxProjPath(projectData);
590
679
  if (this.$fs.exists(pbxprojPath)) {
591
680
  const xcode = this.$pbxprojDomXcode.Xcode.open(pbxprojPath);
@@ -601,6 +690,9 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
601
690
  }
602
691
  }
603
692
  else {
693
+ // Specifying provisioning profile requires "Manual" signing style.
694
+ // If the current signing style was not "Manual" it was probably "Automatic" or,
695
+ // it was not uniform for the debug and release build configurations.
604
696
  changesInfo.signingChanged = true;
605
697
  }
606
698
  }
@@ -614,6 +706,8 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
614
706
  }
615
707
  }
616
708
  else {
709
+ // Specifying team id or name requires "Automatic" signing style.
710
+ // If the current signing style was not "Automatic" it was probably "Manual".
617
711
  changesInfo.signingChanged = true;
618
712
  }
619
713
  }
@@ -830,10 +924,14 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
830
924
  }
831
925
  for (const pluginsXcconfigFilePath of pluginsXcconfigFilePaths) {
832
926
  if (!this.$fs.exists(pluginsXcconfigFilePath)) {
927
+ // We need the pluginsXcconfig file to exist in platforms dir as it is required in the native template:
928
+ // https://github.com/NativeScript/ios-runtime/blob/9c2b7b5f70b9bee8452b7a24aa6b646214c7d2be/build/project-template/__PROJECT_NAME__/build-debug.xcconfig#L3
929
+ // From Xcode 10 in case the file is missing, this include fails and the build itself fails (was a warning in previous Xcode versions).
833
930
  this.$fs.writeFile(pluginsXcconfigFilePath, "");
834
931
  }
835
932
  }
836
933
  for (const pluginsXcconfigFilePath of pluginsXcconfigFilePaths) {
934
+ // Set Entitlements Property to point to default file if not set explicitly by the user.
837
935
  const entitlementsPropertyValue = this.$xcconfigService.readPropertyValue(pluginsXcconfigFilePath, constants.CODE_SIGN_ENTITLEMENTS);
838
936
  if (entitlementsPropertyValue === null &&
839
937
  this.$fs.exists(this.$iOSEntitlementsService.getPlatformsEntitlementsPath(projectData))) {
@@ -878,3 +976,4 @@ __decorate([
878
976
  (0, helpers_2.hook)("buildIOS")
879
977
  ], IOSProjectService.prototype, "buildProject", null);
880
978
  yok_1.injector.register("iOSProjectService", IOSProjectService);
979
+ //# sourceMappingURL=ios-project-service.js.map
@@ -127,6 +127,8 @@ class IOSProvisionService {
127
127
  }
128
128
  async getDevelopmentTeams() {
129
129
  const teams = {};
130
+ // NOTE: We are reading all provisioning profiles and collect team information from them.
131
+ // It would be better if we can check the Apple ID registered in Xcode and read the teams associated with it.
130
132
  mobileprovision.provision.read().forEach((provision) => provision.TeamIdentifier &&
131
133
  provision.TeamIdentifier.forEach((id) => {
132
134
  if (!teams[provision.TeamName]) {
@@ -150,3 +152,4 @@ class IOSProvisionService {
150
152
  }
151
153
  exports.IOSProvisionService = IOSProvisionService;
152
154
  yok_1.injector.register("iOSProvisionService", IOSProvisionService);
155
+ //# sourceMappingURL=ios-provision-service.js.map