@webiny/cli-core 0.0.0-unstable.61c048f412

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 (369) hide show
  1. package/Cli.d.ts +7 -0
  2. package/Cli.js +16 -0
  3. package/Cli.js.map +1 -0
  4. package/LICENSE +21 -0
  5. package/README.md +11 -0
  6. package/abstractions/createAbstraction.d.ts +2 -0
  7. package/abstractions/createAbstraction.js +6 -0
  8. package/abstractions/createAbstraction.js.map +1 -0
  9. package/abstractions/features/CliCommand.d.ts +37 -0
  10. package/abstractions/features/CliCommand.js +4 -0
  11. package/abstractions/features/CliCommand.js.map +1 -0
  12. package/abstractions/features/ErrorHandler.d.ts +15 -0
  13. package/abstractions/features/ErrorHandler.js +4 -0
  14. package/abstractions/features/ErrorHandler.js.map +1 -0
  15. package/abstractions/features/GlobalCliOption.d.ts +20 -0
  16. package/abstractions/features/GlobalCliOption.js +4 -0
  17. package/abstractions/features/GlobalCliOption.js.map +1 -0
  18. package/abstractions/features/IsCi.d.ts +8 -0
  19. package/abstractions/features/IsCi.js +4 -0
  20. package/abstractions/features/IsCi.js.map +1 -0
  21. package/abstractions/features/index.d.ts +4 -0
  22. package/abstractions/features/index.js +6 -0
  23. package/abstractions/features/index.js.map +1 -0
  24. package/abstractions/features/types.d.ts +8 -0
  25. package/abstractions/features/types.js +3 -0
  26. package/abstractions/features/types.js.map +1 -0
  27. package/abstractions/index.d.ts +2 -0
  28. package/abstractions/index.js +4 -0
  29. package/abstractions/index.js.map +1 -0
  30. package/abstractions/services/ArgvParserService.d.ts +7 -0
  31. package/abstractions/services/ArgvParserService.js +4 -0
  32. package/abstractions/services/ArgvParserService.js.map +1 -0
  33. package/abstractions/services/CliParamsService.d.ts +15 -0
  34. package/abstractions/services/CliParamsService.js +4 -0
  35. package/abstractions/services/CliParamsService.js.map +1 -0
  36. package/abstractions/services/CommandsRegistryService.d.ts +8 -0
  37. package/abstractions/services/CommandsRegistryService.js +4 -0
  38. package/abstractions/services/CommandsRegistryService.js.map +1 -0
  39. package/abstractions/services/GetArgvService.d.ts +7 -0
  40. package/abstractions/services/GetArgvService.js +4 -0
  41. package/abstractions/services/GetArgvService.js.map +1 -0
  42. package/abstractions/services/GetCliRunnerService.d.ts +7 -0
  43. package/abstractions/services/GetCliRunnerService.js +4 -0
  44. package/abstractions/services/GetCliRunnerService.js.map +1 -0
  45. package/abstractions/services/GetIsCiService.d.ts +8 -0
  46. package/abstractions/services/GetIsCiService.js +4 -0
  47. package/abstractions/services/GetIsCiService.js.map +1 -0
  48. package/abstractions/services/GetProjectSdkService.d.ts +8 -0
  49. package/abstractions/services/GetProjectSdkService.js +4 -0
  50. package/abstractions/services/GetProjectSdkService.js.map +1 -0
  51. package/abstractions/services/GlobalOptionsRegistryService.d.ts +8 -0
  52. package/abstractions/services/GlobalOptionsRegistryService.js +4 -0
  53. package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -0
  54. package/abstractions/services/LoggerService.d.ts +13 -0
  55. package/abstractions/services/LoggerService.js +4 -0
  56. package/abstractions/services/LoggerService.js.map +1 -0
  57. package/abstractions/services/RunCliRunnerService.d.ts +7 -0
  58. package/abstractions/services/RunCliRunnerService.js +4 -0
  59. package/abstractions/services/RunCliRunnerService.js.map +1 -0
  60. package/abstractions/services/StdioService.d.ts +9 -0
  61. package/abstractions/services/StdioService.js +4 -0
  62. package/abstractions/services/StdioService.js.map +1 -0
  63. package/abstractions/services/UiService.d.ts +15 -0
  64. package/abstractions/services/UiService.js +4 -0
  65. package/abstractions/services/UiService.js.map +1 -0
  66. package/abstractions/services/index.d.ts +12 -0
  67. package/abstractions/services/index.js +14 -0
  68. package/abstractions/services/index.js.map +1 -0
  69. package/createCliContainer.d.ts +3 -0
  70. package/createCliContainer.js +128 -0
  71. package/createCliContainer.js.map +1 -0
  72. package/decorators/CommandsWithGracefulErrorHandling.d.ts +10 -0
  73. package/decorators/CommandsWithGracefulErrorHandling.js +38 -0
  74. package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -0
  75. package/decorators/DeployCommandWithTelemetry.d.ts +11 -0
  76. package/decorators/DeployCommandWithTelemetry.js +91 -0
  77. package/decorators/DeployCommandWithTelemetry.js.map +1 -0
  78. package/decorators/index.d.ts +2 -0
  79. package/decorators/index.js +4 -0
  80. package/decorators/index.js.map +1 -0
  81. package/exports/cli/command.d.ts +1 -0
  82. package/exports/cli/command.js +3 -0
  83. package/exports/cli/command.js.map +1 -0
  84. package/exports/cli/index.d.ts +2 -0
  85. package/exports/cli/index.js +4 -0
  86. package/exports/cli/index.js.map +1 -0
  87. package/extensions/CliCommand.d.ts +8 -0
  88. package/extensions/CliCommand.js +23 -0
  89. package/extensions/CliCommand.js.map +1 -0
  90. package/extensions/CliCommandDecorator.d.ts +8 -0
  91. package/extensions/CliCommandDecorator.js +23 -0
  92. package/extensions/CliCommandDecorator.js.map +1 -0
  93. package/extensions/index.d.ts +9 -0
  94. package/extensions/index.js +6 -0
  95. package/extensions/index.js.map +1 -0
  96. package/features/AboutCommand.d.ts +12 -0
  97. package/features/AboutCommand.js +94 -0
  98. package/features/AboutCommand.js.map +1 -0
  99. package/features/BuildCommand/BuildCommand.d.ts +11 -0
  100. package/features/BuildCommand/BuildCommand.js +44 -0
  101. package/features/BuildCommand/BuildCommand.js.map +1 -0
  102. package/features/BuildCommand/buildRunners/BaseBuildRunner.d.ts +14 -0
  103. package/features/BuildCommand/buildRunners/BaseBuildRunner.js +16 -0
  104. package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -0
  105. package/features/BuildCommand/buildRunners/BuildRunner.d.ts +6 -0
  106. package/features/BuildCommand/buildRunners/BuildRunner.js +30 -0
  107. package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -0
  108. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.d.ts +4 -0
  109. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +25 -0
  110. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -0
  111. package/features/BuildCommand/buildRunners/SingleBuildRunner.d.ts +4 -0
  112. package/features/BuildCommand/buildRunners/SingleBuildRunner.js +19 -0
  113. package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -0
  114. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.d.ts +4 -0
  115. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +8 -0
  116. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -0
  117. package/features/BuildCommand/index.d.ts +1 -0
  118. package/features/BuildCommand/index.js +3 -0
  119. package/features/BuildCommand/index.js.map +1 -0
  120. package/features/ConfigCommand.d.ts +16 -0
  121. package/features/ConfigCommand.js +64 -0
  122. package/features/ConfigCommand.js.map +1 -0
  123. package/features/DeployCommand/DeployCommand.d.ts +30 -0
  124. package/features/DeployCommand/DeployCommand.js +168 -0
  125. package/features/DeployCommand/DeployCommand.js.map +1 -0
  126. package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +20 -0
  127. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +20 -0
  128. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -0
  129. package/features/DeployCommand/deployOutputs/DeployOutput.d.ts +5 -0
  130. package/features/DeployCommand/deployOutputs/DeployOutput.js +24 -0
  131. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -0
  132. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.d.ts +4 -0
  133. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +61 -0
  134. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -0
  135. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.d.ts +4 -0
  136. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +44 -0
  137. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -0
  138. package/features/DeployCommand/index.d.ts +1 -0
  139. package/features/DeployCommand/index.js +3 -0
  140. package/features/DeployCommand/index.js.map +1 -0
  141. package/features/DepsSync/BuildDependencyTree.d.ts +9 -0
  142. package/features/DepsSync/BuildDependencyTree.js +27 -0
  143. package/features/DepsSync/BuildDependencyTree.js.map +1 -0
  144. package/features/DepsSync/DependencyTree.d.ts +12 -0
  145. package/features/DepsSync/DependencyTree.js +131 -0
  146. package/features/DepsSync/DependencyTree.js.map +1 -0
  147. package/features/DepsSync/ListAllPackageJsonFiles.d.ts +7 -0
  148. package/features/DepsSync/ListAllPackageJsonFiles.js +18 -0
  149. package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -0
  150. package/features/DepsSync/ListAllPackages.d.ts +3 -0
  151. package/features/DepsSync/ListAllPackages.js +13 -0
  152. package/features/DepsSync/ListAllPackages.js.map +1 -0
  153. package/features/DepsSync/commands/SyncDepsCommand.d.ts +13 -0
  154. package/features/DepsSync/commands/SyncDepsCommand.js +32 -0
  155. package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -0
  156. package/features/DepsSync/commands/VerifyDepsCommand.d.ts +13 -0
  157. package/features/DepsSync/commands/VerifyDepsCommand.js +81 -0
  158. package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -0
  159. package/features/DepsSync/createDependencyTree.d.ts +3 -0
  160. package/features/DepsSync/createDependencyTree.js +24 -0
  161. package/features/DepsSync/createDependencyTree.js.map +1 -0
  162. package/features/DepsSync/createReferenceFile.d.ts +7 -0
  163. package/features/DepsSync/createReferenceFile.js +30 -0
  164. package/features/DepsSync/createReferenceFile.js.map +1 -0
  165. package/features/DepsSync/index.d.ts +2 -0
  166. package/features/DepsSync/index.js +4 -0
  167. package/features/DepsSync/index.js.map +1 -0
  168. package/features/DepsSync/paths.d.ts +3 -0
  169. package/features/DepsSync/paths.js +8 -0
  170. package/features/DepsSync/paths.js.map +1 -0
  171. package/features/DepsSync/types.d.ts +45 -0
  172. package/features/DepsSync/types.js +9 -0
  173. package/features/DepsSync/types.js.map +1 -0
  174. package/features/DestroyCommand/DestroyCommand.d.ts +22 -0
  175. package/features/DestroyCommand/DestroyCommand.js +78 -0
  176. package/features/DestroyCommand/DestroyCommand.js.map +1 -0
  177. package/features/DestroyCommand/index.d.ts +1 -0
  178. package/features/DestroyCommand/index.js +3 -0
  179. package/features/DestroyCommand/index.js.map +1 -0
  180. package/features/DisableTelemetryCommand.d.ts +11 -0
  181. package/features/DisableTelemetryCommand.js +31 -0
  182. package/features/DisableTelemetryCommand.js.map +1 -0
  183. package/features/EnableTelemetryCommand.d.ts +11 -0
  184. package/features/EnableTelemetryCommand.js +31 -0
  185. package/features/EnableTelemetryCommand.js.map +1 -0
  186. package/features/ExtensionCommand/ExtensionCommand.d.ts +12 -0
  187. package/features/ExtensionCommand/ExtensionCommand.js +71 -0
  188. package/features/ExtensionCommand/ExtensionCommand.js.map +1 -0
  189. package/features/ExtensionCommand/index.d.ts +1 -0
  190. package/features/ExtensionCommand/index.js +3 -0
  191. package/features/ExtensionCommand/index.js.map +1 -0
  192. package/features/InfoCommand/InfoCommand.d.ts +10 -0
  193. package/features/InfoCommand/InfoCommand.js +64 -0
  194. package/features/InfoCommand/InfoCommand.js.map +1 -0
  195. package/features/InfoCommand/PrintInfoForEnv.d.ts +14 -0
  196. package/features/InfoCommand/PrintInfoForEnv.js +48 -0
  197. package/features/InfoCommand/PrintInfoForEnv.js.map +1 -0
  198. package/features/InfoCommand/index.d.ts +1 -0
  199. package/features/InfoCommand/index.js +3 -0
  200. package/features/InfoCommand/index.js.map +1 -0
  201. package/features/IsCi/IsCi.d.ts +7 -0
  202. package/features/IsCi/IsCi.js +17 -0
  203. package/features/IsCi/IsCi.js.map +1 -0
  204. package/features/IsCi/index.d.ts +1 -0
  205. package/features/IsCi/index.js +3 -0
  206. package/features/IsCi/index.js.map +1 -0
  207. package/features/OpenCommand.d.ts +10 -0
  208. package/features/OpenCommand.js +54 -0
  209. package/features/OpenCommand.js.map +1 -0
  210. package/features/OutputCommand.d.ts +12 -0
  211. package/features/OutputCommand.js +79 -0
  212. package/features/OutputCommand.js.map +1 -0
  213. package/features/PulumiCommand/PulumiCommand.d.ts +13 -0
  214. package/features/PulumiCommand/PulumiCommand.js +50 -0
  215. package/features/PulumiCommand/PulumiCommand.js.map +1 -0
  216. package/features/PulumiCommand/index.d.ts +1 -0
  217. package/features/PulumiCommand/index.js +3 -0
  218. package/features/PulumiCommand/index.js.map +1 -0
  219. package/features/RefreshCommand/RefreshCommand.d.ts +12 -0
  220. package/features/RefreshCommand/RefreshCommand.js +45 -0
  221. package/features/RefreshCommand/RefreshCommand.js.map +1 -0
  222. package/features/RefreshCommand/index.d.ts +1 -0
  223. package/features/RefreshCommand/index.js +3 -0
  224. package/features/RefreshCommand/index.js.map +1 -0
  225. package/features/WatchCommand/WatchCommand.d.ts +11 -0
  226. package/features/WatchCommand/WatchCommand.js +143 -0
  227. package/features/WatchCommand/WatchCommand.js.map +1 -0
  228. package/features/WatchCommand/createPrefixer.d.ts +2 -0
  229. package/features/WatchCommand/createPrefixer.js +20 -0
  230. package/features/WatchCommand/createPrefixer.js.map +1 -0
  231. package/features/WatchCommand/getRandomColorForString.d.ts +1 -0
  232. package/features/WatchCommand/getRandomColorForString.js +11 -0
  233. package/features/WatchCommand/getRandomColorForString.js.map +1 -0
  234. package/features/WatchCommand/index.d.ts +1 -0
  235. package/features/WatchCommand/index.js +3 -0
  236. package/features/WatchCommand/index.js.map +1 -0
  237. package/features/Wcp/LinkProjectCommand.d.ts +13 -0
  238. package/features/Wcp/LinkProjectCommand.js +146 -0
  239. package/features/Wcp/LinkProjectCommand.js.map +1 -0
  240. package/features/Wcp/LoginCommand.d.ts +13 -0
  241. package/features/Wcp/LoginCommand.js +126 -0
  242. package/features/Wcp/LoginCommand.js.map +1 -0
  243. package/features/Wcp/LogoutCommand.d.ts +13 -0
  244. package/features/Wcp/LogoutCommand.js +29 -0
  245. package/features/Wcp/LogoutCommand.js.map +1 -0
  246. package/features/Wcp/WhoAmICommand.d.ts +15 -0
  247. package/features/Wcp/WhoAmICommand.js +34 -0
  248. package/features/Wcp/WhoAmICommand.js.map +1 -0
  249. package/features/common/index.d.ts +1 -0
  250. package/features/common/index.js +3 -0
  251. package/features/common/index.js.map +1 -0
  252. package/features/common/options.d.ts +20 -0
  253. package/features/common/options.js +52 -0
  254. package/features/common/options.js.map +1 -0
  255. package/features/globalOptions/LogLevelGlobalOption.d.ts +5 -0
  256. package/features/globalOptions/LogLevelGlobalOption.js +22 -0
  257. package/features/globalOptions/LogLevelGlobalOption.js.map +1 -0
  258. package/features/globalOptions/ShowLogsGlobalOption.d.ts +5 -0
  259. package/features/globalOptions/ShowLogsGlobalOption.js +21 -0
  260. package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -0
  261. package/features/globalOptions/StackTraceGlobalOption.d.ts +5 -0
  262. package/features/globalOptions/StackTraceGlobalOption.js +21 -0
  263. package/features/globalOptions/StackTraceGlobalOption.js.map +1 -0
  264. package/features/globalOptions/index.d.ts +3 -0
  265. package/features/globalOptions/index.js +5 -0
  266. package/features/globalOptions/index.js.map +1 -0
  267. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +6 -0
  268. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +26 -0
  269. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -0
  270. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.d.ts +6 -0
  271. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +27 -0
  272. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -0
  273. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.d.ts +6 -0
  274. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +29 -0
  275. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -0
  276. package/features/gracefulErrorHandlers/index.d.ts +3 -0
  277. package/features/gracefulErrorHandlers/index.js +5 -0
  278. package/features/gracefulErrorHandlers/index.js.map +1 -0
  279. package/features/index.d.ts +22 -0
  280. package/features/index.js +24 -0
  281. package/features/index.js.map +1 -0
  282. package/features/utils/index.d.ts +1 -0
  283. package/features/utils/index.js +3 -0
  284. package/features/utils/index.js.map +1 -0
  285. package/features/utils/measureDuration.d.ts +1 -0
  286. package/features/utils/measureDuration.js +11 -0
  287. package/features/utils/measureDuration.js.map +1 -0
  288. package/index.d.ts +1 -0
  289. package/index.js +3 -0
  290. package/index.js.map +1 -0
  291. package/package.json +48 -0
  292. package/services/ArgvParserService/ArgvParserService.d.ts +7 -0
  293. package/services/ArgvParserService/ArgvParserService.js +41 -0
  294. package/services/ArgvParserService/ArgvParserService.js.map +1 -0
  295. package/services/ArgvParserService/index.d.ts +1 -0
  296. package/services/ArgvParserService/index.js +3 -0
  297. package/services/ArgvParserService/index.js.map +1 -0
  298. package/services/CliParamsService/CliParamsService.d.ts +7 -0
  299. package/services/CliParamsService/CliParamsService.js +21 -0
  300. package/services/CliParamsService/CliParamsService.js.map +1 -0
  301. package/services/CliParamsService/index.d.ts +1 -0
  302. package/services/CliParamsService/index.js +3 -0
  303. package/services/CliParamsService/index.js.map +1 -0
  304. package/services/CommandsRegistryService/CommandsRegistryService.d.ts +7 -0
  305. package/services/CommandsRegistryService/CommandsRegistryService.js +19 -0
  306. package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -0
  307. package/services/CommandsRegistryService/index.d.ts +1 -0
  308. package/services/CommandsRegistryService/index.js +3 -0
  309. package/services/CommandsRegistryService/index.js.map +1 -0
  310. package/services/GetArgvService/GetArgvService.d.ts +7 -0
  311. package/services/GetArgvService/GetArgvService.js +17 -0
  312. package/services/GetArgvService/GetArgvService.js.map +1 -0
  313. package/services/GetArgvService/index.d.ts +1 -0
  314. package/services/GetArgvService/index.js +3 -0
  315. package/services/GetArgvService/index.js.map +1 -0
  316. package/services/GetCliRunnerService/GetCliRunnerService.d.ts +13 -0
  317. package/services/GetCliRunnerService/GetCliRunnerService.js +160 -0
  318. package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -0
  319. package/services/GetCliRunnerService/index.d.ts +1 -0
  320. package/services/GetCliRunnerService/index.js +3 -0
  321. package/services/GetCliRunnerService/index.js.map +1 -0
  322. package/services/GetIsCiService/GetIsCiService.d.ts +5 -0
  323. package/services/GetIsCiService/GetIsCiService.js +15 -0
  324. package/services/GetIsCiService/GetIsCiService.js.map +1 -0
  325. package/services/GetIsCiService/index.d.ts +1 -0
  326. package/services/GetIsCiService/index.js +3 -0
  327. package/services/GetIsCiService/index.js.map +1 -0
  328. package/services/GetProjectSdkService/GetProjectSdkService.d.ts +9 -0
  329. package/services/GetProjectSdkService/GetProjectSdkService.js +31 -0
  330. package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -0
  331. package/services/GetProjectSdkService/index.d.ts +1 -0
  332. package/services/GetProjectSdkService/index.js +3 -0
  333. package/services/GetProjectSdkService/index.js.map +1 -0
  334. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.d.ts +7 -0
  335. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -0
  336. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -0
  337. package/services/GlobalOptionsRegistryService/index.d.ts +1 -0
  338. package/services/GlobalOptionsRegistryService/index.js +3 -0
  339. package/services/GlobalOptionsRegistryService/index.js.map +1 -0
  340. package/services/LoggerService/LoggerService.d.ts +18 -0
  341. package/services/LoggerService/LoggerService.js +100 -0
  342. package/services/LoggerService/LoggerService.js.map +1 -0
  343. package/services/LoggerService/index.d.ts +1 -0
  344. package/services/LoggerService/index.js +3 -0
  345. package/services/LoggerService/index.js.map +1 -0
  346. package/services/RunCliRunnerService/RunCliRunnerService.d.ts +11 -0
  347. package/services/RunCliRunnerService/RunCliRunnerService.js +20 -0
  348. package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -0
  349. package/services/RunCliRunnerService/index.d.ts +1 -0
  350. package/services/RunCliRunnerService/index.js +3 -0
  351. package/services/RunCliRunnerService/index.js.map +1 -0
  352. package/services/StdioService/StdioService.d.ts +13 -0
  353. package/services/StdioService/StdioService.js +20 -0
  354. package/services/StdioService/StdioService.js.map +1 -0
  355. package/services/StdioService/index.d.ts +1 -0
  356. package/services/StdioService/index.js +3 -0
  357. package/services/StdioService/index.js.map +1 -0
  358. package/services/UiService/UiService.d.ts +17 -0
  359. package/services/UiService/UiService.js +70 -0
  360. package/services/UiService/UiService.js.map +1 -0
  361. package/services/UiService/index.d.ts +1 -0
  362. package/services/UiService/index.js +3 -0
  363. package/services/UiService/index.js.map +1 -0
  364. package/services/index.d.ts +12 -0
  365. package/services/index.js +14 -0
  366. package/services/index.js.map +1 -0
  367. package/utils/ManuallyReportedError.d.ts +3 -0
  368. package/utils/ManuallyReportedError.js +9 -0
  369. package/utils/ManuallyReportedError.js.map +1 -0
@@ -0,0 +1,41 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { ArgvParserService, GlobalOptionsRegistryService } from "../../abstractions/index.js";
3
+ import yargs from "yargs";
4
+ export class DefaultArgvParserService {
5
+ constructor(globalOptionsRegistryService) {
6
+ this.globalOptionsRegistryService = globalOptionsRegistryService;
7
+ }
8
+ parse(argv) {
9
+ const yargsInstance = yargs(argv).help(false).version(false);
10
+
11
+ // Register global options dynamically.
12
+ // Note: All global options are expected to be synchronous for argv parsing.
13
+ const globalOptions = this.globalOptionsRegistryService.execute();
14
+ for (const globalOption of globalOptions) {
15
+ const result = globalOption.execute();
16
+ // Global options should be synchronous for immediate argv parsing
17
+ const {
18
+ name,
19
+ config
20
+ } = result;
21
+ yargsInstance.option(name, {
22
+ type: config.type,
23
+ default: config.default,
24
+ desc: config.description,
25
+ alias: config.alias,
26
+ choices: config.choices
27
+ });
28
+ }
29
+ const parsed = yargsInstance.parseSync();
30
+
31
+ // Yargs automatically converts kebab-case to camelCase, so we can use the parsed result directly
32
+ return parsed;
33
+ }
34
+ }
35
+ export const argvParserService = createImplementation({
36
+ abstraction: ArgvParserService,
37
+ implementation: DefaultArgvParserService,
38
+ dependencies: [GlobalOptionsRegistryService]
39
+ });
40
+
41
+ //# sourceMappingURL=ArgvParserService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","ArgvParserService","GlobalOptionsRegistryService","yargs","DefaultArgvParserService","constructor","globalOptionsRegistryService","parse","argv","yargsInstance","help","version","globalOptions","execute","globalOption","result","name","config","option","type","default","desc","description","alias","choices","parsed","parseSync","argvParserService","abstraction","implementation","dependencies"],"sources":["ArgvParserService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { ArgvParserService, GlobalOptionsRegistryService } from \"~/abstractions/index.js\";\nimport yargs from \"yargs\";\n\nexport class DefaultArgvParserService implements ArgvParserService.Interface {\n constructor(\n private readonly globalOptionsRegistryService: GlobalOptionsRegistryService.Interface\n ) {}\n\n parse<T = Record<string, any>>(argv: string[]): T {\n const yargsInstance = yargs(argv).help(false).version(false);\n\n // Register global options dynamically.\n // Note: All global options are expected to be synchronous for argv parsing.\n const globalOptions = this.globalOptionsRegistryService.execute();\n for (const globalOption of globalOptions) {\n const result = globalOption.execute();\n // Global options should be synchronous for immediate argv parsing\n const { name, config } = result as Awaited<typeof result>;\n yargsInstance.option(name, {\n type: config.type,\n default: config.default,\n desc: config.description,\n alias: config.alias,\n choices: config.choices\n });\n }\n\n const parsed = yargsInstance.parseSync();\n\n // Yargs automatically converts kebab-case to camelCase, so we can use the parsed result directly\n return parsed as unknown as T;\n }\n}\n\nexport const argvParserService = createImplementation({\n abstraction: ArgvParserService,\n implementation: DefaultArgvParserService,\n dependencies: [GlobalOptionsRegistryService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAEC,4BAA4B;AACxD,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,MAAMC,wBAAwB,CAAwC;EACzEC,WAAWA,CACUC,4BAAoE,EACvF;IAAA,KADmBA,4BAAoE,GAApEA,4BAAoE;EACtF;EAEHC,KAAKA,CAA0BC,IAAc,EAAK;IAC9C,MAAMC,aAAa,GAAGN,KAAK,CAACK,IAAI,CAAC,CAACE,IAAI,CAAC,KAAK,CAAC,CAACC,OAAO,CAAC,KAAK,CAAC;;IAE5D;IACA;IACA,MAAMC,aAAa,GAAG,IAAI,CAACN,4BAA4B,CAACO,OAAO,CAAC,CAAC;IACjE,KAAK,MAAMC,YAAY,IAAIF,aAAa,EAAE;MACtC,MAAMG,MAAM,GAAGD,YAAY,CAACD,OAAO,CAAC,CAAC;MACrC;MACA,MAAM;QAAEG,IAAI;QAAEC;MAAO,CAAC,GAAGF,MAAgC;MACzDN,aAAa,CAACS,MAAM,CAACF,IAAI,EAAE;QACvBG,IAAI,EAAEF,MAAM,CAACE,IAAI;QACjBC,OAAO,EAAEH,MAAM,CAACG,OAAO;QACvBC,IAAI,EAAEJ,MAAM,CAACK,WAAW;QACxBC,KAAK,EAAEN,MAAM,CAACM,KAAK;QACnBC,OAAO,EAAEP,MAAM,CAACO;MACpB,CAAC,CAAC;IACN;IAEA,MAAMC,MAAM,GAAGhB,aAAa,CAACiB,SAAS,CAAC,CAAC;;IAExC;IACA,OAAOD,MAAM;EACjB;AACJ;AAEA,OAAO,MAAME,iBAAiB,GAAG3B,oBAAoB,CAAC;EAClD4B,WAAW,EAAE3B,iBAAiB;EAC9B4B,cAAc,EAAEzB,wBAAwB;EACxC0B,YAAY,EAAE,CAAC5B,4BAA4B;AAC/C,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./ArgvParserService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./ArgvParserService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ArgvParserService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { CliParamsService } from "../../abstractions/index.js";
2
+ export declare class DefaultCliParamsService implements CliParamsService.Interface {
3
+ params: CliParamsService.Params;
4
+ get(): import("~/abstractions/index.js").ICliParams;
5
+ set(params: CliParamsService.Params): void;
6
+ }
7
+ export declare const cliParamsService: import("@webiny/di").Implementation<typeof DefaultCliParamsService>;
@@ -0,0 +1,21 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { CliParamsService } from "../../abstractions/index.js";
3
+ export class DefaultCliParamsService {
4
+ params = {};
5
+ get() {
6
+ return this.params;
7
+ }
8
+ set(params) {
9
+ this.params = {
10
+ ...this.params,
11
+ ...params
12
+ };
13
+ }
14
+ }
15
+ export const cliParamsService = createImplementation({
16
+ abstraction: CliParamsService,
17
+ implementation: DefaultCliParamsService,
18
+ dependencies: []
19
+ });
20
+
21
+ //# sourceMappingURL=CliParamsService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","CliParamsService","DefaultCliParamsService","params","get","set","cliParamsService","abstraction","implementation","dependencies"],"sources":["CliParamsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliParamsService } from \"~/abstractions/index.js\";\n\nexport class DefaultCliParamsService implements CliParamsService.Interface {\n params: CliParamsService.Params = {};\n\n get() {\n return this.params;\n }\n\n set(params: CliParamsService.Params) {\n this.params = {\n ...this.params,\n ...params\n };\n }\n}\n\nexport const cliParamsService = createImplementation({\n abstraction: CliParamsService,\n implementation: DefaultCliParamsService,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,uBAAuB,CAAuC;EACvEC,MAAM,GAA4B,CAAC,CAAC;EAEpCC,GAAGA,CAAA,EAAG;IACF,OAAO,IAAI,CAACD,MAAM;EACtB;EAEAE,GAAGA,CAACF,MAA+B,EAAE;IACjC,IAAI,CAACA,MAAM,GAAG;MACV,GAAG,IAAI,CAACA,MAAM;MACd,GAAGA;IACP,CAAC;EACL;AACJ;AAEA,OAAO,MAAMG,gBAAgB,GAAGN,oBAAoB,CAAC;EACjDO,WAAW,EAAEN,gBAAgB;EAC7BO,cAAc,EAAEN,uBAAuB;EACvCO,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./CliParamsService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./CliParamsService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CliParamsService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { CliCommandFactory, CommandsRegistryService } from "../../abstractions/index.js";
2
+ export declare class DefaultCommandsRegistryService implements CommandsRegistryService.Interface {
3
+ private commands;
4
+ constructor(commands: CliCommandFactory.Interface<any>[]);
5
+ execute(): CliCommandFactory.Interface<any>[];
6
+ }
7
+ export declare const commandsRegistryService: import("@webiny/di").Implementation<typeof DefaultCommandsRegistryService>;
@@ -0,0 +1,19 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { CliCommandFactory, CommandsRegistryService } from "../../abstractions/index.js";
3
+ export class DefaultCommandsRegistryService {
4
+ constructor(commands) {
5
+ this.commands = commands;
6
+ }
7
+ execute() {
8
+ return this.commands;
9
+ }
10
+ }
11
+ export const commandsRegistryService = createImplementation({
12
+ abstraction: CommandsRegistryService,
13
+ implementation: DefaultCommandsRegistryService,
14
+ dependencies: [[CliCommandFactory, {
15
+ multiple: true
16
+ }]]
17
+ });
18
+
19
+ //# sourceMappingURL=CommandsRegistryService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","CliCommandFactory","CommandsRegistryService","DefaultCommandsRegistryService","constructor","commands","execute","commandsRegistryService","abstraction","implementation","dependencies","multiple"],"sources":["CommandsRegistryService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, CommandsRegistryService } from \"~/abstractions/index.js\";\n\nexport class DefaultCommandsRegistryService implements CommandsRegistryService.Interface {\n constructor(private commands: CliCommandFactory.Interface<any>[]) {}\n\n execute() {\n return this.commands;\n }\n}\n\nexport const commandsRegistryService = createImplementation({\n abstraction: CommandsRegistryService,\n implementation: DefaultCommandsRegistryService,\n dependencies: [[CliCommandFactory, { multiple: true }]]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAEC,uBAAuB;AAEnD,OAAO,MAAMC,8BAA8B,CAA8C;EACrFC,WAAWA,CAASC,QAA4C,EAAE;IAAA,KAA9CA,QAA4C,GAA5CA,QAA4C;EAAG;EAEnEC,OAAOA,CAAA,EAAG;IACN,OAAO,IAAI,CAACD,QAAQ;EACxB;AACJ;AAEA,OAAO,MAAME,uBAAuB,GAAGP,oBAAoB,CAAC;EACxDQ,WAAW,EAAEN,uBAAuB;EACpCO,cAAc,EAAEN,8BAA8B;EAC9CO,YAAY,EAAE,CAAC,CAACT,iBAAiB,EAAE;IAAEU,QAAQ,EAAE;EAAK,CAAC,CAAC;AAC1D,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./CommandsRegistryService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./CommandsRegistryService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CommandsRegistryService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { ArgvParserService, GetArgvService } from "../../abstractions/index.js";
2
+ export declare class DefaultGetArgvService implements GetArgvService.Interface {
3
+ private readonly argvParserService;
4
+ constructor(argvParserService: ArgvParserService.Interface);
5
+ execute<T = Record<string, any>>(): T;
6
+ }
7
+ export declare const getArgvService: import("@webiny/di").Implementation<typeof DefaultGetArgvService>;
@@ -0,0 +1,17 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { ArgvParserService, GetArgvService } from "../../abstractions/index.js";
3
+ export class DefaultGetArgvService {
4
+ constructor(argvParserService) {
5
+ this.argvParserService = argvParserService;
6
+ }
7
+ execute() {
8
+ return this.argvParserService.parse(process.argv.slice(2));
9
+ }
10
+ }
11
+ export const getArgvService = createImplementation({
12
+ abstraction: GetArgvService,
13
+ implementation: DefaultGetArgvService,
14
+ dependencies: [ArgvParserService]
15
+ });
16
+
17
+ //# sourceMappingURL=GetArgvService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","ArgvParserService","GetArgvService","DefaultGetArgvService","constructor","argvParserService","execute","parse","process","argv","slice","getArgvService","abstraction","implementation","dependencies"],"sources":["GetArgvService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { ArgvParserService, GetArgvService } from \"~/abstractions/index.js\";\n\nexport class DefaultGetArgvService implements GetArgvService.Interface {\n constructor(private readonly argvParserService: ArgvParserService.Interface) {}\n\n execute<T = Record<string, any>>(): T {\n return this.argvParserService.parse<T>(process.argv.slice(2));\n }\n}\n\nexport const getArgvService = createImplementation({\n abstraction: GetArgvService,\n implementation: DefaultGetArgvService,\n dependencies: [ArgvParserService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAEC,cAAc;AAE1C,OAAO,MAAMC,qBAAqB,CAAqC;EACnEC,WAAWA,CAAkBC,iBAA8C,EAAE;IAAA,KAAhDA,iBAA8C,GAA9CA,iBAA8C;EAAG;EAE9EC,OAAOA,CAAA,EAA+B;IAClC,OAAO,IAAI,CAACD,iBAAiB,CAACE,KAAK,CAAIC,OAAO,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACjE;AACJ;AAEA,OAAO,MAAMC,cAAc,GAAGX,oBAAoB,CAAC;EAC/CY,WAAW,EAAEV,cAAc;EAC3BW,cAAc,EAAEV,qBAAqB;EACrCW,YAAY,EAAE,CAACb,iBAAiB;AACpC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./GetArgvService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./GetArgvService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GetArgvService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import { CommandsRegistryService, GetArgvService, GetCliRunnerService, GlobalOptionsRegistryService, GetProjectSdkService, UiService } from "../../abstractions/index.js";
2
+ import { Argv } from "yargs";
3
+ export declare class DefaultGetCliRunnerService implements GetCliRunnerService.Interface {
4
+ private readonly commandsRegistryService;
5
+ private readonly globalOptionsRegistryService;
6
+ private readonly uiService;
7
+ private readonly getProjectSdkService;
8
+ private readonly getArgvService;
9
+ constructor(commandsRegistryService: CommandsRegistryService.Interface, globalOptionsRegistryService: GlobalOptionsRegistryService.Interface, uiService: UiService.Interface, getProjectSdkService: GetProjectSdkService.Interface, getArgvService: GetArgvService.Interface);
10
+ private yargsRunner;
11
+ execute(): Promise<Argv<{}>>;
12
+ }
13
+ export declare const getCliRunnerService: import("@webiny/di").Implementation<typeof DefaultGetCliRunnerService>;
@@ -0,0 +1,160 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { CommandsRegistryService, GetArgvService, GetCliRunnerService, GlobalOptionsRegistryService, GetProjectSdkService, UiService } from "../../abstractions/index.js";
3
+ import yargs from "yargs/yargs";
4
+ import chalk from "chalk";
5
+ import { GracefulError } from "@webiny/project";
6
+ import { ManuallyReportedError } from "../../utils/ManuallyReportedError.js";
7
+ const {
8
+ blue,
9
+ bgYellow,
10
+ bold
11
+ } = chalk;
12
+ export class DefaultGetCliRunnerService {
13
+ constructor(commandsRegistryService, globalOptionsRegistryService, uiService, getProjectSdkService, getArgvService) {
14
+ this.commandsRegistryService = commandsRegistryService;
15
+ this.globalOptionsRegistryService = globalOptionsRegistryService;
16
+ this.uiService = uiService;
17
+ this.getProjectSdkService = getProjectSdkService;
18
+ this.getArgvService = getArgvService;
19
+ }
20
+ yargsRunner = null;
21
+ async execute() {
22
+ if (this.yargsRunner) {
23
+ return this.yargsRunner;
24
+ }
25
+ const ui = this.uiService;
26
+ const projectSdk = await this.getProjectSdkService.execute();
27
+ const yargsRunner = yargs().usage("Usage: $0 <command> [options]").help(false).demandCommand(1).recommendCommands().scriptName("webiny").epilogue(`To find more information, docs and tutorials, see ${blue("https://www.webiny.com/docs")}.`).epilogue(`Want to contribute? ${blue("https://github.com/webiny/webiny-js")}.`);
28
+
29
+ // Register global options.
30
+ const globalOptions = this.globalOptionsRegistryService.execute();
31
+ for (const globalOption of globalOptions) {
32
+ const {
33
+ name,
34
+ config
35
+ } = await globalOption.execute();
36
+ yargsRunner.option(name, {
37
+ type: config.type,
38
+ default: config.default,
39
+ desc: config.description,
40
+ alias: config.alias,
41
+ choices: config.choices,
42
+ global: true
43
+ });
44
+ }
45
+ yargsRunner.fail((invalidParamsMessage, error) => {
46
+ if (invalidParamsMessage) {
47
+ if (invalidParamsMessage.includes("Not enough non-option arguments")) {
48
+ ui.emptyLine();
49
+ ui.error("Command was not invoked as expected.");
50
+ ui.info(`Some non-optional arguments are missing. See the usage examples printed below.`);
51
+ ui.emptyLine();
52
+ yargsRunner.showHelp();
53
+ process.exit(1);
54
+ }
55
+ if (invalidParamsMessage.includes("Missing required argument")) {
56
+ const args = invalidParamsMessage.split(":")[1].split(",").map(v => v.trim());
57
+ ui.emptyLine();
58
+ ui.error("Command was not invoked as expected.");
59
+ ui.info(`Missing required argument(s): ${args.join(", ")}. See the usage examples printed below.`);
60
+ ui.emptyLine();
61
+ yargsRunner.showHelp();
62
+ process.exit(1);
63
+ }
64
+ ui.emptyLine();
65
+ ui.error(invalidParamsMessage);
66
+ process.exit(1);
67
+ }
68
+ const logger = projectSdk.getLogger();
69
+ logger.error({
70
+ err: error
71
+ }, "CLI command execution failed.");
72
+ const realError = error.cause || error;
73
+ if (realError instanceof ManuallyReportedError) {
74
+ // Do nothing as the error reporting has already been
75
+ // handled within the invoked CLI command.
76
+ } else {
77
+ ui.error(realError.message);
78
+ }
79
+ const argv = this.getArgvService.execute();
80
+ if (argv.showStackTrace && realError.stack) {
81
+ ui.emptyLine();
82
+ ui.debug("Stack trace:");
83
+ ui.text(realError.stack);
84
+ }
85
+ if (error instanceof GracefulError) {
86
+ ui.emptyLine();
87
+ ui.text(bgYellow(bold("💡 How can I resolve this?")));
88
+ ui.text(error.message);
89
+ }
90
+ process.exit(1);
91
+ });
92
+ const commands = this.commandsRegistryService.execute();
93
+ for (const command of commands) {
94
+ const {
95
+ name,
96
+ description,
97
+ params = [],
98
+ options = [],
99
+ handler
100
+ } = await command.execute();
101
+ let yargsCommand = name;
102
+ if (params.length > 0) {
103
+ yargsCommand += " " + params.map(param => {
104
+ const paramName = param.array ? `${param.name}..` : param.name;
105
+ return param.required ? `<${paramName}>` : `[${paramName}]`;
106
+ }).join(" ");
107
+ }
108
+ yargsRunner.command(yargsCommand, description, yargs => {
109
+ params.forEach(param => {
110
+ const {
111
+ name,
112
+ required,
113
+ validation,
114
+ array,
115
+ ...rest
116
+ } = param;
117
+ const yargsParam = yargs.positional(name, {
118
+ ...rest,
119
+ ...(array && {
120
+ array: true
121
+ }),
122
+ demandOption: required
123
+ });
124
+ if (validation) {
125
+ yargsParam.check(validation);
126
+ }
127
+ });
128
+ options.forEach(option => {
129
+ const {
130
+ name,
131
+ required,
132
+ validation,
133
+ ...rest
134
+ } = option;
135
+ const yargsOption = yargs.option(name, {
136
+ ...rest,
137
+ demandOption: required
138
+ });
139
+ if (option.group) {
140
+ yargsOption.group(option.name, option.group);
141
+ }
142
+ if (validation) {
143
+ yargsOption.check(validation);
144
+ }
145
+ });
146
+ }, handler);
147
+ }
148
+ yargsRunner.help(true);
149
+ yargsRunner.version(projectSdk.getProjectVersion());
150
+ this.yargsRunner = yargsRunner;
151
+ return this.yargsRunner;
152
+ }
153
+ }
154
+ export const getCliRunnerService = createImplementation({
155
+ abstraction: GetCliRunnerService,
156
+ implementation: DefaultGetCliRunnerService,
157
+ dependencies: [CommandsRegistryService, GlobalOptionsRegistryService, UiService, GetProjectSdkService, GetArgvService]
158
+ });
159
+
160
+ //# sourceMappingURL=GetCliRunnerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","CommandsRegistryService","GetArgvService","GetCliRunnerService","GlobalOptionsRegistryService","GetProjectSdkService","UiService","yargs","chalk","GracefulError","ManuallyReportedError","blue","bgYellow","bold","DefaultGetCliRunnerService","constructor","commandsRegistryService","globalOptionsRegistryService","uiService","getProjectSdkService","getArgvService","yargsRunner","execute","ui","projectSdk","usage","help","demandCommand","recommendCommands","scriptName","epilogue","globalOptions","globalOption","name","config","option","type","default","desc","description","alias","choices","global","fail","invalidParamsMessage","error","includes","emptyLine","info","showHelp","process","exit","args","split","map","v","trim","join","logger","getLogger","err","realError","cause","message","argv","showStackTrace","stack","debug","text","commands","command","params","options","handler","yargsCommand","length","param","paramName","array","required","forEach","validation","rest","yargsParam","positional","demandOption","check","yargsOption","group","version","getProjectVersion","getCliRunnerService","abstraction","implementation","dependencies"],"sources":["GetCliRunnerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n CliCommandFactory,\n CommandsRegistryService,\n GetArgvService,\n GetCliRunnerService,\n GlobalOptionsRegistryService,\n GetProjectSdkService,\n UiService\n} from \"~/abstractions/index.js\";\nimport yargs from \"yargs/yargs\";\nimport chalk from \"chalk\";\nimport { Argv } from \"yargs\";\nimport { GracefulError } from \"@webiny/project\";\nimport { ManuallyReportedError } from \"~/utils/ManuallyReportedError.js\";\n\nconst { blue, bgYellow, bold } = chalk;\n\nexport class DefaultGetCliRunnerService implements GetCliRunnerService.Interface {\n constructor(\n private readonly commandsRegistryService: CommandsRegistryService.Interface,\n private readonly globalOptionsRegistryService: GlobalOptionsRegistryService.Interface,\n private readonly uiService: UiService.Interface,\n private readonly getProjectSdkService: GetProjectSdkService.Interface,\n private readonly getArgvService: GetArgvService.Interface\n ) {}\n\n private yargsRunner: Argv | null = null;\n\n async execute() {\n if (this.yargsRunner) {\n return this.yargsRunner;\n }\n\n const ui = this.uiService;\n const projectSdk = await this.getProjectSdkService.execute();\n\n const yargsRunner = yargs()\n .usage(\"Usage: $0 <command> [options]\")\n .help(false)\n .demandCommand(1)\n .recommendCommands()\n .scriptName(\"webiny\")\n .epilogue(\n `To find more information, docs and tutorials, see ${blue(\n \"https://www.webiny.com/docs\"\n )}.`\n )\n .epilogue(`Want to contribute? ${blue(\"https://github.com/webiny/webiny-js\")}.`);\n\n // Register global options.\n const globalOptions = this.globalOptionsRegistryService.execute();\n for (const globalOption of globalOptions) {\n const { name, config } = await globalOption.execute();\n yargsRunner.option(name, {\n type: config.type,\n default: config.default,\n desc: config.description,\n alias: config.alias,\n choices: config.choices,\n global: true\n });\n }\n\n yargsRunner.fail((invalidParamsMessage, error) => {\n if (invalidParamsMessage) {\n if (invalidParamsMessage.includes(\"Not enough non-option arguments\")) {\n ui.emptyLine();\n ui.error(\"Command was not invoked as expected.\");\n ui.info(\n `Some non-optional arguments are missing. See the usage examples printed below.`\n );\n ui.emptyLine();\n yargsRunner.showHelp();\n process.exit(1);\n }\n\n if (invalidParamsMessage.includes(\"Missing required argument\")) {\n const args = invalidParamsMessage\n .split(\":\")[1]\n .split(\",\")\n .map(v => v.trim());\n\n ui.emptyLine();\n ui.error(\"Command was not invoked as expected.\");\n ui.info(\n `Missing required argument(s): ${args.join(\n \", \"\n )}. See the usage examples printed below.`\n );\n ui.emptyLine();\n yargsRunner.showHelp();\n process.exit(1);\n }\n\n ui.emptyLine();\n ui.error(invalidParamsMessage);\n\n process.exit(1);\n }\n\n const logger = projectSdk.getLogger();\n logger.error({ err: error }, \"CLI command execution failed.\");\n\n const realError = (error.cause as Error) || error;\n\n if (realError instanceof ManuallyReportedError) {\n // Do nothing as the error reporting has already been\n // handled within the invoked CLI command.\n } else {\n ui.error(realError.message);\n }\n\n const argv = this.getArgvService.execute();\n if (argv.showStackTrace && realError.stack) {\n ui.emptyLine();\n ui.debug(\"Stack trace:\");\n ui.text(realError.stack);\n }\n\n if (error instanceof GracefulError) {\n ui.emptyLine();\n ui.text(bgYellow(bold(\"💡 How can I resolve this?\")));\n ui.text(error.message);\n }\n\n process.exit(1);\n });\n\n const commands = this.commandsRegistryService.execute();\n\n for (const command of commands) {\n const {\n name,\n description,\n params = [],\n options = [],\n handler\n } = await command.execute();\n\n let yargsCommand = name;\n if (params.length > 0) {\n yargsCommand +=\n \" \" +\n params\n .map(param => {\n const paramName = param.array ? `${param.name}..` : param.name;\n return param.required ? `<${paramName}>` : `[${paramName}]`;\n })\n .join(\" \");\n }\n\n yargsRunner.command(\n yargsCommand,\n description,\n yargs => {\n params.forEach((param: CliCommandFactory.ParamDefinition<unknown>) => {\n const { name, required, validation, array, ...rest } = param;\n\n const yargsParam = yargs.positional(name, {\n ...rest,\n ...(array && { array: true }),\n demandOption: required\n });\n\n if (validation) {\n yargsParam.check(validation);\n }\n });\n\n options.forEach((option: CliCommandFactory.OptionDefinition<unknown>) => {\n const { name, required, validation, ...rest } = option;\n\n const yargsOption = yargs.option(name, {\n ...rest,\n demandOption: required\n });\n\n if (option.group) {\n yargsOption.group(option.name, option.group);\n }\n\n if (validation) {\n yargsOption.check(validation);\n }\n });\n },\n handler\n );\n }\n\n yargsRunner.help(true);\n yargsRunner.version(projectSdk.getProjectVersion());\n this.yargsRunner = yargsRunner;\n return this.yargsRunner;\n }\n}\n\nexport const getCliRunnerService = createImplementation({\n abstraction: GetCliRunnerService,\n implementation: DefaultGetCliRunnerService,\n dependencies: [\n CommandsRegistryService,\n GlobalOptionsRegistryService,\n UiService,\n GetProjectSdkService,\n GetArgvService\n ]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAEIC,uBAAuB,EACvBC,cAAc,EACdC,mBAAmB,EACnBC,4BAA4B,EAC5BC,oBAAoB,EAC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E,UAAU;YAAE,GAAGC;UAAK,CAAC,GAAG/C,MAAM;UAEtD,MAAMoD,WAAW,GAAGhF,KAAK,CAAC4B,MAAM,CAACF,IAAI,EAAE;YACnC,GAAGiD,IAAI;YACPG,YAAY,EAAEN;UAClB,CAAC,CAAC;UAEF,IAAI5C,MAAM,CAACqD,KAAK,EAAE;YACdD,WAAW,CAACC,KAAK,CAACrD,MAAM,CAACF,IAAI,EAAEE,MAAM,CAACqD,KAAK,CAAC;UAChD;UAEA,IAAIP,UAAU,EAAE;YACZM,WAAW,CAACD,KAAK,CAACL,UAAU,CAAC;UACjC;QACJ,CAAC,CAAC;MACN,CAAC,EACDR,OACJ,CAAC;IACL;IAEApD,WAAW,CAACK,IAAI,CAAC,IAAI,CAAC;IACtBL,WAAW,CAACoE,OAAO,CAACjE,UAAU,CAACkE,iBAAiB,CAAC,CAAC,CAAC;IACnD,IAAI,CAACrE,WAAW,GAAGA,WAAW;IAC9B,OAAO,IAAI,CAACA,WAAW;EAC3B;AACJ;AAEA,OAAO,MAAMsE,mBAAmB,GAAG3F,oBAAoB,CAAC;EACpD4F,WAAW,EAAEzF,mBAAmB;EAChC0F,cAAc,EAAE/E,0BAA0B;EAC1CgF,YAAY,EAAE,CACV7F,uBAAuB,EACvBG,4BAA4B,EAC5BE,SAAS,EACTD,oBAAoB,EACpBH,cAAc;AAEtB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./GetCliRunnerService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./GetCliRunnerService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GetCliRunnerService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { GetIsCiService } from "../../abstractions/index.js";
2
+ export declare class DefaultGetIsCiService implements GetIsCiService.Interface {
3
+ execute(): boolean;
4
+ }
5
+ export declare const getIsCiService: import("@webiny/di").Implementation<typeof DefaultGetIsCiService>;
@@ -0,0 +1,15 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GetIsCiService } from "../../abstractions/index.js";
3
+ import { isCI } from "ci-info";
4
+ export class DefaultGetIsCiService {
5
+ execute() {
6
+ return isCI;
7
+ }
8
+ }
9
+ export const getIsCiService = createImplementation({
10
+ abstraction: GetIsCiService,
11
+ implementation: DefaultGetIsCiService,
12
+ dependencies: []
13
+ });
14
+
15
+ //# sourceMappingURL=GetIsCiService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","GetIsCiService","isCI","DefaultGetIsCiService","execute","getIsCiService","abstraction","implementation","dependencies"],"sources":["GetIsCiService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetIsCiService } from \"~/abstractions/index.js\";\nimport { isCI } from \"ci-info\";\n\nexport class DefaultGetIsCiService implements GetIsCiService.Interface {\n execute() {\n return isCI;\n }\n}\n\nexport const getIsCiService = createImplementation({\n abstraction: GetIsCiService,\n implementation: DefaultGetIsCiService,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,cAAc;AACvB,SAASC,IAAI,QAAQ,SAAS;AAE9B,OAAO,MAAMC,qBAAqB,CAAqC;EACnEC,OAAOA,CAAA,EAAG;IACN,OAAOF,IAAI;EACf;AACJ;AAEA,OAAO,MAAMG,cAAc,GAAGL,oBAAoB,CAAC;EAC/CM,WAAW,EAAEL,cAAc;EAC3BM,cAAc,EAAEJ,qBAAqB;EACrCK,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { getIsCiService, DefaultGetIsCiService } from "./GetIsCiService.js";
@@ -0,0 +1,3 @@
1
+ export { getIsCiService, DefaultGetIsCiService } from "./GetIsCiService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getIsCiService","DefaultGetIsCiService"],"sources":["index.ts"],"sourcesContent":["export { getIsCiService, DefaultGetIsCiService } from \"./GetIsCiService.js\";\n"],"mappings":"AAAA,SAASA,cAAc,EAAEC,qBAAqB","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { ProjectSdk } from "@webiny/project";
2
+ import { CliParamsService, GetArgvService, GetProjectSdkService } from "../../abstractions/index.js";
3
+ export declare class DefaultGetProjectSdkService implements GetProjectSdkService.Interface {
4
+ private readonly cliParamsService;
5
+ private readonly getArgvService;
6
+ constructor(cliParamsService: CliParamsService.Interface, getArgvService: GetArgvService.Interface);
7
+ execute(): Promise<ProjectSdk>;
8
+ }
9
+ export declare const getProjectSdkService: import("@webiny/di").Implementation<typeof DefaultGetProjectSdkService>;
@@ -0,0 +1,31 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { ProjectSdk } from "@webiny/project";
3
+ import { CliParamsService, GetArgvService, GetProjectSdkService } from "../../abstractions/index.js";
4
+ export class DefaultGetProjectSdkService {
5
+ constructor(cliParamsService, getArgvService) {
6
+ this.cliParamsService = cliParamsService;
7
+ this.getArgvService = getArgvService;
8
+ }
9
+ async execute() {
10
+ const cliParams = this.cliParamsService.get();
11
+ const argv = this.getArgvService.execute();
12
+
13
+ // Extract env/variant/region from argv and pass to ProjectSdk.init()
14
+ // ProjectSdk.init() handles caching internally based on these parameters
15
+ return ProjectSdk.init({
16
+ ...argv,
17
+ cwd: cliParams.cwd,
18
+ logging: {
19
+ streamToStdout: argv.showLogs,
20
+ level: argv.logLevel
21
+ }
22
+ });
23
+ }
24
+ }
25
+ export const getProjectSdkService = createImplementation({
26
+ abstraction: GetProjectSdkService,
27
+ implementation: DefaultGetProjectSdkService,
28
+ dependencies: [CliParamsService, GetArgvService]
29
+ });
30
+
31
+ //# sourceMappingURL=GetProjectSdkService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","ProjectSdk","CliParamsService","GetArgvService","GetProjectSdkService","DefaultGetProjectSdkService","constructor","cliParamsService","getArgvService","execute","cliParams","get","argv","init","cwd","logging","streamToStdout","showLogs","level","logLevel","getProjectSdkService","abstraction","implementation","dependencies"],"sources":["GetProjectSdkService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { ProjectSdk } from \"@webiny/project\";\nimport { CliParamsService, GetArgvService, GetProjectSdkService } from \"~/abstractions/index.js\";\n\nexport class DefaultGetProjectSdkService implements GetProjectSdkService.Interface {\n constructor(\n private readonly cliParamsService: CliParamsService.Interface,\n private readonly getArgvService: GetArgvService.Interface\n ) {}\n\n async execute() {\n const cliParams = this.cliParamsService.get();\n const argv = this.getArgvService.execute();\n\n // Extract env/variant/region from argv and pass to ProjectSdk.init()\n // ProjectSdk.init() handles caching internally based on these parameters\n return ProjectSdk.init({\n ...argv,\n cwd: cliParams.cwd,\n logging: {\n streamToStdout: argv.showLogs,\n level: argv.logLevel\n }\n });\n }\n}\n\nexport const getProjectSdkService = createImplementation({\n abstraction: GetProjectSdkService,\n implementation: DefaultGetProjectSdkService,\n dependencies: [CliParamsService, GetArgvService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,oBAAoB;AAE/D,OAAO,MAAMC,2BAA2B,CAA2C;EAC/EC,WAAWA,CACUC,gBAA4C,EAC5CC,cAAwC,EAC3D;IAAA,KAFmBD,gBAA4C,GAA5CA,gBAA4C;IAAA,KAC5CC,cAAwC,GAAxCA,cAAwC;EAC1D;EAEH,MAAMC,OAAOA,CAAA,EAAG;IACZ,MAAMC,SAAS,GAAG,IAAI,CAACH,gBAAgB,CAACI,GAAG,CAAC,CAAC;IAC7C,MAAMC,IAAI,GAAG,IAAI,CAACJ,cAAc,CAACC,OAAO,CAAC,CAAC;;IAE1C;IACA;IACA,OAAOR,UAAU,CAACY,IAAI,CAAC;MACnB,GAAGD,IAAI;MACPE,GAAG,EAAEJ,SAAS,CAACI,GAAG;MAClBC,OAAO,EAAE;QACLC,cAAc,EAAEJ,IAAI,CAACK,QAAQ;QAC7BC,KAAK,EAAEN,IAAI,CAACO;MAChB;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMC,oBAAoB,GAAGpB,oBAAoB,CAAC;EACrDqB,WAAW,EAAEjB,oBAAoB;EACjCkB,cAAc,EAAEjB,2BAA2B;EAC3CkB,YAAY,EAAE,CAACrB,gBAAgB,EAAEC,cAAc;AACnD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./GetProjectSdkService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./GetProjectSdkService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GetProjectSdkService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { GlobalCliOption, GlobalOptionsRegistryService } from "../../abstractions/index.js";
2
+ export declare class DefaultGlobalOptionsRegistryService implements GlobalOptionsRegistryService.Interface {
3
+ private globalOptions;
4
+ constructor(globalOptions: GlobalCliOption.Interface[]);
5
+ execute(): import("../../abstractions/features/GlobalCliOption").IGlobalCliOption[];
6
+ }
7
+ export declare const globalOptionsRegistryService: import("@webiny/di").Implementation<typeof DefaultGlobalOptionsRegistryService>;
@@ -0,0 +1,19 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GlobalCliOption, GlobalOptionsRegistryService } from "../../abstractions/index.js";
3
+ export class DefaultGlobalOptionsRegistryService {
4
+ constructor(globalOptions) {
5
+ this.globalOptions = globalOptions;
6
+ }
7
+ execute() {
8
+ return this.globalOptions;
9
+ }
10
+ }
11
+ export const globalOptionsRegistryService = createImplementation({
12
+ abstraction: GlobalOptionsRegistryService,
13
+ implementation: DefaultGlobalOptionsRegistryService,
14
+ dependencies: [[GlobalCliOption, {
15
+ multiple: true
16
+ }]]
17
+ });
18
+
19
+ //# sourceMappingURL=GlobalOptionsRegistryService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","GlobalCliOption","GlobalOptionsRegistryService","DefaultGlobalOptionsRegistryService","constructor","globalOptions","execute","globalOptionsRegistryService","abstraction","implementation","dependencies","multiple"],"sources":["GlobalOptionsRegistryService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GlobalCliOption, GlobalOptionsRegistryService } from \"~/abstractions/index.js\";\n\nexport class DefaultGlobalOptionsRegistryService implements GlobalOptionsRegistryService.Interface {\n constructor(private globalOptions: GlobalCliOption.Interface[]) {}\n\n execute() {\n return this.globalOptions;\n }\n}\n\nexport const globalOptionsRegistryService = createImplementation({\n abstraction: GlobalOptionsRegistryService,\n implementation: DefaultGlobalOptionsRegistryService,\n dependencies: [[GlobalCliOption, { multiple: true }]]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,eAAe,EAAEC,4BAA4B;AAEtD,OAAO,MAAMC,mCAAmC,CAAmD;EAC/FC,WAAWA,CAASC,aAA0C,EAAE;IAAA,KAA5CA,aAA0C,GAA1CA,aAA0C;EAAG;EAEjEC,OAAOA,CAAA,EAAG;IACN,OAAO,IAAI,CAACD,aAAa;EAC7B;AACJ;AAEA,OAAO,MAAME,4BAA4B,GAAGP,oBAAoB,CAAC;EAC7DQ,WAAW,EAAEN,4BAA4B;EACzCO,cAAc,EAAEN,mCAAmC;EACnDO,YAAY,EAAE,CAAC,CAACT,eAAe,EAAE;IAAEU,QAAQ,EAAE;EAAK,CAAC,CAAC;AACxD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./GlobalOptionsRegistryService.js";
@@ -0,0 +1,3 @@
1
+ export * from "./GlobalOptionsRegistryService.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GlobalOptionsRegistryService.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import { GetArgvService, LoggerService } from "../../abstractions/index.js";
2
+ export declare class DefaultLoggerService implements LoggerService.Interface {
3
+ private readonly getArgvService;
4
+ private pinoLogger;
5
+ constructor(getArgvService: GetArgvService.Interface);
6
+ trace(message?: any, ...optionalParams: any[]): void;
7
+ fatal(message?: any, ...optionalParams: any[]): void;
8
+ debug(message?: any, ...optionalParams: any[]): void;
9
+ info(message?: any, ...optionalParams: any[]): void;
10
+ warn(message?: any, ...optionalParams: any[]): void;
11
+ error(message?: any, ...optionalParams: any[]): void;
12
+ log(message?: any, ...optionalParams: any[]): void;
13
+ private getLogger;
14
+ private getLogStream;
15
+ private getLogFileName;
16
+ private getLogLevel;
17
+ }
18
+ export declare const loggerService: import("@webiny/di").Implementation<typeof DefaultLoggerService>;