nativescript 8.7.0-rc.1 → 8.7.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/lib/android-tools-info.js +12 -0
  2. package/lib/base-package-manager.js +7 -0
  3. package/lib/bootstrap.js +7 -1
  4. package/lib/color.js +3 -0
  5. package/lib/commands/add-platform.js +1 -0
  6. package/lib/commands/apple-login.js +1 -0
  7. package/lib/commands/appstore-list.js +1 -0
  8. package/lib/commands/appstore-upload.js +4 -0
  9. package/lib/commands/build.js +20 -3
  10. package/lib/commands/clean.js +22 -1
  11. package/lib/commands/command-base.js +1 -0
  12. package/lib/commands/config.js +3 -0
  13. package/lib/commands/create-project.js +34 -22
  14. package/lib/commands/debug.js +6 -1
  15. package/lib/commands/deploy.js +3 -2
  16. package/lib/commands/extensibility/install-extension.js +1 -0
  17. package/lib/commands/extensibility/list-extensions.js +1 -0
  18. package/lib/commands/extensibility/uninstall-extension.js +1 -0
  19. package/lib/commands/fonts.js +1 -0
  20. package/lib/commands/generate-assets.js +1 -0
  21. package/lib/commands/generate-help.js +1 -0
  22. package/lib/commands/generate.js +12 -2
  23. package/lib/commands/info.js +1 -0
  24. package/lib/commands/install.js +1 -0
  25. package/lib/commands/list-platforms.js +1 -0
  26. package/lib/commands/migrate.js +1 -0
  27. package/lib/commands/platform-clean.js +1 -0
  28. package/lib/commands/plugin/add-plugin.js +1 -0
  29. package/lib/commands/plugin/build-plugin.js +1 -0
  30. package/lib/commands/plugin/create-plugin.js +5 -0
  31. package/lib/commands/plugin/list-plugins.js +1 -0
  32. package/lib/commands/plugin/remove-plugin.js +2 -0
  33. package/lib/commands/plugin/update-plugin.js +1 -0
  34. package/lib/commands/post-install.js +6 -0
  35. package/lib/commands/prepare.js +3 -2
  36. package/lib/commands/preview.js +2 -0
  37. package/lib/commands/remove-platform.js +1 -0
  38. package/lib/commands/resources/resources-update.js +2 -0
  39. package/lib/commands/run.js +1 -0
  40. package/lib/commands/setup.js +1 -0
  41. package/lib/commands/start.js +1 -0
  42. package/lib/commands/test-init.js +4 -0
  43. package/lib/commands/test.js +9 -2
  44. package/lib/commands/typings.js +1 -0
  45. package/lib/commands/update-platform.js +5 -0
  46. package/lib/commands/update.js +2 -0
  47. package/lib/common/bootstrap.js +1 -0
  48. package/lib/common/child-process.js +3 -0
  49. package/lib/common/codeGeneration/code-entity.js +1 -0
  50. package/lib/common/codeGeneration/code-printer.js +1 -0
  51. package/lib/common/command-params.js +1 -0
  52. package/lib/common/commands/analytics.js +3 -0
  53. package/lib/common/commands/autocompletion.js +3 -0
  54. package/lib/common/commands/device/device-log-stream.js +1 -0
  55. package/lib/common/commands/device/get-file.js +2 -0
  56. package/lib/common/commands/device/list-applications.js +1 -0
  57. package/lib/common/commands/device/list-devices.js +3 -0
  58. package/lib/common/commands/device/list-files.js +2 -0
  59. package/lib/common/commands/device/put-file.js +2 -0
  60. package/lib/common/commands/device/run-application.js +1 -0
  61. package/lib/common/commands/device/stop-application.js +1 -0
  62. package/lib/common/commands/device/uninstall-application.js +1 -0
  63. package/lib/common/commands/doctor.js +3 -2
  64. package/lib/common/commands/generate-messages.js +1 -0
  65. package/lib/common/commands/help.js +1 -0
  66. package/lib/common/commands/package-manager-get.js +1 -0
  67. package/lib/common/commands/package-manager-set.js +1 -0
  68. package/lib/common/commands/post-install.js +1 -0
  69. package/lib/common/commands/preuninstall.js +11 -2
  70. package/lib/common/commands/proxy/proxy-base.js +4 -0
  71. package/lib/common/commands/proxy/proxy-clear.js +1 -0
  72. package/lib/common/commands/proxy/proxy-get.js +1 -0
  73. package/lib/common/commands/proxy/proxy-set.js +1 -0
  74. package/lib/common/common-lib.js +1 -0
  75. package/lib/common/constants.js +11 -0
  76. package/lib/common/decorators.js +48 -0
  77. package/lib/common/definitions/mobile.d.ts +1 -1
  78. package/lib/common/dispatchers.js +10 -1
  79. package/lib/common/errors.js +13 -3
  80. package/lib/common/file-system.js +13 -2
  81. package/lib/common/header.js +3 -0
  82. package/lib/common/helpers.js +89 -3
  83. package/lib/common/host-info.js +4 -0
  84. package/lib/common/http-client.js +20 -0
  85. package/lib/common/logger/appenders/cli-appender.js +4 -0
  86. package/lib/common/logger/appenders/emit-appender.js +4 -0
  87. package/lib/common/logger/layouts/cli-layout.js +1 -0
  88. package/lib/common/logger/logger.js +5 -0
  89. package/lib/common/messages/messages.js +6 -0
  90. package/lib/common/mobile/android/android-application-manager.js +20 -1
  91. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
  92. package/lib/common/mobile/android/android-debug-bridge.js +6 -0
  93. package/lib/common/mobile/android/android-device-file-system.js +4 -0
  94. package/lib/common/mobile/android/android-device-hash-service.js +3 -0
  95. package/lib/common/mobile/android/android-device.js +8 -0
  96. package/lib/common/mobile/android/android-emulator-services.js +2 -1
  97. package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
  98. package/lib/common/mobile/android/android-log-filter.js +4 -0
  99. package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
  100. package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
  101. package/lib/common/mobile/android/genymotion/genymotion-service.js +5 -0
  102. package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
  103. package/lib/common/mobile/android/logcat-helper.js +20 -1
  104. package/lib/common/mobile/application-manager-base.js +6 -0
  105. package/lib/common/mobile/device-emitter.js +4 -0
  106. package/lib/common/mobile/device-log-emitter.js +1 -0
  107. package/lib/common/mobile/device-log-provider-base.js +1 -0
  108. package/lib/common/mobile/device-log-provider.js +23 -0
  109. package/lib/common/mobile/device-platforms-constants.js +1 -0
  110. package/lib/common/mobile/emulator-helper.js +3 -0
  111. package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
  112. package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
  113. package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
  114. package/lib/common/mobile/ios/device/ios-device.js +4 -0
  115. package/lib/common/mobile/ios/ios-device-base.js +1 -0
  116. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
  117. package/lib/common/mobile/ios/ios-log-filter.js +1 -0
  118. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
  119. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
  120. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
  121. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
  122. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
  123. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
  124. package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
  125. package/lib/common/mobile/log-filter.js +2 -0
  126. package/lib/common/mobile/logging-levels.js +1 -0
  127. package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
  128. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
  129. package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
  130. package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
  131. package/lib/common/mobile/mobile-core/devices-service.js +72 -3
  132. package/lib/common/mobile/mobile-core/ios-device-discovery.js +3 -1
  133. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
  134. package/lib/common/mobile/mobile-helper.js +2 -1
  135. package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
  136. package/lib/common/opener.js +1 -0
  137. package/lib/common/os-info.js +1 -0
  138. package/lib/common/plist-parser.js +1 -0
  139. package/lib/common/project-helper.js +1 -0
  140. package/lib/common/prompter.js +9 -1
  141. package/lib/common/queue.js +1 -0
  142. package/lib/common/resource-loader.js +1 -0
  143. package/lib/common/services/auto-completion-service.js +12 -1
  144. package/lib/common/services/cancellation.js +2 -1
  145. package/lib/common/services/commands-service.js +17 -6
  146. package/lib/common/services/help-service.js +11 -3
  147. package/lib/common/services/hooks-service.js +13 -0
  148. package/lib/common/services/ios-notification-service.js +1 -0
  149. package/lib/common/services/json-file-settings-service.js +6 -0
  150. package/lib/common/services/lock-service.js +6 -0
  151. package/lib/common/services/message-contract-generator.js +1 -0
  152. package/lib/common/services/messages-service.js +1 -0
  153. package/lib/common/services/micro-templating-service.js +6 -0
  154. package/lib/common/services/net-service.js +3 -0
  155. package/lib/common/services/project-files-manager.js +5 -0
  156. package/lib/common/services/project-files-provider-base.js +1 -0
  157. package/lib/common/services/proxy-service.js +1 -0
  158. package/lib/common/services/qr.js +1 -0
  159. package/lib/common/services/settings-service.js +1 -0
  160. package/lib/common/services/xcode-select-service.js +1 -0
  161. package/lib/common/utils.js +1 -0
  162. package/lib/common/validators/project-name-validator.js +1 -0
  163. package/lib/common/validators/validation-result.js +1 -0
  164. package/lib/common/verify-node-version.js +8 -1
  165. package/lib/common/yok.js +32 -11
  166. package/lib/config.js +22 -1
  167. package/lib/constants-provider.js +1 -0
  168. package/lib/constants.js +58 -5
  169. package/lib/controllers/build-controller.js +4 -3
  170. package/lib/controllers/debug-controller.js +8 -3
  171. package/lib/controllers/deploy-controller.js +1 -0
  172. package/lib/controllers/migrate-controller.js +91 -3
  173. package/lib/controllers/platform-controller.js +9 -1
  174. package/lib/controllers/prepare-controller.js +15 -5
  175. package/lib/controllers/run-controller.js +17 -1
  176. package/lib/controllers/update-controller-base.js +1 -0
  177. package/lib/controllers/update-controller.js +11 -0
  178. package/lib/data/build-data.js +1 -0
  179. package/lib/data/controller-data-base.js +1 -0
  180. package/lib/data/debug-data.js +1 -0
  181. package/lib/data/platform-data.js +1 -0
  182. package/lib/data/prepare-data.js +1 -0
  183. package/lib/data/run-data.js +1 -0
  184. package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
  185. package/lib/detached-processes/cleanup-process.js +18 -14
  186. package/lib/detached-processes/file-log-service.js +2 -1
  187. package/lib/device-path-provider.js +3 -2
  188. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
  189. package/lib/device-sockets/ios/notification.js +3 -0
  190. package/lib/device-sockets/ios/socket-request-executor.js +3 -0
  191. package/lib/helpers/android-bundle-validator-helper.js +2 -1
  192. package/lib/helpers/deploy-command-helper.js +1 -0
  193. package/lib/helpers/key-command-helper.js +4 -2
  194. package/lib/helpers/livesync-command-helper.js +5 -2
  195. package/lib/helpers/network-connectivity-validator.js +1 -0
  196. package/lib/helpers/options-track-helper.js +3 -2
  197. package/lib/helpers/package-path-helper.js +1 -0
  198. package/lib/helpers/platform-command-helper.js +7 -2
  199. package/lib/helpers/version-validator-helper.js +1 -0
  200. package/lib/key-commands/bootstrap.js +3 -2
  201. package/lib/key-commands/index.js +5 -4
  202. package/lib/nativescript-cli-lib-bootstrap.js +4 -0
  203. package/lib/nativescript-cli-lib.js +1 -0
  204. package/lib/nativescript-cli.js +10 -1
  205. package/lib/node/pbxproj-dom-xcode.js +1 -0
  206. package/lib/node/xcode.js +1 -0
  207. package/lib/node-package-manager.js +11 -1
  208. package/lib/options.js +141 -115
  209. package/lib/package-installation-manager.js +8 -1
  210. package/lib/package-manager.js +2 -0
  211. package/lib/platform-command-param.js +1 -0
  212. package/lib/pnpm-package-manager.js +4 -1
  213. package/lib/project-data.js +12 -0
  214. package/lib/providers/project-files-provider.js +1 -0
  215. package/lib/resolvers/livesync-service-resolver.js +2 -1
  216. package/lib/services/analytics/analytics-broker-process.js +10 -6
  217. package/lib/services/analytics/analytics-broker.js +2 -1
  218. package/lib/services/analytics/analytics-service.js +29 -25
  219. package/lib/services/analytics/google-analytics-provider.js +13 -12
  220. package/lib/services/analytics-settings-service.js +5 -0
  221. package/lib/services/android/android-bundle-tool-service.js +1 -0
  222. package/lib/services/android/gradle-build-args-service.js +3 -0
  223. package/lib/services/android/gradle-build-service.js +1 -0
  224. package/lib/services/android/gradle-command-service.js +1 -0
  225. package/lib/services/android-device-debug-service.js +6 -0
  226. package/lib/services/android-plugin-build-service.js +28 -0
  227. package/lib/services/android-project-service.js +71 -4
  228. package/lib/services/android-resources-migration-service.js +7 -0
  229. package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
  230. package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
  231. package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
  232. package/lib/services/assets-generation/assets-generation-service.js +16 -5
  233. package/lib/services/build-artifacts-service.js +2 -1
  234. package/lib/services/build-data-service.js +2 -1
  235. package/lib/services/build-info-file-service.js +1 -0
  236. package/lib/services/cleanup-service.js +13 -9
  237. package/lib/services/cocoapods-platform-manager.js +9 -0
  238. package/lib/services/cocoapods-service.js +21 -1
  239. package/lib/services/debug-data-service.js +1 -0
  240. package/lib/services/debug-service-base.js +7 -0
  241. package/lib/services/device/device-install-app-service.js +2 -1
  242. package/lib/services/doctor-service.js +21 -6
  243. package/lib/services/extensibility-service.js +8 -0
  244. package/lib/services/files-hash-service.js +1 -0
  245. package/lib/services/hmr-status-service.js +2 -0
  246. package/lib/services/info-service.js +1 -0
  247. package/lib/services/initialize-service.js +5 -1
  248. package/lib/services/ios/export-options-plist-service.js +4 -0
  249. package/lib/services/ios/ios-signing-service.js +4 -0
  250. package/lib/services/ios/spm-service.js +10 -1
  251. package/lib/services/ios/xcodebuild-args-service.js +13 -4
  252. package/lib/services/ios/xcodebuild-command-service.js +1 -0
  253. package/lib/services/ios/xcodebuild-service.js +1 -0
  254. package/lib/services/ios-debugger-port-service.js +1 -0
  255. package/lib/services/ios-device-debug-service.js +1 -0
  256. package/lib/services/ios-entitlements-service.js +1 -0
  257. package/lib/services/ios-extensions-service.js +1 -0
  258. package/lib/services/ios-log-filter.js +20 -0
  259. package/lib/services/ios-native-target-service.js +6 -4
  260. package/lib/services/ios-project-service.js +29 -7
  261. package/lib/services/ios-provision-service.js +3 -0
  262. package/lib/services/ios-watch-app-service.js +1 -0
  263. package/lib/services/ip-service.js +2 -0
  264. package/lib/services/itmstransporter-service.js +1 -0
  265. package/lib/services/karma-execution.js +2 -0
  266. package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
  267. package/lib/services/livesync/android-device-livesync-service.js +2 -0
  268. package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
  269. package/lib/services/livesync/android-livesync-service.js +1 -0
  270. package/lib/services/livesync/android-livesync-tool.js +4 -0
  271. package/lib/services/livesync/device-livesync-service-base.js +2 -0
  272. package/lib/services/livesync/ios-device-livesync-service.js +7 -0
  273. package/lib/services/livesync/ios-livesync-service.js +2 -0
  274. package/lib/services/livesync/livesync-socket.js +1 -0
  275. package/lib/services/livesync/platform-livesync-service-base.js +5 -0
  276. package/lib/services/livesync-process-data-service.js +1 -0
  277. package/lib/services/log-parser-service.js +1 -0
  278. package/lib/services/log-source-map-service.js +15 -0
  279. package/lib/services/marking-mode-service.js +8 -5
  280. package/lib/services/metadata-filtering-service.js +1 -0
  281. package/lib/services/npm-config-service.js +4 -0
  282. package/lib/services/pacote-service.js +7 -0
  283. package/lib/services/performance-service.js +3 -1
  284. package/lib/services/platform/add-platform-service.js +47 -2
  285. package/lib/services/platform/platform-validation-service.js +1 -0
  286. package/lib/services/platform/prepare-native-platform-service.js +5 -2
  287. package/lib/services/platform-environment-requirements.js +8 -3
  288. package/lib/services/platform-project-service-base.js +1 -0
  289. package/lib/services/platforms-data-service.js +1 -0
  290. package/lib/services/plugins-service.js +18 -2
  291. package/lib/services/prepare-data-service.js +2 -1
  292. package/lib/services/project-backup-service.js +4 -0
  293. package/lib/services/project-changes-service.js +12 -3
  294. package/lib/services/project-cleanup-service.js +2 -0
  295. package/lib/services/project-config-service.js +18 -1
  296. package/lib/services/project-data-service.js +36 -7
  297. package/lib/services/project-name-service.js +1 -0
  298. package/lib/services/project-service.js +10 -0
  299. package/lib/services/project-templates-service.js +3 -2
  300. package/lib/services/qr-code-terminal-service.js +1 -0
  301. package/lib/services/require-service.js +1 -0
  302. package/lib/services/start-service.js +1 -0
  303. package/lib/services/temp-service.js +1 -0
  304. package/lib/services/terminal-spinner-service.js +2 -0
  305. package/lib/services/test-execution-service.js +9 -2
  306. package/lib/services/test-initialization-service.js +4 -0
  307. package/lib/services/timeline-profiler-service.js +1 -0
  308. package/lib/services/user-settings-service.js +1 -0
  309. package/lib/services/versions-service.js +6 -4
  310. package/lib/services/watch-ignore-list-service.js +1 -0
  311. package/lib/services/webpack/webpack-compiler-service.js +42 -1
  312. package/lib/services/xcconfig-service.js +2 -0
  313. package/lib/services/xcproj-service.js +1 -0
  314. package/lib/shared-event-bus.js +6 -0
  315. package/lib/sys-info.js +2 -1
  316. package/lib/tools/config-manipulation/config-transformer.js +12 -0
  317. package/lib/tools/node-modules/node-modules-builder.js +1 -0
  318. package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
  319. package/lib/yarn-package-manager.js +1 -0
  320. package/lib/yarn2-package-manager.js +3 -0
  321. package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
  322. package/node_modules/rimraf/CHANGELOG.md +65 -0
  323. package/node_modules/stringify-package/CHANGELOG.md +16 -0
  324. package/package.json +1 -1
@@ -34,8 +34,10 @@ 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.
37
38
  yield this.$pluginsService.ensureAllDependenciesAreInstalled(projectData);
38
39
  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.
39
41
  const karmaRunner = this.$childProcess.spawn(process.execPath, [path.join(__dirname, "karma-execution.js")], { stdio: ["inherit", "inherit", "inherit", "ipc"] });
40
42
  const launchKarmaTests = (karmaData) => __awaiter(this, void 0, void 0, function* () {
41
43
  this.$logger.trace("## Unit-testing: Parent process received message", karmaData);
@@ -52,6 +54,8 @@ class TestExecutionService {
52
54
  const configJs = this.generateConfig(port, configOptions);
53
55
  this.$fs.writeFile(path.join(liveSyncInfo.projectDir, TestExecutionService.CONFIG_FILE_NAME), configJs);
54
56
  }
57
+ // Prepare the project AFTER the TestExecutionService.CONFIG_FILE_NAME file is created in node_modules
58
+ // so it will be sent to device.
55
59
  yield this.$runController.run({
56
60
  liveSyncInfo,
57
61
  deviceDescriptors,
@@ -64,12 +68,13 @@ class TestExecutionService {
64
68
  }
65
69
  launchKarmaTests(karmaData).catch((result) => {
66
70
  this.$logger.error(result);
67
- process.exit(130);
71
+ process.exit(130 /* ErrorCodes.KARMA_FAIL */);
68
72
  });
69
73
  });
70
74
  return new Promise((resolve, reject) => {
71
75
  karmaRunner.on("exit", (exitCode) => {
72
76
  if (exitCode !== 0) {
77
+ //End our process with a non-zero exit code
73
78
  const testError = new Error("Test run failed.");
74
79
  reject(testError);
75
80
  }
@@ -84,7 +89,7 @@ class TestExecutionService {
84
89
  canStartKarmaServer(projectData) {
85
90
  return __awaiter(this, void 0, void 0, function* () {
86
91
  let canStartKarmaServer = true;
87
- const requiredDependencies = ["@nativescript/unit-test-runner"];
92
+ const requiredDependencies = ["@nativescript/unit-test-runner"]; // we need @nativescript/unit-test-runner at the local level because of hooks!
88
93
  _.each(requiredDependencies, (dep) => {
89
94
  if (!projectData.dependencies[dep] && !projectData.devDependencies[dep]) {
90
95
  canStartKarmaServer = false;
@@ -134,6 +139,7 @@ class TestExecutionService {
134
139
  karmaConfig.logLevel = "DEBUG";
135
140
  }
136
141
  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.
137
143
  karmaConfig.singleRun = true;
138
144
  }
139
145
  if (this.$options.debugBrk) {
@@ -152,3 +158,4 @@ TestExecutionService.CONFIG_FILE_NAME = `node_modules/${constants.TEST_RUNNER_NA
152
158
  TestExecutionService.SOCKETIO_JS_FILE_NAME = `node_modules/${constants.TEST_RUNNER_NAME}/socket.io.js`;
153
159
  exports.TestExecutionService = TestExecutionService;
154
160
  yok_1.injector.register("testExecutionService", TestExecutionService);
161
+ //# sourceMappingURL=test-execution-service.js.map
@@ -34,6 +34,9 @@ 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
+ */
37
40
  getFrameworkNames() {
38
41
  const configsPath = path.join(__dirname, "..", "..", "config");
39
42
  const dependenciesPath = path.join(configsPath, "test-dependencies.json");
@@ -52,3 +55,4 @@ __decorate([
52
55
  ], TestInitializationService.prototype, "getFrameworkNames", null);
53
56
  exports.TestInitializationService = TestInitializationService;
54
57
  yok_1.injector.register("testInitializationService", TestInitializationService);
58
+ //# sourceMappingURL=test-initialization-service.js.map
@@ -98,3 +98,4 @@ __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,3 +32,4 @@ 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,6 +59,7 @@ 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
62
63
  if (!this.$fs.exists(nodeModulesPath) ||
63
64
  (dependsOnNonScopedPackage && !this.$fs.exists(tnsCoreModulesPath)) ||
64
65
  (dependsOnScopedPackage && !this.$fs.exists(scopedPackagePath))) {
@@ -87,16 +88,16 @@ class VersionsService {
87
88
  }
88
89
  getRuntimesVersions(platform) {
89
90
  return __awaiter(this, void 0, void 0, function* () {
90
- const iosRuntime = this.$projectDataService.getRuntimePackage(this.projectData.projectDir, "ios");
91
- const androidRuntime = this.$projectDataService.getRuntimePackage(this.projectData.projectDir, "android");
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 */);
92
93
  let runtimes = [];
93
94
  if (!platform) {
94
95
  runtimes = [iosRuntime, androidRuntime];
95
96
  }
96
- else if (platform === "ios") {
97
+ else if (platform === "ios" /* PlatformTypes.ios */) {
97
98
  runtimes.push(iosRuntime);
98
99
  }
99
- else if (platform === "android") {
100
+ else if (platform === "android" /* PlatformTypes.android */) {
100
101
  runtimes.push(androidRuntime);
101
102
  }
102
103
  const runtimesVersions = yield Promise.all(runtimes.map((runtime) => __awaiter(this, void 0, void 0, function* () {
@@ -194,3 +195,4 @@ VersionsService.UP_TO_DATE_MESSAGE = "up to date";
194
195
  VersionsService.UPDATE_AVAILABLE_MESSAGE = "Update available";
195
196
  VersionsService.NOT_INSTALLED_MESSAGE = "not installed";
196
197
  yok_1.injector.register("versionsService", VersionsService);
198
+ //# sourceMappingURL=versions-service.js.map
@@ -18,3 +18,4 @@ 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,7 +25,8 @@ 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) {
28
+ constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager // private $sharedEventBus: ISharedEventBus
29
+ ) {
29
30
  super();
30
31
  this.$options = $options;
31
32
  this.$errors = $errors;
@@ -60,14 +61,23 @@ class WebpackCompilerService extends events_1.EventEmitter {
60
61
  });
61
62
  childProcess.on("message", (message) => {
62
63
  this.$logger.trace("Message from webpack", message);
64
+ // if we are on webpack5 - we handle HMR in a slightly different way
63
65
  if (typeof message === "object" &&
64
66
  "version" in message &&
65
67
  "type" in message) {
68
+ // first compilation can be ignored because it will be synced regardless
69
+ // handling it here would trigger 2 syncs
66
70
  if (isFirstWebpackWatchCompilation) {
67
71
  isFirstWebpackWatchCompilation = false;
68
72
  resolve(childProcess);
69
73
  return;
70
74
  }
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
+ // }
71
81
  return this.handleHMRMessage(message, platformData, projectData, prepareData);
72
82
  }
73
83
  if (message === "Webpack compilation complete.") {
@@ -82,6 +92,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
82
92
  prepareData.hmr ? message.hash : "";
83
93
  return;
84
94
  }
95
+ // Persist the previousHash value before calling `this.getUpdatedEmittedFiles` as it will modify the expectedHashes object with the current hash
85
96
  const previousHash = this.expectedHashes[platformData.platformNameLowerCase];
86
97
  let result;
87
98
  if (prepareData.hmr) {
@@ -106,6 +117,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
106
117
  platform: platformData.platformNameLowerCase,
107
118
  };
108
119
  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
109
121
  if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) {
110
122
  return;
111
123
  }
@@ -184,6 +196,9 @@ class WebpackCompilerService extends events_1.EventEmitter {
184
196
  }
185
197
  shouldUsePreserveSymlinksOption() {
186
198
  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
187
202
  const currentPackageManager = yield this.$packageManager.getPackageManagerName();
188
203
  const res = currentPackageManager !== constants_1.PackageManagers.pnpm;
189
204
  return res;
@@ -235,16 +250,28 @@ class WebpackCompilerService extends events_1.EventEmitter {
235
250
  });
236
251
  envData.verbose = envData.verbose || this.$logger.isVerbose();
237
252
  envData.production = envData.production || prepareData.release;
253
+ // add the config file name to the env data so the webpack process can read the
254
+ // correct config file when resolving the CLI lib and the config service
255
+ // we are explicitly setting it to false to force using the defaults
238
256
  envData.config =
239
257
  (_b = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config) !== null && _b !== void 0 ? _b : "false";
258
+ // explicitly set the env variable
240
259
  process.env.NATIVESCRIPT_CONFIG_NAME = envData.config;
260
+ // The snapshot generation is wrongly located in the Webpack plugin.
261
+ // It should be moved in the Native Prepare of the CLI or a Gradle task in the Runtime.
262
+ // As a workaround, we skip the mksnapshot, xxd and android-ndk calls based on skipNativePrepare.
263
+ // In this way the plugin will prepare only the snapshot JS entry without any native prepare and
264
+ // we will able to execute cloud builds with snapshot without having any local snapshot or Docker setup.
265
+ // TODO: Remove this flag when we remove the native part from the plugin.
241
266
  envData.skipSnapshotTools =
242
267
  prepareData.nativePrepare && prepareData.nativePrepare.skipNativePrepare;
268
+ // only set sourceMap if not explicitly set through a flag
243
269
  if (typeof ((_c = prepareData === null || prepareData === void 0 ? void 0 : prepareData.env) === null || _c === void 0 ? void 0 : _c.sourceMap) === "undefined") {
244
270
  if (!prepareData.release) {
245
271
  envData.sourceMap = true;
246
272
  }
247
273
  }
274
+ // convert string to boolean
248
275
  if (envData.sourceMap === "true" || envData.sourceMap === "false") {
249
276
  envData.sourceMap = envData.sourceMap === "true";
250
277
  }
@@ -295,6 +322,15 @@ class WebpackCompilerService extends events_1.EventEmitter {
295
322
  }
296
323
  getUpdatedEmittedFiles(allEmittedFiles, chunkFiles, nextHash, platform) {
297
324
  const currentHash = this.getCurrentHotUpdateHash(allEmittedFiles);
325
+ // This logic is needed as there are already cases when webpack doesn't emit any files physically.
326
+ // We've set noEmitOnErrors in webpack.config.js based on noEmitOnError from tsconfig.json,
327
+ // so webpack doesn't emit any files when noEmitOnErrors: true is set in webpack.config.js and
328
+ // there is a compilation error in the source code. On the other side, hmr generates new hot-update files
329
+ // on every change and the hash of the next hmr update is written inside hot-update.json file.
330
+ // Although webpack doesn't emit any files, hmr hash is still generated. The hash is generated per compilation no matter
331
+ // if files will be emitted or not. This way, the first successful compilation after fixing the compilation error generates
332
+ // a hash that is not the same as the one expected in the latest emitted hot-update.json file.
333
+ // As a result, the hmr chain is broken and the changes are not applied.
298
334
  const isHashValid = nextHash
299
335
  ? this.expectedHashes[platform] === currentHash
300
336
  : true;
@@ -313,6 +349,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
313
349
  let hotHash;
314
350
  const hotUpdateScripts = emittedFiles.filter((x) => x.endsWith(".hot-update.js"));
315
351
  if (hotUpdateScripts && hotUpdateScripts.length) {
352
+ // the hash is the same for each hot update in the current compilation
316
353
  const hotUpdateName = hotUpdateScripts[0];
317
354
  const matcher = /^(.+)\.(.+)\.hot-update/gm;
318
355
  const matches = matcher.exec(hotUpdateName);
@@ -332,6 +369,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
332
369
  });
333
370
  }
334
371
  handleHMRMessage(message, platformData, projectData, prepareData) {
372
+ // handle new webpack hmr packets
335
373
  this.$logger.trace("Received message from webpack process:", message);
336
374
  if (message.type !== "compilation") {
337
375
  return;
@@ -339,6 +377,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
339
377
  this.$logger.trace("Webpack build done!");
340
378
  const files = message.data.emittedAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, "app", asset));
341
379
  const staleFiles = message.data.staleAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, "app", asset));
380
+ // extract last hash from emitted filenames
342
381
  const lastHash = (() => {
343
382
  const absoluteFileNameWithLastHash = files.find((fileName) => fileName.endsWith("hot-update.js"));
344
383
  if (!absoluteFileNameWithLastHash) {
@@ -351,6 +390,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
351
390
  }
352
391
  })();
353
392
  if (!files.length) {
393
+ // ignore compilations if no new files are emitted
354
394
  return;
355
395
  }
356
396
  this.emit(constants_1.WEBPACK_COMPILATION_COMPLETE, {
@@ -400,3 +440,4 @@ __decorate([
400
440
  ], WebpackCompilerService.prototype, "startWebpackProcess", null);
401
441
  exports.WebpackCompilerService = WebpackCompilerService;
402
442
  yok_1.injector.register("webpackCompilerService", WebpackCompilerService);
443
+ //# sourceMappingURL=webpack-compiler-service.js.map
@@ -66,6 +66,7 @@ class XcconfigService {
66
66
  }
67
67
  });
68
68
  if (isPropertyParsed) {
69
+ // property can be an empty string, so we don't check for that.
69
70
  return property;
70
71
  }
71
72
  }
@@ -74,3 +75,4 @@ class XcconfigService {
74
75
  }
75
76
  exports.XcconfigService = XcconfigService;
76
77
  yok_1.injector.register("xcconfigService", XcconfigService);
78
+ //# sourceMappingURL=xcconfig-service.js.map
@@ -9,3 +9,4 @@ class XcprojService {
9
9
  }
10
10
  }
11
11
  yok_1.injector.register("xcprojService", XcprojService);
12
+ //# sourceMappingURL=xcproj-service.js.map
@@ -2,6 +2,12 @@
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
+ */
5
10
  class SharedEventBus extends events_1.EventEmitter {
6
11
  }
7
12
  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",
96
+ severity: "high" /* SystemWarningsSeverity.high */,
97
97
  };
98
98
  }
99
99
  return null;
@@ -118,3 +118,4 @@ __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
@@ -55,6 +55,7 @@ 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
58
59
  if (!property) {
59
60
  return undefined;
60
61
  }
@@ -64,11 +65,14 @@ class ConfigTransformer {
64
65
  if (!_parent) {
65
66
  return undefined;
66
67
  }
68
+ // add nonExistent.deep to android: {}
67
69
  return this.getProperty(parts.join("."), _parent);
68
70
  }
71
+ // if we have a parent, we are reading the property from it
69
72
  if (parent) {
70
73
  return parent.getProperty(key);
71
74
  }
75
+ // otherwise we just read it from the root exports object
72
76
  return this.getProperty(key, this.getDefaultExportValue());
73
77
  }
74
78
  addProperty(key, value, parent = null) {
@@ -181,15 +185,22 @@ class ConfigTransformer {
181
185
  }
182
186
  this.setInitializerValue(initializer, newValue);
183
187
  }
188
+ /**
189
+ * @internal
190
+ */
184
191
  getFullText() {
185
192
  return this.config.getFullText();
186
193
  }
194
+ /**
195
+ * @internal
196
+ */
187
197
  getValue(key) {
188
198
  return this.getPropertyValue(this.getProperty(key));
189
199
  }
190
200
  setValue(key, value) {
191
201
  const property = this.getProperty(key);
192
202
  if (!property) {
203
+ // add new property
193
204
  this.addProperty(key, value);
194
205
  }
195
206
  else {
@@ -199,3 +210,4 @@ class ConfigTransformer {
199
210
  }
200
211
  }
201
212
  exports.ConfigTransformer = ConfigTransformer;
213
+ //# sourceMappingURL=config-transformer.js.map
@@ -40,3 +40,4 @@ class NodeModulesBuilder {
40
40
  }
41
41
  exports.NodeModulesBuilder = NodeModulesBuilder;
42
42
  yok_1.injector.register("nodeModulesBuilder", NodeModulesBuilder);
43
+ //# sourceMappingURL=node-modules-builder.js.map
@@ -56,14 +56,18 @@ 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?
59
60
  if (!modulePath) {
61
+ // fallback to searching in the root path
60
62
  modulePath = (0, resolve_package_path_1.resolvePackagePath)(depDescription.name, {
61
63
  paths: [rootPath],
62
64
  });
63
65
  }
66
+ // if we failed to find the module...
64
67
  if (!modulePath) {
65
68
  return null;
66
69
  }
70
+ // if we already resolved this dependency, we return null to avoid a duplicate resolution
67
71
  if (resolvedDependencies.some((r) => {
68
72
  return r.name === depDescription.name && r.directory === modulePath;
69
73
  })) {
@@ -88,6 +92,7 @@ class NodeModulesDependenciesBuilder {
88
92
  const packageJsonContents = this.$fs.readJson(packageJsonPath);
89
93
  dependency.version = packageJsonContents.version;
90
94
  if (!!packageJsonContents.nativescript) {
95
+ // add `nativescript` property, necessary for resolving plugins
91
96
  dependency.nativescript = packageJsonContents.nativescript;
92
97
  }
93
98
  dependency.dependencies = _.keys(packageJsonContents.dependencies);
@@ -98,3 +103,4 @@ class NodeModulesDependenciesBuilder {
98
103
  }
99
104
  exports.NodeModulesDependenciesBuilder = NodeModulesDependenciesBuilder;
100
105
  yok_1.injector.register("nodeModulesDependenciesBuilder", NodeModulesDependenciesBuilder);
106
+ //# sourceMappingURL=node-modules-dependencies-builder.js.map
@@ -132,3 +132,4 @@ __decorate([
132
132
  ], YarnPackageManager.prototype, "getCachePath", null);
133
133
  exports.YarnPackageManager = YarnPackageManager;
134
134
  yok_1.injector.register("yarn", YarnPackageManager);
135
+ //# sourceMappingURL=yarn-package-manager.js.map
@@ -46,6 +46,8 @@ class Yarn2PackageManager extends base_package_manager_1.BasePackageManager {
46
46
  }
47
47
  const packageJsonPath = path.join(pathToSave, "package.json");
48
48
  const jsonContentBefore = this.$fs.readJson(packageJsonPath);
49
+ // remove unsupported flags
50
+ // todo: refactor all package managers to map typed flags to the actual flags
49
51
  const cleanedConfig = _.omit(config, ["save-dev", "save-exact"]);
50
52
  const flags = this.getFlagsString(cleanedConfig, true);
51
53
  let params = [];
@@ -141,3 +143,4 @@ __decorate([
141
143
  ], Yarn2PackageManager.prototype, "getCachePath", null);
142
144
  exports.Yarn2PackageManager = Yarn2PackageManager;
143
145
  yok_1.injector.register("yarn2", Yarn2PackageManager);
146
+ //# sourceMappingURL=yarn2-package-manager.js.map
@@ -0,0 +1,15 @@
1
+ # Changers Lorgs!
2
+
3
+ ## 1.0
4
+
5
+ Full rewrite. Essentially a brand new module.
6
+
7
+ - Return a promise instead of taking a callback.
8
+ - Use native `fs.mkdir(path, { recursive: true })` when available.
9
+ - Drop support for outdated Node.js versions. (Technically still works on
10
+ Node.js v8, but only 10 and above are officially supported.)
11
+
12
+ ## 0.x
13
+
14
+ Original and most widely used recursive directory creation implementation
15
+ in JavaScript, dating back to 2010.
@@ -0,0 +1,65 @@
1
+ # v3.0
2
+
3
+ - Add `--preserve-root` option to executable (default true)
4
+ - Drop support for Node.js below version 6
5
+
6
+ # v2.7
7
+
8
+ - Make `glob` an optional dependency
9
+
10
+ # 2.6
11
+
12
+ - Retry on EBUSY on non-windows platforms as well
13
+ - Make `rimraf.sync` 10000% more reliable on Windows
14
+
15
+ # 2.5
16
+
17
+ - Handle Windows EPERM when lstat-ing read-only dirs
18
+ - Add glob option to pass options to glob
19
+
20
+ # 2.4
21
+
22
+ - Add EPERM to delay/retry loop
23
+ - Add `disableGlob` option
24
+
25
+ # 2.3
26
+
27
+ - Make maxBusyTries and emfileWait configurable
28
+ - Handle weird SunOS unlink-dir issue
29
+ - Glob the CLI arg for better Windows support
30
+
31
+ # 2.2
32
+
33
+ - Handle ENOENT properly on Windows
34
+ - Allow overriding fs methods
35
+ - Treat EPERM as indicative of non-empty dir
36
+ - Remove optional graceful-fs dep
37
+ - Consistently return null error instead of undefined on success
38
+ - win32: Treat ENOTEMPTY the same as EBUSY
39
+ - Add `rimraf` binary
40
+
41
+ # 2.1
42
+
43
+ - Fix SunOS error code for a non-empty directory
44
+ - Try rmdir before readdir
45
+ - Treat EISDIR like EPERM
46
+ - Remove chmod
47
+ - Remove lstat polyfill, node 0.7 is not supported
48
+
49
+ # 2.0
50
+
51
+ - Fix myGid call to check process.getgid
52
+ - Simplify the EBUSY backoff logic.
53
+ - Use fs.lstat in node >= 0.7.9
54
+ - Remove gently option
55
+ - remove fiber implementation
56
+ - Delete files that are marked read-only
57
+
58
+ # 1.0
59
+
60
+ - Allow ENOENT in sync method
61
+ - Throw when no callback is provided
62
+ - Make opts.gently an absolute path
63
+ - use 'stat' if 'lstat' is not available
64
+ - Consistent error naming, and rethrow non-ENOENT stat errors
65
+ - add fiber implementation
@@ -0,0 +1,16 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ <a name="1.0.1"></a>
6
+ ## [1.0.1](https://github.com/npm/stringify-package/compare/v1.0.0...v1.0.1) (2019-09-30)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * strict comparison ([0c5675f](https://github.com/npm/stringify-package/commit/0c5675f)), closes [#2](https://github.com/npm/stringify-package/issues/2)
12
+
13
+
14
+
15
+ <a name="1.0.0"></a>
16
+ # 1.0.0 (2018-07-18)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nativescript",
3
3
  "preferGlobal": true,
4
- "version": "8.7.0-rc.1",
4
+ "version": "8.7.0-rc.2",
5
5
  "author": "NativeScript <support@nativescript.org>",
6
6
  "description": "Command-line interface for building NativeScript projects",
7
7
  "bin": {