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
@@ -84,6 +84,8 @@ class AndroidToolsInfo {
84
84
  return doctor_1.androidToolsInfo.getPathToAdbFromAndroidHome();
85
85
  }
86
86
  catch (err) {
87
+ // adb does not exist, so ANDROID_HOME is not set correctly
88
+ // try getting default adb path (included in CLI package)
87
89
  this.$logger.trace(`Error while executing '${path.join(doctor_1.androidToolsInfo.androidHome, "platform-tools", "adb")} help'. Error is: ${err.message}`);
88
90
  }
89
91
  return null;
@@ -98,6 +100,14 @@ class AndroidToolsInfo {
98
100
  shouldGenerateTypings() {
99
101
  return this.$options.androidTypings;
100
102
  }
103
+ /**
104
+ * Prints messages on the screen. In case the showWarningsAsErrors flag is set to true, warnings are shown, else - errors.
105
+ * Uses logger.warn for warnings and errors.failWithoutHelp when erros must be shown.
106
+ * In case additional details must be shown as info message, use the second parameter.
107
+ * NOTE: The additional information will not be printed when showWarningsAsErrors flag is set.
108
+ * @param {string} msg The message that will be shown as warning or error.
109
+ * @return {void}
110
+ */
101
111
  printMessage(msg, showWarningsAsErrors) {
102
112
  if (showWarningsAsErrors) {
103
113
  this.$errors.fail(msg);
@@ -117,6 +127,7 @@ class AndroidToolsInfo {
117
127
  }
118
128
  return latestCompileSdk;
119
129
  }
130
+ // TODO check if still needed
120
131
  getTargetSdk(compileSdk) {
121
132
  const targetSdk = this.$options.sdk
122
133
  ? parseInt(this.$options.sdk)
@@ -133,3 +144,4 @@ __decorate([
133
144
  ], AndroidToolsInfo.prototype, "validateAndroidHomeEnvVariable", null);
134
145
  exports.AndroidToolsInfo = AndroidToolsInfo;
135
146
  yok_1.injector.register("androidToolsInfo", AndroidToolsInfo);
147
+ //# sourceMappingURL=android-tools-info.js.map
@@ -28,6 +28,8 @@ class BasePackageManager {
28
28
  }
29
29
  try {
30
30
  const viewResult = yield this.view(packageName, { name: true });
31
+ // `npm view nonExistingPackageName` will return `nativescript`
32
+ // if executed in the root dir of the CLI (npm 6.4.1)
31
33
  const packageNameRegex = new RegExp(packageName, "i");
32
34
  const isProperResult = packageNameRegex.test(viewResult);
33
35
  return isProperResult;
@@ -39,6 +41,8 @@ class BasePackageManager {
39
41
  }
40
42
  getPackageNameParts(fullPackageName) {
41
43
  return __awaiter(this, void 0, void 0, function* () {
44
+ // support <reserved_name>@<version> syntax, for example typescript@1.0.0
45
+ // support <scoped_package_name>@<version> syntax, for example @nativescript/vue-template@1.0.0
42
46
  const lastIndexOfAtSign = fullPackageName.lastIndexOf("@");
43
47
  let version = "";
44
48
  let templateName = "";
@@ -74,6 +78,8 @@ class BasePackageManager {
74
78
  cwd: opts.cwd,
75
79
  stdio: stdioValue,
76
80
  });
81
+ // Whenever calling "npm install" or "yarn add" without any arguments (hence installing all dependencies) no output is emitted on stdout
82
+ // Luckily, whenever you call "npm install" or "yarn add" to install all dependencies chances are you won't need the name/version of the package you're installing because there is none.
77
83
  const { isInstallingAllDependencies } = opts;
78
84
  if (isInstallingAllDependencies) {
79
85
  return null;
@@ -126,3 +132,4 @@ class BasePackageManager {
126
132
  }
127
133
  }
128
134
  exports.BasePackageManager = BasePackageManager;
135
+ //# sourceMappingURL=base-package-manager.js.map
package/lib/bootstrap.js CHANGED
@@ -5,6 +5,7 @@ require("./common/bootstrap");
5
5
  yok_1.injector.requirePublicClass("logger", "./common/logger/logger");
6
6
  yok_1.injector.require("config", "./config");
7
7
  yok_1.injector.require("options", "./options");
8
+ // note: order above is important!
8
9
  yok_1.injector.requirePublicClass("constants", "./constants-provider");
9
10
  yok_1.injector.require("projectData", "./project-data");
10
11
  yok_1.injector.requirePublic("projectDataService", "./services/project-data-service");
@@ -90,12 +91,16 @@ yok_1.injector.requireCommand("fonts", "./commands/fonts");
90
91
  yok_1.injector.requireCommand("prepare", "./commands/prepare");
91
92
  yok_1.injector.requireCommand("build|ios", "./commands/build");
92
93
  yok_1.injector.requireCommand("build|android", "./commands/build");
94
+ yok_1.injector.requireCommand("build|vision", "./commands/build");
95
+ yok_1.injector.requireCommand("build|visionos", "./commands/build");
93
96
  yok_1.injector.requireCommand("deploy", "./commands/deploy");
94
97
  yok_1.injector.require("testExecutionService", "./services/test-execution-service");
95
98
  yok_1.injector.requireCommand("dev-test|android", "./commands/test");
96
99
  yok_1.injector.requireCommand("dev-test|ios", "./commands/test");
97
100
  yok_1.injector.requireCommand("test|android", "./commands/test");
98
101
  yok_1.injector.requireCommand("test|ios", "./commands/test");
102
+ // injector.requireCommand("test|vision", "./commands/test");
103
+ // injector.requireCommand("test|visionos", "./commands/test");
99
104
  yok_1.injector.requireCommand("test|init", "./commands/test-init");
100
105
  yok_1.injector.requireCommand("dev-generate-help", "./commands/generate-help");
101
106
  yok_1.injector.requireCommand("appstore|*list", "./commands/appstore-list");
@@ -145,7 +150,7 @@ yok_1.injector.require("LiveSyncSocket", "./services/livesync/livesync-socket");
145
150
  yok_1.injector.requirePublicClass("androidLivesyncTool", "./services/livesync/android-livesync-tool");
146
151
  yok_1.injector.require("androidLiveSyncService", "./services/livesync/android-livesync-service");
147
152
  yok_1.injector.require("iOSLiveSyncService", "./services/livesync/ios-livesync-service");
148
- yok_1.injector.require("usbLiveSyncService", "./services/livesync/livesync-service");
153
+ yok_1.injector.require("usbLiveSyncService", "./services/livesync/livesync-service"); // The name is used in https://github.com/NativeScript/nativescript-dev-typescript
149
154
  yok_1.injector.requirePublic("sysInfo", "./sys-info");
150
155
  yok_1.injector.require("iOSNotificationService", "./services/ios-notification-service");
151
156
  yok_1.injector.require("appDebugSocketProxyFactory", "./device-sockets/ios/app-debug-socket-proxy-factory");
@@ -198,3 +203,4 @@ yok_1.injector.require("keyCommandHelper", "./helpers/key-command-helper");
198
203
  yok_1.injector.requireCommand("start", "./commands/start");
199
204
  yok_1.injector.require("startService", "./services/start-service");
200
205
  require("./key-commands/bootstrap");
206
+ //# sourceMappingURL=bootstrap.js.map
package/lib/color.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.color = exports.stripColors = void 0;
4
+ // using chalk as some of our other dependencies are already using it...
5
+ // exporting from here so we can easily refactor to a different color library if needed
4
6
  const ansi = require("ansi-colors");
5
7
  const chalk = require("chalk");
6
8
  function stripColors(formatStr) {
@@ -8,3 +10,4 @@ function stripColors(formatStr) {
8
10
  }
9
11
  exports.stripColors = stripColors;
10
12
  exports.color = chalk;
13
+ //# sourceMappingURL=color.js.map
@@ -47,3 +47,4 @@ class AddPlatformCommand extends command_base_1.ValidatePlatformCommandBase {
47
47
  }
48
48
  exports.AddPlatformCommand = AddPlatformCommand;
49
49
  yok_1.injector.registerCommand("platform|add", AddPlatformCommand);
50
+ //# sourceMappingURL=add-platform.js.map
@@ -50,3 +50,4 @@ class AppleLogin {
50
50
  }
51
51
  exports.AppleLogin = AppleLogin;
52
52
  yok_1.injector.registerCommand("apple-login", AppleLogin);
53
+ //# sourceMappingURL=apple-login.js.map
@@ -73,3 +73,4 @@ class ListiOSApps {
73
73
  }
74
74
  exports.ListiOSApps = ListiOSApps;
75
75
  yok_1.injector.registerCommand("appstore|*list", ListiOSApps);
76
+ //# sourceMappingURL=appstore-list.js.map
@@ -63,9 +63,12 @@ class PublishIOS {
63
63
  this.$options.release = true;
64
64
  if (!ipaFilePath) {
65
65
  const platform = this.$devicePlatformsConstants.iOS.toLowerCase();
66
+ // No .ipa path provided, build .ipa on out own.
66
67
  if (mobileProvisionIdentifier) {
68
+ // This is not very correct as if we build multiple targets we will try to sign all of them using the signing identity here.
67
69
  this.$logger.info("Building .ipa with the selected mobile provision and/or certificate. " +
68
70
  mobileProvisionIdentifier);
71
+ // As we need to build the package for device
69
72
  this.$options.forDevice = true;
70
73
  this.$options.provision = mobileProvisionIdentifier;
71
74
  const buildData = new build_data_1.IOSBuildData(this.$projectData.projectDir, platform, Object.assign(Object.assign({}, this.$options.argv), { watch: false }));
@@ -104,3 +107,4 @@ class PublishIOS {
104
107
  }
105
108
  exports.PublishIOS = PublishIOS;
106
109
  yok_1.injector.registerCommand(["publish|ios", "appstore|upload"], PublishIOS);
110
+ //# sourceMappingURL=appstore-upload.js.map
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.BuildAndroidCommand = exports.BuildIosCommand = exports.BuildCommandBase = void 0;
12
+ exports.BuildVisionOsCommand = exports.BuildAndroidCommand = exports.BuildIosCommand = exports.BuildCommandBase = void 0;
13
13
  const constants_1 = require("../constants");
14
14
  const command_base_1 = require("./command-base");
15
15
  const helpers_1 = require("../common/helpers");
@@ -24,11 +24,11 @@ class BuildCommandBase extends command_base_1.ValidatePlatformCommandBase {
24
24
  this.$logger = $logger;
25
25
  this.dashedOptions = {
26
26
  watch: {
27
- type: "boolean",
27
+ type: "boolean" /* OptionType.Boolean */,
28
28
  default: false,
29
29
  hasSensitiveValue: false,
30
30
  },
31
- hmr: { type: "boolean", default: false, hasSensitiveValue: false },
31
+ hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
32
32
  };
33
33
  this.$projectData.initializeProjectData();
34
34
  }
@@ -143,3 +143,20 @@ class BuildAndroidCommand extends BuildCommandBase {
143
143
  }
144
144
  exports.BuildAndroidCommand = BuildAndroidCommand;
145
145
  yok_1.injector.registerCommand("build|android", BuildAndroidCommand);
146
+ class BuildVisionOsCommand extends BuildIosCommand {
147
+ constructor($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $logger, $buildDataService, $migrateController) {
148
+ super($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $logger, $buildDataService, $migrateController);
149
+ this.$options = $options;
150
+ this.$migrateController = $migrateController;
151
+ }
152
+ canExecute(args) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ this.$errors.fail('Building for "visionOS" platform is not supported via the CLI. Please open the project in Xcode and build it from there.');
155
+ return false;
156
+ });
157
+ }
158
+ }
159
+ exports.BuildVisionOsCommand = BuildVisionOsCommand;
160
+ yok_1.injector.registerCommand("build|vision", BuildVisionOsCommand);
161
+ yok_1.injector.registerCommand("build|visionos", BuildVisionOsCommand);
162
+ //# sourceMappingURL=build.js.map
@@ -26,6 +26,18 @@ function bytesToHumanReadable(bytes) {
26
26
  }
27
27
  return `${bytes.toFixed(2)} ${units[unit]}`;
28
28
  }
29
+ /**
30
+ * A helper function to map an array of values to promises with a concurrency limit.
31
+ * The mapper function should return a promise. It will be called for each value in the values array.
32
+ * The concurrency limit is the number of promises that can be running at the same time.
33
+ *
34
+ * This function will return a promise that resolves when all values have been mapped.
35
+ *
36
+ * @param values A static array of values to map to promises
37
+ * @param mapper A function that maps a value to a promise
38
+ * @param concurrency The number of promises that can be running at the same time
39
+ * @returns Promise<void>
40
+ */
29
41
  function promiseMap(values, mapper, concurrency = 10) {
30
42
  let index = 0;
31
43
  let pending = 0;
@@ -84,6 +96,7 @@ class CleanCommand {
84
96
  try {
85
97
  const overridePathsToClean = this.$projectConfigService.getValue("cli.pathsToClean");
86
98
  const additionalPaths = this.$projectConfigService.getValue("cli.additionalPathsToClean");
99
+ // allow overriding default paths to clean
87
100
  if (Array.isArray(overridePathsToClean)) {
88
101
  pathsToClean = overridePathsToClean;
89
102
  }
@@ -92,6 +105,7 @@ class CleanCommand {
92
105
  }
93
106
  }
94
107
  catch (err) {
108
+ // ignore
95
109
  }
96
110
  const res = yield this.$projectCleanupService.clean(pathsToClean, {
97
111
  dryRun: isDryRun,
@@ -117,6 +131,7 @@ class CleanCommand {
117
131
  cleanMultipleProjects(spinner) {
118
132
  return __awaiter(this, void 0, void 0, function* () {
119
133
  if (!(0, helpers_1.isInteractive)() || this.$options.json) {
134
+ // interactive terminal is required, and we can't output json in an interactive command.
120
135
  this.$logger.warn("No project found in the current directory.");
121
136
  return;
122
137
  }
@@ -132,6 +147,7 @@ class CleanCommand {
132
147
  const current = color_1.color.grey(`${computed}/${paths.length}`);
133
148
  spinner.start(`Gathering cleanable sizes. This may take a while... ${current}`);
134
149
  };
150
+ // update the progress initially
135
151
  updateProgress();
136
152
  const projects = new Map();
137
153
  yield promiseMap(paths, (p) => {
@@ -149,8 +165,10 @@ class CleanCommand {
149
165
  })
150
166
  .then((size) => {
151
167
  if (size > 0 || size === -1) {
168
+ // only store size if it's larger than 0 or -1 (error while getting size)
152
169
  projects.set(p, size);
153
170
  }
171
+ // update the progress after each processed project
154
172
  computed++;
155
173
  updateProgress();
156
174
  });
@@ -175,7 +193,7 @@ class CleanCommand {
175
193
  value: p,
176
194
  };
177
195
  }), true, {
178
- optionsPerPage: process.stdout.rows - 6,
196
+ optionsPerPage: process.stdout.rows - 6, // 6 lines are taken up by the instructions
179
197
  });
180
198
  this.$logger.clearScreen();
181
199
  spinner.warn(`This will run "${color_1.color.yellow(`ns clean`)}" in all the selected projects and ${color_1.color.red.bold("delete files from your system")}!`);
@@ -224,6 +242,7 @@ class CleanCommand {
224
242
  let nsDirs = [];
225
243
  const getFiles = (dir) => __awaiter(this, void 0, void 0, function* () {
226
244
  if (dir.includes("node_modules")) {
245
+ // skip traversing node_modules
227
246
  return;
228
247
  }
229
248
  const dirents = yield (0, promises_1.readdir)(dir, { withFileTypes: true }).catch((err) => {
@@ -234,6 +253,7 @@ class CleanCommand {
234
253
  ent.name.includes("nativescript.config.js"));
235
254
  if (hasNSConfig) {
236
255
  nsDirs.push(dir);
256
+ // found a NativeScript project, stop traversing
237
257
  return;
238
258
  }
239
259
  yield Promise.all(dirents.map((dirent) => {
@@ -250,3 +270,4 @@ class CleanCommand {
250
270
  }
251
271
  exports.CleanCommand = CleanCommand;
252
272
  yok_1.injector.registerCommand("clean", CleanCommand);
273
+ //# sourceMappingURL=clean.js.map
@@ -44,3 +44,4 @@ class ValidatePlatformCommandBase {
44
44
  }
45
45
  }
46
46
  exports.ValidatePlatformCommandBase = ValidatePlatformCommandBase;
47
+ //# sourceMappingURL=command-base.js.map
@@ -61,6 +61,7 @@ class ConfigGetCommand {
61
61
  this.$logger.info(current);
62
62
  }
63
63
  catch (err) {
64
+ // ignore
64
65
  }
65
66
  });
66
67
  }
@@ -119,6 +120,7 @@ class ConfigSetCommand {
119
120
  return JSON.parse(v);
120
121
  }
121
122
  catch (e) {
123
+ // just treat it as a string
122
124
  return `${v}`;
123
125
  }
124
126
  }
@@ -127,3 +129,4 @@ exports.ConfigSetCommand = ConfigSetCommand;
127
129
  yok_1.injector.registerCommand("config|*list", ConfigListCommand);
128
130
  yok_1.injector.registerCommand("config|get", ConfigGetCommand);
129
131
  yok_1.injector.registerCommand("config|set", ConfigSetCommand);
132
+ //# sourceMappingURL=config.js.map
@@ -44,19 +44,43 @@ class CreateProjectCommand {
44
44
  }
45
45
  let projectName = args[0];
46
46
  let selectedTemplate;
47
- if (this.$options.js) {
48
- selectedTemplate = constants.JAVASCRIPT_NAME;
47
+ if (this.$options["vision-ng"] ||
48
+ (this.$options.vision && this.$options.ng)) {
49
+ selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-ng"];
50
+ }
51
+ else if (this.$options["vision-react"] ||
52
+ (this.$options.vision && this.$options.react)) {
53
+ selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-react"];
54
+ }
55
+ else if (this.$options["vision-solid"]) {
56
+ // note: we don't have solid templates or --solid
57
+ selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-solid"];
49
58
  }
50
- else if (this.$options.vue && this.$options.tsc) {
59
+ else if (this.$options["vision-svelte"] ||
60
+ (this.$options.vision && this.$options.svelte)) {
61
+ selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-svelte"];
62
+ }
63
+ else if (this.$options["vision-vue"] ||
64
+ (this.$options.vision && (this.$options.vue || this.$options.vuejs))) {
65
+ selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-vue"];
66
+ }
67
+ else if ((this.$options.vue || this.$options.vuejs) &&
68
+ this.$options.tsc) {
51
69
  selectedTemplate = "@nativescript/template-blank-vue-ts";
52
70
  }
71
+ else if (this.$options.vision) {
72
+ selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision"];
73
+ }
74
+ else if (this.$options.js) {
75
+ selectedTemplate = constants.JAVASCRIPT_NAME;
76
+ }
53
77
  else if (this.$options.tsc) {
54
78
  selectedTemplate = constants.TYPESCRIPT_NAME;
55
79
  }
56
80
  else if (this.$options.ng) {
57
81
  selectedTemplate = constants.ANGULAR_NAME;
58
82
  }
59
- else if (this.$options.vue) {
83
+ else if (this.$options.vue || this.$options.vuejs) {
60
84
  selectedTemplate = constants.VUE_NAME;
61
85
  }
62
86
  else if (this.$options.react) {
@@ -65,21 +89,6 @@ class CreateProjectCommand {
65
89
  else if (this.$options.svelte) {
66
90
  selectedTemplate = constants.SVELTE_NAME;
67
91
  }
68
- else if (this.$options["vision-ng"]) {
69
- selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-ng"];
70
- }
71
- else if (this.$options["vision-react"]) {
72
- selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-react"];
73
- }
74
- else if (this.$options["vision-solid"]) {
75
- selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-solid"];
76
- }
77
- else if (this.$options["vision-svelte"]) {
78
- selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-svelte"];
79
- }
80
- else if (this.$options["vision-vue"]) {
81
- selectedTemplate = constants.RESERVED_TEMPLATE_NAMES["vision-vue"];
82
- }
83
92
  else {
84
93
  selectedTemplate = this.$options.template;
85
94
  }
@@ -102,6 +111,7 @@ class CreateProjectCommand {
102
111
  template: selectedTemplate,
103
112
  appId: this.$options.appid,
104
113
  pathToProject: this.$options.path,
114
+ // its already validated above
105
115
  force: true,
106
116
  ignoreScripts: this.$options.ignoreScripts,
107
117
  });
@@ -376,6 +386,10 @@ can skip this prompt next time using the --template option, or the --ng, --react
376
386
  `For more options consult the docs or run ${color_1.color.green("ns --help")}`,
377
387
  "",
378
388
  ].join("\n"));
389
+ // todo: add back ns preview
390
+ // this.$logger.printMarkdown(
391
+ // `After that you can preview it on device by executing \`$ ns preview\``
392
+ // );
379
393
  });
380
394
  }
381
395
  }
@@ -393,3 +407,4 @@ CreateProjectCommand.TabsTemplateKey = "Tabs";
393
407
  CreateProjectCommand.TabsTemplateDescription = "An app with pre-built pages that uses tabs for navigation";
394
408
  exports.CreateProjectCommand = CreateProjectCommand;
395
409
  yok_1.injector.registerCommand("create", CreateProjectCommand);
410
+ //# sourceMappingURL=create-project.js.map
@@ -106,6 +106,10 @@ class DebugIOSCommand {
106
106
  this.allowedParameters = [];
107
107
  this.platform = this.$devicePlatformsConstants.iOS;
108
108
  this.$projectData.initializeProjectData();
109
+ // Do not dispose ios-device-lib, so the process will remain alive and the debug application (NativeScript Inspector or Chrome DevTools) will be able to connect to the socket.
110
+ // In case we dispose ios-device-lib, the socket will be closed and the code will fail when the debug application tries to read/send data to device socket.
111
+ // That's why the `$ tns debug ios --justlaunch` command will not release the terminal.
112
+ // In case we do not set it to false, the dispose will be called once the command finishes its execution, which will prevent the debugging.
109
113
  $iosDeviceOperations.setShouldDispose(false);
110
114
  $iOSSimulatorLogProvider.setShouldDispose(false);
111
115
  }
@@ -124,7 +128,7 @@ class DebugIOSCommand {
124
128
  if (this.$options.inspector) {
125
129
  const macOSWarning = yield this.$sysInfo.getMacOSWarningMessage();
126
130
  if (macOSWarning &&
127
- macOSWarning.severity === "high") {
131
+ macOSWarning.severity === "high" /* SystemWarningsSeverity.high */) {
128
132
  this.$errors.fail(`You cannot use NativeScript Inspector on this OS. To use it, please update your OS.`);
129
133
  }
130
134
  }
@@ -189,3 +193,4 @@ __decorate([
189
193
  ], DebugAndroidCommand.prototype, "debugPlatformCommand", null);
190
194
  exports.DebugAndroidCommand = DebugAndroidCommand;
191
195
  yok_1.injector.registerCommand("debug|android", DebugAndroidCommand);
196
+ //# sourceMappingURL=debug.js.map
@@ -25,11 +25,11 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
25
25
  this.allowedParameters = [];
26
26
  this.dashedOptions = {
27
27
  watch: {
28
- type: "boolean",
28
+ type: "boolean" /* OptionType.Boolean */,
29
29
  default: false,
30
30
  hasSensitiveValue: false,
31
31
  },
32
- hmr: { type: "boolean", default: false, hasSensitiveValue: false },
32
+ hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
33
33
  };
34
34
  this.$projectData.initializeProjectData();
35
35
  }
@@ -76,3 +76,4 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
76
76
  }
77
77
  exports.DeployOnDeviceCommand = DeployOnDeviceCommand;
78
78
  yok_1.injector.registerCommand("deploy", DeployOnDeviceCommand);
79
+ //# sourceMappingURL=deploy.js.map
@@ -31,3 +31,4 @@ class InstallExtensionCommand {
31
31
  }
32
32
  exports.InstallExtensionCommand = InstallExtensionCommand;
33
33
  yok_1.injector.registerCommand("extension|install", InstallExtensionCommand);
34
+ //# sourceMappingURL=install-extension.js.map
@@ -38,3 +38,4 @@ class ListExtensionsCommand {
38
38
  }
39
39
  exports.ListExtensionsCommand = ListExtensionsCommand;
40
40
  yok_1.injector.registerCommand("extension|*list", ListExtensionsCommand);
41
+ //# sourceMappingURL=list-extensions.js.map
@@ -30,3 +30,4 @@ class UninstallExtensionCommand {
30
30
  }
31
31
  exports.UninstallExtensionCommand = UninstallExtensionCommand;
32
32
  yok_1.injector.registerCommand("extension|uninstall", UninstallExtensionCommand);
33
+ //# sourceMappingURL=uninstall-extension.js.map
@@ -62,3 +62,4 @@ class FontsCommand {
62
62
  }
63
63
  exports.FontsCommand = FontsCommand;
64
64
  yok_1.injector.registerCommand("fonts", FontsCommand);
65
+ //# sourceMappingURL=fonts.js.map
@@ -69,3 +69,4 @@ class GenerateSplashScreensCommand extends GenerateCommandBase {
69
69
  }
70
70
  exports.GenerateSplashScreensCommand = GenerateSplashScreensCommand;
71
71
  yok_1.injector.registerCommand("resources|generate|splashes", GenerateSplashScreensCommand);
72
+ //# sourceMappingURL=generate-assets.js.map
@@ -24,3 +24,4 @@ class GenerateHelpCommand {
24
24
  }
25
25
  exports.GenerateHelpCommand = GenerateHelpCommand;
26
26
  yok_1.injector.registerCommand("dev-generate-help", GenerateHelpCommand);
27
+ //# sourceMappingURL=generate-help.js.map
@@ -58,16 +58,25 @@ class GenerateCommand {
58
58
  }
59
59
  }
60
60
  exports.GenerateCommand = GenerateCommand;
61
+ /**
62
+ * Converts an array of command line arguments to options for the executed schematic.
63
+ * @param rawArgs The command line arguments. They should be in the format 'key=value' for strings or 'key' for booleans.
64
+ */
61
65
  function parseSchematicSettings(rawArgs) {
62
66
  const [optionStrings, args] = partition(rawArgs, (item) => item.includes("="));
63
67
  const options = optionStrings
64
- .map((o) => o.split("="))
65
- .map(([key, ...value]) => [key, value.join("=")])
68
+ .map((o) => o.split("=")) // split to key and value pairs
69
+ .map(([key, ...value]) => [key, value.join("=")]) // concat the value arrays if there are multiple = signs
66
70
  .reduce((obj, [key, value]) => {
67
71
  return Object.assign(Object.assign({}, obj), { [key]: value });
68
72
  }, {});
69
73
  return { options, args };
70
74
  }
75
+ /**
76
+ * Splits an array into two groups based on a predicate.
77
+ * @param array The array to split.
78
+ * @param predicate The condition to be used for splitting.
79
+ */
71
80
  function partition(array, predicate) {
72
81
  return array.reduce(([pass, fail], item) => {
73
82
  return predicate(item)
@@ -76,3 +85,4 @@ function partition(array, predicate) {
76
85
  }, [[], []]);
77
86
  }
78
87
  yok_1.injector.registerCommand("generate", GenerateCommand);
88
+ //# sourceMappingURL=generate.js.map
@@ -24,3 +24,4 @@ class InfoCommand {
24
24
  }
25
25
  exports.InfoCommand = InfoCommand;
26
26
  yok_1.injector.registerCommand("info", InfoCommand);
27
+ //# sourceMappingURL=info.js.map
@@ -78,3 +78,4 @@ class InstallCommand {
78
78
  }
79
79
  exports.InstallCommand = InstallCommand;
80
80
  yok_1.injector.registerCommand("install", InstallCommand);
81
+ //# sourceMappingURL=install.js.map
@@ -43,3 +43,4 @@ class ListPlatformsCommand {
43
43
  }
44
44
  exports.ListPlatformsCommand = ListPlatformsCommand;
45
45
  yok_1.injector.registerCommand("platform|*list", ListPlatformsCommand);
46
+ //# sourceMappingURL=list-platforms.js.map
@@ -42,3 +42,4 @@ class MigrateCommand {
42
42
  }
43
43
  exports.MigrateCommand = MigrateCommand;
44
44
  yok_1.injector.registerCommand("migrate", MigrateCommand);
45
+ //# sourceMappingURL=migrate.js.map
@@ -52,3 +52,4 @@ class CleanCommand {
52
52
  }
53
53
  exports.CleanCommand = CleanCommand;
54
54
  yok_1.injector.registerCommand("platform|clean", CleanCommand);
55
+ //# sourceMappingURL=platform-clean.js.map
@@ -41,3 +41,4 @@ class AddPluginCommand {
41
41
  }
42
42
  exports.AddPluginCommand = AddPluginCommand;
43
43
  yok_1.injector.registerCommand(["plugin|add", "plugin|install"], AddPluginCommand);
44
+ //# sourceMappingURL=add-plugin.js.map
@@ -66,3 +66,4 @@ class BuildPluginCommand {
66
66
  }
67
67
  exports.BuildPluginCommand = BuildPluginCommand;
68
68
  yok_1.injector.registerCommand("plugin|build", BuildPluginCommand);
69
+ //# sourceMappingURL=build-plugin.js.map
@@ -38,12 +38,14 @@ class CreatePluginCommand {
38
38
  const selectedTemplate = this.$options.template;
39
39
  const selectedPath = path.resolve(pathToProject || ".");
40
40
  const projectDir = path.join(selectedPath, pluginRepoName);
41
+ // Must be out of try catch block, because will throw error if folder alredy exists and we don't want to delete it.
41
42
  this.ensurePackageDir(projectDir);
42
43
  try {
43
44
  yield this.downloadPackage(selectedTemplate, projectDir);
44
45
  yield this.setupSeed(projectDir, pluginRepoName);
45
46
  }
46
47
  catch (err) {
48
+ // The call to this.ensurePackageDir() above will throw error if folder alredy exists, so it is safe to delete here.
47
49
  this.$fs.deleteDirectory(projectDir);
48
50
  throw err;
49
51
  }
@@ -83,6 +85,7 @@ class CreatePluginCommand {
83
85
  !config.includeTypeScriptDemo)) {
84
86
  this.$logger.printMarkdown("Using default values for plugin creation options since your shell is not interactive.");
85
87
  }
88
+ // run postclone script manually and kill it if it takes more than 10 sec
86
89
  const pathToPostCloneScript = path.join("scripts", "postclone");
87
90
  const params = [
88
91
  pathToPostCloneScript,
@@ -143,6 +146,7 @@ class CreatePluginCommand {
143
146
  getPluginNameSource(pluginNameSource, pluginRepoName) {
144
147
  return __awaiter(this, void 0, void 0, function* () {
145
148
  if (!pluginNameSource) {
149
+ // remove nativescript- prefix for naming plugin files
146
150
  const prefix = "nativescript-";
147
151
  pluginNameSource = pluginRepoName.toLowerCase().startsWith(prefix)
148
152
  ? pluginRepoName.slice(prefix.length, pluginRepoName.length)
@@ -173,3 +177,4 @@ class CreatePluginCommand {
173
177
  }
174
178
  exports.CreatePluginCommand = CreatePluginCommand;
175
179
  yok_1.injector.registerCommand(["plugin|create"], CreatePluginCommand);
180
+ //# sourceMappingURL=create-plugin.js.map
@@ -52,3 +52,4 @@ class ListPluginsCommand {
52
52
  }
53
53
  exports.ListPluginsCommand = ListPluginsCommand;
54
54
  yok_1.injector.registerCommand("plugin|*list", ListPluginsCommand);
55
+ //# sourceMappingURL=list-plugins.js.map
@@ -33,6 +33,7 @@ class RemovePluginCommand {
33
33
  }
34
34
  let pluginNames = [];
35
35
  try {
36
+ // try installing the plugins, so we can get information from node_modules about their native code, libs, etc.
36
37
  const installedPlugins = yield this.$pluginsService.getAllInstalledPlugins(this.$projectData);
37
38
  pluginNames = installedPlugins.map((pl) => pl.name);
38
39
  }
@@ -50,3 +51,4 @@ class RemovePluginCommand {
50
51
  }
51
52
  exports.RemovePluginCommand = RemovePluginCommand;
52
53
  yok_1.injector.registerCommand("plugin|remove", RemovePluginCommand);
54
+ //# sourceMappingURL=remove-plugin.js.map
@@ -50,3 +50,4 @@ class UpdatePluginCommand {
50
50
  }
51
51
  exports.UpdatePluginCommand = UpdatePluginCommand;
52
52
  yok_1.injector.registerCommand("plugin|update", UpdatePluginCommand);
53
+ //# sourceMappingURL=update-plugin.js.map