nativescript 8.8.3 → 8.9.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/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 +4 -3
@@ -36,14 +36,12 @@ class ProjectDataService {
36
36
  this.$injector = $injector;
37
37
  this.projectDataCache = {};
38
38
  try {
39
- // add the ProjectData of the default projectDir to the projectData cache
40
39
  const projectData = this.$injector.resolve("projectData");
41
40
  projectData.initializeProjectData();
42
41
  this.defaultProjectDir = projectData.projectDir;
43
42
  this.projectDataCache[this.defaultProjectDir] = projectData;
44
43
  }
45
44
  catch (e) {
46
- // the CLI is required as a lib from a non-project folder
47
45
  }
48
46
  }
49
47
  get $pluginsService() {
@@ -72,8 +70,6 @@ class ProjectDataService {
72
70
  delete projectFileInfo.projectData[ProjectDataService.DEPENDENCIES_KEY_NAME][dependencyName];
73
71
  this.$fs.writeJson(projectFileInfo.projectFilePath, projectFileInfo.projectData);
74
72
  }
75
- // TODO: Add tests
76
- // TODO: Remove $projectData and replace it with $projectDataService.getProjectData
77
73
  getProjectData(projectDir) {
78
74
  projectDir = projectDir || this.defaultProjectDir;
79
75
  this.projectDataCache[projectDir] =
@@ -130,10 +126,6 @@ class ProjectDataService {
130
126
  }
131
127
  getAndroidAssetsStructure(opts) {
132
128
  return __awaiter(this, void 0, void 0, function* () {
133
- // TODO: Use image-size package to get the width and height of an image.
134
- // TODO: Parse the splash_screen.xml in nodpi directory and get from it the names of the background and center image.
135
- // TODO: Parse the AndroidManifest.xml to get the name of the icon.
136
- // This way we'll not use the image-definitions.json and the method will return the real android structure.
137
129
  const projectDir = opts.projectDir;
138
130
  const projectData = this.getProjectData(projectDir);
139
131
  const pathToAndroidDir = path.join(projectData.appResourcesDirectoryPath, this.$devicePlatformsConstants.Android);
@@ -147,7 +139,6 @@ class ProjectDataService {
147
139
  useLegacy = !manifest.includes(`android:icon="@mipmap/ic_launcher"`);
148
140
  }
149
141
  catch (err) {
150
- // ignore
151
142
  }
152
143
  const content = this.getImageDefinitions()[useLegacy ? "android_legacy" : "android"];
153
144
  return {
@@ -172,8 +163,6 @@ class ProjectDataService {
172
163
  }
173
164
  if (fstat.isDirectory()) {
174
165
  if (filePath === pathToProjectNodeModules) {
175
- // we do not want to get the files from node_modules directory of the project.
176
- // We'll get here only when you have nativescript.config with appDirectoryPath set to "."
177
166
  return false;
178
167
  }
179
168
  return true;
@@ -188,9 +177,6 @@ class ProjectDataService {
188
177
  }
189
178
  }
190
179
  updateNsConfigValue(projectDir, updateObject, propertiesToRemove) {
191
- // todo: figure out a way to update js/ts configs
192
- // most likely needs an ast parser/writer
193
- // should be delegated to the config service
194
180
  const nsConfigPath = path.join(projectDir, constants.CONFIG_FILE_NAME_JS);
195
181
  const currentNsConfig = this.getNsConfig(nsConfigPath);
196
182
  let newNsConfig = currentNsConfig;
@@ -232,14 +218,10 @@ class ProjectDataService {
232
218
  const imageDefinitions = this.getImageDefinitions().ios;
233
219
  _.each(content && content.images, (image) => {
234
220
  let foundMatchingDefinition = false;
235
- // In some cases the image may not be available, it will just be described.
236
- // When this happens, the filename will be empty.
237
- // So we'll keep the path empty as well.
238
221
  if (image.filename) {
239
222
  image.path = path.join(dirPath, image.filename);
240
223
  }
241
224
  if (image.size) {
242
- // size is basically <width>x<height>
243
225
  const [width, height] = image.size
244
226
  .toString()
245
227
  .split(constants_1.AssetConstants.sizeDelimiter);
@@ -248,7 +230,6 @@ class ProjectDataService {
248
230
  image.height = +height;
249
231
  }
250
232
  }
251
- // Find the image size based on the hardcoded values in the image-definitions.json
252
233
  _.each(imageDefinitions, (assetSubGroup) => {
253
234
  const assetItem = _.find(assetSubGroup, (assetElement) => assetElement.filename === image.filename &&
254
235
  path.basename(assetElement.directory) === path.basename(dirPath));
@@ -268,7 +249,6 @@ class ProjectDataService {
268
249
  image.scale = image.scale || assetItem.scale;
269
250
  image.rgba = assetItem.rgba;
270
251
  finalContent.images.push(image);
271
- // break each
272
252
  return false;
273
253
  }
274
254
  });
@@ -372,16 +352,13 @@ class ProjectDataService {
372
352
  getRuntimePackage(projectDir, platform) {
373
353
  platform = platform.toLowerCase();
374
354
  const packageJson = this.$fs.readJson(path.join(projectDir, constants.PACKAGE_JSON_FILE_NAME));
375
- const runtimeName = platform === "android" /* PlatformTypes.android */
355
+ const runtimeName = platform === "android"
376
356
  ? constants.TNS_ANDROID_RUNTIME_NAME
377
357
  : constants.TNS_IOS_RUNTIME_NAME;
378
358
  if (packageJson &&
379
359
  packageJson.nativescript &&
380
360
  packageJson.nativescript[runtimeName] &&
381
361
  packageJson.nativescript[runtimeName].version) {
382
- // if we have a nativescript key with a runtime version in package.json
383
- // that means we are dealing with a legacy project, and should respect
384
- // that information
385
362
  return {
386
363
  name: runtimeName,
387
364
  version: packageJson.nativescript[runtimeName].version,
@@ -393,19 +370,19 @@ class ProjectDataService {
393
370
  const runtimePackage = this.$pluginsService
394
371
  .getDependenciesFromPackageJson(projectDir)
395
372
  .devDependencies.find((d) => {
396
- if (platform === "ios" /* constants.PlatformTypes.ios */) {
373
+ if (platform === "ios") {
397
374
  return [
398
375
  constants.SCOPED_IOS_RUNTIME_NAME,
399
376
  constants.TNS_IOS_RUNTIME_NAME,
400
377
  ].includes(d.name);
401
378
  }
402
- else if (platform === "android" /* constants.PlatformTypes.android */) {
379
+ else if (platform === "android") {
403
380
  return [
404
381
  constants.SCOPED_ANDROID_RUNTIME_NAME,
405
382
  constants.TNS_ANDROID_RUNTIME_NAME,
406
383
  ].includes(d.name);
407
384
  }
408
- else if (platform === "visionos" /* constants.PlatformTypes.visionos */) {
385
+ else if (platform === "visionos") {
409
386
  return d.name === constants.SCOPED_VISIONOS_RUNTIME_NAME;
410
387
  }
411
388
  });
@@ -413,14 +390,12 @@ class ProjectDataService {
413
390
  const coerced = semver.coerce(runtimePackage.version);
414
391
  const isRange = !!coerced && coerced.version !== runtimePackage.version;
415
392
  const isTag = !coerced;
416
- // in case we are using a local tgz for the runtime or a range like ~8.0.0, ^8.0.0 etc. or a tag like JSC
417
393
  if (runtimePackage.version.includes("tgz") || isRange || isTag) {
418
394
  try {
419
395
  const runtimePackageJsonPath = (0, package_path_helper_1.resolvePackageJSONPath)(runtimePackage.name, {
420
396
  paths: [projectDir],
421
397
  });
422
398
  if (!runtimePackageJsonPath) {
423
- // caught below
424
399
  throw new Error("Runtime package.json not found.");
425
400
  }
426
401
  runtimePackage.version = this.$fs.readJson(runtimePackageJsonPath).version;
@@ -437,21 +412,20 @@ class ProjectDataService {
437
412
  }
438
413
  return runtimePackage;
439
414
  }
440
- // default to the scoped runtimes
441
415
  this.$logger.trace("Could not find an installed runtime, falling back to default runtimes");
442
- if (platform === "ios" /* constants.PlatformTypes.ios */) {
416
+ if (platform === "ios") {
443
417
  return {
444
418
  name: constants.SCOPED_IOS_RUNTIME_NAME,
445
419
  version: null,
446
420
  };
447
421
  }
448
- else if (platform === "android" /* constants.PlatformTypes.android */) {
422
+ else if (platform === "android") {
449
423
  return {
450
424
  name: constants.SCOPED_ANDROID_RUNTIME_NAME,
451
425
  version: null,
452
426
  };
453
427
  }
454
- else if (platform === "visionos" /* constants.PlatformTypes.visionos */) {
428
+ else if (platform === "visionos") {
455
429
  return {
456
430
  name: constants.SCOPED_VISIONOS_RUNTIME_NAME,
457
431
  version: null,
@@ -485,11 +459,9 @@ __decorate([
485
459
  return projectDir + ":" + platform;
486
460
  },
487
461
  shouldCache(result) {
488
- // don't cache coerced versions
489
462
  if (result._coerced) {
490
463
  return false;
491
464
  }
492
- // only cache if version is defined
493
465
  return !!result.version;
494
466
  },
495
467
  })
@@ -499,4 +471,3 @@ __decorate([
499
471
  ], ProjectDataService.prototype, "getNsConfigDefaultContent", null);
500
472
  exports.ProjectDataService = ProjectDataService;
501
473
  yok_1.injector.register("projectDataService", ProjectDataService);
502
- //# sourceMappingURL=project-data-service.js.map
@@ -65,4 +65,3 @@ class ProjectNameService {
65
65
  }
66
66
  exports.ProjectNameService = ProjectNameService;
67
67
  yok_1.injector.register("projectNameService", ProjectNameService);
68
- //# sourceMappingURL=project-name-service.js.map
@@ -76,15 +76,11 @@ class ProjectService {
76
76
  appId: appId,
77
77
  projectName,
78
78
  });
79
- // can pass --no-git to skip creating a git repo
80
- // useful in monorepos where we're creating
81
- // sub projects in an existing git repo.
82
79
  if (this.$options.git) {
83
80
  try {
84
81
  if (!this.$options.force) {
85
82
  const git = (0, simple_git_1.default)(projectDir);
86
83
  if (yield git.checkIsRepo()) {
87
- // throwing here since we're catching below.
88
84
  throw new Error("Already part of a git repository.");
89
85
  }
90
86
  }
@@ -126,7 +122,6 @@ class ProjectService {
126
122
  this.alterPackageJsonData(projectCreationSettings);
127
123
  this.$projectConfigService.writeDefaultConfig(projectDir, appId);
128
124
  yield this.ensureAppResourcesExist(projectDir);
129
- // Install devDependencies and execute all scripts:
130
125
  yield this.$packageManager.install(projectDir, projectDir, {
131
126
  disableNpmInstall: false,
132
127
  frameworkPath: null,
@@ -160,7 +155,6 @@ class ProjectService {
160
155
  this.$logger.trace("Project does not have App_Resources - fetching from default template.");
161
156
  this.$fs.createDirectory(appResourcesDestinationPath);
162
157
  const tempDir = yield this.$tempService.mkdirSync("ns-default-template");
163
- // the template installed doesn't have App_Resources -> get from a default template
164
158
  yield this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], tempDir);
165
159
  const templateProjectData = this.$projectDataService.getProjectData(tempDir);
166
160
  const templateAppResourcesDir = templateProjectData.getAppResourcesDirectoryPath(tempDir);
@@ -172,14 +166,12 @@ class ProjectService {
172
166
  const { projectDir, projectName } = projectCreationSettings;
173
167
  const projectFilePath = path.join(projectDir, this.$staticConfig.PROJECT_FILE_NAME);
174
168
  let packageJsonData = this.$fs.readJson(projectFilePath);
175
- // clean up keys from the template package.json that we don't care about.
176
169
  Object.keys(packageJsonData).forEach((key) => {
177
170
  if (key.startsWith("_") ||
178
171
  constants.TemplatesV2PackageJsonKeysToRemove.includes(key)) {
179
172
  delete packageJsonData[key];
180
173
  }
181
174
  });
182
- // this is used to ensure the order of keys is consistent, the blanks are filled in from the template
183
175
  const packageJsonSchema = {
184
176
  name: projectName,
185
177
  main: "",
@@ -187,7 +179,6 @@ class ProjectService {
187
179
  private: true,
188
180
  dependencies: {},
189
181
  devDependencies: {},
190
- // anythign else would go below
191
182
  };
192
183
  packageJsonData = Object.assign(packageJsonSchema, packageJsonData);
193
184
  this.$fs.writeJson(projectFilePath, packageJsonData);
@@ -211,4 +202,3 @@ __decorate([
211
202
  ], ProjectService.prototype, "alterPackageJsonData", null);
212
203
  exports.ProjectService = ProjectService;
213
204
  yok_1.injector.register("projectService", ProjectService);
214
- //# sourceMappingURL=project-service.js.map
@@ -50,12 +50,12 @@ class ProjectTemplatesService {
50
50
  const templateNameToBeTracked = this.getTemplateNameToBeTracked(templateValue, templatePackageJsonContent);
51
51
  if (templateNameToBeTracked) {
52
52
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
53
- action: "Create project" /* constants.TrackActionNames.CreateProject */,
53
+ action: "Create project",
54
54
  isForDevice: null,
55
55
  additionalData: templateNameToBeTracked,
56
56
  });
57
57
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
58
- action: "Using Template" /* constants.TrackActionNames.UsingTemplate */,
58
+ action: "Using Template",
59
59
  additionalData: templateNameToBeTracked,
60
60
  });
61
61
  }
@@ -112,4 +112,3 @@ __decorate([
112
112
  ], ProjectTemplatesService.prototype, "prepareTemplate", null);
113
113
  exports.ProjectTemplatesService = ProjectTemplatesService;
114
114
  yok_1.injector.register("projectTemplatesService", ProjectTemplatesService);
115
- //# sourceMappingURL=project-templates-service.js.map
@@ -18,4 +18,3 @@ class QrCodeTerminalService {
18
18
  }
19
19
  exports.QrCodeTerminalService = QrCodeTerminalService;
20
20
  yok_1.injector.register("qrCodeTerminalService", QrCodeTerminalService);
21
- //# sourceMappingURL=qr-code-terminal-service.js.map
@@ -9,4 +9,3 @@ class RequireService {
9
9
  }
10
10
  exports.RequireService = RequireService;
11
11
  yok_1.injector.register("requireService", RequireService);
12
- //# sourceMappingURL=require-service.js.map
@@ -114,4 +114,3 @@ class StartService {
114
114
  }
115
115
  exports.default = StartService;
116
116
  yok_1.injector.register("startService", StartService);
117
- //# sourceMappingURL=start-service.js.map
@@ -34,4 +34,3 @@ class TempService {
34
34
  }
35
35
  exports.TempService = TempService;
36
36
  yok_1.injector.register("tempService", TempService);
37
- //# sourceMappingURL=temp-service.js.map
@@ -14,7 +14,6 @@ const ora = require("ora");
14
14
  const yok_1 = require("../common/yok");
15
15
  class TerminalSpinnerService {
16
16
  createSpinner(spinnerOptions = {}) {
17
- // @ts-expect-error - options are readonly, however we still want to override them before passing them on...
18
17
  spinnerOptions.stream = spinnerOptions.stream || process.stdout;
19
18
  return ora(spinnerOptions);
20
19
  }
@@ -37,4 +36,3 @@ class TerminalSpinnerService {
37
36
  }
38
37
  exports.TerminalSpinnerService = TerminalSpinnerService;
39
38
  yok_1.injector.register("terminalSpinnerService", TerminalSpinnerService);
40
- //# sourceMappingURL=terminal-spinner-service.js.map
@@ -34,10 +34,8 @@ class TestExecutionService {
34
34
  platform = platform.toLowerCase();
35
35
  this.platform = platform;
36
36
  const projectData = this.$projectDataService.getProjectData(liveSyncInfo.projectDir);
37
- // We need the dependencies installed here, so we can start the Karma server.
38
37
  yield this.$pluginsService.ensureAllDependenciesAreInstalled(projectData);
39
38
  const karmaConfig = this.getKarmaConfiguration(platform, projectData);
40
- // In case you want to debug the unit test runner, add "--inspect-brk=<port>" as a first element in the array of args.
41
39
  const karmaRunner = this.$childProcess.spawn(process.execPath, [path.join(__dirname, "karma-execution.js")], { stdio: ["inherit", "inherit", "inherit", "ipc"] });
42
40
  const launchKarmaTests = (karmaData) => __awaiter(this, void 0, void 0, function* () {
43
41
  this.$logger.trace("## Unit-testing: Parent process received message", karmaData);
@@ -54,8 +52,6 @@ class TestExecutionService {
54
52
  const configJs = this.generateConfig(port, configOptions);
55
53
  this.$fs.writeFile(path.join(liveSyncInfo.projectDir, TestExecutionService.CONFIG_FILE_NAME), configJs);
56
54
  }
57
- // Prepare the project AFTER the TestExecutionService.CONFIG_FILE_NAME file is created in node_modules
58
- // so it will be sent to device.
59
55
  yield this.$runController.run({
60
56
  liveSyncInfo,
61
57
  deviceDescriptors,
@@ -68,13 +64,12 @@ class TestExecutionService {
68
64
  }
69
65
  launchKarmaTests(karmaData).catch((result) => {
70
66
  this.$logger.error(result);
71
- process.exit(130 /* ErrorCodes.KARMA_FAIL */);
67
+ process.exit(130);
72
68
  });
73
69
  });
74
70
  return new Promise((resolve, reject) => {
75
71
  karmaRunner.on("exit", (exitCode) => {
76
72
  if (exitCode !== 0) {
77
- //End our process with a non-zero exit code
78
73
  const testError = new Error("Test run failed.");
79
74
  reject(testError);
80
75
  }
@@ -89,7 +84,7 @@ class TestExecutionService {
89
84
  canStartKarmaServer(projectData) {
90
85
  return __awaiter(this, void 0, void 0, function* () {
91
86
  let canStartKarmaServer = true;
92
- const requiredDependencies = ["@nativescript/unit-test-runner"]; // we need @nativescript/unit-test-runner at the local level because of hooks!
87
+ const requiredDependencies = ["@nativescript/unit-test-runner"];
93
88
  _.each(requiredDependencies, (dep) => {
94
89
  if (!projectData.dependencies[dep] && !projectData.devDependencies[dep]) {
95
90
  canStartKarmaServer = false;
@@ -139,7 +134,6 @@ class TestExecutionService {
139
134
  karmaConfig.logLevel = "DEBUG";
140
135
  }
141
136
  if (!this.$options.watch) {
142
- // Setting singleRun to true will automatically start the tests when new browser (device in our case) is registered in karma.
143
137
  karmaConfig.singleRun = true;
144
138
  }
145
139
  if (this.$options.debugBrk) {
@@ -158,4 +152,3 @@ TestExecutionService.CONFIG_FILE_NAME = `node_modules/${constants.TEST_RUNNER_NA
158
152
  TestExecutionService.SOCKETIO_JS_FILE_NAME = `node_modules/${constants.TEST_RUNNER_NAME}/socket.io.js`;
159
153
  exports.TestExecutionService = TestExecutionService;
160
154
  yok_1.injector.register("testExecutionService", TestExecutionService);
161
- //# sourceMappingURL=test-execution-service.js.map
@@ -34,9 +34,6 @@ class TestInitializationService {
34
34
  });
35
35
  return targetFrameworkDependencies;
36
36
  }
37
- /**
38
- * This method is used from test-init.md file so it is not allowed to use "this" inside the method's body.
39
- */
40
37
  getFrameworkNames() {
41
38
  const configsPath = path.join(__dirname, "..", "..", "config");
42
39
  const dependenciesPath = path.join(configsPath, "test-dependencies.json");
@@ -55,4 +52,3 @@ __decorate([
55
52
  ], TestInitializationService.prototype, "getFrameworkNames", null);
56
53
  exports.TestInitializationService = TestInitializationService;
57
54
  yok_1.injector.register("testInitializationService", TestInitializationService);
58
- //# sourceMappingURL=test-initialization-service.js.map
@@ -98,4 +98,3 @@ __decorate([
98
98
  ], TimelineProfilerService.prototype, "isEnabled", null);
99
99
  exports.TimelineProfilerService = TimelineProfilerService;
100
100
  yok_1.injector.register("timelineProfilerService", TimelineProfilerService);
101
- //# sourceMappingURL=timeline-profiler-service.js.map
@@ -32,4 +32,3 @@ class UserSettingsService {
32
32
  }
33
33
  exports.UserSettingsService = UserSettingsService;
34
34
  yok_1.injector.register("userSettingsService", UserSettingsService);
35
- //# sourceMappingURL=user-settings-service.js.map
@@ -59,7 +59,6 @@ class VersionsService {
59
59
  const tnsCoreModulesPath = path.join(nodeModulesPath, constants.TNS_CORE_MODULES_NAME);
60
60
  const dependsOnNonScopedPackage = !!this.projectData.dependencies[constants.TNS_CORE_MODULES_NAME];
61
61
  const dependsOnScopedPackage = !!this.projectData.dependencies[constants.SCOPED_TNS_CORE_MODULES];
62
- // ensure the dependencies are installed, so we can get their actual versions from node_modules
63
62
  if (!this.$fs.exists(nodeModulesPath) ||
64
63
  (dependsOnNonScopedPackage && !this.$fs.exists(tnsCoreModulesPath)) ||
65
64
  (dependsOnScopedPackage && !this.$fs.exists(scopedPackagePath))) {
@@ -88,16 +87,16 @@ class VersionsService {
88
87
  }
89
88
  getRuntimesVersions(platform) {
90
89
  return __awaiter(this, void 0, void 0, function* () {
91
- const iosRuntime = this.$projectDataService.getRuntimePackage(this.projectData.projectDir, "ios" /* constants.PlatformTypes.ios */);
92
- const androidRuntime = this.$projectDataService.getRuntimePackage(this.projectData.projectDir, "android" /* constants.PlatformTypes.android */);
90
+ const iosRuntime = this.$projectDataService.getRuntimePackage(this.projectData.projectDir, "ios");
91
+ const androidRuntime = this.$projectDataService.getRuntimePackage(this.projectData.projectDir, "android");
93
92
  let runtimes = [];
94
93
  if (!platform) {
95
94
  runtimes = [iosRuntime, androidRuntime];
96
95
  }
97
- else if (platform === "ios" /* PlatformTypes.ios */) {
96
+ else if (platform === "ios") {
98
97
  runtimes.push(iosRuntime);
99
98
  }
100
- else if (platform === "android" /* PlatformTypes.android */) {
99
+ else if (platform === "android") {
101
100
  runtimes.push(androidRuntime);
102
101
  }
103
102
  const runtimesVersions = yield Promise.all(runtimes.map((runtime) => __awaiter(this, void 0, void 0, function* () {
@@ -195,4 +194,3 @@ VersionsService.UP_TO_DATE_MESSAGE = "up to date";
195
194
  VersionsService.UPDATE_AVAILABLE_MESSAGE = "Update available";
196
195
  VersionsService.NOT_INSTALLED_MESSAGE = "not installed";
197
196
  yok_1.injector.register("versionsService", VersionsService);
198
- //# sourceMappingURL=versions-service.js.map
@@ -18,4 +18,3 @@ class WatchIgnoreListService {
18
18
  }
19
19
  exports.WatchIgnoreListService = WatchIgnoreListService;
20
20
  yok_1.injector.register("watchIgnoreListService", WatchIgnoreListService);
21
- //# sourceMappingURL=watch-ignore-list-service.js.map
@@ -25,8 +25,7 @@ const constants_1 = require("../../constants");
25
25
  const yok_1 = require("../../common/yok");
26
26
  const package_path_helper_1 = require("../../helpers/package-path-helper");
27
27
  class WebpackCompilerService extends events_1.EventEmitter {
28
- constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager // private $sharedEventBus: ISharedEventBus
29
- ) {
28
+ constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager) {
30
29
  super();
31
30
  this.$options = $options;
32
31
  this.$errors = $errors;
@@ -61,23 +60,14 @@ class WebpackCompilerService extends events_1.EventEmitter {
61
60
  });
62
61
  childProcess.on("message", (message) => {
63
62
  this.$logger.trace("Message from webpack", message);
64
- // if we are on webpack5 - we handle HMR in a slightly different way
65
63
  if (typeof message === "object" &&
66
64
  "version" in message &&
67
65
  "type" in message) {
68
- // first compilation can be ignored because it will be synced regardless
69
- // handling it here would trigger 2 syncs
70
66
  if (isFirstWebpackWatchCompilation) {
71
67
  isFirstWebpackWatchCompilation = false;
72
68
  resolve(childProcess);
73
69
  return;
74
70
  }
75
- // if ((message as IWebpackMessage).type === "hmr-status") {
76
- // // we pass message through our event-bus to be handled wherever needed
77
- // // in this case webpack-hmr-status-service listens for this event
78
- // this.$sharedEventBus.emit("webpack:hmr-status", message);
79
- // return;
80
- // }
81
71
  return this.handleHMRMessage(message, platformData, projectData, prepareData);
82
72
  }
83
73
  if (message === "Webpack compilation complete.") {
@@ -92,7 +82,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
92
82
  prepareData.hmr ? message.hash : "";
93
83
  return;
94
84
  }
95
- // Persist the previousHash value before calling `this.getUpdatedEmittedFiles` as it will modify the expectedHashes object with the current hash
96
85
  const previousHash = this.expectedHashes[platformData.platformNameLowerCase];
97
86
  let result;
98
87
  if (prepareData.hmr) {
@@ -117,7 +106,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
117
106
  platform: platformData.platformNameLowerCase,
118
107
  };
119
108
  this.$logger.trace("Generated data from webpack message:", data);
120
- // the hash of the compilation is the same as the previous one and there are only hot updates produced
121
109
  if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) {
122
110
  return;
123
111
  }
@@ -196,9 +184,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
196
184
  }
197
185
  shouldUsePreserveSymlinksOption() {
198
186
  return __awaiter(this, void 0, void 0, function* () {
199
- // pnpm does not require symlink (https://github.com/nodejs/node-eps/issues/46#issuecomment-277373566)
200
- // and it also does not work in some cases.
201
- // Check https://github.com/NativeScript/nativescript-cli/issues/5259 for more information
202
187
  const currentPackageManager = yield this.$packageManager.getPackageManagerName();
203
188
  const res = currentPackageManager !== constants_1.PackageManagers.pnpm;
204
189
  return res;
@@ -233,12 +218,15 @@ class WebpackCompilerService extends events_1.EventEmitter {
233
218
  cwd: projectData.projectDir,
234
219
  stdio,
235
220
  };
221
+ options.env = {
222
+ NATIVESCRIPT_WEBPACK_ENV: JSON.stringify(envData)
223
+ };
236
224
  if (this.$options.hostProjectPath) {
237
- options.env = {
225
+ Object.assign(options.env, {
238
226
  USER_PROJECT_PLATFORMS_ANDROID: this.$options.hostProjectPath,
239
227
  USER_PROJECT_PLATFORMS_ANDROID_MODULE: this.$options.hostProjectModuleName,
240
228
  USER_PROJECT_PLATFORMS_IOS: this.$options.hostProjectPath,
241
- };
229
+ });
242
230
  }
243
231
  const childProcess = this.$childProcess.spawn(process.execPath, args, options);
244
232
  this.webpackProcesses[platformData.platformNameLowerCase] = childProcess;
@@ -258,31 +246,22 @@ class WebpackCompilerService extends events_1.EventEmitter {
258
246
  });
259
247
  envData.verbose = envData.verbose || this.$logger.isVerbose();
260
248
  envData.production = envData.production || prepareData.release;
261
- // add the config file name to the env data so the webpack process can read the
262
- // correct config file when resolving the CLI lib and the config service
263
- // we are explicitly setting it to false to force using the defaults
264
249
  envData.config =
265
250
  (_b = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config) !== null && _b !== void 0 ? _b : "false";
266
- // explicitly set the env variable
267
251
  process.env.NATIVESCRIPT_CONFIG_NAME = envData.config;
268
- // The snapshot generation is wrongly located in the Webpack plugin.
269
- // It should be moved in the Native Prepare of the CLI or a Gradle task in the Runtime.
270
- // As a workaround, we skip the mksnapshot, xxd and android-ndk calls based on skipNativePrepare.
271
- // In this way the plugin will prepare only the snapshot JS entry without any native prepare and
272
- // we will able to execute cloud builds with snapshot without having any local snapshot or Docker setup.
273
- // TODO: Remove this flag when we remove the native part from the plugin.
274
252
  envData.skipSnapshotTools =
275
253
  prepareData.nativePrepare && prepareData.nativePrepare.skipNativePrepare;
276
- // only set sourceMap if not explicitly set through a flag
277
254
  if (typeof ((_c = prepareData === null || prepareData === void 0 ? void 0 : prepareData.env) === null || _c === void 0 ? void 0 : _c.sourceMap) === "undefined") {
278
255
  if (!prepareData.release) {
279
256
  envData.sourceMap = true;
280
257
  }
281
258
  }
282
- // convert string to boolean
283
259
  if (envData.sourceMap === "true" || envData.sourceMap === "false") {
284
260
  envData.sourceMap = envData.sourceMap === "true";
285
261
  }
262
+ if (prepareData.uniqueBundle > 0) {
263
+ envData.uniqueBundle = prepareData.uniqueBundle;
264
+ }
286
265
  return envData;
287
266
  }
288
267
  buildEnvCommandLineParams(envData, platformData, projectData, prepareData) {
@@ -330,15 +309,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
330
309
  }
331
310
  getUpdatedEmittedFiles(allEmittedFiles, chunkFiles, nextHash, platform) {
332
311
  const currentHash = this.getCurrentHotUpdateHash(allEmittedFiles);
333
- // This logic is needed as there are already cases when webpack doesn't emit any files physically.
334
- // We've set noEmitOnErrors in webpack.config.js based on noEmitOnError from tsconfig.json,
335
- // so webpack doesn't emit any files when noEmitOnErrors: true is set in webpack.config.js and
336
- // there is a compilation error in the source code. On the other side, hmr generates new hot-update files
337
- // on every change and the hash of the next hmr update is written inside hot-update.json file.
338
- // Although webpack doesn't emit any files, hmr hash is still generated. The hash is generated per compilation no matter
339
- // if files will be emitted or not. This way, the first successful compilation after fixing the compilation error generates
340
- // a hash that is not the same as the one expected in the latest emitted hot-update.json file.
341
- // As a result, the hmr chain is broken and the changes are not applied.
342
312
  const isHashValid = nextHash
343
313
  ? this.expectedHashes[platform] === currentHash
344
314
  : true;
@@ -357,7 +327,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
357
327
  let hotHash;
358
328
  const hotUpdateScripts = emittedFiles.filter((x) => x.endsWith(".hot-update.js"));
359
329
  if (hotUpdateScripts && hotUpdateScripts.length) {
360
- // the hash is the same for each hot update in the current compilation
361
330
  const hotUpdateName = hotUpdateScripts[0];
362
331
  const matcher = /^(.+)\.(.+)\.hot-update/gm;
363
332
  const matches = matcher.exec(hotUpdateName);
@@ -377,7 +346,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
377
346
  });
378
347
  }
379
348
  handleHMRMessage(message, platformData, projectData, prepareData) {
380
- // handle new webpack hmr packets
381
349
  this.$logger.trace("Received message from webpack process:", message);
382
350
  if (message.type !== "compilation") {
383
351
  return;
@@ -385,7 +353,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
385
353
  this.$logger.trace("Webpack build done!");
386
354
  const files = message.data.emittedAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
387
355
  const staleFiles = message.data.staleAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
388
- // extract last hash from emitted filenames
389
356
  const lastHash = (() => {
390
357
  const absoluteFileNameWithLastHash = files.find((fileName) => fileName.endsWith("hot-update.js"));
391
358
  if (!absoluteFileNameWithLastHash) {
@@ -398,7 +365,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
398
365
  }
399
366
  })();
400
367
  if (!files.length) {
401
- // ignore compilations if no new files are emitted
402
368
  return;
403
369
  }
404
370
  this.emit(constants_1.WEBPACK_COMPILATION_COMPLETE, {
@@ -448,4 +414,3 @@ __decorate([
448
414
  ], WebpackCompilerService.prototype, "startWebpackProcess", null);
449
415
  exports.WebpackCompilerService = WebpackCompilerService;
450
416
  yok_1.injector.register("webpackCompilerService", WebpackCompilerService);
451
- //# sourceMappingURL=webpack-compiler-service.js.map
@@ -66,7 +66,6 @@ class XcconfigService {
66
66
  }
67
67
  });
68
68
  if (isPropertyParsed) {
69
- // property can be an empty string, so we don't check for that.
70
69
  return property;
71
70
  }
72
71
  }
@@ -75,4 +74,3 @@ class XcconfigService {
75
74
  }
76
75
  exports.XcconfigService = XcconfigService;
77
76
  yok_1.injector.register("xcconfigService", XcconfigService);
78
- //# 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
@@ -93,7 +93,7 @@ class SysInfo {
93
93
  if (macOSVersion && macOSVersion < constants_1.MacOSVersions.HighSierra) {
94
94
  return {
95
95
  message: (0, util_1.format)(constants_1.MacOSDeprecationStringFormat, macOSVersion),
96
- severity: "high" /* SystemWarningsSeverity.high */,
96
+ severity: "high",
97
97
  };
98
98
  }
99
99
  return null;
@@ -118,4 +118,3 @@ __decorate([
118
118
  ], SysInfo.prototype, "getSupportedNodeVersionRange", null);
119
119
  exports.SysInfo = SysInfo;
120
120
  yok_1.injector.register("sysInfo", SysInfo);
121
- //# sourceMappingURL=sys-info.js.map