@webiny/cli-core 6.3.0 → 6.4.0-beta.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 (255) hide show
  1. package/Cli.js +12 -11
  2. package/Cli.js.map +1 -1
  3. package/abstractions/createAbstraction.js +3 -2
  4. package/abstractions/createAbstraction.js.map +1 -1
  5. package/abstractions/features/CliCommand.js +2 -4
  6. package/abstractions/features/CliCommand.js.map +1 -1
  7. package/abstractions/features/ErrorHandler.js +2 -1
  8. package/abstractions/features/ErrorHandler.js.map +1 -1
  9. package/abstractions/features/GlobalCliOption.js +2 -1
  10. package/abstractions/features/GlobalCliOption.js.map +1 -1
  11. package/abstractions/features/IsCi.js +2 -1
  12. package/abstractions/features/IsCi.js.map +1 -1
  13. package/abstractions/features/index.js +0 -2
  14. package/abstractions/features/types.js +0 -3
  15. package/abstractions/index.js +0 -2
  16. package/abstractions/services/ArgvParserService.js +2 -1
  17. package/abstractions/services/ArgvParserService.js.map +1 -1
  18. package/abstractions/services/CliParamsService.js +2 -1
  19. package/abstractions/services/CliParamsService.js.map +1 -1
  20. package/abstractions/services/CommandsRegistryService.js +2 -1
  21. package/abstractions/services/CommandsRegistryService.js.map +1 -1
  22. package/abstractions/services/GetArgvService.js +2 -1
  23. package/abstractions/services/GetArgvService.js.map +1 -1
  24. package/abstractions/services/GetCliRunnerService.js +2 -1
  25. package/abstractions/services/GetCliRunnerService.js.map +1 -1
  26. package/abstractions/services/GetIsCiService.js +2 -1
  27. package/abstractions/services/GetIsCiService.js.map +1 -1
  28. package/abstractions/services/GetProjectSdkService.js +2 -1
  29. package/abstractions/services/GetProjectSdkService.js.map +1 -1
  30. package/abstractions/services/GlobalOptionsRegistryService.js +2 -1
  31. package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -1
  32. package/abstractions/services/LoggerService.js +2 -1
  33. package/abstractions/services/LoggerService.js.map +1 -1
  34. package/abstractions/services/RunCliRunnerService.js +2 -1
  35. package/abstractions/services/RunCliRunnerService.js.map +1 -1
  36. package/abstractions/services/StdioService.js +2 -1
  37. package/abstractions/services/StdioService.js.map +1 -1
  38. package/abstractions/services/UiService.js +2 -1
  39. package/abstractions/services/UiService.js.map +1 -1
  40. package/abstractions/services/index.js +0 -2
  41. package/createCliContainer.js +87 -113
  42. package/createCliContainer.js.map +1 -1
  43. package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
  44. package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
  45. package/decorators/DeployCommandWithTelemetry.js +72 -82
  46. package/decorators/DeployCommandWithTelemetry.js.map +1 -1
  47. package/decorators/index.js +0 -2
  48. package/exports/cli/command.js +0 -2
  49. package/exports/cli.js +0 -2
  50. package/extensions/CliCommand.js +15 -18
  51. package/extensions/CliCommand.js.map +1 -1
  52. package/extensions/CliCommandDecorator.js +15 -18
  53. package/extensions/CliCommandDecorator.js.map +1 -1
  54. package/extensions/index.js +5 -2
  55. package/extensions/index.js.map +1 -1
  56. package/features/AboutCommand.js +80 -86
  57. package/features/AboutCommand.js.map +1 -1
  58. package/features/BuildCommand/BuildCommand.js +46 -36
  59. package/features/BuildCommand/BuildCommand.js.map +1 -1
  60. package/features/BuildCommand/buildRunners/BaseBuildRunner.js +10 -13
  61. package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -1
  62. package/features/BuildCommand/buildRunners/BuildRunner.js +18 -21
  63. package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -1
  64. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +20 -19
  65. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -1
  66. package/features/BuildCommand/buildRunners/SingleBuildRunner.js +15 -14
  67. package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -1
  68. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +3 -4
  69. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -1
  70. package/features/BuildCommand/index.js +0 -2
  71. package/features/ConfigCommand.js +55 -56
  72. package/features/ConfigCommand.js.map +1 -1
  73. package/features/DeployCommand/DeployCommand.js +162 -156
  74. package/features/DeployCommand/DeployCommand.js.map +1 -1
  75. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +12 -17
  76. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -1
  77. package/features/DeployCommand/deployOutputs/DeployOutput.js +16 -17
  78. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -1
  79. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +89 -54
  80. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -1
  81. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +24 -37
  82. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -1
  83. package/features/DeployCommand/index.js +0 -2
  84. package/features/DepsSync/BuildDependencyTree.js +16 -21
  85. package/features/DepsSync/BuildDependencyTree.js.map +1 -1
  86. package/features/DepsSync/DependencyTree.js +108 -126
  87. package/features/DepsSync/DependencyTree.js.map +1 -1
  88. package/features/DepsSync/ListAllPackageJsonFiles.js +19 -14
  89. package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -1
  90. package/features/DepsSync/ListAllPackages.js +7 -9
  91. package/features/DepsSync/ListAllPackages.js.map +1 -1
  92. package/features/DepsSync/commands/SyncDepsCommand.js +30 -24
  93. package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -1
  94. package/features/DepsSync/commands/VerifyDepsCommand.js +69 -70
  95. package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
  96. package/features/DepsSync/createDependencyTree.js +25 -18
  97. package/features/DepsSync/createDependencyTree.js.map +1 -1
  98. package/features/DepsSync/createReferenceFile.js +21 -25
  99. package/features/DepsSync/createReferenceFile.js.map +1 -1
  100. package/features/DepsSync/index.js +0 -2
  101. package/features/DepsSync/paths.js +3 -6
  102. package/features/DepsSync/paths.js.map +1 -1
  103. package/features/DepsSync/types.js +7 -6
  104. package/features/DepsSync/types.js.map +1 -1
  105. package/features/DestroyCommand/DestroyCommand.js +71 -67
  106. package/features/DestroyCommand/DestroyCommand.js.map +1 -1
  107. package/features/DestroyCommand/index.js +0 -2
  108. package/features/DisableTelemetryCommand.js +28 -25
  109. package/features/DisableTelemetryCommand.js.map +1 -1
  110. package/features/EnableTelemetryCommand.js +28 -25
  111. package/features/EnableTelemetryCommand.js.map +1 -1
  112. package/features/ExtensionCommand/ExtensionCommand.js +60 -63
  113. package/features/ExtensionCommand/ExtensionCommand.js.map +1 -1
  114. package/features/ExtensionCommand/index.js +0 -2
  115. package/features/InfoCommand/InfoCommand.js +54 -56
  116. package/features/InfoCommand/InfoCommand.js.map +1 -1
  117. package/features/InfoCommand/PrintInfoForEnv.js +31 -47
  118. package/features/InfoCommand/PrintInfoForEnv.js.map +1 -1
  119. package/features/InfoCommand/index.js +0 -2
  120. package/features/IsCi/IsCi.js +14 -11
  121. package/features/IsCi/IsCi.js.map +1 -1
  122. package/features/IsCi/index.js +1 -3
  123. package/features/OpenCommand.js +48 -47
  124. package/features/OpenCommand.js.map +1 -1
  125. package/features/OutputCommand.js +56 -69
  126. package/features/OutputCommand.js.map +1 -1
  127. package/features/PulumiCommand/PulumiCommand.js +48 -41
  128. package/features/PulumiCommand/PulumiCommand.js.map +1 -1
  129. package/features/PulumiCommand/index.js +0 -2
  130. package/features/RefreshCommand/RefreshCommand.js +42 -36
  131. package/features/RefreshCommand/RefreshCommand.js.map +1 -1
  132. package/features/RefreshCommand/index.js +0 -2
  133. package/features/UpgradeCommand/UpgradeCommand.js +112 -101
  134. package/features/UpgradeCommand/UpgradeCommand.js.map +1 -1
  135. package/features/UpgradeCommand/UpgradeCommandHandler.js +90 -101
  136. package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -1
  137. package/features/UpgradeCommand/abstraction.js +2 -1
  138. package/features/UpgradeCommand/abstraction.js.map +1 -1
  139. package/features/UpgradeCommand/feature.js +7 -6
  140. package/features/UpgradeCommand/feature.js.map +1 -1
  141. package/features/UpgradeCommand/index.js +0 -2
  142. package/features/WatchCommand/WatchCommand.js +131 -131
  143. package/features/WatchCommand/WatchCommand.js.map +1 -1
  144. package/features/WatchCommand/createPrefixer.js +11 -15
  145. package/features/WatchCommand/createPrefixer.js.map +1 -1
  146. package/features/WatchCommand/getRandomColorForString.js +86 -8
  147. package/features/WatchCommand/getRandomColorForString.js.map +1 -1
  148. package/features/WatchCommand/index.js +0 -2
  149. package/features/Wcp/LinkProjectCommand.js +119 -138
  150. package/features/Wcp/LinkProjectCommand.js.map +1 -1
  151. package/features/Wcp/LoginCommand.js +104 -118
  152. package/features/Wcp/LoginCommand.js.map +1 -1
  153. package/features/Wcp/LogoutCommand.js +29 -23
  154. package/features/Wcp/LogoutCommand.js.map +1 -1
  155. package/features/Wcp/WhoAmICommand.js +33 -29
  156. package/features/Wcp/WhoAmICommand.js.map +1 -1
  157. package/features/common/index.js +0 -2
  158. package/features/common/options.js +41 -50
  159. package/features/common/options.js.map +1 -1
  160. package/features/globalOptions/LogLevelGlobalOption.js +25 -16
  161. package/features/globalOptions/LogLevelGlobalOption.js.map +1 -1
  162. package/features/globalOptions/ShowLogsGlobalOption.js +16 -15
  163. package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -1
  164. package/features/globalOptions/StackTraceGlobalOption.js +16 -15
  165. package/features/globalOptions/StackTraceGlobalOption.js.map +1 -1
  166. package/features/globalOptions/index.js +0 -2
  167. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +17 -16
  168. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -1
  169. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
  170. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
  171. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +19 -19
  172. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -1
  173. package/features/gracefulErrorHandlers/index.js +0 -2
  174. package/features/index.js +0 -2
  175. package/features/utils/index.js +0 -2
  176. package/features/utils/measureDuration.js +7 -8
  177. package/features/utils/measureDuration.js.map +1 -1
  178. package/index.js +0 -2
  179. package/package.json +11 -11
  180. package/services/ArgvParserService/ArgvParserService.js +27 -33
  181. package/services/ArgvParserService/ArgvParserService.js.map +1 -1
  182. package/services/ArgvParserService/index.js +0 -2
  183. package/services/CliParamsService/CliParamsService.js +18 -15
  184. package/services/CliParamsService/CliParamsService.js.map +1 -1
  185. package/services/CliParamsService/index.js +0 -2
  186. package/services/CommandsRegistryService/CommandsRegistryService.js +19 -13
  187. package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -1
  188. package/services/CommandsRegistryService/index.js +0 -2
  189. package/services/GetArgvService/GetArgvService.js +14 -11
  190. package/services/GetArgvService/GetArgvService.js.map +1 -1
  191. package/services/GetArgvService/index.js +0 -2
  192. package/services/GetCliRunnerService/GetCliRunnerService.js +119 -155
  193. package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -1
  194. package/services/GetCliRunnerService/index.js +0 -2
  195. package/services/GetIsCiService/GetIsCiService.js +9 -8
  196. package/services/GetIsCiService/GetIsCiService.js.map +1 -1
  197. package/services/GetIsCiService/index.js +1 -3
  198. package/services/GetProjectSdkService/GetProjectSdkService.js +25 -24
  199. package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -1
  200. package/services/GetProjectSdkService/index.js +0 -2
  201. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -13
  202. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -1
  203. package/services/GlobalOptionsRegistryService/index.js +0 -2
  204. package/services/LoggerService/LoggerService.js +75 -87
  205. package/services/LoggerService/LoggerService.js.map +1 -1
  206. package/services/LoggerService/index.js +0 -2
  207. package/services/RunCliRunnerService/RunCliRunnerService.js +15 -13
  208. package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -1
  209. package/services/RunCliRunnerService/index.js +0 -2
  210. package/services/StdioService/StdioService.js +15 -14
  211. package/services/StdioService/StdioService.js.map +1 -1
  212. package/services/StdioService/index.js +0 -2
  213. package/services/UiService/UiService.js +55 -58
  214. package/services/UiService/UiService.js.map +1 -1
  215. package/services/UiService/index.js +0 -2
  216. package/services/index.js +0 -2
  217. package/utils/ManuallyReportedError.js +7 -6
  218. package/utils/ManuallyReportedError.js.map +1 -1
  219. package/abstractions/features/index.js.map +0 -1
  220. package/abstractions/features/types.js.map +0 -1
  221. package/abstractions/index.js.map +0 -1
  222. package/abstractions/services/index.js.map +0 -1
  223. package/decorators/index.js.map +0 -1
  224. package/exports/cli/command.js.map +0 -1
  225. package/exports/cli.js.map +0 -1
  226. package/features/BuildCommand/index.js.map +0 -1
  227. package/features/DeployCommand/index.js.map +0 -1
  228. package/features/DepsSync/index.js.map +0 -1
  229. package/features/DestroyCommand/index.js.map +0 -1
  230. package/features/ExtensionCommand/index.js.map +0 -1
  231. package/features/InfoCommand/index.js.map +0 -1
  232. package/features/IsCi/index.js.map +0 -1
  233. package/features/PulumiCommand/index.js.map +0 -1
  234. package/features/RefreshCommand/index.js.map +0 -1
  235. package/features/UpgradeCommand/index.js.map +0 -1
  236. package/features/WatchCommand/index.js.map +0 -1
  237. package/features/common/index.js.map +0 -1
  238. package/features/globalOptions/index.js.map +0 -1
  239. package/features/gracefulErrorHandlers/index.js.map +0 -1
  240. package/features/index.js.map +0 -1
  241. package/features/utils/index.js.map +0 -1
  242. package/index.js.map +0 -1
  243. package/services/ArgvParserService/index.js.map +0 -1
  244. package/services/CliParamsService/index.js.map +0 -1
  245. package/services/CommandsRegistryService/index.js.map +0 -1
  246. package/services/GetArgvService/index.js.map +0 -1
  247. package/services/GetCliRunnerService/index.js.map +0 -1
  248. package/services/GetIsCiService/index.js.map +0 -1
  249. package/services/GetProjectSdkService/index.js.map +0 -1
  250. package/services/GlobalOptionsRegistryService/index.js.map +0 -1
  251. package/services/LoggerService/index.js.map +0 -1
  252. package/services/RunCliRunnerService/index.js.map +0 -1
  253. package/services/StdioService/index.js.map +0 -1
  254. package/services/UiService/index.js.map +0 -1
  255. package/services/index.js.map +0 -1
@@ -1,64 +1,63 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import { CliCommandFactory, GetProjectSdkService, UiService } from "../abstractions/index.js";
3
3
  import { createBaseAppOptions } from "./common/index.js";
4
- export class ConfigCommand {
5
- constructor(getProjectSdkService, uiService) {
6
- this.getProjectSdkService = getProjectSdkService;
7
- this.uiService = uiService;
8
- }
9
- async execute() {
10
- const projectSdk = await this.getProjectSdkService.execute();
11
- return {
12
- name: "config",
13
- description: "Prints the current project configuration",
14
- options: [...createBaseAppOptions(projectSdk), {
15
- name: "extension-type",
16
- alias: "t",
17
- description: "Filter by extension type",
18
- type: "string"
19
- }, {
20
- name: "json",
21
- description: "Emit output as JSON",
22
- type: "boolean",
23
- default: true
24
- }],
25
- handler: async params => {
26
- const ui = this.uiService;
27
-
28
- // Get a ProjectSdk instance with the specified env/region/variant params
29
- // ProjectSdk.init handles caching internally based on these parameters
4
+ class ConfigCommand {
5
+ constructor(getProjectSdkService, uiService){
6
+ this.getProjectSdkService = getProjectSdkService;
7
+ this.uiService = uiService;
8
+ }
9
+ async execute() {
30
10
  const projectSdk = await this.getProjectSdkService.execute();
31
- const projectConfig = await projectSdk.getProjectConfig();
32
-
33
- // Get the extension type from either --extension-type or -t
34
- const extensionType = params.extensionType || params.t;
35
- let output;
36
- if (extensionType) {
37
- // Filter extensions by type
38
- const extensions = projectConfig.config[extensionType];
39
- if (!extensions) {
40
- ui.warning(`Extension type %s not found in configuration.`, extensionType);
41
- ui.emptyLine();
42
- ui.info("Available extension types:");
43
- Object.keys(projectConfig.config).forEach(type => {
44
- ui.text(` - ${type}`);
45
- });
46
- return;
47
- }
48
- output = JSON.stringify(extensions, null, 2);
49
- } else {
50
- // Show full config
51
- output = JSON.stringify(projectConfig.config, null, 2);
52
- }
53
- ui.raw(output);
54
- }
55
- };
56
- }
11
+ return {
12
+ name: "config",
13
+ description: "Prints the current project configuration",
14
+ options: [
15
+ ...createBaseAppOptions(projectSdk),
16
+ {
17
+ name: "extension-type",
18
+ alias: "t",
19
+ description: "Filter by extension type",
20
+ type: "string"
21
+ },
22
+ {
23
+ name: "json",
24
+ description: "Emit output as JSON",
25
+ type: "boolean",
26
+ default: true
27
+ }
28
+ ],
29
+ handler: async (params)=>{
30
+ const ui = this.uiService;
31
+ const projectSdk = await this.getProjectSdkService.execute();
32
+ const projectConfig = await projectSdk.getProjectConfig();
33
+ const extensionType = params.extensionType || params.t;
34
+ let output;
35
+ if (extensionType) {
36
+ const extensions = projectConfig.config[extensionType];
37
+ if (!extensions) {
38
+ ui.warning("Extension type %s not found in configuration.", extensionType);
39
+ ui.emptyLine();
40
+ ui.info("Available extension types:");
41
+ Object.keys(projectConfig.config).forEach((type)=>{
42
+ ui.text(` - ${type}`);
43
+ });
44
+ return;
45
+ }
46
+ output = JSON.stringify(extensions, null, 2);
47
+ } else output = JSON.stringify(projectConfig.config, null, 2);
48
+ ui.raw(output);
49
+ }
50
+ };
51
+ }
57
52
  }
58
- export const configCommand = createImplementation({
59
- abstraction: CliCommandFactory,
60
- implementation: ConfigCommand,
61
- dependencies: [GetProjectSdkService, UiService]
53
+ const configCommand = createImplementation({
54
+ abstraction: CliCommandFactory,
55
+ implementation: ConfigCommand,
56
+ dependencies: [
57
+ GetProjectSdkService,
58
+ UiService
59
+ ]
62
60
  });
61
+ export { ConfigCommand, configCommand };
63
62
 
64
63
  //# sourceMappingURL=ConfigCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","UiService","createBaseAppOptions","ConfigCommand","constructor","getProjectSdkService","uiService","execute","projectSdk","name","description","options","alias","type","default","handler","params","ui","projectConfig","getProjectConfig","extensionType","t","output","extensions","config","warning","emptyLine","info","Object","keys","forEach","text","JSON","stringify","raw","configCommand","abstraction","implementation","dependencies"],"sources":["ConfigCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\n\nexport interface IConfigCommandParams {\n env?: string;\n region?: string;\n variant?: string;\n json?: boolean;\n extensionType?: string;\n t?: string;\n}\n\nexport class ConfigCommand implements CliCommandFactory.Interface<IConfigCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IConfigCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"config\",\n description: \"Prints the current project configuration\",\n options: [\n ...createBaseAppOptions(projectSdk),\n {\n name: \"extension-type\",\n alias: \"t\",\n description: \"Filter by extension type\",\n type: \"string\"\n },\n {\n name: \"json\",\n description: \"Emit output as JSON\",\n type: \"boolean\",\n default: true\n }\n ],\n handler: async (params: IConfigCommandParams) => {\n const ui = this.uiService;\n\n // Get a ProjectSdk instance with the specified env/region/variant params\n // ProjectSdk.init handles caching internally based on these parameters\n const projectSdk = await this.getProjectSdkService.execute();\n\n const projectConfig = await projectSdk.getProjectConfig();\n\n // Get the extension type from either --extension-type or -t\n const extensionType = params.extensionType || params.t;\n\n let output: string;\n if (extensionType) {\n // Filter extensions by type\n const extensions = projectConfig.config[extensionType];\n if (!extensions) {\n ui.warning(`Extension type %s not found in configuration.`, extensionType);\n ui.emptyLine();\n ui.info(\"Available extension types:\");\n Object.keys(projectConfig.config).forEach(type => {\n ui.text(` - ${type}`);\n });\n return;\n }\n output = JSON.stringify(extensions, null, 2);\n } else {\n // Show full config\n output = JSON.stringify(projectConfig.config, null, 2);\n }\n\n ui.raw(output);\n }\n };\n }\n}\n\nexport const configCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: ConfigCommand,\n dependencies: [GetProj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Q,OAAO,CAAC,+CAA+C,EAAEL,aAAa,CAAC;YAC1EH,EAAE,CAACS,SAAS,CAAC,CAAC;YACdT,EAAE,CAACU,IAAI,CAAC,4BAA4B,CAAC;YACrCC,MAAM,CAACC,IAAI,CAACX,aAAa,CAACM,MAAM,CAAC,CAACM,OAAO,CAACjB,IAAI,IAAI;cAC9CI,EAAE,CAACc,IAAI,CAAC,OAAOlB,IAAI,EAAE,CAAC;YAC1B,CAAC,CAAC;YACF;UACJ;UACAS,MAAM,GAAGU,IAAI,CAACC,SAAS,CAACV,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC,MAAM;UACH;UACAD,MAAM,GAAGU,IAAI,CAACC,SAAS,CAACf,aAAa,CAACM,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D;QAEAP,EAAE,CAACiB,GAAG,CAACZ,MAAM,CAAC;MAClB;IACJ,CAAC;EACL;AACJ;AAEA,OAAO,MAAMa,aAAa,GAAGrC,oBAAoB,CAAC;EAC9CsC,WAAW,EAAErC,iBAAiB;EAC9BsC,cAAc,EAAElC,aAAa;EAC7BmC,YAAY,EAAE,CAACtC,oBAAoB,EAAEC,SAAS;AAClD,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/ConfigCommand.js","sources":["../../src/features/ConfigCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\n\nexport interface IConfigCommandParams {\n env?: string;\n region?: string;\n variant?: string;\n json?: boolean;\n extensionType?: string;\n t?: string;\n}\n\nexport class ConfigCommand implements CliCommandFactory.Interface<IConfigCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IConfigCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"config\",\n description: \"Prints the current project configuration\",\n options: [\n ...createBaseAppOptions(projectSdk),\n {\n name: \"extension-type\",\n alias: \"t\",\n description: \"Filter by extension type\",\n type: \"string\"\n },\n {\n name: \"json\",\n description: \"Emit output as JSON\",\n type: \"boolean\",\n default: true\n }\n ],\n handler: async (params: IConfigCommandParams) => {\n const ui = this.uiService;\n\n // Get a ProjectSdk instance with the specified env/region/variant params\n // ProjectSdk.init handles caching internally based on these parameters\n const projectSdk = await this.getProjectSdkService.execute();\n\n const projectConfig = await projectSdk.getProjectConfig();\n\n // Get the extension type from either --extension-type or -t\n const extensionType = params.extensionType || params.t;\n\n let output: string;\n if (extensionType) {\n // Filter extensions by type\n const extensions = projectConfig.config[extensionType];\n if (!extensions) {\n ui.warning(`Extension type %s not found in configuration.`, extensionType);\n ui.emptyLine();\n ui.info(\"Available extension types:\");\n Object.keys(projectConfig.config).forEach(type => {\n ui.text(` - ${type}`);\n });\n return;\n }\n output = JSON.stringify(extensions, null, 2);\n } else {\n // Show full config\n output = JSON.stringify(projectConfig.config, null, 2);\n }\n\n ui.raw(output);\n }\n };\n }\n}\n\nexport const configCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: ConfigCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"names":["ConfigCommand","getProjectSdkService","uiService","projectSdk","createBaseAppOptions","params","ui","projectConfig","extensionType","output","extensions","Object","type","JSON","configCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService"],"mappings":";;;AAaO,MAAMA;IACT,YACYC,oBAAoD,EACpDC,SAA8B,CACxC;aAFUD,oBAAoB,GAApBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAA8E;QAChF,MAAMC,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;QAE1D,OAAO;YACH,MAAM;YACN,aAAa;YACb,SAAS;mBACFC,qBAAqBD;gBACxB;oBACI,MAAM;oBACN,OAAO;oBACP,aAAa;oBACb,MAAM;gBACV;gBACA;oBACI,MAAM;oBACN,aAAa;oBACb,MAAM;oBACN,SAAS;gBACb;aACH;YACD,SAAS,OAAOE;gBACZ,MAAMC,KAAK,IAAI,CAAC,SAAS;gBAIzB,MAAMH,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;gBAE1D,MAAMI,gBAAgB,MAAMJ,WAAW,gBAAgB;gBAGvD,MAAMK,gBAAgBH,OAAO,aAAa,IAAIA,OAAO,CAAC;gBAEtD,IAAII;gBACJ,IAAID,eAAe;oBAEf,MAAME,aAAaH,cAAc,MAAM,CAACC,cAAc;oBACtD,IAAI,CAACE,YAAY;wBACbJ,GAAG,OAAO,CAAC,iDAAiDE;wBAC5DF,GAAG,SAAS;wBACZA,GAAG,IAAI,CAAC;wBACRK,OAAO,IAAI,CAACJ,cAAc,MAAM,EAAE,OAAO,CAACK,CAAAA;4BACtCN,GAAG,IAAI,CAAC,CAAC,IAAI,EAAEM,MAAM;wBACzB;wBACA;oBACJ;oBACAH,SAASI,KAAK,SAAS,CAACH,YAAY,MAAM;gBAC9C,OAEID,SAASI,KAAK,SAAS,CAACN,cAAc,MAAM,EAAE,MAAM;gBAGxDD,GAAG,GAAG,CAACG;YACX;QACJ;IACJ;AACJ;AAEO,MAAMK,gBAAgBC,qBAAqB;IAC9C,aAAaC;IACb,gBAAgBhB;IAChB,cAAc;QAACiB;QAAsBC;KAAU;AACnD"}
@@ -1,170 +1,176 @@
1
1
  import { createImplementation } from "@webiny/di";
2
- import { setTimeout } from "node:timers/promises";
3
- import open from "open";
2
+ import { setTimeout as promises_setTimeout } from "node:timers/promises";
3
+ import open_0 from "open";
4
4
  import ora from "ora";
5
5
  import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
6
6
  import { BuildRunner } from "../BuildCommand/buildRunners/BuildRunner.js";
7
7
  import { createBaseAppOptions } from "../common/index.js";
8
8
  import { DeployOutput } from "./deployOutputs/DeployOutput.js";
9
-
10
- // TODO: convert to a real service.
11
9
  import { PrintInfoForEnv } from "../InfoCommand/PrintInfoForEnv.js";
12
- const sleep = (ms = 1500) => setTimeout(ms);
13
- export class DeployCommand {
14
- constructor(getProjectSdkService, uiService, stdioService) {
15
- this.getProjectSdkService = getProjectSdkService;
16
- this.uiService = uiService;
17
- this.stdioService = stdioService;
18
- }
19
- async execute() {
20
- const projectSdk = await this.getProjectSdkService.execute();
21
- const ui = this.uiService;
22
- return {
23
- name: "deploy",
24
- description: "Deploys specified app or all apps in the project",
25
- examples: ["$0 deploy api --env dev", "$0 deploy core api --env dev", "$0 deploy admin --env prod", "$0 deploy --env prod", "$0 deploy"],
26
- params: [{
27
- name: "apps",
28
- description: "Name of the app(s) to deploy (core, admin, or api). You can specify multiple apps.",
29
- type: "string",
30
- array: true
31
- }],
32
- options: [...createBaseAppOptions(projectSdk), {
33
- name: "build",
34
- description: "Build packages before deploying",
35
- type: "boolean",
36
- default: true
37
- }, {
38
- name: "preview",
39
- description: "Preview the deploy instead of actually performing it",
40
- type: "boolean",
41
- default: false
42
- }, {
43
- name: "show-deployment-logs",
44
- description: "Print deployment logs (automatically enabled in CI environments)",
45
- type: "boolean",
46
- default: false
47
- }, {
48
- name: "allow-local-state-files",
49
- description: "Allow using local Pulumi state files with production environment deployment (not recommended).",
50
- type: "boolean"
51
- }],
52
- handler: async params => {
53
- if (params.apps && params.apps.length > 0) {
54
- // Deploy specified apps
55
- for (const appName of params.apps) {
56
- const appParams = {
57
- ...params,
58
- app: appName
59
- };
60
- const app = await projectSdk.getApp(appName);
61
- ui.info("Deploying %s app...", app.getDisplayName());
62
- await this.deployApp(appParams);
63
- ui.emptyLine();
64
- }
65
- } else {
66
- ui.info(`You're using Webiny v${projectSdk.getProjectVersion()}`);
67
- ui.emptyLine();
68
- const isCi = projectSdk.isCi();
69
- const coreStack = await projectSdk.getAppStackOutput("core");
70
- const isFirstDeployment = !isCi && !coreStack?.deploymentId;
71
- if (isFirstDeployment) {
72
- ui.info(`Looks like this is your first time deploying the project.`);
73
- ui.info(`Note that the initial deployment can take up to %s, so please be patient.`, "10 minutes");
74
- await sleep();
75
- }
76
-
77
- // 3. Start deploying apps one-by-one.
78
- isFirstDeployment && ui.emptyLine();
79
-
80
- // Deploy all apps in the project.
81
- ui.info("Deploying %s app...", "Core");
82
- await this.deployApp({
83
- ...params,
84
- app: "core"
85
- });
86
- ui.emptyLine();
87
- ui.info("Deploying %s app...", "API");
88
- await this.deployApp({
89
- ...params,
90
- app: "api"
91
- });
92
- ui.emptyLine();
93
- ui.info("Deploying %s app...", "Admin");
94
- await this.deployApp({
95
- ...params,
96
- app: "admin"
97
- });
98
- if (isFirstDeployment) {
99
- ui.success(`Congratulations! You've just deployed a brand new project!`);
100
- } else {
101
- ui.success(`Project deployed.`);
102
- }
103
- const printInfoForEnv = new PrintInfoForEnv({
104
- getProjectSdkService: this.getProjectSdkService,
105
- uiService: this.uiService
106
- });
107
- ui.emptyLine();
108
- ui.textBold("Project Details");
109
- await printInfoForEnv.execute(params);
110
- const adminAppOutput = await projectSdk.getAppStackOutput("admin");
111
- if (isFirstDeployment && adminAppOutput) {
112
- ui.emptyLine();
113
- ui.info("The final step is to open the %s app in your browser and complete the installation wizard.", "Admin");
114
- const spinner = ora(`Opening Admin in your browser...`).start();
115
- try {
116
- await sleep(7000);
117
- open(adminAppOutput.appUrl);
118
- spinner.succeed(`Successfully opened Admin app in your browser.`);
119
- } catch {
120
- spinner.fail(`Failed to open Admin in your browser.`);
121
- await sleep(1000);
122
- ui.emptyLine();
123
- ui.warning(`Failed to open %s app in your browser. To finish the setup and start using the project, please visit %s and complete the installation wizard.`, "Admin", adminAppOutput.appUrl);
10
+ const sleep = (ms = 1500)=>promises_setTimeout(ms);
11
+ class DeployCommand {
12
+ constructor(getProjectSdkService, uiService, stdioService){
13
+ this.getProjectSdkService = getProjectSdkService;
14
+ this.uiService = uiService;
15
+ this.stdioService = stdioService;
16
+ }
17
+ async execute() {
18
+ const projectSdk = await this.getProjectSdkService.execute();
19
+ const ui = this.uiService;
20
+ return {
21
+ name: "deploy",
22
+ description: "Deploys specified app or all apps in the project",
23
+ examples: [
24
+ "$0 deploy api --env dev",
25
+ "$0 deploy core api --env dev",
26
+ "$0 deploy admin --env prod",
27
+ "$0 deploy --env prod",
28
+ "$0 deploy"
29
+ ],
30
+ params: [
31
+ {
32
+ name: "apps",
33
+ description: "Name of the app(s) to deploy (core, admin, or api). You can specify multiple apps.",
34
+ type: "string",
35
+ array: true
36
+ }
37
+ ],
38
+ options: [
39
+ ...createBaseAppOptions(projectSdk),
40
+ {
41
+ name: "build",
42
+ description: "Build packages before deploying",
43
+ type: "boolean",
44
+ default: true
45
+ },
46
+ {
47
+ name: "preview",
48
+ description: "Preview the deploy instead of actually performing it",
49
+ type: "boolean",
50
+ default: false
51
+ },
52
+ {
53
+ name: "show-deployment-logs",
54
+ description: "Print deployment logs (automatically enabled in CI environments)",
55
+ type: "boolean",
56
+ default: false
57
+ },
58
+ {
59
+ name: "allow-local-state-files",
60
+ description: "Allow using local Pulumi state files with production environment deployment (not recommended).",
61
+ type: "boolean"
62
+ }
63
+ ],
64
+ handler: async (params)=>{
65
+ if (params.apps && params.apps.length > 0) for (const appName of params.apps){
66
+ const appParams = {
67
+ ...params,
68
+ app: appName
69
+ };
70
+ const app = await projectSdk.getApp(appName);
71
+ ui.info("Deploying %s app...", app.getDisplayName());
72
+ await this.deployApp(appParams);
73
+ ui.emptyLine();
74
+ }
75
+ else {
76
+ ui.info(`You're using Webiny v${projectSdk.getProjectVersion()}`);
77
+ ui.emptyLine();
78
+ const isCi = projectSdk.isCi();
79
+ const coreStack = await projectSdk.getAppStackOutput("core");
80
+ const isFirstDeployment = !isCi && !coreStack?.deploymentId;
81
+ if (isFirstDeployment) {
82
+ ui.info("Looks like this is your first time deploying the project.");
83
+ ui.info("Note that the initial deployment can take up to %s, so please be patient.", "10 minutes");
84
+ await sleep();
85
+ }
86
+ isFirstDeployment && ui.emptyLine();
87
+ ui.info("Deploying %s app...", "Core");
88
+ await this.deployApp({
89
+ ...params,
90
+ app: "core"
91
+ });
92
+ ui.emptyLine();
93
+ ui.info("Deploying %s app...", "API");
94
+ await this.deployApp({
95
+ ...params,
96
+ app: "api"
97
+ });
98
+ ui.emptyLine();
99
+ ui.info("Deploying %s app...", "Admin");
100
+ await this.deployApp({
101
+ ...params,
102
+ app: "admin"
103
+ });
104
+ if (isFirstDeployment) ui.success("Congratulations! You've just deployed a brand new project!");
105
+ else ui.success("Project deployed.");
106
+ const printInfoForEnv = new PrintInfoForEnv({
107
+ getProjectSdkService: this.getProjectSdkService,
108
+ uiService: this.uiService
109
+ });
110
+ ui.emptyLine();
111
+ ui.textBold("Project Details");
112
+ await printInfoForEnv.execute(params);
113
+ const adminAppOutput = await projectSdk.getAppStackOutput("admin");
114
+ if (isFirstDeployment && adminAppOutput) {
115
+ ui.emptyLine();
116
+ ui.info("The final step is to open the %s app in your browser and complete the installation wizard.", "Admin");
117
+ const spinner = ora("Opening Admin in your browser...").start();
118
+ try {
119
+ await sleep(7000);
120
+ open_0(adminAppOutput.appUrl);
121
+ spinner.succeed("Successfully opened Admin app in your browser.");
122
+ } catch {
123
+ spinner.fail("Failed to open Admin in your browser.");
124
+ await sleep(1000);
125
+ ui.emptyLine();
126
+ ui.warning("Failed to open %s app in your browser. To finish the setup and start using the project, please visit %s and complete the installation wizard.", "Admin", adminAppOutput.appUrl);
127
+ }
128
+ }
129
+ }
124
130
  }
125
- }
126
- }
127
- }
128
- };
129
- }
130
- async deployApp(params) {
131
- const projectSdk = await this.getProjectSdkService.execute();
132
- const ui = this.uiService;
133
- const stdio = this.stdioService;
134
- if (params.build !== false) {
135
- const packagesBuilder = await projectSdk.buildApp(params);
136
- const buildRunner = new BuildRunner({
137
- stdio,
138
- ui,
139
- packagesBuilder
140
- });
141
- if (!buildRunner.isEmpty()) {
142
- await buildRunner.run();
143
- ui.emptyLine();
144
- }
131
+ };
145
132
  }
146
-
147
- // We always show deployment logs when doing previews.
148
- const showDeploymentLogs = Boolean(projectSdk.isCi() || params.preview || params.showDeploymentLogs);
149
- return await projectSdk.deployApp({
150
- ...params,
151
- output: pulumiProcess => {
152
- const deployOutput = new DeployOutput({
153
- stdio,
154
- ui,
155
- showDeploymentLogs,
156
- deployProcess: pulumiProcess,
157
- deployParams: params
133
+ async deployApp(params) {
134
+ const projectSdk = await this.getProjectSdkService.execute();
135
+ const ui = this.uiService;
136
+ const stdio = this.stdioService;
137
+ if (false !== params.build) {
138
+ const packagesBuilder = await projectSdk.buildApp(params);
139
+ const buildRunner = new BuildRunner({
140
+ stdio,
141
+ ui,
142
+ packagesBuilder
143
+ });
144
+ if (!buildRunner.isEmpty()) {
145
+ await buildRunner.run();
146
+ ui.emptyLine();
147
+ }
148
+ }
149
+ const showDeploymentLogs = Boolean(projectSdk.isCi() || params.preview || params.showDeploymentLogs);
150
+ return await projectSdk.deployApp({
151
+ ...params,
152
+ output: (pulumiProcess)=>{
153
+ const deployOutput = new DeployOutput({
154
+ stdio,
155
+ ui,
156
+ showDeploymentLogs,
157
+ deployProcess: pulumiProcess,
158
+ deployParams: params
159
+ });
160
+ return deployOutput.output();
161
+ }
158
162
  });
159
- return deployOutput.output();
160
- }
161
- });
162
- }
163
+ }
163
164
  }
164
- export const deployCommand = createImplementation({
165
- abstraction: CliCommandFactory,
166
- implementation: DeployCommand,
167
- dependencies: [GetProjectSdkService, UiService, StdioService]
165
+ const deployCommand = createImplementation({
166
+ abstraction: CliCommandFactory,
167
+ implementation: DeployCommand,
168
+ dependencies: [
169
+ GetProjectSdkService,
170
+ UiService,
171
+ StdioService
172
+ ]
168
173
  });
174
+ export { DeployCommand, deployCommand };
169
175
 
170
176
  //# sourceMappingURL=DeployCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","setTimeout","open","ora","CliCommandFactory","GetProjectSdkService","StdioService","UiService","BuildRunner","createBaseAppOptions","DeployOutput","PrintInfoForEnv","sleep","ms","DeployCommand","constructor","getProjectSdkService","uiService","stdioService","execute","projectSdk","ui","name","description","examples","params","type","array","options","default","handler","apps","length","appName","appParams","app","getApp","info","getDisplayName","deployApp","emptyLine","getProjectVersion","isCi","coreStack","getAppStackOutput","isFirstDeployment","deploymentId","success","printInfoForEnv","textBold","adminAppOutput","spinner","start","appUrl","succeed","fail","warning","stdio","build","packagesBuilder","buildApp","buildRunner","isEmpty","run","showDeploymentLogs","Boolean","preview","output","pulumiProcess","deployOutput","deployProcess","deployParams","deployCommand","abstraction","implementation","dependencies"],"sources":["DeployCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { AppName } from \"@webiny/project\";\nimport { setTimeout } from \"node:timers/promises\";\nimport open from \"open\";\nimport ora from \"ora\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { BuildRunner } from \"~/features/BuildCommand/buildRunners/BuildRunner.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { DeployOutput } from \"./deployOutputs/DeployOutput.js\";\n\n// TODO: convert to a real service.\nimport { PrintInfoForEnv } from \"~/features/InfoCommand/PrintInfoForEnv.js\";\n\nexport interface IDeployCommandParams {\n apps?: AppName[];\n variant?: string;\n region?: string;\n env: string;\n showDeploymentLogs?: boolean;\n build?: boolean;\n preview?: boolean;\n allowLocalStateFiles?: boolean;\n}\n\nexport interface IDeploySingleAppParams {\n app: AppName;\n variant?: string;\n region?: string;\n env: string;\n showDeploymentLogs?: boolean;\n build?: boolean;\n preview?: boolean;\n}\n\nconst sleep = (ms: number = 1500) => setTimeout(ms);\n\nexport class DeployCommand implements CliCommandFactory.Interface<IDeployCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface,\n private stdioService: StdioService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IDeployCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n const ui = this.uiService;\n\n return {\n name: \"deploy\",\n description: \"Deploys specified app or all apps in the project\",\n examples: [\n \"$0 deploy api --env dev\",\n \"$0 deploy core api --env dev\",\n \"$0 deploy admin --env prod\",\n \"$0 deploy --env prod\",\n \"$0 deploy\"\n ],\n params: [\n {\n name: \"apps\",\n description:\n \"Name of the app(s) to deploy (core, admin, or api). You can specify multiple apps.\",\n type: \"string\",\n array: true\n }\n ],\n options: [\n ...createBaseAppOptions(projectSdk),\n {\n name: \"build\",\n description: \"Build packages before deploying\",\n type: \"boolean\",\n default: true\n },\n {\n name: \"preview\",\n description: \"Preview the deploy instead of actually performing it\",\n type: \"boolean\",\n default: false\n },\n {\n name: \"show-deployment-logs\",\n description: \"Print deployment logs (automatically enabled in CI environments)\",\n type: \"boolean\",\n default: false\n },\n {\n name: \"allow-local-state-files\",\n description:\n \"Allow using local Pulumi state files with production environment deployment (not recommended).\",\n type: \"boolean\"\n }\n ],\n handler: async (params: IDeployCommandParams) => {\n if (params.apps && params.apps.length > 0) {\n // Deploy specified apps\n for (const appName of params.apps) {\n const appParams: IDeploySingleAppParams = {\n ...params,\n app: appName\n };\n\n const app = await projectSdk.getApp(appName);\n ui.info(\"Deploying %s app...\", app.getDisplayName());\n await this.deployApp(appParams);\n ui.emptyLine();\n }\n } else {\n ui.info(`You're using Webiny v${projectSdk.getProjectVersion()}`);\n ui.emptyLine();\n\n const isCi = projectSdk.isCi();\n const coreStack = await projectSdk.getAppStackOutput(\"core\");\n\n const isFirstDeployment = !isCi && !coreStack?.deploymentId;\n if (isFirstDeployment) {\n ui.info(`Looks like this is your first time deploying the project.`);\n ui.info(\n `Note that the initial deployment can take up to %s, so please be patient.`,\n \"10 minutes\"\n );\n await sleep();\n }\n\n // 3. Start deploying apps one-by-one.\n isFirstDeployment && ui.emptyLine();\n\n // Deploy all apps in the project.\n ui.info(\"Deploying %s app...\", \"Core\");\n await this.deployApp({ ...params, app: \"core\" });\n ui.emptyLine();\n\n ui.info(\"Deploying %s app...\", \"API\");\n await this.deployApp({ ...params, app: \"api\" });\n ui.emptyLine();\n ui.info(\"Deploying %s app...\", \"Admin\");\n await this.deployApp({ ...params, app: \"admin\" });\n\n if (isFirstDeployment) {\n ui.success(`Congratulations! You've just deployed a brand new project!`);\n } else {\n ui.success(`Project deployed.`);\n }\n\n const printInfoForEnv = new PrintInfoForEnv({\n getProjectSdkService: this.getProjectSdkService,\n uiService: this.uiService\n });\n\n ui.emptyLine();\n ui.textBold(\"Project Details\");\n await printInfoForEnv.execute(params);\n\n const adminAppOutput = await projectSdk.getAppStackOutput(\"admin\");\n\n if (isFirstDeployment && adminAppOutput) {\n ui.emptyLine();\n ui.info(\n \"The final step is to open the %s app in your browser and complete the installation wizard.\",\n \"Admin\"\n );\n\n const spinner = ora(`Opening Admin in your browser...`).start();\n\n try {\n await sleep(7000);\n open(adminAppOutput.appUrl as string);\n spinner.succeed(`Successfully opened Admin app in your browser.`);\n } catch {\n spinner.fail(`Failed to open Admin in your browser.`);\n\n await sleep(1000);\n ui.emptyLine();\n ui.warning(\n `Failed to open %s app in your browser. To finish the setup and start using the project, please visit %s and complete the installation wizard.`,\n \"Admin\",\n adminAppOutput.appUrl\n );\n }\n }\n }\n }\n };\n }\n\n private async deployApp(params: IDeploySingleAppParams) {\n const projectSdk = await this.getProjectSdkService.execute();\n\n const ui = this.uiService;\n const stdio = this.stdioService;\n\n if (params.build !== false) {\n const packagesBuilder = await projectSdk.buildApp(params);\n\n const buildRunner = new BuildRunner({\n stdio,\n ui,\n packagesBuilder\n });\n\n if (!buildRunner.isEmpty()) {\n await buildRunner.run();\n ui.emptyLine();\n }\n }\n\n // We always show deployment logs when doing previews.\n const showDeploymentLogs = Boolean(\n projectSdk.isCi() || params.preview || params.showDeploymentLogs\n );\n\n return await projectSdk.deployApp({\n ...params,\n output: pulumiProcess => {\n const deployOutput = new DeployOutput({\n stdio,\n ui,\n showDeploymentLogs,\n deployProcess: pulumiProcess,\n deployParams: params\n });\n\n return deployOutput.output();\n }\n });\n }\n}\n\nexport const deployCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DeployComm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;IAEA;IACA,MAAMwB,kBAAkB,GAAGC,OAAO,CAC9B7C,UAAU,CAACsB,IAAI,CAAC,CAAC,IAAIjB,MAAM,CAACyC,OAAO,IAAIzC,MAAM,CAACuC,kBAClD,CAAC;IAED,OAAO,MAAM5C,UAAU,CAACmB,SAAS,CAAC;MAC9B,GAAGd,MAAM;MACT0C,MAAM,EAAEC,aAAa,IAAI;QACrB,MAAMC,YAAY,GAAG,IAAI3D,YAAY,CAAC;UAClC+C,KAAK;UACLpC,EAAE;UACF2C,kBAAkB;UAClBM,aAAa,EAAEF,aAAa;UAC5BG,YAAY,EAAE9C;QAClB,CAAC,CAAC;QAEF,OAAO4C,YAAY,CAACF,MAAM,CAAC,CAAC;MAChC;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMK,aAAa,GAAGxE,oBAAoB,CAAC;EAC9CyE,WAAW,EAAErE,iBAAiB;EAC9BsE,cAAc,EAAE5D,aAAa;EAC7B6D,YAAY,EAAE,CAACtE,oBAAoB,EAAEE,SAAS,EAAED,YAAY;AAChE,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/DeployCommand/DeployCommand.js","sources":["../../../src/features/DeployCommand/DeployCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { AppName } from \"@webiny/project\";\nimport { setTimeout } from \"node:timers/promises\";\nimport open from \"open\";\nimport ora from \"ora\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { BuildRunner } from \"~/features/BuildCommand/buildRunners/BuildRunner.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { DeployOutput } from \"./deployOutputs/DeployOutput.js\";\n\n// TODO: convert to a real service.\nimport { PrintInfoForEnv } from \"~/features/InfoCommand/PrintInfoForEnv.js\";\n\nexport interface IDeployCommandParams {\n apps?: AppName[];\n variant?: string;\n region?: string;\n env: string;\n showDeploymentLogs?: boolean;\n build?: boolean;\n preview?: boolean;\n allowLocalStateFiles?: boolean;\n}\n\nexport interface IDeploySingleAppParams {\n app: AppName;\n variant?: string;\n region?: string;\n env: string;\n showDeploymentLogs?: boolean;\n build?: boolean;\n preview?: boolean;\n}\n\nconst sleep = (ms: number = 1500) => setTimeout(ms);\n\nexport class DeployCommand implements CliCommandFactory.Interface<IDeployCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface,\n private stdioService: StdioService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IDeployCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n const ui = this.uiService;\n\n return {\n name: \"deploy\",\n description: \"Deploys specified app or all apps in the project\",\n examples: [\n \"$0 deploy api --env dev\",\n \"$0 deploy core api --env dev\",\n \"$0 deploy admin --env prod\",\n \"$0 deploy --env prod\",\n \"$0 deploy\"\n ],\n params: [\n {\n name: \"apps\",\n description:\n \"Name of the app(s) to deploy (core, admin, or api). You can specify multiple apps.\",\n type: \"string\",\n array: true\n }\n ],\n options: [\n ...createBaseAppOptions(projectSdk),\n {\n name: \"build\",\n description: \"Build packages before deploying\",\n type: \"boolean\",\n default: true\n },\n {\n name: \"preview\",\n description: \"Preview the deploy instead of actually performing it\",\n type: \"boolean\",\n default: false\n },\n {\n name: \"show-deployment-logs\",\n description: \"Print deployment logs (automatically enabled in CI environments)\",\n type: \"boolean\",\n default: false\n },\n {\n name: \"allow-local-state-files\",\n description:\n \"Allow using local Pulumi state files with production environment deployment (not recommended).\",\n type: \"boolean\"\n }\n ],\n handler: async (params: IDeployCommandParams) => {\n if (params.apps && params.apps.length > 0) {\n // Deploy specified apps\n for (const appName of params.apps) {\n const appParams: IDeploySingleAppParams = {\n ...params,\n app: appName\n };\n\n const app = await projectSdk.getApp(appName);\n ui.info(\"Deploying %s app...\", app.getDisplayName());\n await this.deployApp(appParams);\n ui.emptyLine();\n }\n } else {\n ui.info(`You're using Webiny v${projectSdk.getProjectVersion()}`);\n ui.emptyLine();\n\n const isCi = projectSdk.isCi();\n const coreStack = await projectSdk.getAppStackOutput(\"core\");\n\n const isFirstDeployment = !isCi && !coreStack?.deploymentId;\n if (isFirstDeployment) {\n ui.info(`Looks like this is your first time deploying the project.`);\n ui.info(\n `Note that the initial deployment can take up to %s, so please be patient.`,\n \"10 minutes\"\n );\n await sleep();\n }\n\n // 3. Start deploying apps one-by-one.\n isFirstDeployment && ui.emptyLine();\n\n // Deploy all apps in the project.\n ui.info(\"Deploying %s app...\", \"Core\");\n await this.deployApp({ ...params, app: \"core\" });\n ui.emptyLine();\n\n ui.info(\"Deploying %s app...\", \"API\");\n await this.deployApp({ ...params, app: \"api\" });\n ui.emptyLine();\n ui.info(\"Deploying %s app...\", \"Admin\");\n await this.deployApp({ ...params, app: \"admin\" });\n\n if (isFirstDeployment) {\n ui.success(`Congratulations! You've just deployed a brand new project!`);\n } else {\n ui.success(`Project deployed.`);\n }\n\n const printInfoForEnv = new PrintInfoForEnv({\n getProjectSdkService: this.getProjectSdkService,\n uiService: this.uiService\n });\n\n ui.emptyLine();\n ui.textBold(\"Project Details\");\n await printInfoForEnv.execute(params);\n\n const adminAppOutput = await projectSdk.getAppStackOutput(\"admin\");\n\n if (isFirstDeployment && adminAppOutput) {\n ui.emptyLine();\n ui.info(\n \"The final step is to open the %s app in your browser and complete the installation wizard.\",\n \"Admin\"\n );\n\n const spinner = ora(`Opening Admin in your browser...`).start();\n\n try {\n await sleep(7000);\n open(adminAppOutput.appUrl as string);\n spinner.succeed(`Successfully opened Admin app in your browser.`);\n } catch {\n spinner.fail(`Failed to open Admin in your browser.`);\n\n await sleep(1000);\n ui.emptyLine();\n ui.warning(\n `Failed to open %s app in your browser. To finish the setup and start using the project, please visit %s and complete the installation wizard.`,\n \"Admin\",\n adminAppOutput.appUrl\n );\n }\n }\n }\n }\n };\n }\n\n private async deployApp(params: IDeploySingleAppParams) {\n const projectSdk = await this.getProjectSdkService.execute();\n\n const ui = this.uiService;\n const stdio = this.stdioService;\n\n if (params.build !== false) {\n const packagesBuilder = await projectSdk.buildApp(params);\n\n const buildRunner = new BuildRunner({\n stdio,\n ui,\n packagesBuilder\n });\n\n if (!buildRunner.isEmpty()) {\n await buildRunner.run();\n ui.emptyLine();\n }\n }\n\n // We always show deployment logs when doing previews.\n const showDeploymentLogs = Boolean(\n projectSdk.isCi() || params.preview || params.showDeploymentLogs\n );\n\n return await projectSdk.deployApp({\n ...params,\n output: pulumiProcess => {\n const deployOutput = new DeployOutput({\n stdio,\n ui,\n showDeploymentLogs,\n deployProcess: pulumiProcess,\n deployParams: params\n });\n\n return deployOutput.output();\n }\n });\n }\n}\n\nexport const deployCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DeployCommand,\n dependencies: [GetProjectSdkService, UiService, StdioService]\n});\n"],"names":["sleep","ms","setTimeout","DeployCommand","getProjectSdkService","uiService","stdioService","projectSdk","ui","createBaseAppOptions","params","appName","appParams","app","isCi","coreStack","isFirstDeployment","printInfoForEnv","PrintInfoForEnv","adminAppOutput","spinner","ora","open","stdio","packagesBuilder","buildRunner","BuildRunner","showDeploymentLogs","Boolean","pulumiProcess","deployOutput","DeployOutput","deployCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService","StdioService"],"mappings":";;;;;;;;;AAuCA,MAAMA,QAAQ,CAACC,KAAa,IAAI,GAAKC,oBAAWD;AAEzC,MAAME;IACT,YACYC,oBAAoD,EACpDC,SAA8B,EAC9BC,YAAoC,CAC9C;aAHUF,oBAAoB,GAApBA;aACAC,SAAS,GAATA;aACAC,YAAY,GAAZA;IACT;IAEH,MAAM,UAA8E;QAChF,MAAMC,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;QAC1D,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzB,OAAO;YACH,MAAM;YACN,aAAa;YACb,UAAU;gBACN;gBACA;gBACA;gBACA;gBACA;aACH;YACD,QAAQ;gBACJ;oBACI,MAAM;oBACN,aACI;oBACJ,MAAM;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MAAMA,YAAY,GAAG;gBACrBjB,GAAG,SAAS;YAChB;QACJ;QAGA,MAAMmB,qBAAqBC,QACvBrB,WAAW,IAAI,MAAMG,OAAO,OAAO,IAAIA,OAAO,kBAAkB;QAGpE,OAAO,MAAMH,WAAW,SAAS,CAAC;YAC9B,GAAGG,MAAM;YACT,QAAQmB,CAAAA;gBACJ,MAAMC,eAAe,IAAIC,aAAa;oBAClCR;oBACAf;oBACAmB;oBACA,eAAeE;oBACf,cAAcnB;gBAClB;gBAEA,OAAOoB,aAAa,MAAM;YAC9B;QACJ;IACJ;AACJ;AAEO,MAAME,gBAAgBC,qBAAqB;IAC9C,aAAaC;IACb,gBAAgB/B;IAChB,cAAc;QAACgC;QAAsBC;QAAWC;KAAa;AACjE"}
@@ -1,20 +1,15 @@
1
- export class BaseDeployOutput {
2
- constructor({
3
- deployProcess,
4
- stdio,
5
- ui,
6
- showDeploymentLogs,
7
- deployParams
8
- }) {
9
- this.deployProcess = deployProcess;
10
- this.stdio = stdio;
11
- this.ui = ui;
12
- this.showDeploymentLogs = showDeploymentLogs;
13
- this.deployParams = deployParams;
14
- }
15
- async output() {
16
- throw new Error("Not implemented.");
17
- }
1
+ class BaseDeployOutput {
2
+ constructor({ deployProcess, stdio, ui, showDeploymentLogs, deployParams }){
3
+ this.deployProcess = deployProcess;
4
+ this.stdio = stdio;
5
+ this.ui = ui;
6
+ this.showDeploymentLogs = showDeploymentLogs;
7
+ this.deployParams = deployParams;
8
+ }
9
+ async output() {
10
+ throw new Error("Not implemented.");
11
+ }
18
12
  }
13
+ export { BaseDeployOutput };
19
14
 
20
15
  //# sourceMappingURL=BaseDeployOutput.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseDeployOutput","constructor","deployProcess","stdio","ui","showDeploymentLogs","deployParams","output","Error"],"sources":["BaseDeployOutput.ts"],"sourcesContent":["import { UiService, StdioService } from \"~/abstractions/index.js\";\nimport { IDeploySingleAppParams } from \"../DeployCommand.js\";\nimport { ExecaChildProcess } from \"execa\";\n\nexport type IDeployProcess = ExecaChildProcess<string>;\n\nexport interface IBaseDeployOutputParams {\n deployProcess: IDeployProcess;\n stdio: StdioService.Interface;\n ui: UiService.Interface;\n showDeploymentLogs: boolean;\n deployParams: IDeploySingleAppParams;\n}\n\nexport class BaseDeployOutput {\n public readonly deployProcess: IDeployProcess;\n public readonly stdio: StdioService.Interface;\n public readonly ui: UiService.Interface;\n public readonly showDeploymentLogs: boolean;\n public readonly deployParams: IDeploySingleAppParams;\n\n public constructor({\n deployProcess,\n stdio,\n ui,\n showDeploymentLogs,\n deployParams\n }: IBaseDeployOutputParams) {\n this.deployProcess = deployProcess;\n this.stdio = stdio;\n this.ui = ui;\n this.showDeploymentLogs = showDeploymentLogs;\n this.deployParams = deployParams;\n }\n\n public async output(): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n}\n"],"mappings":"AAcA,OAAO,MAAMA,gBAAgB,CAAC;EAOnBC,WAAWA,CAAC;IACfC,aAAa;IACbC,KAAK;IACLC,EAAE;IACFC,kBAAkB;IAClBC;EACqB,CAAC,EAAE;IACxB,IAAI,CAACJ,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,kBAAkB,GAAGA,kBAAkB;IAC5C,IAAI,CAACC,YAAY,GAAGA,YAAY;EACpC;EAEA,MAAaC,MAAMA,CAAA,EAAkB;IACjC,MAAM,IAAIC,KAAK,CAAC,kBAAkB,CAAC;EACvC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"features/DeployCommand/deployOutputs/BaseDeployOutput.js","sources":["../../../../src/features/DeployCommand/deployOutputs/BaseDeployOutput.ts"],"sourcesContent":["import { UiService, StdioService } from \"~/abstractions/index.js\";\nimport { IDeploySingleAppParams } from \"../DeployCommand.js\";\nimport { ExecaChildProcess } from \"execa\";\n\nexport type IDeployProcess = ExecaChildProcess<string>;\n\nexport interface IBaseDeployOutputParams {\n deployProcess: IDeployProcess;\n stdio: StdioService.Interface;\n ui: UiService.Interface;\n showDeploymentLogs: boolean;\n deployParams: IDeploySingleAppParams;\n}\n\nexport class BaseDeployOutput {\n public readonly deployProcess: IDeployProcess;\n public readonly stdio: StdioService.Interface;\n public readonly ui: UiService.Interface;\n public readonly showDeploymentLogs: boolean;\n public readonly deployParams: IDeploySingleAppParams;\n\n public constructor({\n deployProcess,\n stdio,\n ui,\n showDeploymentLogs,\n deployParams\n }: IBaseDeployOutputParams) {\n this.deployProcess = deployProcess;\n this.stdio = stdio;\n this.ui = ui;\n this.showDeploymentLogs = showDeploymentLogs;\n this.deployParams = deployParams;\n }\n\n public async output(): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n}\n"],"names":["BaseDeployOutput","deployProcess","stdio","ui","showDeploymentLogs","deployParams","Error"],"mappings":"AAcO,MAAMA;IAOT,YAAmB,EACfC,aAAa,EACbC,KAAK,EACLC,EAAE,EACFC,kBAAkB,EAClBC,YAAY,EACU,CAAE;QACxB,IAAI,CAAC,aAAa,GAAGJ;QACrB,IAAI,CAAC,KAAK,GAAGC;QACb,IAAI,CAAC,EAAE,GAAGC;QACV,IAAI,CAAC,kBAAkB,GAAGC;QAC1B,IAAI,CAAC,YAAY,GAAGC;IACxB;IAEA,MAAa,SAAwB;QACjC,MAAM,IAAIC,MAAM;IACpB;AACJ"}