@webiny/cli-core 0.0.0-unstable.df7a8bb475 → 0.0.0-unstable.e1999482d0

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 (342) hide show
  1. package/Cli.d.ts +2 -1
  2. package/Cli.js +12 -11
  3. package/Cli.js.map +1 -1
  4. package/abstractions/createAbstraction.js +3 -2
  5. package/abstractions/createAbstraction.js.map +1 -1
  6. package/abstractions/features/CliCommand.d.ts +4 -0
  7. package/abstractions/features/CliCommand.js +2 -1
  8. package/abstractions/features/CliCommand.js.map +1 -1
  9. package/abstractions/features/ErrorHandler.js +2 -1
  10. package/abstractions/features/ErrorHandler.js.map +1 -1
  11. package/abstractions/features/GlobalCliOption.js +2 -1
  12. package/abstractions/features/GlobalCliOption.js.map +1 -1
  13. package/abstractions/features/IsCi.js +2 -1
  14. package/abstractions/features/IsCi.js.map +1 -1
  15. package/abstractions/features/index.js +0 -2
  16. package/abstractions/features/types.js +0 -3
  17. package/abstractions/index.js +0 -2
  18. package/abstractions/services/ArgvParserService.js +2 -1
  19. package/abstractions/services/ArgvParserService.js.map +1 -1
  20. package/abstractions/services/CliParamsService.js +2 -1
  21. package/abstractions/services/CliParamsService.js.map +1 -1
  22. package/abstractions/services/CommandsRegistryService.js +2 -1
  23. package/abstractions/services/CommandsRegistryService.js.map +1 -1
  24. package/abstractions/services/DefaultAppsService.d.ts +8 -0
  25. package/abstractions/services/DefaultAppsService.js +5 -0
  26. package/abstractions/services/DefaultAppsService.js.map +1 -0
  27. package/abstractions/services/GetArgvService.js +2 -1
  28. package/abstractions/services/GetArgvService.js.map +1 -1
  29. package/abstractions/services/GetCliRunnerService.js +2 -1
  30. package/abstractions/services/GetCliRunnerService.js.map +1 -1
  31. package/abstractions/services/GetIsCiService.js +2 -1
  32. package/abstractions/services/GetIsCiService.js.map +1 -1
  33. package/abstractions/services/GetProjectSdkService.js +2 -1
  34. package/abstractions/services/GetProjectSdkService.js.map +1 -1
  35. package/abstractions/services/GlobalOptionsRegistryService.js +2 -1
  36. package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -1
  37. package/abstractions/services/LoggerService.js +2 -1
  38. package/abstractions/services/LoggerService.js.map +1 -1
  39. package/abstractions/services/RunCliRunnerService.js +2 -1
  40. package/abstractions/services/RunCliRunnerService.js.map +1 -1
  41. package/abstractions/services/StdioService.js +2 -1
  42. package/abstractions/services/StdioService.js.map +1 -1
  43. package/abstractions/services/UiService.js +2 -1
  44. package/abstractions/services/UiService.js.map +1 -1
  45. package/abstractions/services/index.d.ts +1 -0
  46. package/abstractions/services/index.js +1 -2
  47. package/createCliContainer.d.ts +1 -1
  48. package/createCliContainer.js +86 -119
  49. package/createCliContainer.js.map +1 -1
  50. package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
  51. package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
  52. package/decorators/index.d.ts +0 -1
  53. package/decorators/index.js +0 -3
  54. package/exports/cli/command.js +0 -2
  55. package/exports/cli.d.ts +2 -0
  56. package/exports/cli.js +2 -0
  57. package/exports/extensions.d.ts +1 -0
  58. package/exports/extensions.js +1 -0
  59. package/extensions/CliCommand.d.ts +3 -7
  60. package/extensions/CliCommand.js +16 -18
  61. package/extensions/CliCommand.js.map +1 -1
  62. package/extensions/CliCommandDecorator.d.ts +3 -7
  63. package/extensions/CliCommandDecorator.js +16 -18
  64. package/extensions/CliCommandDecorator.js.map +1 -1
  65. package/extensions/index.d.ts +2 -6
  66. package/extensions/index.js +5 -2
  67. package/extensions/index.js.map +1 -1
  68. package/features/AboutCommand.js +75 -86
  69. package/features/AboutCommand.js.map +1 -1
  70. package/features/BuildCommand/BuildCommand.d.ts +7 -3
  71. package/features/BuildCommand/BuildCommand.js +68 -37
  72. package/features/BuildCommand/BuildCommand.js.map +1 -1
  73. package/features/BuildCommand/buildRunners/BaseBuildRunner.js +10 -13
  74. package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -1
  75. package/features/BuildCommand/buildRunners/BuildRunner.js +18 -21
  76. package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -1
  77. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +20 -19
  78. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -1
  79. package/features/BuildCommand/buildRunners/SingleBuildRunner.js +15 -14
  80. package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -1
  81. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +3 -4
  82. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -1
  83. package/features/BuildCommand/index.js +0 -2
  84. package/features/ConfigCommand.js +55 -56
  85. package/features/ConfigCommand.js.map +1 -1
  86. package/features/DeployCommand/index.d.ts +20 -1
  87. package/features/DeployCommand/index.js +0 -3
  88. package/features/DepsSync/BuildDependencyTree.js +17 -22
  89. package/features/DepsSync/BuildDependencyTree.js.map +1 -1
  90. package/features/DepsSync/DependencyTree.js +108 -119
  91. package/features/DepsSync/DependencyTree.js.map +1 -1
  92. package/features/DepsSync/ListAllPackageJsonFiles.js +19 -14
  93. package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -1
  94. package/features/DepsSync/ListAllPackages.d.ts +1 -1
  95. package/features/DepsSync/ListAllPackages.js +9 -9
  96. package/features/DepsSync/ListAllPackages.js.map +1 -1
  97. package/features/DepsSync/commands/SyncDepsCommand.js +30 -24
  98. package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -1
  99. package/features/DepsSync/commands/VerifyDepsCommand.js +107 -71
  100. package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
  101. package/features/DepsSync/createDependencyTree.d.ts +1 -1
  102. package/features/DepsSync/createDependencyTree.js +28 -18
  103. package/features/DepsSync/createDependencyTree.js.map +1 -1
  104. package/features/DepsSync/createReferenceFile.js +22 -26
  105. package/features/DepsSync/createReferenceFile.js.map +1 -1
  106. package/features/DepsSync/index.js +0 -2
  107. package/features/DepsSync/paths.js +3 -6
  108. package/features/DepsSync/paths.js.map +1 -1
  109. package/features/DepsSync/types.js +7 -6
  110. package/features/DepsSync/types.js.map +1 -1
  111. package/features/DisableTelemetryCommand.js +28 -25
  112. package/features/DisableTelemetryCommand.js.map +1 -1
  113. package/features/EnableTelemetryCommand.js +28 -25
  114. package/features/EnableTelemetryCommand.js.map +1 -1
  115. package/features/ExtensionCommand/ExtensionCommand.js +60 -63
  116. package/features/ExtensionCommand/ExtensionCommand.js.map +1 -1
  117. package/features/ExtensionCommand/index.js +0 -2
  118. package/features/IsCi/IsCi.js +14 -11
  119. package/features/IsCi/IsCi.js.map +1 -1
  120. package/features/IsCi/index.js +1 -3
  121. package/features/UpgradeCommand/UpgradeCommand.d.ts +29 -0
  122. package/features/UpgradeCommand/UpgradeCommand.js +123 -0
  123. package/features/UpgradeCommand/UpgradeCommand.js.map +1 -0
  124. package/features/UpgradeCommand/UpgradeCommandHandler.d.ts +11 -0
  125. package/features/UpgradeCommand/UpgradeCommandHandler.js +105 -0
  126. package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -0
  127. package/features/UpgradeCommand/abstraction.d.ts +23 -0
  128. package/features/UpgradeCommand/abstraction.js +5 -0
  129. package/features/UpgradeCommand/abstraction.js.map +1 -0
  130. package/features/UpgradeCommand/feature.d.ts +4 -0
  131. package/features/UpgradeCommand/feature.js +13 -0
  132. package/features/UpgradeCommand/feature.js.map +1 -0
  133. package/features/UpgradeCommand/index.d.ts +2 -0
  134. package/features/UpgradeCommand/index.js +2 -0
  135. package/features/Wcp/LinkProjectCommand.js +120 -139
  136. package/features/Wcp/LinkProjectCommand.js.map +1 -1
  137. package/features/Wcp/LoginCommand.js +104 -118
  138. package/features/Wcp/LoginCommand.js.map +1 -1
  139. package/features/Wcp/LogoutCommand.js +29 -23
  140. package/features/Wcp/LogoutCommand.js.map +1 -1
  141. package/features/Wcp/WhoAmICommand.js +33 -29
  142. package/features/Wcp/WhoAmICommand.js.map +1 -1
  143. package/features/common/index.js +0 -2
  144. package/features/common/options.js +41 -50
  145. package/features/common/options.js.map +1 -1
  146. package/features/globalOptions/LogLevelGlobalOption.js +25 -16
  147. package/features/globalOptions/LogLevelGlobalOption.js.map +1 -1
  148. package/features/globalOptions/ShowLogsGlobalOption.js +16 -15
  149. package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -1
  150. package/features/globalOptions/StackTraceGlobalOption.js +16 -15
  151. package/features/globalOptions/StackTraceGlobalOption.js.map +1 -1
  152. package/features/globalOptions/TraceGlobalOption.d.ts +5 -0
  153. package/features/globalOptions/TraceGlobalOption.js +22 -0
  154. package/features/globalOptions/TraceGlobalOption.js.map +1 -0
  155. package/features/globalOptions/index.d.ts +1 -0
  156. package/features/globalOptions/index.js +1 -2
  157. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
  158. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
  159. package/features/gracefulErrorHandlers/index.d.ts +0 -2
  160. package/features/gracefulErrorHandlers/index.js +0 -4
  161. package/features/index.d.ts +1 -7
  162. package/features/index.js +1 -9
  163. package/features/utils/index.js +0 -2
  164. package/features/utils/measureDuration.js +7 -8
  165. package/features/utils/measureDuration.js.map +1 -1
  166. package/index.js +0 -2
  167. package/namespaces/cli.d.ts +5 -0
  168. package/namespaces/cli.js +7 -0
  169. package/namespaces/cli.js.map +1 -0
  170. package/package.json +39 -32
  171. package/services/ArgvParserService/ArgvParserService.js +27 -33
  172. package/services/ArgvParserService/ArgvParserService.js.map +1 -1
  173. package/services/ArgvParserService/index.js +0 -2
  174. package/services/CliParamsService/CliParamsService.js +18 -15
  175. package/services/CliParamsService/CliParamsService.js.map +1 -1
  176. package/services/CliParamsService/index.js +0 -2
  177. package/services/CommandsRegistryService/CommandsRegistryService.js +19 -13
  178. package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -1
  179. package/services/CommandsRegistryService/index.js +0 -2
  180. package/services/DefaultAppsService/DefaultAppsService.d.ts +5 -0
  181. package/services/DefaultAppsService/DefaultAppsService.js +15 -0
  182. package/services/DefaultAppsService/DefaultAppsService.js.map +1 -0
  183. package/services/DefaultAppsService/index.d.ts +1 -0
  184. package/services/DefaultAppsService/index.js +1 -0
  185. package/services/GetArgvService/GetArgvService.js +14 -11
  186. package/services/GetArgvService/GetArgvService.js.map +1 -1
  187. package/services/GetArgvService/index.js +0 -2
  188. package/services/GetCliRunnerService/GetCliRunnerService.js +123 -148
  189. package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -1
  190. package/services/GetCliRunnerService/index.js +0 -2
  191. package/services/GetIsCiService/GetIsCiService.js +9 -8
  192. package/services/GetIsCiService/GetIsCiService.js.map +1 -1
  193. package/services/GetIsCiService/index.js +1 -3
  194. package/services/GetProjectSdkService/GetProjectSdkService.js +25 -24
  195. package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -1
  196. package/services/GetProjectSdkService/index.js +0 -2
  197. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -13
  198. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -1
  199. package/services/GlobalOptionsRegistryService/index.js +0 -2
  200. package/services/LoggerService/LoggerService.js +76 -88
  201. package/services/LoggerService/LoggerService.js.map +1 -1
  202. package/services/LoggerService/index.js +0 -2
  203. package/services/RunCliRunnerService/RunCliRunnerService.d.ts +1 -1
  204. package/services/RunCliRunnerService/RunCliRunnerService.js +15 -13
  205. package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -1
  206. package/services/RunCliRunnerService/index.js +0 -2
  207. package/services/StdioService/StdioService.js +15 -14
  208. package/services/StdioService/StdioService.js.map +1 -1
  209. package/services/StdioService/index.js +0 -2
  210. package/services/UiService/UiService.d.ts +18 -0
  211. package/services/UiService/UiService.js +71 -58
  212. package/services/UiService/UiService.js.map +1 -1
  213. package/services/UiService/index.js +0 -2
  214. package/services/index.d.ts +1 -0
  215. package/services/index.js +1 -2
  216. package/utils/ManuallyReportedError.js +7 -6
  217. package/utils/ManuallyReportedError.js.map +1 -1
  218. package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.d.ts +1 -0
  219. package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.js +53 -0
  220. package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.js.map +1 -0
  221. package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.d.ts +1 -0
  222. package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.js +12 -0
  223. package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.js.map +1 -0
  224. package/utils/ensureSameWebinyPackageVersions/hashYarnLock.d.ts +1 -0
  225. package/utils/ensureSameWebinyPackageVersions/hashYarnLock.js +16 -0
  226. package/utils/ensureSameWebinyPackageVersions/hashYarnLock.js.map +1 -0
  227. package/utils/ensureSameWebinyPackageVersions/index.d.ts +6 -0
  228. package/utils/ensureSameWebinyPackageVersions/index.js +6 -0
  229. package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.d.ts +1 -0
  230. package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.js +31 -0
  231. package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.js.map +1 -0
  232. package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.d.ts +1 -0
  233. package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.js +13 -0
  234. package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.js.map +1 -0
  235. package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.d.ts +1 -0
  236. package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.js +24 -0
  237. package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.js.map +1 -0
  238. package/utils/suppressPunycodeWarnings.d.ts +4 -0
  239. package/utils/suppressPunycodeWarnings.js +7 -0
  240. package/utils/suppressPunycodeWarnings.js.map +1 -0
  241. package/abstractions/features/index.js.map +0 -1
  242. package/abstractions/features/types.js.map +0 -1
  243. package/abstractions/index.js.map +0 -1
  244. package/abstractions/services/index.js.map +0 -1
  245. package/decorators/DeployCommandWithTelemetry.d.ts +0 -11
  246. package/decorators/DeployCommandWithTelemetry.js +0 -91
  247. package/decorators/DeployCommandWithTelemetry.js.map +0 -1
  248. package/decorators/index.js.map +0 -1
  249. package/exports/cli/command.js.map +0 -1
  250. package/exports/cli/index.d.ts +0 -2
  251. package/exports/cli/index.js +0 -4
  252. package/exports/cli/index.js.map +0 -1
  253. package/features/BuildCommand/index.js.map +0 -1
  254. package/features/DeployCommand/DeployCommand.d.ts +0 -30
  255. package/features/DeployCommand/DeployCommand.js +0 -168
  256. package/features/DeployCommand/DeployCommand.js.map +0 -1
  257. package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +0 -20
  258. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +0 -20
  259. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +0 -1
  260. package/features/DeployCommand/deployOutputs/DeployOutput.d.ts +0 -5
  261. package/features/DeployCommand/deployOutputs/DeployOutput.js +0 -24
  262. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +0 -1
  263. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.d.ts +0 -4
  264. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +0 -61
  265. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +0 -1
  266. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.d.ts +0 -4
  267. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +0 -44
  268. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +0 -1
  269. package/features/DeployCommand/index.js.map +0 -1
  270. package/features/DepsSync/index.js.map +0 -1
  271. package/features/DestroyCommand/DestroyCommand.d.ts +0 -22
  272. package/features/DestroyCommand/DestroyCommand.js +0 -78
  273. package/features/DestroyCommand/DestroyCommand.js.map +0 -1
  274. package/features/DestroyCommand/index.d.ts +0 -1
  275. package/features/DestroyCommand/index.js +0 -3
  276. package/features/DestroyCommand/index.js.map +0 -1
  277. package/features/ExtensionCommand/index.js.map +0 -1
  278. package/features/InfoCommand/InfoCommand.d.ts +0 -10
  279. package/features/InfoCommand/InfoCommand.js +0 -64
  280. package/features/InfoCommand/InfoCommand.js.map +0 -1
  281. package/features/InfoCommand/PrintInfoForEnv.d.ts +0 -14
  282. package/features/InfoCommand/PrintInfoForEnv.js +0 -53
  283. package/features/InfoCommand/PrintInfoForEnv.js.map +0 -1
  284. package/features/InfoCommand/index.d.ts +0 -1
  285. package/features/InfoCommand/index.js +0 -3
  286. package/features/InfoCommand/index.js.map +0 -1
  287. package/features/IsCi/index.js.map +0 -1
  288. package/features/OpenCommand.d.ts +0 -10
  289. package/features/OpenCommand.js +0 -54
  290. package/features/OpenCommand.js.map +0 -1
  291. package/features/OutputCommand.d.ts +0 -12
  292. package/features/OutputCommand.js +0 -79
  293. package/features/OutputCommand.js.map +0 -1
  294. package/features/PulumiCommand/PulumiCommand.d.ts +0 -13
  295. package/features/PulumiCommand/PulumiCommand.js +0 -50
  296. package/features/PulumiCommand/PulumiCommand.js.map +0 -1
  297. package/features/PulumiCommand/index.d.ts +0 -1
  298. package/features/PulumiCommand/index.js +0 -3
  299. package/features/PulumiCommand/index.js.map +0 -1
  300. package/features/RefreshCommand/RefreshCommand.d.ts +0 -12
  301. package/features/RefreshCommand/RefreshCommand.js +0 -45
  302. package/features/RefreshCommand/RefreshCommand.js.map +0 -1
  303. package/features/RefreshCommand/index.d.ts +0 -1
  304. package/features/RefreshCommand/index.js +0 -3
  305. package/features/RefreshCommand/index.js.map +0 -1
  306. package/features/WatchCommand/WatchCommand.d.ts +0 -11
  307. package/features/WatchCommand/WatchCommand.js +0 -143
  308. package/features/WatchCommand/WatchCommand.js.map +0 -1
  309. package/features/WatchCommand/createPrefixer.d.ts +0 -2
  310. package/features/WatchCommand/createPrefixer.js +0 -20
  311. package/features/WatchCommand/createPrefixer.js.map +0 -1
  312. package/features/WatchCommand/getRandomColorForString.d.ts +0 -1
  313. package/features/WatchCommand/getRandomColorForString.js +0 -11
  314. package/features/WatchCommand/getRandomColorForString.js.map +0 -1
  315. package/features/WatchCommand/index.d.ts +0 -1
  316. package/features/WatchCommand/index.js +0 -3
  317. package/features/WatchCommand/index.js.map +0 -1
  318. package/features/common/index.js.map +0 -1
  319. package/features/globalOptions/index.js.map +0 -1
  320. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +0 -6
  321. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +0 -26
  322. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +0 -1
  323. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.d.ts +0 -6
  324. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +0 -29
  325. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +0 -1
  326. package/features/gracefulErrorHandlers/index.js.map +0 -1
  327. package/features/index.js.map +0 -1
  328. package/features/utils/index.js.map +0 -1
  329. package/index.js.map +0 -1
  330. package/services/ArgvParserService/index.js.map +0 -1
  331. package/services/CliParamsService/index.js.map +0 -1
  332. package/services/CommandsRegistryService/index.js.map +0 -1
  333. package/services/GetArgvService/index.js.map +0 -1
  334. package/services/GetCliRunnerService/index.js.map +0 -1
  335. package/services/GetIsCiService/index.js.map +0 -1
  336. package/services/GetProjectSdkService/index.js.map +0 -1
  337. package/services/GlobalOptionsRegistryService/index.js.map +0 -1
  338. package/services/LoggerService/index.js.map +0 -1
  339. package/services/RunCliRunnerService/index.js.map +0 -1
  340. package/services/StdioService/index.js.map +0 -1
  341. package/services/UiService/index.js.map +0 -1
  342. package/services/index.js.map +0 -1
@@ -1,168 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
3
- import { DeployOutput } from "./deployOutputs/DeployOutput.js";
4
- import { BuildRunner } from "../BuildCommand/buildRunners/BuildRunner.js";
5
- import { createBaseAppOptions } from "../common/index.js";
6
- import { setTimeout } from "node:timers/promises";
7
- import ora from "ora";
8
- import open from "open";
9
-
10
- // TODO: convert to a real service.
11
- 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
- const isCi = projectSdk.isCi();
67
- const coreStack = await projectSdk.getAppStackOutput("core");
68
- const isFirstDeployment = !isCi && !coreStack?.deploymentId;
69
- if (isFirstDeployment) {
70
- ui.info(`Looks like this is your first time deploying the project.`);
71
- ui.info(`Note that the initial deployment can take up to %s, so please be patient.`, "10 minutes");
72
- await sleep();
73
- }
74
-
75
- // 3. Start deploying apps one-by-one.
76
- isFirstDeployment && ui.emptyLine();
77
-
78
- // Deploy all apps in the project.
79
- ui.info("Deploying %s app...", "Core");
80
- await this.deployApp({
81
- ...params,
82
- app: "core"
83
- });
84
- ui.emptyLine();
85
- ui.info("Deploying %s app...", "API");
86
- await this.deployApp({
87
- ...params,
88
- app: "api"
89
- });
90
- ui.emptyLine();
91
- ui.info("Deploying %s app...", "Admin");
92
- await this.deployApp({
93
- ...params,
94
- app: "admin"
95
- });
96
- if (isFirstDeployment) {
97
- ui.success(`Congratulations! You've just deployed a brand new project!`);
98
- } else {
99
- ui.success(`Project deployed.`);
100
- }
101
- const printInfoForEnv = new PrintInfoForEnv({
102
- getProjectSdkService: this.getProjectSdkService,
103
- uiService: this.uiService
104
- });
105
- ui.emptyLine();
106
- ui.textBold("Project Details");
107
- await printInfoForEnv.execute(params);
108
- const adminAppOutput = await projectSdk.getAppStackOutput("admin");
109
- if (isFirstDeployment && adminAppOutput) {
110
- ui.emptyLine();
111
- ui.info("The final step is to open the %s app in your browser and complete the installation wizard.", "Admin");
112
- const spinner = ora(`Opening Admin in your browser...`).start();
113
- try {
114
- await sleep(7000);
115
- open(adminAppOutput.appUrl);
116
- spinner.succeed(`Successfully opened Admin app in your browser.`);
117
- } catch {
118
- spinner.fail(`Failed to open Admin in your browser.`);
119
- await sleep(1000);
120
- ui.emptyLine();
121
- 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);
122
- }
123
- }
124
- }
125
- }
126
- };
127
- }
128
- async deployApp(params) {
129
- const projectSdk = await this.getProjectSdkService.execute();
130
- const ui = this.uiService;
131
- const stdio = this.stdioService;
132
- if (params.build !== false) {
133
- const packagesBuilder = await projectSdk.buildApp(params);
134
- const buildRunner = new BuildRunner({
135
- stdio,
136
- ui,
137
- packagesBuilder
138
- });
139
- if (!buildRunner.isEmpty()) {
140
- await buildRunner.run();
141
- ui.emptyLine();
142
- }
143
- }
144
-
145
- // We always show deployment logs when doing previews.
146
- const showDeploymentLogs = Boolean(projectSdk.isCi() || params.preview || params.showDeploymentLogs);
147
- return await projectSdk.deployApp({
148
- ...params,
149
- output: pulumiProcess => {
150
- const deployOutput = new DeployOutput({
151
- stdio,
152
- ui,
153
- showDeploymentLogs,
154
- deployProcess: pulumiProcess,
155
- deployParams: params
156
- });
157
- return deployOutput.output();
158
- }
159
- });
160
- }
161
- }
162
- export const deployCommand = createImplementation({
163
- abstraction: CliCommandFactory,
164
- implementation: DeployCommand,
165
- dependencies: [GetProjectSdkService, UiService, StdioService]
166
- });
167
-
168
- //# sourceMappingURL=DeployCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","StdioService","UiService","DeployOutput","BuildRunner","createBaseAppOptions","setTimeout","ora","open","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","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 {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { DeployOutput } from \"./deployOutputs/DeployOutput.js\";\nimport { AppName } from \"@webiny/project\";\nimport { BuildRunner } from \"~/features/BuildCommand/buildRunners/BuildRunner.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { setTimeout } from \"node:timers/promises\";\nimport ora from \"ora\";\nimport open from \"open\";\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 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"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SACIC,iBAAiB,EACjBC,oBAAoB,EACpBC,YAAY,EACZC,SAAS;AAEb,SAASC,YAAY;AAErB,SAASC,WAAW;AACpB,SAASC,oBAAoB;AAC7B,SAASC,UAAU,QAAQ,sBAAsB;AACjD,OAAOC,GAAG,MAAM,KAAK;AACrB,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA,SAASC,eAAe;AAuBxB,MAAMC,KAAK,GAAGA,CAACC,EAAU,GAAG,IAAI,KAAKL,UAAU,CAACK,EAAE,CAAC;AAEnD,OAAO,MAAMC,aAAa,CAA8D;EACpFC,WAAWA,CACCC,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4D,YAAY,EAAE,CAACxE,oBAAoB,EAAEE,SAAS,EAAED,YAAY;AAChE,CAAC,CAAC","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- import { UiService, StdioService } from "../../../abstractions/index.js";
2
- import { IDeploySingleAppParams } from "../DeployCommand.js";
3
- import { ExecaChildProcess } from "execa";
4
- export type IDeployProcess = ExecaChildProcess<string>;
5
- export interface IBaseDeployOutputParams {
6
- deployProcess: IDeployProcess;
7
- stdio: StdioService.Interface;
8
- ui: UiService.Interface;
9
- showDeploymentLogs: boolean;
10
- deployParams: IDeploySingleAppParams;
11
- }
12
- export declare class BaseDeployOutput {
13
- readonly deployProcess: IDeployProcess;
14
- readonly stdio: StdioService.Interface;
15
- readonly ui: UiService.Interface;
16
- readonly showDeploymentLogs: boolean;
17
- readonly deployParams: IDeploySingleAppParams;
18
- constructor({ deployProcess, stdio, ui, showDeploymentLogs, deployParams }: IBaseDeployOutputParams);
19
- output(): Promise<void>;
20
- }
@@ -1,20 +0,0 @@
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
- }
18
- }
19
-
20
- //# sourceMappingURL=BaseDeployOutput.js.map
@@ -1 +0,0 @@
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,5 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- export declare class DeployOutput extends BaseDeployOutput {
3
- output(): Promise<void>;
4
- private getOutputClass;
5
- }
@@ -1,24 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- import { NoDeploymentLogsDeployOutput } from "./NoDeploymentLogsDeployOutput.js";
3
- import { WithDeploymentLogsDeployOutput } from "./WithDeploymentLogsDeployOutput.js";
4
- export class DeployOutput extends BaseDeployOutput {
5
- async output() {
6
- const OutputClass = this.getOutputClass();
7
- const output = new OutputClass({
8
- deployProcess: this.deployProcess,
9
- stdio: this.stdio,
10
- ui: this.ui,
11
- showDeploymentLogs: this.showDeploymentLogs,
12
- deployParams: this.deployParams
13
- });
14
- return output.output();
15
- }
16
- getOutputClass() {
17
- if (this.showDeploymentLogs) {
18
- return WithDeploymentLogsDeployOutput;
19
- }
20
- return NoDeploymentLogsDeployOutput;
21
- }
22
- }
23
-
24
- //# sourceMappingURL=DeployOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BaseDeployOutput","NoDeploymentLogsDeployOutput","WithDeploymentLogsDeployOutput","DeployOutput","output","OutputClass","getOutputClass","deployProcess","stdio","ui","showDeploymentLogs","deployParams"],"sources":["DeployOutput.ts"],"sourcesContent":["import { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport { NoDeploymentLogsDeployOutput } from \"./NoDeploymentLogsDeployOutput.js\";\nimport { WithDeploymentLogsDeployOutput } from \"./WithDeploymentLogsDeployOutput.js\";\n\nexport class DeployOutput extends BaseDeployOutput {\n public override async output() {\n const OutputClass = this.getOutputClass();\n\n const output = new OutputClass({\n deployProcess: this.deployProcess,\n stdio: this.stdio,\n ui: this.ui,\n showDeploymentLogs: this.showDeploymentLogs,\n deployParams: this.deployParams\n });\n\n return output.output();\n }\n\n private getOutputClass() {\n if (this.showDeploymentLogs) {\n return WithDeploymentLogsDeployOutput;\n }\n\n return NoDeploymentLogsDeployOutput;\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB;AACzB,SAASC,4BAA4B;AACrC,SAASC,8BAA8B;AAEvC,OAAO,MAAMC,YAAY,SAASH,gBAAgB,CAAC;EAC/C,MAAsBI,MAAMA,CAAA,EAAG;IAC3B,MAAMC,WAAW,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;IAEzC,MAAMF,MAAM,GAAG,IAAIC,WAAW,CAAC;MAC3BE,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,EAAE,EAAE,IAAI,CAACA,EAAE;MACXC,kBAAkB,EAAE,IAAI,CAACA,kBAAkB;MAC3CC,YAAY,EAAE,IAAI,CAACA;IACvB,CAAC,CAAC;IAEF,OAAOP,MAAM,CAACA,MAAM,CAAC,CAAC;EAC1B;EAEQE,cAAcA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACI,kBAAkB,EAAE;MACzB,OAAOR,8BAA8B;IACzC;IAEA,OAAOD,4BAA4B;EACvC;AACJ","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- export declare class NoDeploymentLogsDeployOutput extends BaseDeployOutput {
3
- output(): Promise<void>;
4
- }
@@ -1,61 +0,0 @@
1
- import { measureDuration } from "../../utils/index.js";
2
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
3
- import ora from "ora";
4
- const SPINNER_MESSAGES = [[60, "Still deploying..."], [120, "Still deploying, please wait..."], [180, "Some resources take some time to become ready, please wait..."], [270, "Still deploying, please don't interrupt..."], [360, "Still deploying, please be patient..."], [450, "Still deploying, please don't interrupt..."], [540, "Still deploying, please be patient..."], [600, "Deploying for 10 minutes now, probably a couple more to go..."], [720, "Still deploying, shouldn't be much longer now..."], [840, "Looks like it's taking a bit longer than usual, please wait..."], [900, "Deploying for 15 minutes now, hopefully it's almost done..."], [1200, "Deploying for 20 minutes now, hopefully it's almost done..."]];
5
- export class NoDeploymentLogsDeployOutput extends BaseDeployOutput {
6
- async output() {
7
- const deployProcess = this.deployProcess;
8
- const ui = this.ui;
9
- const params = this.deployParams;
10
- const isPreview = !!params.preview;
11
- const getDeploymentDuration = measureDuration();
12
- const spinner = ora(isPreview ? "Previewing deployment..." : "Deploying...");
13
-
14
- // When showing spinner, we want to show a few messages to the user.
15
- // The deployment process can take in some cases 10-15 minutes, so we want to
16
- // give the user some feedback.
17
- const spinnerMessagesTimeouts = SPINNER_MESSAGES.map(([seconds, message]) => {
18
- return setTimeout(() => {
19
- spinner.text = message;
20
- }, seconds * 1000);
21
- });
22
-
23
- // Every second, let's add a dot to the end of the message.
24
- // Once we reach three dots, we start over.
25
- const threeDotsInterval = setInterval(() => {
26
- const spinnerText = spinner.text;
27
- if (spinnerText.endsWith("...")) {
28
- spinner.text = spinnerText.substring(0, spinnerText.length - 3);
29
- } else {
30
- spinner.text = spinnerText + ".";
31
- }
32
- }, 1000);
33
- try {
34
- spinner.start();
35
- await deployProcess;
36
- if (isPreview) {
37
- spinner.succeed(`Preview completed in ${getDeploymentDuration()}.`);
38
- } else {
39
- spinner.succeed(`Deployed in ${getDeploymentDuration()}.`);
40
- }
41
- } catch (e) {
42
- if (isPreview) {
43
- spinner.fail("Preview failed.");
44
- ui.emptyLine();
45
- ui.text(e.message);
46
- ui.error("Preview failed, please check the details above.");
47
- } else {
48
- spinner.fail("Deployment failed.");
49
- ui.emptyLine();
50
- ui.text(e.message);
51
- ui.error("Deployment failed, please check the details above.");
52
- }
53
- throw e;
54
- } finally {
55
- spinnerMessagesTimeouts.forEach(clearTimeout);
56
- clearInterval(threeDotsInterval);
57
- }
58
- }
59
- }
60
-
61
- //# sourceMappingURL=NoDeploymentLogsDeployOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["measureDuration","BaseDeployOutput","ora","SPINNER_MESSAGES","NoDeploymentLogsDeployOutput","output","deployProcess","ui","params","deployParams","isPreview","preview","getDeploymentDuration","spinner","spinnerMessagesTimeouts","map","seconds","message","setTimeout","text","threeDotsInterval","setInterval","spinnerText","endsWith","substring","length","start","succeed","e","fail","emptyLine","error","forEach","clearTimeout","clearInterval"],"sources":["NoDeploymentLogsDeployOutput.ts"],"sourcesContent":["import { measureDuration } from \"~/features/utils/index.js\";\nimport { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport ora from \"ora\";\n\nconst SPINNER_MESSAGES: [number, string][] = [\n [60, \"Still deploying...\"],\n [120, \"Still deploying, please wait...\"],\n [180, \"Some resources take some time to become ready, please wait...\"],\n\n [270, \"Still deploying, please don't interrupt...\"],\n [360, \"Still deploying, please be patient...\"],\n [450, \"Still deploying, please don't interrupt...\"],\n [540, \"Still deploying, please be patient...\"],\n\n [600, \"Deploying for 10 minutes now, probably a couple more to go...\"],\n [720, \"Still deploying, shouldn't be much longer now...\"],\n\n [840, \"Looks like it's taking a bit longer than usual, please wait...\"],\n [900, \"Deploying for 15 minutes now, hopefully it's almost done...\"],\n\n [1200, \"Deploying for 20 minutes now, hopefully it's almost done...\"]\n];\n\nexport class NoDeploymentLogsDeployOutput extends BaseDeployOutput {\n public override async output() {\n const deployProcess = this.deployProcess;\n const ui = this.ui;\n const params = this.deployParams;\n\n const isPreview = !!params.preview;\n\n const getDeploymentDuration = measureDuration();\n\n const spinner = ora(isPreview ? \"Previewing deployment...\" : \"Deploying...\");\n\n // When showing spinner, we want to show a few messages to the user.\n // The deployment process can take in some cases 10-15 minutes, so we want to\n // give the user some feedback.\n const spinnerMessagesTimeouts = SPINNER_MESSAGES.map(([seconds, message]) => {\n return setTimeout(() => {\n spinner.text = message;\n }, seconds * 1000);\n });\n\n // Every second, let's add a dot to the end of the message.\n // Once we reach three dots, we start over.\n const threeDotsInterval = setInterval(() => {\n const spinnerText = spinner.text;\n if (spinnerText.endsWith(\"...\")) {\n spinner.text = spinnerText.substring(0, spinnerText.length - 3);\n } else {\n spinner.text = spinnerText + \".\";\n }\n }, 1000);\n\n try {\n spinner.start();\n await deployProcess;\n\n if (isPreview) {\n spinner.succeed(`Preview completed in ${getDeploymentDuration()}.`);\n } else {\n spinner.succeed(`Deployed in ${getDeploymentDuration()}.`);\n }\n } catch (e) {\n if (isPreview) {\n spinner.fail(\"Preview failed.\");\n ui.emptyLine();\n ui.text(e.message);\n ui.error(\"Preview failed, please check the details above.\");\n } else {\n spinner.fail(\"Deployment failed.\");\n ui.emptyLine();\n ui.text(e.message);\n ui.error(\"Deployment failed, please check the details above.\");\n }\n\n throw e;\n } finally {\n spinnerMessagesTimeouts.forEach(clearTimeout);\n clearInterval(threeDotsInterval);\n }\n }\n}\n"],"mapp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 -1,4 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- export declare class WithDeploymentLogsDeployOutput extends BaseDeployOutput {
3
- output(): Promise<void>;
4
- }
@@ -1,44 +0,0 @@
1
- import { measureDuration } from "../../utils/index.js";
2
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
3
- import { PulumiError } from "@webiny/pulumi-sdk";
4
- export class WithDeploymentLogsDeployOutput extends BaseDeployOutput {
5
- async output() {
6
- const deployProcess = this.deployProcess;
7
- const ui = this.ui;
8
- const stdio = this.stdio;
9
- const params = this.deployParams;
10
- const isPreview = !!params.preview;
11
- const getDeploymentDuration = measureDuration();
12
- try {
13
- if (isPreview) {
14
- ui.info(`Previewing deployment for %s app...`, params.app);
15
- } else {
16
- ui.info(`Deploying %s app...`, params.app);
17
- }
18
- ui.emptyLine();
19
- this.deployProcess.stdout.pipe(stdio.getStdout());
20
- this.deployProcess.stderr.pipe(stdio.getStderr());
21
- await deployProcess;
22
- if (isPreview) {
23
- ui.success(`Preview completed in ${getDeploymentDuration()}.`);
24
- } else {
25
- ui.success(`Deployed in ${getDeploymentDuration()}.`);
26
- }
27
- } catch (e) {
28
- // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.
29
- if (e instanceof PulumiError) {
30
- // Do nothing.
31
- } else {
32
- ui.text(e.message);
33
- }
34
- if (isPreview) {
35
- ui.error("Preview failed, please check the details above.");
36
- } else {
37
- ui.error("Deployment failed, please check the details above.");
38
- }
39
- throw e;
40
- }
41
- }
42
- }
43
-
44
- //# sourceMappingURL=WithDeploymentLogsDeployOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["measureDuration","BaseDeployOutput","PulumiError","WithDeploymentLogsDeployOutput","output","deployProcess","ui","stdio","params","deployParams","isPreview","preview","getDeploymentDuration","info","app","emptyLine","stdout","pipe","getStdout","stderr","getStderr","success","e","text","message","error"],"sources":["WithDeploymentLogsDeployOutput.ts"],"sourcesContent":["import { measureDuration } from \"~/features/utils/index.js\";\nimport { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport { PulumiError } from \"@webiny/pulumi-sdk\";\n\nexport class WithDeploymentLogsDeployOutput extends BaseDeployOutput {\n public override async output() {\n const deployProcess = this.deployProcess;\n const ui = this.ui;\n const stdio = this.stdio;\n const params = this.deployParams;\n\n const isPreview = !!params.preview;\n\n const getDeploymentDuration = measureDuration();\n\n try {\n if (isPreview) {\n ui.info(`Previewing deployment for %s app...`, params.app);\n } else {\n ui.info(`Deploying %s app...`, params.app);\n }\n\n ui.emptyLine();\n\n this.deployProcess.stdout!.pipe(stdio.getStdout());\n this.deployProcess.stderr!.pipe(stdio.getStderr());\n await deployProcess;\n\n if (isPreview) {\n ui.success(`Preview completed in ${getDeploymentDuration()}.`);\n } else {\n ui.success(`Deployed in ${getDeploymentDuration()}.`);\n }\n } catch (e) {\n // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.\n if (e instanceof PulumiError) {\n // Do nothing.\n } else {\n ui.text(e.message);\n }\n\n if (isPreview) {\n ui.error(\"Preview failed, please check the details above.\");\n } else {\n ui.error(\"Deployment failed, please check the details above.\");\n }\n\n throw e;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,8BAA8B,SAASF,gBAAgB,CAAC;EACjE,MAAsBG,MAAMA,CAAA,EAAG;IAC3B,MAAMC,aAAa,GAAG,IAAI,CAACA,aAAa;IACxC,MAAMC,EAAE,GAAG,IAAI,CAACA,EAAE;IAClB,MAAMC,KAAK,GAAG,IAAI,CAACA,KAAK;IACxB,MAAMC,MAAM,GAAG,IAAI,CAACC,YAAY;IAEhC,MAAMC,SAAS,GAAG,CAAC,CAACF,MAAM,CAACG,OAAO;IAElC,MAAMC,qBAAqB,GAAGZ,eAAe,CAAC,CAAC;IAE/C,IAAI;MACA,IAAIU,SAAS,EAAE;QACXJ,EAAE,CAACO,IAAI,CAAC,qCAAqC,EAAEL,MAAM,CAACM,GAAG,CAAC;MAC9D,CAAC,MAAM;QACHR,EAAE,CAACO,IAAI,CAAC,qBAAqB,EAAEL,MAAM,CAACM,GAAG,CAAC;MAC9C;MAEAR,EAAE,CAACS,SAAS,CAAC,CAAC;MAEd,IAAI,CAACV,aAAa,CAACW,MAAM,CAAEC,IAAI,CAACV,KAAK,CAACW,SAAS,CAAC,CAAC,CAAC;MAClD,IAAI,CAACb,aAAa,CAACc,MAAM,CAAEF,IAAI,CAACV,KAAK,CAACa,SAAS,CAAC,CAAC,CAAC;MAClD,MAAMf,aAAa;MAEnB,IAAIK,SAAS,EAAE;QACXJ,EAAE,CAACe,OAAO,CAAC,wBAAwBT,qBAAqB,CAAC,CAAC,GAAG,CAAC;MAClE,CAAC,MAAM;QACHN,EAAE,CAACe,OAAO,CAAC,eAAeT,qBAAqB,CAAC,CAAC,GAAG,CAAC;MACzD;IACJ,CAAC,CAAC,OAAOU,CAAC,EAAE;MACR;MACA,IAAIA,CAAC,YAAYpB,WAAW,EAAE;QAC1B;MAAA,CACH,MAAM;QACHI,EAAE,CAACiB,IAAI,CAACD,CAAC,CAACE,OAAO,CAAC;MACtB;MAEA,IAAId,SAAS,EAAE;QACXJ,EAAE,CAACmB,KAAK,CAAC,iDAAiD,CAAC;MAC/D,CAAC,MAAM;QACHnB,EAAE,CAACmB,KAAK,CAAC,oDAAoD,CAAC;MAClE;MAEA,MAAMH,CAAC;IACX;EACJ;AACJ","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DeployCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./commands/SyncDepsCommand.js\";\nexport * from \"./commands/VerifyDepsCommand.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
2
- import { AppName } from "@webiny/project";
3
- export interface IDestroyNoAppParams {
4
- variant?: string;
5
- region?: string;
6
- env: string;
7
- }
8
- export interface IDestroyWithAppParams extends IDestroyNoAppParams {
9
- app: AppName;
10
- build?: boolean;
11
- preview?: boolean;
12
- }
13
- export type IDestroyCommandParams = IDestroyNoAppParams | IDestroyWithAppParams;
14
- export declare class DestroyCommand implements CliCommandFactory.Interface<IDestroyCommandParams> {
15
- private getProjectSdkService;
16
- private uiService;
17
- private stdioService;
18
- constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface, stdioService: StdioService.Interface);
19
- execute(): Promise<CliCommandFactory.CommandDefinition<IDestroyCommandParams>>;
20
- private destroyApp;
21
- }
22
- export declare const destroyCommand: import("@webiny/di").Implementation<typeof DestroyCommand>;
@@ -1,78 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
3
- import { measureDuration } from "../utils/index.js";
4
- import { createBaseAppOptions } from "../common/index.js";
5
- import { PulumiError } from "@webiny/pulumi-sdk";
6
- export class DestroyCommand {
7
- constructor(getProjectSdkService, uiService, stdioService) {
8
- this.getProjectSdkService = getProjectSdkService;
9
- this.uiService = uiService;
10
- this.stdioService = stdioService;
11
- }
12
- async execute() {
13
- const projectSdk = await this.getProjectSdkService.execute();
14
- return {
15
- name: "destroy",
16
- description: "Destroys specified app or all apps in the project",
17
- examples: ["$0 destroy api --env dev", "$0 destroy admin --env prod", "$0 destroy --env prod", "$0 destroy"],
18
- params: [{
19
- name: "app",
20
- description: "Name of the app (core, admin, or api)",
21
- type: "string"
22
- }],
23
- options: createBaseAppOptions(projectSdk),
24
- handler: async params => {
25
- if ("app" in params) {
26
- return this.destroyApp(params);
27
- }
28
-
29
- // Destroy all apps in the project.
30
- await this.destroyApp({
31
- ...params,
32
- app: "admin"
33
- });
34
- await this.destroyApp({
35
- ...params,
36
- app: "api"
37
- });
38
- await this.destroyApp({
39
- ...params,
40
- app: "core"
41
- });
42
- }
43
- };
44
- }
45
- async destroyApp(params) {
46
- const projectSdk = await this.getProjectSdkService.execute();
47
- const ui = this.uiService;
48
- const stdio = this.stdioService;
49
- const {
50
- pulumiProcess
51
- } = await projectSdk.destroyApp(params);
52
- const getDestroyDuration = measureDuration();
53
- try {
54
- ui.info(`Destroying %s app...`, params.app);
55
- ui.emptyLine();
56
- pulumiProcess.stdout.pipe(stdio.getStdout());
57
- pulumiProcess.stderr.pipe(stdio.getStderr());
58
- await pulumiProcess;
59
- ui.success(`Destroyed in ${getDestroyDuration()}.`);
60
- } catch (e) {
61
- // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.
62
- if (e instanceof PulumiError) {
63
- ui.error("Destroy failed, please check the details above.");
64
- } else {
65
- ui.text(e.message);
66
- ui.error("Destroy failed, please check the details above.");
67
- }
68
- throw e;
69
- }
70
- }
71
- }
72
- export const destroyCommand = createImplementation({
73
- abstraction: CliCommandFactory,
74
- implementation: DestroyCommand,
75
- dependencies: [GetProjectSdkService, UiService, StdioService]
76
- });
77
-
78
- //# sourceMappingURL=DestroyCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","StdioService","UiService","measureDuration","createBaseAppOptions","PulumiError","DestroyCommand","constructor","getProjectSdkService","uiService","stdioService","execute","projectSdk","name","description","examples","params","type","options","handler","destroyApp","app","ui","stdio","pulumiProcess","getDestroyDuration","info","emptyLine","stdout","pipe","getStdout","stderr","getStderr","success","e","error","text","message","destroyCommand","abstraction","implementation","dependencies"],"sources":["DestroyCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { measureDuration } from \"~/features/utils/index.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { PulumiError } from \"@webiny/pulumi-sdk\";\nimport { AppName } from \"@webiny/project\";\n\nexport interface IDestroyNoAppParams {\n variant?: string;\n region?: string;\n env: string;\n}\n\nexport interface IDestroyWithAppParams extends IDestroyNoAppParams {\n app: AppName;\n build?: boolean;\n preview?: boolean;\n}\n\nexport type IDestroyCommandParams = IDestroyNoAppParams | IDestroyWithAppParams;\n\nexport class DestroyCommand implements CliCommandFactory.Interface<IDestroyCommandParams> {\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<IDestroyCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"destroy\",\n description: \"Destroys specified app or all apps in the project\",\n examples: [\n \"$0 destroy api --env dev\",\n \"$0 destroy admin --env prod\",\n \"$0 destroy --env prod\",\n \"$0 destroy\"\n ],\n params: [\n {\n name: \"app\",\n description: \"Name of the app (core, admin, or api)\",\n type: \"string\"\n }\n ],\n options: createBaseAppOptions(projectSdk),\n handler: async (params: IDestroyCommandParams) => {\n if (\"app\" in params) {\n return this.destroyApp(params);\n }\n\n // Destroy all apps in the project.\n await this.destroyApp({ ...params, app: \"admin\" });\n await this.destroyApp({ ...params, app: \"api\" });\n await this.destroyApp({ ...params, app: \"core\" });\n }\n };\n }\n\n private async destroyApp(params: IDestroyWithAppParams) {\n const projectSdk = await this.getProjectSdkService.execute();\n const ui = this.uiService;\n const stdio = this.stdioService;\n\n const { pulumiProcess } = await projectSdk.destroyApp(params);\n\n const getDestroyDuration = measureDuration();\n\n try {\n ui.info(`Destroying %s app...`, params.app);\n\n ui.emptyLine();\n\n pulumiProcess.stdout!.pipe(stdio.getStdout());\n pulumiProcess.stderr!.pipe(stdio.getStderr());\n await pulumiProcess;\n\n ui.success(`Destroyed in ${getDestroyDuration()}.`);\n } catch (e) {\n // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.\n if (e instanceof PulumiError) {\n ui.error(\"Destroy failed, please check the details above.\");\n } else {\n ui.text(e.message);\n ui.error(\"Destroy failed, please check the details above.\");\n }\n\n throw e;\n }\n }\n}\n\nexport const destroyCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DestroyCommand,\n dependencies: [GetProjectSdkService, UiService, StdioService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SACIC,iBAAiB,EACjBC,oBAAoB,EACpBC,YAAY,EACZC,SAAS;AAEb,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SAASC,WAAW,QAAQ,oBAAoB;AAiBhD,OAAO,MAAMC,cAAc,CAA+D;EACtFC,WAAWA,CACCC,oBAAoD,EACpDC,SAA8B,EAC9BC,YAAoC,EAC9C;IAAA,KAHUF,oBAAoD,GAApDA,oBAAoD;IAAA,KACpDC,SAA8B,GAA9BA,SAA8B;IAAA,KAC9BC,YAAoC,GAApCA,YAAoC;EAC7C;EAEH,MAAMC,OAAOA,CAAA,EAAwE;IACjF,MAAMC,UAAU,GAAG,MAAM,IAAI,CAACJ,oBAAoB,CAACG,OAAO,CAAC,CAAC;IAE5D,OAAO;MACHE,IAAI,EAAE,SAAS;MACfC,WAAW,EAAE,mDAAmD;MAChEC,QAAQ,EAAE,CACN,0BAA0B,EAC1B,6BAA6B,EAC7B,uBAAuB,EACvB,YAAY,CACf;MACDC,MAAM,EAAE,CACJ;QACIH,IAAI,EAAE,KAAK;QACXC,WAAW,EAAE,uCAAuC;QACpDG,IAAI,EAAE;MACV,CAAC,CACJ;MACDC,OAAO,EAAEd,oBAAoB,CAACQ,UAAU,CAAC;MACzCO,OAAO,EAAE,MAAOH,MAA6B,IAAK;QAC9C,IAAI,KAAK,IAAIA,MAAM,EAAE;UACjB,OAAO,IAAI,CAACI,UAAU,CAACJ,MAAM,CAAC;QAClC;;QAEA;QACA,MAAM,IAAI,CAACI,UAAU,CAAC;UAAE,GAAGJ,MAAM;UAAEK,GAAG,EAAE;QAAQ,CAAC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AEA,OAAO,MAAMI,cAAc,GAAGxC,oBAAoB,CAAC;EAC/CyC,WAAW,EAAExC,iBAAiB;EAC9ByC,cAAc,EAAElC,cAAc;EAC9BmC,YAAY,EAAE,CAACzC,oBAAoB,EAAEE,SAAS,EAAED,YAAY;AAChE,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- export * from "./DestroyCommand.js";
@@ -1,3 +0,0 @@
1
- export * from "./DestroyCommand.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DestroyCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ExtensionCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import { CliCommandFactory, GetProjectSdkService, UiService } from "../../abstractions/index.js";
2
- import { IBaseAppParams } from "../../abstractions/features/types.js";
3
- export type IInfoCommandParams = Omit<IBaseAppParams, "app">;
4
- export declare class InfoCommand implements CliCommandFactory.Interface<IInfoCommandParams> {
5
- private getProjectSdkService;
6
- private uiService;
7
- constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface);
8
- execute(): Promise<CliCommandFactory.CommandDefinition<IInfoCommandParams>>;
9
- }
10
- export declare const infoCommand: import("@webiny/di").Implementation<typeof InfoCommand>;