nativescript 8.1.5 → 8.2.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 (145) hide show
  1. package/config/test-deps-versions-generated.json +1 -1
  2. package/lib/android-tools-info.js +2 -2
  3. package/lib/base-package-manager.js +3 -2
  4. package/lib/commands/appstore-list.js +1 -1
  5. package/lib/commands/build.js +1 -1
  6. package/lib/commands/clean.js +7 -3
  7. package/lib/commands/create-project.js +2 -2
  8. package/lib/commands/debug.js +3 -3
  9. package/lib/commands/deploy.js +1 -1
  10. package/lib/commands/fonts.js +1 -1
  11. package/lib/commands/generate.js +1 -1
  12. package/lib/commands/plugin/build-plugin.js +2 -0
  13. package/lib/commands/plugin/create-plugin.js +4 -4
  14. package/lib/commands/plugin/list-plugins.js +2 -2
  15. package/lib/commands/post-install.js +1 -1
  16. package/lib/commands/run.js +3 -3
  17. package/lib/commands/test-init.js +1 -1
  18. package/lib/commands/test.js +2 -1
  19. package/lib/commands/typings.js +35 -27
  20. package/lib/common/commands/device/list-devices.js +18 -7
  21. package/lib/common/commands/preuninstall.js +2 -2
  22. package/lib/common/commands/proxy/proxy-set.js +6 -6
  23. package/lib/common/dispatchers.js +1 -1
  24. package/lib/common/errors.js +2 -2
  25. package/lib/common/file-system.js +17 -17
  26. package/lib/common/helpers.js +6 -5
  27. package/lib/common/host-info.js +1 -1
  28. package/lib/common/http-client.js +1 -1
  29. package/lib/common/logger/layouts/cli-layout.js +1 -1
  30. package/lib/common/logger/logger.js +1 -1
  31. package/lib/common/mobile/android/android-application-manager.js +6 -6
  32. package/lib/common/mobile/android/android-debug-bridge.js +4 -4
  33. package/lib/common/mobile/android/android-device-file-system.js +3 -3
  34. package/lib/common/mobile/android/android-device-hash-service.js +4 -4
  35. package/lib/common/mobile/android/android-device.js +1 -1
  36. package/lib/common/mobile/android/android-emulator-services.js +6 -6
  37. package/lib/common/mobile/android/android-virtual-device-service.js +7 -7
  38. package/lib/common/mobile/android/genymotion/genymotion-service.js +3 -3
  39. package/lib/common/mobile/android/genymotion/virtualbox-service.js +2 -2
  40. package/lib/common/mobile/device-log-provider-base.js +1 -1
  41. package/lib/common/mobile/ios/device/ios-application-manager.js +2 -2
  42. package/lib/common/mobile/ios/device/ios-device-operations.js +2 -2
  43. package/lib/common/mobile/ios/device/ios-device.js +1 -1
  44. package/lib/common/mobile/ios/ios-device-base.js +1 -1
  45. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +1 -1
  46. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +3 -3
  47. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +1 -1
  48. package/lib/common/mobile/mobile-core/android-process-service.js +1 -1
  49. package/lib/common/mobile/mobile-core/devices-service.js +22 -20
  50. package/lib/common/services/auto-completion-service.js +3 -3
  51. package/lib/common/services/hooks-service.js +2 -2
  52. package/lib/common/services/json-file-settings-service.js +1 -1
  53. package/lib/common/services/lock-service.js +2 -2
  54. package/lib/common/services/messages-service.js +1 -1
  55. package/lib/common/services/net-service.js +1 -1
  56. package/lib/common/services/qr.js +2 -2
  57. package/lib/common/services/settings-service.js +1 -1
  58. package/lib/common/services/xcode-select-service.js +1 -1
  59. package/lib/common/yok.js +2 -2
  60. package/lib/constants.js +8 -6
  61. package/lib/controllers/build-controller.js +6 -1
  62. package/lib/controllers/company-insights-controller.js +1 -1
  63. package/lib/controllers/debug-controller.js +3 -3
  64. package/lib/controllers/migrate-controller.js +16 -16
  65. package/lib/controllers/platform-controller.js +32 -6
  66. package/lib/controllers/prepare-controller.js +6 -6
  67. package/lib/controllers/preview-app-controller.js +3 -3
  68. package/lib/controllers/run-controller.js +4 -3
  69. package/lib/data/build-data.js +2 -0
  70. package/lib/declarations.d.ts +6 -0
  71. package/lib/definitions/android-plugin-migrator.d.ts +12 -0
  72. package/lib/definitions/build.d.ts +4 -1
  73. package/lib/definitions/gradle.d.ts +1 -0
  74. package/lib/definitions/platform.d.ts +12 -3
  75. package/lib/detached-processes/cleanup-js-subprocess.js +1 -1
  76. package/lib/detached-processes/file-log-service.js +1 -1
  77. package/lib/device-path-provider.js +1 -1
  78. package/lib/nativescript-cli.js +2 -2
  79. package/lib/node-package-manager.js +15 -10
  80. package/lib/options.js +4 -1
  81. package/lib/package-manager.js +17 -17
  82. package/lib/pnpm-package-manager.js +12 -8
  83. package/lib/project-data.js +3 -3
  84. package/lib/services/analytics/analytics-broker.js +1 -1
  85. package/lib/services/analytics/analytics-service.js +5 -5
  86. package/lib/services/analytics/google-analytics-provider.js +2 -2
  87. package/lib/services/analytics-settings-service.js +4 -4
  88. package/lib/services/android/android-bundle-tool-service.js +2 -2
  89. package/lib/services/android/gradle-build-args-service.js +3 -0
  90. package/lib/services/android/gradle-build-service.js +3 -1
  91. package/lib/services/android/gradle-command-service.js +2 -3
  92. package/lib/services/android-device-debug-service.js +3 -3
  93. package/lib/services/android-plugin-build-service.js +33 -13
  94. package/lib/services/android-project-service.js +35 -10
  95. package/lib/services/apple-portal/apple-portal-session-service.js +1 -1
  96. package/lib/services/assets-generation/assets-generation-service.js +2 -2
  97. package/lib/services/cleanup-service.js +2 -2
  98. package/lib/services/cocoapods-service.js +2 -1
  99. package/lib/services/doctor-service.js +3 -3
  100. package/lib/services/extensibility-service.js +4 -4
  101. package/lib/services/files-hash-service.js +1 -1
  102. package/lib/services/hmr-status-service.js +1 -1
  103. package/lib/services/ios-debugger-port-service.js +2 -2
  104. package/lib/services/ios-device-debug-service.js +4 -4
  105. package/lib/services/ios-project-service.js +6 -6
  106. package/lib/services/ios-provision-service.js +3 -3
  107. package/lib/services/ip-service.js +1 -1
  108. package/lib/services/itmstransporter-service.js +3 -3
  109. package/lib/services/karma-execution.js +1 -1
  110. package/lib/services/livesync/android-device-livesync-service.js +2 -2
  111. package/lib/services/livesync/android-livesync-service.js +2 -2
  112. package/lib/services/livesync/device-livesync-service-base.js +2 -2
  113. package/lib/services/livesync/ios-device-livesync-service.js +1 -1
  114. package/lib/services/livesync/ios-livesync-service.js +1 -1
  115. package/lib/services/livesync/platform-livesync-service-base.js +2 -2
  116. package/lib/services/livesync/playground/preview-app-files-service.js +1 -1
  117. package/lib/services/livesync/playground/preview-qr-code-service.js +1 -1
  118. package/lib/services/log-parser-service.js +1 -1
  119. package/lib/services/log-source-map-service.js +1 -1
  120. package/lib/services/pacote-service.js +1 -1
  121. package/lib/services/performance-service.js +1 -1
  122. package/lib/services/platform/add-platform-service.js +1 -1
  123. package/lib/services/platform/prepare-native-platform-service.js +2 -2
  124. package/lib/services/platform-environment-requirements.js +1 -1
  125. package/lib/services/plugins-service.js +2 -2
  126. package/lib/services/project-changes-service.js +2 -2
  127. package/lib/services/project-cleanup-service.js +3 -1
  128. package/lib/services/project-config-service.js +6 -6
  129. package/lib/services/project-data-service.js +9 -9
  130. package/lib/services/project-name-service.js +1 -1
  131. package/lib/services/project-service.js +7 -7
  132. package/lib/services/project-templates-service.js +1 -1
  133. package/lib/services/test-execution-service.js +1 -1
  134. package/lib/services/test-initialization-service.js +2 -2
  135. package/lib/services/webpack/webpack-compiler-service.js +6 -5
  136. package/lib/services/webpack/webpack.d.ts +1 -1
  137. package/lib/sys-info.js +5 -5
  138. package/lib/tools/node-modules/node-modules-builder.js +2 -2
  139. package/lib/tools/node-modules/node-modules-dependencies-builder.js +13 -6
  140. package/lib/yarn-package-manager.js +13 -8
  141. package/package.json +6 -6
  142. package/vendor/aab-tool/README.txt +1 -1
  143. package/vendor/aab-tool/bundletool.jar +0 -0
  144. package/vendor/gradle-plugin/build.gradle +127 -34
  145. package/vendor/gradle-plugin/gradle.properties +2 -0
@@ -1 +1 @@
1
- {"@jsdevtools/coverage-istanbul-loader":"3.0.5","karma":"6.3.9","karma-coverage":"2.0.3","karma-nativescript-launcher":"0.4.0","mocha":"9.1.3","karma-mocha":"2.0.1","karma-chai":"0.1.0","karma-jasmine":"4.0.1","karma-qunit":"4.1.2","@types/karma-chai":"0.1.2","@types/mocha":"9.0.0","@types/jasmine":"3.10.2","@types/qunit":"2.11.2","nyc":"15.1.0"}
1
+ {"@jsdevtools/coverage-istanbul-loader":"3.0.5","karma":"6.3.17","karma-coverage":"2.2.0","karma-nativescript-launcher":"0.4.0","mocha":"9.2.1","karma-mocha":"2.0.1","karma-chai":"0.1.0","karma-jasmine":"4.0.1","karma-qunit":"4.1.2","@types/karma-chai":"0.1.2","@types/mocha":"9.1.0","@types/jasmine":"3.10.3","@types/qunit":"2.11.3","nyc":"15.1.0"}
@@ -126,10 +126,10 @@ class AndroidToolsInfo {
126
126
  }
127
127
  }
128
128
  __decorate([
129
- decorators_1.cache()
129
+ (0, decorators_1.cache)()
130
130
  ], AndroidToolsInfo.prototype, "getToolsInfo", null);
131
131
  __decorate([
132
- decorators_1.cache()
132
+ (0, decorators_1.cache)()
133
133
  ], AndroidToolsInfo.prototype, "validateAndroidHomeEnvVariable", null);
134
134
  exports.AndroidToolsInfo = AndroidToolsInfo;
135
135
  yok_1.injector.register("androidToolsInfo", AndroidToolsInfo);
@@ -69,7 +69,7 @@ class BasePackageManager {
69
69
  processPackageManagerInstall(packageName, params, opts) {
70
70
  return __awaiter(this, void 0, void 0, function* () {
71
71
  const npmExecutable = this.getPackageManagerExecutableName();
72
- const stdioValue = helpers_1.isInteractive() ? "inherit" : "pipe";
72
+ const stdioValue = (0, helpers_1.isInteractive)() ? "inherit" : "pipe";
73
73
  yield this.$childProcess.spawnFromEvent(npmExecutable, params, "close", {
74
74
  cwd: opts.cwd,
75
75
  stdio: stdioValue,
@@ -96,7 +96,8 @@ class BasePackageManager {
96
96
  if (flag === "dist-tags" ||
97
97
  flag === "versions" ||
98
98
  flag === "name" ||
99
- flag === "gradle") {
99
+ flag === "gradle" ||
100
+ flag === "version_info") {
100
101
  array.push(` ${flag}`);
101
102
  continue;
102
103
  }
@@ -57,7 +57,7 @@ class ListiOSApps {
57
57
  this.$logger.info("Seems you don't have any applications yet.");
58
58
  }
59
59
  else {
60
- const table = helpers_1.createTable(["Application Name", "Bundle Identifier", "In Flight Version"], applications.map((application) => {
60
+ const table = (0, helpers_1.createTable)(["Application Name", "Bundle Identifier", "In Flight Version"], applications.map((application) => {
61
61
  const version = (application &&
62
62
  application.versionSets &&
63
63
  application.versionSets.length &&
@@ -136,7 +136,7 @@ class BuildAndroidCommand extends BuildCommandBase {
136
136
  notConfiguredEnvOptions: { hideSyncToPreviewAppOption: true },
137
137
  });
138
138
  if (canExecute) {
139
- if (this.$options.release && !helpers_1.hasValidAndroidSigning(this.$options)) {
139
+ if (this.$options.release && !(0, helpers_1.hasValidAndroidSigning)(this.$options)) {
140
140
  this.$errors.failWithHelp(constants_1.ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
141
141
  }
142
142
  canExecute = yield _super.validateArgs.call(this, args, platform);
@@ -22,15 +22,19 @@ class CleanCommand {
22
22
  execute(args) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  const spinner = this.$terminalSpinnerService.createSpinner();
25
- spinner.start("Cleaning project...");
26
- const pathsToClean = [
25
+ spinner.start("Cleaning project...\n");
26
+ let pathsToClean = [
27
27
  constants.HOOKS_DIR_NAME,
28
28
  constants.PLATFORMS_DIR_NAME,
29
29
  constants.NODE_MODULES_FOLDER_NAME,
30
30
  constants.PACKAGE_LOCK_JSON_FILE_NAME,
31
31
  ];
32
32
  try {
33
- const additionalPaths = this.$projectConfigService.getValue("additionalPathsToClean");
33
+ const overridePathsToClean = this.$projectConfigService.getValue("cli.pathsToClean");
34
+ const additionalPaths = this.$projectConfigService.getValue("cli.additionalPathsToClean");
35
+ if (Array.isArray(overridePathsToClean)) {
36
+ pathsToClean = overridePathsToClean;
37
+ }
34
38
  if (Array.isArray(additionalPaths)) {
35
39
  pathsToClean.push(...additionalPaths);
36
40
  }
@@ -67,7 +67,7 @@ class CreateProjectCommand {
67
67
  else {
68
68
  selectedTemplate = this.$options.template;
69
69
  }
70
- if (!projectName && helpers_1.isInteractive()) {
70
+ if (!projectName && (0, helpers_1.isInteractive)()) {
71
71
  this.printInteractiveCreationIntroIfNeeded();
72
72
  projectName = yield this.$prompter.getString(`${getNextInteractiveAdverb()}, what will be the name of your app?`, { allowEmpty: false });
73
73
  this.$logger.info();
@@ -77,7 +77,7 @@ class CreateProjectCommand {
77
77
  force: this.$options.force,
78
78
  pathToProject: this.$options.path,
79
79
  });
80
- if (!selectedTemplate && helpers_1.isInteractive()) {
80
+ if (!selectedTemplate && (0, helpers_1.isInteractive)()) {
81
81
  this.printInteractiveCreationIntroIfNeeded();
82
82
  selectedTemplate = yield this.interactiveFlavorAndTemplateSelection(getNextInteractiveAdverb(), getNextInteractiveAdverb());
83
83
  }
@@ -148,7 +148,7 @@ class DebugIOSCommand {
148
148
  }
149
149
  }
150
150
  __decorate([
151
- decorators_1.cache()
151
+ (0, decorators_1.cache)()
152
152
  ], DebugIOSCommand.prototype, "debugPlatformCommand", null);
153
153
  exports.DebugIOSCommand = DebugIOSCommand;
154
154
  yok_1.injector.registerCommand("debug|ios", DebugIOSCommand);
@@ -177,7 +177,7 @@ class DebugAndroidCommand {
177
177
  return __awaiter(this, void 0, void 0, function* () {
178
178
  const canExecuteBase = yield this.debugPlatformCommand.canExecute(args);
179
179
  if (canExecuteBase) {
180
- if (this.$options.aab && !helpers_1.hasValidAndroidSigning(this.$options)) {
180
+ if (this.$options.aab && !(0, helpers_1.hasValidAndroidSigning)(this.$options)) {
181
181
  this.$errors.failWithHelp(constants_1.ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE);
182
182
  }
183
183
  }
@@ -186,7 +186,7 @@ class DebugAndroidCommand {
186
186
  }
187
187
  }
188
188
  __decorate([
189
- decorators_1.cache()
189
+ (0, decorators_1.cache)()
190
190
  ], DebugAndroidCommand.prototype, "debugPlatformCommand", null);
191
191
  exports.DebugAndroidCommand = DebugAndroidCommand;
192
192
  yok_1.injector.registerCommand("debug|android", DebugAndroidCommand);
@@ -59,7 +59,7 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
59
59
  }
60
60
  if (this.$mobileHelper.isAndroidPlatform(platform) &&
61
61
  (this.$options.release || this.$options.aab) &&
62
- !helpers_1.hasValidAndroidSigning(this.$options)) {
62
+ !(0, helpers_1.hasValidAndroidSigning)(this.$options)) {
63
63
  if (this.$options.release) {
64
64
  this.$errors.failWithHelp(constants_1.ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
65
65
  }
@@ -48,7 +48,7 @@ class FontsCommand {
48
48
  this.$logger.warn("No custom fonts found.");
49
49
  return;
50
50
  }
51
- const table = helpers_1.createTable(["Font", "CSS Properties"], []);
51
+ const table = (0, helpers_1.createTable)(["Font", "CSS Properties"], []);
52
52
  for (const file of files) {
53
53
  const font = yield fontFinder.get(fontsFolderPath + "/" + file.base);
54
54
  table.push([
@@ -22,7 +22,7 @@ class GenerateCommand {
22
22
  execute(_rawArgs) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  try {
25
- yield schematics_executor_1.run(this.executionOptions);
25
+ yield (0, schematics_executor_1.run)(this.executionOptions);
26
26
  }
27
27
  catch (error) {
28
28
  this.$errors.fail(error.message);
@@ -38,6 +38,8 @@ class BuildPluginCommand {
38
38
  }
39
39
  const tempAndroidProject = yield this.$tempService.mkdirSync("android-project");
40
40
  const options = {
41
+ gradlePath: this.$options.gradlePath,
42
+ gradleArgs: this.$options.gradleArgs,
41
43
  aarOutputDir: platformsAndroidPath,
42
44
  platformsAndroidDirPath: platformsAndroidPath,
43
45
  pluginName: pluginName,
@@ -76,7 +76,7 @@ class CreatePluginCommand {
76
76
  const pluginNameSource = yield this.getPluginNameSource(config.pluginName, pluginRepoName);
77
77
  const includeTypescriptDemo = yield this.getShouldIncludeDemoResult(config.includeTypeScriptDemo, this.includeTypeScriptDemoMessage);
78
78
  const includeAngularDemo = yield this.getShouldIncludeDemoResult(config.includeAngularDemo, this.includeAngularDemoMessage);
79
- if (!helpers_1.isInteractive() &&
79
+ if (!(0, helpers_1.isInteractive)() &&
80
80
  (!config.username ||
81
81
  !config.pluginName ||
82
82
  !config.includeAngularDemo ||
@@ -128,7 +128,7 @@ class CreatePluginCommand {
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
129
  if (!gitHubUsername) {
130
130
  gitHubUsername = "NativeScriptDeveloper";
131
- if (helpers_1.isInteractive()) {
131
+ if ((0, helpers_1.isInteractive)()) {
132
132
  gitHubUsername = yield this.$prompter.getString(this.userMessage, {
133
133
  allowEmpty: false,
134
134
  defaultAction: () => {
@@ -147,7 +147,7 @@ class CreatePluginCommand {
147
147
  pluginNameSource = pluginRepoName.toLowerCase().startsWith(prefix)
148
148
  ? pluginRepoName.slice(prefix.length, pluginRepoName.length)
149
149
  : pluginRepoName;
150
- if (helpers_1.isInteractive()) {
150
+ if ((0, helpers_1.isInteractive)()) {
151
151
  pluginNameSource = yield this.$prompter.getString(this.nameMessage, {
152
152
  allowEmpty: false,
153
153
  defaultAction: () => {
@@ -162,7 +162,7 @@ class CreatePluginCommand {
162
162
  getShouldIncludeDemoResult(includeDemoOption, message) {
163
163
  return __awaiter(this, void 0, void 0, function* () {
164
164
  let shouldIncludeDemo = !!includeDemoOption;
165
- if (!includeDemoOption && helpers_1.isInteractive()) {
165
+ if (!includeDemoOption && (0, helpers_1.isInteractive)()) {
166
166
  shouldIncludeDemo = yield this.$prompter.confirm(message, () => {
167
167
  return true;
168
168
  });
@@ -25,13 +25,13 @@ class ListPluginsCommand {
25
25
  const installedPlugins = this.$pluginsService.getDependenciesFromPackageJson(this.$projectData.projectDir);
26
26
  const headers = ["Plugin", "Version"];
27
27
  const dependenciesData = this.createTableCells(installedPlugins.dependencies);
28
- const dependenciesTable = helpers_1.createTable(headers, dependenciesData);
28
+ const dependenciesTable = (0, helpers_1.createTable)(headers, dependenciesData);
29
29
  this.$logger.info("Dependencies:");
30
30
  this.$logger.info(dependenciesTable.toString());
31
31
  if (installedPlugins.devDependencies &&
32
32
  installedPlugins.devDependencies.length) {
33
33
  const devDependenciesData = this.createTableCells(installedPlugins.devDependencies);
34
- const devDependenciesTable = helpers_1.createTable(headers, devDependenciesData);
34
+ const devDependenciesTable = (0, helpers_1.createTable)(headers, devDependenciesData);
35
35
  this.$logger.info("Dev Dependencies:");
36
36
  this.$logger.info(devDependenciesTable.toString());
37
37
  }
@@ -32,7 +32,7 @@ class PostInstallCliCommand {
32
32
  yield this.$fs.setCurrentUserAsOwner(this.$settingsService.getProfileDir(), process.env.SUDO_USER);
33
33
  }
34
34
  }
35
- const canExecutePostInstallTask = !isRunningWithSudoUser || helpers_1.doesCurrentNpmCommandMatch([/^--unsafe-perm$/]);
35
+ const canExecutePostInstallTask = !isRunningWithSudoUser || (0, helpers_1.doesCurrentNpmCommandMatch)([/^--unsafe-perm$/]);
36
36
  if (canExecutePostInstallTask) {
37
37
  yield this.$helpService.generateHtmlPages();
38
38
  yield this.$analyticsService.checkConsent();
@@ -105,7 +105,7 @@ class RunIosCommand {
105
105
  }
106
106
  }
107
107
  __decorate([
108
- decorators_1.cache()
108
+ (0, decorators_1.cache)()
109
109
  ], RunIosCommand.prototype, "runCommand", null);
110
110
  exports.RunIosCommand = RunIosCommand;
111
111
  yok_1.injector.registerCommand("run|ios", RunIosCommand);
@@ -139,7 +139,7 @@ class RunAndroidCommand {
139
139
  this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.Android} can not be built on this OS`);
140
140
  }
141
141
  if ((this.$options.release || this.$options.aab) &&
142
- !helpers_1.hasValidAndroidSigning(this.$options)) {
142
+ !(0, helpers_1.hasValidAndroidSigning)(this.$options)) {
143
143
  if (this.$options.release) {
144
144
  this.$errors.failWithHelp(constants_2.ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
145
145
  }
@@ -152,7 +152,7 @@ class RunAndroidCommand {
152
152
  }
153
153
  }
154
154
  __decorate([
155
- decorators_1.cache()
155
+ (0, decorators_1.cache)()
156
156
  ], RunAndroidCommand.prototype, "runCommand", null);
157
157
  exports.RunAndroidCommand = RunAndroidCommand;
158
158
  yok_1.injector.registerCommand("run|android", RunAndroidCommand);
@@ -111,7 +111,7 @@ class TestInitCommand {
111
111
  .concat(this.karmaConfigAdditionalFrameworks[frameworkToInstall] || [])
112
112
  .map((fw) => `'${fw}'`)
113
113
  .join(", ");
114
- const testFiles = `'${helpers_1.fromWindowsRelativePathToUnix(relativeTestsDir)}/**/*${projectFilesExtension}'`;
114
+ const testFiles = `'${(0, helpers_1.fromWindowsRelativePathToUnix)(relativeTestsDir)}/**/*${projectFilesExtension}'`;
115
115
  const karmaConfTemplate = this.$resources.readText("test/karma.conf.js");
116
116
  const karmaConf = _.template(karmaConfTemplate)({
117
117
  frameworks,
@@ -49,6 +49,7 @@ class TestCommandBase {
49
49
  devices.forEach((device) => (deviceDebugMap[device.deviceInfo.identifier] = this.$options.debugBrk));
50
50
  const deviceDescriptors = yield this.$liveSyncCommandHelper.createDeviceDescriptors(devices, this.platform, { deviceDebugMap });
51
51
  yield this.$testExecutionService.startKarmaServer(this.platform, liveSyncInfo, deviceDescriptors);
52
+ process.exit(0);
52
53
  });
53
54
  }
54
55
  canExecute(args) {
@@ -115,7 +116,7 @@ class TestAndroidCommand extends TestCommandBase {
115
116
  const canExecuteBase = yield _super.canExecute.call(this, args);
116
117
  if (canExecuteBase) {
117
118
  if ((this.$options.release || this.$options.aab) &&
118
- !helpers_1.hasValidAndroidSigning(this.$options)) {
119
+ !(0, helpers_1.hasValidAndroidSigning)(this.$options)) {
119
120
  if (this.$options.release) {
120
121
  this.$errors.failWithHelp(constants_1.ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
121
122
  }
@@ -26,18 +26,21 @@ class TypingsCommand {
26
26
  execute(args) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const platform = args[0];
29
+ let result;
29
30
  if (this.$mobileHelper.isAndroidPlatform(platform)) {
30
- yield this.handleAndroidTypings();
31
+ result = yield this.handleAndroidTypings();
31
32
  }
32
- if (this.$mobileHelper.isiOSPlatform(platform)) {
33
- yield this.handleiOSTypings();
33
+ else if (this.$mobileHelper.isiOSPlatform(platform)) {
34
+ result = yield this.handleiOSTypings();
34
35
  }
35
36
  let typingsFolder = "./typings";
36
37
  if (this.$options.copyTo) {
37
38
  this.$fs.copyFile(path.resolve(this.$projectData.projectDir, "typings"), this.$options.copyTo);
38
39
  typingsFolder = this.$options.copyTo;
39
40
  }
40
- this.$logger.info("Typings have been generated in the following directory:", typingsFolder);
41
+ if (result !== false) {
42
+ this.$logger.info("Typings have been generated in the following directory:", typingsFolder);
43
+ }
41
44
  });
42
45
  }
43
46
  canExecute(args) {
@@ -49,16 +52,13 @@ class TypingsCommand {
49
52
  }
50
53
  handleAndroidTypings() {
51
54
  return __awaiter(this, void 0, void 0, function* () {
52
- if (this.$options.aar) {
53
- return this.$logger.warn(`Open the .aar archive
54
- Extract the classes.jar and any dependencies it may have inside libs/
55
- Rename classes.jar if necessary
56
-
57
- ns typings android --jar classes.jar --jar dependency-of-classes-jar.jar
58
- `);
59
- }
60
- else if (!this.$options.jar) {
61
- return this.$logger.warn("No .jar file specified. Please specify a .jar file with --jar <Jar>.");
55
+ if (!(this.$options.jar || this.$options.aar)) {
56
+ this.$logger.warn([
57
+ "No .jar or .aar file specified. Please specify at least one of the following:",
58
+ " - path to .jar file with --jar <jar>",
59
+ " - path to .aar file with --aar <aar>",
60
+ ].join("\n"));
61
+ return false;
62
62
  }
63
63
  this.$fs.ensureDirectoryExists(path.resolve(this.$projectData.projectDir, "typings", "android"));
64
64
  const dtsGeneratorPath = path.resolve(this.$projectData.projectDir, "platforms", "android", "build-tools", "dts-generator.jar");
@@ -66,19 +66,27 @@ ns typings android --jar classes.jar --jar dependency-of-classes-jar.jar
66
66
  this.$logger.warn("No platforms folder found, preparing project now...");
67
67
  yield this.$childProcess.spawnFromEvent(this.$hostInfo.isWindows ? "ns.cmd" : "ns", ["prepare", "android"], "exit", { stdio: "inherit" });
68
68
  }
69
- if (this.$options.jar) {
70
- const jars = typeof this.$options.jar === "string"
71
- ? [this.$options.jar]
72
- : this.$options.jar;
73
- yield this.$childProcess.spawnFromEvent("java", [
74
- "-jar",
75
- dtsGeneratorPath,
76
- "-input",
77
- ...jars,
78
- "-output",
79
- path.resolve(this.$projectData.projectDir, "typings", "android"),
80
- ], "exit", { stdio: "inherit" });
81
- }
69
+ const asArray = (input) => {
70
+ if (!input) {
71
+ return [];
72
+ }
73
+ if (typeof input === "string") {
74
+ return [input];
75
+ }
76
+ return input;
77
+ };
78
+ const inputs = [
79
+ ...asArray(this.$options.jar),
80
+ ...asArray(this.$options.aar),
81
+ ];
82
+ yield this.$childProcess.spawnFromEvent("java", [
83
+ "-jar",
84
+ dtsGeneratorPath,
85
+ "-input",
86
+ ...inputs,
87
+ "-output",
88
+ path.resolve(this.$projectData.projectDir, "typings", "android"),
89
+ ], "exit", { stdio: "inherit" });
82
90
  });
83
91
  }
84
92
  handleiOSTypings() {
@@ -26,16 +26,24 @@ class ListDevicesCommand {
26
26
  }
27
27
  execute(args) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
+ const devices = {
30
+ devices: [],
31
+ };
29
32
  if (this.$options.availableDevices) {
30
33
  const platform = this.$mobileHelper.normalizePlatformName(args[0]);
31
34
  if (!platform && args[0]) {
32
- this.$errors.fail(`${args[0]} is not a valid device platform. The valid platforms are ${helpers_1.formatListOfNames(this.$mobileHelper.platformNames)}`);
35
+ this.$errors.fail(`${args[0]} is not a valid device platform. The valid platforms are ${(0, helpers_1.formatListOfNames)(this.$mobileHelper.platformNames)}`);
33
36
  }
34
37
  const availableEmulatorsOutput = yield this.$devicesService.getEmulatorImages({ platform });
35
38
  const emulators = this.$emulatorHelper.getEmulatorsFromAvailableEmulatorsOutput(availableEmulatorsOutput);
36
- this.printEmulators("\nAvailable emulators", emulators);
39
+ devices.available = emulators;
40
+ if (!this.$options.json) {
41
+ this.printEmulators("\nAvailable emulators", emulators);
42
+ }
43
+ }
44
+ if (!this.$options.json) {
45
+ this.$logger.info("\nConnected devices & emulators");
37
46
  }
38
- this.$logger.info("\nConnected devices & emulators");
39
47
  let index = 1;
40
48
  yield this.$devicesService.initialize({
41
49
  platform: args[0],
@@ -45,7 +53,7 @@ class ListDevicesCommand {
45
53
  skipEmulatorStart: true,
46
54
  fullDiscovery: true,
47
55
  });
48
- const table = helpers_1.createTable([
56
+ const table = (0, helpers_1.createTable)([
49
57
  "#",
50
58
  "Device Name",
51
59
  "Platform",
@@ -57,7 +65,7 @@ class ListDevicesCommand {
57
65
  let action;
58
66
  if (this.$options.json) {
59
67
  action = (device) => __awaiter(this, void 0, void 0, function* () {
60
- this.$logger.info(JSON.stringify(device.deviceInfo));
68
+ devices.devices.push(device.deviceInfo);
61
69
  });
62
70
  }
63
71
  else {
@@ -78,14 +86,17 @@ class ListDevicesCommand {
78
86
  yield this.$devicesService.execute(action, undefined, {
79
87
  allowNoDevices: true,
80
88
  });
81
- if (!this.$options.json && table.length) {
89
+ if (this.$options.json) {
90
+ return this.$logger.info(JSON.stringify(devices, null, 2));
91
+ }
92
+ if (table.length) {
82
93
  this.$logger.info(table.toString());
83
94
  }
84
95
  });
85
96
  }
86
97
  printEmulators(title, emulators) {
87
98
  this.$logger.info(title);
88
- const table = helpers_1.createTable([
99
+ const table = (0, helpers_1.createTable)([
89
100
  "Device Name",
90
101
  "Platform",
91
102
  "Version",
@@ -25,7 +25,7 @@ class PreUninstallCommand {
25
25
  }
26
26
  execute(args) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- const isIntentionalUninstall = helpers_1.doesCurrentNpmCommandMatch([
28
+ const isIntentionalUninstall = (0, helpers_1.doesCurrentNpmCommandMatch)([
29
29
  /^uninstall$/,
30
30
  /^remove$/,
31
31
  /^rm$/,
@@ -35,7 +35,7 @@ class PreUninstallCommand {
35
35
  ]);
36
36
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
37
37
  action: "Uninstall CLI",
38
- additionalData: `isIntentionalUninstall${constants_1.AnalyticsEventLabelDelimiter}${isIntentionalUninstall}${constants_1.AnalyticsEventLabelDelimiter}isInteractive${constants_1.AnalyticsEventLabelDelimiter}${!!helpers_1.isInteractive()}`,
38
+ additionalData: `isIntentionalUninstall${constants_1.AnalyticsEventLabelDelimiter}${isIntentionalUninstall}${constants_1.AnalyticsEventLabelDelimiter}isInteractive${constants_1.AnalyticsEventLabelDelimiter}${!!(0, helpers_1.isInteractive)()}`,
39
39
  });
40
40
  if (isIntentionalUninstall) {
41
41
  yield this.handleIntentionalUninstall();
@@ -44,7 +44,7 @@ class ProxySetCommand extends proxy_base_1.ProxyCommandBase {
44
44
  let password = args[2];
45
45
  const noUrl = !urlString;
46
46
  if (noUrl) {
47
- if (!helpers_1.isInteractive()) {
47
+ if (!(0, helpers_1.isInteractive)()) {
48
48
  this.$errors.failWithHelp("Console is not interactive - you need to supply all command parameters.");
49
49
  }
50
50
  else {
@@ -53,14 +53,14 @@ class ProxySetCommand extends proxy_base_1.ProxyCommandBase {
53
53
  });
54
54
  }
55
55
  }
56
- let urlObj = url_1.parse(urlString);
57
- if ((!urlObj.protocol || !urlObj.hostname) && !helpers_1.isInteractive()) {
56
+ let urlObj = (0, url_1.parse)(urlString);
57
+ if ((!urlObj.protocol || !urlObj.hostname) && !(0, helpers_1.isInteractive)()) {
58
58
  this.$errors.fail("The url you have entered is invalid please enter a valid url containing a valid protocol and hostname.");
59
59
  }
60
60
  while (!urlObj.protocol || !urlObj.hostname) {
61
61
  this.$logger.warn("The url you have entered is invalid please enter a valid url containing a valid protocol and hostname.");
62
62
  urlString = yield this.$prompter.getString("Url", { allowEmpty: false });
63
- urlObj = url_1.parse(urlString);
63
+ urlObj = (0, url_1.parse)(urlString);
64
64
  }
65
65
  let port = (urlObj.port && +urlObj.port) || constants_1.HttpProtocolToPort[urlObj.protocol];
66
66
  const noPort = !port || !this.isValidPort(port);
@@ -75,7 +75,7 @@ class ProxySetCommand extends proxy_base_1.ProxyCommandBase {
75
75
  }
76
76
  username = username || authCredentials.username;
77
77
  password = password || authCredentials.password;
78
- if (!helpers_1.isInteractive()) {
78
+ if (!(0, helpers_1.isInteractive)()) {
79
79
  if (noPort) {
80
80
  this.$errors.fail(`The port you have specified (${port || "none"}) is not valid.`);
81
81
  }
@@ -105,7 +105,7 @@ class ProxySetCommand extends proxy_base_1.ProxyCommandBase {
105
105
  rejectUnauthorized: !this.$options.insecure,
106
106
  };
107
107
  if (!this.$hostInfo.isWindows) {
108
- this.$logger.warn(`Note that storing credentials is not supported on ${os_1.platform()} yet.`);
108
+ this.$logger.warn(`Note that storing credentials is not supported on ${(0, os_1.platform)()} yet.`);
109
109
  }
110
110
  const clientName = this.$staticConfig.CLIENT_NAME.toLowerCase();
111
111
  const messageNote = (clientName === "tns"
@@ -122,7 +122,7 @@ class CommandDispatcher {
122
122
  }
123
123
  }
124
124
  __decorate([
125
- helpers_1.hook("resolveCommand")
125
+ (0, helpers_1.hook)("resolveCommand")
126
126
  ], CommandDispatcher.prototype, "resolveCommand", null);
127
127
  exports.CommandDispatcher = CommandDispatcher;
128
128
  yok_1.injector.register("commandDispatcher", CommandDispatcher);
@@ -175,7 +175,7 @@ class Errors {
175
175
  loggerLevel === "DEBUG";
176
176
  const message = printCallStack
177
177
  ? yield resolveCallStack(ex)
178
- : helpers_1.isInteractive()
178
+ : (0, helpers_1.isInteractive)()
179
179
  ? `\x1B[31;1m${ex.message}\x1B[0m`
180
180
  : ex.message;
181
181
  if (ex.printOnStdout) {
@@ -200,7 +200,7 @@ class Errors {
200
200
  }
201
201
  }
202
202
  __decorate([
203
- decorators_1.deprecated("Use `fail` instead.")
203
+ (0, decorators_1.deprecated)("Use `fail` instead.")
204
204
  ], Errors.prototype, "failWithoutHelp", null);
205
205
  exports.Errors = Errors;
206
206
  yok_1.injector.register("errors", Errors);