nativescript 9.1.0-alpha.15 → 9.1.0-alpha.16

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 (344) hide show
  1. package/docs/build-jekyll-md.sh +1 -1
  2. package/docs/man_pages/config/config-set.md +2 -0
  3. package/lib/android-tools-info.js +0 -12
  4. package/lib/base-package-manager.js +0 -7
  5. package/lib/bootstrap.js +1 -5
  6. package/lib/bun-package-manager.js +1 -14
  7. package/lib/color.js +0 -4
  8. package/lib/commands/add-platform.js +0 -1
  9. package/lib/commands/apple-login.js +0 -1
  10. package/lib/commands/appstore-list.js +0 -1
  11. package/lib/commands/appstore-upload.js +0 -3
  12. package/lib/commands/build.js +3 -3
  13. package/lib/commands/clean.js +1 -22
  14. package/lib/commands/command-base.js +0 -1
  15. package/lib/commands/config.js +0 -5
  16. package/lib/commands/create-project.js +0 -6
  17. package/lib/commands/debug.js +2 -6
  18. package/lib/commands/deploy.js +3 -3
  19. package/lib/commands/embedding/embed.js +0 -7
  20. package/lib/commands/extensibility/install-extension.js +0 -1
  21. package/lib/commands/extensibility/list-extensions.js +0 -1
  22. package/lib/commands/extensibility/uninstall-extension.js +0 -1
  23. package/lib/commands/fonts.js +0 -1
  24. package/lib/commands/generate-assets.js +0 -1
  25. package/lib/commands/generate-help.js +0 -1
  26. package/lib/commands/generate.js +1 -48
  27. package/lib/commands/hooks/common.js +1 -2
  28. package/lib/commands/hooks/hooks-lock.js +0 -1
  29. package/lib/commands/hooks/hooks.js +0 -1
  30. package/lib/commands/info.js +0 -1
  31. package/lib/commands/install.js +0 -1
  32. package/lib/commands/list-platforms.js +0 -1
  33. package/lib/commands/migrate.js +0 -1
  34. package/lib/commands/native-add.js +0 -5
  35. package/lib/commands/platform-clean.js +0 -1
  36. package/lib/commands/plugin/add-plugin.js +0 -1
  37. package/lib/commands/plugin/build-plugin.js +0 -1
  38. package/lib/commands/plugin/create-plugin.js +0 -5
  39. package/lib/commands/plugin/list-plugins.js +0 -1
  40. package/lib/commands/plugin/remove-plugin.js +0 -2
  41. package/lib/commands/plugin/update-plugin.js +0 -1
  42. package/lib/commands/post-install.js +0 -6
  43. package/lib/commands/prepare.js +5 -5
  44. package/lib/commands/preview.js +0 -2
  45. package/lib/commands/remove-platform.js +0 -1
  46. package/lib/commands/resources/resources-update.js +0 -2
  47. package/lib/commands/run.js +0 -1
  48. package/lib/commands/setup.js +0 -1
  49. package/lib/commands/start.js +0 -1
  50. package/lib/commands/test-init.js +0 -4
  51. package/lib/commands/test.js +3 -9
  52. package/lib/commands/typings.js +1 -2
  53. package/lib/commands/update-platform.js +0 -5
  54. package/lib/commands/update.js +0 -2
  55. package/lib/commands/widget.js +0 -18
  56. package/lib/common/bootstrap.js +0 -1
  57. package/lib/common/child-process.js +0 -3
  58. package/lib/common/codeGeneration/code-entity.js +0 -1
  59. package/lib/common/codeGeneration/code-printer.js +0 -1
  60. package/lib/common/command-params.js +0 -1
  61. package/lib/common/commands/analytics.js +0 -3
  62. package/lib/common/commands/autocompletion.js +0 -3
  63. package/lib/common/commands/device/device-log-stream.js +0 -1
  64. package/lib/common/commands/device/get-file.js +0 -2
  65. package/lib/common/commands/device/list-applications.js +0 -1
  66. package/lib/common/commands/device/list-devices.js +0 -3
  67. package/lib/common/commands/device/list-files.js +0 -2
  68. package/lib/common/commands/device/put-file.js +0 -2
  69. package/lib/common/commands/device/run-application.js +0 -1
  70. package/lib/common/commands/device/stop-application.js +0 -1
  71. package/lib/common/commands/device/uninstall-application.js +0 -1
  72. package/lib/common/commands/doctor.js +3 -3
  73. package/lib/common/commands/generate-messages.js +0 -1
  74. package/lib/common/commands/help.js +0 -1
  75. package/lib/common/commands/package-manager-get.js +0 -1
  76. package/lib/common/commands/package-manager-set.js +0 -1
  77. package/lib/common/commands/post-install.js +0 -1
  78. package/lib/common/commands/preuninstall.js +2 -11
  79. package/lib/common/commands/proxy/proxy-base.js +0 -4
  80. package/lib/common/commands/proxy/proxy-clear.js +0 -1
  81. package/lib/common/commands/proxy/proxy-get.js +0 -1
  82. package/lib/common/commands/proxy/proxy-set.js +0 -1
  83. package/lib/common/common-lib.js +0 -1
  84. package/lib/common/constants.js +14 -12
  85. package/lib/common/declarations.d.ts +37 -117
  86. package/lib/common/decorators.js +0 -48
  87. package/lib/common/definitions/key-commands.js +8 -0
  88. package/lib/common/dispatchers.js +1 -10
  89. package/lib/common/enums.js +42 -0
  90. package/lib/common/errors.js +4 -13
  91. package/lib/common/file-system.js +2 -13
  92. package/lib/common/header.js +0 -3
  93. package/lib/common/helpers.js +3 -89
  94. package/lib/common/host-info.js +0 -4
  95. package/lib/common/http-client.js +0 -20
  96. package/lib/common/logger/appenders/cli-appender.js +0 -4
  97. package/lib/common/logger/appenders/emit-appender.js +0 -4
  98. package/lib/common/logger/layouts/cli-layout.js +0 -1
  99. package/lib/common/logger/logger.js +0 -5
  100. package/lib/common/messages/messages.js +0 -6
  101. package/lib/common/mobile/android/android-application-manager.js +1 -20
  102. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
  103. package/lib/common/mobile/android/android-debug-bridge.js +0 -6
  104. package/lib/common/mobile/android/android-device-file-system.js +0 -4
  105. package/lib/common/mobile/android/android-device-hash-service.js +0 -3
  106. package/lib/common/mobile/android/android-device.js +0 -8
  107. package/lib/common/mobile/android/android-emulator-services.js +1 -2
  108. package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
  109. package/lib/common/mobile/android/android-log-filter.js +0 -4
  110. package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
  111. package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
  112. package/lib/common/mobile/android/genymotion/genymotion-service.js +1 -6
  113. package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
  114. package/lib/common/mobile/android/logcat-helper.js +0 -13
  115. package/lib/common/mobile/application-manager-base.js +0 -6
  116. package/lib/common/mobile/device-emitter.js +0 -4
  117. package/lib/common/mobile/device-log-emitter.js +0 -1
  118. package/lib/common/mobile/device-log-provider-base.js +0 -1
  119. package/lib/common/mobile/device-log-provider.js +0 -23
  120. package/lib/common/mobile/device-platforms-constants.js +0 -1
  121. package/lib/common/mobile/emulator-helper.js +0 -3
  122. package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
  123. package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -9
  124. package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
  125. package/lib/common/mobile/ios/device/ios-device.js +0 -4
  126. package/lib/common/mobile/ios/ios-device-base.js +0 -1
  127. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
  128. package/lib/common/mobile/ios/ios-log-filter.js +0 -1
  129. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
  130. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
  131. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
  132. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
  133. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
  134. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
  135. package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
  136. package/lib/common/mobile/log-filter.js +0 -2
  137. package/lib/common/mobile/logging-levels.js +0 -1
  138. package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
  139. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
  140. package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
  141. package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
  142. package/lib/common/mobile/mobile-core/devices-service.js +0 -69
  143. package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
  144. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
  145. package/lib/common/mobile/mobile-helper.js +0 -1
  146. package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
  147. package/lib/common/opener.js +0 -1
  148. package/lib/common/os-info.js +0 -1
  149. package/lib/common/plist-parser.js +0 -1
  150. package/lib/common/project-helper.js +0 -1
  151. package/lib/common/prompter.js +1 -9
  152. package/lib/common/queue.js +0 -1
  153. package/lib/common/resource-loader.js +0 -1
  154. package/lib/common/services/analytics/google-analytics-custom-dimensions.js +13 -0
  155. package/lib/common/services/auto-completion-service.js +1 -13
  156. package/lib/common/services/cancellation.js +2 -2
  157. package/lib/common/services/commands-service.js +8 -17
  158. package/lib/common/services/help-service.js +4 -11
  159. package/lib/common/services/hooks-service.js +0 -13
  160. package/lib/common/services/ios-notification-service.js +0 -1
  161. package/lib/common/services/json-file-settings-service.js +0 -6
  162. package/lib/common/services/lock-service.js +0 -6
  163. package/lib/common/services/message-contract-generator.js +0 -1
  164. package/lib/common/services/messages-service.js +0 -1
  165. package/lib/common/services/micro-templating-service.js +0 -6
  166. package/lib/common/services/net-service.js +0 -3
  167. package/lib/common/services/project-files-manager.js +0 -5
  168. package/lib/common/services/project-files-provider-base.js +0 -1
  169. package/lib/common/services/proxy-service.js +0 -1
  170. package/lib/common/services/qr.js +0 -1
  171. package/lib/common/services/settings-service.js +0 -1
  172. package/lib/common/services/xcode-select-service.js +0 -1
  173. package/lib/common/utils.js +0 -1
  174. package/lib/common/validators/project-name-validator.js +0 -1
  175. package/lib/common/validators/validation-result.js +0 -1
  176. package/lib/common/verify-node-version.js +2 -8
  177. package/lib/common/yok.js +12 -32
  178. package/lib/config.js +1 -22
  179. package/lib/constants-provider.js +0 -1
  180. package/lib/constants.js +54 -58
  181. package/lib/controllers/build-controller.js +3 -4
  182. package/lib/controllers/debug-controller.js +3 -8
  183. package/lib/controllers/deploy-controller.js +0 -1
  184. package/lib/controllers/migrate-controller.js +4 -90
  185. package/lib/controllers/platform-controller.js +2 -9
  186. package/lib/controllers/prepare-controller.js +8 -24
  187. package/lib/controllers/run-controller.js +1 -81
  188. package/lib/controllers/update-controller-base.js +0 -1
  189. package/lib/controllers/update-controller.js +0 -11
  190. package/lib/data/build-data.js +0 -1
  191. package/lib/data/controller-data-base.js +0 -1
  192. package/lib/data/debug-data.js +0 -1
  193. package/lib/data/platform-data.js +0 -1
  194. package/lib/data/prepare-data.js +0 -1
  195. package/lib/data/run-data.js +0 -1
  196. package/lib/definitions/project.d.ts +1 -6
  197. package/lib/definitions/system-warnings.js +8 -0
  198. package/lib/detached-processes/cleanup-js-subprocess.js +3 -8
  199. package/lib/detached-processes/cleanup-process.js +15 -18
  200. package/lib/detached-processes/detached-process-enums.js +24 -0
  201. package/lib/detached-processes/file-log-service.js +2 -2
  202. package/lib/device-path-provider.js +0 -1
  203. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
  204. package/lib/device-sockets/ios/notification.js +0 -3
  205. package/lib/device-sockets/ios/socket-request-executor.js +0 -3
  206. package/lib/helpers/android-bundle-validator-helper.js +1 -2
  207. package/lib/helpers/deploy-command-helper.js +0 -1
  208. package/lib/helpers/key-command-helper.js +3 -4
  209. package/lib/helpers/livesync-command-helper.js +2 -4
  210. package/lib/helpers/network-connectivity-validator.js +0 -1
  211. package/lib/helpers/options-track-helper.js +4 -3
  212. package/lib/helpers/package-path-helper.js +0 -1
  213. package/lib/helpers/platform-command-helper.js +2 -7
  214. package/lib/helpers/version-validator-helper.js +0 -1
  215. package/lib/key-commands/bootstrap.js +3 -3
  216. package/lib/key-commands/index.js +5 -5
  217. package/lib/nativescript-cli-lib-bootstrap.js +0 -4
  218. package/lib/nativescript-cli-lib.js +0 -1
  219. package/lib/nativescript-cli.js +2 -11
  220. package/lib/node/pbxproj-dom-xcode.js +0 -1
  221. package/lib/node/xcode.js +0 -1
  222. package/lib/node-package-manager.js +1 -11
  223. package/lib/options.js +121 -145
  224. package/lib/package-installation-manager.js +1 -8
  225. package/lib/package-manager.js +0 -2
  226. package/lib/platform-command-param.js +0 -1
  227. package/lib/pnpm-package-manager.js +1 -4
  228. package/lib/project-data.js +0 -12
  229. package/lib/providers/project-files-provider.js +0 -1
  230. package/lib/resolvers/livesync-service-resolver.js +0 -1
  231. package/lib/services/analytics/analytics-broker-process.js +8 -10
  232. package/lib/services/analytics/analytics-broker.js +2 -2
  233. package/lib/services/analytics/analytics-service.js +29 -29
  234. package/lib/services/analytics/google-analytics-provider.js +16 -13
  235. package/lib/services/analytics-settings-service.js +0 -5
  236. package/lib/services/android/android-bundle-tool-service.js +0 -1
  237. package/lib/services/android/gradle-build-args-service.js +0 -3
  238. package/lib/services/android/gradle-build-service.js +0 -1
  239. package/lib/services/android/gradle-command-service.js +0 -1
  240. package/lib/services/android-device-debug-service.js +0 -6
  241. package/lib/services/android-plugin-build-service.js +2 -31
  242. package/lib/services/android-project-service.js +4 -71
  243. package/lib/services/android-resources-migration-service.js +0 -7
  244. package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
  245. package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
  246. package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
  247. package/lib/services/apple-portal/srp/srp-wrapper.js +1 -4
  248. package/lib/services/assets-generation/assets-generation-service.js +13 -11
  249. package/lib/services/build-artifacts-service.js +1 -2
  250. package/lib/services/build-data-service.js +0 -1
  251. package/lib/services/build-info-file-service.js +0 -1
  252. package/lib/services/bundler/bundler-compiler-service.js +1 -144
  253. package/lib/services/bundler/bundler.js +0 -1
  254. package/lib/services/cleanup-service.js +10 -13
  255. package/lib/services/cocoapods-platform-manager.js +0 -9
  256. package/lib/services/cocoapods-service.js +1 -21
  257. package/lib/services/debug-data-service.js +0 -1
  258. package/lib/services/debug-service-base.js +0 -7
  259. package/lib/services/device/device-install-app-service.js +1 -2
  260. package/lib/services/doctor-service.js +6 -21
  261. package/lib/services/extensibility-service.js +0 -8
  262. package/lib/services/files-hash-service.js +0 -1
  263. package/lib/services/hmr-status-service.js +0 -2
  264. package/lib/services/info-service.js +0 -1
  265. package/lib/services/initialize-service.js +2 -5
  266. package/lib/services/ios/export-options-plist-service.js +0 -4
  267. package/lib/services/ios/ios-signing-service.js +0 -4
  268. package/lib/services/ios/spm-service.js +0 -119
  269. package/lib/services/ios/xcodebuild-args-service.js +0 -29
  270. package/lib/services/ios/xcodebuild-command-service.js +0 -3
  271. package/lib/services/ios/xcodebuild-service.js +1 -2
  272. package/lib/services/ios-debugger-port-service.js +0 -1
  273. package/lib/services/ios-device-debug-service.js +0 -1
  274. package/lib/services/ios-entitlements-service.js +0 -1
  275. package/lib/services/ios-extensions-service.js +0 -1
  276. package/lib/services/ios-log-filter.js +0 -20
  277. package/lib/services/ios-native-target-service.js +5 -6
  278. package/lib/services/ios-project-service.js +7 -133
  279. package/lib/services/ios-provision-service.js +0 -3
  280. package/lib/services/ios-watch-app-service.js +10 -60
  281. package/lib/services/ip-service.js +0 -2
  282. package/lib/services/itmstransporter-service.js +0 -1
  283. package/lib/services/karma-execution.js +0 -2
  284. package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
  285. package/lib/services/livesync/android-device-livesync-service.js +0 -2
  286. package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
  287. package/lib/services/livesync/android-livesync-service.js +0 -1
  288. package/lib/services/livesync/android-livesync-tool.js +0 -4
  289. package/lib/services/livesync/device-livesync-service-base.js +0 -2
  290. package/lib/services/livesync/ios-device-livesync-service.js +0 -7
  291. package/lib/services/livesync/ios-livesync-service.js +0 -55
  292. package/lib/services/livesync/livesync-socket.js +0 -1
  293. package/lib/services/livesync/platform-livesync-service-base.js +0 -5
  294. package/lib/services/livesync-process-data-service.js +0 -1
  295. package/lib/services/log-parser-service.js +0 -1
  296. package/lib/services/log-source-map-service.js +0 -15
  297. package/lib/services/marking-mode-service.js +10 -8
  298. package/lib/services/metadata-filtering-service.js +0 -1
  299. package/lib/services/npm-config-service.js +0 -4
  300. package/lib/services/pacote-service.js +0 -7
  301. package/lib/services/performance-service.js +2 -3
  302. package/lib/services/platform/add-platform-service.js +2 -49
  303. package/lib/services/platform/platform-validation-service.js +0 -1
  304. package/lib/services/platform/prepare-native-platform-service.js +3 -5
  305. package/lib/services/platform-environment-requirements.js +4 -8
  306. package/lib/services/platform-project-service-base.js +0 -1
  307. package/lib/services/platforms-data-service.js +0 -1
  308. package/lib/services/plugins-service.js +2 -20
  309. package/lib/services/prepare-data-service.js +0 -1
  310. package/lib/services/project-backup-service.js +0 -4
  311. package/lib/services/project-changes-service.js +3 -14
  312. package/lib/services/project-cleanup-service.js +0 -2
  313. package/lib/services/project-config-service.js +2 -21
  314. package/lib/services/project-data-service.js +7 -36
  315. package/lib/services/project-name-service.js +0 -1
  316. package/lib/services/project-service.js +0 -10
  317. package/lib/services/project-templates-service.js +2 -3
  318. package/lib/services/qr-code-terminal-service.js +0 -1
  319. package/lib/services/require-service.js +0 -1
  320. package/lib/services/start-service.js +0 -1
  321. package/lib/services/temp-service.js +0 -3
  322. package/lib/services/terminal-spinner-service.js +0 -2
  323. package/lib/services/test-execution-service.js +3 -9
  324. package/lib/services/test-initialization-service.js +0 -4
  325. package/lib/services/timeline-profiler-service.js +0 -1
  326. package/lib/services/user-settings-service.js +0 -1
  327. package/lib/services/versions-service.js +5 -6
  328. package/lib/services/watch-ignore-list-service.js +0 -1
  329. package/lib/services/xcconfig-service.js +45 -12
  330. package/lib/services/xcproj-service.js +0 -1
  331. package/lib/shared-event-bus.js +0 -6
  332. package/lib/sys-info.js +2 -2
  333. package/lib/tools/config-manipulation/config-transformer.js +0 -12
  334. package/lib/tools/node-modules/node-modules-builder.js +0 -1
  335. package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
  336. package/lib/yarn-package-manager.js +0 -1
  337. package/lib/yarn2-package-manager.js +0 -3
  338. package/package.json +7 -18
  339. package/lib/.d.ts +0 -504
  340. package/lib/common/definitions/key-commands.d.ts +0 -62
  341. package/lib/common/services/analytics/google-analytics-custom-dimensions.d.ts +0 -16
  342. package/lib/definitions/system-warnings.d.ts +0 -4
  343. package/lib/detached-processes/detached-process-enums.d.ts +0 -70
  344. package/lib/services/analytics/google-analytics-cross-client-custom-dimensions.d.ts +0 -6
@@ -9,32 +9,6 @@ exports.performanceLog = performanceLog;
9
9
  exports.deprecated = deprecated;
10
10
  const constants_1 = require("../constants");
11
11
  const yok_1 = require("./yok");
12
- /**
13
- * Caches the result of the first execution of the method and returns it whenever it is called instead of executing it again.
14
- * Works with methods and getters.
15
- * @example
16
- * ```
17
- * class CacheDecoratorsTest {
18
- *
19
- * @cache()
20
- * public method(num: number): number {
21
- * return num;
22
- * }
23
- *
24
- * @cache()
25
- * public get property(): any {
26
- * // execute some heavy operation.
27
- * return result;
28
- * }
29
- * }
30
- *
31
- * const instance = new CacheDecoratorsTest();
32
- * const result = instance.method(1); // returns 1;
33
- *
34
- * // all consecutive calls to instance.method will return 1.
35
- * const result2 = instance.method(2); // returns 1;
36
- * ```
37
- */
38
12
  function cache() {
39
13
  return (target, propertyKey, descriptor) => {
40
14
  let result;
@@ -54,7 +28,6 @@ function cache() {
54
28
  let memoizeIDCounter = 0;
55
29
  function memoize(options) {
56
30
  return (target, propertyKey, descriptor) => {
57
- // todo: remove once surely working as intended.
58
31
  const DEBUG = false;
59
32
  const memoizeID = memoizeIDCounter++;
60
33
  const valueOrGet = descriptor.value ? "value" : "get";
@@ -75,7 +48,6 @@ function memoize(options) {
75
48
  cacheMapName,
76
49
  hashKey,
77
50
  });
78
- // initialize cache map if not exists
79
51
  if (!this.hasOwnProperty(cacheMapName)) {
80
52
  DEBUG && console.log("NO CACHE MAP YET, CREATING ONE NOW");
81
53
  Object.defineProperty(this, cacheMapName, {
@@ -90,16 +62,12 @@ function memoize(options) {
90
62
  console.log({
91
63
  cacheMap,
92
64
  });
93
- // check if has memoized value based on hashFn
94
65
  if (cacheMap.has(hashKey)) {
95
66
  DEBUG && console.log("CACHE HIT");
96
- // if yes, return cached value
97
67
  return cacheMap.get(hashKey);
98
68
  }
99
69
  DEBUG && console.log("CACHE MISS");
100
- // if not call original and get result
101
70
  const result = originalMethod.apply(this, args);
102
- // call shouldCache (if passed) with the result or default to true
103
71
  let shouldCache = true;
104
72
  if (options.shouldCache) {
105
73
  shouldCache = options.shouldCache.call(this, result);
@@ -109,21 +77,12 @@ function memoize(options) {
109
77
  DEBUG && console.log("CACHING NOW");
110
78
  cacheMap.set(hashKey, result);
111
79
  }
112
- // if shouldCache: save result
113
80
  DEBUG && console.log("RETURNING", result);
114
81
  return result;
115
82
  };
116
83
  return descriptor;
117
84
  };
118
85
  }
119
- /**
120
- * Calls specific method of the instance before executing the decorated method.
121
- * This is usable when some of your methods depend on initialize async method, that cannot be invoked in constructor of the class.
122
- * IMPORTANT: The decorated method must be async.
123
- * @param {string} methodName The name of the method that will be invoked before calling the decorated method.
124
- * @param {any[]} methodArgs Args that will be passed to the method that will be invoked before calling the decorated one.
125
- * @return {any} Result of the decorated method.
126
- */
127
86
  function invokeBefore(methodName, methodArgs) {
128
87
  return (target, propertyKey, descriptor) => {
129
88
  const originalValue = descriptor.value;
@@ -155,7 +114,6 @@ function performanceLog(localInjector) {
155
114
  const className = target.constructor.name;
156
115
  const trackName = `${className}${constants_1.AnalyticsEventLabelDelimiter}${propertyKey}`;
157
116
  const performanceService = localInjector.resolve("performanceService");
158
- //needed for the returned function to have the same name as the original - used in hooks decorator
159
117
  const functionWrapper = {
160
118
  [originalMethod.name]: function (...args) {
161
119
  const start = performanceService.now();
@@ -181,14 +139,12 @@ function performanceLog(localInjector) {
181
139
  },
182
140
  };
183
141
  descriptor.value = functionWrapper[originalMethod.name];
184
- // used to get parameter names in hooks decorator
185
142
  descriptor.value.toString = () => {
186
143
  return originalMethod.toString();
187
144
  };
188
145
  return descriptor;
189
146
  };
190
147
  }
191
- // inspired by https://github.com/NativeScript/NativeScript/blob/55dfe25938569edbec89255008e5ad9804901305/tns-core-modules/globals/globals.ts#L121-L137
192
148
  function deprecated(additionalInfo, localInjector) {
193
149
  const isDeprecatedMessage = " is deprecated.";
194
150
  return (target, key, descriptor) => {
@@ -197,7 +153,6 @@ function deprecated(additionalInfo, localInjector) {
197
153
  const $logger = localInjector.resolve("logger");
198
154
  if (descriptor) {
199
155
  if (descriptor.value) {
200
- // method
201
156
  const originalMethod = descriptor.value;
202
157
  descriptor.value = function (...args) {
203
158
  $logger.warn(`${key.toString()}${isDeprecatedMessage} ${additionalInfo}`);
@@ -206,7 +161,6 @@ function deprecated(additionalInfo, localInjector) {
206
161
  return descriptor;
207
162
  }
208
163
  else {
209
- // property
210
164
  if (descriptor.set) {
211
165
  const originalSetter = descriptor.set;
212
166
  descriptor.set = function (...args) {
@@ -225,7 +179,6 @@ function deprecated(additionalInfo, localInjector) {
225
179
  }
226
180
  }
227
181
  else {
228
- // class
229
182
  $logger.warn(`${(target &&
230
183
  (target.name ||
231
184
  (target.constructor && target.constructor.name))) ||
@@ -234,4 +187,3 @@ function deprecated(additionalInfo, localInjector) {
234
187
  }
235
188
  };
236
189
  }
237
- //# sourceMappingURL=decorators.js.map
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpecialKeys = void 0;
4
+ var SpecialKeys;
5
+ (function (SpecialKeys) {
6
+ SpecialKeys["CtrlC"] = "\u0003";
7
+ SpecialKeys["QuestionMark"] = "?";
8
+ })(SpecialKeys || (exports.SpecialKeys = SpecialKeys = {}));
@@ -15,9 +15,7 @@ const yok_1 = require("./yok");
15
15
  const constants_1 = require("../constants");
16
16
  const semver = require("semver");
17
17
  class CommandDispatcher {
18
- constructor($logger,
19
- // required by the hooksService
20
- $injector, $cancellation, $commandsService, $staticConfig, $sysInfo, $options, $versionsService, $packageManager, $terminalSpinnerService) {
18
+ constructor($logger, $injector, $cancellation, $commandsService, $staticConfig, $sysInfo, $options, $versionsService, $packageManager, $terminalSpinnerService) {
21
19
  this.$logger = $logger;
22
20
  this.$injector = $injector;
23
21
  this.$cancellation = $cancellation;
@@ -34,7 +32,6 @@ class CommandDispatcher {
34
32
  return this.printVersion();
35
33
  }
36
34
  if (this.$logger.getLevel() === "TRACE" && !this.$options.json) {
37
- // CommandDispatcher is called from external CLI's only, so pass the path to their package.json
38
35
  this.$logger.trace("Collecting system information...");
39
36
  const sysInfo = await this.$sysInfo.getSysInfo({
40
37
  pathToNativeScriptCliPackageJson: path.join(__dirname, "..", "..", "package.json"),
@@ -64,7 +61,6 @@ class CommandDispatcher {
64
61
  await this.$commandsService.tryExecuteCommand(commandName, commandArguments);
65
62
  }
66
63
  async resolveCommand(commandName, commandArguments, argv) {
67
- // just a hook point
68
64
  return { commandName, commandArguments, argv };
69
65
  }
70
66
  getCommandName() {
@@ -72,15 +68,12 @@ class CommandDispatcher {
72
68
  if (remaining.length > 0) {
73
69
  return remaining[0].toString().toLowerCase();
74
70
  }
75
- // if only <CLI_NAME> is specified on console, show console help
76
71
  this.$options.help = true;
77
72
  return "";
78
73
  }
79
74
  async printVersion() {
80
75
  this.$logger.info(this.$staticConfig.version);
81
76
  if (this.$options.json) {
82
- // we don't check for updates when --json is passed
83
- // useful for tools that rely on the output of the command
84
77
  return;
85
78
  }
86
79
  const spinner = this.$terminalSpinnerService.createSpinner();
@@ -108,7 +101,6 @@ class CommandDispatcher {
108
101
  if (semver.gte(nativescriptCliVersion.currentVersion, nativescriptCliVersion.latestVersion, {
109
102
  loose: true,
110
103
  })) {
111
- // up-to-date
112
104
  spinner.succeed("Up to date.");
113
105
  }
114
106
  else {
@@ -140,4 +132,3 @@ class FutureDispatcher {
140
132
  }
141
133
  }
142
134
  yok_1.injector.register("dispatcher", FutureDispatcher, false);
143
- //# sourceMappingURL=dispatchers.js.map
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorCodes = exports.OptionType = exports.AnalyticsStatus = exports.TrackingTypes = exports.GoogleAnalyticsDataType = void 0;
4
+ var GoogleAnalyticsDataType;
5
+ (function (GoogleAnalyticsDataType) {
6
+ GoogleAnalyticsDataType["Page"] = "pageview";
7
+ GoogleAnalyticsDataType["Event"] = "event";
8
+ })(GoogleAnalyticsDataType || (exports.GoogleAnalyticsDataType = GoogleAnalyticsDataType = {}));
9
+ var TrackingTypes;
10
+ (function (TrackingTypes) {
11
+ TrackingTypes["Initialization"] = "initialization";
12
+ TrackingTypes["Exception"] = "exception";
13
+ TrackingTypes["AcceptTrackFeatureUsage"] = "acceptTrackFeatureUsage";
14
+ TrackingTypes["GoogleAnalyticsData"] = "googleAnalyticsData";
15
+ TrackingTypes["FinishTracking"] = "FinishTracking";
16
+ })(TrackingTypes || (exports.TrackingTypes = TrackingTypes = {}));
17
+ var AnalyticsStatus;
18
+ (function (AnalyticsStatus) {
19
+ AnalyticsStatus["enabled"] = "enabled";
20
+ AnalyticsStatus["disabled"] = "disabled";
21
+ AnalyticsStatus["notConfirmed"] = "not confirmed";
22
+ })(AnalyticsStatus || (exports.AnalyticsStatus = AnalyticsStatus = {}));
23
+ var OptionType;
24
+ (function (OptionType) {
25
+ OptionType["String"] = "string";
26
+ OptionType["Boolean"] = "boolean";
27
+ OptionType["Number"] = "number";
28
+ OptionType["Array"] = "array";
29
+ OptionType["Object"] = "object";
30
+ })(OptionType || (exports.OptionType = OptionType = {}));
31
+ var ErrorCodes;
32
+ (function (ErrorCodes) {
33
+ ErrorCodes[ErrorCodes["UNCAUGHT"] = 120] = "UNCAUGHT";
34
+ ErrorCodes[ErrorCodes["UNKNOWN"] = 127] = "UNKNOWN";
35
+ ErrorCodes[ErrorCodes["INVALID_ARGUMENT"] = 128] = "INVALID_ARGUMENT";
36
+ ErrorCodes[ErrorCodes["RESOURCE_PROBLEM"] = 129] = "RESOURCE_PROBLEM";
37
+ ErrorCodes[ErrorCodes["KARMA_FAIL"] = 130] = "KARMA_FAIL";
38
+ ErrorCodes[ErrorCodes["UNHANDLED_REJECTION_FAILURE"] = 131] = "UNHANDLED_REJECTION_FAILURE";
39
+ ErrorCodes[ErrorCodes["DELETED_KILL_FILE"] = 132] = "DELETED_KILL_FILE";
40
+ ErrorCodes[ErrorCodes["TESTS_INIT_REQUIRED"] = 133] = "TESTS_INIT_REQUIRED";
41
+ ErrorCodes[ErrorCodes["ALL_DEVICES_DISCONNECTED"] = 134] = "ALL_DEVICES_DISCONNECTED";
42
+ })(ErrorCodes || (exports.ErrorCodes = ErrorCodes = {}));
@@ -14,10 +14,9 @@ const _ = require("lodash");
14
14
  const source_map_1 = require("source-map");
15
15
  const helpers_1 = require("./helpers");
16
16
  const decorators_1 = require("./decorators");
17
+ const enums_1 = require("./enums");
17
18
  const yok_1 = require("./yok");
18
- // we need this to overwrite .stack property (read-only in Error)
19
19
  function Exception() {
20
- /* intentionally left blank */
21
20
  }
22
21
  Exception.prototype = new Error();
23
22
  async function resolveCallStack(error) {
@@ -62,7 +61,6 @@ async function resolveCallStack(error) {
62
61
  }));
63
62
  let outputMessage = remapped.join("\n");
64
63
  if (outputMessage.indexOf(error.message) === -1) {
65
- // when fibers throw error in node 0.12.x, the stack does NOT contain the message
66
64
  outputMessage = outputMessage.replace(/Error/, "Error: " + error.message);
67
65
  }
68
66
  return outputMessage;
@@ -86,9 +84,7 @@ function installUncaughtExceptionListener(actionOnException) {
86
84
  }
87
85
  }
88
86
  catch (err) {
89
- // In case the handler throws error and we do not catch it, we'll go in infinite loop of unhandled rejections.
90
- // We cannot do anything here as even `console.error` may fail. So just exit the process.
91
- process.exit(131 /* ErrorCodes.UNHANDLED_REJECTION_FAILURE */);
87
+ process.exit(enums_1.ErrorCodes.UNHANDLED_REJECTION_FAILURE);
92
88
  }
93
89
  };
94
90
  process.on("uncaughtException", handler);
@@ -100,7 +96,6 @@ async function tryTrackException(error, localInjector) {
100
96
  disableAnalytics = localInjector.resolve("staticConfig").disableAnalytics;
101
97
  }
102
98
  catch (err) {
103
- // We should get here only in our unit tests.
104
99
  disableAnalytics = true;
105
100
  }
106
101
  if (!disableAnalytics) {
@@ -109,7 +104,6 @@ async function tryTrackException(error, localInjector) {
109
104
  await analyticsService.trackException(error, error.message);
110
105
  }
111
106
  catch (e) {
112
- // Do not replace with logger due to cyclic dependency
113
107
  console.error("Error while reporting exception: " + e);
114
108
  }
115
109
  }
@@ -147,10 +141,9 @@ class Errors {
147
141
  exception.message = $messagesService.getMessage.apply($messagesService, [opts.formatStr].concat(argsArray));
148
142
  }
149
143
  catch (err) {
150
- // Ignore
151
144
  }
152
145
  exception.stack = new Error(exception.message).stack;
153
- exception.errorCode = opts.errorCode || 127 /* ErrorCodes.UNKNOWN */;
146
+ exception.errorCode = opts.errorCode || enums_1.ErrorCodes.UNKNOWN;
154
147
  exception.suggestCommandHelp = suggestCommandHelp;
155
148
  exception.proxyAuthenticationRequired = !!opts.proxyAuthenticationRequired;
156
149
  exception.printOnStdout = opts.printOnStdout;
@@ -182,10 +175,9 @@ class Errors {
182
175
  await printCommandHelpSuggestion();
183
176
  }
184
177
  await tryTrackException(ex, this.$injector);
185
- process.exit(_.isNumber(ex.errorCode) ? ex.errorCode : 127 /* ErrorCodes.UNKNOWN */);
178
+ process.exit(_.isNumber(ex.errorCode) ? ex.errorCode : enums_1.ErrorCodes.UNKNOWN);
186
179
  }
187
180
  }
188
- // If you want to activate this function, start Node with flags --nouse_idle_notification and --expose_gc
189
181
  verifyHeap(message) {
190
182
  if (global.gc) {
191
183
  console.log("verifyHeap: '%s'", message);
@@ -198,4 +190,3 @@ __decorate([
198
190
  (0, decorators_1.deprecated)("Use `fail` instead.")
199
191
  ], Errors.prototype, "failWithoutHelp", null);
200
192
  yok_1.injector.register("errors", Errors);
201
- //# sourceMappingURL=errors.js.map
@@ -20,14 +20,12 @@ const constants_1 = require("../constants");
20
20
  const os_1 = require("os");
21
21
  const detectNewline = require("detect-newline");
22
22
  const yazl = require("yazl");
23
- // TODO: Add .d.ts for mkdirp module (or use it from @types repo).
24
23
  const mkdirp = require("mkdirp");
25
24
  let FileSystem = FileSystem_1 = class FileSystem {
26
25
  constructor($injector) {
27
26
  this.$injector = $injector;
28
27
  }
29
28
  async zipFiles(zipFile, files, zipPathCallback) {
30
- //we are resolving it here instead of in the constructor, because config has dependency on file system and config shouldn't require logger
31
29
  const $logger = this.$injector.resolve("logger");
32
30
  const zip = new yazl.ZipFile();
33
31
  const outFile = fs.createWriteStream(zipFile);
@@ -60,10 +58,10 @@ let FileSystem = FileSystem_1 = class FileSystem {
60
58
  proc = (0, path_1.join)(__dirname, "resources/platform-tools/unzip/win32/unzip");
61
59
  }
62
60
  else if ($hostInfo.isDarwin) {
63
- proc = "unzip"; // darwin unzip is info-zip
61
+ proc = "unzip";
64
62
  }
65
63
  else if ($hostInfo.isLinux) {
66
- proc = "unzip"; // linux unzip is info-zip
64
+ proc = "unzip";
67
65
  }
68
66
  if (!isCaseSensitive) {
69
67
  zipFile = this.findFileCaseInsensitive(zipFile);
@@ -104,7 +102,6 @@ let FileSystem = FileSystem_1 = class FileSystem {
104
102
  }
105
103
  catch (err) {
106
104
  if (err && err.code !== "ENOENT") {
107
- // ignore "file doesn't exist" error
108
105
  throw err;
109
106
  }
110
107
  }
@@ -143,7 +140,6 @@ let FileSystem = FileSystem_1 = class FileSystem {
143
140
  }
144
141
  });
145
142
  if (root) {
146
- // console.log("root", paths);
147
143
  return Array.from(paths.values()).reduce((sum, current) => sum + current, 0);
148
144
  }
149
145
  };
@@ -216,8 +212,6 @@ let FileSystem = FileSystem_1 = class FileSystem {
216
212
  writeFile(filename, data, encoding) {
217
213
  this.createDirectory((0, path_1.dirname)(filename));
218
214
  if (!data) {
219
- // node 14 will no longer coerce unsupported input to strings anymore.
220
- // clean any null or undefined data
221
215
  data = "";
222
216
  }
223
217
  fs.writeFileSync(filename, data, { encoding: encoding });
@@ -248,8 +242,6 @@ let FileSystem = FileSystem_1 = class FileSystem {
248
242
  return;
249
243
  }
250
244
  this.createDirectory((0, path_1.dirname)(destinationFileName));
251
- // MobileApplication.app is resolved as a directory on Mac,
252
- // therefore we need to copy it recursively as it's not a single file.
253
245
  shelljs.cp("-rf", sourceFileName, destinationFileName);
254
246
  const err = shelljs.error();
255
247
  if (err) {
@@ -325,9 +317,7 @@ let FileSystem = FileSystem_1 = class FileSystem {
325
317
  });
326
318
  await this.futureFromEvent(chown, "close");
327
319
  }
328
- // nothing to do on Windows, as chown does not work on this platform
329
320
  }
330
- // filterCallback: function(path: String, stat: fs.Stats): Boolean
331
321
  enumerateFilesInDirectorySync(directoryPath, filterCallback, opts, foundFiles) {
332
322
  foundFiles = foundFiles || [];
333
323
  if (!this.exists(directoryPath)) {
@@ -423,4 +413,3 @@ FileSystem.JSON_OBJECT_REGEXP = new RegExp(`{\\r*\\n*(\\W*)"`, "m");
423
413
  exports.FileSystem = FileSystem = FileSystem_1 = __decorate([
424
414
  injector.register("fs")
425
415
  ], FileSystem);
426
- //# sourceMappingURL=file-system.js.map
@@ -13,13 +13,11 @@ function printHeader() {
13
13
  color_1.color.styleText(["cyanBright", "bold"], "{N} NativeScript "),
14
14
  color_1.color.styleText(["whiteBright", "bold"], "CLI"),
15
15
  color_1.color.dim(` [v${version}] `),
16
- // color.dim(" │"),
17
16
  ].join("");
18
17
  const tagLine = [
19
18
  color_1.color.dim("│ "),
20
19
  color_1.color.dim(" → "),
21
20
  color_1.color.styleText(["whiteBright", "bold"], "Empower JavaScript with native APIs "),
22
- // color.dim(" │"),
23
21
  ].join("");
24
22
  const headerLength = (0, color_1.stripColors)(header).length;
25
23
  const tagLineLength = (0, color_1.stripColors)(tagLine).length;
@@ -29,4 +27,3 @@ function printHeader() {
29
27
  console.info(" " + tagLine + " ".repeat(width - tagLineLength) + color_1.color.dim("│"));
30
28
  console.info(" " + color_1.color.dim("└" + "─".repeat(width - 1) + "┘"));
31
29
  }
32
- //# sourceMappingURL=header.js.map
@@ -71,13 +71,6 @@ function doesCurrentNpmCommandMatch(patterns) {
71
71
  }
72
72
  return result;
73
73
  }
74
- /**
75
- * Equivalent of lodash's some, but instead of lambda, just pass array of Regular Expressions.
76
- * If any of them matches any of the given elements, true is returned.
77
- * @param {string[]} array Elements to be checked.
78
- * @param {RegExp[]} patterns Regular expressions to be tested
79
- * @returns {boolean} True in case any element of the array matches any of the patterns. False otherwise.
80
- */
81
74
  function someWithRegExps(array, patterns) {
82
75
  return _.some(array, (item) => _.some(patterns, (pattern) => !!item.match(pattern)));
83
76
  }
@@ -89,7 +82,6 @@ function getCurrentNpmCommandArgv() {
89
82
  result = npmConfigArgv.original || [];
90
83
  }
91
84
  catch (error) {
92
- // ignore
93
85
  }
94
86
  }
95
87
  return result;
@@ -108,7 +100,6 @@ function isInstallingNativeScriptGloballyWithNpm() {
108
100
  return isInstallCommand && isGlobalCommand && hasNativeScriptPackage;
109
101
  }
110
102
  function isInstallingNativeScriptGloballyWithYarn() {
111
- // yarn populates the same env used by npm - npm_config_argv, so check it for yarn specific command
112
103
  const isInstallCommand = doesCurrentNpmCommandMatch([/^add$/]);
113
104
  const isGlobalCommand = doesCurrentNpmCommandMatch([/^global$/]);
114
105
  const hasNativeScriptPackage = doesCurrentNpmCommandMatch([
@@ -117,13 +108,6 @@ function isInstallingNativeScriptGloballyWithYarn() {
117
108
  ]);
118
109
  return isInstallCommand && isGlobalCommand && hasNativeScriptPackage;
119
110
  }
120
- /**
121
- * Creates regular expression from input string.
122
- * The method replaces all occurences of RegExp special symbols in the input string with \<symbol>.
123
- * @param {string} input The string from which a regular expression should be created.
124
- * @param {string} opts RegExp options, for example "gm" - global and multiline.
125
- * @returns {RegExp} The regular expression created from the input string.
126
- */
127
111
  function createRegExp(input, opts) {
128
112
  if (!input || !_.isString(input)) {
129
113
  throw new Error("Input must be a string.");
@@ -131,20 +115,13 @@ function createRegExp(input, opts) {
131
115
  const escapedSource = regExpEscape(input);
132
116
  return new RegExp(escapedSource, opts);
133
117
  }
134
- /**
135
- * Escapes all special symbols used in regex.
136
- * @param {string} input The string in which to replace the special regexp symbols.
137
- * @returns {string} A string in which all regex symbols are escaped.
138
- */
139
118
  function regExpEscape(input) {
140
- // https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
141
119
  return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
142
120
  }
143
121
  function getShortPluginName(pluginName) {
144
122
  return sanitizePluginName(pluginName).replace(/[\-]/g, "_");
145
123
  }
146
124
  function sanitizePluginName(pluginName) {
147
- // avoid long plugin names, exclude the npm module scope (@scope/nativescript-plugin) from the android plugin name
148
125
  return pluginName.split("/").pop();
149
126
  }
150
127
  async function executeActionByChunks(initialData, chunkSize, elementAction) {
@@ -191,13 +168,6 @@ function deferPromise() {
191
168
  getResult: () => result,
192
169
  };
193
170
  }
194
- /**
195
- * Executes all promises and does not stop in case any of them throws.
196
- * Returns the results of all promises in array when all are successfully resolved.
197
- * In case any of the promises is rejected, rejects the resulted promise with all accumulated errors.
198
- * @param {Promise<T>[]} promises Promises to be resolved.
199
- * @returns {Promise<T[]>} New promise which will be resolved with the results of all promises.
200
- */
201
171
  function settlePromises(promises) {
202
172
  return new Promise((resolve, reject) => {
203
173
  let settledPromisesCount = 0;
@@ -213,7 +183,6 @@ function settlePromises(promises) {
213
183
  results[index] = result;
214
184
  })
215
185
  .catch((err) => {
216
- // Accumulate all errors.
217
186
  errors.push(err);
218
187
  })
219
188
  .then(() => {
@@ -245,14 +214,12 @@ function bashQuote(s) {
245
214
  if (s[0] === "'" && s[s.length - 1] === "'") {
246
215
  return s;
247
216
  }
248
- // replace ' with '"'"' and wrap in ''
249
217
  return "'" + s.replace(/'/g, "'\"'\"'") + "'";
250
218
  }
251
219
  function cmdQuote(s) {
252
220
  if (s[0] === '"' && s[s.length - 1] === '"') {
253
221
  return s;
254
222
  }
255
- // replace " with \" and wrap in ""
256
223
  return '"' + s.replace(/"/g, '\\"') + '"';
257
224
  }
258
225
  function quoteString(s) {
@@ -309,9 +276,6 @@ function isInteractive() {
309
276
  const result = isRunningInTTY() && !isCIEnvironment();
310
277
  return result;
311
278
  }
312
- /**
313
- * Checks if current process is running in Text Terminal (TTY)
314
- */
315
279
  function isRunningInTTY() {
316
280
  return (process.stdout &&
317
281
  process.stdout.isTTY &&
@@ -319,10 +283,6 @@ function isRunningInTTY() {
319
283
  process.stdin.isTTY);
320
284
  }
321
285
  function isCIEnvironment() {
322
- // The following CI environments set their own environment variables that we respect:
323
- // travis: "CI",
324
- // circleCI: "CI",
325
- // jenkins: "JENKINS_HOME"
326
286
  return !!(process.env && (process.env.CI || process.env.JENKINS_HOME));
327
287
  }
328
288
  function toBoolean(str) {
@@ -377,11 +337,11 @@ function getMessageWithBorders(message, spanLength = 3) {
377
337
  const longestRowLength = message.split("\n").sort((a, b) => {
378
338
  return b.length - a.length;
379
339
  })[0].length;
380
- let border = "*".repeat(longestRowLength + 2 * spanLength); // * 2 for both sides
340
+ let border = "*".repeat(longestRowLength + 2 * spanLength);
381
341
  if (border.length % 2 === 0) {
382
- border += "*"; // the * should always be an odd number in order to get * in each edge (we will remove the even *s below)
342
+ border += "*";
383
343
  }
384
- border = border.replace(/\*\*/g, "* "); // ***** => * * * in order to have similar padding to the side borders
344
+ border = border.replace(/\*\*/g, "* ");
385
345
  const formatRow = function (row) {
386
346
  return (_.padEnd("*", spanLength) +
387
347
  _.padEnd(row, border.length - 2 * spanLength) +
@@ -411,20 +371,12 @@ function trimSymbol(str, symbol) {
411
371
  return str;
412
372
  }
413
373
  function parseJson(data) {
414
- // Replace BOM from the header of the file if it exists
415
374
  return JSON.parse(data.replace(/^\uFEFF/, ""));
416
375
  }
417
- // TODO: Use generic for predicatе predicate: (element: T|T[]) when TypeScript support this.
418
376
  async function getFuturesResults(promises, predicate) {
419
377
  const results = await Promise.all(promises);
420
378
  return _(results).filter(predicate).flatten().value();
421
379
  }
422
- /**
423
- * Appends zeroes to a version string until it reaches a specified length.
424
- * @param {string} version The version on which to append zeroes.
425
- * @param requiredVersionLength The required length of the version string.
426
- * @returns {string} Appended version string. In case input is null, undefined or empty string, it is returned immediately without appending anything.
427
- */
428
380
  function appendZeroesToVersion(version, requiredVersionLength) {
429
381
  if (version) {
430
382
  const zeroesToAppend = requiredVersionLength - version.split(".").length;
@@ -569,14 +521,6 @@ function getProjectFilesConfig(opts) {
569
521
  };
570
522
  return projectFilesConfig;
571
523
  }
572
- /**
573
- * Tries to find the process id (PID) of the specified application identifier.
574
- * This is specific implementation for iOS Simulator, where the running applications are real processes.
575
- * Their PIDs are printed in a specific format in the the logs, once the application is started.
576
- * @param {string} applicationIdentifier Application Identifier of the app for which we try to get the PID.
577
- * @param {string} logLine Line that may contain the PID of the process.
578
- * @returns {string} The PID of the searched application identifier in case it's found in the current line, null otherwise.
579
- */
580
524
  function getPidFromiOSSimulatorLogs(applicationIdentifier, logLine) {
581
525
  if (logLine) {
582
526
  const pidRegExp = new RegExp(`${applicationIdentifier}:\\s?(\\d+)`);
@@ -624,7 +568,6 @@ function getWinRegPropertyValue(key, propertyName) {
624
568
  function stringify(value, replacer, space) {
625
569
  return JSON.stringify(value, replacer, space || 2);
626
570
  }
627
- //2019-01-07 18:29:50.745
628
571
  function getFixedLengthDateString() {
629
572
  const currentDate = new Date();
630
573
  const year = currentDate.getFullYear();
@@ -647,28 +590,6 @@ function getFormattedMilliseconds(date) {
647
590
  }
648
591
  return milliseconds;
649
592
  }
650
- //--- begin part copied from AngularJS
651
- //The MIT License
652
- //
653
- //Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
654
- //
655
- //Permission is hereby granted, free of charge, to any person obtaining a copy
656
- //of this software and associated documentation files (the "Software"), to deal
657
- //in the Software without restriction, including without limitation the rights
658
- //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
659
- //copies of the Software, and to permit persons to whom the Software is
660
- //furnished to do so, subject to the following conditions:
661
- //
662
- // The above copyright notice and this permission notice shall be included in
663
- //all copies or substantial portions of the Software.
664
- //
665
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
666
- //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
667
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
668
- //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
669
- //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
670
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
671
- //THE SOFTWARE.
672
593
  const CLASS_NAME = /class\s+([A-Z].+?)(?:\s+.*?)?\{/;
673
594
  const CONSTRUCTOR_ARGS = /constructor\s*([^\(]*)\(\s*([^\)]*)\)/m;
674
595
  const FN_NAME_AND_ARGS = /^(?:function)?\s*([^\(]*)\(\s*([^\)]*)\)\s*(=>)?\s*[{_]/m;
@@ -698,11 +619,6 @@ function annotate(fn) {
698
619
  }
699
620
  return $inject;
700
621
  }
701
- /**
702
- * Returns true if all Android signing options are provided, false otherwise.
703
- * @param {IAndroidSigningData} signingData The signing data to be validated.
704
- * @return {void}
705
- */
706
622
  function hasValidAndroidSigning(signingData) {
707
623
  const isValid = signingData &&
708
624
  signingData.keyStorePath &&
@@ -711,5 +627,3 @@ function hasValidAndroidSigning(signingData) {
711
627
  signingData.keyStoreAliasPassword;
712
628
  return !!isValid;
713
629
  }
714
- //--- end part copied from AngularJS
715
- //# sourceMappingURL=helpers.js.map
@@ -65,9 +65,6 @@ class HostInfo {
65
65
  catch (err) {
66
66
  this.$logger.trace(`Unable to get macOS version from ${systemProfileCommand}. Error is: ${err}`);
67
67
  }
68
- // https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
69
- // Each macOS version is labeled 10.<version>, where it looks like <versions> is taken from the major version returned by os.release() (16.x.x for example) and subtracting 4 from it.
70
- // So the version becomes "10.12" in this case.
71
68
  const osRelease = this.$osInfo.release();
72
69
  const majorVersion = osRelease && _.first(osRelease.split("."));
73
70
  macOSVersion = majorVersion && `10.${+majorVersion - 4}`;
@@ -121,4 +118,3 @@ __decorate([
121
118
  (0, decorators_1.cache)()
122
119
  ], HostInfo.prototype, "getMacOSVersion", null);
123
120
  yok_1.injector.register("hostInfo", HostInfo);
124
- //# sourceMappingURL=host-info.js.map