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
@@ -27,12 +27,15 @@ class AutoCompletionService {
27
27
  get shellProfiles() {
28
28
  return [
29
29
  this.getHomePath(".bashrc"),
30
- this.getHomePath(".zshrc"),
30
+ this.getHomePath(".zshrc"), // zsh - http://www.acm.uiuc.edu/workshops/zsh/startup_files.html
31
31
  ];
32
32
  }
33
33
  get cliRunCommandsFile() {
34
34
  let cliRunCommandsFile = this.getHomePath(util.format(".%src", this.$staticConfig.CLIENT_NAME.toLowerCase()));
35
35
  if (this.$hostInfo.isWindows) {
36
+ // on Windows bash, file is incorrectly written as C:\Users\<username>, which leads to errors when trying to execute the script:
37
+ // $ source ~/.bashrc
38
+ // sh.exe": C:Usersusername.appbuilderrc: No such file or directory
36
39
  cliRunCommandsFile = cliRunCommandsFile.replace(/\\/g, "/");
37
40
  }
38
41
  return cliRunCommandsFile;
@@ -47,7 +50,9 @@ class AutoCompletionService {
47
50
  return new RegExp(util.format("%s[\\s\\S]*%s", AutoCompletionService.GENERATED_TABTAB_COMPLETION_START, AutoCompletionService.GENERATED_TABTAB_COMPLETION_END));
48
51
  }
49
52
  removeObsoleteAutoCompletion() {
53
+ // In previous releases we were writing directly in .bash_profile, .bashrc, .zshrc and .profile - remove this old code
50
54
  const shellProfilesToBeCleared = this.shellProfiles;
55
+ // Add .profile only here as we do not want new autocompletion in this file, but we have to remove our old code from it.
51
56
  shellProfilesToBeCleared.push(this.getHomePath(".profile"));
52
57
  shellProfilesToBeCleared.forEach((file) => {
53
58
  try {
@@ -100,6 +105,7 @@ class AutoCompletionService {
100
105
  this.isNewAutoCompletionEnabledInFile(filePath) ||
101
106
  this.isObsoleteAutoCompletionEnabledInFile(filePath);
102
107
  if (!result) {
108
+ // break each
103
109
  return false;
104
110
  }
105
111
  });
@@ -125,6 +131,7 @@ class AutoCompletionService {
125
131
  _.each(this.shellProfiles, (shellProfile) => {
126
132
  result = this.isObsoleteAutoCompletionEnabledInFile(shellProfile);
127
133
  if (!result) {
134
+ // break each
128
135
  return false;
129
136
  }
130
137
  });
@@ -163,6 +170,8 @@ class AutoCompletionService {
163
170
  }
164
171
  catch (err) {
165
172
  this.$logger.info("Unable to update %s. Command-line completion might not work.", fileName);
173
+ // When npm is installed with sudo, in some cases the installation cannot write to shell profiles
174
+ // Advise the user how to enable autocompletion after the installation is completed.
166
175
  if ((err.code === "EPERM" || err.code === "EACCES") &&
167
176
  !this.$hostInfo.isWindows &&
168
177
  process.env.SUDO_USER) {
@@ -183,6 +192,7 @@ class AutoCompletionService {
183
192
  }
184
193
  }
185
194
  catch (err) {
195
+ // If file does not exist, autocompletion was not working for it, so ignore this error.
186
196
  if (err.code !== "ENOENT") {
187
197
  this.$logger.info("Failed to update %s. Auto-completion may still work or work incorrectly. ", fileName);
188
198
  this.$logger.info(err);
@@ -214,6 +224,7 @@ class AutoCompletionService {
214
224
  this.$fs.writeFile(filePath, newText);
215
225
  }
216
226
  }
227
+ // The generated seems to be inconsistent in it's start/end markers so adding our own.
217
228
  this.$fs.appendFile(filePath, `\n${AutoCompletionService.GENERATED_TABTAB_COMPLETION_START}\n`);
218
229
  await this.$childProcess.exec(`"${process.argv[0]}" "${pathToExecutableFile}" completion_generate_script >> "${filePath}"`);
219
230
  this.$fs.appendFile(filePath, this.completionAliasDefinition);
@@ -250,3 +261,4 @@ __decorate([
250
261
  (0, decorators_1.cache)()
251
262
  ], AutoCompletionService.prototype, "completionShellScriptContent", null);
252
263
  yok_1.injector.register("autoCompletionService", AutoCompletionService);
264
+ //# sourceMappingURL=auto-completion-service.js.map
@@ -28,7 +28,7 @@ class CancellationService {
28
28
  .watch(triggerFile, { ignoreInitial: true })
29
29
  .on("unlink", (filePath) => {
30
30
  this.$logger.info(`Exiting process as the file ${filePath} has been deleted. Probably reinstalling CLI while there's a working instance.`);
31
- process.exit(132);
31
+ process.exit(132 /* ErrorCodes.DELETED_KILL_FILE */);
32
32
  });
33
33
  if (watcher) {
34
34
  this.watches[name] = watcher;
@@ -54,3 +54,4 @@ class CancellationService {
54
54
  }
55
55
  }
56
56
  yok_1.injector.register("cancellation", CancellationService);
57
+ //# sourceMappingURL=cancellation.js.map
@@ -38,11 +38,11 @@ class CommandsService {
38
38
  if (!this.$staticConfig.disableAnalytics &&
39
39
  !command.disableAnalytics &&
40
40
  !this.$options.disableAnalytics) {
41
- const analyticsService = this.$injector.resolve("analyticsService");
41
+ const analyticsService = this.$injector.resolve("analyticsService"); // This should be resolved here due to cyclic dependency
42
42
  await analyticsService.checkConsent();
43
43
  const beautifiedCommandName = this.beautifyCommandName(commandName).replace(/\|/g, " ");
44
44
  const googleAnalyticsPageData = {
45
- googleAnalyticsDataType: "pageview",
45
+ googleAnalyticsDataType: "pageview" /* GoogleAnalyticsDataType.Page */,
46
46
  path: beautifiedCommandName,
47
47
  title: beautifiedCommandName,
48
48
  };
@@ -52,10 +52,11 @@ class CommandsService {
52
52
  const shouldExecuteHooks = !this.$staticConfig.disableCommandHooks &&
53
53
  (command.enableHooks === undefined || command.enableHooks === true);
54
54
  if (shouldExecuteHooks) {
55
+ // Handle correctly hierarchical commands
55
56
  const hierarchicalCommandName = this.$injector.buildHierarchicalCommand(commandName, commandArguments);
56
57
  if (hierarchicalCommandName) {
57
- commandName = helpers.stringReplaceAll(hierarchicalCommandName.commandName, "|*", "-");
58
- commandName = helpers.stringReplaceAll(commandName, "|", "-");
58
+ commandName = helpers.stringReplaceAll(hierarchicalCommandName.commandName, "|*" /* CommandsDelimiters.DefaultHierarchicalCommand */, "-" /* CommandsDelimiters.HooksCommand */);
59
+ commandName = helpers.stringReplaceAll(commandName, "|" /* CommandsDelimiters.HierarchicalCommand */, "-" /* CommandsDelimiters.HooksCommand */);
59
60
  }
60
61
  await this.$hooksService.executeBeforeHooks(commandName);
61
62
  }
@@ -100,6 +101,7 @@ class CommandsService {
100
101
  await this.executeCommandAction(commandName, commandArguments, this.executeCommandUnchecked);
101
102
  }
102
103
  else {
104
+ // If canExecuteCommand returns false, the command cannot be executed or there's no such command at all.
103
105
  const command = this.$injector.resolveCommand(commandName);
104
106
  if (command) {
105
107
  let commandWithArgs = commandName;
@@ -115,12 +117,15 @@ class CommandsService {
115
117
  const command = this.$injector.resolveCommand(commandName);
116
118
  const beautifiedName = helpers.stringReplaceAll(commandName, "|", " ");
117
119
  if (command) {
120
+ // Verify command is enabled
118
121
  if (command.isDisabled) {
119
122
  this.$errors.fail("This command is not applicable to your environment.");
120
123
  }
124
+ // If command wants to handle canExecute logic on its own.
121
125
  if (command.canExecute) {
122
126
  return await command.canExecute(commandArguments);
123
127
  }
128
+ // First part of hierarchical commands should be validated in specific way.
124
129
  if (await this.$injector.isValidHierarchicalCommand(commandName, commandArguments)) {
125
130
  return true;
126
131
  }
@@ -132,8 +137,8 @@ class CommandsService {
132
137
  }
133
138
  const commandInfo = {
134
139
  inputStrings: [commandName, ...commandArguments],
135
- commandDelimiter: "|",
136
- defaultCommandDelimiter: "|*",
140
+ commandDelimiter: "|" /* CommandsDelimiters.HierarchicalCommand */,
141
+ defaultCommandDelimiter: "|*" /* CommandsDelimiters.DefaultHierarchicalCommand */,
137
142
  };
138
143
  const extensionData = await this.$extensibilityService.getExtensionNameWhereCommandIsRegistered(commandInfo);
139
144
  if (extensionData) {
@@ -149,11 +154,13 @@ class CommandsService {
149
154
  async validateMandatoryParams(commandArguments, mandatoryParams) {
150
155
  const commandArgsHelper = new CommandArgumentsValidationHelper(true, commandArguments);
151
156
  if (mandatoryParams.length > 0) {
157
+ // If command has more mandatory params than the passed ones, we shouldn't execute it
152
158
  if (mandatoryParams.length > commandArguments.length) {
153
159
  const customErrorMessages = _.map(mandatoryParams, (mp) => mp.errorMessage);
154
160
  customErrorMessages.splice(0, 0, "You need to provide all the required parameters.");
155
161
  this.$errors.failWithHelp(customErrorMessages.join(os_1.EOL));
156
162
  }
163
+ // If we reach here, the commandArguments are at least as much as mandatoryParams. Now we should verify that we have each of them.
157
164
  for (let mandatoryParamIndex = 0; mandatoryParamIndex < mandatoryParams.length; ++mandatoryParamIndex) {
158
165
  const mandatoryParam = mandatoryParams[mandatoryParamIndex];
159
166
  let argument = null;
@@ -180,12 +187,14 @@ class CommandsService {
180
187
  if (!commandArgsHelper.isValid) {
181
188
  return false;
182
189
  }
190
+ // Command doesn't have any allowedParameters
183
191
  if (!command.allowedParameters || command.allowedParameters.length === 0) {
184
192
  if (commandArguments.length > 0) {
185
193
  this.$errors.failWithHelp("This command doesn't accept parameters.");
186
194
  }
187
195
  }
188
196
  else {
197
+ // Exclude mandatory params, we've already checked them
189
198
  const unverifiedAllowedParams = command.allowedParameters.filter((param) => !param.mandatory);
190
199
  for (let remainingArgsIndex = 0; remainingArgsIndex < commandArgsHelper.remainingArguments.length; ++remainingArgsIndex) {
191
200
  const argument = commandArgsHelper.remainingArguments[remainingArgsIndex];
@@ -199,6 +208,7 @@ class CommandsService {
199
208
  }
200
209
  if (parameter) {
201
210
  const index = unverifiedAllowedParams.indexOf(parameter);
211
+ // Remove the matched parameter from unverifiedAllowedParams collection, so it will not be used to verify another argument.
202
212
  unverifiedAllowedParams.splice(index, 1);
203
213
  }
204
214
  else {
@@ -243,3 +253,4 @@ class CommandsService {
243
253
  }
244
254
  exports.CommandsService = CommandsService;
245
255
  yok_1.injector.register("commandsService", CommandsService);
256
+ //# sourceMappingURL=commands-service.js.map
@@ -42,6 +42,7 @@ class HelpService {
42
42
  this.$logger.trace("Opening help for command '%s'. FileName is '%s'.", commandName, htmlPage);
43
43
  this.$fs.ensureDirectoryExists(this.pathToHtmlPages);
44
44
  if (!this.tryOpeningSelectedPage(htmlPage)) {
45
+ // HTML pages may have been skipped on post-install, lets generate them.
45
46
  this.$logger.trace("Required HTML file '%s' is missing. Let's try generating HTML files and see if we'll find it.", htmlPage);
46
47
  await this.generateHtmlPages();
47
48
  if (!this.tryOpeningSelectedPage(htmlPage)) {
@@ -98,6 +99,11 @@ class HelpService {
98
99
  const help = await this.getCommandLineHelpForCommand(commandData);
99
100
  this.$logger.printMarkdown(help);
100
101
  }
102
+ /**
103
+ * Gets the help content for a specific command that should be shown on the terminal.
104
+ * @param {string} commandName Name of the command for which to read the help.
105
+ * @returns {Promise<string>} Help content of the command parsed with all terminal rules applied (stripped content that should be shown only for html help).
106
+ */
101
107
  async getCommandLineHelpForCommand(commandData) {
102
108
  const helpText = await this.readMdFileForCommand(commandData);
103
109
  const commandLineHelp = (await this.$microTemplateService.parseContent(helpText, { isHtml: false }))
@@ -109,6 +115,7 @@ class HelpService {
109
115
  .replace(HelpService.NEW_LINE_REGEX, os_1.EOL);
110
116
  return commandLineHelp;
111
117
  }
118
+ // This method should return Promise in order to generate all html pages simultaneously.
112
119
  async createHtmlPage(htmlPageGenerationData) {
113
120
  const { basicHtmlPage, pathToMdFile, pathToMdPages, pathToHtmlPages, extensionName, } = htmlPageGenerationData;
114
121
  const mdFileName = path.basename(pathToMdFile);
@@ -155,8 +162,8 @@ class HelpService {
155
162
  const commandName = commandData.commandName;
156
163
  const commandInfo = {
157
164
  inputStrings: [commandName, ...commandData.commandArguments],
158
- commandDelimiter: "|",
159
- defaultCommandDelimiter: "|*",
165
+ commandDelimiter: "|" /* CommandsDelimiters.HierarchicalCommand */,
166
+ defaultCommandDelimiter: "|*" /* CommandsDelimiters.DefaultHierarchicalCommand */,
160
167
  };
161
168
  const extensionData = await this.$extensibilityService.getExtensionNameWhereCommandIsRegistered(commandInfo);
162
169
  if (extensionData) {
@@ -223,5 +230,6 @@ HelpService.RELATIVE_PATH_TO_INDEX_REGEX = /@RELATIVE_PATH_TO_INDEX@/g;
223
230
  HelpService.EXTENSION_NAME_REGEX = /@EXTENSION_NAME@/g;
224
231
  HelpService.MARKDOWN_LINK_REGEX = /\[([\w \-\`\<\>\*\:\\]+?)\]\([\s\S]+?\)/g;
225
232
  HelpService.SPAN_REGEX = /([\s\S]*?)(?:\r?\n)?<span.*?>([\s\S]*?)<\/span>(?:\r?\n)*/g;
226
- HelpService.NEW_LINE_REGEX = /<\/?\s*?br\s*?\/?>/g;
233
+ HelpService.NEW_LINE_REGEX = /<\/?\s*?br\s*?\/?>/g; // <br>, <br > <br/> <br />
227
234
  yok_1.injector.register("helpService", HelpService);
235
+ //# sourceMappingURL=help-service.js.map
@@ -52,6 +52,7 @@ class HooksService {
52
52
  }
53
53
  }
54
54
  static formatHookName(commandName) {
55
+ // Remove everything after | (including the pipe)
55
56
  return commandName.replace(/\|[\s\S]*$/, "");
56
57
  }
57
58
  executeBeforeHooks(commandName, hookArguments) {
@@ -131,6 +132,11 @@ class HooksService {
131
132
  this.$logger.warn(`${hook.fullPath} will NOT be executed because it has invalid arguments - ${color_1.color.grey(invalidArguments.join(", "))}.`);
132
133
  return;
133
134
  }
135
+ // HACK for backwards compatibility:
136
+ // In case $projectData wasn't resolved by the time we got here (most likely we got here without running a command but through a service directly)
137
+ // then it is probably passed as a hookArg
138
+ // if that is the case then pass it directly to the hook instead of trying to resolve $projectData via injector
139
+ // This helps make hooks stateless
134
140
  const projectDataHookArg = hookArguments["hookArgs"] && hookArguments["hookArgs"]["projectData"];
135
141
  if (projectDataHookArg) {
136
142
  hookArguments["projectData"] = hookArguments["$projectData"] =
@@ -149,6 +155,7 @@ class HooksService {
149
155
  this.$logger.warn(err.message || err);
150
156
  }
151
157
  else {
158
+ // Print the actual error with its callstack, so it is easy to find out which hooks is causing troubles.
152
159
  this.$logger.error(err);
153
160
  throw err || new Error(`Failed to execute hook: ${hook.fullPath}.`);
154
161
  }
@@ -253,6 +260,7 @@ class HooksService {
253
260
  interpreter = sheBangMatch[1];
254
261
  }
255
262
  if (interpreter) {
263
+ // Likewise, make /usr/bin/bash work like "bash".
256
264
  shMatch = interpreter.match(/bin\/((?:ba)?sh)$/);
257
265
  }
258
266
  if (shMatch) {
@@ -293,6 +301,7 @@ class HooksService {
293
301
  }
294
302
  validateHookArguments(hookConstructor, hookFullPath) {
295
303
  const invalidArguments = [];
304
+ // We need to annotate the hook in order to have the arguments of the constructor.
296
305
  (0, helpers_1.annotate)(hookConstructor);
297
306
  _.each(hookConstructor.$inject.args, (argument) => {
298
307
  try {
@@ -313,8 +322,12 @@ HooksService.HOOKS_DIRECTORY_NAME = "hooks";
313
322
  __decorate([
314
323
  (0, decorators_1.memoize)({
315
324
  shouldCache() {
325
+ // only cache if we have hooks directories, the only case to
326
+ // not have hooks directories is when the project dir is
327
+ // not set yet, ie. when creating a project.
316
328
  return !!this.hooksDirectories.length;
317
329
  },
318
330
  })
319
331
  ], HooksService.prototype, "initialize", null);
320
332
  yok_1.injector.register("hooksService", HooksService);
333
+ //# sourceMappingURL=hooks-service.js.map
@@ -34,3 +34,4 @@ class IOSNotificationService {
34
34
  }
35
35
  exports.IOSNotificationService = IOSNotificationService;
36
36
  yok_1.injector.register("iOSNotificationService", IOSNotificationService);
37
+ //# sourceMappingURL=ios-notification-service.js.map
@@ -25,6 +25,8 @@ class JsonFileSettingsService {
25
25
  const dataToReturn = data.modifiedByCacheMechanism ? data.value : data;
26
26
  if (cacheOpts && cacheOpts.cacheTimeout) {
27
27
  if (!data.modifiedByCacheMechanism) {
28
+ // If data has no cache, but we want to check the timeout, consider the data as outdated.
29
+ // this should be a really rare case
28
30
  return null;
29
31
  }
30
32
  const currentTime = Date.now();
@@ -82,6 +84,8 @@ class JsonFileSettingsService {
82
84
  if (!this.$fs.exists(this.jsonSettingsFilePath)) {
83
85
  const unexistingDirs = this.getUnexistingDirectories(this.jsonSettingsFilePath);
84
86
  this.$fs.writeFile(this.jsonSettingsFilePath, null);
87
+ // when running under 'sudo' we create the <path to home dir>/.local/share/.nativescript-cli dir with root as owner
88
+ // and other Applications cannot access this directory anymore. (bower/heroku/etc)
85
89
  if (process.env.SUDO_USER) {
86
90
  for (const dir of unexistingDirs) {
87
91
  await this.$fs.setCurrentUserAsOwner(dir, process.env.SUDO_USER);
@@ -101,6 +105,7 @@ class JsonFileSettingsService {
101
105
  const unexistingDirs = [];
102
106
  let currentDir = path.join(filePath, "..");
103
107
  while (true) {
108
+ // this directory won't be created.
104
109
  if (this.$fs.exists(currentDir)) {
105
110
  break;
106
111
  }
@@ -112,3 +117,4 @@ class JsonFileSettingsService {
112
117
  }
113
118
  exports.JsonFileSettingsService = JsonFileSettingsService;
114
119
  yok_1.injector.register("jsonFileSettingsService", JsonFileSettingsService, false);
120
+ //# sourceMappingURL=json-file-settings-service.js.map
@@ -22,6 +22,7 @@ class LockService {
22
22
  }
23
23
  get defaultLockParams() {
24
24
  const lockParams = {
25
+ // https://www.npmjs.com/package/retry#retrytimeoutsoptions
25
26
  retriesObj: { retries: 13, minTimeout: 100, maxTimeout: 1000, factor: 2 },
26
27
  stale: 10 * 1000,
27
28
  realpath: false,
@@ -72,6 +73,8 @@ class LockService {
72
73
  }
73
74
  }
74
75
  getPathsForCleanupAction(lockPath) {
76
+ // The proper-lockfile creates directory with the passed name and `.lock` at the end.
77
+ // Ensure we will take care of it as well.
75
78
  return [lockPath, `${lockPath}.lock`];
76
79
  }
77
80
  getLockFileSettings(filePath, fileOpts) {
@@ -87,6 +90,7 @@ class LockService {
87
90
  fileOpts.retriesObj.retries = fileOpts.retries;
88
91
  }
89
92
  if (fileOpts.retryWait) {
93
+ // backwards compatibility
90
94
  fileOpts.retriesObj.minTimeout = fileOpts.retriesObj.maxTimeout =
91
95
  fileOpts.retryWait;
92
96
  }
@@ -109,4 +113,6 @@ __decorate([
109
113
  (0, decorators_1.cache)()
110
114
  ], LockService.prototype, "defaultLockFilePath", null);
111
115
  yok_1.injector.register("lockService", LockService);
116
+ // backwards compatibility
112
117
  yok_1.injector.register("lockfile", LockService);
118
+ //# sourceMappingURL=lock-service.js.map
@@ -70,3 +70,4 @@ class MessageContractGenerator {
70
70
  }
71
71
  exports.MessageContractGenerator = MessageContractGenerator;
72
72
  yok_1.injector.register("messageContractGenerator", MessageContractGenerator);
73
+ //# sourceMappingURL=message-contract-generator.js.map
@@ -75,3 +75,4 @@ class MessagesService {
75
75
  }
76
76
  exports.MessagesService = MessagesService;
77
77
  yok_1.injector.register("messagesService", MessagesService);
78
+ //# sourceMappingURL=messages-service.js.map
@@ -9,11 +9,15 @@ const _ = require("lodash");
9
9
  class MicroTemplateService {
10
10
  constructor($injector) {
11
11
  this.$injector = $injector;
12
+ // Injector's dynamicCallRegex doesn't have 'g' option, which we need here.
13
+ // Use ( ) in order to use $1 to get whole expression later
12
14
  this.dynamicCallRegex = new RegExp(util.format("(%s)", this.$injector.dynamicCallRegex.source), "g");
13
15
  }
14
16
  async parseContent(data, options) {
15
17
  const localVariables = this.getLocalVariables(options);
16
18
  const compiledTemplate = _.template(data.replace(this.dynamicCallRegex, 'this.$injector.getDynamicCallData("$1")'));
19
+ // When debugging parsing, uncomment the line below:
20
+ // console.log(compiledTemplate.source);
17
21
  return await compiledTemplate.apply(this, [localVariables]);
18
22
  }
19
23
  isPlatform(...args) {
@@ -22,6 +26,7 @@ class MicroTemplateService {
22
26
  }
23
27
  getLocalVariables(options) {
24
28
  const isHtml = options.isHtml;
29
+ // in html help we want to show all help. Only CONSOLE specific help(wrapped in if(isConsole) ) must be omitted
25
30
  const localVariables = {
26
31
  constants,
27
32
  };
@@ -36,3 +41,4 @@ class MicroTemplateService {
36
41
  }
37
42
  exports.MicroTemplateService = MicroTemplateService;
38
43
  yok_1.injector.register("microTemplateService", MicroTemplateService);
44
+ //# sourceMappingURL=micro-templating-service.js.map
@@ -14,6 +14,7 @@ class Net {
14
14
  }
15
15
  async getFreePort() {
16
16
  const server = net.createServer((sock) => {
17
+ /* empty - noone will connect here */
17
18
  });
18
19
  return new Promise((resolve, reject) => {
19
20
  let isResolved = false;
@@ -45,6 +46,7 @@ class Net {
45
46
  });
46
47
  server.once("close", () => {
47
48
  if (!isResolved) {
49
+ // "close" will be emitted right after "error"
48
50
  isResolved = true;
49
51
  resolve(true);
50
52
  }
@@ -118,3 +120,4 @@ class Net {
118
120
  exports.Net = Net;
119
121
  Net.DEFAULT_INTERVAL = 1000;
120
122
  yok_1.injector.register("net", Net);
123
+ //# sourceMappingURL=net-service.js.map
@@ -53,6 +53,7 @@ class ProjectFilesManager {
53
53
  this.processPlatformSpecificFilesCore(platform, files, projectFilesConfig);
54
54
  }
55
55
  processPlatformSpecificFilesCore(platform, files, projectFilesConfig) {
56
+ // Renames the files that have `platform` as substring and removes the files from other platform
56
57
  _.each(files, (filePath) => {
57
58
  const projectFileInfo = this.$projectFilesProvider.getProjectFileInfo(filePath, platform, projectFilesConfig);
58
59
  if (!projectFileInfo.shouldIncludeFile) {
@@ -60,6 +61,7 @@ class ProjectFilesManager {
60
61
  }
61
62
  else if (projectFileInfo.onDeviceFileName) {
62
63
  const onDeviceFilePath = path.join(path.dirname(filePath), projectFileInfo.onDeviceFileName);
64
+ // Fix .js.map entries
63
65
  const extension = path.extname(projectFileInfo.onDeviceFileName);
64
66
  if (onDeviceFilePath !== filePath) {
65
67
  if (extension === ".js" || extension === ".map") {
@@ -73,6 +75,8 @@ class ProjectFilesManager {
73
75
  fileContent = fileContent.replace(new RegExp(oldName, "g"), newName);
74
76
  this.$fs.writeFile(filePath, fileContent);
75
77
  }
78
+ // Rename the file
79
+ // this.$fs.rename is not called as it is error prone on some systems with slower hard drives and rigorous antivirus software
76
80
  this.$fs.writeFile(onDeviceFilePath, this.$fs.readText(filePath));
77
81
  this.$fs.deleteFile(filePath);
78
82
  }
@@ -85,3 +89,4 @@ class ProjectFilesManager {
85
89
  }
86
90
  exports.ProjectFilesManager = ProjectFilesManager;
87
91
  yok_1.injector.register("projectFilesManager", ProjectFilesManager);
92
+ //# sourceMappingURL=project-files-manager.js.map
@@ -52,3 +52,4 @@ class ProjectFilesProviderBase {
52
52
  }
53
53
  }
54
54
  exports.ProjectFilesProviderBase = ProjectFilesProviderBase;
55
+ //# sourceMappingURL=project-files-provider-base.js.map
@@ -51,3 +51,4 @@ class ProxyService {
51
51
  }
52
52
  exports.ProxyService = ProxyService;
53
53
  yok_1.injector.register("proxyService", ProxyService);
54
+ //# sourceMappingURL=proxy-service.js.map
@@ -26,3 +26,4 @@ class QrCodeGenerator {
26
26
  }
27
27
  exports.QrCodeGenerator = QrCodeGenerator;
28
28
  yok_1.injector.register("qr", QrCodeGenerator);
29
+ //# sourceMappingURL=qr.js.map
@@ -40,3 +40,4 @@ __decorate([
40
40
  (0, decorators_1.exported)("settingsService")
41
41
  ], SettingsService.prototype, "setSettings", null);
42
42
  yok_1.injector.register("settingsService", SettingsService);
43
+ //# sourceMappingURL=settings-service.js.map
@@ -45,3 +45,4 @@ __decorate([
45
45
  (0, decorators_1.cache)()
46
46
  ], XcodeSelectService.prototype, "getXcodeVersion", null);
47
47
  yok_1.injector.register("xcodeSelectService", XcodeSelectService);
48
+ //# sourceMappingURL=xcode-select-service.js.map
@@ -36,3 +36,4 @@ function capitalizeFirstLetter(value) {
36
36
  return value.charAt(0).toUpperCase() + value.slice(1);
37
37
  }
38
38
  yok_1.injector.register("utils", Utils);
39
+ //# sourceMappingURL=utils.js.map
@@ -86,3 +86,4 @@ ProjectNameValidator.INVALID_FILENAMES = [
86
86
  ];
87
87
  ProjectNameValidator.INVALID_EXTENSIONS = [];
88
88
  yok_1.injector.register("projectNameValidator", ProjectNameValidator);
89
+ //# sourceMappingURL=project-name-validator.js.map
@@ -14,3 +14,4 @@ class ValidationResult {
14
14
  }
15
15
  exports.ValidationResult = ValidationResult;
16
16
  ValidationResult.Successful = new ValidationResult(null);
17
+ //# sourceMappingURL=validation-result.js.map
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ // This function must be separate to avoid dependencies on C++ modules - it must execute precisely when other functions cannot
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.verifyNodeVersion = verifyNodeVersion;
4
5
  exports.getNodeWarning = getNodeWarning;
5
6
  const color_1 = require("../color");
7
+ // Use only ES5 code here - pure JavaScript can be executed with any Node.js version (even 0.10, 0.12).
8
+ /* tslint:disable:no-var-keyword no-var-requires prefer-const*/
6
9
  var os = require("os");
7
10
  var semver = require("semver");
8
11
  var util = require("util");
12
+ // These versions cannot be used with CLI due to bugs in the node itself.
13
+ // We are absolutely sure we cannot work with them, so inform the user if he is trying to use any of them and exit the process.
9
14
  var versionsCausingFailure = ["0.10.34", "4.0.0", "4.2.0", "5.0.0"];
10
15
  var minimumRequiredVersion = "8.0.0";
11
16
  function getNodeVersionOpts() {
@@ -69,9 +74,11 @@ function getNodeWarning() {
69
74
  if (warningMessage) {
70
75
  nodeWarn = {
71
76
  message: warningMessage,
72
- severity: "medium",
77
+ severity: "medium" /* SystemWarningsSeverity.medium */,
73
78
  };
74
79
  }
75
80
  }
76
81
  return nodeWarn;
77
82
  }
83
+ /* tslint:enable */
84
+ //# sourceMappingURL=verify-node-version.js.map