nativescript 8.9.1 → 8.9.3-dev.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/config/test-deps-versions-generated.json +1 -1
  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 +0 -3
  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 -4
  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 +1 -48
  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/commands/widget.js +1 -20
  52. package/lib/common/bootstrap.js +0 -1
  53. package/lib/common/child-process.js +0 -3
  54. package/lib/common/codeGeneration/code-entity.js +0 -1
  55. package/lib/common/codeGeneration/code-printer.js +0 -1
  56. package/lib/common/command-params.js +0 -1
  57. package/lib/common/commands/analytics.js +0 -3
  58. package/lib/common/commands/autocompletion.js +0 -3
  59. package/lib/common/commands/device/device-log-stream.js +0 -1
  60. package/lib/common/commands/device/get-file.js +0 -2
  61. package/lib/common/commands/device/list-applications.js +0 -1
  62. package/lib/common/commands/device/list-devices.js +0 -3
  63. package/lib/common/commands/device/list-files.js +0 -2
  64. package/lib/common/commands/device/put-file.js +0 -2
  65. package/lib/common/commands/device/run-application.js +0 -1
  66. package/lib/common/commands/device/stop-application.js +0 -1
  67. package/lib/common/commands/device/uninstall-application.js +0 -1
  68. package/lib/common/commands/doctor.js +2 -3
  69. package/lib/common/commands/generate-messages.js +0 -1
  70. package/lib/common/commands/help.js +0 -1
  71. package/lib/common/commands/package-manager-get.js +0 -1
  72. package/lib/common/commands/package-manager-set.js +0 -1
  73. package/lib/common/commands/post-install.js +0 -1
  74. package/lib/common/commands/preuninstall.js +2 -11
  75. package/lib/common/commands/proxy/proxy-base.js +0 -4
  76. package/lib/common/commands/proxy/proxy-clear.js +0 -1
  77. package/lib/common/commands/proxy/proxy-get.js +0 -1
  78. package/lib/common/commands/proxy/proxy-set.js +0 -1
  79. package/lib/common/common-lib.js +0 -1
  80. package/lib/common/constants.js +0 -11
  81. package/lib/common/decorators.js +0 -48
  82. package/lib/common/dispatchers.js +1 -10
  83. package/lib/common/errors.js +3 -13
  84. package/lib/common/file-system.js +2 -13
  85. package/lib/common/header.js +0 -3
  86. package/lib/common/helpers.js +3 -89
  87. package/lib/common/host-info.js +0 -4
  88. package/lib/common/http-client.js +0 -20
  89. package/lib/common/logger/appenders/cli-appender.js +0 -4
  90. package/lib/common/logger/appenders/emit-appender.js +0 -4
  91. package/lib/common/logger/layouts/cli-layout.js +0 -1
  92. package/lib/common/logger/logger.js +0 -5
  93. package/lib/common/messages/messages.js +0 -6
  94. package/lib/common/mobile/android/android-application-manager.js +1 -20
  95. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
  96. package/lib/common/mobile/android/android-debug-bridge.js +0 -6
  97. package/lib/common/mobile/android/android-device-file-system.js +0 -4
  98. package/lib/common/mobile/android/android-device-hash-service.js +0 -3
  99. package/lib/common/mobile/android/android-device.js +0 -8
  100. package/lib/common/mobile/android/android-emulator-services.js +1 -2
  101. package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
  102. package/lib/common/mobile/android/android-log-filter.js +0 -4
  103. package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
  104. package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
  105. package/lib/common/mobile/android/genymotion/genymotion-service.js +1 -6
  106. package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
  107. package/lib/common/mobile/android/logcat-helper.js +0 -13
  108. package/lib/common/mobile/application-manager-base.js +0 -6
  109. package/lib/common/mobile/device-emitter.js +0 -4
  110. package/lib/common/mobile/device-log-emitter.js +0 -1
  111. package/lib/common/mobile/device-log-provider-base.js +0 -1
  112. package/lib/common/mobile/device-log-provider.js +0 -23
  113. package/lib/common/mobile/device-platforms-constants.js +0 -1
  114. package/lib/common/mobile/emulator-helper.js +0 -3
  115. package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
  116. package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
  117. package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
  118. package/lib/common/mobile/ios/device/ios-device.js +0 -4
  119. package/lib/common/mobile/ios/ios-device-base.js +0 -1
  120. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
  121. package/lib/common/mobile/ios/ios-log-filter.js +0 -1
  122. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
  123. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
  124. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
  125. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
  126. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
  127. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
  128. package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
  129. package/lib/common/mobile/log-filter.js +0 -2
  130. package/lib/common/mobile/logging-levels.js +0 -1
  131. package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
  132. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
  133. package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
  134. package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
  135. package/lib/common/mobile/mobile-core/devices-service.js +0 -69
  136. package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
  137. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
  138. package/lib/common/mobile/mobile-helper.js +0 -1
  139. package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
  140. package/lib/common/opener.js +0 -1
  141. package/lib/common/os-info.js +0 -1
  142. package/lib/common/plist-parser.js +0 -1
  143. package/lib/common/project-helper.js +0 -1
  144. package/lib/common/prompter.js +1 -9
  145. package/lib/common/queue.js +0 -1
  146. package/lib/common/resource-loader.js +0 -1
  147. package/lib/common/services/auto-completion-service.js +1 -13
  148. package/lib/common/services/cancellation.js +1 -2
  149. package/lib/common/services/commands-service.js +6 -17
  150. package/lib/common/services/help-service.js +3 -11
  151. package/lib/common/services/hooks-service.js +0 -13
  152. package/lib/common/services/ios-notification-service.js +0 -1
  153. package/lib/common/services/json-file-settings-service.js +0 -6
  154. package/lib/common/services/lock-service.js +0 -6
  155. package/lib/common/services/message-contract-generator.js +0 -1
  156. package/lib/common/services/messages-service.js +0 -1
  157. package/lib/common/services/micro-templating-service.js +0 -6
  158. package/lib/common/services/net-service.js +0 -3
  159. package/lib/common/services/project-files-manager.js +0 -5
  160. package/lib/common/services/project-files-provider-base.js +0 -1
  161. package/lib/common/services/proxy-service.js +0 -1
  162. package/lib/common/services/qr.js +0 -1
  163. package/lib/common/services/settings-service.js +0 -1
  164. package/lib/common/services/xcode-select-service.js +0 -1
  165. package/lib/common/utils.js +0 -1
  166. package/lib/common/validators/project-name-validator.js +0 -1
  167. package/lib/common/validators/validation-result.js +0 -1
  168. package/lib/common/verify-node-version.js +1 -8
  169. package/lib/common/yok.js +11 -32
  170. package/lib/config.js +1 -22
  171. package/lib/constants-provider.js +0 -1
  172. package/lib/constants.js +0 -53
  173. package/lib/controllers/build-controller.js +3 -4
  174. package/lib/controllers/debug-controller.js +3 -8
  175. package/lib/controllers/deploy-controller.js +0 -1
  176. package/lib/controllers/migrate-controller.js +4 -90
  177. package/lib/controllers/platform-controller.js +1 -9
  178. package/lib/controllers/prepare-controller.js +4 -17
  179. package/lib/controllers/run-controller.js +1 -17
  180. package/lib/controllers/update-controller-base.js +0 -1
  181. package/lib/controllers/update-controller.js +0 -11
  182. package/lib/data/build-data.js +0 -1
  183. package/lib/data/controller-data-base.js +0 -1
  184. package/lib/data/debug-data.js +0 -1
  185. package/lib/data/platform-data.js +0 -1
  186. package/lib/data/prepare-data.js +0 -1
  187. package/lib/data/run-data.js +0 -1
  188. package/lib/definitions/project.d.ts +7 -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 +4 -5
  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 -144
  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 +4 -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 +2 -31
  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 +0 -1
  235. package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
  236. package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
  237. package/lib/services/apple-portal/srp/srp-wrapper.js +1 -4
  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 +0 -4
  255. package/lib/services/ios/ios-signing-service.js +0 -4
  256. package/lib/services/ios/spm-service.js +0 -11
  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 +1 -2
  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 +1 -91
  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 -21
  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 +35 -57
  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 +1 -1
@@ -16,8 +16,7 @@ const constants_1 = require("../../constants");
16
16
  const yok_1 = require("../../common/yok");
17
17
  const package_path_helper_1 = require("../../helpers/package-path-helper");
18
18
  class WebpackCompilerService extends events_1.EventEmitter {
19
- constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager // private $sharedEventBus: ISharedEventBus
20
- ) {
19
+ constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager, $projectConfigService) {
21
20
  super();
22
21
  this.$options = $options;
23
22
  this.$errors = $errors;
@@ -30,6 +29,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
30
29
  this.$cleanupService = $cleanupService;
31
30
  this.$packageManager = $packageManager;
32
31
  this.$packageInstallationManager = $packageInstallationManager;
32
+ this.$projectConfigService = $projectConfigService;
33
33
  this.webpackProcesses = {};
34
34
  this.expectedHashes = {};
35
35
  }
@@ -51,23 +51,14 @@ class WebpackCompilerService extends events_1.EventEmitter {
51
51
  });
52
52
  childProcess.on("message", (message) => {
53
53
  this.$logger.trace("Message from webpack", message);
54
- // if we are on webpack5 - we handle HMR in a slightly different way
55
54
  if (typeof message === "object" &&
56
55
  "version" in message &&
57
56
  "type" in message) {
58
- // first compilation can be ignored because it will be synced regardless
59
- // handling it here would trigger 2 syncs
60
57
  if (isFirstWebpackWatchCompilation) {
61
58
  isFirstWebpackWatchCompilation = false;
62
59
  resolve(childProcess);
63
60
  return;
64
61
  }
65
- // if ((message as IWebpackMessage).type === "hmr-status") {
66
- // // we pass message through our event-bus to be handled wherever needed
67
- // // in this case webpack-hmr-status-service listens for this event
68
- // this.$sharedEventBus.emit("webpack:hmr-status", message);
69
- // return;
70
- // }
71
62
  return this.handleHMRMessage(message, platformData, projectData, prepareData);
72
63
  }
73
64
  if (message === "Webpack compilation complete.") {
@@ -82,7 +73,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
82
73
  prepareData.hmr ? message.hash : "";
83
74
  return;
84
75
  }
85
- // Persist the previousHash value before calling `this.getUpdatedEmittedFiles` as it will modify the expectedHashes object with the current hash
86
76
  const previousHash = this.expectedHashes[platformData.platformNameLowerCase];
87
77
  let result;
88
78
  if (prepareData.hmr) {
@@ -107,7 +97,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
107
97
  platform: platformData.platformNameLowerCase,
108
98
  };
109
99
  this.$logger.trace("Generated data from webpack message:", data);
110
- // the hash of the compilation is the same as the previous one and there are only hot updates produced
111
100
  if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) {
112
101
  return;
113
102
  }
@@ -180,16 +169,20 @@ class WebpackCompilerService extends events_1.EventEmitter {
180
169
  }
181
170
  }
182
171
  async shouldUsePreserveSymlinksOption() {
183
- // pnpm does not require symlink (https://github.com/nodejs/node-eps/issues/46#issuecomment-277373566)
184
- // and it also does not work in some cases.
185
- // Check https://github.com/NativeScript/nativescript-cli/issues/5259 for more information
186
172
  const currentPackageManager = await this.$packageManager.getPackageManagerName();
187
173
  const res = currentPackageManager !== constants_1.PackageManagers.pnpm;
188
174
  return res;
189
175
  }
190
176
  async startWebpackProcess(platformData, projectData, prepareData) {
191
- if (!this.$fs.exists(projectData.webpackConfigPath)) {
192
- this.$errors.fail(`The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${constants_1.CONFIG_FILE_NAME_DISPLAY}.`);
177
+ if (projectData.bundlerConfigPath) {
178
+ if (!this.$fs.exists(projectData.bundlerConfigPath)) {
179
+ this.$errors.fail(`The bundler configuration file ${projectData.bundlerConfigPath} does not exist. Ensure the file exists, or update the path in ${constants_1.CONFIG_FILE_NAME_DISPLAY}.`);
180
+ }
181
+ }
182
+ else {
183
+ if (!this.$fs.exists(projectData.webpackConfigPath)) {
184
+ this.$errors.fail(`The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${constants_1.CONFIG_FILE_NAME_DISPLAY}.`);
185
+ }
193
186
  }
194
187
  const envData = this.buildEnvData(platformData.platformNameLowerCase, projectData, prepareData);
195
188
  const envParams = await this.buildEnvCommandLineParams(envData, platformData, projectData, prepareData);
@@ -203,8 +196,8 @@ class WebpackCompilerService extends events_1.EventEmitter {
203
196
  const args = [
204
197
  ...additionalNodeArgs,
205
198
  this.getWebpackExecutablePath(projectData),
206
- this.isWebpack5(projectData) ? `build` : null,
207
- `--config=${projectData.webpackConfigPath}`,
199
+ this.isModernBundler(projectData) ? `build` : null,
200
+ `--config=${projectData.bundlerConfigPath || projectData.webpackConfigPath}`,
208
201
  ...envParams,
209
202
  ].filter(Boolean);
210
203
  if (prepareData.watch) {
@@ -245,28 +238,16 @@ class WebpackCompilerService extends events_1.EventEmitter {
245
238
  });
246
239
  envData.verbose = envData.verbose || this.$logger.isVerbose();
247
240
  envData.production = envData.production || prepareData.release;
248
- // add the config file name to the env data so the webpack process can read the
249
- // correct config file when resolving the CLI lib and the config service
250
- // we are explicitly setting it to false to force using the defaults
251
241
  envData.config =
252
242
  (_b = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config) !== null && _b !== void 0 ? _b : "false";
253
- // explicitly set the env variable
254
243
  process.env.NATIVESCRIPT_CONFIG_NAME = envData.config;
255
- // The snapshot generation is wrongly located in the Webpack plugin.
256
- // It should be moved in the Native Prepare of the CLI or a Gradle task in the Runtime.
257
- // As a workaround, we skip the mksnapshot, xxd and android-ndk calls based on skipNativePrepare.
258
- // In this way the plugin will prepare only the snapshot JS entry without any native prepare and
259
- // we will able to execute cloud builds with snapshot without having any local snapshot or Docker setup.
260
- // TODO: Remove this flag when we remove the native part from the plugin.
261
244
  envData.skipSnapshotTools =
262
245
  prepareData.nativePrepare && prepareData.nativePrepare.skipNativePrepare;
263
- // only set sourceMap if not explicitly set through a flag
264
246
  if (typeof ((_c = prepareData === null || prepareData === void 0 ? void 0 : prepareData.env) === null || _c === void 0 ? void 0 : _c.sourceMap) === "undefined") {
265
247
  if (!prepareData.release) {
266
248
  envData.sourceMap = true;
267
249
  }
268
250
  }
269
- // convert string to boolean
270
251
  if (envData.sourceMap === "true" || envData.sourceMap === "false") {
271
252
  envData.sourceMap = envData.sourceMap === "true";
272
253
  }
@@ -318,15 +299,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
318
299
  }
319
300
  getUpdatedEmittedFiles(allEmittedFiles, chunkFiles, nextHash, platform) {
320
301
  const currentHash = this.getCurrentHotUpdateHash(allEmittedFiles);
321
- // This logic is needed as there are already cases when webpack doesn't emit any files physically.
322
- // We've set noEmitOnErrors in webpack.config.js based on noEmitOnError from tsconfig.json,
323
- // so webpack doesn't emit any files when noEmitOnErrors: true is set in webpack.config.js and
324
- // there is a compilation error in the source code. On the other side, hmr generates new hot-update files
325
- // on every change and the hash of the next hmr update is written inside hot-update.json file.
326
- // Although webpack doesn't emit any files, hmr hash is still generated. The hash is generated per compilation no matter
327
- // if files will be emitted or not. This way, the first successful compilation after fixing the compilation error generates
328
- // a hash that is not the same as the one expected in the latest emitted hot-update.json file.
329
- // As a result, the hmr chain is broken and the changes are not applied.
330
302
  const isHashValid = nextHash
331
303
  ? this.expectedHashes[platform] === currentHash
332
304
  : true;
@@ -345,7 +317,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
345
317
  let hotHash;
346
318
  const hotUpdateScripts = emittedFiles.filter((x) => x.endsWith(".hot-update.js"));
347
319
  if (hotUpdateScripts && hotUpdateScripts.length) {
348
- // the hash is the same for each hot update in the current compilation
349
320
  const hotUpdateName = hotUpdateScripts[0];
350
321
  const matcher = /^(.+)\.(.+)\.hot-update/gm;
351
322
  const matches = matcher.exec(hotUpdateName);
@@ -363,7 +334,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
363
334
  }
364
335
  }
365
336
  handleHMRMessage(message, platformData, projectData, prepareData) {
366
- // handle new webpack hmr packets
367
337
  this.$logger.trace("Received message from webpack process:", message);
368
338
  if (message.type !== "compilation") {
369
339
  return;
@@ -371,7 +341,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
371
341
  this.$logger.trace("Webpack build done!");
372
342
  const files = message.data.emittedAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
373
343
  const staleFiles = message.data.staleAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
374
- // extract last hash from emitted filenames
375
344
  const lastHash = (() => {
376
345
  const absoluteFileNameWithLastHash = files.find((fileName) => fileName.endsWith("hot-update.js"));
377
346
  if (!absoluteFileNameWithLastHash) {
@@ -384,7 +353,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
384
353
  }
385
354
  })();
386
355
  if (!files.length) {
387
- // ignore compilations if no new files are emitted
388
356
  return;
389
357
  }
390
358
  this.emit(constants_1.WEBPACK_COMPILATION_COMPLETE, {
@@ -399,8 +367,9 @@ class WebpackCompilerService extends events_1.EventEmitter {
399
367
  });
400
368
  }
401
369
  getWebpackExecutablePath(projectData) {
402
- if (this.isWebpack5(projectData)) {
403
- const packagePath = (0, package_path_helper_1.resolvePackagePath)("@nativescript/webpack", {
370
+ const bundler = this.getBundler();
371
+ if (this.isModernBundler(projectData)) {
372
+ const packagePath = (0, package_path_helper_1.resolvePackagePath)(`@nativescript/${bundler}`, {
404
373
  paths: [projectData.projectDir],
405
374
  });
406
375
  if (packagePath) {
@@ -415,23 +384,32 @@ class WebpackCompilerService extends events_1.EventEmitter {
415
384
  }
416
385
  return path.resolve(packagePath, "bin", "webpack.js");
417
386
  }
418
- isWebpack5(projectData) {
419
- const packageJSONPath = (0, package_path_helper_1.resolvePackageJSONPath)("@nativescript/webpack", {
420
- paths: [projectData.projectDir],
421
- });
422
- if (packageJSONPath) {
423
- const packageData = this.$fs.readJson(packageJSONPath);
424
- const ver = semver.coerce(packageData.version);
425
- if (semver.satisfies(ver, ">= 5.0.0")) {
387
+ isModernBundler(projectData) {
388
+ const bundler = this.getBundler();
389
+ switch (bundler) {
390
+ case "rspack":
426
391
  return true;
427
- }
392
+ default:
393
+ const packageJSONPath = (0, package_path_helper_1.resolvePackageJSONPath)("@nativescript/webpack", {
394
+ paths: [projectData.projectDir],
395
+ });
396
+ if (packageJSONPath) {
397
+ const packageData = this.$fs.readJson(packageJSONPath);
398
+ const ver = semver.coerce(packageData.version);
399
+ if (semver.satisfies(ver, ">= 5.0.0")) {
400
+ return true;
401
+ }
402
+ }
403
+ break;
428
404
  }
429
405
  return false;
430
406
  }
407
+ getBundler() {
408
+ return this.$projectConfigService.getValue(`bundler`, "webpack");
409
+ }
431
410
  }
432
411
  exports.WebpackCompilerService = WebpackCompilerService;
433
412
  __decorate([
434
413
  (0, decorators_1.performanceLog)()
435
414
  ], WebpackCompilerService.prototype, "startWebpackProcess", null);
436
415
  yok_1.injector.register("webpackCompilerService", WebpackCompilerService);
437
- //# sourceMappingURL=webpack-compiler-service.js.map
@@ -55,7 +55,6 @@ class XcconfigService {
55
55
  }
56
56
  });
57
57
  if (isPropertyParsed) {
58
- // property can be an empty string, so we don't check for that.
59
58
  return property;
60
59
  }
61
60
  }
@@ -64,4 +63,3 @@ class XcconfigService {
64
63
  }
65
64
  exports.XcconfigService = XcconfigService;
66
65
  yok_1.injector.register("xcconfigService", XcconfigService);
67
- //# sourceMappingURL=xcconfig-service.js.map
@@ -21,4 +21,3 @@ class XcprojService {
21
21
  }
22
22
  }
23
23
  yok_1.injector.register("xcprojService", XcprojService);
24
- //# sourceMappingURL=xcproj-service.js.map
@@ -2,12 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const events_1 = require("events");
4
4
  const yok_1 = require("./common/yok");
5
- /**
6
- * Event Bus used by different services to emit state changes and
7
- * allow listening for these state changes without needing a reference
8
- * to the emitting service.
9
- */
10
5
  class SharedEventBus extends events_1.EventEmitter {
11
6
  }
12
7
  yok_1.injector.register("sharedEventBus", SharedEventBus);
13
- //# sourceMappingURL=shared-event-bus.js.map
package/lib/sys-info.js CHANGED
@@ -79,7 +79,7 @@ class SysInfo {
79
79
  if (macOSVersion && macOSVersion < constants_1.MacOSVersions.HighSierra) {
80
80
  return {
81
81
  message: (0, util_1.format)(constants_1.MacOSDeprecationStringFormat, macOSVersion),
82
- severity: "high" /* SystemWarningsSeverity.high */,
82
+ severity: "high",
83
83
  };
84
84
  }
85
85
  return null;
@@ -101,4 +101,3 @@ __decorate([
101
101
  (0, decorators_1.exported)("sysInfo")
102
102
  ], SysInfo.prototype, "getSupportedNodeVersionRange", null);
103
103
  yok_1.injector.register("sysInfo", SysInfo);
104
- //# sourceMappingURL=sys-info.js.map
@@ -55,7 +55,6 @@ class ConfigTransformer {
55
55
  const parts = key.split(".");
56
56
  const name = parts.shift();
57
57
  const property = this.getProperty(name, parent);
58
- // no android key, add it to parent to root
59
58
  if (!property) {
60
59
  return undefined;
61
60
  }
@@ -65,14 +64,11 @@ class ConfigTransformer {
65
64
  if (!_parent) {
66
65
  return undefined;
67
66
  }
68
- // add nonExistent.deep to android: {}
69
67
  return this.getProperty(parts.join("."), _parent);
70
68
  }
71
- // if we have a parent, we are reading the property from it
72
69
  if (parent) {
73
70
  return parent.getProperty(key);
74
71
  }
75
- // otherwise we just read it from the root exports object
76
72
  return this.getProperty(key, this.getDefaultExportValue());
77
73
  }
78
74
  addProperty(key, value, parent = null) {
@@ -194,22 +190,15 @@ class ConfigTransformer {
194
190
  }
195
191
  this.setInitializerValue(initializer, newValue);
196
192
  }
197
- /**
198
- * @internal
199
- */
200
193
  getFullText() {
201
194
  return this.config.getFullText();
202
195
  }
203
- /**
204
- * @internal
205
- */
206
196
  getValue(key) {
207
197
  return this.getPropertyValue(this.getProperty(key));
208
198
  }
209
199
  setValue(key, value) {
210
200
  const property = this.getProperty(key);
211
201
  if (!property) {
212
- // add new property
213
202
  this.addProperty(key, value);
214
203
  }
215
204
  else {
@@ -219,4 +208,3 @@ class ConfigTransformer {
219
208
  }
220
209
  }
221
210
  exports.ConfigTransformer = ConfigTransformer;
222
- //# sourceMappingURL=config-transformer.js.map
@@ -29,4 +29,3 @@ class NodeModulesBuilder {
29
29
  }
30
30
  exports.NodeModulesBuilder = NodeModulesBuilder;
31
31
  yok_1.injector.register("nodeModulesBuilder", NodeModulesBuilder);
32
- //# sourceMappingURL=node-modules-builder.js.map
@@ -56,18 +56,14 @@ class NodeModulesDependenciesBuilder {
56
56
  let modulePath = (0, resolve_package_path_1.resolvePackagePath)(depDescription.name, {
57
57
  paths: [parentModulesPath],
58
58
  });
59
- // perhaps traverse up the tree here?
60
59
  if (!modulePath) {
61
- // fallback to searching in the root path
62
60
  modulePath = (0, resolve_package_path_1.resolvePackagePath)(depDescription.name, {
63
61
  paths: [rootPath],
64
62
  });
65
63
  }
66
- // if we failed to find the module...
67
64
  if (!modulePath) {
68
65
  return null;
69
66
  }
70
- // if we already resolved this dependency, we return null to avoid a duplicate resolution
71
67
  if (resolvedDependencies.some((r) => {
72
68
  return r.name === depDescription.name && r.directory === modulePath;
73
69
  })) {
@@ -92,7 +88,6 @@ class NodeModulesDependenciesBuilder {
92
88
  const packageJsonContents = this.$fs.readJson(packageJsonPath);
93
89
  dependency.version = packageJsonContents.version;
94
90
  if (!!packageJsonContents.nativescript) {
95
- // add `nativescript` property, necessary for resolving plugins
96
91
  dependency.nativescript = packageJsonContents.nativescript;
97
92
  }
98
93
  dependency.dependencies = _.keys(packageJsonContents.dependencies);
@@ -103,4 +98,3 @@ class NodeModulesDependenciesBuilder {
103
98
  }
104
99
  exports.NodeModulesDependenciesBuilder = NodeModulesDependenciesBuilder;
105
100
  yok_1.injector.register("nodeModulesDependenciesBuilder", NodeModulesDependenciesBuilder);
106
- //# sourceMappingURL=node-modules-dependencies-builder.js.map
@@ -113,4 +113,3 @@ __decorate([
113
113
  (0, decorators_1.exported)("yarn")
114
114
  ], YarnPackageManager.prototype, "getCachePath", null);
115
115
  yok_1.injector.register("yarn", YarnPackageManager);
116
- //# sourceMappingURL=yarn-package-manager.js.map
@@ -36,8 +36,6 @@ class Yarn2PackageManager extends base_package_manager_1.BasePackageManager {
36
36
  }
37
37
  const packageJsonPath = path.join(pathToSave, "package.json");
38
38
  const jsonContentBefore = this.$fs.readJson(packageJsonPath);
39
- // remove unsupported flags
40
- // todo: refactor all package managers to map typed flags to the actual flags
41
39
  const cleanedConfig = _.omit(config, ["save-dev", "save-exact"]);
42
40
  const flags = this.getFlagsString(cleanedConfig, true);
43
41
  let params = [];
@@ -124,4 +122,3 @@ __decorate([
124
122
  (0, decorators_1.exported)("yarn2")
125
123
  ], Yarn2PackageManager.prototype, "getCachePath", null);
126
124
  yok_1.injector.register("yarn2", Yarn2PackageManager);
127
- //# sourceMappingURL=yarn2-package-manager.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nativescript",
3
3
  "main": "./lib/nativescript-cli-lib.js",
4
- "version": "8.9.1",
4
+ "version": "8.9.3-dev.0",
5
5
  "author": "NativeScript <oss@nativescript.org>",
6
6
  "description": "Command-line interface for building NativeScript projects",
7
7
  "bin": {