nativescript 8.7.0-rc.0 → 8.7.0-rc.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 (324) 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 +7 -1
  4. package/lib/color.js +3 -0
  5. package/lib/commands/add-platform.js +1 -0
  6. package/lib/commands/apple-login.js +1 -0
  7. package/lib/commands/appstore-list.js +1 -0
  8. package/lib/commands/appstore-upload.js +4 -0
  9. package/lib/commands/build.js +20 -3
  10. package/lib/commands/clean.js +22 -1
  11. package/lib/commands/command-base.js +1 -0
  12. package/lib/commands/config.js +3 -0
  13. package/lib/commands/create-project.js +34 -19
  14. package/lib/commands/debug.js +6 -1
  15. package/lib/commands/deploy.js +3 -2
  16. package/lib/commands/extensibility/install-extension.js +1 -0
  17. package/lib/commands/extensibility/list-extensions.js +1 -0
  18. package/lib/commands/extensibility/uninstall-extension.js +1 -0
  19. package/lib/commands/fonts.js +1 -0
  20. package/lib/commands/generate-assets.js +1 -0
  21. package/lib/commands/generate-help.js +1 -0
  22. package/lib/commands/generate.js +12 -2
  23. package/lib/commands/info.js +1 -0
  24. package/lib/commands/install.js +1 -0
  25. package/lib/commands/list-platforms.js +1 -0
  26. package/lib/commands/migrate.js +1 -0
  27. package/lib/commands/platform-clean.js +1 -0
  28. package/lib/commands/plugin/add-plugin.js +1 -0
  29. package/lib/commands/plugin/build-plugin.js +1 -0
  30. package/lib/commands/plugin/create-plugin.js +5 -0
  31. package/lib/commands/plugin/list-plugins.js +1 -0
  32. package/lib/commands/plugin/remove-plugin.js +2 -0
  33. package/lib/commands/plugin/update-plugin.js +1 -0
  34. package/lib/commands/post-install.js +6 -0
  35. package/lib/commands/prepare.js +3 -2
  36. package/lib/commands/preview.js +2 -0
  37. package/lib/commands/remove-platform.js +1 -0
  38. package/lib/commands/resources/resources-update.js +2 -0
  39. package/lib/commands/run.js +1 -0
  40. package/lib/commands/setup.js +1 -0
  41. package/lib/commands/start.js +1 -0
  42. package/lib/commands/test-init.js +4 -0
  43. package/lib/commands/test.js +9 -2
  44. package/lib/commands/typings.js +1 -0
  45. package/lib/commands/update-platform.js +5 -0
  46. package/lib/commands/update.js +2 -0
  47. package/lib/common/bootstrap.js +1 -0
  48. package/lib/common/child-process.js +3 -0
  49. package/lib/common/codeGeneration/code-entity.js +1 -0
  50. package/lib/common/codeGeneration/code-printer.js +1 -0
  51. package/lib/common/command-params.js +1 -0
  52. package/lib/common/commands/analytics.js +3 -0
  53. package/lib/common/commands/autocompletion.js +3 -0
  54. package/lib/common/commands/device/device-log-stream.js +1 -0
  55. package/lib/common/commands/device/get-file.js +2 -0
  56. package/lib/common/commands/device/list-applications.js +1 -0
  57. package/lib/common/commands/device/list-devices.js +3 -0
  58. package/lib/common/commands/device/list-files.js +2 -0
  59. package/lib/common/commands/device/put-file.js +2 -0
  60. package/lib/common/commands/device/run-application.js +1 -0
  61. package/lib/common/commands/device/stop-application.js +1 -0
  62. package/lib/common/commands/device/uninstall-application.js +1 -0
  63. package/lib/common/commands/doctor.js +3 -2
  64. package/lib/common/commands/generate-messages.js +1 -0
  65. package/lib/common/commands/help.js +1 -0
  66. package/lib/common/commands/package-manager-get.js +1 -0
  67. package/lib/common/commands/package-manager-set.js +1 -0
  68. package/lib/common/commands/post-install.js +1 -0
  69. package/lib/common/commands/preuninstall.js +11 -2
  70. package/lib/common/commands/proxy/proxy-base.js +4 -0
  71. package/lib/common/commands/proxy/proxy-clear.js +1 -0
  72. package/lib/common/commands/proxy/proxy-get.js +1 -0
  73. package/lib/common/commands/proxy/proxy-set.js +1 -0
  74. package/lib/common/common-lib.js +1 -0
  75. package/lib/common/constants.js +11 -0
  76. package/lib/common/decorators.js +48 -0
  77. package/lib/common/definitions/mobile.d.ts +1 -1
  78. package/lib/common/dispatchers.js +10 -1
  79. package/lib/common/errors.js +13 -3
  80. package/lib/common/file-system.js +13 -2
  81. package/lib/common/header.js +3 -0
  82. package/lib/common/helpers.js +89 -3
  83. package/lib/common/host-info.js +4 -0
  84. package/lib/common/http-client.js +20 -0
  85. package/lib/common/logger/appenders/cli-appender.js +4 -0
  86. package/lib/common/logger/appenders/emit-appender.js +4 -0
  87. package/lib/common/logger/layouts/cli-layout.js +1 -0
  88. package/lib/common/logger/logger.js +5 -0
  89. package/lib/common/messages/messages.js +6 -0
  90. package/lib/common/mobile/android/android-application-manager.js +20 -1
  91. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
  92. package/lib/common/mobile/android/android-debug-bridge.js +6 -0
  93. package/lib/common/mobile/android/android-device-file-system.js +4 -0
  94. package/lib/common/mobile/android/android-device-hash-service.js +3 -0
  95. package/lib/common/mobile/android/android-device.js +8 -0
  96. package/lib/common/mobile/android/android-emulator-services.js +2 -1
  97. package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
  98. package/lib/common/mobile/android/android-log-filter.js +4 -0
  99. package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
  100. package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
  101. package/lib/common/mobile/android/genymotion/genymotion-service.js +5 -0
  102. package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
  103. package/lib/common/mobile/android/logcat-helper.js +20 -1
  104. package/lib/common/mobile/application-manager-base.js +6 -0
  105. package/lib/common/mobile/device-emitter.js +4 -0
  106. package/lib/common/mobile/device-log-emitter.js +1 -0
  107. package/lib/common/mobile/device-log-provider-base.js +1 -0
  108. package/lib/common/mobile/device-log-provider.js +23 -0
  109. package/lib/common/mobile/device-platforms-constants.js +1 -0
  110. package/lib/common/mobile/emulator-helper.js +3 -0
  111. package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
  112. package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
  113. package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
  114. package/lib/common/mobile/ios/device/ios-device.js +4 -0
  115. package/lib/common/mobile/ios/ios-device-base.js +1 -0
  116. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
  117. package/lib/common/mobile/ios/ios-log-filter.js +1 -0
  118. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
  119. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
  120. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
  121. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
  122. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
  123. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
  124. package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
  125. package/lib/common/mobile/log-filter.js +2 -0
  126. package/lib/common/mobile/logging-levels.js +1 -0
  127. package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
  128. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
  129. package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
  130. package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
  131. package/lib/common/mobile/mobile-core/devices-service.js +72 -3
  132. package/lib/common/mobile/mobile-core/ios-device-discovery.js +3 -1
  133. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
  134. package/lib/common/mobile/mobile-helper.js +2 -1
  135. package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
  136. package/lib/common/opener.js +1 -0
  137. package/lib/common/os-info.js +1 -0
  138. package/lib/common/plist-parser.js +1 -0
  139. package/lib/common/project-helper.js +1 -0
  140. package/lib/common/prompter.js +9 -1
  141. package/lib/common/queue.js +1 -0
  142. package/lib/common/resource-loader.js +1 -0
  143. package/lib/common/services/auto-completion-service.js +12 -1
  144. package/lib/common/services/cancellation.js +2 -1
  145. package/lib/common/services/commands-service.js +17 -6
  146. package/lib/common/services/help-service.js +11 -3
  147. package/lib/common/services/hooks-service.js +13 -0
  148. package/lib/common/services/ios-notification-service.js +1 -0
  149. package/lib/common/services/json-file-settings-service.js +6 -0
  150. package/lib/common/services/lock-service.js +6 -0
  151. package/lib/common/services/message-contract-generator.js +1 -0
  152. package/lib/common/services/messages-service.js +1 -0
  153. package/lib/common/services/micro-templating-service.js +6 -0
  154. package/lib/common/services/net-service.js +3 -0
  155. package/lib/common/services/project-files-manager.js +5 -0
  156. package/lib/common/services/project-files-provider-base.js +1 -0
  157. package/lib/common/services/proxy-service.js +1 -0
  158. package/lib/common/services/qr.js +1 -0
  159. package/lib/common/services/settings-service.js +1 -0
  160. package/lib/common/services/xcode-select-service.js +1 -0
  161. package/lib/common/utils.js +1 -0
  162. package/lib/common/validators/project-name-validator.js +1 -0
  163. package/lib/common/validators/validation-result.js +1 -0
  164. package/lib/common/verify-node-version.js +8 -1
  165. package/lib/common/yok.js +32 -11
  166. package/lib/config.js +22 -1
  167. package/lib/constants-provider.js +1 -0
  168. package/lib/constants.js +58 -5
  169. package/lib/controllers/build-controller.js +4 -3
  170. package/lib/controllers/debug-controller.js +8 -3
  171. package/lib/controllers/deploy-controller.js +1 -0
  172. package/lib/controllers/migrate-controller.js +91 -3
  173. package/lib/controllers/platform-controller.js +9 -1
  174. package/lib/controllers/prepare-controller.js +15 -5
  175. package/lib/controllers/run-controller.js +17 -1
  176. package/lib/controllers/update-controller-base.js +1 -0
  177. package/lib/controllers/update-controller.js +11 -0
  178. package/lib/data/build-data.js +1 -0
  179. package/lib/data/controller-data-base.js +1 -0
  180. package/lib/data/debug-data.js +1 -0
  181. package/lib/data/platform-data.js +1 -0
  182. package/lib/data/prepare-data.js +1 -0
  183. package/lib/data/run-data.js +1 -0
  184. package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
  185. package/lib/detached-processes/cleanup-process.js +18 -14
  186. package/lib/detached-processes/file-log-service.js +2 -1
  187. package/lib/device-path-provider.js +3 -2
  188. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
  189. package/lib/device-sockets/ios/notification.js +3 -0
  190. package/lib/device-sockets/ios/socket-request-executor.js +3 -0
  191. package/lib/helpers/android-bundle-validator-helper.js +2 -1
  192. package/lib/helpers/deploy-command-helper.js +1 -0
  193. package/lib/helpers/key-command-helper.js +4 -2
  194. package/lib/helpers/livesync-command-helper.js +5 -2
  195. package/lib/helpers/network-connectivity-validator.js +1 -0
  196. package/lib/helpers/options-track-helper.js +3 -2
  197. package/lib/helpers/package-path-helper.js +1 -0
  198. package/lib/helpers/platform-command-helper.js +7 -2
  199. package/lib/helpers/version-validator-helper.js +1 -0
  200. package/lib/key-commands/bootstrap.js +3 -2
  201. package/lib/key-commands/index.js +5 -4
  202. package/lib/nativescript-cli-lib-bootstrap.js +4 -0
  203. package/lib/nativescript-cli-lib.js +1 -0
  204. package/lib/nativescript-cli.js +10 -1
  205. package/lib/node/pbxproj-dom-xcode.js +1 -0
  206. package/lib/node/xcode.js +1 -0
  207. package/lib/node-package-manager.js +11 -1
  208. package/lib/options.js +141 -115
  209. package/lib/package-installation-manager.js +8 -1
  210. package/lib/package-manager.js +2 -0
  211. package/lib/platform-command-param.js +1 -0
  212. package/lib/pnpm-package-manager.js +4 -1
  213. package/lib/project-data.js +12 -0
  214. package/lib/providers/project-files-provider.js +1 -0
  215. package/lib/resolvers/livesync-service-resolver.js +2 -1
  216. package/lib/services/analytics/analytics-broker-process.js +10 -6
  217. package/lib/services/analytics/analytics-broker.js +2 -1
  218. package/lib/services/analytics/analytics-service.js +29 -25
  219. package/lib/services/analytics/google-analytics-provider.js +13 -12
  220. package/lib/services/analytics-settings-service.js +5 -0
  221. package/lib/services/android/android-bundle-tool-service.js +1 -0
  222. package/lib/services/android/gradle-build-args-service.js +3 -0
  223. package/lib/services/android/gradle-build-service.js +1 -0
  224. package/lib/services/android/gradle-command-service.js +1 -0
  225. package/lib/services/android-device-debug-service.js +6 -0
  226. package/lib/services/android-plugin-build-service.js +28 -0
  227. package/lib/services/android-project-service.js +71 -4
  228. package/lib/services/android-resources-migration-service.js +7 -0
  229. package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
  230. package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
  231. package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
  232. package/lib/services/assets-generation/assets-generation-service.js +16 -5
  233. package/lib/services/build-artifacts-service.js +2 -1
  234. package/lib/services/build-data-service.js +2 -1
  235. package/lib/services/build-info-file-service.js +1 -0
  236. package/lib/services/cleanup-service.js +13 -9
  237. package/lib/services/cocoapods-platform-manager.js +9 -0
  238. package/lib/services/cocoapods-service.js +21 -1
  239. package/lib/services/debug-data-service.js +1 -0
  240. package/lib/services/debug-service-base.js +7 -0
  241. package/lib/services/device/device-install-app-service.js +2 -1
  242. package/lib/services/doctor-service.js +21 -6
  243. package/lib/services/extensibility-service.js +8 -0
  244. package/lib/services/files-hash-service.js +1 -0
  245. package/lib/services/hmr-status-service.js +2 -0
  246. package/lib/services/info-service.js +1 -0
  247. package/lib/services/initialize-service.js +5 -1
  248. package/lib/services/ios/export-options-plist-service.js +4 -0
  249. package/lib/services/ios/ios-signing-service.js +4 -0
  250. package/lib/services/ios/spm-service.js +10 -1
  251. package/lib/services/ios/xcodebuild-args-service.js +13 -4
  252. package/lib/services/ios/xcodebuild-command-service.js +1 -0
  253. package/lib/services/ios/xcodebuild-service.js +1 -0
  254. package/lib/services/ios-debugger-port-service.js +1 -0
  255. package/lib/services/ios-device-debug-service.js +1 -0
  256. package/lib/services/ios-entitlements-service.js +1 -0
  257. package/lib/services/ios-extensions-service.js +1 -0
  258. package/lib/services/ios-log-filter.js +20 -0
  259. package/lib/services/ios-native-target-service.js +6 -4
  260. package/lib/services/ios-project-service.js +29 -7
  261. package/lib/services/ios-provision-service.js +3 -0
  262. package/lib/services/ios-watch-app-service.js +1 -0
  263. package/lib/services/ip-service.js +2 -0
  264. package/lib/services/itmstransporter-service.js +1 -0
  265. package/lib/services/karma-execution.js +2 -0
  266. package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
  267. package/lib/services/livesync/android-device-livesync-service.js +2 -0
  268. package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
  269. package/lib/services/livesync/android-livesync-service.js +1 -0
  270. package/lib/services/livesync/android-livesync-tool.js +4 -0
  271. package/lib/services/livesync/device-livesync-service-base.js +2 -0
  272. package/lib/services/livesync/ios-device-livesync-service.js +7 -0
  273. package/lib/services/livesync/ios-livesync-service.js +2 -0
  274. package/lib/services/livesync/livesync-socket.js +1 -0
  275. package/lib/services/livesync/platform-livesync-service-base.js +5 -0
  276. package/lib/services/livesync-process-data-service.js +1 -0
  277. package/lib/services/log-parser-service.js +1 -0
  278. package/lib/services/log-source-map-service.js +15 -0
  279. package/lib/services/marking-mode-service.js +8 -5
  280. package/lib/services/metadata-filtering-service.js +1 -0
  281. package/lib/services/npm-config-service.js +4 -0
  282. package/lib/services/pacote-service.js +7 -0
  283. package/lib/services/performance-service.js +3 -1
  284. package/lib/services/platform/add-platform-service.js +47 -2
  285. package/lib/services/platform/platform-validation-service.js +1 -0
  286. package/lib/services/platform/prepare-native-platform-service.js +5 -2
  287. package/lib/services/platform-environment-requirements.js +8 -3
  288. package/lib/services/platform-project-service-base.js +1 -0
  289. package/lib/services/platforms-data-service.js +1 -0
  290. package/lib/services/plugins-service.js +18 -2
  291. package/lib/services/prepare-data-service.js +2 -1
  292. package/lib/services/project-backup-service.js +4 -0
  293. package/lib/services/project-changes-service.js +12 -3
  294. package/lib/services/project-cleanup-service.js +2 -0
  295. package/lib/services/project-config-service.js +18 -1
  296. package/lib/services/project-data-service.js +36 -7
  297. package/lib/services/project-name-service.js +1 -0
  298. package/lib/services/project-service.js +10 -0
  299. package/lib/services/project-templates-service.js +3 -2
  300. package/lib/services/qr-code-terminal-service.js +1 -0
  301. package/lib/services/require-service.js +1 -0
  302. package/lib/services/start-service.js +1 -0
  303. package/lib/services/temp-service.js +1 -0
  304. package/lib/services/terminal-spinner-service.js +2 -0
  305. package/lib/services/test-execution-service.js +9 -2
  306. package/lib/services/test-initialization-service.js +4 -0
  307. package/lib/services/timeline-profiler-service.js +1 -0
  308. package/lib/services/user-settings-service.js +1 -0
  309. package/lib/services/versions-service.js +6 -4
  310. package/lib/services/watch-ignore-list-service.js +1 -0
  311. package/lib/services/webpack/webpack-compiler-service.js +42 -1
  312. package/lib/services/xcconfig-service.js +2 -0
  313. package/lib/services/xcproj-service.js +1 -0
  314. package/lib/shared-event-bus.js +6 -0
  315. package/lib/sys-info.js +2 -1
  316. package/lib/tools/config-manipulation/config-transformer.js +12 -0
  317. package/lib/tools/node-modules/node-modules-builder.js +1 -0
  318. package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
  319. package/lib/yarn-package-manager.js +1 -0
  320. package/lib/yarn2-package-manager.js +3 -0
  321. package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
  322. package/node_modules/rimraf/CHANGELOG.md +65 -0
  323. package/node_modules/stringify-package/CHANGELOG.md +16 -0
  324. package/package.json +1 -1
@@ -61,6 +61,7 @@ class HooksService {
61
61
  }
62
62
  }
63
63
  static formatHookName(commandName) {
64
+ // Remove everything after | (including the pipe)
64
65
  return commandName.replace(/\|[\s\S]*$/, "");
65
66
  }
66
67
  executeBeforeHooks(commandName, hookArguments) {
@@ -129,6 +130,11 @@ class HooksService {
129
130
  this.$logger.warn(`${hook.fullPath} will NOT be executed because it has invalid arguments - ${color_1.color.grey(invalidArguments.join(", "))}.`);
130
131
  return;
131
132
  }
133
+ // HACK for backwards compatibility:
134
+ // In case $projectData wasn't resolved by the time we got here (most likely we got here without running a command but through a service directly)
135
+ // then it is probably passed as a hookArg
136
+ // if that is the case then pass it directly to the hook instead of trying to resolve $projectData via injector
137
+ // This helps make hooks stateless
132
138
  const projectDataHookArg = hookArguments["hookArgs"] && hookArguments["hookArgs"]["projectData"];
133
139
  if (projectDataHookArg) {
134
140
  hookArguments["projectData"] = hookArguments["$projectData"] = projectDataHookArg;
@@ -146,6 +152,7 @@ class HooksService {
146
152
  this.$logger.warn(err.message || err);
147
153
  }
148
154
  else {
155
+ // Print the actual error with its callstack, so it is easy to find out which hooks is causing troubles.
149
156
  this.$logger.error(err);
150
157
  throw err || new Error(`Failed to execute hook: ${hook.fullPath}.`);
151
158
  }
@@ -251,6 +258,7 @@ class HooksService {
251
258
  interpreter = sheBangMatch[1];
252
259
  }
253
260
  if (interpreter) {
261
+ // Likewise, make /usr/bin/bash work like "bash".
254
262
  shMatch = interpreter.match(/bin\/((?:ba)?sh)$/);
255
263
  }
256
264
  if (shMatch) {
@@ -291,6 +299,7 @@ class HooksService {
291
299
  }
292
300
  validateHookArguments(hookConstructor, hookFullPath) {
293
301
  const invalidArguments = [];
302
+ // We need to annotate the hook in order to have the arguments of the constructor.
294
303
  (0, helpers_1.annotate)(hookConstructor);
295
304
  _.each(hookConstructor.$inject.args, (argument) => {
296
305
  try {
@@ -310,9 +319,13 @@ HooksService.HOOKS_DIRECTORY_NAME = "hooks";
310
319
  __decorate([
311
320
  (0, decorators_1.memoize)({
312
321
  shouldCache() {
322
+ // only cache if we have hooks directories, the only case to
323
+ // not have hooks directories is when the project dir is
324
+ // not set yet, ie. when creating a project.
313
325
  return !!this.hooksDirectories.length;
314
326
  },
315
327
  })
316
328
  ], HooksService.prototype, "initialize", null);
317
329
  exports.HooksService = HooksService;
318
330
  yok_1.injector.register("hooksService", HooksService);
331
+ //# sourceMappingURL=hooks-service.js.map
@@ -47,3 +47,4 @@ class IOSNotificationService {
47
47
  }
48
48
  exports.IOSNotificationService = IOSNotificationService;
49
49
  yok_1.injector.register("iOSNotificationService", IOSNotificationService);
50
+ //# sourceMappingURL=ios-notification-service.js.map
@@ -35,6 +35,8 @@ class JsonFileSettingsService {
35
35
  const dataToReturn = data.modifiedByCacheMechanism ? data.value : data;
36
36
  if (cacheOpts && cacheOpts.cacheTimeout) {
37
37
  if (!data.modifiedByCacheMechanism) {
38
+ // If data has no cache, but we want to check the timeout, consider the data as outdated.
39
+ // this should be a really rare case
38
40
  return null;
39
41
  }
40
42
  const currentTime = Date.now();
@@ -100,6 +102,8 @@ class JsonFileSettingsService {
100
102
  if (!this.$fs.exists(this.jsonSettingsFilePath)) {
101
103
  const unexistingDirs = this.getUnexistingDirectories(this.jsonSettingsFilePath);
102
104
  this.$fs.writeFile(this.jsonSettingsFilePath, null);
105
+ // when running under 'sudo' we create the <path to home dir>/.local/share/.nativescript-cli dir with root as owner
106
+ // and other Applications cannot access this directory anymore. (bower/heroku/etc)
103
107
  if (process.env.SUDO_USER) {
104
108
  for (const dir of unexistingDirs) {
105
109
  yield this.$fs.setCurrentUserAsOwner(dir, process.env.SUDO_USER);
@@ -120,6 +124,7 @@ class JsonFileSettingsService {
120
124
  const unexistingDirs = [];
121
125
  let currentDir = path.join(filePath, "..");
122
126
  while (true) {
127
+ // this directory won't be created.
123
128
  if (this.$fs.exists(currentDir)) {
124
129
  break;
125
130
  }
@@ -131,3 +136,4 @@ class JsonFileSettingsService {
131
136
  }
132
137
  exports.JsonFileSettingsService = JsonFileSettingsService;
133
138
  yok_1.injector.register("jsonFileSettingsService", JsonFileSettingsService, false);
139
+ //# sourceMappingURL=json-file-settings-service.js.map
@@ -31,6 +31,7 @@ class LockService {
31
31
  }
32
32
  get defaultLockParams() {
33
33
  const lockParams = {
34
+ // https://www.npmjs.com/package/retry#retrytimeoutsoptions
34
35
  retriesObj: { retries: 13, minTimeout: 100, maxTimeout: 1000, factor: 2 },
35
36
  stale: 10 * 1000,
36
37
  realpath: false,
@@ -89,6 +90,8 @@ class LockService {
89
90
  });
90
91
  }
91
92
  getPathsForCleanupAction(lockPath) {
93
+ // The proper-lockfile creates directory with the passed name and `.lock` at the end.
94
+ // Ensure we will take care of it as well.
92
95
  return [lockPath, `${lockPath}.lock`];
93
96
  }
94
97
  getLockFileSettings(filePath, fileOpts) {
@@ -104,6 +107,7 @@ class LockService {
104
107
  fileOpts.retriesObj.retries = fileOpts.retries;
105
108
  }
106
109
  if (fileOpts.retryWait) {
110
+ // backwards compatibility
107
111
  fileOpts.retriesObj.minTimeout = fileOpts.retriesObj.maxTimeout =
108
112
  fileOpts.retryWait;
109
113
  }
@@ -126,4 +130,6 @@ __decorate([
126
130
  ], LockService.prototype, "defaultLockFilePath", null);
127
131
  exports.LockService = LockService;
128
132
  yok_1.injector.register("lockService", LockService);
133
+ // backwards compatibility
129
134
  yok_1.injector.register("lockfile", LockService);
135
+ //# sourceMappingURL=lock-service.js.map
@@ -81,3 +81,4 @@ class MessageContractGenerator {
81
81
  }
82
82
  exports.MessageContractGenerator = MessageContractGenerator;
83
83
  yok_1.injector.register("messageContractGenerator", MessageContractGenerator);
84
+ //# sourceMappingURL=message-contract-generator.js.map
@@ -75,3 +75,4 @@ class MessagesService {
75
75
  }
76
76
  exports.MessagesService = MessagesService;
77
77
  yok_1.injector.register("messagesService", MessagesService);
78
+ //# sourceMappingURL=messages-service.js.map
@@ -18,12 +18,16 @@ const _ = require("lodash");
18
18
  class MicroTemplateService {
19
19
  constructor($injector) {
20
20
  this.$injector = $injector;
21
+ // Injector's dynamicCallRegex doesn't have 'g' option, which we need here.
22
+ // Use ( ) in order to use $1 to get whole expression later
21
23
  this.dynamicCallRegex = new RegExp(util.format("(%s)", this.$injector.dynamicCallRegex.source), "g");
22
24
  }
23
25
  parseContent(data, options) {
24
26
  return __awaiter(this, void 0, void 0, function* () {
25
27
  const localVariables = this.getLocalVariables(options);
26
28
  const compiledTemplate = _.template(data.replace(this.dynamicCallRegex, 'this.$injector.getDynamicCallData("$1")'));
29
+ // When debugging parsing, uncomment the line below:
30
+ // console.log(compiledTemplate.source);
27
31
  return yield compiledTemplate.apply(this, [localVariables]);
28
32
  });
29
33
  }
@@ -33,6 +37,7 @@ class MicroTemplateService {
33
37
  }
34
38
  getLocalVariables(options) {
35
39
  const isHtml = options.isHtml;
40
+ // in html help we want to show all help. Only CONSOLE specific help(wrapped in if(isConsole) ) must be omitted
36
41
  const localVariables = {
37
42
  constants,
38
43
  };
@@ -47,3 +52,4 @@ class MicroTemplateService {
47
52
  }
48
53
  exports.MicroTemplateService = MicroTemplateService;
49
54
  yok_1.injector.register("microTemplateService", MicroTemplateService);
55
+ //# sourceMappingURL=micro-templating-service.js.map
@@ -24,6 +24,7 @@ class Net {
24
24
  getFreePort() {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
26
  const server = net.createServer((sock) => {
27
+ /* empty - noone will connect here */
27
28
  });
28
29
  return new Promise((resolve, reject) => {
29
30
  let isResolved = false;
@@ -57,6 +58,7 @@ class Net {
57
58
  });
58
59
  server.once("close", () => {
59
60
  if (!isResolved) {
61
+ // "close" will be emitted right after "error"
60
62
  isResolved = true;
61
63
  resolve(true);
62
64
  }
@@ -135,3 +137,4 @@ class Net {
135
137
  Net.DEFAULT_INTERVAL = 1000;
136
138
  exports.Net = Net;
137
139
  yok_1.injector.register("net", Net);
140
+ //# sourceMappingURL=net-service.js.map
@@ -66,6 +66,7 @@ class ProjectFilesManager {
66
66
  this.processPlatformSpecificFilesCore(platform, files, projectFilesConfig);
67
67
  }
68
68
  processPlatformSpecificFilesCore(platform, files, projectFilesConfig) {
69
+ // Renames the files that have `platform` as substring and removes the files from other platform
69
70
  _.each(files, (filePath) => {
70
71
  const projectFileInfo = this.$projectFilesProvider.getProjectFileInfo(filePath, platform, projectFilesConfig);
71
72
  if (!projectFileInfo.shouldIncludeFile) {
@@ -73,6 +74,7 @@ class ProjectFilesManager {
73
74
  }
74
75
  else if (projectFileInfo.onDeviceFileName) {
75
76
  const onDeviceFilePath = path.join(path.dirname(filePath), projectFileInfo.onDeviceFileName);
77
+ // Fix .js.map entries
76
78
  const extension = path.extname(projectFileInfo.onDeviceFileName);
77
79
  if (onDeviceFilePath !== filePath) {
78
80
  if (extension === ".js" || extension === ".map") {
@@ -86,6 +88,8 @@ class ProjectFilesManager {
86
88
  fileContent = fileContent.replace(new RegExp(oldName, "g"), newName);
87
89
  this.$fs.writeFile(filePath, fileContent);
88
90
  }
91
+ // Rename the file
92
+ // this.$fs.rename is not called as it is error prone on some systems with slower hard drives and rigorous antivirus software
89
93
  this.$fs.writeFile(onDeviceFilePath, this.$fs.readText(filePath));
90
94
  this.$fs.deleteFile(filePath);
91
95
  }
@@ -98,3 +102,4 @@ class ProjectFilesManager {
98
102
  }
99
103
  exports.ProjectFilesManager = ProjectFilesManager;
100
104
  yok_1.injector.register("projectFilesManager", ProjectFilesManager);
105
+ //# sourceMappingURL=project-files-manager.js.map
@@ -52,3 +52,4 @@ class ProjectFilesProviderBase {
52
52
  }
53
53
  }
54
54
  exports.ProjectFilesProviderBase = ProjectFilesProviderBase;
55
+ //# sourceMappingURL=project-files-provider-base.js.map
@@ -62,3 +62,4 @@ class ProxyService {
62
62
  }
63
63
  exports.ProxyService = ProxyService;
64
64
  yok_1.injector.register("proxyService", ProxyService);
65
+ //# sourceMappingURL=proxy-service.js.map
@@ -37,3 +37,4 @@ class QrCodeGenerator {
37
37
  }
38
38
  exports.QrCodeGenerator = QrCodeGenerator;
39
39
  yok_1.injector.register("qr", QrCodeGenerator);
40
+ //# sourceMappingURL=qr.js.map
@@ -40,3 +40,4 @@ __decorate([
40
40
  ], SettingsService.prototype, "setSettings", null);
41
41
  exports.SettingsService = SettingsService;
42
42
  yok_1.injector.register("settingsService", SettingsService);
43
+ //# sourceMappingURL=settings-service.js.map
@@ -60,3 +60,4 @@ __decorate([
60
60
  ], XcodeSelectService.prototype, "getXcodeVersion", null);
61
61
  exports.XcodeSelectService = XcodeSelectService;
62
62
  yok_1.injector.register("xcodeSelectService", XcodeSelectService);
63
+ //# sourceMappingURL=xcode-select-service.js.map
@@ -29,3 +29,4 @@ class Utils {
29
29
  }
30
30
  exports.Utils = Utils;
31
31
  yok_1.injector.register("utils", Utils);
32
+ //# sourceMappingURL=utils.js.map
@@ -86,3 +86,4 @@ ProjectNameValidator.INVALID_FILENAMES = [
86
86
  ProjectNameValidator.INVALID_EXTENSIONS = [];
87
87
  exports.ProjectNameValidator = ProjectNameValidator;
88
88
  yok_1.injector.register("projectNameValidator", ProjectNameValidator);
89
+ //# sourceMappingURL=project-name-validator.js.map
@@ -14,3 +14,4 @@ class ValidationResult {
14
14
  }
15
15
  ValidationResult.Successful = new ValidationResult(null);
16
16
  exports.ValidationResult = ValidationResult;
17
+ //# sourceMappingURL=validation-result.js.map
@@ -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
@@ -137,18 +137,19 @@ exports.RESERVED_TEMPLATE_NAMES = {
137
137
  default: "@nativescript/template-hello-world",
138
138
  javascript: "@nativescript/template-hello-world",
139
139
  tsc: "@nativescript/template-hello-world-ts",
140
- vision: "@nativescript/template-hello-world-ts-vision",
141
140
  vue: "@nativescript/template-blank-vue",
142
- "vision-vue": "@nativescript/template-blank-vue-vision",
143
141
  typescript: "@nativescript/template-hello-world-ts",
144
142
  ng: "@nativescript/template-hello-world-ng",
145
143
  angular: "@nativescript/template-hello-world-ng",
146
- "vision-ng": "@nativescript/template-hello-world-ng-vision",
147
144
  react: "@nativescript/template-blank-react",
148
- "vision-react": "@nativescript/template-blank-react-vision",
149
145
  reactjs: "@nativescript/template-blank-react",
150
- "vision-solid": "@nativescript/template-blank-solid-vision",
151
146
  svelte: "@nativescript/template-blank-svelte",
147
+ // vision templates
148
+ vision: "@nativescript/template-hello-world-ts-vision",
149
+ "vision-vue": "@nativescript/template-blank-vue-vision",
150
+ "vision-ng": "@nativescript/template-hello-world-ng-vision",
151
+ "vision-react": "@nativescript/template-blank-react-vision",
152
+ "vision-solid": "@nativescript/template-blank-solid-vision",
152
153
  "vision-svelte": "@nativescript/template-blank-svelte-vision",
153
154
  };
154
155
  exports.ANALYTICS_LOCAL_TEMPLATE_PREFIX = "localTemplate_";
@@ -216,6 +217,9 @@ DebugCommandErrors.NO_DEVICES_EMULATORS_FOUND_FOR_OPTIONS = "Unable to find devi
216
217
  DebugCommandErrors.UNSUPPORTED_DEVICE_OS_FOR_DEBUGGING = "Unsupported device OS for debugging";
217
218
  exports.DebugCommandErrors = DebugCommandErrors;
218
219
  exports.AnalyticsEventLabelDelimiter = "__";
220
+ /**
221
+ * Used in ProjectDataService to concatenate the names of the properties inside nativescript key of package.json.
222
+ */
219
223
  exports.NATIVESCRIPT_PROPS_INTERNAL_DELIMITER = "**|__**";
220
224
  exports.CLI_RESOURCES_DIR_NAME = "resources";
221
225
  class AssetConstants {
@@ -232,6 +236,7 @@ AssetConstants.sizeDelimiter = "x";
232
236
  AssetConstants.defaultScale = 1;
233
237
  AssetConstants.defaultOverlayImageScale = 0.8;
234
238
  exports.AssetConstants = AssetConstants;
239
+ // https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
235
240
  class MacOSVersions {
236
241
  }
237
242
  MacOSVersions.Sierra = "10.12";
@@ -241,6 +246,14 @@ MacOSVersions.Catalina = "10.15";
241
246
  exports.MacOSVersions = MacOSVersions;
242
247
  exports.MacOSDeprecationStringFormat = "NativeScript does not support macOS %s and some functionality may not work. Please, upgrade to the latest macOS version.";
243
248
  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.";
249
+ // export class TemplateVersions {
250
+ // public static v1 = "v1";
251
+ // public static v2 = "v2";
252
+ // }
253
+ // export class ProjectTemplateErrors {
254
+ // public static InvalidTemplateVersionStringFormat =
255
+ // "The template '%s' has a NativeScript version '%s' that is not supported. Unable to create project from it.";
256
+ // }
244
257
  class Hooks {
245
258
  }
246
259
  Hooks.createProject = "createProject";
@@ -281,6 +294,7 @@ AndroidAppBundleMessages.ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE = "How to use A
281
294
  exports.AndroidAppBundleMessages = AndroidAppBundleMessages;
282
295
  exports.RunOnDeviceEvents = {
283
296
  runOnDeviceStopped: "runOnDeviceStopped",
297
+ // 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
284
298
  runOnDeviceError: "runOnDeviceError",
285
299
  runOnDeviceExecuted: "runOnDeviceExecuted",
286
300
  runOnDeviceStarted: "runOnDeviceStarted",
@@ -317,14 +331,52 @@ var DeviceConnectionType;
317
331
  })(DeviceConnectionType = exports.DeviceConnectionType || (exports.DeviceConnectionType = {}));
318
332
  var LoggerLevel;
319
333
  (function (LoggerLevel) {
334
+ /**
335
+ * Show all log messages.
336
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
337
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
338
+ */
320
339
  LoggerLevel["ALL"] = "ALL";
340
+ /**
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
+ */
321
344
  LoggerLevel["TRACE"] = "TRACE";
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
+ */
322
349
  LoggerLevel["DEBUG"] = "DEBUG";
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
+ */
323
354
  LoggerLevel["INFO"] = "INFO";
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
+ */
324
359
  LoggerLevel["WARN"] = "WARN";
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
+ */
325
364
  LoggerLevel["ERROR"] = "ERROR";
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
+ */
326
369
  LoggerLevel["FATAL"] = "FATAL";
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
+ */
327
374
  LoggerLevel["MARK"] = "MARK";
375
+ /**
376
+ * Disable all logging.
377
+ * Log levels are used to assign importance to log messages, with the integer value being used to sort them.
378
+ * If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
379
+ */
328
380
  LoggerLevel["OFF"] = "OFF";
329
381
  })(LoggerLevel = exports.LoggerLevel || (exports.LoggerLevel = {}));
330
382
  var LoggerConfigData;
@@ -341,3 +393,4 @@ var PackageManagers;
341
393
  PackageManagers["yarn"] = "yarn";
342
394
  PackageManagers["yarn2"] = "yarn2";
343
395
  })(PackageManagers = exports.PackageManagers || (exports.PackageManagers = {}));
396
+ //# sourceMappingURL=constants.js.map