nativescript 9.1.2 → 9.1.3-dev.2026-11-07-42333391420

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 (221) hide show
  1. package/config/test-deps-versions-generated.json +1 -1
  2. package/lib/bootstrap.js +85 -76
  3. package/lib/commands/add-platform.d.ts +9 -12
  4. package/lib/commands/add-platform.js +26 -16
  5. package/lib/commands/apple-login.d.ts +1 -14
  6. package/lib/commands/apple-login.js +20 -27
  7. package/lib/commands/appstore-list.d.ts +8 -15
  8. package/lib/commands/appstore-list.js +31 -28
  9. package/lib/commands/appstore-upload.d.ts +19 -19
  10. package/lib/commands/appstore-upload.js +81 -66
  11. package/lib/commands/build.d.ts +39 -58
  12. package/lib/commands/build.js +69 -133
  13. package/lib/commands/clean.d.ts +4 -22
  14. package/lib/commands/clean.js +166 -161
  15. package/lib/commands/command-base.d.ts +19 -16
  16. package/lib/commands/command-base.js +51 -29
  17. package/lib/commands/config.d.ts +3 -30
  18. package/lib/commands/config.js +80 -86
  19. package/lib/commands/create-project.d.ts +26 -38
  20. package/lib/commands/create-project.js +342 -352
  21. package/lib/commands/debug.d.ts +51 -53
  22. package/lib/commands/debug.js +145 -148
  23. package/lib/commands/deploy.d.ts +1 -32
  24. package/lib/commands/deploy.js +44 -47
  25. package/lib/commands/embedding/embed.d.ts +13 -24
  26. package/lib/commands/embedding/embed.js +47 -56
  27. package/lib/commands/extensibility/install-extension.d.ts +1 -10
  28. package/lib/commands/extensibility/install-extension.js +22 -20
  29. package/lib/commands/extensibility/list-extensions.d.ts +1 -9
  30. package/lib/commands/extensibility/list-extensions.js +15 -17
  31. package/lib/commands/extensibility/uninstall-extension.d.ts +1 -10
  32. package/lib/commands/extensibility/uninstall-extension.js +21 -19
  33. package/lib/commands/fonts.d.ts +1 -12
  34. package/lib/commands/fonts.js +24 -23
  35. package/lib/commands/generate-assets.d.ts +6 -29
  36. package/lib/commands/generate-assets.js +35 -53
  37. package/lib/commands/generate-help.d.ts +1 -8
  38. package/lib/commands/generate-help.js +12 -13
  39. package/lib/commands/generate.d.ts +1 -12
  40. package/lib/commands/generate.js +13 -24
  41. package/lib/commands/hooks/common.d.ts +3 -12
  42. package/lib/commands/hooks/common.js +68 -63
  43. package/lib/commands/hooks/hooks-lock.d.ts +2 -24
  44. package/lib/commands/hooks/hooks-lock.js +68 -85
  45. package/lib/commands/hooks/hooks.d.ts +2 -17
  46. package/lib/commands/hooks/hooks.js +61 -56
  47. package/lib/commands/info.d.ts +1 -8
  48. package/lib/commands/info.js +12 -13
  49. package/lib/commands/install.d.ts +6 -25
  50. package/lib/commands/install.js +64 -57
  51. package/lib/commands/list-platforms.d.ts +1 -11
  52. package/lib/commands/list-platforms.js +24 -23
  53. package/lib/commands/migrate.d.ts +1 -13
  54. package/lib/commands/migrate.js +25 -24
  55. package/lib/commands/native-add.d.ts +5 -49
  56. package/lib/commands/native-add.js +180 -212
  57. package/lib/commands/open.d.ts +9 -0
  58. package/lib/commands/open.js +155 -0
  59. package/lib/commands/platform-clean.d.ts +7 -11
  60. package/lib/commands/platform-clean.js +29 -19
  61. package/lib/commands/plugin/add-plugin.d.ts +1 -13
  62. package/lib/commands/plugin/add-plugin.js +27 -23
  63. package/lib/commands/plugin/build-plugin.d.ts +10 -13
  64. package/lib/commands/plugin/build-plugin.js +29 -21
  65. package/lib/commands/plugin/create-plugin.d.ts +18 -16
  66. package/lib/commands/plugin/create-plugin.js +83 -71
  67. package/lib/commands/plugin/list-plugins.d.ts +1 -12
  68. package/lib/commands/plugin/list-plugins.js +30 -29
  69. package/lib/commands/plugin/remove-plugin.d.ts +1 -14
  70. package/lib/commands/plugin/remove-plugin.js +28 -26
  71. package/lib/commands/plugin/update-plugin.d.ts +1 -13
  72. package/lib/commands/plugin/update-plugin.js +31 -28
  73. package/lib/commands/post-install.d.ts +6 -8
  74. package/lib/commands/post-install.js +24 -17
  75. package/lib/commands/prepare.d.ts +13 -40
  76. package/lib/commands/prepare.js +43 -50
  77. package/lib/commands/preview.d.ts +11 -14
  78. package/lib/commands/preview.js +76 -60
  79. package/lib/commands/remove-platform.d.ts +1 -14
  80. package/lib/commands/remove-platform.js +23 -21
  81. package/lib/commands/resources/resources-update.d.ts +1 -13
  82. package/lib/commands/resources/resources-update.js +25 -22
  83. package/lib/commands/run.d.ts +44 -61
  84. package/lib/commands/run.js +119 -139
  85. package/lib/commands/setup.d.ts +1 -8
  86. package/lib/commands/setup.js +11 -13
  87. package/lib/commands/start.d.ts +1 -9
  88. package/lib/commands/start.js +12 -15
  89. package/lib/commands/test-init.d.ts +20 -0
  90. package/lib/commands/test-init.js +66 -49
  91. package/lib/commands/test.d.ts +51 -1
  92. package/lib/commands/test.js +143 -148
  93. package/lib/commands/typings.d.ts +15 -14
  94. package/lib/commands/typings.js +41 -28
  95. package/lib/commands/update-platform.d.ts +5 -11
  96. package/lib/commands/update-platform.js +25 -18
  97. package/lib/commands/update.d.ts +10 -14
  98. package/lib/commands/update.js +46 -37
  99. package/lib/commands/widget.d.ts +1 -24
  100. package/lib/commands/widget.js +17 -34
  101. package/lib/common/bootstrap.js +37 -27
  102. package/lib/common/commands/analytics.d.ts +6 -30
  103. package/lib/common/commands/analytics.js +51 -62
  104. package/lib/common/commands/autocompletion.d.ts +4 -35
  105. package/lib/common/commands/autocompletion.js +61 -68
  106. package/lib/common/commands/device/device-log-stream.d.ts +3 -16
  107. package/lib/common/commands/device/device-log-stream.js +31 -27
  108. package/lib/common/commands/device/get-file.d.ts +4 -14
  109. package/lib/common/commands/device/get-file.js +28 -28
  110. package/lib/common/commands/device/list-applications.d.ts +3 -10
  111. package/lib/common/commands/device/list-applications.js +21 -19
  112. package/lib/common/commands/device/list-devices.d.ts +15 -15
  113. package/lib/common/commands/device/list-devices.js +113 -119
  114. package/lib/common/commands/device/list-files.d.ts +3 -14
  115. package/lib/common/commands/device/list-files.js +27 -28
  116. package/lib/common/commands/device/put-file.d.ts +3 -14
  117. package/lib/common/commands/device/put-file.js +27 -29
  118. package/lib/common/commands/device/run-application.d.ts +3 -13
  119. package/lib/common/commands/device/run-application.js +24 -26
  120. package/lib/common/commands/device/stop-application.d.ts +3 -10
  121. package/lib/common/commands/device/stop-application.js +21 -24
  122. package/lib/common/commands/device/uninstall-application.d.ts +3 -10
  123. package/lib/common/commands/device/uninstall-application.js +19 -18
  124. package/lib/common/commands/doctor.d.ts +3 -23
  125. package/lib/common/commands/doctor.js +18 -49
  126. package/lib/common/commands/generate-messages.d.ts +3 -13
  127. package/lib/common/commands/generate-messages.js +26 -24
  128. package/lib/common/commands/help.d.ts +3 -14
  129. package/lib/common/commands/help.js +22 -22
  130. package/lib/common/commands/package-manager-get.d.ts +1 -10
  131. package/lib/common/commands/package-manager-get.js +13 -19
  132. package/lib/common/commands/package-manager-set.d.ts +1 -11
  133. package/lib/common/commands/package-manager-set.js +17 -20
  134. package/lib/common/commands/post-install.d.ts +1 -9
  135. package/lib/common/commands/post-install.js +11 -14
  136. package/lib/common/commands/preuninstall.d.ts +1 -16
  137. package/lib/common/commands/preuninstall.js +27 -28
  138. package/lib/common/commands/proxy/proxy-base.d.ts +1 -13
  139. package/lib/common/commands/proxy/proxy-base.js +7 -18
  140. package/lib/common/commands/proxy/proxy-clear.d.ts +1 -9
  141. package/lib/common/commands/proxy/proxy-clear.js +16 -17
  142. package/lib/common/commands/proxy/proxy-get.d.ts +1 -9
  143. package/lib/common/commands/proxy/proxy-get.js +15 -16
  144. package/lib/common/commands/proxy/proxy-set.d.ts +12 -19
  145. package/lib/common/commands/proxy/proxy-set.js +100 -87
  146. package/lib/common/contracts/command-context.d.ts +3 -0
  147. package/lib/common/contracts/command-context.js +5 -0
  148. package/lib/common/contracts/command-preconditions.d.ts +4 -0
  149. package/lib/common/contracts/command-preconditions.js +5 -0
  150. package/lib/common/contracts/command-registry.d.ts +10 -5
  151. package/lib/common/contracts/command-registry.js +18 -1
  152. package/lib/common/contracts/commands-service.d.ts +10 -0
  153. package/lib/common/contracts/{key-command-registry.js → commands-service.js} +6 -6
  154. package/lib/common/contracts/index.d.ts +6 -2
  155. package/lib/common/contracts/index.js +9 -3
  156. package/lib/common/contracts/key-shortcuts.d.ts +31 -0
  157. package/lib/common/contracts/key-shortcuts.js +25 -0
  158. package/lib/common/define-command.d.ts +82 -10
  159. package/lib/common/define-command.js +219 -15
  160. package/lib/common/definitions/commands-service.d.ts +26 -2
  161. package/lib/common/definitions/commands.d.ts +6 -1
  162. package/lib/common/definitions/yok.d.ts +1 -7
  163. package/lib/common/deprecation.js +1 -1
  164. package/lib/common/di/index.d.ts +2 -2
  165. package/lib/common/di/index.js +2 -1
  166. package/lib/common/di/inject.d.ts +1 -0
  167. package/lib/common/di/inject.js +5 -0
  168. package/lib/common/di/injector.js +30 -2
  169. package/lib/common/di/providers.d.ts +6 -1
  170. package/lib/common/di/providers.js +10 -0
  171. package/lib/common/errors.d.ts +1 -0
  172. package/lib/common/errors.js +28 -20
  173. package/lib/common/helpers.js +1 -1
  174. package/lib/common/opener.d.ts +1 -0
  175. package/lib/common/opener.js +11 -0
  176. package/lib/common/services/command-definition-adapter.d.ts +11 -5
  177. package/lib/common/services/command-definition-adapter.js +261 -30
  178. package/lib/common/services/commands-service.d.ts +18 -2
  179. package/lib/common/services/commands-service.js +225 -42
  180. package/lib/common/services/help-service.js +4 -0
  181. package/lib/common/yok.d.ts +1 -8
  182. package/lib/common/yok.js +11 -31
  183. package/lib/contracts/errors.d.ts +1 -0
  184. package/lib/contracts/index.d.ts +10 -2
  185. package/lib/contracts/index.js +17 -1
  186. package/lib/contracts/provide-project.d.ts +2 -0
  187. package/lib/contracts/provide-project.js +18 -0
  188. package/lib/controllers/prepare-controller.d.ts +0 -1
  189. package/lib/controllers/prepare-controller.js +11 -5
  190. package/lib/controllers/run-controller.d.ts +1 -0
  191. package/lib/controllers/run-controller.js +61 -1
  192. package/lib/declarations.d.ts +1 -1
  193. package/lib/definitions/livesync.d.ts +39 -37
  194. package/lib/definitions/run.d.ts +10 -3
  195. package/lib/helpers/livesync-command-helper.js +3 -2
  196. package/lib/options.d.ts +1 -1
  197. package/lib/options.js +4 -2
  198. package/lib/services/android/gradle-build-args-service.d.ts +3 -3
  199. package/lib/services/android/gradle-build-args-service.js +4 -4
  200. package/lib/services/bundler/bundler-compiler-service.d.ts +3 -0
  201. package/lib/services/bundler/bundler-compiler-service.js +52 -11
  202. package/lib/services/extensibility-service.d.ts +1 -0
  203. package/lib/services/extensibility-service.js +12 -20
  204. package/lib/services/key-shortcut-registry.d.ts +6 -0
  205. package/lib/services/key-shortcut-registry.js +32 -0
  206. package/lib/services/key-shortcuts.d.ts +55 -0
  207. package/lib/services/key-shortcuts.js +389 -0
  208. package/lib/services/livesync-process-data-service.d.ts +1 -1
  209. package/lib/services/livesync-process-data-service.js +5 -2
  210. package/lib/services/start-service.d.ts +4 -4
  211. package/lib/services/start-service.js +67 -34
  212. package/package.json +4 -4
  213. package/lib/common/contracts/key-command-registry.d.ts +0 -7
  214. package/lib/common/definitions/key-commands.d.ts +0 -25
  215. package/lib/common/definitions/key-commands.js +0 -8
  216. package/lib/helpers/key-command-helper.d.ts +0 -13
  217. package/lib/helpers/key-command-helper.js +0 -117
  218. package/lib/key-commands/bootstrap.d.ts +0 -1
  219. package/lib/key-commands/bootstrap.js +0 -22
  220. package/lib/key-commands/index.d.ts +0 -166
  221. package/lib/key-commands/index.js +0 -414
@@ -1,90 +1,105 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PublishIOS = void 0;
3
+ exports.PublishIOSCommand = void 0;
4
4
  const path = require("path");
5
- const command_params_1 = require("../common/command-params");
5
+ const define_command_1 = require("../common/define-command");
6
+ const di_1 = require("../common/di");
6
7
  const build_data_1 = require("../data/build-data");
7
- const yok_1 = require("../common/yok");
8
- class PublishIOS {
9
- constructor($applePortalSessionService, $injector, $itmsTransporterService, $logger, $projectData, $options, $prompter, $devicePlatformsConstants, $hostInfo, $errors, $buildController, $platformValidationService) {
10
- this.$applePortalSessionService = $applePortalSessionService;
11
- this.$injector = $injector;
12
- this.$itmsTransporterService = $itmsTransporterService;
13
- this.$logger = $logger;
14
- this.$projectData = $projectData;
15
- this.$options = $options;
16
- this.$prompter = $prompter;
17
- this.$devicePlatformsConstants = $devicePlatformsConstants;
18
- this.$hostInfo = $hostInfo;
19
- this.$errors = $errors;
20
- this.$buildController = $buildController;
21
- this.$platformValidationService = $platformValidationService;
22
- this.allowedParameters = [
23
- new command_params_1.StringCommandParameter(this.$injector),
24
- new command_params_1.StringCommandParameter(this.$injector),
25
- new command_params_1.StringCommandParameter(this.$injector),
26
- new command_params_1.StringCommandParameter(this.$injector),
27
- ];
28
- this.$projectData.initializeProjectData();
8
+ const project_data_1 = require("../contracts/project-data");
9
+ const command_base_1 = require("./command-base");
10
+ const publishIOSCommandOptions = {
11
+ appleApplicationSpecificPassword: (0, define_command_1.stringOption)(),
12
+ appleSessionBase64: (0, define_command_1.stringOption)(),
13
+ ipa: (0, define_command_1.stringOption)(),
14
+ provision: (0, define_command_1.objectOption)(),
15
+ release: (0, define_command_1.booleanOption)(),
16
+ teamId: (0, define_command_1.objectOption)(),
17
+ };
18
+ class PublishIOSCommand extends (0, define_command_1.Command)({
19
+ name: ["publish|ios", "appstore|upload"],
20
+ description: "Uploads a project to App Store Connect.",
21
+ options: publishIOSCommandOptions,
22
+ params: "any",
23
+ providers: [(0, command_base_1.provideProject)()],
24
+ }) {
25
+ constructor() {
26
+ super(...arguments);
27
+ this.$applePortalSessionService = (0, di_1.inject)("applePortalSessionService");
28
+ this.$buildController = (0, di_1.inject)("buildController");
29
+ this.$devicePlatformsConstants = (0, di_1.inject)("devicePlatformsConstants");
30
+ this.$hostInfo = (0, di_1.inject)("hostInfo");
31
+ this.$itmsTransporterService = (0, di_1.inject)("itmsTransporterService");
32
+ this.$logger = (0, di_1.inject)("logger");
33
+ this.$options = (0, di_1.inject)("options");
34
+ this.$platformValidationService = (0, di_1.inject)("platformValidationService");
35
+ this.$projectData = (0, di_1.inject)(project_data_1.ProjectData);
36
+ this.$prompter = (0, di_1.inject)("prompter");
29
37
  }
30
- async execute(args) {
38
+ canExecute() {
39
+ if (!this.$hostInfo.isDarwin) {
40
+ this.context.fail("iOS publishing is only available on macOS.", {
41
+ help: false,
42
+ });
43
+ }
44
+ if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
45
+ this.context.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`, { help: false });
46
+ }
47
+ return true;
48
+ }
49
+ async run() {
31
50
  var _a;
32
- await this.$itmsTransporterService.validate(this.$options.appleApplicationSpecificPassword);
33
- const username = args[0] ||
51
+ await this.$itmsTransporterService.validate(this.options.appleApplicationSpecificPassword);
52
+ const username = this.args[0] ||
34
53
  (await this.$prompter.getString("Apple ID", { allowEmpty: false }));
35
- const password = args[1] || (await this.$prompter.getPassword("Apple ID password"));
36
- const user = await this.$applePortalSessionService.createUserSession({ username, password }, {
37
- applicationSpecificPassword: this.$options.appleApplicationSpecificPassword,
38
- sessionBase64: this.$options.appleSessionBase64,
39
- requireInteractiveConsole: true,
40
- requireApplicationSpecificPassword: true,
41
- });
42
- if (!user.areCredentialsValid) {
43
- this.$errors.fail(`Invalid username and password combination. Used '${username}' as the username.`);
44
- }
45
- const mobileProvisionIdentifier = (_a = this.$options.provision) !== null && _a !== void 0 ? _a : args[2];
46
- let ipaFilePath = this.$options.ipa
47
- ? path.resolve(this.$options.ipa)
48
- : null;
54
+ const password = this.args[1] || (await this.$prompter.getPassword("Apple ID password"));
55
+ const user = await this.createUserSession(username, password);
56
+ const mobileProvisionIdentifier = (_a = this.options.provision) !== null && _a !== void 0 ? _a : this.args[2];
57
+ let ipaFilePath = this.options.ipa ? path.resolve(this.options.ipa) : null;
49
58
  if (!mobileProvisionIdentifier && !ipaFilePath) {
50
59
  this.$logger.warn("No mobile provision identifier set. A default mobile provision will be used. You can set one in app/App_Resources/iOS/build.xcconfig");
51
60
  }
52
61
  this.$options.release = true;
53
62
  if (!ipaFilePath) {
54
- const platform = this.$devicePlatformsConstants.iOS.toLowerCase();
55
- if (mobileProvisionIdentifier) {
56
- this.$logger.info("Building .ipa with the selected mobile provision and/or certificate. " +
57
- mobileProvisionIdentifier);
58
- this.$options.provision = mobileProvisionIdentifier;
59
- const buildData = new build_data_1.IOSBuildData(this.$projectData.projectDir, platform, { ...this.$options.argv, buildForAppStore: true, watch: false });
60
- ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
61
- }
62
- else {
63
- this.$logger.info("No .ipa, mobile provision or certificate set. Perfect! Now we'll build .xcarchive and let Xcode pick the distribution certificate and provisioning profile for you when exporting .ipa for AppStore submission.");
64
- const buildData = new build_data_1.IOSBuildData(this.$projectData.projectDir, platform, { ...this.$options.argv, buildForAppStore: true, watch: false });
65
- ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
66
- this.$logger.info(`Export at: ${ipaFilePath}`);
67
- }
63
+ ipaFilePath = await this.buildIpa(mobileProvisionIdentifier);
68
64
  }
69
65
  await this.$itmsTransporterService.upload({
70
66
  credentials: { username, password },
71
67
  user,
72
- applicationSpecificPassword: this.$options.appleApplicationSpecificPassword,
68
+ applicationSpecificPassword: this.options.appleApplicationSpecificPassword,
73
69
  ipaFilePath,
74
- shouldExtractIpa: !!this.$options.ipa,
70
+ shouldExtractIpa: !!this.options.ipa,
75
71
  verboseLogging: this.$logger.getLevel() === "TRACE",
76
- teamId: this.$options.teamId,
72
+ teamId: this.options.teamId,
77
73
  });
78
74
  }
79
- async canExecute(args) {
80
- if (!this.$hostInfo.isDarwin) {
81
- this.$errors.fail("iOS publishing is only available on macOS.");
75
+ async createUserSession(username, password) {
76
+ const user = await this.$applePortalSessionService.createUserSession({ username, password }, {
77
+ applicationSpecificPassword: this.options.appleApplicationSpecificPassword,
78
+ sessionBase64: this.options.appleSessionBase64,
79
+ requireInteractiveConsole: true,
80
+ requireApplicationSpecificPassword: true,
81
+ });
82
+ if (!user.areCredentialsValid) {
83
+ this.context.fail(`Invalid username and password combination. Used '${username}' as the username.`, { help: false });
82
84
  }
83
- if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
84
- this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
85
+ return user;
86
+ }
87
+ async buildIpa(mobileProvisionIdentifier) {
88
+ const platform = this.$devicePlatformsConstants.iOS.toLowerCase();
89
+ if (mobileProvisionIdentifier) {
90
+ this.$logger.info("Building .ipa with the selected mobile provision and/or certificate. " +
91
+ mobileProvisionIdentifier);
92
+ this.$options.provision = mobileProvisionIdentifier;
93
+ const buildData = new build_data_1.IOSBuildData(this.$projectData.projectDir, platform, { ...this.$options.argv, buildForAppStore: true, watch: false });
94
+ return await this.$buildController.prepareAndBuild(buildData);
95
+ }
96
+ else {
97
+ this.$logger.info("No .ipa, mobile provision or certificate set. Perfect! Now we'll build .xcarchive and let Xcode pick the distribution certificate and provisioning profile for you when exporting .ipa for AppStore submission.");
98
+ const buildData = new build_data_1.IOSBuildData(this.$projectData.projectDir, platform, { ...this.$options.argv, buildForAppStore: true, watch: false });
99
+ const ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
100
+ this.$logger.info(`Export at: ${ipaFilePath}`);
101
+ return ipaFilePath;
85
102
  }
86
- return true;
87
103
  }
88
104
  }
89
- exports.PublishIOS = PublishIOS;
90
- yok_1.injector.registerCommand(["publish|ios", "appstore|upload"], PublishIOS);
105
+ exports.PublishIOSCommand = PublishIOSCommand;
@@ -1,58 +1,39 @@
1
- import { ValidatePlatformCommandBase } from "./command-base";
2
- import { IProjectData } from "../definitions/project";
3
- import { IOptions, IPlatformValidationService, IAndroidBundleValidatorHelper } from "../declarations";
4
- import { IPlatformsDataService } from "../definitions/platform";
5
- import { IBuildController, IBuildDataService } from "../definitions/build";
6
- import { IMigrateController } from "../definitions/migrate";
7
- import { IErrors } from "../common/declarations";
8
- import { OptionType } from "../common/enums";
9
- import { ICommandParameter, ICommand } from "../common/definitions/commands";
10
- export declare abstract class BuildCommandBase extends ValidatePlatformCommandBase {
11
- protected $errors: IErrors;
12
- protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants;
13
- protected $buildController: IBuildController;
14
- private $buildDataService;
15
- protected $logger: ILogger;
16
- constructor($options: IOptions, $errors: IErrors, $projectData: IProjectData, $platformsDataService: IPlatformsDataService, $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, $buildController: IBuildController, $platformValidationService: IPlatformValidationService, $buildDataService: IBuildDataService, $logger: ILogger);
17
- dashedOptions: {
18
- watch: {
19
- type: OptionType;
20
- default: boolean;
21
- hasSensitiveValue: boolean;
22
- };
23
- hmr: {
24
- type: OptionType;
25
- default: boolean;
26
- hasSensitiveValue: boolean;
27
- };
28
- };
29
- executeCore(args: string[]): Promise<string>;
30
- protected validatePlatform(platform: string): void;
31
- protected validateArgs(args: string[], platform: string): Promise<boolean>;
32
- }
33
- export declare class BuildIosCommand extends BuildCommandBase implements ICommand {
34
- protected $options: IOptions;
35
- protected $migrateController: IMigrateController;
36
- allowedParameters: ICommandParameter[];
37
- constructor($options: IOptions, $errors: IErrors, $projectData: IProjectData, $platformsDataService: IPlatformsDataService, $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, $buildController: IBuildController, $platformValidationService: IPlatformValidationService, $logger: ILogger, $buildDataService: IBuildDataService, $migrateController: IMigrateController);
38
- execute(args: string[]): Promise<void>;
39
- canExecute(args: string[]): Promise<boolean>;
40
- }
41
- export declare class BuildAndroidCommand extends BuildCommandBase implements ICommand {
42
- protected $options: IOptions;
43
- protected $errors: IErrors;
44
- protected $androidBundleValidatorHelper: IAndroidBundleValidatorHelper;
45
- protected $logger: ILogger;
46
- private $migrateController;
47
- allowedParameters: ICommandParameter[];
48
- constructor($options: IOptions, $errors: IErrors, $projectData: IProjectData, platformsDataService: IPlatformsDataService, $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, $buildController: IBuildController, $platformValidationService: IPlatformValidationService, $androidBundleValidatorHelper: IAndroidBundleValidatorHelper, $buildDataService: IBuildDataService, $logger: ILogger, $migrateController: IMigrateController);
49
- execute(args: string[]): Promise<void>;
50
- canExecute(args: string[]): Promise<boolean>;
51
- }
52
- export declare class BuildVisionOsCommand extends BuildIosCommand implements ICommand {
53
- protected $options: IOptions;
54
- protected $migrateController: IMigrateController;
55
- constructor($options: IOptions, $errors: IErrors, $projectData: IProjectData, $platformsDataService: IPlatformsDataService, $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, $buildController: IBuildController, $platformValidationService: IPlatformValidationService, $logger: ILogger, $buildDataService: IBuildDataService, $migrateController: IMigrateController);
56
- execute(args: string[]): Promise<void>;
57
- canExecute(args: string[]): Promise<boolean>;
58
- }
1
+ export declare const iosBuildCommand: import("../common/define-command").NamedCommand<{
2
+ watch: import("../common/define-command").DefaultedCommandOptionSpec<boolean>;
3
+ hmr: import("../common/define-command").DefaultedCommandOptionSpec<boolean>;
4
+ force: import("../common/define-command").CommandOptionSpec<boolean>;
5
+ release: import("../common/define-command").CommandOptionSpec<boolean>;
6
+ aab: import("../common/define-command").CommandOptionSpec<boolean>;
7
+ keyStorePath: import("../common/define-command").CommandOptionSpec<string>;
8
+ keyStorePassword: import("../common/define-command").CommandOptionSpec<string>;
9
+ keyStoreAlias: import("../common/define-command").CommandOptionSpec<string>;
10
+ keyStoreAliasPassword: import("../common/define-command").CommandOptionSpec<string>;
11
+ provision: import("../common/define-command").CommandOptionSpec<any>;
12
+ teamId: import("../common/define-command").CommandOptionSpec<any>;
13
+ }, string, void, "build|ios">;
14
+ export declare const androidBuildCommand: import("../common/define-command").NamedCommand<{
15
+ watch: import("../common/define-command").DefaultedCommandOptionSpec<boolean>;
16
+ hmr: import("../common/define-command").DefaultedCommandOptionSpec<boolean>;
17
+ force: import("../common/define-command").CommandOptionSpec<boolean>;
18
+ release: import("../common/define-command").CommandOptionSpec<boolean>;
19
+ aab: import("../common/define-command").CommandOptionSpec<boolean>;
20
+ keyStorePath: import("../common/define-command").CommandOptionSpec<string>;
21
+ keyStorePassword: import("../common/define-command").CommandOptionSpec<string>;
22
+ keyStoreAlias: import("../common/define-command").CommandOptionSpec<string>;
23
+ keyStoreAliasPassword: import("../common/define-command").CommandOptionSpec<string>;
24
+ provision: import("../common/define-command").CommandOptionSpec<any>;
25
+ teamId: import("../common/define-command").CommandOptionSpec<any>;
26
+ }, string, void, "build|android">;
27
+ export declare const visionBuildCommand: import("../common/define-command").NamedCommand<{
28
+ watch: import("../common/define-command").DefaultedCommandOptionSpec<boolean>;
29
+ hmr: import("../common/define-command").DefaultedCommandOptionSpec<boolean>;
30
+ force: import("../common/define-command").CommandOptionSpec<boolean>;
31
+ release: import("../common/define-command").CommandOptionSpec<boolean>;
32
+ aab: import("../common/define-command").CommandOptionSpec<boolean>;
33
+ keyStorePath: import("../common/define-command").CommandOptionSpec<string>;
34
+ keyStorePassword: import("../common/define-command").CommandOptionSpec<string>;
35
+ keyStoreAlias: import("../common/define-command").CommandOptionSpec<string>;
36
+ keyStoreAliasPassword: import("../common/define-command").CommandOptionSpec<string>;
37
+ provision: import("../common/define-command").CommandOptionSpec<any>;
38
+ teamId: import("../common/define-command").CommandOptionSpec<any>;
39
+ }, string, void, readonly ["build|vision", "build|visionos"]>;
@@ -1,146 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuildVisionOsCommand = exports.BuildAndroidCommand = exports.BuildIosCommand = exports.BuildCommandBase = void 0;
3
+ exports.visionBuildCommand = exports.androidBuildCommand = exports.iosBuildCommand = void 0;
4
4
  const constants_1 = require("../constants");
5
5
  const command_base_1 = require("./command-base");
6
6
  const helpers_1 = require("../common/helpers");
7
- const enums_1 = require("../common/enums");
8
- const yok_1 = require("../common/yok");
9
- class BuildCommandBase extends command_base_1.ValidatePlatformCommandBase {
10
- constructor($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $buildDataService, $logger) {
11
- super($options, $platformsDataService, $platformValidationService, $projectData);
12
- this.$errors = $errors;
13
- this.$devicePlatformsConstants = $devicePlatformsConstants;
14
- this.$buildController = $buildController;
15
- this.$buildDataService = $buildDataService;
16
- this.$logger = $logger;
17
- this.dashedOptions = {
18
- watch: {
19
- type: enums_1.OptionType.Boolean,
20
- default: false,
21
- hasSensitiveValue: false,
22
- },
23
- hmr: { type: enums_1.OptionType.Boolean, default: false, hasSensitiveValue: false },
24
- };
25
- this.$projectData.initializeProjectData();
26
- }
27
- async executeCore(args) {
28
- const platform = args[0].toLowerCase();
29
- const buildData = this.$buildDataService.getBuildData(this.$projectData.projectDir, platform, this.$options);
30
- const outputPath = await this.$buildController.prepareAndBuild(buildData);
31
- return outputPath;
32
- }
33
- validatePlatform(platform) {
34
- if (!this.$platformValidationService.isPlatformSupportedForOS(platform, this.$projectData)) {
35
- this.$errors.fail(`Applications for platform ${platform} can not be built on this OS`);
36
- }
37
- }
38
- async validateArgs(args, platform) {
39
- if (args.length !== 0) {
40
- this.$errors.failWithHelp(`The arguments '${args.join(" ")}' are not valid for the current command.`);
41
- }
42
- const result = await this.$platformValidationService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, platform);
43
- return result;
44
- }
45
- }
46
- exports.BuildCommandBase = BuildCommandBase;
47
- class BuildIosCommand extends BuildCommandBase {
48
- constructor($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $logger, $buildDataService, $migrateController) {
49
- super($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $buildDataService, $logger);
50
- this.$options = $options;
51
- this.$migrateController = $migrateController;
52
- this.allowedParameters = [];
53
- }
54
- async execute(args) {
55
- await this.executeCore([this.$devicePlatformsConstants.iOS.toLowerCase()]);
56
- }
57
- async canExecute(args) {
58
- const platform = this.$devicePlatformsConstants.iOS;
59
- if (!this.$options.force) {
60
- await this.$migrateController.validate({
61
- projectDir: this.$projectData.projectDir,
7
+ const define_command_1 = require("../common/define-command");
8
+ const di_1 = require("../common/di");
9
+ const project_data_1 = require("../contracts/project-data");
10
+ const buildCommandOptions = {
11
+ ...command_base_1.platformSigningOptions,
12
+ watch: (0, define_command_1.booleanOption)({ default: false }),
13
+ hmr: (0, define_command_1.booleanOption)({ default: false }),
14
+ force: (0, define_command_1.booleanOption)(),
15
+ release: (0, define_command_1.booleanOption)(),
16
+ aab: (0, define_command_1.booleanOption)(),
17
+ keyStorePath: (0, define_command_1.stringOption)(),
18
+ keyStorePassword: (0, define_command_1.stringOption)(),
19
+ keyStoreAlias: (0, define_command_1.stringOption)(),
20
+ keyStoreAliasPassword: (0, define_command_1.stringOption)(),
21
+ };
22
+ const defineBuildCommand = (name, buildPlatform) => (0, define_command_1.defineCommand)({
23
+ name,
24
+ description: "Builds the project for the selected target platform.",
25
+ options: buildCommandOptions,
26
+ params: "none",
27
+ providers: [(0, command_base_1.provideProject)()],
28
+ async canExecute(context) {
29
+ const $devicePlatformsConstants = (0, di_1.inject)("devicePlatformsConstants");
30
+ const $migrateController = (0, di_1.inject)("migrateController");
31
+ const $platformValidationService = (0, di_1.inject)("platformValidationService");
32
+ const $projectData = (0, di_1.inject)(project_data_1.ProjectData);
33
+ const platform = $devicePlatformsConstants[buildPlatform];
34
+ const isAndroid = $devicePlatformsConstants.isAndroid(platform);
35
+ const $androidBundleValidatorHelper = isAndroid
36
+ ? (0, di_1.inject)("androidBundleValidatorHelper")
37
+ : null;
38
+ if (!context.options.force) {
39
+ await $migrateController.validate({
40
+ projectDir: $projectData.projectDir,
62
41
  platforms: [platform],
63
42
  });
64
43
  }
65
- super.validatePlatform(platform);
66
- let canExecute = await super.canExecuteCommandBase(platform);
67
- if (canExecute) {
68
- canExecute = await super.validateArgs(args, platform);
44
+ if (isAndroid) {
45
+ $androidBundleValidatorHelper.validateRuntimeVersion($projectData);
69
46
  }
70
- return canExecute;
71
- }
72
- }
73
- exports.BuildIosCommand = BuildIosCommand;
74
- yok_1.injector.registerCommand("build|ios", BuildIosCommand);
75
- class BuildAndroidCommand extends BuildCommandBase {
76
- constructor($options, $errors, $projectData, platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $androidBundleValidatorHelper, $buildDataService, $logger, $migrateController) {
77
- super($options, $errors, $projectData, platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $buildDataService, $logger);
78
- this.$options = $options;
79
- this.$errors = $errors;
80
- this.$androidBundleValidatorHelper = $androidBundleValidatorHelper;
81
- this.$logger = $logger;
82
- this.$migrateController = $migrateController;
83
- this.allowedParameters = [];
84
- }
85
- async execute(args) {
86
- await this.executeCore([
87
- this.$devicePlatformsConstants.Android.toLowerCase(),
88
- ]);
89
- if (this.$options.aab) {
90
- this.$logger.info(constants_1.AndroidAppBundleMessages.ANDROID_APP_BUNDLE_DOCS_MESSAGE);
91
- if (this.$options.release) {
92
- this.$logger.info(constants_1.AndroidAppBundleMessages.ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE);
93
- }
94
- }
95
- }
96
- async canExecute(args) {
97
- const platform = this.$devicePlatformsConstants.Android;
98
- if (!this.$options.force) {
99
- await this.$migrateController.validate({
100
- projectDir: this.$projectData.projectDir,
101
- platforms: [platform],
102
- });
47
+ else if (!$platformValidationService.isPlatformSupportedForOS(platform, $projectData)) {
48
+ context.fail(`Applications for platform ${platform} can not be built on this OS`, { help: false });
103
49
  }
104
- this.$androidBundleValidatorHelper.validateRuntimeVersion(this.$projectData);
105
- let canExecute = await super.canExecuteCommandBase(platform);
106
- if (canExecute) {
107
- if (this.$options.release && !(0, helpers_1.hasValidAndroidSigning)(this.$options)) {
108
- this.$errors.failWithHelp(constants_1.ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
109
- }
110
- canExecute = await super.validateArgs(args, platform);
50
+ if (!(await (0, command_base_1.canExecuteCommandBase)(context, platform))) {
51
+ return false;
111
52
  }
112
- return canExecute;
113
- }
114
- }
115
- exports.BuildAndroidCommand = BuildAndroidCommand;
116
- yok_1.injector.registerCommand("build|android", BuildAndroidCommand);
117
- class BuildVisionOsCommand extends BuildIosCommand {
118
- constructor($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $logger, $buildDataService, $migrateController) {
119
- super($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $logger, $buildDataService, $migrateController);
120
- this.$options = $options;
121
- this.$migrateController = $migrateController;
122
- }
123
- async execute(args) {
124
- await this.executeCore([
125
- this.$devicePlatformsConstants.visionOS.toLowerCase(),
126
- ]);
127
- }
128
- async canExecute(args) {
129
- const platform = this.$devicePlatformsConstants.visionOS;
130
- if (!this.$options.force) {
131
- await this.$migrateController.validate({
132
- projectDir: this.$projectData.projectDir,
133
- platforms: [platform],
134
- });
53
+ if (isAndroid &&
54
+ context.options.release &&
55
+ !(0, helpers_1.hasValidAndroidSigning)(context.options)) {
56
+ context.fail(constants_1.ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
135
57
  }
136
- super.validatePlatform(platform);
137
- let canExecute = await super.canExecuteCommandBase(platform);
138
- if (canExecute) {
139
- canExecute = await super.validateArgs(args, platform);
58
+ return (0, command_base_1.validatePlatformOptions)(context, platform);
59
+ },
60
+ async run(context) {
61
+ const $buildController = (0, di_1.inject)("buildController");
62
+ const $buildDataService = (0, di_1.inject)("buildDataService");
63
+ const $devicePlatformsConstants = (0, di_1.inject)("devicePlatformsConstants");
64
+ const $logger = (0, di_1.inject)("logger");
65
+ const $options = (0, di_1.inject)("options");
66
+ const $projectData = (0, di_1.inject)(project_data_1.ProjectData);
67
+ const platform = $devicePlatformsConstants[buildPlatform];
68
+ const isAndroid = $devicePlatformsConstants.isAndroid(platform);
69
+ const buildData = $buildDataService.getBuildData($projectData.projectDir, platform.toLowerCase(), $options);
70
+ const outputPath = await $buildController.prepareAndBuild(buildData);
71
+ if (isAndroid && context.options.aab) {
72
+ $logger.info(constants_1.AndroidAppBundleMessages.ANDROID_APP_BUNDLE_DOCS_MESSAGE);
73
+ if (context.options.release) {
74
+ $logger.info(constants_1.AndroidAppBundleMessages.ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE);
75
+ }
140
76
  }
141
- return canExecute;
142
- }
143
- }
144
- exports.BuildVisionOsCommand = BuildVisionOsCommand;
145
- yok_1.injector.registerCommand("build|vision", BuildVisionOsCommand);
146
- yok_1.injector.registerCommand("build|visionos", BuildVisionOsCommand);
77
+ return outputPath;
78
+ },
79
+ });
80
+ exports.iosBuildCommand = defineBuildCommand("build|ios", "iOS");
81
+ exports.androidBuildCommand = defineBuildCommand("build|android", "Android");
82
+ exports.visionBuildCommand = defineBuildCommand(["build|vision", "build|visionos"], "visionOS");
@@ -1,22 +1,4 @@
1
- import { ICommand, ICommandParameter } from "../common/definitions/commands";
2
- import { IProjectCleanupService, IProjectConfigService, IProjectData, IProjectService } from "../definitions/project";
3
- import { IOptions, IStaticConfig } from "../declarations";
4
- import { ITerminalSpinnerService } from "../definitions/terminal-spinner-service";
5
- import { IChildProcess } from "../common/declarations";
6
- export declare class CleanCommand implements ICommand {
7
- private $projectCleanupService;
8
- private $projectConfigService;
9
- private $projectData;
10
- private $terminalSpinnerService;
11
- private $projectService;
12
- private $prompter;
13
- private $logger;
14
- private $options;
15
- private $childProcess;
16
- private $staticConfig;
17
- allowedParameters: ICommandParameter[];
18
- constructor($projectCleanupService: IProjectCleanupService, $projectConfigService: IProjectConfigService, $projectData: IProjectData, $terminalSpinnerService: ITerminalSpinnerService, $projectService: IProjectService, $prompter: IPrompter, $logger: ILogger, $options: IOptions, $childProcess: IChildProcess, $staticConfig: IStaticConfig);
19
- execute(args: string[]): Promise<void>;
20
- private cleanMultipleProjects;
21
- private getNSProjectPathsInDirectory;
22
- }
1
+ export declare const cleanCommandDefinition: import("../common/define-command").NamedCommand<{
2
+ dryRun: import("../common/define-command").CommandOptionSpec<boolean>;
3
+ json: import("../common/define-command").CommandOptionSpec<boolean>;
4
+ }, void, void, "clean">;