nativescript 8.8.0 → 8.8.1

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 (327) hide show
  1. package/config/test-deps-versions-generated.json +1 -1
  2. package/lib/android-tools-info.js +12 -0
  3. package/lib/base-package-manager.js +11 -1
  4. package/lib/bootstrap.js +5 -1
  5. package/lib/bun-package-manager.js +17 -1
  6. package/lib/color.js +3 -0
  7. package/lib/commands/add-platform.js +1 -0
  8. package/lib/commands/apple-login.js +1 -0
  9. package/lib/commands/appstore-list.js +1 -0
  10. package/lib/commands/appstore-upload.js +4 -0
  11. package/lib/commands/build.js +3 -2
  12. package/lib/commands/clean.js +22 -1
  13. package/lib/commands/command-base.js +1 -0
  14. package/lib/commands/config.js +3 -0
  15. package/lib/commands/create-project.js +6 -0
  16. package/lib/commands/debug.js +6 -1
  17. package/lib/commands/deploy.js +3 -2
  18. package/lib/commands/embedding/embed.js +7 -0
  19. package/lib/commands/extensibility/install-extension.js +1 -0
  20. package/lib/commands/extensibility/list-extensions.js +1 -0
  21. package/lib/commands/extensibility/uninstall-extension.js +1 -0
  22. package/lib/commands/fonts.js +1 -0
  23. package/lib/commands/generate-assets.js +1 -0
  24. package/lib/commands/generate-help.js +1 -0
  25. package/lib/commands/generate.js +12 -2
  26. package/lib/commands/info.js +1 -0
  27. package/lib/commands/install.js +1 -0
  28. package/lib/commands/list-platforms.js +1 -0
  29. package/lib/commands/migrate.js +1 -0
  30. package/lib/commands/native-add.js +5 -0
  31. package/lib/commands/platform-clean.js +1 -0
  32. package/lib/commands/plugin/add-plugin.js +1 -0
  33. package/lib/commands/plugin/build-plugin.js +1 -0
  34. package/lib/commands/plugin/create-plugin.js +5 -0
  35. package/lib/commands/plugin/list-plugins.js +1 -0
  36. package/lib/commands/plugin/remove-plugin.js +2 -0
  37. package/lib/commands/plugin/update-plugin.js +1 -0
  38. package/lib/commands/post-install.js +6 -0
  39. package/lib/commands/prepare.js +4 -3
  40. package/lib/commands/preview.js +2 -0
  41. package/lib/commands/remove-platform.js +1 -0
  42. package/lib/commands/resources/resources-update.js +2 -0
  43. package/lib/commands/run.js +1 -0
  44. package/lib/commands/setup.js +1 -0
  45. package/lib/commands/start.js +1 -0
  46. package/lib/commands/test-init.js +4 -0
  47. package/lib/commands/test.js +9 -2
  48. package/lib/commands/typings.js +2 -1
  49. package/lib/commands/update-platform.js +5 -0
  50. package/lib/commands/update.js +2 -0
  51. package/lib/common/bootstrap.js +1 -0
  52. package/lib/common/child-process.js +3 -0
  53. package/lib/common/codeGeneration/code-entity.js +1 -0
  54. package/lib/common/codeGeneration/code-printer.js +1 -0
  55. package/lib/common/command-params.js +1 -0
  56. package/lib/common/commands/analytics.js +3 -0
  57. package/lib/common/commands/autocompletion.js +3 -0
  58. package/lib/common/commands/device/device-log-stream.js +1 -0
  59. package/lib/common/commands/device/get-file.js +2 -0
  60. package/lib/common/commands/device/list-applications.js +1 -0
  61. package/lib/common/commands/device/list-devices.js +3 -0
  62. package/lib/common/commands/device/list-files.js +2 -0
  63. package/lib/common/commands/device/put-file.js +2 -0
  64. package/lib/common/commands/device/run-application.js +1 -0
  65. package/lib/common/commands/device/stop-application.js +1 -0
  66. package/lib/common/commands/device/uninstall-application.js +1 -0
  67. package/lib/common/commands/doctor.js +3 -2
  68. package/lib/common/commands/generate-messages.js +1 -0
  69. package/lib/common/commands/help.js +1 -0
  70. package/lib/common/commands/package-manager-get.js +1 -0
  71. package/lib/common/commands/package-manager-set.js +1 -0
  72. package/lib/common/commands/post-install.js +1 -0
  73. package/lib/common/commands/preuninstall.js +11 -2
  74. package/lib/common/commands/proxy/proxy-base.js +4 -0
  75. package/lib/common/commands/proxy/proxy-clear.js +1 -0
  76. package/lib/common/commands/proxy/proxy-get.js +1 -0
  77. package/lib/common/commands/proxy/proxy-set.js +1 -0
  78. package/lib/common/common-lib.js +1 -0
  79. package/lib/common/constants.js +11 -0
  80. package/lib/common/decorators.js +48 -0
  81. package/lib/common/dispatchers.js +10 -1
  82. package/lib/common/errors.js +13 -3
  83. package/lib/common/file-system.js +13 -2
  84. package/lib/common/header.js +3 -0
  85. package/lib/common/helpers.js +89 -3
  86. package/lib/common/host-info.js +4 -0
  87. package/lib/common/http-client.js +20 -0
  88. package/lib/common/logger/appenders/cli-appender.js +4 -0
  89. package/lib/common/logger/appenders/emit-appender.js +4 -0
  90. package/lib/common/logger/layouts/cli-layout.js +1 -0
  91. package/lib/common/logger/logger.js +5 -0
  92. package/lib/common/messages/messages.js +6 -0
  93. package/lib/common/mobile/android/android-application-manager.js +20 -1
  94. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
  95. package/lib/common/mobile/android/android-debug-bridge.js +6 -0
  96. package/lib/common/mobile/android/android-device-file-system.js +4 -0
  97. package/lib/common/mobile/android/android-device-hash-service.js +3 -0
  98. package/lib/common/mobile/android/android-device.js +8 -0
  99. package/lib/common/mobile/android/android-emulator-services.js +2 -1
  100. package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
  101. package/lib/common/mobile/android/android-log-filter.js +4 -0
  102. package/lib/common/mobile/android/android-virtual-device-service.js +30 -1
  103. package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
  104. package/lib/common/mobile/android/genymotion/genymotion-service.js +5 -0
  105. package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
  106. package/lib/common/mobile/android/logcat-helper.js +13 -0
  107. package/lib/common/mobile/application-manager-base.js +6 -0
  108. package/lib/common/mobile/device-emitter.js +4 -0
  109. package/lib/common/mobile/device-log-emitter.js +1 -0
  110. package/lib/common/mobile/device-log-provider-base.js +1 -0
  111. package/lib/common/mobile/device-log-provider.js +23 -0
  112. package/lib/common/mobile/device-platforms-constants.js +1 -0
  113. package/lib/common/mobile/emulator-helper.js +4 -0
  114. package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
  115. package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
  116. package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
  117. package/lib/common/mobile/ios/device/ios-device.js +4 -0
  118. package/lib/common/mobile/ios/ios-device-base.js +1 -0
  119. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
  120. package/lib/common/mobile/ios/ios-log-filter.js +1 -0
  121. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
  122. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
  123. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
  124. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
  125. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
  126. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
  127. package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
  128. package/lib/common/mobile/log-filter.js +2 -0
  129. package/lib/common/mobile/logging-levels.js +1 -0
  130. package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
  131. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
  132. package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
  133. package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
  134. package/lib/common/mobile/mobile-core/devices-service.js +69 -0
  135. package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
  136. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
  137. package/lib/common/mobile/mobile-helper.js +1 -0
  138. package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
  139. package/lib/common/opener.js +1 -0
  140. package/lib/common/os-info.js +1 -0
  141. package/lib/common/plist-parser.js +1 -0
  142. package/lib/common/project-helper.js +1 -0
  143. package/lib/common/prompter.js +9 -1
  144. package/lib/common/queue.js +1 -0
  145. package/lib/common/resource-loader.js +1 -0
  146. package/lib/common/services/auto-completion-service.js +13 -1
  147. package/lib/common/services/cancellation.js +2 -1
  148. package/lib/common/services/commands-service.js +17 -6
  149. package/lib/common/services/help-service.js +11 -3
  150. package/lib/common/services/hooks-service.js +13 -0
  151. package/lib/common/services/ios-notification-service.js +1 -0
  152. package/lib/common/services/json-file-settings-service.js +6 -0
  153. package/lib/common/services/lock-service.js +6 -0
  154. package/lib/common/services/message-contract-generator.js +1 -0
  155. package/lib/common/services/messages-service.js +1 -0
  156. package/lib/common/services/micro-templating-service.js +6 -0
  157. package/lib/common/services/net-service.js +3 -0
  158. package/lib/common/services/project-files-manager.js +5 -0
  159. package/lib/common/services/project-files-provider-base.js +1 -0
  160. package/lib/common/services/proxy-service.js +1 -0
  161. package/lib/common/services/qr.js +1 -0
  162. package/lib/common/services/settings-service.js +1 -0
  163. package/lib/common/services/xcode-select-service.js +1 -0
  164. package/lib/common/utils.js +1 -0
  165. package/lib/common/validators/project-name-validator.js +1 -0
  166. package/lib/common/validators/validation-result.js +1 -0
  167. package/lib/common/verify-node-version.js +8 -1
  168. package/lib/common/yok.js +32 -11
  169. package/lib/config.js +22 -1
  170. package/lib/constants-provider.js +1 -0
  171. package/lib/constants.js +53 -0
  172. package/lib/controllers/build-controller.js +4 -3
  173. package/lib/controllers/debug-controller.js +8 -3
  174. package/lib/controllers/deploy-controller.js +1 -0
  175. package/lib/controllers/migrate-controller.js +91 -3
  176. package/lib/controllers/platform-controller.js +9 -1
  177. package/lib/controllers/prepare-controller.js +17 -4
  178. package/lib/controllers/run-controller.js +17 -1
  179. package/lib/controllers/update-controller-base.js +1 -0
  180. package/lib/controllers/update-controller.js +11 -0
  181. package/lib/data/build-data.js +1 -0
  182. package/lib/data/controller-data-base.js +1 -0
  183. package/lib/data/debug-data.js +1 -0
  184. package/lib/data/platform-data.js +1 -0
  185. package/lib/data/prepare-data.js +1 -0
  186. package/lib/data/run-data.js +1 -0
  187. package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
  188. package/lib/detached-processes/cleanup-process.js +18 -14
  189. package/lib/detached-processes/file-log-service.js +2 -1
  190. package/lib/device-path-provider.js +1 -0
  191. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
  192. package/lib/device-sockets/ios/notification.js +3 -0
  193. package/lib/device-sockets/ios/socket-request-executor.js +3 -0
  194. package/lib/helpers/android-bundle-validator-helper.js +2 -1
  195. package/lib/helpers/deploy-command-helper.js +1 -0
  196. package/lib/helpers/key-command-helper.js +4 -2
  197. package/lib/helpers/livesync-command-helper.js +4 -1
  198. package/lib/helpers/network-connectivity-validator.js +1 -0
  199. package/lib/helpers/options-track-helper.js +3 -2
  200. package/lib/helpers/package-path-helper.js +1 -0
  201. package/lib/helpers/platform-command-helper.js +7 -2
  202. package/lib/helpers/version-validator-helper.js +1 -0
  203. package/lib/key-commands/bootstrap.js +3 -2
  204. package/lib/key-commands/index.js +5 -4
  205. package/lib/nativescript-cli-lib-bootstrap.js +4 -0
  206. package/lib/nativescript-cli-lib.js +1 -0
  207. package/lib/nativescript-cli.js +10 -1
  208. package/lib/node/pbxproj-dom-xcode.js +1 -0
  209. package/lib/node/xcode.js +1 -0
  210. package/lib/node-package-manager.js +11 -1
  211. package/lib/options.js +143 -118
  212. package/lib/package-installation-manager.js +8 -1
  213. package/lib/package-manager.js +2 -0
  214. package/lib/platform-command-param.js +1 -0
  215. package/lib/pnpm-package-manager.js +4 -1
  216. package/lib/project-data.js +12 -0
  217. package/lib/providers/project-files-provider.js +1 -0
  218. package/lib/resolvers/livesync-service-resolver.js +1 -0
  219. package/lib/services/analytics/analytics-broker-process.js +10 -6
  220. package/lib/services/analytics/analytics-broker.js +2 -1
  221. package/lib/services/analytics/analytics-service.js +29 -25
  222. package/lib/services/analytics/google-analytics-provider.js +13 -12
  223. package/lib/services/analytics-settings-service.js +5 -0
  224. package/lib/services/android/android-bundle-tool-service.js +1 -0
  225. package/lib/services/android/gradle-build-args-service.js +3 -0
  226. package/lib/services/android/gradle-build-service.js +1 -0
  227. package/lib/services/android/gradle-command-service.js +6 -1
  228. package/lib/services/android-device-debug-service.js +6 -0
  229. package/lib/services/android-plugin-build-service.js +33 -1
  230. package/lib/services/android-project-service.js +71 -4
  231. package/lib/services/android-resources-migration-service.js +7 -0
  232. package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
  233. package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
  234. package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
  235. package/lib/services/assets-generation/assets-generation-service.js +16 -5
  236. package/lib/services/build-artifacts-service.js +2 -1
  237. package/lib/services/build-data-service.js +1 -0
  238. package/lib/services/build-info-file-service.js +1 -0
  239. package/lib/services/cleanup-service.js +13 -9
  240. package/lib/services/cocoapods-platform-manager.js +9 -0
  241. package/lib/services/cocoapods-service.js +21 -1
  242. package/lib/services/debug-data-service.js +1 -0
  243. package/lib/services/debug-service-base.js +7 -0
  244. package/lib/services/device/device-install-app-service.js +2 -1
  245. package/lib/services/doctor-service.js +21 -6
  246. package/lib/services/extensibility-service.js +8 -0
  247. package/lib/services/files-hash-service.js +1 -0
  248. package/lib/services/hmr-status-service.js +2 -0
  249. package/lib/services/info-service.js +1 -0
  250. package/lib/services/initialize-service.js +5 -1
  251. package/lib/services/ios/export-options-plist-service.js +4 -0
  252. package/lib/services/ios/ios-signing-service.js +4 -0
  253. package/lib/services/ios/spm-service.js +9 -0
  254. package/lib/services/ios/xcodebuild-args-service.js +9 -0
  255. package/lib/services/ios/xcodebuild-command-service.js +1 -0
  256. package/lib/services/ios/xcodebuild-service.js +1 -0
  257. package/lib/services/ios-debugger-port-service.js +1 -0
  258. package/lib/services/ios-device-debug-service.js +1 -0
  259. package/lib/services/ios-entitlements-service.js +1 -0
  260. package/lib/services/ios-extensions-service.js +1 -0
  261. package/lib/services/ios-log-filter.js +20 -0
  262. package/lib/services/ios-native-target-service.js +6 -4
  263. package/lib/services/ios-project-service.js +94 -2
  264. package/lib/services/ios-provision-service.js +3 -0
  265. package/lib/services/ios-watch-app-service.js +1 -0
  266. package/lib/services/ip-service.js +2 -0
  267. package/lib/services/itmstransporter-service.js +1 -0
  268. package/lib/services/karma-execution.js +2 -0
  269. package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
  270. package/lib/services/livesync/android-device-livesync-service.js +2 -0
  271. package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
  272. package/lib/services/livesync/android-livesync-service.js +1 -0
  273. package/lib/services/livesync/android-livesync-tool.js +4 -0
  274. package/lib/services/livesync/device-livesync-service-base.js +2 -0
  275. package/lib/services/livesync/ios-device-livesync-service.js +7 -0
  276. package/lib/services/livesync/ios-livesync-service.js +2 -0
  277. package/lib/services/livesync/livesync-socket.js +1 -0
  278. package/lib/services/livesync/platform-livesync-service-base.js +5 -0
  279. package/lib/services/livesync-process-data-service.js +1 -0
  280. package/lib/services/log-parser-service.js +1 -0
  281. package/lib/services/log-source-map-service.js +15 -0
  282. package/lib/services/marking-mode-service.js +8 -5
  283. package/lib/services/metadata-filtering-service.js +1 -0
  284. package/lib/services/npm-config-service.js +4 -0
  285. package/lib/services/pacote-service.js +7 -0
  286. package/lib/services/performance-service.js +3 -1
  287. package/lib/services/platform/add-platform-service.js +49 -2
  288. package/lib/services/platform/platform-validation-service.js +1 -0
  289. package/lib/services/platform/prepare-native-platform-service.js +5 -2
  290. package/lib/services/platform-environment-requirements.js +8 -3
  291. package/lib/services/platform-project-service-base.js +1 -0
  292. package/lib/services/platforms-data-service.js +1 -0
  293. package/lib/services/plugins-service.js +20 -2
  294. package/lib/services/prepare-data-service.js +1 -0
  295. package/lib/services/project-backup-service.js +4 -0
  296. package/lib/services/project-changes-service.js +14 -3
  297. package/lib/services/project-cleanup-service.js +2 -0
  298. package/lib/services/project-config-service.js +22 -2
  299. package/lib/services/project-data-service.js +36 -7
  300. package/lib/services/project-name-service.js +1 -0
  301. package/lib/services/project-service.js +10 -0
  302. package/lib/services/project-templates-service.js +3 -2
  303. package/lib/services/qr-code-terminal-service.js +1 -0
  304. package/lib/services/require-service.js +1 -0
  305. package/lib/services/start-service.js +1 -0
  306. package/lib/services/temp-service.js +1 -0
  307. package/lib/services/terminal-spinner-service.js +2 -0
  308. package/lib/services/test-execution-service.js +9 -2
  309. package/lib/services/test-initialization-service.js +4 -0
  310. package/lib/services/timeline-profiler-service.js +1 -0
  311. package/lib/services/user-settings-service.js +1 -0
  312. package/lib/services/versions-service.js +6 -4
  313. package/lib/services/watch-ignore-list-service.js +1 -0
  314. package/lib/services/webpack/webpack-compiler-service.js +42 -1
  315. package/lib/services/xcconfig-service.js +2 -0
  316. package/lib/services/xcproj-service.js +1 -0
  317. package/lib/shared-event-bus.js +6 -0
  318. package/lib/sys-info.js +2 -1
  319. package/lib/tools/config-manipulation/config-transformer.js +12 -0
  320. package/lib/tools/node-modules/node-modules-builder.js +1 -0
  321. package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
  322. package/lib/yarn-package-manager.js +1 -0
  323. package/lib/yarn2-package-manager.js +3 -0
  324. package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
  325. package/node_modules/rimraf/CHANGELOG.md +65 -0
  326. package/node_modules/stringify-package/CHANGELOG.md +16 -0
  327. package/package.json +2 -2
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
+ // This function must be separate to avoid dependencies on C++ modules - it must execute precisely when other functions cannot
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.getNodeWarning = exports.verifyNodeVersion = void 0;
4
5
  const color_1 = require("../color");
6
+ // Use only ES5 code here - pure JavaScript can be executed with any Node.js version (even 0.10, 0.12).
7
+ /* tslint:disable:no-var-keyword no-var-requires prefer-const*/
5
8
  var os = require("os");
6
9
  var semver = require("semver");
7
10
  var util = require("util");
11
+ // These versions cannot be used with CLI due to bugs in the node itself.
12
+ // We are absolutely sure we cannot work with them, so inform the user if he is trying to use any of them and exit the process.
8
13
  var versionsCausingFailure = ["0.10.34", "4.0.0", "4.2.0", "5.0.0"];
9
14
  var minimumRequiredVersion = "8.0.0";
10
15
  function getNodeVersionOpts() {
@@ -69,10 +74,12 @@ function getNodeWarning() {
69
74
  if (warningMessage) {
70
75
  nodeWarn = {
71
76
  message: warningMessage,
72
- severity: "medium",
77
+ severity: "medium" /* SystemWarningsSeverity.medium */,
73
78
  };
74
79
  }
75
80
  }
76
81
  return nodeWarn;
77
82
  }
78
83
  exports.getNodeWarning = getNodeWarning;
84
+ /* tslint:enable */
85
+ //# sourceMappingURL=verify-node-version.js.map
package/lib/common/yok.js CHANGED
@@ -16,6 +16,13 @@ const helpers_1 = require("./helpers");
16
16
  const constants_1 = require("./constants");
17
17
  let indent = "";
18
18
  function trace(formatStr, ...args) {
19
+ // uncomment following lines when debugging dependency injection
20
+ // const items: any[] = [];
21
+ // for (let _i = 1; _i < arguments.length; _i++) {
22
+ // items[_i - 1] = arguments[_i];
23
+ // }
24
+ // const util = require("util");
25
+ // console.log(util.format.apply(util, [indent + formatStr].concat(args)));
19
26
  }
20
27
  function pushIndent() {
21
28
  indent += " ";
@@ -33,6 +40,7 @@ function forEachName(names, action) {
33
40
  }
34
41
  function register(...rest) {
35
42
  return function (target) {
43
+ // TODO: Check if 'rest' has more arguments that have to be registered
36
44
  exports.injector.register(rest[0], target);
37
45
  };
38
46
  }
@@ -52,7 +60,7 @@ class Yok {
52
60
  }
53
61
  requireCommand(names, file) {
54
62
  forEachName(names, (commandName) => {
55
- const commands = commandName.split("|");
63
+ const commands = commandName.split("|" /* CommandsDelimiters.HierarchicalCommand */);
56
64
  if (commands.length > 1) {
57
65
  if (_.startsWith(commands[1], "*") &&
58
66
  this.modules[this.createCommandName(commands[0])]) {
@@ -62,7 +70,7 @@ class Yok {
62
70
  if (!this.hierarchicalCommands[parentCommandName]) {
63
71
  this.hierarchicalCommands[parentCommandName] = [];
64
72
  }
65
- this.hierarchicalCommands[parentCommandName].push(_.tail(commands).join("|"));
73
+ this.hierarchicalCommands[parentCommandName].push(_.tail(commands).join("|" /* CommandsDelimiters.HierarchicalCommand */));
66
74
  }
67
75
  if (commands.length > 1 &&
68
76
  !this.modules[this.createCommandName(commands[0])]) {
@@ -133,7 +141,7 @@ class Yok {
133
141
  }
134
142
  registerCommand(names, resolver) {
135
143
  forEachName(names, (name) => {
136
- const commands = name.split("|");
144
+ const commands = name.split("|" /* CommandsDelimiters.HierarchicalCommand */);
137
145
  this.register(this.createCommandName(name), resolver);
138
146
  if (commands.length > 1) {
139
147
  this.createHierarchicalCommand(commands[0]);
@@ -145,7 +153,7 @@ class Yok {
145
153
  }
146
154
  getDefaultCommand(name, commandArguments) {
147
155
  const subCommands = this.hierarchicalCommands[name];
148
- const defaultCommand = _.find(subCommands, (command) => _.some(command.split("|"), (c) => _.startsWith(c, "*")));
156
+ const defaultCommand = _.find(subCommands, (command) => _.some(command.split("|" /* CommandsDelimiters.HierarchicalCommand */), (c) => _.startsWith(c, "*" /* CommandsDelimiters.DefaultCommandSymbol */)));
149
157
  return defaultCommand;
150
158
  }
151
159
  buildHierarchicalCommand(parentCommandName, commandLineArguments) {
@@ -161,7 +169,7 @@ class Yok {
161
169
  remainingArguments = _.tail(remainingArguments);
162
170
  if ((matchingSubCommandName = _.find(subCommands, (sc) => sc === currentSubCommandName ||
163
171
  sc ===
164
- `${"*"}${currentSubCommandName}`))) {
172
+ `${"*" /* CommandsDelimiters.DefaultCommandSymbol */}${currentSubCommandName}`))) {
165
173
  finalSubCommandName = matchingSubCommandName;
166
174
  finalRemainingArguments = remainingArguments;
167
175
  }
@@ -170,8 +178,8 @@ class Yok {
170
178
  finalSubCommandName =
171
179
  this.getDefaultCommand(parentCommandName, commandLineArguments) || "";
172
180
  finalRemainingArguments = _.difference(commandLineArguments, finalSubCommandName
173
- .split("|")
174
- .map((command) => _.startsWith(command, "*")
181
+ .split("|" /* CommandsDelimiters.HierarchicalCommand */)
182
+ .map((command) => _.startsWith(command, "*" /* CommandsDelimiters.DefaultCommandSymbol */)
175
183
  ? command.substr(1)
176
184
  : command));
177
185
  }
@@ -202,7 +210,9 @@ class Yok {
202
210
  commandName = defaultCommand
203
211
  ? this.getHierarchicalCommandName(name, defaultCommand)
204
212
  : "help";
205
- if (_.includes(this.hierarchicalCommands[name], "*" + args[0])) {
213
+ // If we'll execute the default command, but it's full name had been written by the user
214
+ // for example "tns run ios", we have to remove the "ios" option from the arguments that we'll pass to the command.
215
+ if (_.includes(this.hierarchicalCommands[name], "*" /* CommandsDelimiters.DefaultCommandSymbol */ + args[0])) {
206
216
  commandArguments = _.tail(args);
207
217
  }
208
218
  else {
@@ -211,11 +221,13 @@ class Yok {
211
221
  }
212
222
  }
213
223
  else {
224
+ //Execute only default command without arguments
214
225
  if (defaultCommand) {
215
226
  commandName = this.getHierarchicalCommandName(name, defaultCommand);
216
227
  }
217
228
  else {
218
229
  commandName = "help";
230
+ // Show command-line help
219
231
  const options = this.resolve("options");
220
232
  options.help = true;
221
233
  }
@@ -227,7 +239,7 @@ class Yok {
227
239
  exports.injector.registerCommand(name, factory);
228
240
  }
229
241
  getHierarchicalCommandName(parentCommandName, subCommandName) {
230
- return [parentCommandName, subCommandName].join("|");
242
+ return [parentCommandName, subCommandName].join("|" /* CommandsDelimiters.HierarchicalCommand */);
231
243
  }
232
244
  isValidHierarchicalCommand(commandName, commandArguments) {
233
245
  return __awaiter(this, void 0, void 0, function* () {
@@ -236,6 +248,8 @@ class Yok {
236
248
  if (subCommands) {
237
249
  const fullCommandName = this.buildHierarchicalCommand(commandName, commandArguments);
238
250
  if (!fullCommandName) {
251
+ // In case buildHierarchicalCommand doesn't find a valid command
252
+ // there isn't a valid command or default with those arguments
239
253
  const errors = exports.injector.resolve("errors");
240
254
  errors.failWithHelp(constants_1.ERROR_NO_VALID_SUBCOMMAND_FORMAT, commandName);
241
255
  }
@@ -246,8 +260,8 @@ class Yok {
246
260
  });
247
261
  }
248
262
  isDefaultCommand(commandName) {
249
- return (commandName.indexOf("*") > 0 &&
250
- commandName.indexOf("|") > 0);
263
+ return (commandName.indexOf("*" /* CommandsDelimiters.DefaultCommandSymbol */) > 0 &&
264
+ commandName.indexOf("|" /* CommandsDelimiters.HierarchicalCommand */) > 0);
251
265
  }
252
266
  register(name, resolver, shared) {
253
267
  shared = shared === undefined ? true : shared;
@@ -294,6 +308,12 @@ class Yok {
294
308
  return this.resolveByName(param, ctorArguments);
295
309
  }
296
310
  }
311
+ /* Regex to match dynamic calls in the following format:
312
+ #{moduleName.functionName} or
313
+ #{moduleName.functionName(param1)} or
314
+ #{moduleName.functionName(param1, param2)} - multiple parameters separated with comma are supported
315
+ Check dynamicCall method for sample usage of this regular expression and see how to determine the passed parameters
316
+ */
297
317
  get dynamicCallRegex() {
298
318
  return /#{([^.]+)\.([^}]+?)(\((.+)\))*}/;
299
319
  }
@@ -424,3 +444,4 @@ function setGlobalInjector(inj) {
424
444
  return inj;
425
445
  }
426
446
  exports.setGlobalInjector = setGlobalInjector;
447
+ //# sourceMappingURL=yok.js.map
package/lib/config.js CHANGED
@@ -16,8 +16,10 @@ const os = require("os");
16
16
  const _ = require("lodash");
17
17
  const yok_1 = require("./common/yok");
18
18
  class Configuration {
19
+ /*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/
19
20
  constructor($fs) {
20
21
  this.$fs = $fs;
22
+ // User specific config
21
23
  this.DEBUG = false;
22
24
  this.ANDROID_DEBUG_UI = null;
23
25
  this.USE_POD_SANDBOX = false;
@@ -56,6 +58,7 @@ class StaticConfig {
56
58
  this._userAgent = null;
57
59
  }
58
60
  get disableCommandHooks() {
61
+ // Never set this to false because it will duplicate execution of hooks realized through method decoration
59
62
  return true;
60
63
  }
61
64
  get HTML_CLI_HELPERS_DIR() {
@@ -100,6 +103,7 @@ class StaticConfig {
100
103
  return __awaiter(this, void 0, void 0, function* () {
101
104
  const $childProcess = this.$injector.resolve("$childProcess");
102
105
  try {
106
+ // Do NOT use the adb wrapper because it will end blow up with Segmentation fault because the wrapper uses this method!!!
103
107
  const proc = yield $childProcess.spawnFromEvent("adb", ["version"], "exit", undefined, { throwError: false });
104
108
  if (proc.stderr) {
105
109
  return yield this.spawnPrivateAdb();
@@ -113,21 +117,37 @@ class StaticConfig {
113
117
  return "adb";
114
118
  });
115
119
  }
120
+ /*
121
+ Problem:
122
+ 1. Adb forks itself as a server which keeps running until adb kill-server is invoked or crashes
123
+ 2. On Windows running processes lock their image files due to memory mapping. Locked files prevent their parent directories from deletion and cannot be overwritten.
124
+ 3. Update and uninstall scenarios are broken
125
+ Solution:
126
+ - Copy adb and associated files into a temporary directory. Let this copy of adb run persistently
127
+ - On Posix OSes, immediately delete the file to not take file space
128
+ - Tie common lib version to updates of adb, so that when we integrate a newer adb we can use it
129
+ - Adb is named differently on OSes and may have additional files. The code is hairy to accommodate these differences
130
+ */
116
131
  spawnPrivateAdb() {
117
132
  return __awaiter(this, void 0, void 0, function* () {
118
133
  const $fs = this.$injector.resolve("$fs"), $childProcess = this.$injector.resolve("$childProcess"), $hostInfo = this.$injector.resolve("$hostInfo");
134
+ // prepare the directory to host our copy of adb
119
135
  const defaultAdbDirPath = path.join(__dirname, "common", "resources", "platform-tools", "android", process.platform);
120
136
  const pathToPackageJson = path.join(__dirname, "..", "package.json");
121
137
  const nsCliVersion = require(pathToPackageJson).version;
122
138
  const tmpDir = path.join(os.tmpdir(), `nativescript-cli-${nsCliVersion}`);
123
139
  $fs.createDirectory(tmpDir);
140
+ // copy the adb and associated files
124
141
  const targetAdb = path.join(tmpDir, "adb");
142
+ // In case directory is missing or it's empty, copy the new adb
125
143
  if (!$fs.exists(tmpDir) || !$fs.readDirectory(tmpDir).length) {
126
- shelljs.cp(path.join(defaultAdbDirPath, "*"), tmpDir);
144
+ shelljs.cp(path.join(defaultAdbDirPath, "*"), tmpDir); // deliberately ignore copy errors
145
+ // adb loses its executable bit when packed inside electron asar file. Manually fix the issue
127
146
  if (!$hostInfo.isWindows) {
128
147
  shelljs.chmod("+x", targetAdb);
129
148
  }
130
149
  }
150
+ // let adb start its global server
131
151
  yield $childProcess.spawnFromEvent(targetAdb, ["start-server"], "exit");
132
152
  return targetAdb;
133
153
  });
@@ -135,3 +155,4 @@ class StaticConfig {
135
155
  }
136
156
  exports.StaticConfig = StaticConfig;
137
157
  yok_1.injector.register("staticConfig", StaticConfig);
158
+ //# sourceMappingURL=config.js.map
@@ -10,3 +10,4 @@ class Constants {
10
10
  }
11
11
  exports.Constants = Constants;
12
12
  yok_1.injector.register("constants", Constants);
13
+ //# sourceMappingURL=constants-provider.js.map
package/lib/constants.js CHANGED
@@ -146,6 +146,7 @@ exports.RESERVED_TEMPLATE_NAMES = {
146
146
  solid: "@nativescript/template-blank-solid",
147
147
  solidjs: "@nativescript/template-blank-solid",
148
148
  svelte: "@nativescript/template-blank-svelte",
149
+ // vision templates
149
150
  vision: "@nativescript/template-hello-world-ts-vision",
150
151
  "vision-vue": "@nativescript/template-blank-vue-vision",
151
152
  "vision-ng": "@nativescript/template-hello-world-ng-vision",
@@ -221,6 +222,9 @@ DebugCommandErrors.NO_DEVICES_EMULATORS_FOUND_FOR_OPTIONS = "Unable to find devi
221
222
  DebugCommandErrors.UNSUPPORTED_DEVICE_OS_FOR_DEBUGGING = "Unsupported device OS for debugging";
222
223
  exports.DebugCommandErrors = DebugCommandErrors;
223
224
  exports.AnalyticsEventLabelDelimiter = "__";
225
+ /**
226
+ * Used in ProjectDataService to concatenate the names of the properties inside nativescript key of package.json.
227
+ */
224
228
  exports.NATIVESCRIPT_PROPS_INTERNAL_DELIMITER = "**|__**";
225
229
  exports.CLI_RESOURCES_DIR_NAME = "resources";
226
230
  class AssetConstants {
@@ -237,6 +241,7 @@ AssetConstants.sizeDelimiter = "x";
237
241
  AssetConstants.defaultScale = 1;
238
242
  AssetConstants.defaultOverlayImageScale = 0.8;
239
243
  exports.AssetConstants = AssetConstants;
244
+ // https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
240
245
  class MacOSVersions {
241
246
  }
242
247
  MacOSVersions.Sierra = "10.12";
@@ -246,6 +251,14 @@ MacOSVersions.Catalina = "10.15";
246
251
  exports.MacOSVersions = MacOSVersions;
247
252
  exports.MacOSDeprecationStringFormat = "NativeScript does not support macOS %s and some functionality may not work. Please, upgrade to the latest macOS version.";
248
253
  exports.XcodeDeprecationStringFormat = "The current Xcode version %s will not be supported in the next release of NativeScript. Consider updating your Xcode to latest official version.";
254
+ // export class TemplateVersions {
255
+ // public static v1 = "v1";
256
+ // public static v2 = "v2";
257
+ // }
258
+ // export class ProjectTemplateErrors {
259
+ // public static InvalidTemplateVersionStringFormat =
260
+ // "The template '%s' has a NativeScript version '%s' that is not supported. Unable to create project from it.";
261
+ // }
249
262
  class Hooks {
250
263
  }
251
264
  Hooks.createProject = "createProject";
@@ -286,6 +299,7 @@ AndroidAppBundleMessages.ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE = "How to use A
286
299
  exports.AndroidAppBundleMessages = AndroidAppBundleMessages;
287
300
  exports.RunOnDeviceEvents = {
288
301
  runOnDeviceStopped: "runOnDeviceStopped",
302
+ // In case we name it error, EventEmitter expects instance of Error to be raised and will also raise uncaught exception in case there's no handler
289
303
  runOnDeviceError: "runOnDeviceError",
290
304
  runOnDeviceExecuted: "runOnDeviceExecuted",
291
305
  runOnDeviceStarted: "runOnDeviceStarted",
@@ -322,14 +336,52 @@ var DeviceConnectionType;
322
336
  })(DeviceConnectionType = exports.DeviceConnectionType || (exports.DeviceConnectionType = {}));
323
337
  var LoggerLevel;
324
338
  (function (LoggerLevel) {
339
+ /**
340
+ * Show all log messages.
341
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
342
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
343
+ */
325
344
  LoggerLevel["ALL"] = "ALL";
345
+ /**
346
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
347
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
348
+ */
326
349
  LoggerLevel["TRACE"] = "TRACE";
350
+ /**
351
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
352
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
353
+ */
327
354
  LoggerLevel["DEBUG"] = "DEBUG";
355
+ /**
356
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
357
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
358
+ */
328
359
  LoggerLevel["INFO"] = "INFO";
360
+ /**
361
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
362
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
363
+ */
329
364
  LoggerLevel["WARN"] = "WARN";
365
+ /**
366
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
367
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
368
+ */
330
369
  LoggerLevel["ERROR"] = "ERROR";
370
+ /**
371
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
372
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
373
+ */
331
374
  LoggerLevel["FATAL"] = "FATAL";
375
+ /**
376
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
377
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
378
+ */
332
379
  LoggerLevel["MARK"] = "MARK";
380
+ /**
381
+ * Disable all logging.
382
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
383
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
384
+ */
333
385
  LoggerLevel["OFF"] = "OFF";
334
386
  })(LoggerLevel = exports.LoggerLevel || (exports.LoggerLevel = {}));
335
387
  var LoggerConfigData;
@@ -347,3 +399,4 @@ var PackageManagers;
347
399
  PackageManagers["yarn2"] = "yarn2";
348
400
  PackageManagers["bun"] = "bun";
349
401
  })(PackageManagers = exports.PackageManagers || (exports.PackageManagers = {}));
402
+ //# sourceMappingURL=constants.js.map
@@ -47,7 +47,7 @@ class BuildController extends events_1.EventEmitter {
47
47
  const platform = buildData.platform.toLowerCase();
48
48
  const projectData = this.$projectDataService.getProjectData(buildData.projectDir);
49
49
  const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
50
- const action = "Build";
50
+ const action = "Build" /* constants.TrackActionNames.Build */;
51
51
  const isForDevice = this.$mobileHelper.isAndroidPlatform(platform)
52
52
  ? null
53
53
  : buildData && buildData.buildForDevice;
@@ -57,8 +57,8 @@ class BuildController extends events_1.EventEmitter {
57
57
  platform,
58
58
  projectDir: projectData.projectDir,
59
59
  additionalData: `${buildData.release ? constants_1.Configurations.Release : constants_1.Configurations.Debug}_${buildData.clean
60
- ? "Clean"
61
- : "Incremental"}`,
60
+ ? "Clean" /* constants.BuildStates.Clean */
61
+ : "Incremental" /* constants.BuildStates.Incremental */}`,
62
62
  });
63
63
  if (buildData.clean) {
64
64
  yield platformData.platformProjectService.cleanProject(platformData.projectRoot);
@@ -131,3 +131,4 @@ class BuildController extends events_1.EventEmitter {
131
131
  }
132
132
  exports.BuildController = BuildController;
133
133
  yok_1.injector.register("buildController", BuildController);
134
+ //# sourceMappingURL=build-controller.js.map
@@ -50,13 +50,13 @@ class DebugController extends events_1.EventEmitter {
50
50
  this.$errors.fail(`The device with identifier ${debugData.deviceIdentifier} is unreachable. Make sure it is Trusted and try again.`);
51
51
  }
52
52
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
53
- action: "Debug",
53
+ action: "Debug" /* TrackActionNames.Debug */,
54
54
  device,
55
55
  additionalData: this.$mobileHelper.isiOSPlatform(device.deviceInfo.platform) &&
56
56
  options &&
57
57
  options.inspector
58
- ? "Inspector"
59
- : "Chrome",
58
+ ? "Inspector" /* DebugTools.Inspector */
59
+ : "Chrome" /* DebugTools.Chrome */,
60
60
  projectDir: debugData.projectDir,
61
61
  });
62
62
  if (!(yield device.applicationManager.isApplicationInstalled(debugData.applicationIdentifier))) {
@@ -101,6 +101,7 @@ class DebugController extends events_1.EventEmitter {
101
101
  }
102
102
  attachDebugger(attachDebuggerData) {
103
103
  return __awaiter(this, void 0, void 0, function* () {
104
+ // Default values
104
105
  if (attachDebuggerData.debugOptions) {
105
106
  attachDebuggerData.debugOptions.chrome =
106
107
  attachDebuggerData.debugOptions.chrome === undefined
@@ -119,6 +120,9 @@ class DebugController extends events_1.EventEmitter {
119
120
  }
120
121
  const projectData = this.$projectDataService.getProjectData(attachDebuggerData.projectDir);
121
122
  const debugData = this.$debugDataService.getDebugData(attachDebuggerData.deviceIdentifier, projectData, attachDebuggerData.debugOptions);
123
+ // const platformData = this.$platformsDataService.getPlatformData(settings.platform, projectData);
124
+ // Of the properties below only `buildForDevice` and `release` are currently used.
125
+ // Leaving the others with placeholder values so that they may not be forgotten in future implementations.
122
126
  const debugInfo = yield this.startDebug(debugData);
123
127
  const result = this.printDebugInformation(debugInfo, attachDebuggerData.debugOptions.forceDebuggerAttachedEvent);
124
128
  return result;
@@ -233,3 +237,4 @@ __decorate([
233
237
  ], DebugController.prototype, "enableDebuggingCoreWithoutWaitingCurrentAction", null);
234
238
  exports.DebugController = DebugController;
235
239
  yok_1.injector.register("debugController", DebugController);
240
+ //# sourceMappingURL=debug-controller.js.map
@@ -36,3 +36,4 @@ class DeployController {
36
36
  }
37
37
  exports.DeployController = DeployController;
38
38
  yok_1.injector.register("deployController", DeployController);
39
+ //# sourceMappingURL=deploy-controller.js.map