nativescript 9.0.4-dev.1 → 9.0.4-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/lib/android-tools-info.js +12 -0
  2. package/lib/base-package-manager.js +7 -0
  3. package/lib/bootstrap.js +5 -1
  4. package/lib/bun-package-manager.js +14 -1
  5. package/lib/color.js +4 -0
  6. package/lib/commands/add-platform.js +1 -0
  7. package/lib/commands/apple-login.js +1 -0
  8. package/lib/commands/appstore-list.js +1 -0
  9. package/lib/commands/appstore-upload.js +3 -0
  10. package/lib/commands/build.js +3 -2
  11. package/lib/commands/clean.js +22 -1
  12. package/lib/commands/command-base.js +1 -0
  13. package/lib/commands/config.js +5 -0
  14. package/lib/commands/create-project.js +6 -0
  15. package/lib/commands/debug.js +6 -1
  16. package/lib/commands/deploy.js +3 -2
  17. package/lib/commands/embedding/embed.js +7 -0
  18. package/lib/commands/extensibility/install-extension.js +1 -0
  19. package/lib/commands/extensibility/list-extensions.js +1 -0
  20. package/lib/commands/extensibility/uninstall-extension.js +1 -0
  21. package/lib/commands/fonts.js +1 -0
  22. package/lib/commands/generate-assets.js +1 -0
  23. package/lib/commands/generate-help.js +1 -0
  24. package/lib/commands/generate.js +48 -1
  25. package/lib/commands/hooks/common.js +2 -1
  26. package/lib/commands/hooks/hooks-lock.js +1 -0
  27. package/lib/commands/hooks/hooks.js +1 -0
  28. package/lib/commands/info.js +1 -0
  29. package/lib/commands/install.js +1 -0
  30. package/lib/commands/list-platforms.js +1 -0
  31. package/lib/commands/migrate.js +1 -0
  32. package/lib/commands/native-add.js +5 -0
  33. package/lib/commands/platform-clean.js +1 -0
  34. package/lib/commands/plugin/add-plugin.js +1 -0
  35. package/lib/commands/plugin/build-plugin.js +1 -0
  36. package/lib/commands/plugin/create-plugin.js +5 -0
  37. package/lib/commands/plugin/list-plugins.js +1 -0
  38. package/lib/commands/plugin/remove-plugin.js +2 -0
  39. package/lib/commands/plugin/update-plugin.js +1 -0
  40. package/lib/commands/post-install.js +6 -0
  41. package/lib/commands/prepare.js +4 -3
  42. package/lib/commands/preview.js +2 -0
  43. package/lib/commands/remove-platform.js +1 -0
  44. package/lib/commands/resources/resources-update.js +2 -0
  45. package/lib/commands/run.js +1 -0
  46. package/lib/commands/setup.js +1 -0
  47. package/lib/commands/start.js +1 -0
  48. package/lib/commands/test-init.js +4 -0
  49. package/lib/commands/test.js +9 -2
  50. package/lib/commands/typings.js +2 -1
  51. package/lib/commands/update-platform.js +5 -0
  52. package/lib/commands/update.js +2 -0
  53. package/lib/commands/widget.js +20 -1
  54. package/lib/common/bootstrap.js +1 -0
  55. package/lib/common/child-process.js +3 -0
  56. package/lib/common/codeGeneration/code-entity.js +1 -0
  57. package/lib/common/codeGeneration/code-printer.js +1 -0
  58. package/lib/common/command-params.js +1 -0
  59. package/lib/common/commands/analytics.js +3 -0
  60. package/lib/common/commands/autocompletion.js +3 -0
  61. package/lib/common/commands/device/device-log-stream.js +1 -0
  62. package/lib/common/commands/device/get-file.js +2 -0
  63. package/lib/common/commands/device/list-applications.js +1 -0
  64. package/lib/common/commands/device/list-devices.js +3 -0
  65. package/lib/common/commands/device/list-files.js +2 -0
  66. package/lib/common/commands/device/put-file.js +2 -0
  67. package/lib/common/commands/device/run-application.js +1 -0
  68. package/lib/common/commands/device/stop-application.js +1 -0
  69. package/lib/common/commands/device/uninstall-application.js +1 -0
  70. package/lib/common/commands/doctor.js +3 -2
  71. package/lib/common/commands/generate-messages.js +1 -0
  72. package/lib/common/commands/help.js +1 -0
  73. package/lib/common/commands/package-manager-get.js +1 -0
  74. package/lib/common/commands/package-manager-set.js +1 -0
  75. package/lib/common/commands/post-install.js +1 -0
  76. package/lib/common/commands/preuninstall.js +11 -2
  77. package/lib/common/commands/proxy/proxy-base.js +4 -0
  78. package/lib/common/commands/proxy/proxy-clear.js +1 -0
  79. package/lib/common/commands/proxy/proxy-get.js +1 -0
  80. package/lib/common/commands/proxy/proxy-set.js +1 -0
  81. package/lib/common/common-lib.js +1 -0
  82. package/lib/common/constants.js +11 -0
  83. package/lib/common/decorators.js +48 -0
  84. package/lib/common/dispatchers.js +10 -1
  85. package/lib/common/errors.js +13 -3
  86. package/lib/common/file-system.js +13 -2
  87. package/lib/common/header.js +3 -0
  88. package/lib/common/helpers.js +89 -3
  89. package/lib/common/host-info.js +4 -0
  90. package/lib/common/http-client.js +20 -0
  91. package/lib/common/logger/appenders/cli-appender.js +4 -0
  92. package/lib/common/logger/appenders/emit-appender.js +4 -0
  93. package/lib/common/logger/layouts/cli-layout.js +1 -0
  94. package/lib/common/logger/logger.js +5 -0
  95. package/lib/common/messages/messages.js +6 -0
  96. package/lib/common/mobile/android/android-application-manager.js +20 -1
  97. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
  98. package/lib/common/mobile/android/android-debug-bridge.js +6 -0
  99. package/lib/common/mobile/android/android-device-file-system.js +4 -0
  100. package/lib/common/mobile/android/android-device-hash-service.js +3 -0
  101. package/lib/common/mobile/android/android-device.js +8 -0
  102. package/lib/common/mobile/android/android-emulator-services.js +2 -1
  103. package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
  104. package/lib/common/mobile/android/android-log-filter.js +4 -0
  105. package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
  106. package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
  107. package/lib/common/mobile/android/genymotion/genymotion-service.js +6 -1
  108. package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
  109. package/lib/common/mobile/android/logcat-helper.js +13 -0
  110. package/lib/common/mobile/application-manager-base.js +6 -0
  111. package/lib/common/mobile/device-emitter.js +4 -0
  112. package/lib/common/mobile/device-log-emitter.js +1 -0
  113. package/lib/common/mobile/device-log-provider-base.js +1 -0
  114. package/lib/common/mobile/device-log-provider.js +23 -0
  115. package/lib/common/mobile/device-platforms-constants.js +1 -0
  116. package/lib/common/mobile/emulator-helper.js +3 -0
  117. package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
  118. package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
  119. package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
  120. package/lib/common/mobile/ios/device/ios-device.js +4 -0
  121. package/lib/common/mobile/ios/ios-device-base.js +1 -0
  122. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
  123. package/lib/common/mobile/ios/ios-log-filter.js +1 -0
  124. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
  125. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
  126. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
  127. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
  128. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
  129. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
  130. package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
  131. package/lib/common/mobile/log-filter.js +2 -0
  132. package/lib/common/mobile/logging-levels.js +1 -0
  133. package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
  134. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
  135. package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
  136. package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
  137. package/lib/common/mobile/mobile-core/devices-service.js +69 -0
  138. package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
  139. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
  140. package/lib/common/mobile/mobile-helper.js +1 -0
  141. package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
  142. package/lib/common/opener.js +1 -0
  143. package/lib/common/os-info.js +1 -0
  144. package/lib/common/plist-parser.js +1 -0
  145. package/lib/common/project-helper.js +1 -0
  146. package/lib/common/prompter.js +9 -1
  147. package/lib/common/queue.js +1 -0
  148. package/lib/common/resource-loader.js +1 -0
  149. package/lib/common/services/auto-completion-service.js +13 -1
  150. package/lib/common/services/cancellation.js +2 -1
  151. package/lib/common/services/commands-service.js +17 -6
  152. package/lib/common/services/help-service.js +11 -3
  153. package/lib/common/services/hooks-service.js +13 -0
  154. package/lib/common/services/ios-notification-service.js +1 -0
  155. package/lib/common/services/json-file-settings-service.js +6 -0
  156. package/lib/common/services/lock-service.js +6 -0
  157. package/lib/common/services/message-contract-generator.js +1 -0
  158. package/lib/common/services/messages-service.js +1 -0
  159. package/lib/common/services/micro-templating-service.js +6 -0
  160. package/lib/common/services/net-service.js +3 -0
  161. package/lib/common/services/project-files-manager.js +5 -0
  162. package/lib/common/services/project-files-provider-base.js +1 -0
  163. package/lib/common/services/proxy-service.js +1 -0
  164. package/lib/common/services/qr.js +1 -0
  165. package/lib/common/services/settings-service.js +1 -0
  166. package/lib/common/services/xcode-select-service.js +1 -0
  167. package/lib/common/utils.js +1 -0
  168. package/lib/common/validators/project-name-validator.js +1 -0
  169. package/lib/common/validators/validation-result.js +1 -0
  170. package/lib/common/verify-node-version.js +8 -1
  171. package/lib/common/yok.js +32 -11
  172. package/lib/config.js +22 -1
  173. package/lib/constants-provider.js +1 -0
  174. package/lib/constants.js +53 -0
  175. package/lib/controllers/build-controller.js +4 -3
  176. package/lib/controllers/debug-controller.js +8 -3
  177. package/lib/controllers/deploy-controller.js +1 -0
  178. package/lib/controllers/migrate-controller.js +90 -4
  179. package/lib/controllers/platform-controller.js +9 -1
  180. package/lib/controllers/prepare-controller.js +17 -4
  181. package/lib/controllers/run-controller.js +17 -1
  182. package/lib/controllers/update-controller-base.js +1 -0
  183. package/lib/controllers/update-controller.js +11 -0
  184. package/lib/data/build-data.js +1 -0
  185. package/lib/data/controller-data-base.js +1 -0
  186. package/lib/data/debug-data.js +1 -0
  187. package/lib/data/platform-data.js +1 -0
  188. package/lib/data/prepare-data.js +1 -0
  189. package/lib/data/run-data.js +1 -0
  190. package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
  191. package/lib/detached-processes/cleanup-process.js +18 -14
  192. package/lib/detached-processes/file-log-service.js +2 -1
  193. package/lib/device-path-provider.js +1 -0
  194. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
  195. package/lib/device-sockets/ios/notification.js +3 -0
  196. package/lib/device-sockets/ios/socket-request-executor.js +3 -0
  197. package/lib/helpers/android-bundle-validator-helper.js +2 -1
  198. package/lib/helpers/deploy-command-helper.js +1 -0
  199. package/lib/helpers/key-command-helper.js +4 -2
  200. package/lib/helpers/livesync-command-helper.js +4 -1
  201. package/lib/helpers/network-connectivity-validator.js +1 -0
  202. package/lib/helpers/options-track-helper.js +3 -2
  203. package/lib/helpers/package-path-helper.js +1 -0
  204. package/lib/helpers/platform-command-helper.js +7 -2
  205. package/lib/helpers/version-validator-helper.js +1 -0
  206. package/lib/key-commands/bootstrap.js +3 -2
  207. package/lib/key-commands/index.js +5 -4
  208. package/lib/nativescript-cli-lib-bootstrap.js +4 -0
  209. package/lib/nativescript-cli-lib.js +1 -0
  210. package/lib/nativescript-cli.js +11 -1
  211. package/lib/node/pbxproj-dom-xcode.js +1 -0
  212. package/lib/node/xcode.js +1 -0
  213. package/lib/node-package-manager.js +11 -1
  214. package/lib/options.js +144 -119
  215. package/lib/package-installation-manager.js +8 -1
  216. package/lib/package-manager.js +2 -0
  217. package/lib/platform-command-param.js +1 -0
  218. package/lib/pnpm-package-manager.js +4 -1
  219. package/lib/project-data.js +12 -0
  220. package/lib/providers/project-files-provider.js +1 -0
  221. package/lib/resolvers/livesync-service-resolver.js +1 -0
  222. package/lib/services/analytics/analytics-broker-process.js +10 -6
  223. package/lib/services/analytics/analytics-broker.js +2 -1
  224. package/lib/services/analytics/analytics-service.js +29 -25
  225. package/lib/services/analytics/google-analytics-provider.js +13 -12
  226. package/lib/services/analytics-settings-service.js +5 -0
  227. package/lib/services/android/android-bundle-tool-service.js +1 -0
  228. package/lib/services/android/gradle-build-args-service.js +3 -0
  229. package/lib/services/android/gradle-build-service.js +1 -0
  230. package/lib/services/android/gradle-command-service.js +1 -0
  231. package/lib/services/android-device-debug-service.js +6 -0
  232. package/lib/services/android-plugin-build-service.js +31 -2
  233. package/lib/services/android-project-service.js +71 -4
  234. package/lib/services/android-resources-migration-service.js +7 -0
  235. package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
  236. package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
  237. package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
  238. package/lib/services/apple-portal/srp/srp-wrapper.js +4 -1
  239. package/lib/services/assets-generation/assets-generation-service.js +10 -5
  240. package/lib/services/build-artifacts-service.js +2 -1
  241. package/lib/services/build-data-service.js +1 -0
  242. package/lib/services/build-info-file-service.js +1 -0
  243. package/lib/services/bundler/bundler-compiler-service.js +68 -1
  244. package/lib/services/bundler/bundler.js +1 -0
  245. package/lib/services/cleanup-service.js +13 -9
  246. package/lib/services/cocoapods-platform-manager.js +9 -0
  247. package/lib/services/cocoapods-service.js +21 -1
  248. package/lib/services/debug-data-service.js +1 -0
  249. package/lib/services/debug-service-base.js +7 -0
  250. package/lib/services/device/device-install-app-service.js +2 -1
  251. package/lib/services/doctor-service.js +21 -6
  252. package/lib/services/extensibility-service.js +8 -0
  253. package/lib/services/files-hash-service.js +1 -0
  254. package/lib/services/hmr-status-service.js +2 -0
  255. package/lib/services/info-service.js +1 -0
  256. package/lib/services/initialize-service.js +5 -1
  257. package/lib/services/ios/export-options-plist-service.js +4 -0
  258. package/lib/services/ios/ios-signing-service.js +4 -0
  259. package/lib/services/ios/spm-service.js +18 -0
  260. package/lib/services/ios/xcodebuild-args-service.js +11 -0
  261. package/lib/services/ios/xcodebuild-command-service.js +1 -0
  262. package/lib/services/ios/xcodebuild-service.js +2 -1
  263. package/lib/services/ios-debugger-port-service.js +1 -0
  264. package/lib/services/ios-device-debug-service.js +1 -0
  265. package/lib/services/ios-entitlements-service.js +1 -0
  266. package/lib/services/ios-extensions-service.js +1 -0
  267. package/lib/services/ios-log-filter.js +20 -0
  268. package/lib/services/ios-native-target-service.js +6 -4
  269. package/lib/services/ios-project-service.js +100 -1
  270. package/lib/services/ios-provision-service.js +3 -0
  271. package/lib/services/ios-watch-app-service.js +1 -0
  272. package/lib/services/ip-service.js +2 -0
  273. package/lib/services/itmstransporter-service.js +1 -0
  274. package/lib/services/karma-execution.js +2 -0
  275. package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
  276. package/lib/services/livesync/android-device-livesync-service.js +2 -0
  277. package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
  278. package/lib/services/livesync/android-livesync-service.js +1 -0
  279. package/lib/services/livesync/android-livesync-tool.js +4 -0
  280. package/lib/services/livesync/device-livesync-service-base.js +2 -0
  281. package/lib/services/livesync/ios-device-livesync-service.js +7 -0
  282. package/lib/services/livesync/ios-livesync-service.js +2 -0
  283. package/lib/services/livesync/livesync-socket.js +1 -0
  284. package/lib/services/livesync/platform-livesync-service-base.js +5 -0
  285. package/lib/services/livesync-process-data-service.js +1 -0
  286. package/lib/services/log-parser-service.js +1 -0
  287. package/lib/services/log-source-map-service.js +15 -0
  288. package/lib/services/marking-mode-service.js +8 -5
  289. package/lib/services/metadata-filtering-service.js +1 -0
  290. package/lib/services/npm-config-service.js +4 -0
  291. package/lib/services/pacote-service.js +7 -0
  292. package/lib/services/performance-service.js +3 -1
  293. package/lib/services/platform/add-platform-service.js +49 -2
  294. package/lib/services/platform/platform-validation-service.js +1 -0
  295. package/lib/services/platform/prepare-native-platform-service.js +5 -2
  296. package/lib/services/platform-environment-requirements.js +8 -3
  297. package/lib/services/platform-project-service-base.js +1 -0
  298. package/lib/services/platforms-data-service.js +1 -0
  299. package/lib/services/plugins-service.js +20 -2
  300. package/lib/services/prepare-data-service.js +1 -0
  301. package/lib/services/project-backup-service.js +4 -0
  302. package/lib/services/project-changes-service.js +14 -3
  303. package/lib/services/project-cleanup-service.js +2 -0
  304. package/lib/services/project-config-service.js +21 -2
  305. package/lib/services/project-data-service.js +36 -7
  306. package/lib/services/project-name-service.js +1 -0
  307. package/lib/services/project-service.js +10 -0
  308. package/lib/services/project-templates-service.js +3 -2
  309. package/lib/services/qr-code-terminal-service.js +1 -0
  310. package/lib/services/require-service.js +1 -0
  311. package/lib/services/start-service.js +1 -0
  312. package/lib/services/temp-service.js +3 -0
  313. package/lib/services/terminal-spinner-service.js +2 -0
  314. package/lib/services/test-execution-service.js +9 -2
  315. package/lib/services/test-initialization-service.js +4 -0
  316. package/lib/services/timeline-profiler-service.js +1 -0
  317. package/lib/services/user-settings-service.js +1 -0
  318. package/lib/services/versions-service.js +6 -4
  319. package/lib/services/watch-ignore-list-service.js +1 -0
  320. package/lib/services/xcconfig-service.js +2 -0
  321. package/lib/services/xcproj-service.js +1 -0
  322. package/lib/shared-event-bus.js +6 -0
  323. package/lib/sys-info.js +2 -1
  324. package/lib/tools/config-manipulation/config-transformer.js +12 -0
  325. package/lib/tools/node-modules/node-modules-builder.js +1 -0
  326. package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
  327. package/lib/yarn-package-manager.js +1 -0
  328. package/lib/yarn2-package-manager.js +3 -0
  329. package/package.json +1 -1
@@ -24,3 +24,4 @@ class PackageManagerCommand {
24
24
  }
25
25
  exports.PackageManagerCommand = PackageManagerCommand;
26
26
  yok_1.injector.registerCommand("package-manager|set", PackageManagerCommand);
27
+ //# sourceMappingURL=package-manager-set.js.map
@@ -14,3 +14,4 @@ class PostInstallCommand {
14
14
  }
15
15
  exports.PostInstallCommand = PostInstallCommand;
16
16
  yok_1.injector.registerCommand("dev-post-install", PostInstallCommand);
17
+ //# sourceMappingURL=post-install.js.map
@@ -6,12 +6,16 @@ const helpers_1 = require("../helpers");
6
6
  const constants_1 = require("../../constants");
7
7
  const yok_1 = require("../yok");
8
8
  class PreUninstallCommand {
9
- constructor($analyticsService, $extensibilityService, $fs, $packageInstallationManager, $settingsService) {
9
+ constructor($analyticsService, $extensibilityService, $fs,
10
+ // private $opener: IOpener,
11
+ $packageInstallationManager, $settingsService) {
10
12
  this.$analyticsService = $analyticsService;
11
13
  this.$extensibilityService = $extensibilityService;
12
14
  this.$fs = $fs;
13
15
  this.$packageInstallationManager = $packageInstallationManager;
14
16
  this.$settingsService = $settingsService;
17
+ // disabled for now (6/24/2020)
18
+ // private static FEEDBACK_FORM_URL = "https://www.nativescript.org/uninstall-feedback";
15
19
  this.allowedParameters = [];
16
20
  }
17
21
  async execute(args) {
@@ -24,7 +28,7 @@ class PreUninstallCommand {
24
28
  /^unlink$/,
25
29
  ]);
26
30
  await this.$analyticsService.trackEventActionInGoogleAnalytics({
27
- action: "Uninstall CLI",
31
+ action: "Uninstall CLI" /* TrackActionNames.UninstallCLI */,
28
32
  additionalData: `isIntentionalUninstall${constants_1.AnalyticsEventLabelDelimiter}${isIntentionalUninstall}${constants_1.AnalyticsEventLabelDelimiter}isInteractive${constants_1.AnalyticsEventLabelDelimiter}${!!(0, helpers_1.isInteractive)()}`,
29
33
  });
30
34
  if (isIntentionalUninstall) {
@@ -39,8 +43,13 @@ class PreUninstallCommand {
39
43
  await this.handleFeedbackForm();
40
44
  }
41
45
  async handleFeedbackForm() {
46
+ // disabled for now (6/24/2020)
47
+ // if (isInteractive()) {
48
+ // this.$opener.open(PreUninstallCommand.FEEDBACK_FORM_URL);
49
+ // }
42
50
  return Promise.resolve();
43
51
  }
44
52
  }
45
53
  exports.PreUninstallCommand = PreUninstallCommand;
46
54
  yok_1.injector.registerCommand("dev-preuninstall", PreUninstallCommand);
55
+ //# sourceMappingURL=preuninstall.js.map
@@ -12,7 +12,10 @@ class ProxyCommandBase {
12
12
  }
13
13
  async tryTrackUsage() {
14
14
  try {
15
+ // TODO(Analytics): Check why we have set the `disableAnalytics` to true and we track the command as separate one
16
+ // instead of tracking it through the commandsService.
15
17
  this.$logger.trace(this.commandName);
18
+ // await this.$analyticsService.trackFeature(this.commandName);
16
19
  }
17
20
  catch (ex) {
18
21
  this.$logger.trace("Error in trying to track proxy command usage:");
@@ -21,3 +24,4 @@ class ProxyCommandBase {
21
24
  }
22
25
  }
23
26
  exports.ProxyCommandBase = ProxyCommandBase;
27
+ //# sourceMappingURL=proxy-base.js.map
@@ -19,3 +19,4 @@ class ProxyClearCommand extends proxy_base_1.ProxyCommandBase {
19
19
  }
20
20
  exports.ProxyClearCommand = ProxyClearCommand;
21
21
  yok_1.injector.registerCommand(proxyClearCommandName, ProxyClearCommand);
22
+ //# sourceMappingURL=proxy-clear.js.map
@@ -18,3 +18,4 @@ class ProxyGetCommand extends proxy_base_1.ProxyCommandBase {
18
18
  }
19
19
  exports.ProxyGetCommand = ProxyGetCommand;
20
20
  yok_1.injector.registerCommand(proxyGetCommandName, ProxyGetCommand);
21
+ //# sourceMappingURL=proxy-get.js.map
@@ -135,3 +135,4 @@ class ProxySetCommand extends proxy_base_1.ProxyCommandBase {
135
135
  }
136
136
  exports.ProxySetCommand = ProxySetCommand;
137
137
  yok_1.injector.registerCommand(proxySetCommandName, ProxySetCommand);
138
+ //# sourceMappingURL=proxy-set.js.map
@@ -3,3 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const yok_1 = require("./yok");
4
4
  require("./appbuilder/proton-bootstrap");
5
5
  module.exports = yok_1.injector.publicApi;
6
+ //# sourceMappingURL=common-lib.js.map
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SOCKET_CONNECTION_TIMEOUT_MS = exports.AndroidVirtualDevice = exports.ATTACH_REQUEST_EVENT_NAME = exports.DEBUGGER_PORT_FOUND_EVENT_NAME = exports.DEFAULT_CHUNK_SIZE = exports.HttpProtocolToPort = exports.HttpStatusCodes = exports.Proxy = exports.IOS_RELAY_NOTIFICATION_COMMAND_TYPE = exports.IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE = exports.IOS_POST_NOTIFICATION_COMMAND_TYPE = exports.FileExtensions = exports.TNS_CORE_MODULES = exports.NODE_MODULES_DIR_NAME = exports.Configurations = exports.TARGET_FRAMEWORK_IDENTIFIERS = exports.FAIL_LIVESYNC_LOG_REGEX = exports.IOS_APP_CRASH_LOG_REG_EXP = exports.IOS_LOG_PREDICATE = exports.DEVICE_LOG_EVENT_NAME = exports.EmulatorDiscoveryNames = exports.DeviceDiscoveryEventNames = exports.HmrConstants = exports.LiveSyncPaths = exports.APPLE_VENDOR_NAME = exports.NOT_RUNNING_EMULATOR_STATUS = exports.RUNNING_EMULATOR_STATUS = exports.CONNECTED_STATUS = exports.UNREACHABLE_STATUS = exports.ERROR_NO_VALID_SUBCOMMAND_FORMAT = exports.ERROR_CANNOT_RESOLVE_DEVICE = exports.ERROR_NO_DEVICES_CANT_USE_IOS_SIMULATOR = exports.ERROR_CANT_USE_SIMULATOR = exports.ERROR_NO_DEVICES = exports.APP_RESOURCES_FOLDER_NAME = exports.DeviceTypes = exports.ProvisionType = void 0;
4
+ // enumeration taken from ProvisionType.cs
4
5
  class ProvisionType {
5
6
  }
6
7
  exports.ProvisionType = ProvisionType;
@@ -82,6 +83,9 @@ Proxy.CACHE_FILE_NAME = "proxy-cache.json";
82
83
  Proxy.USE_PROXY = "USE_PROXY";
83
84
  Proxy.PROXY_PORT = "PROXY_PORT";
84
85
  Proxy.PROXY_HOSTNAME = "PROXY_HOSTNAME";
86
+ /**
87
+ * Http status codes available from `require("http").STATUS_CODES`.
88
+ */
85
89
  class HttpStatusCodes {
86
90
  }
87
91
  exports.HttpStatusCodes = HttpStatusCodes;
@@ -107,7 +111,13 @@ AndroidVirtualDevice.INI_FILES_MASK = /^(.*)\.ini$/i;
107
111
  AndroidVirtualDevice.AVD_FILES_MASK = /^(.*)\.avd$/i;
108
112
  AndroidVirtualDevice.MIN_ANDROID_APILEVEL = 17;
109
113
  AndroidVirtualDevice.MIN_ANDROID_VERSION = "4.2";
114
+ /**
115
+ * The message that is printed from `avdmanager list avds`
116
+ */
110
117
  AndroidVirtualDevice.AVAILABLE_AVDS_MESSAGE = "Available Android Virtual Devices:";
118
+ /**
119
+ * The delimiter between devices that is used from `avdmanager list avds`
120
+ */
111
121
  AndroidVirtualDevice.AVD_LIST_DELIMITER = "---------";
112
122
  AndroidVirtualDevice.CONFIG_INI_FILE_NAME = "config.ini";
113
123
  AndroidVirtualDevice.INI_FILE_EXTENSION = ".ini";
@@ -120,3 +130,4 @@ AndroidVirtualDevice.TIMEOUT_SECONDS = 120;
120
130
  AndroidVirtualDevice.GENYMOTION_DEFAULT_STDERR_STRING = "Logging activities to file";
121
131
  AndroidVirtualDevice.UNABLE_TO_START_EMULATOR_MESSAGE = "Cannot run the app in the selected native emulator. Try to restart the adb server by running the `adb kill-server` command in the Command Prompt, or increase the allocated RAM of the virtual device through the Android Virtual Device manager. NativeScript CLI users can try to increase the timeout of the operation by adding the `--timeout` flag.";
122
132
  exports.SOCKET_CONNECTION_TIMEOUT_MS = 30000;
133
+ //# sourceMappingURL=constants.js.map
@@ -9,6 +9,32 @@ 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
+ */
12
38
  function cache() {
13
39
  return (target, propertyKey, descriptor) => {
14
40
  let result;
@@ -28,6 +54,7 @@ function cache() {
28
54
  let memoizeIDCounter = 0;
29
55
  function memoize(options) {
30
56
  return (target, propertyKey, descriptor) => {
57
+ // todo: remove once surely working as intended.
31
58
  const DEBUG = false;
32
59
  const memoizeID = memoizeIDCounter++;
33
60
  const valueOrGet = descriptor.value ? "value" : "get";
@@ -48,6 +75,7 @@ function memoize(options) {
48
75
  cacheMapName,
49
76
  hashKey,
50
77
  });
78
+ // initialize cache map if not exists
51
79
  if (!this.hasOwnProperty(cacheMapName)) {
52
80
  DEBUG && console.log("NO CACHE MAP YET, CREATING ONE NOW");
53
81
  Object.defineProperty(this, cacheMapName, {
@@ -62,12 +90,16 @@ function memoize(options) {
62
90
  console.log({
63
91
  cacheMap,
64
92
  });
93
+ // check if has memoized value based on hashFn
65
94
  if (cacheMap.has(hashKey)) {
66
95
  DEBUG && console.log("CACHE HIT");
96
+ // if yes, return cached value
67
97
  return cacheMap.get(hashKey);
68
98
  }
69
99
  DEBUG && console.log("CACHE MISS");
100
+ // if not call original and get result
70
101
  const result = originalMethod.apply(this, args);
102
+ // call shouldCache (if passed) with the result or default to true
71
103
  let shouldCache = true;
72
104
  if (options.shouldCache) {
73
105
  shouldCache = options.shouldCache.call(this, result);
@@ -77,12 +109,21 @@ function memoize(options) {
77
109
  DEBUG && console.log("CACHING NOW");
78
110
  cacheMap.set(hashKey, result);
79
111
  }
112
+ // if shouldCache: save result
80
113
  DEBUG && console.log("RETURNING", result);
81
114
  return result;
82
115
  };
83
116
  return descriptor;
84
117
  };
85
118
  }
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
+ */
86
127
  function invokeBefore(methodName, methodArgs) {
87
128
  return (target, propertyKey, descriptor) => {
88
129
  const originalValue = descriptor.value;
@@ -114,6 +155,7 @@ function performanceLog(localInjector) {
114
155
  const className = target.constructor.name;
115
156
  const trackName = `${className}${constants_1.AnalyticsEventLabelDelimiter}${propertyKey}`;
116
157
  const performanceService = localInjector.resolve("performanceService");
158
+ //needed for the returned function to have the same name as the original - used in hooks decorator
117
159
  const functionWrapper = {
118
160
  [originalMethod.name]: function (...args) {
119
161
  const start = performanceService.now();
@@ -139,12 +181,14 @@ function performanceLog(localInjector) {
139
181
  },
140
182
  };
141
183
  descriptor.value = functionWrapper[originalMethod.name];
184
+ // used to get parameter names in hooks decorator
142
185
  descriptor.value.toString = () => {
143
186
  return originalMethod.toString();
144
187
  };
145
188
  return descriptor;
146
189
  };
147
190
  }
191
+ // inspired by https://github.com/NativeScript/NativeScript/blob/55dfe25938569edbec89255008e5ad9804901305/tns-core-modules/globals/globals.ts#L121-L137
148
192
  function deprecated(additionalInfo, localInjector) {
149
193
  const isDeprecatedMessage = " is deprecated.";
150
194
  return (target, key, descriptor) => {
@@ -153,6 +197,7 @@ function deprecated(additionalInfo, localInjector) {
153
197
  const $logger = localInjector.resolve("logger");
154
198
  if (descriptor) {
155
199
  if (descriptor.value) {
200
+ // method
156
201
  const originalMethod = descriptor.value;
157
202
  descriptor.value = function (...args) {
158
203
  $logger.warn(`${key.toString()}${isDeprecatedMessage} ${additionalInfo}`);
@@ -161,6 +206,7 @@ function deprecated(additionalInfo, localInjector) {
161
206
  return descriptor;
162
207
  }
163
208
  else {
209
+ // property
164
210
  if (descriptor.set) {
165
211
  const originalSetter = descriptor.set;
166
212
  descriptor.set = function (...args) {
@@ -179,6 +225,7 @@ function deprecated(additionalInfo, localInjector) {
179
225
  }
180
226
  }
181
227
  else {
228
+ // class
182
229
  $logger.warn(`${(target &&
183
230
  (target.name ||
184
231
  (target.constructor && target.constructor.name))) ||
@@ -187,3 +234,4 @@ function deprecated(additionalInfo, localInjector) {
187
234
  }
188
235
  };
189
236
  }
237
+ //# sourceMappingURL=decorators.js.map
@@ -15,7 +15,9 @@ 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, $injector, $cancellation, $commandsService, $staticConfig, $sysInfo, $options, $versionsService, $packageManager, $terminalSpinnerService) {
18
+ constructor($logger,
19
+ // required by the hooksService
20
+ $injector, $cancellation, $commandsService, $staticConfig, $sysInfo, $options, $versionsService, $packageManager, $terminalSpinnerService) {
19
21
  this.$logger = $logger;
20
22
  this.$injector = $injector;
21
23
  this.$cancellation = $cancellation;
@@ -32,6 +34,7 @@ class CommandDispatcher {
32
34
  return this.printVersion();
33
35
  }
34
36
  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
35
38
  this.$logger.trace("Collecting system information...");
36
39
  const sysInfo = await this.$sysInfo.getSysInfo({
37
40
  pathToNativeScriptCliPackageJson: path.join(__dirname, "..", "..", "package.json"),
@@ -61,6 +64,7 @@ class CommandDispatcher {
61
64
  await this.$commandsService.tryExecuteCommand(commandName, commandArguments);
62
65
  }
63
66
  async resolveCommand(commandName, commandArguments, argv) {
67
+ // just a hook point
64
68
  return { commandName, commandArguments, argv };
65
69
  }
66
70
  getCommandName() {
@@ -68,12 +72,15 @@ class CommandDispatcher {
68
72
  if (remaining.length > 0) {
69
73
  return remaining[0].toString().toLowerCase();
70
74
  }
75
+ // if only <CLI_NAME> is specified on console, show console help
71
76
  this.$options.help = true;
72
77
  return "";
73
78
  }
74
79
  async printVersion() {
75
80
  this.$logger.info(this.$staticConfig.version);
76
81
  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
77
84
  return;
78
85
  }
79
86
  const spinner = this.$terminalSpinnerService.createSpinner();
@@ -101,6 +108,7 @@ class CommandDispatcher {
101
108
  if (semver.gte(nativescriptCliVersion.currentVersion, nativescriptCliVersion.latestVersion, {
102
109
  loose: true,
103
110
  })) {
111
+ // up-to-date
104
112
  spinner.succeed("Up to date.");
105
113
  }
106
114
  else {
@@ -132,3 +140,4 @@ class FutureDispatcher {
132
140
  }
133
141
  }
134
142
  yok_1.injector.register("dispatcher", FutureDispatcher, false);
143
+ //# sourceMappingURL=dispatchers.js.map
@@ -15,7 +15,9 @@ const source_map_1 = require("source-map");
15
15
  const helpers_1 = require("./helpers");
16
16
  const decorators_1 = require("./decorators");
17
17
  const yok_1 = require("./yok");
18
+ // we need this to overwrite .stack property (read-only in Error)
18
19
  function Exception() {
20
+ /* intentionally left blank */
19
21
  }
20
22
  Exception.prototype = new Error();
21
23
  async function resolveCallStack(error) {
@@ -60,6 +62,7 @@ async function resolveCallStack(error) {
60
62
  }));
61
63
  let outputMessage = remapped.join("\n");
62
64
  if (outputMessage.indexOf(error.message) === -1) {
65
+ // when fibers throw error in node 0.12.x, the stack does NOT contain the message
63
66
  outputMessage = outputMessage.replace(/Error/, "Error: " + error.message);
64
67
  }
65
68
  return outputMessage;
@@ -83,7 +86,9 @@ function installUncaughtExceptionListener(actionOnException) {
83
86
  }
84
87
  }
85
88
  catch (err) {
86
- process.exit(131);
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
92
  }
88
93
  };
89
94
  process.on("uncaughtException", handler);
@@ -95,6 +100,7 @@ async function tryTrackException(error, localInjector) {
95
100
  disableAnalytics = localInjector.resolve("staticConfig").disableAnalytics;
96
101
  }
97
102
  catch (err) {
103
+ // We should get here only in our unit tests.
98
104
  disableAnalytics = true;
99
105
  }
100
106
  if (!disableAnalytics) {
@@ -103,6 +109,7 @@ async function tryTrackException(error, localInjector) {
103
109
  await analyticsService.trackException(error, error.message);
104
110
  }
105
111
  catch (e) {
112
+ // Do not replace with logger due to cyclic dependency
106
113
  console.error("Error while reporting exception: " + e);
107
114
  }
108
115
  }
@@ -140,9 +147,10 @@ class Errors {
140
147
  exception.message = $messagesService.getMessage.apply($messagesService, [opts.formatStr].concat(argsArray));
141
148
  }
142
149
  catch (err) {
150
+ // Ignore
143
151
  }
144
152
  exception.stack = new Error(exception.message).stack;
145
- exception.errorCode = opts.errorCode || 127;
153
+ exception.errorCode = opts.errorCode || 127 /* ErrorCodes.UNKNOWN */;
146
154
  exception.suggestCommandHelp = suggestCommandHelp;
147
155
  exception.proxyAuthenticationRequired = !!opts.proxyAuthenticationRequired;
148
156
  exception.printOnStdout = opts.printOnStdout;
@@ -174,9 +182,10 @@ class Errors {
174
182
  await printCommandHelpSuggestion();
175
183
  }
176
184
  await tryTrackException(ex, this.$injector);
177
- process.exit(_.isNumber(ex.errorCode) ? ex.errorCode : 127);
185
+ process.exit(_.isNumber(ex.errorCode) ? ex.errorCode : 127 /* ErrorCodes.UNKNOWN */);
178
186
  }
179
187
  }
188
+ // If you want to activate this function, start Node with flags --nouse_idle_notification and --expose_gc
180
189
  verifyHeap(message) {
181
190
  if (global.gc) {
182
191
  console.log("verifyHeap: '%s'", message);
@@ -189,3 +198,4 @@ __decorate([
189
198
  (0, decorators_1.deprecated)("Use `fail` instead.")
190
199
  ], Errors.prototype, "failWithoutHelp", null);
191
200
  yok_1.injector.register("errors", Errors);
201
+ //# sourceMappingURL=errors.js.map
@@ -20,12 +20,14 @@ const constants_1 = require("../constants");
20
20
  const os_1 = require("os");
21
21
  const detectNewline = require("detect-newline");
22
22
  const archiver_1 = require("archiver");
23
+ // TODO: Add .d.ts for mkdirp module (or use it from @types repo).
23
24
  const mkdirp = require("mkdirp");
24
25
  let FileSystem = FileSystem_1 = class FileSystem {
25
26
  constructor($injector) {
26
27
  this.$injector = $injector;
27
28
  }
28
29
  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
29
31
  const $logger = this.$injector.resolve("logger");
30
32
  const zip = (0, archiver_1.create)("zip", {
31
33
  zlib: {
@@ -62,10 +64,10 @@ let FileSystem = FileSystem_1 = class FileSystem {
62
64
  proc = (0, path_1.join)(__dirname, "resources/platform-tools/unzip/win32/unzip");
63
65
  }
64
66
  else if ($hostInfo.isDarwin) {
65
- proc = "unzip";
67
+ proc = "unzip"; // darwin unzip is info-zip
66
68
  }
67
69
  else if ($hostInfo.isLinux) {
68
- proc = "unzip";
70
+ proc = "unzip"; // linux unzip is info-zip
69
71
  }
70
72
  if (!isCaseSensitive) {
71
73
  zipFile = this.findFileCaseInsensitive(zipFile);
@@ -106,6 +108,7 @@ let FileSystem = FileSystem_1 = class FileSystem {
106
108
  }
107
109
  catch (err) {
108
110
  if (err && err.code !== "ENOENT") {
111
+ // ignore "file doesn't exist" error
109
112
  throw err;
110
113
  }
111
114
  }
@@ -144,6 +147,7 @@ let FileSystem = FileSystem_1 = class FileSystem {
144
147
  }
145
148
  });
146
149
  if (root) {
150
+ // console.log("root", paths);
147
151
  return Array.from(paths.values()).reduce((sum, current) => sum + current, 0);
148
152
  }
149
153
  };
@@ -216,6 +220,8 @@ let FileSystem = FileSystem_1 = class FileSystem {
216
220
  writeFile(filename, data, encoding) {
217
221
  this.createDirectory((0, path_1.dirname)(filename));
218
222
  if (!data) {
223
+ // node 14 will no longer coerce unsupported input to strings anymore.
224
+ // clean any null or undefined data
219
225
  data = "";
220
226
  }
221
227
  fs.writeFileSync(filename, data, { encoding: encoding });
@@ -246,6 +252,8 @@ let FileSystem = FileSystem_1 = class FileSystem {
246
252
  return;
247
253
  }
248
254
  this.createDirectory((0, path_1.dirname)(destinationFileName));
255
+ // MobileApplication.app is resolved as a directory on Mac,
256
+ // therefore we need to copy it recursively as it's not a single file.
249
257
  shelljs.cp("-rf", sourceFileName, destinationFileName);
250
258
  const err = shelljs.error();
251
259
  if (err) {
@@ -321,7 +329,9 @@ let FileSystem = FileSystem_1 = class FileSystem {
321
329
  });
322
330
  await this.futureFromEvent(chown, "close");
323
331
  }
332
+ // nothing to do on Windows, as chown does not work on this platform
324
333
  }
334
+ // filterCallback: function(path: String, stat: fs.Stats): Boolean
325
335
  enumerateFilesInDirectorySync(directoryPath, filterCallback, opts, foundFiles) {
326
336
  foundFiles = foundFiles || [];
327
337
  if (!this.exists(directoryPath)) {
@@ -417,3 +427,4 @@ FileSystem.JSON_OBJECT_REGEXP = new RegExp(`{\\r*\\n*(\\W*)"`, "m");
417
427
  exports.FileSystem = FileSystem = FileSystem_1 = __decorate([
418
428
  injector.register("fs")
419
429
  ], FileSystem);
430
+ //# sourceMappingURL=file-system.js.map
@@ -13,11 +13,13 @@ 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(" │"),
16
17
  ].join("");
17
18
  const tagLine = [
18
19
  color_1.color.dim("│ "),
19
20
  color_1.color.dim(" → "),
20
21
  color_1.color.styleText(["whiteBright", "bold"], "Empower JavaScript with native APIs "),
22
+ // color.dim(" │"),
21
23
  ].join("");
22
24
  const headerLength = (0, color_1.stripColors)(header).length;
23
25
  const tagLineLength = (0, color_1.stripColors)(tagLine).length;
@@ -27,3 +29,4 @@ function printHeader() {
27
29
  console.info(" " + tagLine + " ".repeat(width - tagLineLength) + color_1.color.dim("│"));
28
30
  console.info(" " + color_1.color.dim("└" + "─".repeat(width - 1) + "┘"));
29
31
  }
32
+ //# sourceMappingURL=header.js.map