nativescript 8.8.3 → 8.9.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/lib/.d.ts +1 -0
  2. package/lib/android-tools-info.js +0 -12
  3. package/lib/base-package-manager.js +0 -7
  4. package/lib/bootstrap.js +1 -5
  5. package/lib/bun-package-manager.js +1 -17
  6. package/lib/color.js +0 -3
  7. package/lib/commands/add-platform.js +0 -1
  8. package/lib/commands/apple-login.js +0 -1
  9. package/lib/commands/appstore-list.js +0 -1
  10. package/lib/commands/appstore-upload.js +3 -10
  11. package/lib/commands/build.js +2 -3
  12. package/lib/commands/clean.js +1 -22
  13. package/lib/commands/command-base.js +0 -1
  14. package/lib/commands/config.js +0 -3
  15. package/lib/commands/create-project.js +0 -6
  16. package/lib/commands/debug.js +1 -6
  17. package/lib/commands/deploy.js +2 -3
  18. package/lib/commands/embedding/embed.js +0 -7
  19. package/lib/commands/extensibility/install-extension.js +0 -1
  20. package/lib/commands/extensibility/list-extensions.js +0 -1
  21. package/lib/commands/extensibility/uninstall-extension.js +0 -1
  22. package/lib/commands/fonts.js +0 -1
  23. package/lib/commands/generate-assets.js +0 -1
  24. package/lib/commands/generate-help.js +0 -1
  25. package/lib/commands/generate.js +2 -12
  26. package/lib/commands/info.js +0 -1
  27. package/lib/commands/install.js +0 -1
  28. package/lib/commands/list-platforms.js +0 -1
  29. package/lib/commands/migrate.js +0 -1
  30. package/lib/commands/native-add.js +0 -5
  31. package/lib/commands/platform-clean.js +0 -1
  32. package/lib/commands/plugin/add-plugin.js +0 -1
  33. package/lib/commands/plugin/build-plugin.js +0 -1
  34. package/lib/commands/plugin/create-plugin.js +0 -5
  35. package/lib/commands/plugin/list-plugins.js +0 -1
  36. package/lib/commands/plugin/remove-plugin.js +0 -2
  37. package/lib/commands/plugin/update-plugin.js +0 -1
  38. package/lib/commands/post-install.js +0 -6
  39. package/lib/commands/prepare.js +3 -4
  40. package/lib/commands/preview.js +0 -2
  41. package/lib/commands/remove-platform.js +0 -1
  42. package/lib/commands/resources/resources-update.js +0 -2
  43. package/lib/commands/run.js +0 -1
  44. package/lib/commands/setup.js +0 -1
  45. package/lib/commands/start.js +0 -1
  46. package/lib/commands/test-init.js +0 -4
  47. package/lib/commands/test.js +2 -9
  48. package/lib/commands/typings.js +1 -2
  49. package/lib/commands/update-platform.js +0 -5
  50. package/lib/commands/update.js +0 -2
  51. package/lib/common/bootstrap.js +0 -1
  52. package/lib/common/child-process.js +0 -3
  53. package/lib/common/codeGeneration/code-entity.js +0 -1
  54. package/lib/common/codeGeneration/code-printer.js +0 -1
  55. package/lib/common/command-params.js +0 -1
  56. package/lib/common/commands/analytics.js +0 -3
  57. package/lib/common/commands/autocompletion.js +0 -3
  58. package/lib/common/commands/device/device-log-stream.js +0 -1
  59. package/lib/common/commands/device/get-file.js +0 -2
  60. package/lib/common/commands/device/list-applications.js +0 -1
  61. package/lib/common/commands/device/list-devices.js +0 -3
  62. package/lib/common/commands/device/list-files.js +0 -2
  63. package/lib/common/commands/device/put-file.js +0 -2
  64. package/lib/common/commands/device/run-application.js +0 -1
  65. package/lib/common/commands/device/stop-application.js +0 -1
  66. package/lib/common/commands/device/uninstall-application.js +0 -1
  67. package/lib/common/commands/doctor.js +2 -3
  68. package/lib/common/commands/generate-messages.js +0 -1
  69. package/lib/common/commands/help.js +0 -1
  70. package/lib/common/commands/package-manager-get.js +0 -1
  71. package/lib/common/commands/package-manager-set.js +0 -1
  72. package/lib/common/commands/post-install.js +0 -1
  73. package/lib/common/commands/preuninstall.js +2 -11
  74. package/lib/common/commands/proxy/proxy-base.js +0 -4
  75. package/lib/common/commands/proxy/proxy-clear.js +0 -1
  76. package/lib/common/commands/proxy/proxy-get.js +0 -1
  77. package/lib/common/commands/proxy/proxy-set.js +0 -1
  78. package/lib/common/common-lib.js +0 -1
  79. package/lib/common/constants.js +0 -11
  80. package/lib/common/decorators.js +0 -48
  81. package/lib/common/dispatchers.js +1 -10
  82. package/lib/common/errors.js +3 -13
  83. package/lib/common/file-system.js +2 -13
  84. package/lib/common/header.js +0 -3
  85. package/lib/common/helpers.js +3 -89
  86. package/lib/common/host-info.js +0 -4
  87. package/lib/common/http-client.js +0 -20
  88. package/lib/common/logger/appenders/cli-appender.js +0 -4
  89. package/lib/common/logger/appenders/emit-appender.js +0 -4
  90. package/lib/common/logger/layouts/cli-layout.js +0 -1
  91. package/lib/common/logger/logger.js +0 -5
  92. package/lib/common/messages/messages.js +0 -6
  93. package/lib/common/mobile/android/android-application-manager.js +1 -20
  94. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
  95. package/lib/common/mobile/android/android-debug-bridge.js +0 -6
  96. package/lib/common/mobile/android/android-device-file-system.js +0 -4
  97. package/lib/common/mobile/android/android-device-hash-service.js +0 -3
  98. package/lib/common/mobile/android/android-device.js +0 -8
  99. package/lib/common/mobile/android/android-emulator-services.js +1 -2
  100. package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
  101. package/lib/common/mobile/android/android-log-filter.js +0 -4
  102. package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
  103. package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
  104. package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
  105. package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
  106. package/lib/common/mobile/android/logcat-helper.js +1 -14
  107. package/lib/common/mobile/application-manager-base.js +0 -6
  108. package/lib/common/mobile/device-emitter.js +0 -4
  109. package/lib/common/mobile/device-log-emitter.js +0 -1
  110. package/lib/common/mobile/device-log-provider-base.js +0 -1
  111. package/lib/common/mobile/device-log-provider.js +0 -23
  112. package/lib/common/mobile/device-platforms-constants.js +0 -1
  113. package/lib/common/mobile/emulator-helper.js +0 -3
  114. package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
  115. package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
  116. package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
  117. package/lib/common/mobile/ios/device/ios-device.js +0 -4
  118. package/lib/common/mobile/ios/ios-device-base.js +0 -1
  119. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
  120. package/lib/common/mobile/ios/ios-log-filter.js +0 -1
  121. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
  122. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
  123. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
  124. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
  125. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
  126. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
  127. package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
  128. package/lib/common/mobile/log-filter.js +0 -2
  129. package/lib/common/mobile/logging-levels.js +0 -1
  130. package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
  131. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
  132. package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
  133. package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
  134. package/lib/common/mobile/mobile-core/devices-service.js +0 -69
  135. package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
  136. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
  137. package/lib/common/mobile/mobile-helper.js +0 -1
  138. package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
  139. package/lib/common/opener.js +0 -1
  140. package/lib/common/os-info.js +0 -1
  141. package/lib/common/plist-parser.js +0 -1
  142. package/lib/common/project-helper.js +0 -1
  143. package/lib/common/prompter.js +1 -9
  144. package/lib/common/queue.js +0 -1
  145. package/lib/common/resource-loader.js +0 -1
  146. package/lib/common/services/auto-completion-service.js +1 -13
  147. package/lib/common/services/cancellation.js +1 -2
  148. package/lib/common/services/commands-service.js +6 -17
  149. package/lib/common/services/help-service.js +3 -11
  150. package/lib/common/services/hooks-service.js +0 -13
  151. package/lib/common/services/ios-notification-service.js +0 -1
  152. package/lib/common/services/json-file-settings-service.js +0 -6
  153. package/lib/common/services/lock-service.js +0 -6
  154. package/lib/common/services/message-contract-generator.js +0 -1
  155. package/lib/common/services/messages-service.js +0 -1
  156. package/lib/common/services/micro-templating-service.js +0 -6
  157. package/lib/common/services/net-service.js +0 -3
  158. package/lib/common/services/project-files-manager.js +0 -5
  159. package/lib/common/services/project-files-provider-base.js +0 -1
  160. package/lib/common/services/proxy-service.js +0 -1
  161. package/lib/common/services/qr.js +0 -1
  162. package/lib/common/services/settings-service.js +0 -1
  163. package/lib/common/services/xcode-select-service.js +0 -1
  164. package/lib/common/utils.js +0 -1
  165. package/lib/common/validators/project-name-validator.js +0 -1
  166. package/lib/common/validators/validation-result.js +0 -1
  167. package/lib/common/verify-node-version.js +1 -8
  168. package/lib/common/yok.js +11 -32
  169. package/lib/config.js +1 -22
  170. package/lib/constants-provider.js +0 -1
  171. package/lib/constants.js +0 -53
  172. package/lib/controllers/build-controller.js +3 -4
  173. package/lib/controllers/debug-controller.js +3 -8
  174. package/lib/controllers/deploy-controller.js +0 -1
  175. package/lib/controllers/migrate-controller.js +3 -91
  176. package/lib/controllers/platform-controller.js +1 -9
  177. package/lib/controllers/prepare-controller.js +9 -19
  178. package/lib/controllers/run-controller.js +1 -17
  179. package/lib/controllers/update-controller-base.js +0 -1
  180. package/lib/controllers/update-controller.js +0 -11
  181. package/lib/data/build-data.js +0 -1
  182. package/lib/data/controller-data-base.js +0 -1
  183. package/lib/data/debug-data.js +0 -1
  184. package/lib/data/platform-data.js +0 -1
  185. package/lib/data/prepare-data.js +1 -1
  186. package/lib/data/run-data.js +0 -1
  187. package/lib/declarations.d.ts +1 -1
  188. package/lib/definitions/prepare.d.ts +2 -0
  189. package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
  190. package/lib/detached-processes/cleanup-process.js +14 -18
  191. package/lib/detached-processes/file-log-service.js +1 -2
  192. package/lib/device-path-provider.js +0 -1
  193. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
  194. package/lib/device-sockets/ios/notification.js +0 -3
  195. package/lib/device-sockets/ios/socket-request-executor.js +0 -3
  196. package/lib/helpers/android-bundle-validator-helper.js +1 -2
  197. package/lib/helpers/deploy-command-helper.js +0 -1
  198. package/lib/helpers/key-command-helper.js +2 -4
  199. package/lib/helpers/livesync-command-helper.js +1 -4
  200. package/lib/helpers/network-connectivity-validator.js +0 -1
  201. package/lib/helpers/options-track-helper.js +2 -3
  202. package/lib/helpers/package-path-helper.js +0 -1
  203. package/lib/helpers/platform-command-helper.js +2 -7
  204. package/lib/helpers/version-validator-helper.js +0 -1
  205. package/lib/key-commands/bootstrap.js +2 -3
  206. package/lib/key-commands/index.js +32 -26
  207. package/lib/nativescript-cli-lib-bootstrap.js +0 -4
  208. package/lib/nativescript-cli-lib.js +0 -1
  209. package/lib/nativescript-cli.js +1 -10
  210. package/lib/node/pbxproj-dom-xcode.js +0 -1
  211. package/lib/node/xcode.js +0 -1
  212. package/lib/node-package-manager.js +1 -11
  213. package/lib/options.js +119 -143
  214. package/lib/package-installation-manager.js +1 -8
  215. package/lib/package-manager.js +0 -2
  216. package/lib/platform-command-param.js +0 -1
  217. package/lib/pnpm-package-manager.js +1 -4
  218. package/lib/project-data.js +0 -12
  219. package/lib/providers/project-files-provider.js +0 -1
  220. package/lib/resolvers/livesync-service-resolver.js +0 -1
  221. package/lib/services/analytics/analytics-broker-process.js +6 -10
  222. package/lib/services/analytics/analytics-broker.js +1 -2
  223. package/lib/services/analytics/analytics-service.js +25 -29
  224. package/lib/services/analytics/google-analytics-provider.js +12 -13
  225. package/lib/services/analytics-settings-service.js +0 -5
  226. package/lib/services/android/android-bundle-tool-service.js +0 -1
  227. package/lib/services/android/gradle-build-args-service.js +0 -3
  228. package/lib/services/android/gradle-build-service.js +0 -1
  229. package/lib/services/android/gradle-command-service.js +0 -1
  230. package/lib/services/android-device-debug-service.js +0 -6
  231. package/lib/services/android-plugin-build-service.js +0 -29
  232. package/lib/services/android-project-service.js +4 -71
  233. package/lib/services/android-resources-migration-service.js +0 -7
  234. package/lib/services/apple-portal/apple-portal-application-service.js +1 -2
  235. package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
  236. package/lib/services/apple-portal/apple-portal-session-service.js +42 -15
  237. package/lib/services/apple-portal/srp/srp-wrapper.js +76 -0
  238. package/lib/services/assets-generation/assets-generation-service.js +5 -16
  239. package/lib/services/build-artifacts-service.js +1 -2
  240. package/lib/services/build-data-service.js +0 -1
  241. package/lib/services/build-info-file-service.js +0 -1
  242. package/lib/services/cleanup-service.js +9 -13
  243. package/lib/services/cocoapods-platform-manager.js +0 -9
  244. package/lib/services/cocoapods-service.js +1 -21
  245. package/lib/services/debug-data-service.js +0 -1
  246. package/lib/services/debug-service-base.js +0 -7
  247. package/lib/services/device/device-install-app-service.js +1 -2
  248. package/lib/services/doctor-service.js +6 -21
  249. package/lib/services/extensibility-service.js +0 -8
  250. package/lib/services/files-hash-service.js +0 -1
  251. package/lib/services/hmr-status-service.js +0 -2
  252. package/lib/services/info-service.js +0 -1
  253. package/lib/services/initialize-service.js +1 -5
  254. package/lib/services/ios/export-options-plist-service.js +4 -6
  255. package/lib/services/ios/ios-signing-service.js +45 -27
  256. package/lib/services/ios/spm-service.js +0 -9
  257. package/lib/services/ios/xcodebuild-args-service.js +0 -9
  258. package/lib/services/ios/xcodebuild-command-service.js +0 -1
  259. package/lib/services/ios/xcodebuild-service.js +2 -1
  260. package/lib/services/ios-debugger-port-service.js +0 -1
  261. package/lib/services/ios-device-debug-service.js +0 -1
  262. package/lib/services/ios-entitlements-service.js +0 -1
  263. package/lib/services/ios-extensions-service.js +0 -1
  264. package/lib/services/ios-log-filter.js +0 -20
  265. package/lib/services/ios-native-target-service.js +4 -6
  266. package/lib/services/ios-project-service.js +2 -94
  267. package/lib/services/ios-provision-service.js +0 -3
  268. package/lib/services/ios-watch-app-service.js +0 -1
  269. package/lib/services/ip-service.js +0 -2
  270. package/lib/services/itmstransporter-service.js +0 -1
  271. package/lib/services/karma-execution.js +0 -2
  272. package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
  273. package/lib/services/livesync/android-device-livesync-service.js +0 -2
  274. package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
  275. package/lib/services/livesync/android-livesync-service.js +0 -1
  276. package/lib/services/livesync/android-livesync-tool.js +0 -4
  277. package/lib/services/livesync/device-livesync-service-base.js +0 -2
  278. package/lib/services/livesync/ios-device-livesync-service.js +0 -7
  279. package/lib/services/livesync/ios-livesync-service.js +0 -2
  280. package/lib/services/livesync/livesync-socket.js +0 -1
  281. package/lib/services/livesync/platform-livesync-service-base.js +0 -5
  282. package/lib/services/livesync-process-data-service.js +0 -1
  283. package/lib/services/log-parser-service.js +0 -1
  284. package/lib/services/log-source-map-service.js +0 -15
  285. package/lib/services/marking-mode-service.js +5 -8
  286. package/lib/services/metadata-filtering-service.js +0 -1
  287. package/lib/services/npm-config-service.js +0 -4
  288. package/lib/services/pacote-service.js +0 -7
  289. package/lib/services/performance-service.js +1 -3
  290. package/lib/services/platform/add-platform-service.js +2 -49
  291. package/lib/services/platform/platform-validation-service.js +0 -1
  292. package/lib/services/platform/prepare-native-platform-service.js +2 -5
  293. package/lib/services/platform-environment-requirements.js +3 -8
  294. package/lib/services/platform-project-service-base.js +0 -1
  295. package/lib/services/platforms-data-service.js +0 -1
  296. package/lib/services/plugins-service.js +2 -20
  297. package/lib/services/prepare-data-service.js +0 -1
  298. package/lib/services/project-backup-service.js +0 -4
  299. package/lib/services/project-changes-service.js +3 -14
  300. package/lib/services/project-cleanup-service.js +0 -2
  301. package/lib/services/project-config-service.js +2 -22
  302. package/lib/services/project-data-service.js +7 -36
  303. package/lib/services/project-name-service.js +0 -1
  304. package/lib/services/project-service.js +0 -10
  305. package/lib/services/project-templates-service.js +2 -3
  306. package/lib/services/qr-code-terminal-service.js +0 -1
  307. package/lib/services/require-service.js +0 -1
  308. package/lib/services/start-service.js +0 -1
  309. package/lib/services/temp-service.js +0 -1
  310. package/lib/services/terminal-spinner-service.js +0 -2
  311. package/lib/services/test-execution-service.js +2 -9
  312. package/lib/services/test-initialization-service.js +0 -4
  313. package/lib/services/timeline-profiler-service.js +0 -1
  314. package/lib/services/user-settings-service.js +0 -1
  315. package/lib/services/versions-service.js +4 -6
  316. package/lib/services/watch-ignore-list-service.js +0 -1
  317. package/lib/services/webpack/webpack-compiler-service.js +9 -44
  318. package/lib/services/xcconfig-service.js +0 -2
  319. package/lib/services/xcproj-service.js +0 -1
  320. package/lib/shared-event-bus.js +0 -6
  321. package/lib/sys-info.js +1 -2
  322. package/lib/tools/config-manipulation/config-transformer.js +0 -12
  323. package/lib/tools/node-modules/node-modules-builder.js +0 -1
  324. package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
  325. package/lib/yarn-package-manager.js +0 -1
  326. package/lib/yarn2-package-manager.js +0 -3
  327. package/package.json +3 -2
@@ -103,4 +103,3 @@ class MetadataFilteringService {
103
103
  }
104
104
  exports.MetadataFilteringService = MetadataFilteringService;
105
105
  yok_1.injector.register("metadataFilteringService", MetadataFilteringService);
106
- //# sourceMappingURL=metadata-filtering-service.js.map
@@ -21,11 +21,8 @@ class NpmConfigService {
21
21
  readConfig() {
22
22
  try {
23
23
  const res = (0, child_process_1.execSync)("npm config list --json --global");
24
- // const data: any = npmconfig.read();
25
24
  const data = JSON.parse(res.toString());
26
- // todo: remove if not needed with npm config list --json?
27
25
  Object.entries(data).forEach(([key, value]) => {
28
- // replace env ${VARS} in strings with the process.env value
29
26
  this.config[key] =
30
27
  typeof value !== "string"
31
28
  ? value
@@ -40,4 +37,3 @@ __decorate([
40
37
  ], NpmConfigService.prototype, "readConfig", null);
41
38
  exports.NpmConfigService = NpmConfigService;
42
39
  yok_1.injector.register("npmConfigService", NpmConfigService);
43
- //# sourceMappingURL=npm-config-service.js.map
@@ -33,7 +33,6 @@ class PacoteService {
33
33
  this.$proxyService = $proxyService;
34
34
  }
35
35
  get $packageManager() {
36
- // need to be resolved here due to cyclic dependency
37
36
  return this.$injector.resolve("packageManager");
38
37
  }
39
38
  manifest(packageName, options) {
@@ -52,8 +51,6 @@ class PacoteService {
52
51
  }
53
52
  extractPackage(packageName, destinationDirectory, options) {
54
53
  return __awaiter(this, void 0, void 0, function* () {
55
- // strip: Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. More info: https://github.com/npm/node-tar/blob/e89c4d37519b1c20133a9f49d5f6b85fa34c203b/README.md
56
- // C: Create an archive
57
54
  this.$logger.trace(`Calling pacoteService.extractPackage for packageName: '${packageName}', destinationDir: '${destinationDirectory}' and options: ${options}`);
58
55
  const extractOptions = { strip: 1, C: destinationDirectory };
59
56
  if (options) {
@@ -71,7 +68,6 @@ class PacoteService {
71
68
  });
72
69
  this.$logger.trace(`Creating extract tar stream with options: ${JSON.stringify(extractOptions, null, 2)}`);
73
70
  const destination = tar.x(extractOptions);
74
- // Initiate the source
75
71
  const sourceStream = new stream_1.PassThrough();
76
72
  sourceStream.end(source);
77
73
  sourceStream.pipe(destination);
@@ -88,9 +84,7 @@ class PacoteService {
88
84
  }
89
85
  getPacoteBaseOptions() {
90
86
  return __awaiter(this, void 0, void 0, function* () {
91
- // In case `tns create myapp --template https://github.com/NativeScript/template-hello-world.git` command is executed, pacote module throws an error if cache option is not provided.
92
87
  const cachePath = yield this.$packageManager.getCachePath();
93
- // Add NPM Configuration to our Manifest options
94
88
  const npmConfig = this.$npmConfigService.getConfig();
95
89
  const pacoteOptions = _.extend(npmConfig, { cache: cachePath, Arborist: arborist_1.Arborist });
96
90
  const proxySettings = yield this.$proxyService.getCache();
@@ -113,4 +107,3 @@ __decorate([
113
107
  ], PacoteService.prototype, "$packageManager", null);
114
108
  exports.PacoteService = PacoteService;
115
109
  yok_1.injector.register("pacoteService", PacoteService);
116
- //# sourceMappingURL=pacote-service.js.map
@@ -41,7 +41,7 @@ class PerformanceService {
41
41
  trackAnalyticsData(methodInfo, executionTime) {
42
42
  this.$analyticsService
43
43
  .trackEventActionInGoogleAnalytics({
44
- action: "Performance" /* TrackActionNames.Performance */,
44
+ action: "Performance",
45
45
  additionalData: methodInfo,
46
46
  value: executionTime,
47
47
  })
@@ -71,7 +71,6 @@ class PerformanceService {
71
71
  this.$logger.info(PerformanceService.LOG_MESSAGE_TEMPLATE, methodInfo, executionTime);
72
72
  }
73
73
  }
74
- //removes any injected members of the arguments and excludes the options object even if it was renamed
75
74
  getJsonSanitizer() {
76
75
  const seen = new WeakSet();
77
76
  seen.add(this.$options);
@@ -91,4 +90,3 @@ PerformanceService.FAIL_LOG_MESSAGE_TEMPLATE = `Failed to log pefromance data in
91
90
  PerformanceService.MIN_NODE_PERFORMANCE_MODULE_VERSION = "8.5.0";
92
91
  exports.PerformanceService = PerformanceService;
93
92
  yok_1.injector.register("performanceService", PerformanceService);
94
- //# sourceMappingURL=performance-service.js.map
@@ -21,11 +21,7 @@ const constants_1 = require("../../constants");
21
21
  const decorators_1 = require("../../common/decorators");
22
22
  const yok_1 = require("../../common/yok");
23
23
  class AddPlatformService {
24
- constructor($fs, $logger, $options,
25
- // private $pacoteService: IPacoteService,
26
- // private $projectDataService: IProjectDataService,
27
- $packageManager, $terminalSpinnerService, $analyticsService // private $tempService: ITempService
28
- ) {
24
+ constructor($fs, $logger, $options, $packageManager, $terminalSpinnerService, $analyticsService) {
29
25
  this.$fs = $fs;
30
26
  this.$logger = $logger;
31
27
  this.$options = $options;
@@ -41,13 +37,9 @@ class AddPlatformService {
41
37
  const spinner = this.$terminalSpinnerService.createSpinner();
42
38
  try {
43
39
  spinner.start();
44
- // const frameworkDirPath = addPlatformData.frameworkPath ?
45
- // await this.extractPackage(packageToInstall)
46
- // : await this.installPackage(projectData.projectDir, packageToInstall);
47
40
  const frameworkDirPath = yield this.installPackage(projectData.projectDir, packageToInstall);
48
41
  const frameworkPackageJsonContent = this.$fs.readJson(path.join(frameworkDirPath, "..", "package.json"));
49
42
  const frameworkVersion = frameworkPackageJsonContent.version;
50
- // await this.setPlatformVersion(platformData, projectData, frameworkVersion);
51
43
  yield this.trackPlatformVersion(frameworkVersion, platformData);
52
44
  if (!addPlatformData.nativePrepare ||
53
45
  !addPlatformData.nativePrepare.skipNativePrepare) {
@@ -70,22 +62,10 @@ class AddPlatformService {
70
62
  yield this.installPackage(projectData.projectDir, `${platformData.frameworkPackageName}@${frameworkVersion}`);
71
63
  });
72
64
  }
73
- // private async extractPackage(pkg: string): Promise<string> {
74
- // const downloadedPackagePath = await this.$tempService.mkdirSync(
75
- // "runtimeDir"
76
- // );
77
- // await this.$pacoteService.extractPackage(pkg, downloadedPackagePath);
78
- // const frameworkDir = path.join(
79
- // downloadedPackagePath,
80
- // PROJECT_FRAMEWORK_FOLDER_NAME
81
- // );
82
- // return path.resolve(frameworkDir);
83
- // }
84
65
  installPackage(projectDir, packageName) {
85
66
  return __awaiter(this, void 0, void 0, function* () {
86
67
  const frameworkDir = this.resolveFrameworkDir(projectDir, packageName);
87
68
  if (frameworkDir && this.$fs.exists(frameworkDir)) {
88
- // don't install if it's already installed
89
69
  return frameworkDir;
90
70
  }
91
71
  const installedPackage = yield this.$packageManager.install(packageName, projectDir, {
@@ -102,30 +82,6 @@ class AddPlatformService {
102
82
  }
103
83
  resolveFrameworkDir(projectDir, packageName) {
104
84
  try {
105
- // strip version info if present <package>@1.2.3-rc.0 -> <package>
106
- // tested cases:
107
- // @nativescript/ios
108
- // @nativescript/ios@1
109
- // @nativescript/ios@1.2
110
- // @nativescript/ios@1.2.3
111
- // @nativescript/ios@1.2.3-
112
- // @nativescript/ios@1.2.3-rc
113
- // @nativescript/ios@1.2.3-rc.
114
- // @nativescript/ios@1.2.3-rc.0
115
- // @nativescript/ios@rc
116
- // @nativescript/ios@^7.0.0
117
- // @nativescript/ios@~7.0.0
118
- // tns-ios
119
- // tns-ios@1
120
- // tns-ios@1.2
121
- // tns-ios@1.2.3
122
- // tns-ios@1.2.3-
123
- // tns-ios@1.2.3-rc
124
- // tns-ios@1.2.3-rc.
125
- // tns-ios@1.2.3-rc.0
126
- // tns-ios@rc
127
- // tns-ios@^7.0.0
128
- // tns-ios@~7.0.0
129
85
  packageName = packageName.replace(/(.+)@.+$/g, "$1");
130
86
  const frameworkDir = require
131
87
  .resolve(`${packageName}/package.json`, {
@@ -144,10 +100,8 @@ class AddPlatformService {
144
100
  addNativePlatform(platformData, projectData, frameworkDirPath, frameworkVersion) {
145
101
  var _a;
146
102
  return __awaiter(this, void 0, void 0, function* () {
147
- // here we should use ios OR android
148
103
  const platformDir = (_a = this.$options.hostProjectPath) !== null && _a !== void 0 ? _a : path.join(projectData.platformsDir, platformData.normalizedPlatformName.toLowerCase());
149
104
  this.$fs.deleteDirectory(platformDir);
150
- //if iosHost - dont create project
151
105
  yield platformData.platformProjectService.createProject(path.resolve(frameworkDirPath), frameworkVersion, projectData);
152
106
  platformData.platformProjectService.ensureConfigurationFileInAppResources(projectData);
153
107
  yield platformData.platformProjectService.interpolateData(projectData);
@@ -157,7 +111,7 @@ class AddPlatformService {
157
111
  trackPlatformVersion(frameworkVersion, platformData) {
158
112
  return __awaiter(this, void 0, void 0, function* () {
159
113
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
160
- action: "Add Platform" /* TrackActionNames.AddPlatform */,
114
+ action: "Add Platform",
161
115
  additionalData: `${platformData.platformNameLowerCase}${constants_1.AnalyticsEventLabelDelimiter}${frameworkVersion}`,
162
116
  });
163
117
  });
@@ -168,4 +122,3 @@ __decorate([
168
122
  ], AddPlatformService.prototype, "addNativePlatform", null);
169
123
  exports.AddPlatformService = AddPlatformService;
170
124
  yok_1.injector.register("addPlatformService", AddPlatformService);
171
- //# sourceMappingURL=add-platform-service.js.map
@@ -83,4 +83,3 @@ class PlatformValidationService {
83
83
  }
84
84
  exports.PlatformValidationService = PlatformValidationService;
85
85
  yok_1.injector.register("platformValidationService", PlatformValidationService);
86
- //# sourceMappingURL=platform-validation-service.js.map
@@ -59,21 +59,19 @@ class PrepareNativePlatformService {
59
59
  this.$metadataFilteringService.generateMetadataFilters(projectData, platformData.platformNameLowerCase);
60
60
  }
61
61
  platformData.platformProjectService.interpolateConfigurationFile(projectData);
62
- yield this.$projectChangesService.setNativePlatformStatus(platformData, projectData, { nativePlatformStatus: "3" /* NativePlatformStatus.alreadyPrepared */ });
62
+ yield this.$projectChangesService.setNativePlatformStatus(platformData, projectData, { nativePlatformStatus: "3" });
63
63
  return hasChanges;
64
64
  });
65
65
  }
66
66
  cleanProject(platformData, options) {
67
67
  return __awaiter(this, void 0, void 0, function* () {
68
- // android build artifacts need to be cleaned up
69
- // when switching between debug, release and webpack builds
70
68
  if (platformData.platformNameLowerCase !== "android") {
71
69
  return;
72
70
  }
73
71
  const previousPrepareInfo = this.$projectChangesService.getPrepareInfo(platformData);
74
72
  if (!previousPrepareInfo ||
75
73
  previousPrepareInfo.nativePlatformStatus !==
76
- "3" /* NativePlatformStatus.alreadyPrepared */) {
74
+ "3") {
77
75
  return;
78
76
  }
79
77
  const { release: previousWasRelease } = previousPrepareInfo;
@@ -90,4 +88,3 @@ __decorate([
90
88
  ], PrepareNativePlatformService.prototype, "prepareNativePlatform", null);
91
89
  exports.PrepareNativePlatformService = PrepareNativePlatformService;
92
90
  yok_1.injector.register("prepareNativePlatformService", PrepareNativePlatformService);
93
- //# sourceMappingURL=prepare-native-platform-service.js.map
@@ -20,9 +20,7 @@ const helpers_1 = require("../common/helpers");
20
20
  const os_1 = require("os");
21
21
  const yok_1 = require("../common/yok");
22
22
  class PlatformEnvironmentRequirements {
23
- constructor($doctorService, $errors, $analyticsService,
24
- // @ts-ignore - required by the hook helper!
25
- $injector) {
23
+ constructor($doctorService, $errors, $analyticsService, $injector) {
26
24
  this.$doctorService = $doctorService;
27
25
  this.$errors = $errors;
28
26
  this.$analyticsService = $analyticsService;
@@ -34,7 +32,7 @@ class PlatformEnvironmentRequirements {
34
32
  const selectedOption = null;
35
33
  if (process.env.NS_SKIP_ENV_CHECK) {
36
34
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
37
- action: "Check Environment Requirements" /* TrackActionNames.CheckEnvironmentRequirements */,
35
+ action: "Check Environment Requirements",
38
36
  additionalData: "Skipped: NS_SKIP_ENV_CHECK is set",
39
37
  });
40
38
  return {
@@ -49,9 +47,8 @@ class PlatformEnvironmentRequirements {
49
47
  forceCheck: input.forceCheck,
50
48
  });
51
49
  if (!canExecute) {
52
- // if (!isInteractive()) {
53
50
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
54
- action: "Check Environment Requirements" /* TrackActionNames.CheckEnvironmentRequirements */,
51
+ action: "Check Environment Requirements",
55
52
  additionalData: "Non-interactive terminal, unable to execute local builds.",
56
53
  });
57
54
  this.fail(this.getNonInteractiveConsoleMessage(platform));
@@ -72,7 +69,6 @@ class PlatformEnvironmentRequirements {
72
69
  ].join(os_1.EOL);
73
70
  }
74
71
  getEnvVerificationMessage(platform) {
75
- // map process.platform to OS name used in docs
76
72
  const os = {
77
73
  linux: "linux",
78
74
  win32: "windows",
@@ -91,4 +87,3 @@ __decorate([
91
87
  ], PlatformEnvironmentRequirements.prototype, "checkEnvironmentRequirements", null);
92
88
  exports.PlatformEnvironmentRequirements = PlatformEnvironmentRequirements;
93
89
  yok_1.injector.register("platformEnvironmentRequirements", PlatformEnvironmentRequirements);
94
- //# sourceMappingURL=platform-environment-requirements.js.map
@@ -30,4 +30,3 @@ class PlatformProjectServiceBase extends events_1.EventEmitter {
30
30
  }
31
31
  }
32
32
  exports.PlatformProjectServiceBase = PlatformProjectServiceBase;
33
- //# sourceMappingURL=platform-project-service-base.js.map
@@ -29,4 +29,3 @@ class PlatformsDataService {
29
29
  }
30
30
  exports.PlatformsDataService = PlatformsDataService;
31
31
  yok_1.injector.register("platformsDataService", PlatformsDataService);
32
- //# sourceMappingURL=platforms-data-service.js.map
@@ -64,7 +64,6 @@ class PluginsService {
64
64
  const realNpmPackageJson = this.$fs.readJson(pathToRealNpmPackageJson);
65
65
  if (realNpmPackageJson.nativescript) {
66
66
  const pluginData = this.convertToPluginData(realNpmPackageJson, projectData.projectDir);
67
- // Validate
68
67
  const action = (pluginDestinationPath, platform, platformData) => __awaiter(this, void 0, void 0, function* () {
69
68
  this.isPluginDataValidForPlatform(pluginData, platform, projectData);
70
69
  });
@@ -153,9 +152,6 @@ class PluginsService {
153
152
  paths: [projectData.projectDir],
154
153
  });
155
154
  if (pathToPackage) {
156
- // return false if the dependency is installed - we'll filter out boolean values
157
- // and end up with an array of dep names that are not installed if we end up
158
- // inside the catch block.
159
155
  return false;
160
156
  }
161
157
  this.$logger.trace(`${dep} is not installed, or couldn't be found`);
@@ -191,9 +187,6 @@ class PluginsService {
191
187
  return productionPlugins
192
188
  .map((plugin) => this.convertToPluginData(plugin, projectData.projectDir))
193
189
  .filter((item, idx, self) => {
194
- // Filter out duplicates to speed up build times by not building the same dependency
195
- // multiple times. One possible downside is that if there are different versions
196
- // of the same native dependency only the first one in the array will be built
197
190
  return self.findIndex((p) => p.name === item.name) === idx;
198
191
  });
199
192
  }
@@ -225,11 +218,9 @@ class PluginsService {
225
218
  const dependenciesGroupedByName = _.groupBy(productionDependencies, (p) => p.name);
226
219
  _.each(dependenciesGroupedByName, (dependencyOccurrences, dependencyName) => {
227
220
  if (dependencyOccurrences.length > 1) {
228
- // the dependency exists multiple times in node_modules
229
221
  const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
230
222
  const versions = _.keys(dependencyOccurrencesGroupedByVersion);
231
223
  if (versions.length === 1) {
232
- // all dependencies with this name have the same version
233
224
  this.$logger.trace(`Detected same versions (${_.first(versions)}) of the ${dependencyName} installed at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
234
225
  }
235
226
  else {
@@ -255,11 +246,9 @@ class PluginsService {
255
246
  const dependenciesGroupedByFrameworkName = _.groupBy(dependenciesWithFrameworks, (d) => d.frameworkName);
256
247
  _.each(dependenciesGroupedByFrameworkName, (dependencyOccurrences, frameworkName) => {
257
248
  if (dependencyOccurrences.length > 1) {
258
- // A framework exists multiple times in node_modules
259
249
  const groupedByName = _.groupBy(dependencyOccurrences, (d) => d.name);
260
250
  const pluginsNames = _.keys(groupedByName);
261
251
  if (pluginsNames.length > 1) {
262
- // fail - the same framework is installed by different dependencies.
263
252
  const locations = dependencyOccurrences.map((d) => d.frameworkLocation);
264
253
  let msg = `Detected the framework ${frameworkName} is installed from multiple plugins at locations:\n${locations.join("\n")}\n`;
265
254
  msg += this.getHelpMessage(projectDir);
@@ -269,7 +258,6 @@ class PluginsService {
269
258
  const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
270
259
  const versions = _.keys(dependencyOccurrencesGroupedByVersion);
271
260
  if (versions.length === 1) {
272
- // all dependencies with this name have the same version
273
261
  this.$logger.warn(`Detected the framework ${frameworkName} is installed multiple times from the same versions of plugin (${_.first(versions)}) at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
274
262
  const selectedPackage = _.minBy(dependencyOccurrences, (d) => d.depth);
275
263
  this.$logger.info(color_1.color.green(`CLI will use only the native code from '${selectedPackage.directory}'.`));
@@ -321,7 +309,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
321
309
  pluginData.isPlugin = !!cacheData.nativescript;
322
310
  pluginData.pluginPlatformsFolderPath = (platform) => {
323
311
  if (this.$mobileHelper.isvisionOSPlatform(platform)) {
324
- platform = "ios" /* constants.PlatformTypes.ios */;
312
+ platform = "ios";
325
313
  }
326
314
  return path.join(pluginData.fullPath, "platforms", platform.toLowerCase());
327
315
  };
@@ -378,7 +366,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
378
366
  return _.keys(require(packageJsonFilePath).dependencies);
379
367
  }
380
368
  getNodeModuleData(module, projectDir) {
381
- // module can be modulePath or moduleName
382
369
  if (!this.$fs.exists(module) || path.basename(module) !== "package.json") {
383
370
  module = this.getPackageJsonFilePathForModule(module, projectDir);
384
371
  }
@@ -416,7 +403,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
416
403
  });
417
404
  }
418
405
  parseNpmCommandResult(npmCommandResult) {
419
- return npmCommandResult.split("@")[0]; // returns plugin name
406
+ return npmCommandResult.split("@")[0];
420
407
  }
421
408
  executeForAllInstalledPlatforms(action, projectData) {
422
409
  return __awaiter(this, void 0, void 0, function* () {
@@ -433,8 +420,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
433
420
  }
434
421
  getInstalledFrameworkVersion(platform, projectData) {
435
422
  const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, platform);
436
- // const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
437
- // const frameworkData = this.$projectDataService.getNSValue(projectData.projectDir, platformData.frameworkPackageName);
438
423
  return runtimePackage.version;
439
424
  }
440
425
  isPluginDataValidForPlatform(pluginData, platform, projectData) {
@@ -466,7 +451,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
466
451
  }
467
452
  getAllPluginsNativeHashes(pathToPluginsBuildFile) {
468
453
  if (this.$options.hostProjectPath) {
469
- // TODO: force rebuild plugins for now until we decide where to put .ns-plugins-build-data.json when embedding
470
454
  return {};
471
455
  }
472
456
  let data = {};
@@ -477,7 +461,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
477
461
  }
478
462
  setPluginNativeHashes(opts) {
479
463
  if (this.$options.hostProjectPath) {
480
- // TODO: force rebuild plugins for now until we decide where to put .ns-plugins-build-data.json when embedding
481
464
  return;
482
465
  }
483
466
  opts.allPluginsNativeHashes[opts.pluginData.name] =
@@ -498,4 +481,3 @@ PluginsService.LOCK_FILES = [
498
481
  ];
499
482
  exports.PluginsService = PluginsService;
500
483
  yok_1.injector.register("pluginsService", PluginsService);
501
- //# sourceMappingURL=plugins-service.js.map
@@ -19,4 +19,3 @@ class PrepareDataService {
19
19
  }
20
20
  exports.PrepareDataService = PrepareDataService;
21
21
  yok_1.injector.register("prepareDataService", PrepareDataService);
22
- //# sourceMappingURL=prepare-data-service.js.map
@@ -46,7 +46,6 @@ ProjectBackupService.Backup = class Backup {
46
46
  backedUpPaths.push(pathToBackup);
47
47
  }
48
48
  }
49
- // create backup.json
50
49
  this.$super.$fs.writeJson(path.resolve(this.backupDir, "_backup.json"), {
51
50
  name: this.name,
52
51
  paths: backedUpPaths,
@@ -67,7 +66,6 @@ ProjectBackupService.Backup = class Backup {
67
66
  }
68
67
  }
69
68
  this.$super.$logger.trace(backupData);
70
- // restore files
71
69
  return this;
72
70
  }
73
71
  isUpToDate() {
@@ -77,7 +75,6 @@ ProjectBackupService.Backup = class Backup {
77
75
  }
78
76
  for (const pathToBackup of backupData.paths) {
79
77
  const sourcePath = path.resolve(this.backupDir, pathToBackup);
80
- // if any of the files don't exist the backup is not up-to-date
81
78
  if (!this.$super.$fs.exists(sourcePath)) {
82
79
  return false;
83
80
  }
@@ -115,4 +112,3 @@ ProjectBackupService.Backup = class Backup {
115
112
  };
116
113
  exports.ProjectBackupService = ProjectBackupService;
117
114
  yok_1.injector.register("projectBackupService", ProjectBackupService);
118
- //# sourceMappingURL=project-backup-service.js.map
@@ -74,7 +74,6 @@ class ProjectChangesService {
74
74
  this._prepareInfo.projectFileHash = this.getProjectFileStrippedHash(projectData.projectDir, platformData);
75
75
  this._changesInfo.nativeChanged = this.isProjectFileChanged(projectData.projectDir, platformData);
76
76
  }
77
- // If this causes too much rebuilds of the plugins or uncecessary builds for Android, move overrideCocoapods to prepareInfo.
78
77
  this._changesInfo.nsConfigChanged = this.filesChanged([
79
78
  path.join(projectData.projectDir, constants_1.CONFIG_FILE_NAME_JS),
80
79
  path.join(projectData.projectDir, constants_1.CONFIG_FILE_NAME_TS),
@@ -133,7 +132,6 @@ class ProjectChangesService {
133
132
  }
134
133
  getPrepareInfo(platformData) {
135
134
  if (this.$options.hostProjectPath) {
136
- // TODO: always prepare for now until we decide where to keep the .nsprepareinfo file when embedding
137
135
  return null;
138
136
  }
139
137
  const prepareInfoFilePath = this.getPrepareInfoFilePath(platformData);
@@ -154,7 +152,6 @@ class ProjectChangesService {
154
152
  yield this.ensurePrepareInfo(platformData, projectData, prepareData);
155
153
  }
156
154
  if (this.$options.hostProjectPath) {
157
- // TODO: do not save for now until we decide where to keep the .nsprepareinfo file when embedding
158
155
  return null;
159
156
  }
160
157
  const prepareInfoFilePath = this.getPrepareInfoFilePath(platformData);
@@ -166,7 +163,7 @@ class ProjectChangesService {
166
163
  this._prepareInfo = this._prepareInfo || this.getPrepareInfo(platformData);
167
164
  if (this._prepareInfo &&
168
165
  addedPlatform.nativePlatformStatus ===
169
- "3" /* NativePlatformStatus.alreadyPrepared */) {
166
+ "3") {
170
167
  this._prepareInfo.nativePlatformStatus =
171
168
  addedPlatform.nativePlatformStatus;
172
169
  }
@@ -192,8 +189,8 @@ class ProjectChangesService {
192
189
  return false;
193
190
  }
194
191
  const nativePlatformStatus = !prepareData.nativePrepare || !prepareData.nativePrepare.skipNativePrepare
195
- ? "2" /* NativePlatformStatus.requiresPrepare */
196
- : "1" /* NativePlatformStatus.requiresPlatformAdd */;
192
+ ? "2"
193
+ : "1";
197
194
  this._prepareInfo = {
198
195
  time: "",
199
196
  nativePlatformStatus,
@@ -217,13 +214,6 @@ class ProjectChangesService {
217
214
  const projectFileContents = this.$fs.readJson(projectFilePath);
218
215
  const relevantProperties = ["dependencies"];
219
216
  const projectFileStrippedContents = _.pick(projectFileContents, relevantProperties);
220
- // _(this.$devicePlatformsConstants)
221
- // .keys()
222
- // .map(k => k.toLowerCase())
223
- // .difference([platformData.platformNameLowerCase])
224
- // .each(otherPlatform => {
225
- // delete projectFileContents.nativescript[`tns-${otherPlatform}`];
226
- // });
227
217
  return (0, helpers_1.getHash)(JSON.stringify(projectFileStrippedContents));
228
218
  }
229
219
  isProjectFileChanged(projectDir, platformData) {
@@ -289,4 +279,3 @@ __decorate([
289
279
  ], ProjectChangesService.prototype, "checkForChanges", null);
290
280
  exports.ProjectChangesService = ProjectChangesService;
291
281
  yok_1.injector.register("projectChangesService", ProjectChangesService);
292
- //# sourceMappingURL=project-changes-service.js.map
@@ -38,7 +38,6 @@ class ProjectCleanupService {
38
38
  success = success && cleanRes.ok;
39
39
  }
40
40
  if (!(options === null || options === void 0 ? void 0 : options.silent)) {
41
- // required to print an empty line for the spinner to not replace the last status... (probably a bug in the spinners)
42
41
  console.log();
43
42
  }
44
43
  if (stats) {
@@ -101,4 +100,3 @@ class ProjectCleanupService {
101
100
  }
102
101
  exports.ProjectCleanupService = ProjectCleanupService;
103
102
  yok_1.injector.register("projectCleanupService", ProjectCleanupService);
104
- //# sourceMappingURL=project-cleanup-service.js.map
@@ -44,7 +44,6 @@ class ProjectConfigService {
44
44
  return (this.forceUsingLegacyConfig = force);
45
45
  }
46
46
  requireFromString(src, filename) {
47
- // @ts-ignore
48
47
  const m = new module.constructor();
49
48
  m.paths = module.paths;
50
49
  m._compile(src, filename);
@@ -67,7 +66,6 @@ export default {
67
66
  } as NativeScriptConfig;`.trim();
68
67
  }
69
68
  warnUsingLegacyNSConfig() {
70
- // todo: remove hack
71
69
  const isMigrate = _.get(this.$options, "argv._[0]") === "migrate";
72
70
  if (isMigrate) {
73
71
  return;
@@ -76,7 +74,6 @@ export default {
76
74
  }
77
75
  detectProjectConfigs(projectDir) {
78
76
  var _a;
79
- // allow overriding config name with env variable or --config (or -c)
80
77
  let configName = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config;
81
78
  if (configName === "false") {
82
79
  configName = false;
@@ -106,7 +103,6 @@ export default {
106
103
  const existingConfigs = possibleConfigPaths.filter((path) => {
107
104
  return this.$fs.exists(path);
108
105
  });
109
- // push the first possible config into the "existing" list
110
106
  const hasExistingConfig = !!existingConfigs.length;
111
107
  if (!hasExistingConfig) {
112
108
  this.$logger.trace(`No config file found - falling back to ${possibleConfigPaths[0]}.`);
@@ -199,20 +195,15 @@ export default {
199
195
  singleQuote: true,
200
196
  };
201
197
  this.$logger.trace("updating config, prettier options: ", prettierOptions);
202
- this.$fs.writeFile(configFilePath, (0, prettier_1.format)(newContent, Object.assign(Object.assign({}, prettierOptions), { parser: "typescript",
203
- // note: we don't use plugins here, since we are only formatting ts files, and they are supported by default
204
- // and this also causes issues with certain plugins, like prettier-plugin-tailwindcss.
205
- plugins: [] })));
198
+ this.$fs.writeFile(configFilePath, (0, prettier_1.format)(newContent, Object.assign(Object.assign({}, prettierOptions), { parser: "typescript", plugins: [] })));
206
199
  }
207
200
  catch (error) {
208
201
  this.$logger.error(`Failed to update config.` + error);
209
202
  }
210
203
  finally {
211
- // verify config is updated correctly
212
204
  if (this.getValue(key) !== value) {
213
205
  this.$logger.error(`${os_1.EOL}Failed to update ${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}.${os_1.EOL}`);
214
206
  this.$logger.printMarkdown(`Please manually update \`${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}\` and set \`${key}\` to \`${value}\`.${os_1.EOL}`);
215
- // restore original content
216
207
  this.$fs.writeFile(configFilePath, configContent);
217
208
  return false;
218
209
  }
@@ -242,11 +233,9 @@ export default {
242
233
  ? this.$fs.readJson(info.NSConfigPath)
243
234
  : {};
244
235
  try {
245
- // injecting here to avoid circular dependency
246
236
  const projectData = this.$injector.resolve("projectData");
247
237
  const embeddedPackageJsonPath = path.resolve(this.projectHelper.projectDir, projectData.getAppDirectoryRelativePath(), constants.PACKAGE_JSON_FILE_NAME);
248
238
  const embeddedPackageJson = this.$fs.readJson(embeddedPackageJsonPath);
249
- // filter only the supported keys
250
239
  additionalData.push(_.pick(embeddedPackageJson, [
251
240
  "android",
252
241
  "ios",
@@ -258,11 +247,9 @@ export default {
258
247
  }
259
248
  catch (err) {
260
249
  this.$logger.trace("failed to add embedded package.json data to config", err);
261
- // ignore if the file doesn't exist
262
250
  }
263
251
  try {
264
252
  const packageJson = this.$fs.readJson(path.join(this.projectHelper.projectDir, "package.json"));
265
- // add app id to additionalData for backwards compatibility
266
253
  if (!NSConfig.id &&
267
254
  packageJson &&
268
255
  packageJson.nativescript &&
@@ -286,10 +273,8 @@ export default {
286
273
  }
287
274
  catch (err) {
288
275
  this.$logger.trace("failed to read package.json data for config", err);
289
- // ignore if the file doesn't exist
290
276
  }
291
277
  return _.defaultsDeep({}, ...additionalData, NSConfig);
292
- // return Object.assign({}, ...additionalData, NSConfig);
293
278
  }
294
279
  writeLegacyNSConfigIfNeeded(projectDir, runtimePackage) {
295
280
  return __awaiter(this, void 0, void 0, function* () {
@@ -299,8 +284,6 @@ export default {
299
284
  }
300
285
  if (runtimePackage.version &&
301
286
  semver.gte(semver.coerce(runtimePackage.version), "7.0.0-rc.5")) {
302
- // runtimes >= 7.0.0-rc.5 support passing appPath and appResourcesPath through gradle project flags
303
- // so writing an nsconfig is not necessary.
304
287
  return;
305
288
  }
306
289
  const runtimePackageDisplay = `${runtimePackage.name}${runtimePackage.version ? " v" + runtimePackage.version : ""}`;
@@ -317,11 +300,9 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
317
300
  appPath: this.getValue("appPath"),
318
301
  appResourcesPath: this.getValue("appResourcesPath"),
319
302
  });
320
- // mark the file for cleanup after the CLI exits
321
303
  yield this.$cleanupService.addCleanupDeleteAction(nsConfigPath);
322
304
  });
323
305
  }
324
- // todo: move into config manipulation
325
306
  flattenObjectToPaths(obj, basePath) {
326
307
  const toPath = (key) => [basePath, key].filter(Boolean).join(".");
327
308
  return Object.keys(obj).reduce((all, key) => {
@@ -339,7 +320,7 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
339
320
  }
340
321
  }
341
322
  __decorate([
342
- (0, decorators_1.cache)() // @cache should prevent the message being printed multiple times
323
+ (0, decorators_1.cache)()
343
324
  ], ProjectConfigService.prototype, "warnUsingLegacyNSConfig", null);
344
325
  __decorate([
345
326
  (0, decorators_1.exported)("projectConfigService")
@@ -352,4 +333,3 @@ __decorate([
352
333
  ], ProjectConfigService.prototype, "setValue", null);
353
334
  exports.ProjectConfigService = ProjectConfigService;
354
335
  yok_1.injector.register("projectConfigService", ProjectConfigService);
355
- //# sourceMappingURL=project-config-service.js.map