@webiny/cli-core 6.3.0-beta.4 → 6.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/Cli.js +12 -11
  2. package/Cli.js.map +1 -1
  3. package/abstractions/createAbstraction.js +3 -2
  4. package/abstractions/createAbstraction.js.map +1 -1
  5. package/abstractions/features/CliCommand.js +2 -4
  6. package/abstractions/features/CliCommand.js.map +1 -1
  7. package/abstractions/features/ErrorHandler.js +2 -1
  8. package/abstractions/features/ErrorHandler.js.map +1 -1
  9. package/abstractions/features/GlobalCliOption.js +2 -1
  10. package/abstractions/features/GlobalCliOption.js.map +1 -1
  11. package/abstractions/features/IsCi.js +2 -1
  12. package/abstractions/features/IsCi.js.map +1 -1
  13. package/abstractions/features/index.js +0 -2
  14. package/abstractions/features/types.js +0 -3
  15. package/abstractions/index.js +0 -2
  16. package/abstractions/services/ArgvParserService.js +2 -1
  17. package/abstractions/services/ArgvParserService.js.map +1 -1
  18. package/abstractions/services/CliParamsService.js +2 -1
  19. package/abstractions/services/CliParamsService.js.map +1 -1
  20. package/abstractions/services/CommandsRegistryService.js +2 -1
  21. package/abstractions/services/CommandsRegistryService.js.map +1 -1
  22. package/abstractions/services/GetArgvService.js +2 -1
  23. package/abstractions/services/GetArgvService.js.map +1 -1
  24. package/abstractions/services/GetCliRunnerService.js +2 -1
  25. package/abstractions/services/GetCliRunnerService.js.map +1 -1
  26. package/abstractions/services/GetIsCiService.js +2 -1
  27. package/abstractions/services/GetIsCiService.js.map +1 -1
  28. package/abstractions/services/GetProjectSdkService.js +2 -1
  29. package/abstractions/services/GetProjectSdkService.js.map +1 -1
  30. package/abstractions/services/GlobalOptionsRegistryService.js +2 -1
  31. package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -1
  32. package/abstractions/services/LoggerService.js +2 -1
  33. package/abstractions/services/LoggerService.js.map +1 -1
  34. package/abstractions/services/RunCliRunnerService.js +2 -1
  35. package/abstractions/services/RunCliRunnerService.js.map +1 -1
  36. package/abstractions/services/StdioService.js +2 -1
  37. package/abstractions/services/StdioService.js.map +1 -1
  38. package/abstractions/services/UiService.js +2 -1
  39. package/abstractions/services/UiService.js.map +1 -1
  40. package/abstractions/services/index.js +0 -2
  41. package/createCliContainer.js +87 -113
  42. package/createCliContainer.js.map +1 -1
  43. package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
  44. package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
  45. package/decorators/DeployCommandWithTelemetry.js +72 -82
  46. package/decorators/DeployCommandWithTelemetry.js.map +1 -1
  47. package/decorators/index.js +0 -2
  48. package/exports/cli/command.js +0 -2
  49. package/exports/cli.js +0 -2
  50. package/extensions/CliCommand.js +15 -18
  51. package/extensions/CliCommand.js.map +1 -1
  52. package/extensions/CliCommandDecorator.js +15 -18
  53. package/extensions/CliCommandDecorator.js.map +1 -1
  54. package/extensions/index.js +5 -2
  55. package/extensions/index.js.map +1 -1
  56. package/features/AboutCommand.js +80 -86
  57. package/features/AboutCommand.js.map +1 -1
  58. package/features/BuildCommand/BuildCommand.js +46 -36
  59. package/features/BuildCommand/BuildCommand.js.map +1 -1
  60. package/features/BuildCommand/buildRunners/BaseBuildRunner.js +10 -13
  61. package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -1
  62. package/features/BuildCommand/buildRunners/BuildRunner.js +18 -21
  63. package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -1
  64. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +20 -19
  65. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -1
  66. package/features/BuildCommand/buildRunners/SingleBuildRunner.js +15 -14
  67. package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -1
  68. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +3 -4
  69. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -1
  70. package/features/BuildCommand/index.js +0 -2
  71. package/features/ConfigCommand.js +55 -56
  72. package/features/ConfigCommand.js.map +1 -1
  73. package/features/DeployCommand/DeployCommand.js +162 -156
  74. package/features/DeployCommand/DeployCommand.js.map +1 -1
  75. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +12 -17
  76. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -1
  77. package/features/DeployCommand/deployOutputs/DeployOutput.js +16 -17
  78. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -1
  79. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +89 -54
  80. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -1
  81. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +24 -37
  82. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -1
  83. package/features/DeployCommand/index.js +0 -2
  84. package/features/DepsSync/BuildDependencyTree.js +16 -21
  85. package/features/DepsSync/BuildDependencyTree.js.map +1 -1
  86. package/features/DepsSync/DependencyTree.js +108 -126
  87. package/features/DepsSync/DependencyTree.js.map +1 -1
  88. package/features/DepsSync/ListAllPackageJsonFiles.js +19 -14
  89. package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -1
  90. package/features/DepsSync/ListAllPackages.js +7 -9
  91. package/features/DepsSync/ListAllPackages.js.map +1 -1
  92. package/features/DepsSync/commands/SyncDepsCommand.js +30 -24
  93. package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -1
  94. package/features/DepsSync/commands/VerifyDepsCommand.js +69 -70
  95. package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
  96. package/features/DepsSync/createDependencyTree.js +25 -18
  97. package/features/DepsSync/createDependencyTree.js.map +1 -1
  98. package/features/DepsSync/createReferenceFile.js +21 -25
  99. package/features/DepsSync/createReferenceFile.js.map +1 -1
  100. package/features/DepsSync/index.js +0 -2
  101. package/features/DepsSync/paths.js +3 -6
  102. package/features/DepsSync/paths.js.map +1 -1
  103. package/features/DepsSync/types.js +7 -6
  104. package/features/DepsSync/types.js.map +1 -1
  105. package/features/DestroyCommand/DestroyCommand.js +71 -67
  106. package/features/DestroyCommand/DestroyCommand.js.map +1 -1
  107. package/features/DestroyCommand/index.js +0 -2
  108. package/features/DisableTelemetryCommand.js +28 -25
  109. package/features/DisableTelemetryCommand.js.map +1 -1
  110. package/features/EnableTelemetryCommand.js +28 -25
  111. package/features/EnableTelemetryCommand.js.map +1 -1
  112. package/features/ExtensionCommand/ExtensionCommand.js +60 -63
  113. package/features/ExtensionCommand/ExtensionCommand.js.map +1 -1
  114. package/features/ExtensionCommand/index.js +0 -2
  115. package/features/InfoCommand/InfoCommand.js +54 -56
  116. package/features/InfoCommand/InfoCommand.js.map +1 -1
  117. package/features/InfoCommand/PrintInfoForEnv.js +31 -47
  118. package/features/InfoCommand/PrintInfoForEnv.js.map +1 -1
  119. package/features/InfoCommand/index.js +0 -2
  120. package/features/IsCi/IsCi.js +14 -11
  121. package/features/IsCi/IsCi.js.map +1 -1
  122. package/features/IsCi/index.js +1 -3
  123. package/features/OpenCommand.js +48 -47
  124. package/features/OpenCommand.js.map +1 -1
  125. package/features/OutputCommand.js +56 -69
  126. package/features/OutputCommand.js.map +1 -1
  127. package/features/PulumiCommand/PulumiCommand.js +48 -41
  128. package/features/PulumiCommand/PulumiCommand.js.map +1 -1
  129. package/features/PulumiCommand/index.js +0 -2
  130. package/features/RefreshCommand/RefreshCommand.js +42 -36
  131. package/features/RefreshCommand/RefreshCommand.js.map +1 -1
  132. package/features/RefreshCommand/index.js +0 -2
  133. package/features/UpgradeCommand/UpgradeCommand.js +112 -101
  134. package/features/UpgradeCommand/UpgradeCommand.js.map +1 -1
  135. package/features/UpgradeCommand/UpgradeCommandHandler.js +90 -101
  136. package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -1
  137. package/features/UpgradeCommand/abstraction.js +2 -1
  138. package/features/UpgradeCommand/abstraction.js.map +1 -1
  139. package/features/UpgradeCommand/feature.js +7 -6
  140. package/features/UpgradeCommand/feature.js.map +1 -1
  141. package/features/UpgradeCommand/index.js +0 -2
  142. package/features/WatchCommand/WatchCommand.js +131 -131
  143. package/features/WatchCommand/WatchCommand.js.map +1 -1
  144. package/features/WatchCommand/createPrefixer.js +11 -15
  145. package/features/WatchCommand/createPrefixer.js.map +1 -1
  146. package/features/WatchCommand/getRandomColorForString.js +86 -8
  147. package/features/WatchCommand/getRandomColorForString.js.map +1 -1
  148. package/features/WatchCommand/index.js +0 -2
  149. package/features/Wcp/LinkProjectCommand.js +119 -138
  150. package/features/Wcp/LinkProjectCommand.js.map +1 -1
  151. package/features/Wcp/LoginCommand.js +104 -118
  152. package/features/Wcp/LoginCommand.js.map +1 -1
  153. package/features/Wcp/LogoutCommand.js +29 -23
  154. package/features/Wcp/LogoutCommand.js.map +1 -1
  155. package/features/Wcp/WhoAmICommand.js +33 -29
  156. package/features/Wcp/WhoAmICommand.js.map +1 -1
  157. package/features/common/index.js +0 -2
  158. package/features/common/options.js +41 -50
  159. package/features/common/options.js.map +1 -1
  160. package/features/globalOptions/LogLevelGlobalOption.js +25 -16
  161. package/features/globalOptions/LogLevelGlobalOption.js.map +1 -1
  162. package/features/globalOptions/ShowLogsGlobalOption.js +16 -15
  163. package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -1
  164. package/features/globalOptions/StackTraceGlobalOption.js +16 -15
  165. package/features/globalOptions/StackTraceGlobalOption.js.map +1 -1
  166. package/features/globalOptions/index.js +0 -2
  167. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +17 -16
  168. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -1
  169. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
  170. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
  171. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +19 -19
  172. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -1
  173. package/features/gracefulErrorHandlers/index.js +0 -2
  174. package/features/index.js +0 -2
  175. package/features/utils/index.js +0 -2
  176. package/features/utils/measureDuration.js +7 -8
  177. package/features/utils/measureDuration.js.map +1 -1
  178. package/index.js +0 -2
  179. package/package.json +10 -10
  180. package/services/ArgvParserService/ArgvParserService.js +27 -33
  181. package/services/ArgvParserService/ArgvParserService.js.map +1 -1
  182. package/services/ArgvParserService/index.js +0 -2
  183. package/services/CliParamsService/CliParamsService.js +18 -15
  184. package/services/CliParamsService/CliParamsService.js.map +1 -1
  185. package/services/CliParamsService/index.js +0 -2
  186. package/services/CommandsRegistryService/CommandsRegistryService.js +19 -13
  187. package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -1
  188. package/services/CommandsRegistryService/index.js +0 -2
  189. package/services/GetArgvService/GetArgvService.js +14 -11
  190. package/services/GetArgvService/GetArgvService.js.map +1 -1
  191. package/services/GetArgvService/index.js +0 -2
  192. package/services/GetCliRunnerService/GetCliRunnerService.js +119 -155
  193. package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -1
  194. package/services/GetCliRunnerService/index.js +0 -2
  195. package/services/GetIsCiService/GetIsCiService.js +9 -8
  196. package/services/GetIsCiService/GetIsCiService.js.map +1 -1
  197. package/services/GetIsCiService/index.js +1 -3
  198. package/services/GetProjectSdkService/GetProjectSdkService.js +25 -24
  199. package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -1
  200. package/services/GetProjectSdkService/index.js +0 -2
  201. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -13
  202. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -1
  203. package/services/GlobalOptionsRegistryService/index.js +0 -2
  204. package/services/LoggerService/LoggerService.js +75 -87
  205. package/services/LoggerService/LoggerService.js.map +1 -1
  206. package/services/LoggerService/index.js +0 -2
  207. package/services/RunCliRunnerService/RunCliRunnerService.js +15 -13
  208. package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -1
  209. package/services/RunCliRunnerService/index.js +0 -2
  210. package/services/StdioService/StdioService.js +15 -14
  211. package/services/StdioService/StdioService.js.map +1 -1
  212. package/services/StdioService/index.js +0 -2
  213. package/services/UiService/UiService.js +55 -58
  214. package/services/UiService/UiService.js.map +1 -1
  215. package/services/UiService/index.js +0 -2
  216. package/services/index.js +0 -2
  217. package/utils/ManuallyReportedError.js +7 -6
  218. package/utils/ManuallyReportedError.js.map +1 -1
  219. package/abstractions/features/index.js.map +0 -1
  220. package/abstractions/features/types.js.map +0 -1
  221. package/abstractions/index.js.map +0 -1
  222. package/abstractions/services/index.js.map +0 -1
  223. package/decorators/index.js.map +0 -1
  224. package/exports/cli/command.js.map +0 -1
  225. package/exports/cli.js.map +0 -1
  226. package/features/BuildCommand/index.js.map +0 -1
  227. package/features/DeployCommand/index.js.map +0 -1
  228. package/features/DepsSync/index.js.map +0 -1
  229. package/features/DestroyCommand/index.js.map +0 -1
  230. package/features/ExtensionCommand/index.js.map +0 -1
  231. package/features/InfoCommand/index.js.map +0 -1
  232. package/features/IsCi/index.js.map +0 -1
  233. package/features/PulumiCommand/index.js.map +0 -1
  234. package/features/RefreshCommand/index.js.map +0 -1
  235. package/features/UpgradeCommand/index.js.map +0 -1
  236. package/features/WatchCommand/index.js.map +0 -1
  237. package/features/common/index.js.map +0 -1
  238. package/features/globalOptions/index.js.map +0 -1
  239. package/features/gracefulErrorHandlers/index.js.map +0 -1
  240. package/features/index.js.map +0 -1
  241. package/features/utils/index.js.map +0 -1
  242. package/index.js.map +0 -1
  243. package/services/ArgvParserService/index.js.map +0 -1
  244. package/services/CliParamsService/index.js.map +0 -1
  245. package/services/CommandsRegistryService/index.js.map +0 -1
  246. package/services/GetArgvService/index.js.map +0 -1
  247. package/services/GetCliRunnerService/index.js.map +0 -1
  248. package/services/GetIsCiService/index.js.map +0 -1
  249. package/services/GetProjectSdkService/index.js.map +0 -1
  250. package/services/GlobalOptionsRegistryService/index.js.map +0 -1
  251. package/services/LoggerService/index.js.map +0 -1
  252. package/services/RunCliRunnerService/index.js.map +0 -1
  253. package/services/StdioService/index.js.map +0 -1
  254. package/services/UiService/index.js.map +0 -1
  255. package/services/index.js.map +0 -1
package/Cli.js CHANGED
@@ -1,16 +1,17 @@
1
1
  import { createCliContainer } from "./createCliContainer.js";
2
2
  import { RunCliRunnerService } from "./abstractions/index.js";
3
- export class Cli {
4
- constructor(container) {
5
- this.container = container;
6
- }
7
- run() {
8
- return this.container.resolve(RunCliRunnerService).execute();
9
- }
10
- static async init(params = {}) {
11
- const container = await createCliContainer(params);
12
- return new Cli(container);
13
- }
3
+ class Cli {
4
+ constructor(container){
5
+ this.container = container;
6
+ }
7
+ run() {
8
+ return this.container.resolve(RunCliRunnerService).execute();
9
+ }
10
+ static async init(params = {}) {
11
+ const container = await createCliContainer(params);
12
+ return new Cli(container);
13
+ }
14
14
  }
15
+ export { Cli };
15
16
 
16
17
  //# sourceMappingURL=Cli.js.map
package/Cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["createCliContainer","RunCliRunnerService","Cli","constructor","container","run","resolve","execute","init","params"],"sources":["Cli.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\nimport { createCliContainer } from \"./createCliContainer.js\";\nimport { CliParamsService, RunCliRunnerService } from \"~/abstractions/index.js\";\n\nexport class Cli {\n private container: Container;\n\n private constructor(container: Container) {\n this.container = container;\n }\n\n run() {\n return this.container.resolve(RunCliRunnerService).execute();\n }\n\n static async init(params: CliParamsService.Params = {}) {\n const container = await createCliContainer(params);\n return new Cli(container);\n }\n}\n"],"mappings":"AACA,SAASA,kBAAkB;AAC3B,SAA2BC,mBAAmB;AAE9C,OAAO,MAAMC,GAAG,CAAC;EAGLC,WAAWA,CAACC,SAAoB,EAAE;IACtC,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC9B;EAEAC,GAAGA,CAAA,EAAG;IACF,OAAO,IAAI,CAACD,SAAS,CAACE,OAAO,CAACL,mBAAmB,CAAC,CAACM,OAAO,CAAC,CAAC;EAChE;EAEA,aAAaC,IAAIA,CAACC,MAA+B,GAAG,CAAC,CAAC,EAAE;IACpD,MAAML,SAAS,GAAG,MAAMJ,kBAAkB,CAACS,MAAM,CAAC;IAClD,OAAO,IAAIP,GAAG,CAACE,SAAS,CAAC;EAC7B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"Cli.js","sources":["../src/Cli.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\nimport { createCliContainer } from \"./createCliContainer.js\";\nimport { CliParamsService, RunCliRunnerService } from \"~/abstractions/index.js\";\n\nexport class Cli {\n private container: Container;\n\n private constructor(container: Container) {\n this.container = container;\n }\n\n run() {\n return this.container.resolve(RunCliRunnerService).execute();\n }\n\n static async init(params: CliParamsService.Params = {}) {\n const container = await createCliContainer(params);\n return new Cli(container);\n }\n}\n"],"names":["Cli","container","RunCliRunnerService","params","createCliContainer"],"mappings":";;AAIO,MAAMA;IAGT,YAAoBC,SAAoB,CAAE;QACtC,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,MAAM;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC,qBAAqB,OAAO;IAC9D;IAEA,aAAa,KAAKC,SAAkC,CAAC,CAAC,EAAE;QACpD,MAAMF,YAAY,MAAMG,mBAAmBD;QAC3C,OAAO,IAAIH,IAAIC;IACnB;AACJ"}
@@ -1,6 +1,7 @@
1
1
  import { Abstraction } from "@webiny/di";
2
- export function createAbstraction(name) {
3
- return new Abstraction(name);
2
+ function createAbstraction(name) {
3
+ return new Abstraction(name);
4
4
  }
5
+ export { createAbstraction };
5
6
 
6
7
  //# sourceMappingURL=createAbstraction.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Abstraction","createAbstraction","name"],"sources":["createAbstraction.ts"],"sourcesContent":["import { Abstraction } from \"@webiny/di\";\n\nexport function createAbstraction<T>(name: string): Abstraction<T> {\n return new Abstraction<T>(name);\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,YAAY;AAExC,OAAO,SAASC,iBAAiBA,CAAIC,IAAY,EAAkB;EAC/D,OAAO,IAAIF,WAAW,CAAIE,IAAI,CAAC;AACnC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/createAbstraction.js","sources":["../../src/abstractions/createAbstraction.ts"],"sourcesContent":["import { Abstraction } from \"@webiny/di\";\n\nexport function createAbstraction<T>(name: string): Abstraction<T> {\n return new Abstraction<T>(name);\n}\n"],"names":["createAbstraction","name","Abstraction"],"mappings":";AAEO,SAASA,kBAAqBC,IAAY;IAC7C,OAAO,IAAIC,YAAeD;AAC9B"}
@@ -1,7 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- /**
3
- * Implement a custom CLI command for Webiny CLI.
4
- */
5
- export const CliCommandFactory = createAbstraction("CliCommandFactory");
2
+ const CliCommandFactory = createAbstraction("CliCommandFactory");
3
+ export { CliCommandFactory };
6
4
 
7
5
  //# sourceMappingURL=CliCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","CliCommandFactory"],"sources":["CliCommand.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface ICliCommandParamDefinition<TCommandParams> {\n name: string;\n description: string;\n type: \"boolean\" | \"number\" | \"string\";\n required?: boolean;\n array?: boolean;\n default?: any;\n validation?: (value: TCommandParams) => boolean | string;\n}\n\nexport interface ICliCommandOptionDefinition<TCommandParams> {\n name: string;\n description: string;\n type: \"boolean\" | \"number\" | \"string\";\n group?: string;\n required?: boolean;\n alias?: string;\n array?: boolean;\n default?: any;\n validation?: (value: TCommandParams) => boolean | string;\n}\n\nexport interface ICliCommandDefinition<TCommandParams> {\n name: string;\n description: string;\n params?: ICliCommandParamDefinition<TCommandParams>[];\n options?: ICliCommandOptionDefinition<TCommandParams>[];\n examples?: string[];\n handler: (params: TCommandParams) => void | Promise<void>;\n}\n\nexport interface ICliCommand<TCommandParams> {\n execute():\n | Promise<ICliCommandDefinition<TCommandParams>>\n | ICliCommandDefinition<TCommandParams>;\n}\n\n/**\n * Implement a custom CLI command for Webiny CLI.\n */\nexport const CliCommandFactory = createAbstraction<ICliCommand<any>>(\"CliCommandFactory\");\n\nexport namespace CliCommandFactory {\n export type Interface<TCommandParams> = ICliCommand<TCommandParams>;\n\n export type ParamDefinition<TCommandParams> = ICliCommandParamDefinition<TCommandParams>;\n export type OptionDefinition<TCommandParams> = ICliCommandOptionDefinition<TCommandParams>;\n\n export type CommandDefinition<TCommandParams> = ICliCommandDefinition<TCommandParams>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAuC1B;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGD,iBAAiB,CAAmB,mBAAmB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/features/CliCommand.js","sources":["../../../src/abstractions/features/CliCommand.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface ICliCommandParamDefinition<TCommandParams> {\n name: string;\n description: string;\n type: \"boolean\" | \"number\" | \"string\";\n required?: boolean;\n array?: boolean;\n default?: any;\n validation?: (value: TCommandParams) => boolean | string;\n}\n\nexport interface ICliCommandOptionDefinition<TCommandParams> {\n name: string;\n description: string;\n type: \"boolean\" | \"number\" | \"string\";\n group?: string;\n required?: boolean;\n alias?: string;\n array?: boolean;\n default?: any;\n validation?: (value: TCommandParams) => boolean | string;\n}\n\nexport interface ICliCommandDefinition<TCommandParams> {\n name: string;\n description: string;\n params?: ICliCommandParamDefinition<TCommandParams>[];\n options?: ICliCommandOptionDefinition<TCommandParams>[];\n examples?: string[];\n handler: (params: TCommandParams) => void | Promise<void>;\n}\n\nexport interface ICliCommand<TCommandParams> {\n execute():\n | Promise<ICliCommandDefinition<TCommandParams>>\n | ICliCommandDefinition<TCommandParams>;\n}\n\n/**\n * Implement a custom CLI command for Webiny CLI.\n */\nexport const CliCommandFactory = createAbstraction<ICliCommand<any>>(\"CliCommandFactory\");\n\nexport namespace CliCommandFactory {\n export type Interface<TCommandParams> = ICliCommand<TCommandParams>;\n\n export type ParamDefinition<TCommandParams> = ICliCommandParamDefinition<TCommandParams>;\n export type OptionDefinition<TCommandParams> = ICliCommandOptionDefinition<TCommandParams>;\n\n export type CommandDefinition<TCommandParams> = ICliCommandDefinition<TCommandParams>;\n}\n"],"names":["CliCommandFactory","createAbstraction"],"mappings":";AA0CO,MAAMA,oBAAoBC,kBAAoC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const ErrorHandler = createAbstraction("ErrorHandler");
2
+ const ErrorHandler = createAbstraction("ErrorHandler");
3
+ export { ErrorHandler };
3
4
 
4
5
  //# sourceMappingURL=ErrorHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","ErrorHandler"],"sources":["ErrorHandler.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { CliCommandFactory } from \"~/abstractions/index.js\";\n\nexport type IError = Error;\n\nexport interface IErrorHandlerParams<TParams> {\n error: Error;\n command: CliCommandFactory.CommandDefinition<any>;\n params: TParams;\n}\n\nexport interface IErrorHandler<TParams> {\n execute(params: IErrorHandlerParams<TParams>): void;\n}\n\nexport const ErrorHandler = createAbstraction<IErrorHandler<any>>(\"ErrorHandler\");\n\nexport namespace ErrorHandler {\n export type Interface<TParams> = IErrorHandler<TParams>;\n export type Params<TParams> = IErrorHandlerParams<TParams>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAe1B,OAAO,MAAMC,YAAY,GAAGD,iBAAiB,CAAqB,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/features/ErrorHandler.js","sources":["../../../src/abstractions/features/ErrorHandler.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { CliCommandFactory } from \"~/abstractions/index.js\";\n\nexport type IError = Error;\n\nexport interface IErrorHandlerParams<TParams> {\n error: Error;\n command: CliCommandFactory.CommandDefinition<any>;\n params: TParams;\n}\n\nexport interface IErrorHandler<TParams> {\n execute(params: IErrorHandlerParams<TParams>): void;\n}\n\nexport const ErrorHandler = createAbstraction<IErrorHandler<any>>(\"ErrorHandler\");\n\nexport namespace ErrorHandler {\n export type Interface<TParams> = IErrorHandler<TParams>;\n export type Params<TParams> = IErrorHandlerParams<TParams>;\n}\n"],"names":["ErrorHandler","createAbstraction"],"mappings":";AAeO,MAAMA,eAAeC,kBAAsC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const GlobalCliOption = createAbstraction("GlobalCliOption");
2
+ const GlobalCliOption = createAbstraction("GlobalCliOption");
3
+ export { GlobalCliOption };
3
4
 
4
5
  //# sourceMappingURL=GlobalCliOption.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","GlobalCliOption"],"sources":["GlobalCliOption.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IGlobalCliOptionConfig {\n type: \"boolean\" | \"number\" | \"string\";\n description: string;\n default?: any;\n alias?: string;\n choices?: string[];\n}\n\nexport interface IGlobalCliOptionDefinition {\n name: string;\n config: IGlobalCliOptionConfig;\n}\n\nexport interface IGlobalCliOption {\n execute(): Promise<IGlobalCliOptionDefinition> | IGlobalCliOptionDefinition;\n}\n\nexport const GlobalCliOption = createAbstraction<IGlobalCliOption>(\"GlobalCliOption\");\n\nexport namespace GlobalCliOption {\n export type Interface = IGlobalCliOption;\n export type Definition = IGlobalCliOptionDefinition;\n export type Config = IGlobalCliOptionConfig;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAmB1B,OAAO,MAAMC,eAAe,GAAGD,iBAAiB,CAAmB,iBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/features/GlobalCliOption.js","sources":["../../../src/abstractions/features/GlobalCliOption.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IGlobalCliOptionConfig {\n type: \"boolean\" | \"number\" | \"string\";\n description: string;\n default?: any;\n alias?: string;\n choices?: string[];\n}\n\nexport interface IGlobalCliOptionDefinition {\n name: string;\n config: IGlobalCliOptionConfig;\n}\n\nexport interface IGlobalCliOption {\n execute(): Promise<IGlobalCliOptionDefinition> | IGlobalCliOptionDefinition;\n}\n\nexport const GlobalCliOption = createAbstraction<IGlobalCliOption>(\"GlobalCliOption\");\n\nexport namespace GlobalCliOption {\n export type Interface = IGlobalCliOption;\n export type Definition = IGlobalCliOptionDefinition;\n export type Config = IGlobalCliOptionConfig;\n}\n"],"names":["GlobalCliOption","createAbstraction"],"mappings":";AAmBO,MAAMA,kBAAkBC,kBAAoC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const IsCi = createAbstraction("IsCi");
2
+ const IsCi = createAbstraction("IsCi");
3
+ export { IsCi };
3
4
 
4
5
  //# sourceMappingURL=IsCi.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","IsCi"],"sources":["IsCi.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\ninterface IIsCi {\n execute(): boolean;\n}\n\nexport const IsCi = createAbstraction<IIsCi>(\"IsCi\");\n\nexport namespace IsCi {\n export type Interface = IIsCi;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAM1B,OAAO,MAAMC,IAAI,GAAGD,iBAAiB,CAAQ,MAAM,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/features/IsCi.js","sources":["../../../src/abstractions/features/IsCi.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\ninterface IIsCi {\n execute(): boolean;\n}\n\nexport const IsCi = createAbstraction<IIsCi>(\"IsCi\");\n\nexport namespace IsCi {\n export type Interface = IIsCi;\n}\n"],"names":["IsCi","createAbstraction"],"mappings":";AAMO,MAAMA,OAAOC,kBAAyB"}
@@ -2,5 +2,3 @@ export { CliCommandFactory } from "./CliCommand.js";
2
2
  export { ErrorHandler } from "./ErrorHandler.js";
3
3
  export { GlobalCliOption } from "./GlobalCliOption.js";
4
4
  export { IsCi } from "./IsCi.js";
5
-
6
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1,4 +1,2 @@
1
1
  export * from "./features/index.js";
2
2
  export * from "./services/index.js";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const ArgvParserService = createAbstraction("ArgvParserService");
2
+ const ArgvParserService = createAbstraction("ArgvParserService");
3
+ export { ArgvParserService };
3
4
 
4
5
  //# sourceMappingURL=ArgvParserService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","ArgvParserService"],"sources":["ArgvParserService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IArgvParserService {\n parse<T = Record<string, any>>(argv: string[]): T;\n}\n\nexport const ArgvParserService = createAbstraction<IArgvParserService>(\"ArgvParserService\");\n\nexport namespace ArgvParserService {\n export type Interface = IArgvParserService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAM1B,OAAO,MAAMC,iBAAiB,GAAGD,iBAAiB,CAAqB,mBAAmB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/ArgvParserService.js","sources":["../../../src/abstractions/services/ArgvParserService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IArgvParserService {\n parse<T = Record<string, any>>(argv: string[]): T;\n}\n\nexport const ArgvParserService = createAbstraction<IArgvParserService>(\"ArgvParserService\");\n\nexport namespace ArgvParserService {\n export type Interface = IArgvParserService;\n}\n"],"names":["ArgvParserService","createAbstraction"],"mappings":";AAMO,MAAMA,oBAAoBC,kBAAsC"}
@@ -1,4 +1,5 @@
1
1
  import { Abstraction } from "@webiny/di";
2
- export const CliParamsService = new Abstraction("CliParamsService");
2
+ const CliParamsService = new Abstraction("CliParamsService");
3
+ export { CliParamsService };
3
4
 
4
5
  //# sourceMappingURL=CliParamsService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Abstraction","CliParamsService"],"sources":["CliParamsService.ts"],"sourcesContent":["import { ExtensionDefinitionModel } from \"@webiny/project/extensions/index.js\";\nimport { Abstraction } from \"@webiny/di\";\n\nexport interface ICliParams {\n cwd?: string;\n extensions?: ExtensionDefinitionModel<any>[];\n}\n\nexport interface ICliParamsService {\n get(): ICliParams;\n set(params: ICliParams): void;\n}\n\nexport const CliParamsService = new Abstraction<ICliParamsService>(\"CliParamsService\");\n\nexport namespace CliParamsService {\n export type Interface = ICliParamsService;\n export type Params = ICliParams;\n}\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,YAAY;AAYxC,OAAO,MAAMC,gBAAgB,GAAG,IAAID,WAAW,CAAoB,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/CliParamsService.js","sources":["../../../src/abstractions/services/CliParamsService.ts"],"sourcesContent":["import { ExtensionDefinitionModel } from \"@webiny/project/extensions/index.js\";\nimport { Abstraction } from \"@webiny/di\";\n\nexport interface ICliParams {\n cwd?: string;\n extensions?: ExtensionDefinitionModel<any>[];\n}\n\nexport interface ICliParamsService {\n get(): ICliParams;\n set(params: ICliParams): void;\n}\n\nexport const CliParamsService = new Abstraction<ICliParamsService>(\"CliParamsService\");\n\nexport namespace CliParamsService {\n export type Interface = ICliParamsService;\n export type Params = ICliParams;\n}\n"],"names":["CliParamsService","Abstraction"],"mappings":";AAaO,MAAMA,mBAAmB,IAAIC,YAA+B"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const CommandsRegistryService = createAbstraction("CommandsRegistryService");
2
+ const CommandsRegistryService = createAbstraction("CommandsRegistryService");
3
+ export { CommandsRegistryService };
3
4
 
4
5
  //# sourceMappingURL=CommandsRegistryService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","CommandsRegistryService"],"sources":["CommandsRegistryService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { CliCommandFactory } from \"~/abstractions/index.js\";\n\nexport interface ICommandsRegistryService {\n execute(): CliCommandFactory.Interface<any>[];\n}\n\nexport const CommandsRegistryService =\n createAbstraction<ICommandsRegistryService>(\"CommandsRegistryService\");\n\nexport namespace CommandsRegistryService {\n export type Interface = ICommandsRegistryService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAO1B,OAAO,MAAMC,uBAAuB,GAChCD,iBAAiB,CAA2B,yBAAyB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/CommandsRegistryService.js","sources":["../../../src/abstractions/services/CommandsRegistryService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { CliCommandFactory } from \"~/abstractions/index.js\";\n\nexport interface ICommandsRegistryService {\n execute(): CliCommandFactory.Interface<any>[];\n}\n\nexport const CommandsRegistryService =\n createAbstraction<ICommandsRegistryService>(\"CommandsRegistryService\");\n\nexport namespace CommandsRegistryService {\n export type Interface = ICommandsRegistryService;\n}\n"],"names":["CommandsRegistryService","createAbstraction"],"mappings":";AAOO,MAAMA,0BACTC,kBAA4C"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const GetArgvService = createAbstraction("GetArgvService");
2
+ const GetArgvService = createAbstraction("GetArgvService");
3
+ export { GetArgvService };
3
4
 
4
5
  //# sourceMappingURL=GetArgvService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","GetArgvService"],"sources":["GetArgvService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IGetArgvService {\n execute<T = Record<string, any>>(): T;\n}\n\nexport const GetArgvService = createAbstraction<IGetArgvService>(\"GetArgvService\");\n\nexport namespace GetArgvService {\n export type Interface = IGetArgvService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAM1B,OAAO,MAAMC,cAAc,GAAGD,iBAAiB,CAAkB,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/GetArgvService.js","sources":["../../../src/abstractions/services/GetArgvService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IGetArgvService {\n execute<T = Record<string, any>>(): T;\n}\n\nexport const GetArgvService = createAbstraction<IGetArgvService>(\"GetArgvService\");\n\nexport namespace GetArgvService {\n export type Interface = IGetArgvService;\n}\n"],"names":["GetArgvService","createAbstraction"],"mappings":";AAMO,MAAMA,iBAAiBC,kBAAmC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const GetCliRunnerService = createAbstraction("GetCliRunnerService");
2
+ const GetCliRunnerService = createAbstraction("GetCliRunnerService");
3
+ export { GetCliRunnerService };
3
4
 
4
5
  //# sourceMappingURL=GetCliRunnerService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","GetCliRunnerService"],"sources":["GetCliRunnerService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IGetCliRunnerService {\n execute(): Promise<any>;\n}\n\nexport const GetCliRunnerService = createAbstraction<IGetCliRunnerService>(\"GetCliRunnerService\");\n\nexport namespace GetCliRunnerService {\n export type Interface = IGetCliRunnerService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAM1B,OAAO,MAAMC,mBAAmB,GAAGD,iBAAiB,CAAuB,qBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/GetCliRunnerService.js","sources":["../../../src/abstractions/services/GetCliRunnerService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IGetCliRunnerService {\n execute(): Promise<any>;\n}\n\nexport const GetCliRunnerService = createAbstraction<IGetCliRunnerService>(\"GetCliRunnerService\");\n\nexport namespace GetCliRunnerService {\n export type Interface = IGetCliRunnerService;\n}\n"],"names":["GetCliRunnerService","createAbstraction"],"mappings":";AAMO,MAAMA,sBAAsBC,kBAAwC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const GetIsCiService = createAbstraction("GetIsCiService");
2
+ const GetIsCiService = createAbstraction("GetIsCiService");
3
+ export { GetIsCiService };
3
4
 
4
5
  //# sourceMappingURL=GetIsCiService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","GetIsCiService"],"sources":["GetIsCiService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\ninterface IGetIsCiService {\n execute(): boolean;\n}\n\nexport const GetIsCiService = createAbstraction<IGetIsCiService>(\"GetIsCiService\");\n\nexport namespace GetIsCiService {\n export type Interface = IGetIsCiService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAM1B,OAAO,MAAMC,cAAc,GAAGD,iBAAiB,CAAkB,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/GetIsCiService.js","sources":["../../../src/abstractions/services/GetIsCiService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\ninterface IGetIsCiService {\n execute(): boolean;\n}\n\nexport const GetIsCiService = createAbstraction<IGetIsCiService>(\"GetIsCiService\");\n\nexport namespace GetIsCiService {\n export type Interface = IGetIsCiService;\n}\n"],"names":["GetIsCiService","createAbstraction"],"mappings":";AAMO,MAAMA,iBAAiBC,kBAAmC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const GetProjectSdkService = createAbstraction("GetProjectSdkService");
2
+ const GetProjectSdkService = createAbstraction("GetProjectSdkService");
3
+ export { GetProjectSdkService };
3
4
 
4
5
  //# sourceMappingURL=GetProjectSdkService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","GetProjectSdkService"],"sources":["GetProjectSdkService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type ProjectSdk } from \"@webiny/project\";\n\nexport interface IGetProjectSdkService {\n execute(): Promise<ProjectSdk>;\n}\n\nexport const GetProjectSdkService =\n createAbstraction<IGetProjectSdkService>(\"GetProjectSdkService\");\n\nexport namespace GetProjectSdkService {\n export type Interface = IGetProjectSdkService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAO1B,OAAO,MAAMC,oBAAoB,GAC7BD,iBAAiB,CAAwB,sBAAsB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/GetProjectSdkService.js","sources":["../../../src/abstractions/services/GetProjectSdkService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type ProjectSdk } from \"@webiny/project\";\n\nexport interface IGetProjectSdkService {\n execute(): Promise<ProjectSdk>;\n}\n\nexport const GetProjectSdkService =\n createAbstraction<IGetProjectSdkService>(\"GetProjectSdkService\");\n\nexport namespace GetProjectSdkService {\n export type Interface = IGetProjectSdkService;\n}\n"],"names":["GetProjectSdkService","createAbstraction"],"mappings":";AAOO,MAAMA,uBACTC,kBAAyC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const GlobalOptionsRegistryService = createAbstraction("GlobalOptionsRegistryService");
2
+ const GlobalOptionsRegistryService = createAbstraction("GlobalOptionsRegistryService");
3
+ export { GlobalOptionsRegistryService };
3
4
 
4
5
  //# sourceMappingURL=GlobalOptionsRegistryService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","GlobalOptionsRegistryService"],"sources":["GlobalOptionsRegistryService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { GlobalCliOption } from \"~/abstractions/index.js\";\n\nexport interface IGlobalOptionsRegistryService {\n execute(): GlobalCliOption.Interface[];\n}\n\nexport const GlobalOptionsRegistryService = createAbstraction<IGlobalOptionsRegistryService>(\n \"GlobalOptionsRegistryService\"\n);\n\nexport namespace GlobalOptionsRegistryService {\n export type Interface = IGlobalOptionsRegistryService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAO1B,OAAO,MAAMC,4BAA4B,GAAGD,iBAAiB,CACzD,8BACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/GlobalOptionsRegistryService.js","sources":["../../../src/abstractions/services/GlobalOptionsRegistryService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { GlobalCliOption } from \"~/abstractions/index.js\";\n\nexport interface IGlobalOptionsRegistryService {\n execute(): GlobalCliOption.Interface[];\n}\n\nexport const GlobalOptionsRegistryService = createAbstraction<IGlobalOptionsRegistryService>(\n \"GlobalOptionsRegistryService\"\n);\n\nexport namespace GlobalOptionsRegistryService {\n export type Interface = IGlobalOptionsRegistryService;\n}\n"],"names":["GlobalOptionsRegistryService","createAbstraction"],"mappings":";AAOO,MAAMA,+BAA+BC,kBACxC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const LoggerService = createAbstraction("LoggerService");
2
+ const LoggerService = createAbstraction("LoggerService");
3
+ export { LoggerService };
3
4
 
4
5
  //# sourceMappingURL=LoggerService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","LoggerService"],"sources":["LoggerService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface ILoggerService {\n // Basic levels\n trace(objOrMsg: object | string, ...args: any[]): void;\n debug(objOrMsg: object | string, ...args: any[]): void;\n info(objOrMsg: object | string, ...args: any[]): void;\n warn(objOrMsg: object | string, ...args: any[]): void;\n error(objOrMsg: object | string, ...args: any[]): void;\n fatal(objOrMsg: object | string, ...args: any[]): void;\n\n // Generic log (can default to 'info')\n log(objOrMsg: object | string, ...args: any[]): void;\n}\n\nexport const LoggerService = createAbstraction<ILoggerService>(\"LoggerService\");\n\nexport namespace LoggerService {\n export type Interface = ILoggerService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAe1B,OAAO,MAAMC,aAAa,GAAGD,iBAAiB,CAAiB,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/LoggerService.js","sources":["../../../src/abstractions/services/LoggerService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface ILoggerService {\n // Basic levels\n trace(objOrMsg: object | string, ...args: any[]): void;\n debug(objOrMsg: object | string, ...args: any[]): void;\n info(objOrMsg: object | string, ...args: any[]): void;\n warn(objOrMsg: object | string, ...args: any[]): void;\n error(objOrMsg: object | string, ...args: any[]): void;\n fatal(objOrMsg: object | string, ...args: any[]): void;\n\n // Generic log (can default to 'info')\n log(objOrMsg: object | string, ...args: any[]): void;\n}\n\nexport const LoggerService = createAbstraction<ILoggerService>(\"LoggerService\");\n\nexport namespace LoggerService {\n export type Interface = ILoggerService;\n}\n"],"names":["LoggerService","createAbstraction"],"mappings":";AAeO,MAAMA,gBAAgBC,kBAAkC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const RunCliRunnerService = createAbstraction("RunCliRunnerService");
2
+ const RunCliRunnerService = createAbstraction("RunCliRunnerService");
3
+ export { RunCliRunnerService };
3
4
 
4
5
  //# sourceMappingURL=RunCliRunnerService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","RunCliRunnerService"],"sources":["RunCliRunnerService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IRunCliRunnerService {\n execute(): any;\n}\n\nexport const RunCliRunnerService = createAbstraction<IRunCliRunnerService>(\"RunCliRunnerService\");\n\nexport namespace RunCliRunnerService {\n export type Interface = IRunCliRunnerService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAM1B,OAAO,MAAMC,mBAAmB,GAAGD,iBAAiB,CAAuB,qBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/RunCliRunnerService.js","sources":["../../../src/abstractions/services/RunCliRunnerService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IRunCliRunnerService {\n execute(): any;\n}\n\nexport const RunCliRunnerService = createAbstraction<IRunCliRunnerService>(\"RunCliRunnerService\");\n\nexport namespace RunCliRunnerService {\n export type Interface = IRunCliRunnerService;\n}\n"],"names":["RunCliRunnerService","createAbstraction"],"mappings":";AAMO,MAAMA,sBAAsBC,kBAAwC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const StdioService = createAbstraction("StdioService");
2
+ const StdioService = createAbstraction("StdioService");
3
+ export { StdioService };
3
4
 
4
5
  //# sourceMappingURL=StdioService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","StdioService"],"sources":["StdioService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IStdioService {\n getStdout(): NodeJS.WriteStream;\n\n getStderr(): NodeJS.WriteStream;\n\n getStdin(): NodeJS.ReadStream;\n}\n\nexport const StdioService = createAbstraction<IStdioService>(\"StdioService\");\n\nexport namespace StdioService {\n export type Interface = IStdioService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAU1B,OAAO,MAAMC,YAAY,GAAGD,iBAAiB,CAAgB,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/StdioService.js","sources":["../../../src/abstractions/services/StdioService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IStdioService {\n getStdout(): NodeJS.WriteStream;\n\n getStderr(): NodeJS.WriteStream;\n\n getStdin(): NodeJS.ReadStream;\n}\n\nexport const StdioService = createAbstraction<IStdioService>(\"StdioService\");\n\nexport namespace StdioService {\n export type Interface = IStdioService;\n}\n"],"names":["StdioService","createAbstraction"],"mappings":";AAUO,MAAMA,eAAeC,kBAAiC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "../createAbstraction.js";
2
- export const UiService = createAbstraction("UiService");
2
+ const UiService = createAbstraction("UiService");
3
+ export { UiService };
3
4
 
4
5
  //# sourceMappingURL=UiService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","UiService"],"sources":["UiService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IUiService {\n raw(text: string): void;\n\n text(text: string): void;\n\n textBold(text: string): void;\n\n emptyLine(): void;\n\n info(text: string, ...args: any[]): void;\n\n success(text: string, ...args: any[]): void;\n\n error(text: string, ...args: any[]): void;\n\n warning(text: string, ...args: any[]): void;\n\n debug(text: string, ...args: any[]): void;\n}\n\nexport const UiService = createAbstraction<IUiService>(\"UiService\");\n\nexport namespace UiService {\n export type Interface = IUiService;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB;AAsB1B,OAAO,MAAMC,SAAS,GAAGD,iBAAiB,CAAa,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"abstractions/services/UiService.js","sources":["../../../src/abstractions/services/UiService.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\n\nexport interface IUiService {\n raw(text: string): void;\n\n text(text: string): void;\n\n textBold(text: string): void;\n\n emptyLine(): void;\n\n info(text: string, ...args: any[]): void;\n\n success(text: string, ...args: any[]): void;\n\n error(text: string, ...args: any[]): void;\n\n warning(text: string, ...args: any[]): void;\n\n debug(text: string, ...args: any[]): void;\n}\n\nexport const UiService = createAbstraction<IUiService>(\"UiService\");\n\nexport namespace UiService {\n export type Interface = IUiService;\n}\n"],"names":["UiService","createAbstraction"],"mappings":";AAsBO,MAAMA,YAAYC,kBAA8B"}
@@ -10,5 +10,3 @@ export * from "./LoggerService.js";
10
10
  export * from "./RunCliRunnerService.js";
11
11
  export * from "./StdioService.js";
12
12
  export * from "./UiService.js";
13
-
14
- //# sourceMappingURL=index.js.map
@@ -1,125 +1,99 @@
1
1
  import path from "path";
2
2
  import { Container } from "@webiny/di";
3
3
  import { argvParserService, cliParamsService, commandsRegistryService, getArgvService, getCliRunnerService, getIsCiService, getProjectSdkService, globalOptionsRegistryService, loggerService, runCliRunnerService, stdioService, uiService } from "./services/index.js";
4
- import { aboutCommand, buildCommand, configCommand, ddbPutItemConditionalCheckFailedGracefulErrorHandler, deployCommand, destroyCommand, disableTelemetryCommand, enableTelemetryCommand, extensionCommand, infoCommand, isCi, linkProjectCommand, loginCommand, logLevelGlobalOption, logoutCommand, missingFilesInBuildGracefulErrorHandler, openCommand, outputCommand, pendingOperationsGracefulErrorHandler, pulumiCommand, refreshCommand, showLogsGlobalOption, stackTraceGlobalOption, syncDepsCommand, UpgradeCommandFeature, verifyDepsCommand, watchCommand, whoAmICommand } from "./features/index.js";
4
+ import { UpgradeCommandFeature, aboutCommand, buildCommand, configCommand, ddbPutItemConditionalCheckFailedGracefulErrorHandler, deployCommand, destroyCommand, disableTelemetryCommand, enableTelemetryCommand, extensionCommand, infoCommand, isCi, linkProjectCommand, logLevelGlobalOption, loginCommand, logoutCommand, missingFilesInBuildGracefulErrorHandler, openCommand, outputCommand, pendingOperationsGracefulErrorHandler, pulumiCommand, refreshCommand, showLogsGlobalOption, stackTraceGlobalOption, syncDepsCommand, verifyDepsCommand, watchCommand, whoAmICommand } from "./features/index.js";
5
5
  import chalk from "chalk";
6
6
  import { CliParamsService, GetArgvService, GetProjectSdkService, UiService } from "./abstractions/index.js";
7
7
  import { GracefulError, toImportSpecifier } from "@webiny/project";
8
8
  import { commandsWithGracefulErrorHandling, deployCommandWithTelemetry } from "./decorators/index.js";
9
9
  import { CliCommand } from "./extensions/index.js";
10
- const {
11
- bgYellow,
12
- bold
13
- } = chalk;
14
- export const createCliContainer = async params => {
15
- const container = new Container();
16
-
17
- // Features (commands).
18
- container.register(aboutCommand).inSingletonScope();
19
- container.register(buildCommand).inSingletonScope();
20
- container.register(configCommand).inSingletonScope();
21
- container.register(deployCommand).inSingletonScope();
22
- container.register(pulumiCommand).inSingletonScope();
23
- container.register(refreshCommand).inSingletonScope();
24
- container.register(enableTelemetryCommand).inSingletonScope();
25
- container.register(disableTelemetryCommand).inSingletonScope();
26
- container.register(extensionCommand).inSingletonScope();
27
- container.register(syncDepsCommand).inSingletonScope();
28
- container.register(verifyDepsCommand).inSingletonScope();
29
- container.register(destroyCommand).inSingletonScope();
30
- container.register(infoCommand).inSingletonScope();
31
- container.register(isCi).inSingletonScope();
32
- container.register(openCommand).inSingletonScope();
33
- container.register(outputCommand).inSingletonScope();
34
- container.register(watchCommand).inSingletonScope();
35
- UpgradeCommandFeature.register(container);
36
- container.register(linkProjectCommand).inSingletonScope();
37
- container.register(loginCommand).inSingletonScope();
38
- container.register(logoutCommand).inSingletonScope();
39
- container.register(whoAmICommand).inSingletonScope();
40
-
41
- // Graceful error handlers.
42
- container.register(ddbPutItemConditionalCheckFailedGracefulErrorHandler).inSingletonScope();
43
- container.register(missingFilesInBuildGracefulErrorHandler).inSingletonScope();
44
- container.register(pendingOperationsGracefulErrorHandler).inSingletonScope();
45
-
46
- // Global options.
47
- container.register(showLogsGlobalOption).inSingletonScope();
48
- container.register(logLevelGlobalOption).inSingletonScope();
49
- container.register(stackTraceGlobalOption).inSingletonScope();
50
-
51
- // Services.
52
- container.register(argvParserService).inSingletonScope();
53
- container.register(cliParamsService).inSingletonScope();
54
- container.register(commandsRegistryService).inSingletonScope();
55
- container.register(getArgvService).inSingletonScope();
56
- container.register(getCliRunnerService).inSingletonScope();
57
- container.register(getIsCiService).inSingletonScope();
58
- container.register(globalOptionsRegistryService).inSingletonScope();
59
- container.register(getProjectSdkService).inSingletonScope();
60
- container.register(loggerService).inSingletonScope();
61
- container.register(runCliRunnerService).inSingletonScope();
62
- container.register(stdioService).inSingletonScope();
63
- container.register(uiService).inSingletonScope();
64
-
65
- // Extensions.
66
- const ui = container.resolve(UiService);
67
- try {
68
- // Immediately set CLI instance params via the `CliParamsService`.
69
- container.resolve(CliParamsService).set(params);
70
- const projectSdk = await container.resolve(GetProjectSdkService).execute();
71
- const projectConfig = await projectSdk.getProjectConfig({
72
- tags: {
73
- runtimeContext: "cli"
74
- }
75
- });
76
- await projectSdk.validateProjectConfig(projectConfig);
77
- const project = projectSdk.getProject();
78
- const importFromPath = async filePath => {
79
- let importPath;
80
- if (filePath.startsWith("/extensions/")) {
81
- // Resolve from project root.
82
- importPath = project.paths.rootFolder.join(filePath).toString();
83
- } else {
84
- // Treat as absolute path.
85
- importPath = filePath;
86
- }
87
- const exportName = path.basename(filePath).replace(path.extname(filePath), "");
88
- const importedModule = await import(toImportSpecifier(importPath));
89
-
90
- // Support both default and named exports.
91
- // Check for 'default' property existence rather than truthiness.
92
- return "default" in importedModule && importedModule.default || importedModule[exportName];
93
- };
94
- const commands = projectConfig.extensionsByType(CliCommand);
95
- for (const command of commands) {
96
- const commandImplementation = await importFromPath(command.params.src);
97
- container.register(commandImplementation).inSingletonScope();
98
- }
99
- } catch (error) {
100
- let realError = error;
101
- if (error.cause) {
102
- realError = error.cause;
103
- }
104
- ui.error(realError.message);
105
- const argv = container.resolve(GetArgvService).execute();
106
- if (argv.showStackTrace && realError.stack) {
107
- ui.emptyLine();
108
- ui.debug("Stack trace:");
109
- ui.text(realError.stack);
10
+ const { bgYellow: bgYellow, bold: bold } = chalk;
11
+ const createCliContainer = async (params)=>{
12
+ const container = new Container();
13
+ container.register(aboutCommand).inSingletonScope();
14
+ container.register(buildCommand).inSingletonScope();
15
+ container.register(configCommand).inSingletonScope();
16
+ container.register(deployCommand).inSingletonScope();
17
+ container.register(pulumiCommand).inSingletonScope();
18
+ container.register(refreshCommand).inSingletonScope();
19
+ container.register(enableTelemetryCommand).inSingletonScope();
20
+ container.register(disableTelemetryCommand).inSingletonScope();
21
+ container.register(extensionCommand).inSingletonScope();
22
+ container.register(syncDepsCommand).inSingletonScope();
23
+ container.register(verifyDepsCommand).inSingletonScope();
24
+ container.register(destroyCommand).inSingletonScope();
25
+ container.register(infoCommand).inSingletonScope();
26
+ container.register(isCi).inSingletonScope();
27
+ container.register(openCommand).inSingletonScope();
28
+ container.register(outputCommand).inSingletonScope();
29
+ container.register(watchCommand).inSingletonScope();
30
+ UpgradeCommandFeature.register(container);
31
+ container.register(linkProjectCommand).inSingletonScope();
32
+ container.register(loginCommand).inSingletonScope();
33
+ container.register(logoutCommand).inSingletonScope();
34
+ container.register(whoAmICommand).inSingletonScope();
35
+ container.register(ddbPutItemConditionalCheckFailedGracefulErrorHandler).inSingletonScope();
36
+ container.register(missingFilesInBuildGracefulErrorHandler).inSingletonScope();
37
+ container.register(pendingOperationsGracefulErrorHandler).inSingletonScope();
38
+ container.register(showLogsGlobalOption).inSingletonScope();
39
+ container.register(logLevelGlobalOption).inSingletonScope();
40
+ container.register(stackTraceGlobalOption).inSingletonScope();
41
+ container.register(argvParserService).inSingletonScope();
42
+ container.register(cliParamsService).inSingletonScope();
43
+ container.register(commandsRegistryService).inSingletonScope();
44
+ container.register(getArgvService).inSingletonScope();
45
+ container.register(getCliRunnerService).inSingletonScope();
46
+ container.register(getIsCiService).inSingletonScope();
47
+ container.register(globalOptionsRegistryService).inSingletonScope();
48
+ container.register(getProjectSdkService).inSingletonScope();
49
+ container.register(loggerService).inSingletonScope();
50
+ container.register(runCliRunnerService).inSingletonScope();
51
+ container.register(stdioService).inSingletonScope();
52
+ container.register(uiService).inSingletonScope();
53
+ const ui = container.resolve(UiService);
54
+ try {
55
+ container.resolve(CliParamsService).set(params);
56
+ const projectSdk = await container.resolve(GetProjectSdkService).execute();
57
+ const projectConfig = await projectSdk.getProjectConfig({
58
+ tags: {
59
+ runtimeContext: "cli"
60
+ }
61
+ });
62
+ await projectSdk.validateProjectConfig(projectConfig);
63
+ const project = projectSdk.getProject();
64
+ const importFromPath = async (filePath)=>{
65
+ let importPath;
66
+ importPath = filePath.startsWith("/extensions/") ? project.paths.rootFolder.join(filePath).toString() : filePath;
67
+ const exportName = path.basename(filePath).replace(path.extname(filePath), "");
68
+ const importedModule = await import(toImportSpecifier(importPath));
69
+ return "default" in importedModule && importedModule.default || importedModule[exportName];
70
+ };
71
+ const commands = projectConfig.extensionsByType(CliCommand);
72
+ for (const command of commands){
73
+ const commandImplementation = await importFromPath(command.params.src);
74
+ container.register(commandImplementation).inSingletonScope();
75
+ }
76
+ } catch (error) {
77
+ let realError = error;
78
+ if (error.cause) realError = error.cause;
79
+ ui.error(realError.message);
80
+ const argv = container.resolve(GetArgvService).execute();
81
+ if (argv.showStackTrace && realError.stack) {
82
+ ui.emptyLine();
83
+ ui.debug("Stack trace:");
84
+ ui.text(realError.stack);
85
+ }
86
+ if (error && error instanceof GracefulError) {
87
+ ui.emptyLine();
88
+ ui.text(bgYellow(bold("💡 How can I resolve this?")));
89
+ ui.text(error.message);
90
+ }
91
+ process.exit(1);
110
92
  }
111
- if (error && error instanceof GracefulError) {
112
- ui.emptyLine();
113
- ui.text(bgYellow(bold("💡 How can I resolve this?")));
114
- ui.text(error.message);
115
- }
116
- process.exit(1);
117
- }
118
-
119
- // Decorators.
120
- container.registerDecorator(commandsWithGracefulErrorHandling);
121
- container.registerDecorator(deployCommandWithTelemetry);
122
- return container;
93
+ container.registerDecorator(commandsWithGracefulErrorHandling);
94
+ container.registerDecorator(deployCommandWithTelemetry);
95
+ return container;
123
96
  };
97
+ export { createCliContainer };
124
98
 
125
99
  //# sourceMappingURL=createCliContainer.js.map