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
package/lib/options.js CHANGED
@@ -14,6 +14,7 @@ class Options {
14
14
  this.setArgv();
15
15
  }
16
16
  this.argv.bundle = "webpack";
17
+ // Check if the user has explicitly provide --hmr and --release options from command line
17
18
  if (this.initialArgv.release && this.initialArgv.hmr) {
18
19
  this.$errors.fail("The options --release and --hmr cannot be used simultaneously.");
19
20
  }
@@ -21,6 +22,8 @@ class Options {
21
22
  this.argv.hmr = !this.argv.release;
22
23
  }
23
24
  if (this.argv.debugBrk) {
25
+ // we cannot use HMR along with debug-brk because we have to restart the app
26
+ // on each livesync in order to stop and allow debugging on app start
24
27
  this.argv.hmr = false;
25
28
  }
26
29
  if (this.argv.justlaunch) {
@@ -38,17 +41,18 @@ class Options {
38
41
  "timeout",
39
42
  "_",
40
43
  "$0",
41
- ];
44
+ ]; // These options shouldn't be validated
42
45
  this.globalOptions = {
43
- log: { type: "string", hasSensitiveValue: false },
44
- verbose: { type: "boolean", hasSensitiveValue: false },
45
- version: { type: "boolean", alias: "v", hasSensitiveValue: false },
46
- help: { type: "boolean", alias: "h", hasSensitiveValue: false },
47
- profileDir: { type: "string", hasSensitiveValue: true },
48
- analyticsClient: { type: "string", hasSensitiveValue: false },
49
- path: { type: "string", alias: "p", hasSensitiveValue: true },
50
- config: { type: "string", alias: "c", hasSensitiveValue: true },
51
- _: { type: "string", hasSensitiveValue: false },
46
+ log: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
47
+ verbose: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
48
+ version: { type: "boolean" /* OptionType.Boolean */, alias: "v", hasSensitiveValue: false },
49
+ help: { type: "boolean" /* OptionType.Boolean */, alias: "h", hasSensitiveValue: false },
50
+ profileDir: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
51
+ analyticsClient: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
52
+ path: { type: "string" /* OptionType.String */, alias: "p", hasSensitiveValue: true },
53
+ config: { type: "string" /* OptionType.String */, alias: "c", hasSensitiveValue: true },
54
+ // This will parse all non-hyphenated values as strings.
55
+ _: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
52
56
  };
53
57
  this.options = _.extend({}, this.commonOptions, this.globalOptions);
54
58
  this.setArgv();
@@ -64,163 +68,164 @@ class Options {
64
68
  }
65
69
  get commonOptions() {
66
70
  return {
67
- ipa: { type: "string", hasSensitiveValue: true },
68
- frameworkPath: { type: "string", hasSensitiveValue: true },
69
- frameworkName: { type: "string", hasSensitiveValue: false },
70
- framework: { type: "string", hasSensitiveValue: false },
71
- frameworkVersion: { type: "string", hasSensitiveValue: false },
72
- forDevice: { type: "boolean", hasSensitiveValue: false },
71
+ ipa: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
72
+ frameworkPath: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
73
+ frameworkName: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
74
+ framework: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
75
+ frameworkVersion: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
76
+ forDevice: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
73
77
  iCloudContainerEnvironment: {
74
- type: "string",
78
+ type: "string" /* OptionType.String */,
75
79
  hasSensitiveValue: false,
76
80
  },
77
- provision: { type: "object", hasSensitiveValue: true },
81
+ provision: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
78
82
  client: {
79
- type: "boolean",
83
+ type: "boolean" /* OptionType.Boolean */,
80
84
  default: true,
81
85
  hasSensitiveValue: false,
82
86
  },
83
- env: { type: "object", hasSensitiveValue: false },
84
- production: { type: "boolean", hasSensitiveValue: false },
85
- debugTransport: { type: "boolean", hasSensitiveValue: false },
86
- keyStorePath: { type: "string", hasSensitiveValue: true },
87
- keyStorePassword: { type: "string", hasSensitiveValue: true },
88
- keyStoreAlias: { type: "string", hasSensitiveValue: true },
87
+ env: { type: "object" /* OptionType.Object */, hasSensitiveValue: false },
88
+ production: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
89
+ debugTransport: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
90
+ keyStorePath: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
91
+ keyStorePassword: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
92
+ keyStoreAlias: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
89
93
  keyStoreAliasPassword: {
90
- type: "string",
94
+ type: "string" /* OptionType.String */,
91
95
  hasSensitiveValue: true,
92
96
  },
93
- ignoreScripts: { type: "boolean", hasSensitiveValue: false },
94
- disableNpmInstall: { type: "boolean", hasSensitiveValue: false },
95
- compileSdk: { type: "number", hasSensitiveValue: false },
96
- port: { type: "number", hasSensitiveValue: false },
97
- copyTo: { type: "string", hasSensitiveValue: true },
98
- js: { type: "boolean", hasSensitiveValue: false },
99
- javascript: { type: "boolean", hasSensitiveValue: false },
100
- ng: { type: "boolean", hasSensitiveValue: false },
101
- angular: { type: "boolean", hasSensitiveValue: false },
102
- react: { type: "boolean", hasSensitiveValue: false },
103
- reactjs: { type: "boolean", hasSensitiveValue: false },
104
- vue: { type: "boolean", hasSensitiveValue: false },
105
- vuejs: { type: "boolean", hasSensitiveValue: false },
106
- svelte: { type: "boolean", hasSensitiveValue: false },
107
- vision: { type: "boolean", hasSensitiveValue: false },
108
- "vision-ng": { type: "boolean", hasSensitiveValue: false },
109
- "vision-react": { type: "boolean", hasSensitiveValue: false },
110
- "vision-solid": { type: "boolean", hasSensitiveValue: false },
111
- "vision-svelte": { type: "boolean", hasSensitiveValue: false },
112
- "vision-vue": { type: "boolean", hasSensitiveValue: false },
113
- tsc: { type: "boolean", hasSensitiveValue: false },
114
- ts: { type: "boolean", hasSensitiveValue: false },
115
- typescript: { type: "boolean", hasSensitiveValue: false },
116
- yarn: { type: "boolean", hasSensitiveValue: false },
117
- yarn2: { type: "boolean", hasSensitiveValue: false },
118
- pnpm: { type: "boolean", hasSensitiveValue: false },
119
- androidTypings: { type: "boolean", hasSensitiveValue: false },
120
- bundle: { type: "string", hasSensitiveValue: false },
121
- all: { type: "boolean", hasSensitiveValue: false },
122
- teamId: { type: "object", hasSensitiveValue: true },
123
- chrome: { type: "boolean", hasSensitiveValue: false },
124
- inspector: { type: "boolean", hasSensitiveValue: false },
125
- clean: { type: "boolean", hasSensitiveValue: false },
97
+ ignoreScripts: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
98
+ disableNpmInstall: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
99
+ compileSdk: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
100
+ port: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
101
+ copyTo: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
102
+ js: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
103
+ javascript: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
104
+ ng: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
105
+ angular: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
106
+ react: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
107
+ reactjs: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
108
+ vue: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
109
+ vuejs: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
110
+ svelte: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
111
+ vision: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
112
+ "vision-ng": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
113
+ "vision-react": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
114
+ "vision-solid": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
115
+ "vision-svelte": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
116
+ "vision-vue": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
117
+ tsc: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
118
+ ts: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
119
+ typescript: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
120
+ yarn: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
121
+ yarn2: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
122
+ pnpm: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
123
+ androidTypings: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
124
+ bundle: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
125
+ all: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
126
+ teamId: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
127
+ chrome: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
128
+ inspector: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
129
+ clean: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
126
130
  watch: {
127
- type: "boolean",
131
+ type: "boolean" /* OptionType.Boolean */,
128
132
  default: true,
129
133
  hasSensitiveValue: false,
130
134
  },
131
- background: { type: "string", hasSensitiveValue: false },
132
- username: { type: "string", hasSensitiveValue: true },
133
- pluginName: { type: "string", hasSensitiveValue: false },
135
+ background: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
136
+ username: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
137
+ pluginName: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
134
138
  includeTypeScriptDemo: {
135
- type: "string",
139
+ type: "string" /* OptionType.String */,
136
140
  hasSensitiveValue: false,
137
141
  },
138
- includeAngularDemo: { type: "string", hasSensitiveValue: false },
142
+ includeAngularDemo: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
139
143
  hmr: {
140
- type: "boolean",
144
+ type: "boolean" /* OptionType.Boolean */,
141
145
  hasSensitiveValue: false,
142
146
  default: true,
143
147
  },
144
148
  collection: {
145
- type: "string",
149
+ type: "string" /* OptionType.String */,
146
150
  alias: "c",
147
151
  hasSensitiveValue: false,
148
152
  },
149
- json: { type: "boolean", hasSensitiveValue: false },
150
- avd: { type: "string", hasSensitiveValue: true },
151
- config: { type: "array", hasSensitiveValue: false },
153
+ json: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
154
+ avd: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
155
+ // check not used
156
+ config: { type: "array" /* OptionType.Array */, hasSensitiveValue: false },
152
157
  insecure: {
153
- type: "boolean",
158
+ type: "boolean" /* OptionType.Boolean */,
154
159
  alias: "k",
155
160
  hasSensitiveValue: false,
156
161
  },
157
- debug: { type: "boolean", alias: "d", hasSensitiveValue: false },
158
- timeout: { type: "string", hasSensitiveValue: false },
159
- device: { type: "string", hasSensitiveValue: true },
160
- availableDevices: { type: "boolean", hasSensitiveValue: false },
161
- appid: { type: "string", hasSensitiveValue: true },
162
- geny: { type: "string", hasSensitiveValue: true },
163
- debugBrk: { type: "boolean", hasSensitiveValue: false },
164
- debugPort: { type: "number", hasSensitiveValue: false },
165
- start: { type: "boolean", hasSensitiveValue: false },
166
- stop: { type: "boolean", hasSensitiveValue: false },
167
- ddi: { type: "string", hasSensitiveValue: true },
168
- justlaunch: { type: "boolean", hasSensitiveValue: false },
169
- file: { type: "string", hasSensitiveValue: true },
170
- force: { type: "boolean", alias: "f", hasSensitiveValue: false },
171
- emulator: { type: "boolean", hasSensitiveValue: false },
172
- simulator: { type: "boolean", hasSensitiveValue: false },
173
- sdk: { type: "string", hasSensitiveValue: false },
174
- template: { type: "string", hasSensitiveValue: true },
175
- certificate: { type: "string", hasSensitiveValue: true },
176
- certificatePassword: { type: "string", hasSensitiveValue: true },
162
+ debug: { type: "boolean" /* OptionType.Boolean */, alias: "d", hasSensitiveValue: false },
163
+ timeout: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
164
+ device: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
165
+ availableDevices: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
166
+ appid: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
167
+ geny: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
168
+ debugBrk: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
169
+ debugPort: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
170
+ start: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
171
+ stop: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
172
+ ddi: { type: "string" /* OptionType.String */, hasSensitiveValue: true }, // the path to developer disk image
173
+ justlaunch: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
174
+ file: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
175
+ force: { type: "boolean" /* OptionType.Boolean */, alias: "f", hasSensitiveValue: false },
176
+ emulator: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
177
+ simulator: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
178
+ sdk: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
179
+ template: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
180
+ certificate: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
181
+ certificatePassword: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
177
182
  release: {
178
- type: "boolean",
183
+ type: "boolean" /* OptionType.Boolean */,
179
184
  alias: "r",
180
185
  hasSensitiveValue: false,
181
186
  },
182
- markingMode: { type: "boolean", hasSensitiveValue: false },
183
- var: { type: "object", hasSensitiveValue: true },
184
- default: { type: "boolean", hasSensitiveValue: false },
185
- count: { type: "number", hasSensitiveValue: false },
186
- analyticsLogFile: { type: "string", hasSensitiveValue: true },
187
- disableAnalytics: { type: "boolean", hasSensitiveValue: false },
188
- cleanupLogFile: { type: "string", hasSensitiveValue: true },
187
+ markingMode: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
188
+ var: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
189
+ default: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
190
+ count: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
191
+ analyticsLogFile: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
192
+ disableAnalytics: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
193
+ cleanupLogFile: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
189
194
  hooks: {
190
- type: "boolean",
195
+ type: "boolean" /* OptionType.Boolean */,
191
196
  default: true,
192
197
  hasSensitiveValue: false,
193
198
  },
194
199
  link: {
195
- type: "boolean",
200
+ type: "boolean" /* OptionType.Boolean */,
196
201
  default: false,
197
202
  hasSensitiveValue: false,
198
203
  },
199
- gradlePath: { type: "string", hasSensitiveValue: false },
200
- gradleArgs: { type: "string", hasSensitiveValue: false },
201
- hostProjectPath: { type: "string", hasSensitiveValue: false },
204
+ gradlePath: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
205
+ gradleArgs: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
206
+ hostProjectPath: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
202
207
  hostProjectModuleName: {
203
- type: "string",
208
+ type: "string" /* OptionType.String */,
204
209
  hasSensitiveValue: false,
205
210
  default: constants_1.APP_FOLDER_NAME,
206
211
  },
207
- aab: { type: "boolean", hasSensitiveValue: false },
208
- performance: { type: "object", hasSensitiveValue: true },
212
+ aab: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
213
+ performance: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
209
214
  appleApplicationSpecificPassword: {
210
- type: "string",
215
+ type: "string" /* OptionType.String */,
211
216
  hasSensitiveValue: true,
212
217
  },
213
- appleSessionBase64: { type: "string", hasSensitiveValue: true },
214
- jar: { type: "string", hasSensitiveValue: true },
215
- aar: { type: "string", hasSensitiveValue: true },
216
- filter: { type: "string", hasSensitiveValue: true },
218
+ appleSessionBase64: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
219
+ jar: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
220
+ aar: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
221
+ filter: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
217
222
  git: {
218
- type: "boolean",
223
+ type: "boolean" /* OptionType.Boolean */,
219
224
  hasSensitiveValue: false,
220
225
  default: true,
221
226
  },
222
- dryRun: { type: "boolean", hasSensitiveValue: false },
223
- uniqueBundle: { type: "boolean", hasSensitiveValue: false },
227
+ dryRun: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
228
+ uniqueBundle: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
224
229
  };
225
230
  }
226
231
  get optionNames() {
@@ -238,6 +243,7 @@ class Options {
238
243
  parsed[optionName] = this.getOptionValue(optionName);
239
244
  }
240
245
  _.each(parsed, (value, originalOptionName) => {
246
+ // when this.options are passed to yargs, it returns all of them and the ones that are not part of process.argv are set to undefined.
241
247
  if (value === undefined) {
242
248
  return;
243
249
  }
@@ -247,14 +253,14 @@ class Options {
247
253
  this.$errors.failWithHelp(`The option '${originalOptionName}' is not supported.`);
248
254
  }
249
255
  const optionType = this.getOptionType(optionName), optionValue = parsed[optionName];
250
- if (_.isArray(optionValue) && optionType !== "array") {
256
+ if (_.isArray(optionValue) && optionType !== "array" /* OptionType.Array */) {
251
257
  this.$errors.failWithHelp("The '%s' option requires a single value.", originalOptionName);
252
258
  }
253
- else if (optionType === "string" &&
259
+ else if (optionType === "string" /* OptionType.String */ &&
254
260
  helpers.isNullOrWhitespace(optionValue)) {
255
261
  this.$errors.failWithHelp("The option '%s' requires non-empty value.", originalOptionName);
256
262
  }
257
- else if (optionType === "array" &&
263
+ else if (optionType === "array" /* OptionType.Array */ &&
258
264
  optionValue.length === 0) {
259
265
  this.$errors.failWithHelp(`The option '${originalOptionName}' requires one or more values, separated by a space.`);
260
266
  }
@@ -282,9 +288,16 @@ class Options {
282
288
  }
283
289
  return true;
284
290
  }
291
+ // If you pass value with dash, yargs adds it to yargs.argv in two ways:
292
+ // with dash and without dash, replacing first symbol after it with its toUpper equivalent
293
+ // ex, "$ <cli name> emulate android --profile-dir" will add profile-dir to yargs.argv as profile-dir and profileDir
294
+ // IMPORTANT: In your code, it is better to use the value without dashes (profileDir in the example).
295
+ // This way your code will work in case "$ <cli name> emulate android --profile-dir" or "$ <cli name> emulate android --profileDir" is used by user.
285
296
  getNonDashedOptionName(optionName) {
286
297
  const matchUpperCaseLetters = optionName.match(Options.NONDASHED_OPTION_REGEX);
287
298
  if (matchUpperCaseLetters) {
299
+ // get here if option with upperCase letter is specified, for example profileDir
300
+ // check if in knownOptions we have its kebabCase presentation
288
301
  const secondaryOptionName = matchUpperCaseLetters[1] +
289
302
  matchUpperCaseLetters[2].toUpperCase() +
290
303
  matchUpperCaseLetters[3] || "";
@@ -313,15 +326,18 @@ class Options {
313
326
  const args = argv._.slice(1);
314
327
  const commands = yok_1.injector
315
328
  .getRegisteredCommandsNames(false)
316
- .filter((c) => c != "/?");
329
+ .filter((c) => c != "/?"); // remove the /? command, looks weird... :D
317
330
  const currentDepth = args.length > 0 ? args.length - 1 : 0;
318
331
  const current = (_a = current_ !== null && current_ !== void 0 ? current_ : args[currentDepth]) !== null && _a !== void 0 ? _a : "";
332
+ // split all commands into their components ie. "device|list" => ["device", "list"]
319
333
  const matchGroups = commands.map((c) => c.split("|"));
334
+ // find all commands that match the current depth and all the previous args
320
335
  const possibleMatches = matchGroups.filter((group) => {
321
336
  return group.slice(0, currentDepth).every((g, i) => {
322
337
  return g === args[i] || args[i].at(0) === "-";
323
338
  });
324
339
  });
340
+ // filter out duplicates
325
341
  const completions = [
326
342
  ...new Set(possibleMatches
327
343
  .map((match) => {
@@ -329,21 +345,28 @@ class Options {
329
345
  })
330
346
  .filter(Boolean)),
331
347
  ];
348
+ // autocomplete long -- options
332
349
  if (current.startsWith("--")) {
333
350
  return this.optionNames.filter((o) => o !== "_").map((o) => `--${o}`);
334
351
  }
352
+ // autocomple short - options
335
353
  if (current.startsWith("-")) {
336
354
  return this.shorthands.map((o) => `-${o}`);
337
355
  }
356
+ // autocomplete matched completions
338
357
  return completions;
339
358
  });
340
359
  this.initialArgv = parsed.argv;
341
360
  this.argv = parsed.options(opts).argv;
361
+ // For backwards compatibility
362
+ // Previously profileDir had a default option and calling `this.$options.profileDir` always returned valid result.
363
+ // Now the profileDir should be used from $settingsService, but ensure the `this.$options.profileDir` returns the same value.
342
364
  this.$settingsService.setSettings({
343
365
  profileDir: this.argv.profileDir,
344
366
  });
345
367
  this.argv.profileDir = this.argv["profile-dir"] =
346
368
  this.$settingsService.getProfileDir();
369
+ // if justlaunch is set, it takes precedence over the --watch flag and the default true value
347
370
  if (this.argv.justlaunch) {
348
371
  this.argv.watch = false;
349
372
  }
@@ -359,6 +382,7 @@ class Options {
359
382
  if (this.argv.javascript) {
360
383
  this.argv.js = true;
361
384
  }
385
+ // alias --simulator to --emulator
362
386
  if (this.argv.simulator) {
363
387
  this.argv.emulator = this.argv.simulator;
364
388
  }
@@ -383,3 +407,4 @@ exports.Options = Options;
383
407
  Options.DASHED_OPTION_REGEX = /(.+?)([A-Z])(.*)/;
384
408
  Options.NONDASHED_OPTION_REGEX = /(.+?)[-]([a-zA-Z])(.*)/;
385
409
  yok_1.injector.register("options", Options);
410
+ //# sourceMappingURL=options.js.map
@@ -24,6 +24,7 @@ class PackageInstallationManager {
24
24
  async getLatestCompatibleVersion(packageName, referenceVersion) {
25
25
  referenceVersion = referenceVersion || this.$staticConfig.version;
26
26
  const isPreReleaseVersion = semver.prerelease(referenceVersion) !== null;
27
+ // if the user has some v.v.v-prerelease-xx.xx pre-release version, include pre-release versions in the search query.
27
28
  const compatibleVersionRange = isPreReleaseVersion
28
29
  ? `~${referenceVersion}`
29
30
  : `~${semver.major(referenceVersion)}.${semver.minor(referenceVersion)}.0`;
@@ -105,13 +106,14 @@ class PackageInstallationManager {
105
106
  }
106
107
  async getInspectorFromCache(inspectorNpmPackageName, projectDir) {
107
108
  const inspectorPath = path.join(projectDir, constants.NODE_MODULES_FOLDER_NAME, inspectorNpmPackageName);
109
+ // local installation takes precedence over cache
108
110
  if (this.inspectorAlreadyInstalled(inspectorPath)) {
109
111
  return inspectorPath;
110
112
  }
111
113
  const cachePath = this.getInspectorCachePath();
112
114
  this.prepareCacheDir(cachePath);
113
115
  const pathToPackageInCache = path.join(cachePath, constants.NODE_MODULES_FOLDER_NAME, inspectorNpmPackageName);
114
- const iOSFrameworkNSValue = this.$projectDataService.getRuntimePackage(projectDir, "ios");
116
+ const iOSFrameworkNSValue = this.$projectDataService.getRuntimePackage(projectDir, "ios" /* constants.PlatformTypes.ios */);
115
117
  const version = await this.getLatestCompatibleVersion(inspectorNpmPackageName, iOSFrameworkNSValue.version);
116
118
  let shouldInstall = !this.$fs.exists(pathToPackageInCache);
117
119
  if (!shouldInstall) {
@@ -172,6 +174,10 @@ class PackageInstallationManager {
172
174
  }
173
175
  return await this.$packageManager.install(packageName, pathToSave, npmOptions);
174
176
  }
177
+ /**
178
+ * This function must not be used with packageName being a URL or local file,
179
+ * because npm view doens't work with those
180
+ */
175
181
  async getVersion(packageName, version) {
176
182
  var _a;
177
183
  let data = await this.$packageManager.view(packageName, {
@@ -184,3 +190,4 @@ class PackageInstallationManager {
184
190
  }
185
191
  exports.PackageInstallationManager = PackageInstallationManager;
186
192
  yok_1.injector.register("packageInstallationManager", PackageInstallationManager);
193
+ //# sourceMappingURL=package-installation-manager.js.map
@@ -92,6 +92,7 @@ class PackageManager {
92
92
  }
93
93
  }
94
94
  catch (err) {
95
+ // ignore error, but log info
95
96
  this.$logger.trace("Tried to read cli.packageManager from project config and failed. Error is: ", err);
96
97
  }
97
98
  if (pm === constants_1.PackageManagers.yarn || this.$options.yarn) {
@@ -159,3 +160,4 @@ __decorate([
159
160
  (0, decorators_1.invokeInit)()
160
161
  ], PackageManager.prototype, "getCachePath", null);
161
162
  yok_1.injector.register("packageManager", PackageManager);
163
+ //# sourceMappingURL=package-manager.js.map
@@ -16,3 +16,4 @@ class PlatformCommandParameter {
16
16
  }
17
17
  exports.PlatformCommandParameter = PlatformCommandParameter;
18
18
  yok_1.injector.register("platformCommandParameter", PlatformCommandParameter);
19
+ //# sourceMappingURL=platform-command-param.js.map
@@ -24,13 +24,14 @@ class PnpmPackageManager extends base_package_manager_1.BasePackageManager {
24
24
  if (config.disableNpmInstall) {
25
25
  return;
26
26
  }
27
- delete config.dev;
27
+ delete config.dev; // temporary fix for unsupported yarn flag
28
28
  if (config.ignoreScripts) {
29
29
  config["ignore-scripts"] = true;
30
30
  }
31
31
  const packageJsonPath = path.join(pathToSave, "package.json");
32
32
  const jsonContentBefore = this.$fs.readJson(packageJsonPath);
33
33
  const flags = this.getFlagsString(config, true);
34
+ // With pnpm we need to install as "flat" or some imports wont be found
34
35
  let params = ["i", "--shamefully-hoist"];
35
36
  const isInstallingAllDependencies = packageName === pathToSave;
36
37
  if (!isInstallingAllDependencies) {
@@ -48,6 +49,7 @@ class PnpmPackageManager extends base_package_manager_1.BasePackageManager {
48
49
  }
49
50
  }
50
51
  uninstall(packageName, config, cwd) {
52
+ // pnpm does not want save option in remove. It saves it by default
51
53
  delete config["save"];
52
54
  const flags = this.getFlagsString(config, false);
53
55
  return this.$childProcess.exec(`pnpm remove ${packageName} ${flags}`, {
@@ -115,3 +117,4 @@ __decorate([
115
117
  (0, decorators_1.exported)("pnpm")
116
118
  ], PnpmPackageManager.prototype, "getCachePath", null);
117
119
  yok_1.injector.register("pnpm", PnpmPackageManager);
120
+ //# sourceMappingURL=pnpm-package-manager.js.map
@@ -19,6 +19,7 @@ class ProjectData {
19
19
  this.warnProjectId();
20
20
  return this.projectIdentifiers.ios;
21
21
  }
22
+ //just in case hook/extension modifies it.
22
23
  set projectId(identifier) {
23
24
  this.warnProjectId();
24
25
  this.projectIdentifiers.ios = identifier;
@@ -44,6 +45,7 @@ class ProjectData {
44
45
  return;
45
46
  }
46
47
  projectDir = projectDir || this.$projectHelper.projectDir;
48
+ // If no project found, projectDir should be null
47
49
  if (projectDir) {
48
50
  const projectFilePath = this.getProjectFilePath(projectDir);
49
51
  if (this.$fs.exists(projectFilePath)) {
@@ -116,6 +118,7 @@ class ProjectData {
116
118
  errorInvalidProject(projectDir) {
117
119
  const currentDir = path.resolve(".");
118
120
  this.$logger.trace(`Unable to find project. projectDir: ${projectDir}, options.path: ${this.$options.path}, ${currentDir}`);
121
+ // This is the case when no project file found
119
122
  this.$errors.fail("No project found at or above '%s' and neither was a --path specified.", projectDir || this.$options.path || currentDir);
120
123
  }
121
124
  getProjectFilePath(projectDir) {
@@ -131,6 +134,10 @@ class ProjectData {
131
134
  return this.nsConfig[constants.CONFIG_NS_APP_RESOURCES_ENTRY];
132
135
  }
133
136
  return constants.APP_RESOURCES_FOLDER_NAME;
137
+ // return path.join(
138
+ // this.getAppDirectoryRelativePath(),
139
+ // constants.APP_RESOURCES_FOLDER_NAME
140
+ // );
134
141
  }
135
142
  getAppDirectoryPath(projectDir) {
136
143
  const appRelativePath = this.getAppDirectoryRelativePath();
@@ -144,6 +151,7 @@ class ProjectData {
144
151
  return constants.SRC_DIR;
145
152
  }
146
153
  else {
154
+ // legacy project setup often uses app folder
147
155
  return constants.APP_FOLDER_NAME;
148
156
  }
149
157
  }
@@ -201,6 +209,9 @@ class ProjectData {
201
209
  }
202
210
  }
203
211
  exports.ProjectData = ProjectData;
212
+ /**
213
+ * NOTE: Order of the elements is important as the TypeScript dependencies are commonly included in Angular project as well.
214
+ */
204
215
  ProjectData.PROJECT_TYPES = [
205
216
  {
206
217
  type: constants.ProjectTypes.JsFlavorName,
@@ -238,3 +249,4 @@ __decorate([
238
249
  (0, decorators_1.cache)()
239
250
  ], ProjectData.prototype, "warnProjectId", null);
240
251
  yok_1.injector.register("projectData", ProjectData, true);
252
+ //# sourceMappingURL=project-data.js.map
@@ -44,3 +44,4 @@ class ProjectFilesProvider extends project_files_provider_base_1.ProjectFilesPro
44
44
  exports.ProjectFilesProvider = ProjectFilesProvider;
45
45
  ProjectFilesProvider.INTERNAL_NONPROJECT_FILES = ["**/*.ts"];
46
46
  yok_1.injector.register("projectFilesProvider", ProjectFilesProvider);
47
+ //# sourceMappingURL=project-files-provider.js.map
@@ -20,3 +20,4 @@ class LiveSyncServiceResolver {
20
20
  }
21
21
  exports.LiveSyncServiceResolver = LiveSyncServiceResolver;
22
22
  yok_1.injector.register("liveSyncServiceResolver", LiveSyncServiceResolver);
23
+ //# sourceMappingURL=livesync-service-resolver.js.map
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // NOTE: This file is used to track data in a separate process.
4
+ // The instances here are not shared with the ones in main CLI process.
3
5
  const fs = require("fs");
4
6
  const analytics_broker_1 = require("./analytics-broker");
5
7
  const file_log_service_1 = require("../../detached-processes/file-log-service");
@@ -9,6 +11,7 @@ if (!pathToBootstrap || !fs.existsSync(pathToBootstrap)) {
9
11
  throw new Error("Invalid path to bootstrap.");
10
12
  }
11
13
  const logFile = process.argv[3];
14
+ // After requiring the bootstrap we can use $injector
12
15
  require(pathToBootstrap);
13
16
  const analyticsLoggingService = yok_1.injector.resolve(file_log_service_1.FileLogService, { logFile });
14
17
  analyticsLoggingService.logData({ message: "Initializing AnalyticsBroker." });
@@ -38,15 +41,15 @@ process.on("message", async (data) => {
38
41
  analyticsLoggingService.logData({
39
42
  message: `analytics-broker-process received message of type: ${JSON.stringify(data)}`,
40
43
  });
41
- if (data.type === "FinishTracking") {
44
+ if (data.type === "FinishTracking" /* TrackingTypes.FinishTracking */) {
42
45
  await finishTracking();
43
46
  if (process.connected) {
44
47
  analyticsLoggingService.logData({
45
- message: `analytics-broker-process will send ${"ProcessFinishedTasks"} message`,
48
+ message: `analytics-broker-process will send ${"ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */} message`,
46
49
  });
47
- process.send("ProcessFinishedTasks", () => {
50
+ process.send("ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */, null, null, () => {
48
51
  analyticsLoggingService.logData({
49
- message: `analytics-broker-process sent ${"ProcessFinishedTasks"} message and will exit gracefully now`,
52
+ message: `analytics-broker-process sent ${"ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */} message and will exit gracefully now`,
50
53
  });
51
54
  killCurrentProcessGracefully();
52
55
  });
@@ -63,6 +66,7 @@ process.on("disconnect", async () => {
63
66
  killCurrentProcessGracefully();
64
67
  });
65
68
  analyticsLoggingService.logData({
66
- message: `analytics-broker-process will send ${"ProcessReadyToReceive"} message`,
69
+ message: `analytics-broker-process will send ${"ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */} message`,
67
70
  });
68
- process.send("ProcessReadyToReceive");
71
+ process.send("ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */);
72
+ //# sourceMappingURL=analytics-broker-process.js.map