nativescript 9.0.0-alpha.13 → 9.0.0-alpha.14

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 (343) hide show
  1. package/config/test-deps-versions-generated.json +2 -2
  2. package/docs/build-jekyll-md.sh +1 -1
  3. package/docs/man_pages/config/config-get.md +36 -0
  4. package/docs/man_pages/config/config-set.md +40 -0
  5. package/docs/man_pages/config/config.md +39 -0
  6. package/docs/man_pages/project/hooks/hooks.md +35 -0
  7. package/docs/man_pages/start.md +1 -0
  8. package/lib/.d.ts +4 -0
  9. package/lib/android-tools-info.js +12 -0
  10. package/lib/base-package-manager.js +7 -0
  11. package/lib/bootstrap.js +7 -1
  12. package/lib/bun-package-manager.js +14 -1
  13. package/lib/color.js +4 -0
  14. package/lib/commands/add-platform.js +1 -0
  15. package/lib/commands/apple-login.js +1 -0
  16. package/lib/commands/appstore-list.js +1 -0
  17. package/lib/commands/appstore-upload.js +3 -0
  18. package/lib/commands/build.js +3 -2
  19. package/lib/commands/clean.js +22 -1
  20. package/lib/commands/command-base.js +1 -0
  21. package/lib/commands/config.js +5 -0
  22. package/lib/commands/create-project.js +6 -0
  23. package/lib/commands/debug.js +6 -1
  24. package/lib/commands/deploy.js +3 -2
  25. package/lib/commands/embedding/embed.js +7 -0
  26. package/lib/commands/extensibility/install-extension.js +1 -0
  27. package/lib/commands/extensibility/list-extensions.js +1 -0
  28. package/lib/commands/extensibility/uninstall-extension.js +1 -0
  29. package/lib/commands/fonts.js +1 -0
  30. package/lib/commands/generate-assets.js +1 -0
  31. package/lib/commands/generate-help.js +1 -0
  32. package/lib/commands/generate.js +48 -1
  33. package/lib/commands/hooks/common.js +80 -0
  34. package/lib/commands/hooks/hooks-lock.js +101 -0
  35. package/lib/commands/hooks/hooks.js +72 -0
  36. package/lib/commands/info.js +1 -0
  37. package/lib/commands/install.js +1 -0
  38. package/lib/commands/list-platforms.js +1 -0
  39. package/lib/commands/migrate.js +1 -0
  40. package/lib/commands/native-add.js +5 -0
  41. package/lib/commands/platform-clean.js +1 -0
  42. package/lib/commands/plugin/add-plugin.js +1 -0
  43. package/lib/commands/plugin/build-plugin.js +1 -0
  44. package/lib/commands/plugin/create-plugin.js +5 -0
  45. package/lib/commands/plugin/list-plugins.js +1 -0
  46. package/lib/commands/plugin/remove-plugin.js +2 -0
  47. package/lib/commands/plugin/update-plugin.js +1 -0
  48. package/lib/commands/post-install.js +6 -0
  49. package/lib/commands/prepare.js +4 -3
  50. package/lib/commands/preview.js +2 -0
  51. package/lib/commands/remove-platform.js +1 -0
  52. package/lib/commands/resources/resources-update.js +2 -0
  53. package/lib/commands/run.js +1 -0
  54. package/lib/commands/setup.js +1 -0
  55. package/lib/commands/start.js +1 -0
  56. package/lib/commands/test-init.js +4 -0
  57. package/lib/commands/test.js +9 -2
  58. package/lib/commands/typings.js +2 -1
  59. package/lib/commands/update-platform.js +5 -0
  60. package/lib/commands/update.js +2 -0
  61. package/lib/commands/widget.js +20 -1
  62. package/lib/common/bootstrap.js +1 -0
  63. package/lib/common/child-process.js +3 -0
  64. package/lib/common/codeGeneration/code-entity.js +1 -0
  65. package/lib/common/codeGeneration/code-printer.js +1 -0
  66. package/lib/common/command-params.js +1 -0
  67. package/lib/common/commands/analytics.js +3 -0
  68. package/lib/common/commands/autocompletion.js +3 -0
  69. package/lib/common/commands/device/device-log-stream.js +1 -0
  70. package/lib/common/commands/device/get-file.js +2 -0
  71. package/lib/common/commands/device/list-applications.js +1 -0
  72. package/lib/common/commands/device/list-devices.js +3 -0
  73. package/lib/common/commands/device/list-files.js +2 -0
  74. package/lib/common/commands/device/put-file.js +2 -0
  75. package/lib/common/commands/device/run-application.js +1 -0
  76. package/lib/common/commands/device/stop-application.js +1 -0
  77. package/lib/common/commands/device/uninstall-application.js +1 -0
  78. package/lib/common/commands/doctor.js +3 -2
  79. package/lib/common/commands/generate-messages.js +1 -0
  80. package/lib/common/commands/help.js +1 -0
  81. package/lib/common/commands/package-manager-get.js +1 -0
  82. package/lib/common/commands/package-manager-set.js +1 -0
  83. package/lib/common/commands/post-install.js +1 -0
  84. package/lib/common/commands/preuninstall.js +11 -2
  85. package/lib/common/commands/proxy/proxy-base.js +4 -0
  86. package/lib/common/commands/proxy/proxy-clear.js +1 -0
  87. package/lib/common/commands/proxy/proxy-get.js +1 -0
  88. package/lib/common/commands/proxy/proxy-set.js +1 -0
  89. package/lib/common/common-lib.js +1 -0
  90. package/lib/common/constants.js +11 -0
  91. package/lib/common/decorators.js +48 -0
  92. package/lib/common/definitions/extensibility.d.ts +2 -2
  93. package/lib/common/definitions/mobile.d.ts +72 -72
  94. package/lib/common/dispatchers.js +10 -1
  95. package/lib/common/errors.js +13 -3
  96. package/lib/common/file-system.js +13 -2
  97. package/lib/common/header.js +3 -0
  98. package/lib/common/helpers.js +89 -3
  99. package/lib/common/host-info.js +4 -0
  100. package/lib/common/http-client.js +20 -0
  101. package/lib/common/logger/appenders/cli-appender.js +4 -0
  102. package/lib/common/logger/appenders/emit-appender.js +4 -0
  103. package/lib/common/logger/layouts/cli-layout.js +1 -0
  104. package/lib/common/logger/logger.js +5 -0
  105. package/lib/common/messages/messages.js +6 -0
  106. package/lib/common/mobile/android/android-application-manager.js +20 -1
  107. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
  108. package/lib/common/mobile/android/android-debug-bridge.js +6 -0
  109. package/lib/common/mobile/android/android-device-file-system.js +4 -0
  110. package/lib/common/mobile/android/android-device-hash-service.js +3 -0
  111. package/lib/common/mobile/android/android-device.js +8 -0
  112. package/lib/common/mobile/android/android-emulator-services.js +2 -1
  113. package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
  114. package/lib/common/mobile/android/android-log-filter.js +4 -0
  115. package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
  116. package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
  117. package/lib/common/mobile/android/genymotion/genymotion-service.js +6 -1
  118. package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
  119. package/lib/common/mobile/android/logcat-helper.js +13 -0
  120. package/lib/common/mobile/application-manager-base.js +6 -0
  121. package/lib/common/mobile/device-emitter.js +4 -0
  122. package/lib/common/mobile/device-log-emitter.js +1 -0
  123. package/lib/common/mobile/device-log-provider-base.js +1 -0
  124. package/lib/common/mobile/device-log-provider.js +23 -0
  125. package/lib/common/mobile/device-platforms-constants.js +1 -0
  126. package/lib/common/mobile/emulator-helper.js +3 -0
  127. package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
  128. package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
  129. package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
  130. package/lib/common/mobile/ios/device/ios-device.js +4 -0
  131. package/lib/common/mobile/ios/ios-device-base.js +1 -0
  132. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
  133. package/lib/common/mobile/ios/ios-log-filter.js +1 -0
  134. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
  135. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
  136. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
  137. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
  138. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
  139. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
  140. package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
  141. package/lib/common/mobile/log-filter.js +2 -0
  142. package/lib/common/mobile/logging-levels.js +1 -0
  143. package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
  144. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
  145. package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
  146. package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
  147. package/lib/common/mobile/mobile-core/devices-service.js +69 -0
  148. package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
  149. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
  150. package/lib/common/mobile/mobile-helper.js +1 -0
  151. package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
  152. package/lib/common/opener.js +1 -0
  153. package/lib/common/os-info.js +1 -0
  154. package/lib/common/plist-parser.js +1 -0
  155. package/lib/common/project-helper.js +1 -0
  156. package/lib/common/prompter.js +9 -1
  157. package/lib/common/queue.js +1 -0
  158. package/lib/common/resource-loader.js +1 -0
  159. package/lib/common/services/auto-completion-service.js +13 -1
  160. package/lib/common/services/cancellation.js +2 -1
  161. package/lib/common/services/commands-service.js +17 -6
  162. package/lib/common/services/help-service.js +11 -3
  163. package/lib/common/services/hooks-service.js +13 -0
  164. package/lib/common/services/ios-notification-service.js +1 -0
  165. package/lib/common/services/json-file-settings-service.js +6 -0
  166. package/lib/common/services/lock-service.js +6 -0
  167. package/lib/common/services/message-contract-generator.js +1 -0
  168. package/lib/common/services/messages-service.js +1 -0
  169. package/lib/common/services/micro-templating-service.js +6 -0
  170. package/lib/common/services/net-service.js +3 -0
  171. package/lib/common/services/project-files-manager.js +5 -0
  172. package/lib/common/services/project-files-provider-base.js +1 -0
  173. package/lib/common/services/proxy-service.js +1 -0
  174. package/lib/common/services/qr.js +1 -0
  175. package/lib/common/services/settings-service.js +1 -0
  176. package/lib/common/services/xcode-select-service.js +1 -0
  177. package/lib/common/utils.js +1 -0
  178. package/lib/common/validators/project-name-validator.js +1 -0
  179. package/lib/common/validators/validation-result.js +1 -0
  180. package/lib/common/verify-node-version.js +8 -1
  181. package/lib/common/yok.js +32 -11
  182. package/lib/config.js +22 -1
  183. package/lib/constants-provider.js +1 -0
  184. package/lib/constants.js +53 -0
  185. package/lib/controllers/build-controller.js +4 -3
  186. package/lib/controllers/debug-controller.js +8 -3
  187. package/lib/controllers/deploy-controller.js +1 -0
  188. package/lib/controllers/migrate-controller.js +90 -4
  189. package/lib/controllers/platform-controller.js +9 -1
  190. package/lib/controllers/prepare-controller.js +17 -4
  191. package/lib/controllers/run-controller.js +17 -1
  192. package/lib/controllers/update-controller-base.js +1 -0
  193. package/lib/controllers/update-controller.js +11 -0
  194. package/lib/data/build-data.js +1 -0
  195. package/lib/data/controller-data-base.js +1 -0
  196. package/lib/data/debug-data.js +1 -0
  197. package/lib/data/platform-data.js +1 -0
  198. package/lib/data/prepare-data.js +1 -0
  199. package/lib/data/run-data.js +1 -0
  200. package/lib/definitions/hooks.d.ts +1 -0
  201. package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
  202. package/lib/detached-processes/cleanup-process.js +18 -14
  203. package/lib/detached-processes/file-log-service.js +2 -1
  204. package/lib/device-path-provider.js +1 -0
  205. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
  206. package/lib/device-sockets/ios/notification.js +3 -0
  207. package/lib/device-sockets/ios/socket-request-executor.js +3 -0
  208. package/lib/helpers/android-bundle-validator-helper.js +2 -1
  209. package/lib/helpers/deploy-command-helper.js +1 -0
  210. package/lib/helpers/key-command-helper.js +4 -2
  211. package/lib/helpers/livesync-command-helper.js +4 -1
  212. package/lib/helpers/network-connectivity-validator.js +1 -0
  213. package/lib/helpers/options-track-helper.js +3 -2
  214. package/lib/helpers/package-path-helper.js +1 -0
  215. package/lib/helpers/platform-command-helper.js +7 -2
  216. package/lib/helpers/version-validator-helper.js +1 -0
  217. package/lib/key-commands/bootstrap.js +3 -2
  218. package/lib/key-commands/index.js +5 -4
  219. package/lib/nativescript-cli-lib-bootstrap.js +4 -0
  220. package/lib/nativescript-cli-lib.js +1 -0
  221. package/lib/nativescript-cli.js +11 -1
  222. package/lib/node/pbxproj-dom-xcode.js +1 -0
  223. package/lib/node/xcode.js +1 -0
  224. package/lib/node-package-manager.js +11 -1
  225. package/lib/options.js +144 -119
  226. package/lib/package-installation-manager.js +8 -1
  227. package/lib/package-manager.js +2 -0
  228. package/lib/platform-command-param.js +1 -0
  229. package/lib/pnpm-package-manager.js +4 -1
  230. package/lib/project-data.js +12 -0
  231. package/lib/providers/project-files-provider.js +1 -0
  232. package/lib/resolvers/livesync-service-resolver.js +1 -0
  233. package/lib/services/analytics/analytics-broker-process.js +10 -6
  234. package/lib/services/analytics/analytics-broker.js +2 -1
  235. package/lib/services/analytics/analytics-service.js +29 -25
  236. package/lib/services/analytics/google-analytics-provider.js +13 -12
  237. package/lib/services/analytics-settings-service.js +5 -0
  238. package/lib/services/android/android-bundle-tool-service.js +1 -0
  239. package/lib/services/android/gradle-build-args-service.js +3 -0
  240. package/lib/services/android/gradle-build-service.js +1 -0
  241. package/lib/services/android/gradle-command-service.js +1 -0
  242. package/lib/services/android-device-debug-service.js +6 -0
  243. package/lib/services/android-plugin-build-service.js +31 -2
  244. package/lib/services/android-project-service.js +71 -4
  245. package/lib/services/android-resources-migration-service.js +7 -0
  246. package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
  247. package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
  248. package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
  249. package/lib/services/apple-portal/srp/srp-wrapper.js +4 -1
  250. package/lib/services/assets-generation/assets-generation-service.js +10 -5
  251. package/lib/services/build-artifacts-service.js +2 -1
  252. package/lib/services/build-data-service.js +1 -0
  253. package/lib/services/build-info-file-service.js +1 -0
  254. package/lib/services/bundler/bundler-compiler-service.js +88 -17
  255. package/lib/services/bundler/bundler.js +1 -0
  256. package/lib/services/cleanup-service.js +13 -9
  257. package/lib/services/cocoapods-platform-manager.js +9 -0
  258. package/lib/services/cocoapods-service.js +21 -1
  259. package/lib/services/debug-data-service.js +1 -0
  260. package/lib/services/debug-service-base.js +7 -0
  261. package/lib/services/device/device-install-app-service.js +2 -1
  262. package/lib/services/doctor-service.js +21 -6
  263. package/lib/services/extensibility-service.js +9 -1
  264. package/lib/services/files-hash-service.js +1 -0
  265. package/lib/services/hmr-status-service.js +2 -0
  266. package/lib/services/info-service.js +1 -0
  267. package/lib/services/initialize-service.js +5 -1
  268. package/lib/services/ios/export-options-plist-service.js +4 -0
  269. package/lib/services/ios/ios-signing-service.js +4 -0
  270. package/lib/services/ios/spm-service.js +11 -0
  271. package/lib/services/ios/xcodebuild-args-service.js +9 -0
  272. package/lib/services/ios/xcodebuild-command-service.js +1 -0
  273. package/lib/services/ios/xcodebuild-service.js +2 -1
  274. package/lib/services/ios-debugger-port-service.js +1 -0
  275. package/lib/services/ios-device-debug-service.js +1 -0
  276. package/lib/services/ios-entitlements-service.js +1 -0
  277. package/lib/services/ios-extensions-service.js +1 -0
  278. package/lib/services/ios-log-filter.js +20 -0
  279. package/lib/services/ios-native-target-service.js +6 -4
  280. package/lib/services/ios-project-service.js +91 -1
  281. package/lib/services/ios-provision-service.js +3 -0
  282. package/lib/services/ios-watch-app-service.js +1 -0
  283. package/lib/services/ip-service.js +2 -0
  284. package/lib/services/itmstransporter-service.js +1 -0
  285. package/lib/services/karma-execution.js +2 -0
  286. package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
  287. package/lib/services/livesync/android-device-livesync-service.js +2 -0
  288. package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
  289. package/lib/services/livesync/android-livesync-service.js +1 -0
  290. package/lib/services/livesync/android-livesync-tool.js +4 -0
  291. package/lib/services/livesync/device-livesync-service-base.js +2 -0
  292. package/lib/services/livesync/ios-device-livesync-service.js +7 -0
  293. package/lib/services/livesync/ios-livesync-service.js +2 -0
  294. package/lib/services/livesync/livesync-socket.js +1 -0
  295. package/lib/services/livesync/platform-livesync-service-base.js +5 -0
  296. package/lib/services/livesync-process-data-service.js +1 -0
  297. package/lib/services/log-parser-service.js +1 -0
  298. package/lib/services/log-source-map-service.js +15 -0
  299. package/lib/services/marking-mode-service.js +8 -5
  300. package/lib/services/metadata-filtering-service.js +1 -0
  301. package/lib/services/npm-config-service.js +4 -0
  302. package/lib/services/pacote-service.js +7 -0
  303. package/lib/services/performance-service.js +3 -1
  304. package/lib/services/platform/add-platform-service.js +49 -2
  305. package/lib/services/platform/platform-validation-service.js +1 -0
  306. package/lib/services/platform/prepare-native-platform-service.js +5 -2
  307. package/lib/services/platform-environment-requirements.js +8 -3
  308. package/lib/services/platform-project-service-base.js +1 -0
  309. package/lib/services/platforms-data-service.js +1 -0
  310. package/lib/services/plugins-service.js +21 -2
  311. package/lib/services/prepare-data-service.js +1 -0
  312. package/lib/services/project-backup-service.js +4 -0
  313. package/lib/services/project-changes-service.js +14 -3
  314. package/lib/services/project-cleanup-service.js +2 -0
  315. package/lib/services/project-config-service.js +21 -2
  316. package/lib/services/project-data-service.js +36 -7
  317. package/lib/services/project-name-service.js +1 -0
  318. package/lib/services/project-service.js +10 -0
  319. package/lib/services/project-templates-service.js +3 -2
  320. package/lib/services/qr-code-terminal-service.js +1 -0
  321. package/lib/services/require-service.js +1 -0
  322. package/lib/services/start-service.js +1 -0
  323. package/lib/services/temp-service.js +3 -0
  324. package/lib/services/terminal-spinner-service.js +2 -0
  325. package/lib/services/test-execution-service.js +9 -2
  326. package/lib/services/test-initialization-service.js +4 -0
  327. package/lib/services/timeline-profiler-service.js +1 -0
  328. package/lib/services/user-settings-service.js +1 -0
  329. package/lib/services/versions-service.js +6 -4
  330. package/lib/services/watch-ignore-list-service.js +1 -0
  331. package/lib/services/xcconfig-service.js +2 -0
  332. package/lib/services/xcproj-service.js +1 -0
  333. package/lib/shared-event-bus.js +6 -0
  334. package/lib/sys-info.js +2 -1
  335. package/lib/tools/config-manipulation/config-transformer.js +12 -0
  336. package/lib/tools/node-modules/node-modules-builder.js +1 -0
  337. package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
  338. package/lib/yarn-package-manager.js +1 -0
  339. package/lib/yarn2-package-manager.js +3 -0
  340. package/package.json +11 -10
  341. package/vendor/aab-tool/README.txt +1 -1
  342. package/vendor/aab-tool/bundletool.jar +0 -0
  343. package/vendor/gradle-plugin/build.gradle +1 -1
@@ -138,7 +138,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
138
138
  ".ico",
139
139
  ".cur",
140
140
  ".xbm",
141
- ],
141
+ ], // https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/
142
142
  };
143
143
  }
144
144
  return this._platformData;
@@ -185,8 +185,11 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
185
185
  this.$fs.ensureDirectoryExists(path.join(this.getPlatformData(projectData).projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER));
186
186
  shell.cp("-R", path.join(frameworkDir, "*"), this.getPlatformData(projectData).projectRoot);
187
187
  }
188
+ //TODO: plamen5kov: revisit this method, might have unnecessary/obsolete logic
188
189
  async interpolateData(projectData) {
189
190
  const projectRootFilePath = path.join(this.getPlatformData(projectData).projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER);
191
+ // Starting with NativeScript for iOS 1.6.0, the project Info.plist file resides not in the platform project,
192
+ // but in the hello-world app template as a platform specific resource.
190
193
  if (this.$fs.exists(path.join(projectRootFilePath, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER + "-Info.plist"))) {
191
194
  this.replaceFileName("-Info.plist", projectRootFilePath, projectData);
192
195
  }
@@ -289,16 +292,32 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
289
292
  frameworkAddOptions["sign"] = true;
290
293
  }
291
294
  if (this.$options.hostProjectPath) {
295
+ // always mark xcframeworks for embedding
292
296
  frameworkAddOptions["embed"] = true;
293
297
  frameworkAddOptions["sign"] = false;
294
298
  }
299
+ // Note: we used to prepend "$(SRCROOT)/" to the framework path, but seems like it's not needed anymore
300
+ // "$(SRCROOT)/" +
295
301
  const frameworkRelativePath = this.getLibSubpathRelativeToProjectPath(frameworkPath, projectData);
296
302
  project.addFramework(frameworkRelativePath, frameworkAddOptions);
303
+ // filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath
304
+ // project.addBuildPhase(
305
+ // [],
306
+ // "PBXShellScriptBuildPhase",
307
+ // "Debug SRCROOT",
308
+ // undefined,
309
+ // {
310
+ // shellPath: "/bin/sh",
311
+ // shellScript: `echo "SRCROOT: $SRCROOT"`,
312
+ // }
313
+ // );
297
314
  this.savePbxProj(project, projectData);
298
315
  }
299
316
  async addStaticLibrary(staticLibPath, projectData) {
317
+ // Copy files to lib folder.
300
318
  const libraryName = path.basename(staticLibPath, ".a");
301
319
  const headersSubpath = path.join(path.dirname(staticLibPath), "include", libraryName);
320
+ // Add static library to project file and setup header search paths
302
321
  const project = this.createPbxProj(projectData);
303
322
  const relativeStaticLibPath = this.getLibSubpathRelativeToProjectPath(staticLibPath, projectData);
304
323
  project.addFramework(relativeStaticLibPath);
@@ -333,10 +352,58 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
333
352
  filesRelativeToProject: true,
334
353
  uuid: "NATIVESCRIPTNATIVESCRIPT",
335
354
  });
355
+ /**
356
+ * 1. Add platforms/ios/{projectname}/app build to the host app
357
+ */
358
+ // Note: allow customization of this targetFolderName
359
+ // const targetFolderName = "app";
336
360
  const buildFolderPath = path.join(this.$options.hostProjectPath, projectData.projectName);
337
361
  project.addResourceFile(buildFolderPath, {}, "NATIVESCRIPTNATIVESCRIPT");
362
+ // filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath
363
+ // project.addBuildPhase(
364
+ // [],
365
+ // "PBXShellScriptBuildPhase",
366
+ // "Copy Metadata (DEBUG)",
367
+ // undefined,
368
+ // {
369
+ // shellPath: "/bin/sh",
370
+ // shellScript: `cp ./platforms/ios/build/Debug-iphonesimulator/metadata-arm64.bin $CONFIGURATION_BUILD_DIR`,
371
+ // outputPaths: [
372
+ // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-arm64.bin"),
373
+ // // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-arm64e.bin"),
374
+ // // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-i386.bin"),
375
+ // // JSON.stringify("$(CONFIGURATION_BUILD_DIR)/metadata-x86_64.bin"),
376
+ // ],
377
+ // }
378
+ // );
338
379
  const metadataPath = path.relative(this.$options.hostProjectPath, buildFolderPath);
339
380
  project.addToOtherLinkerFlags(JSON.stringify(`-sectcreate __DATA __TNSMetadata "${metadataPath}/metadata-arm64.bin"`));
381
+ // // no shorthand way to get UUID of build phase that i can tell
382
+ // // methods return the phase as an object but ommitted the actual key (uuid we need)
383
+ // // this does it same way nativescript-dev-xcode does but gets the uuid we need
384
+ // const resourcesBuildPhaseKeys = Object.keys(
385
+ // project.hash.project.objects["PBXResourcesBuildPhase"]
386
+ // );
387
+ // // console.log('resourcesBuildPhaseKeys:', resourcesBuildPhaseKeys);
388
+ // const buildPhaseUUID = resourcesBuildPhaseKeys[0];
389
+ // const comment = `${targetFolderName} in Resources`;
390
+ // project.hash.project.objects["PBXResourcesBuildPhase"][
391
+ // buildPhaseUUID
392
+ // ].files.forEach((f: any) => {
393
+ // console.log(f);
394
+ // });
395
+ // if (
396
+ // !project.hash.project.objects["PBXResourcesBuildPhase"][
397
+ // buildPhaseUUID
398
+ // ].files.find((f: any) => f.comment === comment)
399
+ // ) {
400
+ // project.addResourceFile(buildFolderPath, {}, buildPhaseUUID);
401
+ // }
402
+ /**
403
+ * 2. Ensure metadata is copied as a file
404
+ * The apps metadata-{arch}.bin should be added as a file reference.
405
+ */
406
+ // TODO
340
407
  this.savePbxProj(project, projectData);
341
408
  }
342
409
  catch (err) {
@@ -389,10 +456,12 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
389
456
  this.$fs.deleteDirectory(platformsAppResourcesPath);
390
457
  this.$fs.ensureDirectoryExists(platformsAppResourcesPath);
391
458
  const platformAppResourcesPath = path.join(projectAppResourcesPath, platformData.normalizedPlatformName);
459
+ // this allows App_Resources/visionOS
392
460
  if (this.$fs.exists(platformAppResourcesPath)) {
393
461
  this.$fs.copyFile(path.join(platformAppResourcesPath, "*"), platformsAppResourcesPath);
394
462
  }
395
463
  else {
464
+ // otherwise falls back to App_Resources/iOS
396
465
  this.$fs.copyFile(path.join(projectAppResourcesPath, this.$devicePlatformsConstants.iOS, "*"), platformsAppResourcesPath);
397
466
  }
398
467
  this.$fs.deleteFile(path.join(platformsAppResourcesPath, platformData.configurationFileName));
@@ -491,6 +560,12 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
491
560
  getLibSubpathRelativeToProjectPath(targetPath, projectData) {
492
561
  const projectRoot = this.getPlatformData(projectData).projectRoot;
493
562
  const frameworkPath = path.relative(projectRoot, targetPath);
563
+ // console.log({
564
+ // targetPath,
565
+ // projectRoot,
566
+ // frameworkPath,
567
+ // resolved: path.resolve(projectRoot, frameworkPath),
568
+ // });
494
569
  return frameworkPath;
495
570
  }
496
571
  getPbxProjPath(projectData) {
@@ -538,6 +613,10 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
538
613
  const projectPodfilePath = this.$cocoapodsService.getProjectPodfilePath(platformData.projectRoot);
539
614
  if (this.$fs.exists(projectPodfilePath)) {
540
615
  await this.$cocoapodsService.executePodInstall(platformData.projectRoot, this.$xcprojService.getXcodeprojPath(projectData, platformData.projectRoot));
616
+ // The `pod install` command adds a new target to the .pbxproject. This target adds additional build phases to Xcode project.
617
+ // Some of these phases relies on env variables (like PODS_PODFILE_DIR_PATH or PODS_ROOT).
618
+ // These variables are produced from merge of pod's xcconfig file and project's xcconfig file.
619
+ // So the correct order is `pod install` to be executed before merging pod's xcconfig file.
541
620
  await this.$cocoapodsService.mergePodXcconfigFile(projectData, platformData, opts);
542
621
  }
543
622
  const pluginSpmPackages = [];
@@ -563,6 +642,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
563
642
  const hasProvision = provision !== undefined;
564
643
  const hasTeamId = teamId !== undefined;
565
644
  if (hasProvision || hasTeamId) {
645
+ // Check if the native project's signing is set to the provided provision...
566
646
  const pbxprojPath = this.getPbxProjPath(projectData);
567
647
  if (this.$fs.exists(pbxprojPath)) {
568
648
  const xcode = this.$pbxprojDomXcode.Xcode.open(pbxprojPath);
@@ -578,6 +658,9 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
578
658
  }
579
659
  }
580
660
  else {
661
+ // Specifying provisioning profile requires "Manual" signing style.
662
+ // If the current signing style was not "Manual" it was probably "Automatic" or,
663
+ // it was not uniform for the debug and release build configurations.
581
664
  changesInfo.signingChanged = true;
582
665
  }
583
666
  }
@@ -591,6 +674,8 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
591
674
  }
592
675
  }
593
676
  else {
677
+ // Specifying team id or name requires "Automatic" signing style.
678
+ // If the current signing style was not "Automatic" it was probably "Manual".
594
679
  changesInfo.signingChanged = true;
595
680
  }
596
681
  }
@@ -807,10 +892,14 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
807
892
  }
808
893
  for (const pluginsXcconfigFilePath of pluginsXcconfigFilePaths) {
809
894
  if (!this.$fs.exists(pluginsXcconfigFilePath)) {
895
+ // We need the pluginsXcconfig file to exist in platforms dir as it is required in the native template:
896
+ // https://github.com/NativeScript/ios-runtime/blob/9c2b7b5f70b9bee8452b7a24aa6b646214c7d2be/build/project-template/__PROJECT_NAME__/build-debug.xcconfig#L3
897
+ // From Xcode 10 in case the file is missing, this include fails and the build itself fails (was a warning in previous Xcode versions).
810
898
  this.$fs.writeFile(pluginsXcconfigFilePath, "");
811
899
  }
812
900
  }
813
901
  for (const pluginsXcconfigFilePath of pluginsXcconfigFilePaths) {
902
+ // Set Entitlements Property to point to default file if not set explicitly by the user.
814
903
  const entitlementsPropertyValue = this.$xcconfigService.readPropertyValue(pluginsXcconfigFilePath, constants.CODE_SIGN_ENTITLEMENTS);
815
904
  if (entitlementsPropertyValue === null &&
816
905
  this.$fs.exists(this.$iOSEntitlementsService.getPlatformsEntitlementsPath(projectData))) {
@@ -855,3 +944,4 @@ __decorate([
855
944
  (0, helpers_2.hook)("buildIOS")
856
945
  ], IOSProjectService.prototype, "buildProject", null);
857
946
  yok_1.injector.register("iOSProjectService", IOSProjectService);
947
+ //# 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
@@ -63,3 +63,4 @@ exports.IOSWatchAppService = IOSWatchAppService;
63
63
  IOSWatchAppService.WATCH_APP_IDENTIFIER = "watchkitapp";
64
64
  IOSWatchAppService.WACTCH_EXTENSION_IDENTIFIER = "watchkitextension";
65
65
  yok_1.injector.register("iOSWatchAppService", IOSWatchAppService);
66
+ //# sourceMappingURL=ios-watch-app-service.js.map
@@ -38,6 +38,7 @@ class IPService {
38
38
  return ipAddress;
39
39
  }
40
40
  async getIPAddressFromIpifyOrgAPI() {
41
+ // https://www.ipify.org/
41
42
  const ipifyOrgAPIEndpoint = "https://api.ipify.org";
42
43
  let ipAddress = null;
43
44
  try {
@@ -61,3 +62,4 @@ __decorate([
61
62
  (0, decorators_1.cache)()
62
63
  ], IPService.prototype, "getCurrentIPv4Address", null);
63
64
  yok_1.injector.register("ipService", IPService);
65
+ //# sourceMappingURL=ip-service.js.map
@@ -191,3 +191,4 @@ __decorate([
191
191
  (0, decorators_1.cache)()
192
192
  ], ITMSTransporterService.prototype, "getITMSTransporterPath", null);
193
193
  yok_1.injector.register("itmsTransporterService", ITMSTransporterService);
194
+ //# sourceMappingURL=itmstransporter-service.js.map
@@ -9,8 +9,10 @@ process.on("message", (data) => {
9
9
  });
10
10
  const KarmaServer = require(path.join(pathToKarma, "lib/server"));
11
11
  const karma = new KarmaServer(data.karmaConfig, (exitCode) => {
12
+ // Exit with the correct exit code and signal the manager process.
12
13
  process.exit(exitCode);
13
14
  });
14
15
  karma.start();
15
16
  }
16
17
  });
18
+ //# sourceMappingURL=karma-execution.js.map
@@ -49,3 +49,4 @@ class AndroidDeviceLiveSyncServiceBase extends device_livesync_service_base_1.De
49
49
  }
50
50
  }
51
51
  exports.AndroidDeviceLiveSyncServiceBase = AndroidDeviceLiveSyncServiceBase;
52
+ //# sourceMappingURL=android-device-livesync-service-base.js.map
@@ -97,6 +97,7 @@ class AndroidDeviceLiveSyncService extends android_device_livesync_service_base_
97
97
  ]);
98
98
  const regex = new RegExp(`^-.*${deviceRootBasename}$`, "m");
99
99
  const matchingFile = (listResult || "").match(regex);
100
+ // Check if there is already a file with deviceRootBasename. If so, delete it as it breaks LiveSyncing.
100
101
  if (matchingFile && matchingFile[0] && _.startsWith(matchingFile[0], "-")) {
101
102
  await this.device.adb.executeShellCommand(["rm", "-f", deviceRootPath]);
102
103
  }
@@ -172,3 +173,4 @@ __decorate([
172
173
  __decorate([
173
174
  (0, decorators_1.performanceLog)()
174
175
  ], AndroidDeviceLiveSyncService.prototype, "removeFiles", null);
176
+ //# sourceMappingURL=android-device-livesync-service.js.map
@@ -95,6 +95,8 @@ class AndroidDeviceSocketsLiveSyncService extends android_device_livesync_servic
95
95
  await this.$cleanupService.removeCleanupCommand(cleanupCommand);
96
96
  };
97
97
  await this.$cleanupService.addCleanupCommand(cleanupCommand);
98
+ // We need to clear resources when the action fails
99
+ // But we also need the real result of the action.
98
100
  await doSyncPromise.then(actionOnEnd.bind(this), actionOnEnd.bind(this));
99
101
  result = await doSyncPromise;
100
102
  }
@@ -164,3 +166,4 @@ class AndroidDeviceSocketsLiveSyncService extends android_device_livesync_servic
164
166
  exports.AndroidDeviceSocketsLiveSyncService = AndroidDeviceSocketsLiveSyncService;
165
167
  AndroidDeviceSocketsLiveSyncService.STATUS_UPDATE_INTERVAL = 10000;
166
168
  AndroidDeviceSocketsLiveSyncService.MINIMAL_VERSION_LONG_LIVING_CONNECTION = "0.2.0";
169
+ //# sourceMappingURL=android-device-livesync-sockets-service.js.map
@@ -53,3 +53,4 @@ __decorate([
53
53
  (0, decorators_1.performanceLog)()
54
54
  ], AndroidLiveSyncService.prototype, "fullSync", null);
55
55
  yok_1.injector.register("androidLiveSyncService", AndroidLiveSyncService);
56
+ //# sourceMappingURL=android-livesync-service.js.map
@@ -140,9 +140,12 @@ class AndroidLivesyncTool {
140
140
  error =
141
141
  error ||
142
142
  this.getErrorWithMessage("Socket connection ended before sync operation is complete.");
143
+ //remove listeners and delete this.socketConnection
143
144
  this.cleanState(socketUid);
145
+ //call end of the connection (close and error callbacks won't be called - listeners removed)
144
146
  socket.end();
145
147
  socket.destroy();
148
+ //reject all pending sync requests and clear timeouts
146
149
  this.rejectPendingSyncOperations(socketUid, error);
147
150
  }
148
151
  }
@@ -404,3 +407,4 @@ AndroidLivesyncTool.SOCKET_CONNECTION_ALREADY_EXISTS_ERROR = "Socket connection
404
407
  AndroidLivesyncTool.SOCKET_CONNECTION_TIMED_OUT_ERROR = "Socket connection timed out.";
405
408
  AndroidLivesyncTool.NO_SOCKET_CONNECTION_AVAILABLE_ERROR = "No socket connection available.";
406
409
  yok_1.injector.register("androidLivesyncTool", AndroidLivesyncTool);
410
+ //# sourceMappingURL=android-livesync-tool.js.map
@@ -40,6 +40,7 @@ class DeviceLiveSyncServiceBase {
40
40
  return transferredFiles;
41
41
  }
42
42
  async finalizeSync(liveSyncInfo, projectData) {
43
+ //implement in case a sync point for all remove/create operation is needed
43
44
  return {
44
45
  didRefresh: true,
45
46
  operationId: "",
@@ -54,3 +55,4 @@ __decorate([
54
55
  __decorate([
55
56
  (0, decorators_2.performanceLog)()
56
57
  ], DeviceLiveSyncServiceBase.prototype, "transferFiles", null);
58
+ //# sourceMappingURL=device-livesync-service-base.js.map
@@ -37,11 +37,13 @@ class IOSDeviceLiveSyncService extends device_livesync_service_base_1.DeviceLive
37
37
  return canRefresh;
38
38
  }
39
39
  async setupSocketIfNeeded(projectData) {
40
+ // TODO: persist the sockets per app in order to support LiveSync on multiple apps on the same device
40
41
  if (this.socket) {
41
42
  return true;
42
43
  }
43
44
  const appId = projectData.projectIdentifiers.ios;
44
45
  try {
46
+ // TODO: temp workaround till we setup the sockets along with the app start
45
47
  const ensureAppStarted = true;
46
48
  this.socket = await this.device.getDebugSocket(appId, projectData.projectName, projectData.projectDir, ensureAppStarted);
47
49
  }
@@ -121,6 +123,7 @@ class IOSDeviceLiveSyncService extends device_livesync_service_base_1.DeviceLive
121
123
  projectDir: projectData.projectDir,
122
124
  });
123
125
  if (liveSyncInfo.useHotModuleReload) {
126
+ // enable HOT updates
124
127
  await this.setupSocketIfNeeded(projectData);
125
128
  }
126
129
  }
@@ -177,6 +180,9 @@ class IOSDeviceLiveSyncService extends device_livesync_service_base_1.DeviceLive
177
180
  }
178
181
  async destroySocket() {
179
182
  if (this.socket) {
183
+ // we do not support LiveSync on multiple apps on the same device
184
+ // in order to do that, we should cache the socket per app
185
+ // and destroy just the current app socket when possible
180
186
  await this.device.destroyAllSockets();
181
187
  this.socket = null;
182
188
  }
@@ -187,3 +193,4 @@ IOSDeviceLiveSyncService.MIN_RUNTIME_VERSION_WITH_REFRESH_NOTIFICATION = "6.1.0"
187
193
  __decorate([
188
194
  (0, decorators_1.performanceLog)()
189
195
  ], IOSDeviceLiveSyncService.prototype, "removeFiles", null);
196
+ //# sourceMappingURL=ios-device-livesync-service.js.map
@@ -58,6 +58,7 @@ class IOSLiveSyncService extends platform_livesync_service_base_1.PlatformLiveSy
58
58
  }
59
59
  async syncAfterInstall(device, liveSyncInfo) {
60
60
  if (!device.isEmulator) {
61
+ // In this case we should execute fullsync because iOS Runtime requires the full content of app dir to be extracted in the root of sync dir.
61
62
  await this.fullSync({
62
63
  projectData: liveSyncInfo.projectData,
63
64
  device,
@@ -77,3 +78,4 @@ __decorate([
77
78
  (0, decorators_1.performanceLog)()
78
79
  ], IOSLiveSyncService.prototype, "fullSync", null);
79
80
  yok_1.injector.register("iOSLiveSyncService", IOSLiveSyncService);
81
+ //# sourceMappingURL=ios-livesync-service.js.map
@@ -12,3 +12,4 @@ class LiveSyncSocket extends net.Socket {
12
12
  }
13
13
  exports.LiveSyncSocket = LiveSyncSocket;
14
14
  yok_1.injector.register("LiveSyncSocket", LiveSyncSocket, false);
15
+ //# sourceMappingURL=livesync-socket.js.map
@@ -40,6 +40,7 @@ class PlatformLiveSyncServiceBase {
40
40
  return shouldRestart;
41
41
  }
42
42
  async syncAfterInstall(device, liveSyncInfo) {
43
+ /* intentionally left blank */
43
44
  }
44
45
  async restartApplication(projectData, liveSyncInfo) {
45
46
  const deviceLiveSyncService = this.getDeviceLiveSyncService(liveSyncInfo.deviceAppData.device, projectData);
@@ -85,6 +86,8 @@ class PlatformLiveSyncServiceBase {
85
86
  let modifiedLocalToDevicePaths = [];
86
87
  if (liveSyncInfo.filesToSync.length) {
87
88
  const filesToSync = liveSyncInfo.filesToSync;
89
+ // const mappedFiles = _.map(filesToSync, filePath => this.$projectFilesProvider.mapFilePath(filePath, device.deviceInfo.platform, projectData));
90
+ // Some plugins modify platforms dir on afterPrepare (check nativescript-dev-sass) - we want to sync only existing file.
88
91
  const existingFiles = filesToSync.filter((m) => m && this.$fs.exists(m));
89
92
  this.$logger.trace("Will execute livesync for files: ", existingFiles);
90
93
  const skippedFiles = _.difference(filesToSync, existingFiles);
@@ -103,6 +106,7 @@ class PlatformLiveSyncServiceBase {
103
106
  const filePaths = liveSyncInfo.filesToRemove;
104
107
  const platformData = this.$platformsDataService.getPlatformData(device.deviceInfo.platform, projectData);
105
108
  const mappedFiles = _(filePaths)
109
+ // .map(filePath => this.$projectFilesProvider.mapFilePath(filePath, device.deviceInfo.platform, projectData))
106
110
  .filter((filePath) => !!filePath)
107
111
  .value();
108
112
  const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, constants_1.APP_FOLDER_NAME);
@@ -154,3 +158,4 @@ exports.PlatformLiveSyncServiceBase = PlatformLiveSyncServiceBase;
154
158
  __decorate([
155
159
  (0, decorators_1.performanceLog)()
156
160
  ], PlatformLiveSyncServiceBase.prototype, "liveSyncWatchAction", null);
161
+ //# sourceMappingURL=platform-livesync-service-base.js.map
@@ -41,3 +41,4 @@ class LiveSyncProcessDataService {
41
41
  }
42
42
  exports.LiveSyncProcessDataService = LiveSyncProcessDataService;
43
43
  yok_1.injector.register("liveSyncProcessDataService", LiveSyncProcessDataService);
44
+ //# sourceMappingURL=livesync-process-data-service.js.map
@@ -50,3 +50,4 @@ __decorate([
50
50
  (0, decorators_1.cache)()
51
51
  ], LogParserService.prototype, "startParsingLogCore", null);
52
52
  yok_1.injector.register("logParserService", LogParserService);
53
+ //# sourceMappingURL=log-parser-service.js.map
@@ -31,6 +31,7 @@ class LogSourceMapService {
31
31
  if (!this.$fs.getFsStats(filePath).isDirectory()) {
32
32
  const mapFile = filePath + ".map";
33
33
  let sourceMapRaw;
34
+ // Skip files bigger than 50MB
34
35
  if (this.$fs.getFileSize(filePath) > 50 * 1000 * 1000) {
35
36
  this.$logger.trace(`Skipping source map for file ${filePath} because it is too big (> 50MB).`);
36
37
  return;
@@ -155,6 +156,8 @@ class LogSourceMapService {
155
156
  }
156
157
  }
157
158
  parseAndroidLog(projectData, rawMessage) {
159
+ // "JS: at module.exports.push../main-view-model.ts.HelloWorldModel.onTap (file:///data/data/org.nativescript.sourceMap/files/app/bundle.js:303:17)"
160
+ // "System.err: File: "file:///data/data/org.nativescript.sourceMap/files/app/bundle.js, line: 304, column: 8"
158
161
  const fileIndex = rawMessage.lastIndexOf(LogSourceMapService.FILE_PREFIX);
159
162
  const deviceProjectPath = util.format(constants_1.ANDROID_DEVICE_APP_ROOT_TEMPLATE, projectData.projectIdentifiers.android);
160
163
  let separator = ",";
@@ -162,18 +165,25 @@ class LogSourceMapService {
162
165
  let parts, filePath, line, column, messagePrefix;
163
166
  if (fileIndex >= 0) {
164
167
  const fileSubstring = rawMessage.substring(fileIndex + LogSourceMapService.FILE_PREFIX.length);
168
+ //"data/data/org.nativescript.sourceMap/files/app/bundle.js, line: 304, column: 8"
165
169
  parts = fileSubstring.split(separator);
166
170
  if (parts.length >= 3) {
171
+ // "data/data/org.nativescript.sourceMap/files/app/bundle.js"
167
172
  parts[0] = parts[0].replace("'", "");
173
+ // " line: 304"
168
174
  parts[1] = parts[1].replace(" line: ", "");
175
+ // " column: 8"
169
176
  parts[2] = parts[2].replace(" column: ", "");
170
177
  }
171
178
  else {
179
+ // "data/data/org.nativescript.sourceMap/files/app/bundle.js:303:17)"
172
180
  separator = ":";
173
181
  parts = fileSubstring.split(separator);
174
182
  }
175
183
  if (parts.length >= 3) {
184
+ // "/data/data/org.nativescript.sourceMap/files/app/"
176
185
  const devicePath = `${deviceProjectPath}/${constants_1.APP_FOLDER_NAME}/`;
186
+ // "bundle.js"
177
187
  filePath = path.relative(devicePath, `${"/"}${parts[0]}`);
178
188
  line = parseInt(parts[1]);
179
189
  column = parseInt(parts[2]);
@@ -181,20 +191,24 @@ class LogSourceMapService {
181
191
  for (let i = 3; i < parts.length; i++) {
182
192
  messageSuffix += `${parts[i]}${i === parts.length - 1 ? "" : separator}`;
183
193
  }
194
+ // "JS: at module.exports.push../main-view-model.ts.HelloWorldModel.onTap ("
184
195
  messagePrefix = _.trimEnd(messagePrefix, "(");
185
196
  }
186
197
  }
187
198
  return { filePath, line, column, messagePrefix, messageSuffix };
188
199
  }
189
200
  parseIosLog(rawMessage) {
201
+ // "CONSOLE INFO file:///app/vendor.js:131:36: HMR: Hot Module Replacement Enabled. Waiting for signal."
190
202
  const fileIndex = rawMessage.lastIndexOf(LogSourceMapService.FILE_PREFIX);
191
203
  let messageSuffix = "";
192
204
  let parts, filePath, line, column, messagePrefix;
193
205
  if (fileIndex >= 0) {
206
+ // "app/vendor.js:131:36: HMR: Hot Module Replacement Enabled. Waiting for signal."
194
207
  const fileSubstring = rawMessage.substring(fileIndex + LogSourceMapService.FILE_PREFIX.length);
195
208
  parts = fileSubstring.split(":");
196
209
  if (parts && parts.length >= 3) {
197
210
  filePath = parts[0];
211
+ // "app/vendor.js"
198
212
  if (_.startsWith(filePath, constants_1.APP_FOLDER_NAME)) {
199
213
  filePath = path.relative(constants_1.APP_FOLDER_NAME, parts[0]);
200
214
  }
@@ -223,3 +237,4 @@ LogSourceMapService.FILE_PREFIX = "file:///";
223
237
  LogSourceMapService.FILE_PREFIX_REPLACEMENT = "file: ";
224
238
  LogSourceMapService.MEMOIZE_FUNCTION_RANDOM_KEY_FOR_JOIN = "__some_random_value__";
225
239
  yok_1.injector.register("logSourceMapService", LogSourceMapService);
240
+ //# sourceMappingURL=log-source-map-service.js.map
@@ -6,7 +6,7 @@ const constants_1 = require("../constants");
6
6
  const yok_1 = require("../common/yok");
7
7
  const semver = require("semver/preload");
8
8
  const MARKING_MODE_PROP = "markingMode";
9
- const MARKING_MODE_FULL_DEPRECATION_MSG = `In the current version of NativeScript "${MARKING_MODE_PROP}:${"full"}" is no longer supported.`;
9
+ const MARKING_MODE_FULL_DEPRECATION_MSG = `In the current version of NativeScript "${MARKING_MODE_PROP}:${"full" /* MarkingMode.Full */}" is no longer supported.`;
10
10
  class MarkingModeService {
11
11
  constructor($logger, $projectConfigService, $projectHelper, $projectDataService) {
12
12
  this.$logger = $logger;
@@ -18,11 +18,13 @@ class MarkingModeService {
18
18
  const markingModeValue = this.$projectConfigService.getValue("android.markingMode");
19
19
  const { skipWarnings, forceSwitch } = options;
20
20
  if (forceSwitch) {
21
- await this.setMarkingMode("none");
21
+ await this.setMarkingMode("none" /* MarkingMode.None */);
22
22
  return;
23
23
  }
24
- if (!skipWarnings && (markingModeValue === null || markingModeValue === void 0 ? void 0 : markingModeValue.toLowerCase()) !== "none") {
25
- const { version } = this.$projectDataService.getRuntimePackage(this.$projectHelper.projectDir, "android");
24
+ if (!skipWarnings && (markingModeValue === null || markingModeValue === void 0 ? void 0 : markingModeValue.toLowerCase()) !== "none" /* MarkingMode.None */) {
25
+ // only warn if runtime is less than 7.0.0-rc.5 - where the default has been changed to None
26
+ // if version is null - we are about to add the latest runtime, so no need to warn
27
+ const { version } = this.$projectDataService.getRuntimePackage(this.$projectHelper.projectDir, "android" /* PlatformTypes.android */);
26
28
  const isMarkingModeFullDefault = version && semver.lt(semver.coerce(version), "7.0.0-rc.5");
27
29
  if (isMarkingModeFullDefault) {
28
30
  this.showMarkingModeFullWarning();
@@ -33,7 +35,7 @@ class MarkingModeService {
33
35
  await this.$projectConfigService.setValue("android.markingMode", newMode);
34
36
  }
35
37
  showMarkingModeFullWarning() {
36
- const markingModeFullWarning = `You are using the deprecated "${MARKING_MODE_PROP}:${"full"}".${os_1.EOL}${os_1.EOL}${MARKING_MODE_FULL_DEPRECATION_MSG}${os_1.EOL}${os_1.EOL}You should update your marking mode by executing 'ns update --markingMode'.`;
38
+ const markingModeFullWarning = `You are using the deprecated "${MARKING_MODE_PROP}:${"full" /* MarkingMode.Full */}".${os_1.EOL}${os_1.EOL}${MARKING_MODE_FULL_DEPRECATION_MSG}${os_1.EOL}${os_1.EOL}You should update your marking mode by executing 'ns update --markingMode'.`;
37
39
  this.$logger.warn(markingModeFullWarning, {
38
40
  [constants_1.LoggerConfigData.wrapMessageWithBorders]: true,
39
41
  });
@@ -41,3 +43,4 @@ class MarkingModeService {
41
43
  }
42
44
  exports.MarkingModeService = MarkingModeService;
43
45
  yok_1.injector.register("markingModeService", MarkingModeService);
46
+ //# sourceMappingURL=marking-mode-service.js.map
@@ -103,3 +103,4 @@ class MetadataFilteringService {
103
103
  }
104
104
  exports.MetadataFilteringService = MetadataFilteringService;
105
105
  yok_1.injector.register("metadataFilteringService", MetadataFilteringService);
106
+ //# sourceMappingURL=metadata-filtering-service.js.map
@@ -21,8 +21,11 @@ class NpmConfigService {
21
21
  readConfig() {
22
22
  try {
23
23
  const res = (0, child_process_1.execSync)("npm config list --json --global");
24
+ // const data: any = npmconfig.read();
24
25
  const data = JSON.parse(res.toString());
26
+ // todo: remove if not needed with npm config list --json?
25
27
  Object.entries(data).forEach(([key, value]) => {
28
+ // replace env ${VARS} in strings with the process.env value
26
29
  this.config[key] =
27
30
  typeof value !== "string"
28
31
  ? value
@@ -37,3 +40,4 @@ __decorate([
37
40
  (0, decorators_1.cache)()
38
41
  ], NpmConfigService.prototype, "readConfig", null);
39
42
  yok_1.injector.register("npmConfigService", NpmConfigService);
43
+ //# sourceMappingURL=npm-config-service.js.map
@@ -24,6 +24,7 @@ class PacoteService {
24
24
  this.$proxyService = $proxyService;
25
25
  }
26
26
  get $packageManager() {
27
+ // need to be resolved here due to cyclic dependency
27
28
  return this.$injector.resolve("packageManager");
28
29
  }
29
30
  async manifest(packageName, options) {
@@ -39,6 +40,8 @@ class PacoteService {
39
40
  return result;
40
41
  }
41
42
  async extractPackage(packageName, destinationDirectory, options) {
43
+ // strip: Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. More info: https://github.com/npm/node-tar/blob/e89c4d37519b1c20133a9f49d5f6b85fa34c203b/README.md
44
+ // C: Create an archive
42
45
  this.$logger.trace(`Calling pacoteService.extractPackage for packageName: '${packageName}', destinationDir: '${destinationDirectory}' and options: ${options}`);
43
46
  const extractOptions = { strip: 1, C: destinationDirectory };
44
47
  if (options) {
@@ -56,6 +59,7 @@ class PacoteService {
56
59
  });
57
60
  this.$logger.trace(`Creating extract tar stream with options: ${JSON.stringify(extractOptions, null, 2)}`);
58
61
  const destination = tar.x(extractOptions);
62
+ // Initiate the source
59
63
  const sourceStream = new stream_1.PassThrough();
60
64
  sourceStream.end(source);
61
65
  sourceStream.pipe(destination);
@@ -70,7 +74,9 @@ class PacoteService {
70
74
  });
71
75
  }
72
76
  async getPacoteBaseOptions() {
77
+ // In case `ns create myapp --template https://github.com/NativeScript/template-hello-world.git` command is executed, pacote module throws an error if cache option is not provided.
73
78
  const cachePath = await this.$packageManager.getCachePath();
79
+ // Add NPM Configuration to our Manifest options
74
80
  const npmConfig = this.$npmConfigService.getConfig();
75
81
  const pacoteOptions = _.extend(npmConfig, { cache: cachePath, Arborist: arborist_1.Arborist });
76
82
  const proxySettings = await this.$proxyService.getCache();
@@ -92,3 +98,4 @@ __decorate([
92
98
  (0, decorators_1.cache)()
93
99
  ], PacoteService.prototype, "$packageManager", null);
94
100
  yok_1.injector.register("pacoteService", PacoteService);
101
+ //# sourceMappingURL=pacote-service.js.map
@@ -41,7 +41,7 @@ class PerformanceService {
41
41
  trackAnalyticsData(methodInfo, executionTime) {
42
42
  this.$analyticsService
43
43
  .trackEventActionInGoogleAnalytics({
44
- action: "Performance",
44
+ action: "Performance" /* TrackActionNames.Performance */,
45
45
  additionalData: methodInfo,
46
46
  value: executionTime,
47
47
  })
@@ -71,6 +71,7 @@ class PerformanceService {
71
71
  this.$logger.info(PerformanceService.LOG_MESSAGE_TEMPLATE, methodInfo, executionTime);
72
72
  }
73
73
  }
74
+ //removes any injected members of the arguments and excludes the options object even if it was renamed
74
75
  getJsonSanitizer() {
75
76
  const seen = new WeakSet();
76
77
  seen.add(this.$options);
@@ -90,3 +91,4 @@ PerformanceService.LOG_MESSAGE_TEMPLATE = `Execution of method "%s" took %s ms.`
90
91
  PerformanceService.FAIL_LOG_MESSAGE_TEMPLATE = `Failed to log pefromance data in file for method %s.`;
91
92
  PerformanceService.MIN_NODE_PERFORMANCE_MODULE_VERSION = "8.5.0";
92
93
  yok_1.injector.register("performanceService", PerformanceService);
94
+ //# sourceMappingURL=performance-service.js.map