@webiny/cli-core 0.0.0-unstable.6844005670 → 0.0.0-unstable.7be00a75a9

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 (268) 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.d.ts +3 -0
  6. package/abstractions/features/CliCommand.js +2 -1
  7. package/abstractions/features/CliCommand.js.map +1 -1
  8. package/abstractions/features/ErrorHandler.js +2 -1
  9. package/abstractions/features/ErrorHandler.js.map +1 -1
  10. package/abstractions/features/GlobalCliOption.js +2 -1
  11. package/abstractions/features/GlobalCliOption.js.map +1 -1
  12. package/abstractions/features/IsCi.js +2 -1
  13. package/abstractions/features/IsCi.js.map +1 -1
  14. package/abstractions/features/index.js +0 -2
  15. package/abstractions/features/types.js +0 -3
  16. package/abstractions/index.js +0 -2
  17. package/abstractions/services/ArgvParserService.js +2 -1
  18. package/abstractions/services/ArgvParserService.js.map +1 -1
  19. package/abstractions/services/CliParamsService.js +2 -1
  20. package/abstractions/services/CliParamsService.js.map +1 -1
  21. package/abstractions/services/CommandsRegistryService.js +2 -1
  22. package/abstractions/services/CommandsRegistryService.js.map +1 -1
  23. package/abstractions/services/GetArgvService.js +2 -1
  24. package/abstractions/services/GetArgvService.js.map +1 -1
  25. package/abstractions/services/GetCliRunnerService.js +2 -1
  26. package/abstractions/services/GetCliRunnerService.js.map +1 -1
  27. package/abstractions/services/GetIsCiService.js +2 -1
  28. package/abstractions/services/GetIsCiService.js.map +1 -1
  29. package/abstractions/services/GetProjectSdkService.js +2 -1
  30. package/abstractions/services/GetProjectSdkService.js.map +1 -1
  31. package/abstractions/services/GlobalOptionsRegistryService.js +2 -1
  32. package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -1
  33. package/abstractions/services/LoggerService.js +2 -1
  34. package/abstractions/services/LoggerService.js.map +1 -1
  35. package/abstractions/services/RunCliRunnerService.js +2 -1
  36. package/abstractions/services/RunCliRunnerService.js.map +1 -1
  37. package/abstractions/services/StdioService.js +2 -1
  38. package/abstractions/services/StdioService.js.map +1 -1
  39. package/abstractions/services/UiService.js +2 -1
  40. package/abstractions/services/UiService.js.map +1 -1
  41. package/abstractions/services/index.js +0 -2
  42. package/createCliContainer.js +89 -118
  43. package/createCliContainer.js.map +1 -1
  44. package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
  45. package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
  46. package/decorators/DeployCommandWithTelemetry.js +72 -82
  47. package/decorators/DeployCommandWithTelemetry.js.map +1 -1
  48. package/decorators/index.js +0 -2
  49. package/exports/cli/command.js +0 -2
  50. package/exports/cli.d.ts +2 -0
  51. package/exports/cli.js +2 -0
  52. package/extensions/CliCommand.d.ts +3 -7
  53. package/extensions/CliCommand.js +15 -18
  54. package/extensions/CliCommand.js.map +1 -1
  55. package/extensions/CliCommandDecorator.d.ts +3 -7
  56. package/extensions/CliCommandDecorator.js +15 -18
  57. package/extensions/CliCommandDecorator.js.map +1 -1
  58. package/extensions/index.d.ts +2 -6
  59. package/extensions/index.js +5 -2
  60. package/extensions/index.js.map +1 -1
  61. package/features/AboutCommand.js +80 -86
  62. package/features/AboutCommand.js.map +1 -1
  63. package/features/BuildCommand/BuildCommand.js +46 -36
  64. package/features/BuildCommand/BuildCommand.js.map +1 -1
  65. package/features/BuildCommand/buildRunners/BaseBuildRunner.js +10 -13
  66. package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -1
  67. package/features/BuildCommand/buildRunners/BuildRunner.js +18 -21
  68. package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -1
  69. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +20 -19
  70. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -1
  71. package/features/BuildCommand/buildRunners/SingleBuildRunner.js +15 -14
  72. package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -1
  73. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +3 -4
  74. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -1
  75. package/features/BuildCommand/index.js +0 -2
  76. package/features/ConfigCommand.js +55 -56
  77. package/features/ConfigCommand.js.map +1 -1
  78. package/features/DeployCommand/DeployCommand.d.ts +1 -1
  79. package/features/DeployCommand/DeployCommand.js +164 -156
  80. package/features/DeployCommand/DeployCommand.js.map +1 -1
  81. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +12 -17
  82. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -1
  83. package/features/DeployCommand/deployOutputs/DeployOutput.js +16 -17
  84. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -1
  85. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +89 -54
  86. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -1
  87. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +24 -37
  88. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -1
  89. package/features/DeployCommand/index.js +0 -2
  90. package/features/DepsSync/BuildDependencyTree.js +16 -21
  91. package/features/DepsSync/BuildDependencyTree.js.map +1 -1
  92. package/features/DepsSync/DependencyTree.js +108 -119
  93. package/features/DepsSync/DependencyTree.js.map +1 -1
  94. package/features/DepsSync/ListAllPackageJsonFiles.js +19 -14
  95. package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -1
  96. package/features/DepsSync/ListAllPackages.js +7 -9
  97. package/features/DepsSync/ListAllPackages.js.map +1 -1
  98. package/features/DepsSync/commands/SyncDepsCommand.js +30 -24
  99. package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -1
  100. package/features/DepsSync/commands/VerifyDepsCommand.js +69 -70
  101. package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
  102. package/features/DepsSync/createDependencyTree.js +25 -18
  103. package/features/DepsSync/createDependencyTree.js.map +1 -1
  104. package/features/DepsSync/createReferenceFile.js +21 -25
  105. package/features/DepsSync/createReferenceFile.js.map +1 -1
  106. package/features/DepsSync/index.js +0 -2
  107. package/features/DepsSync/paths.js +3 -6
  108. package/features/DepsSync/paths.js.map +1 -1
  109. package/features/DepsSync/types.js +7 -6
  110. package/features/DepsSync/types.js.map +1 -1
  111. package/features/DestroyCommand/DestroyCommand.js +71 -67
  112. package/features/DestroyCommand/DestroyCommand.js.map +1 -1
  113. package/features/DestroyCommand/index.js +0 -2
  114. package/features/DisableTelemetryCommand.js +28 -25
  115. package/features/DisableTelemetryCommand.js.map +1 -1
  116. package/features/EnableTelemetryCommand.js +28 -25
  117. package/features/EnableTelemetryCommand.js.map +1 -1
  118. package/features/ExtensionCommand/ExtensionCommand.js +60 -63
  119. package/features/ExtensionCommand/ExtensionCommand.js.map +1 -1
  120. package/features/ExtensionCommand/index.js +0 -2
  121. package/features/InfoCommand/InfoCommand.js +54 -56
  122. package/features/InfoCommand/InfoCommand.js.map +1 -1
  123. package/features/InfoCommand/PrintInfoForEnv.js +31 -47
  124. package/features/InfoCommand/PrintInfoForEnv.js.map +1 -1
  125. package/features/InfoCommand/index.js +0 -2
  126. package/features/IsCi/IsCi.js +14 -11
  127. package/features/IsCi/IsCi.js.map +1 -1
  128. package/features/IsCi/index.js +1 -3
  129. package/features/OpenCommand.js +48 -47
  130. package/features/OpenCommand.js.map +1 -1
  131. package/features/OutputCommand.js +56 -69
  132. package/features/OutputCommand.js.map +1 -1
  133. package/features/PulumiCommand/PulumiCommand.js +48 -41
  134. package/features/PulumiCommand/PulumiCommand.js.map +1 -1
  135. package/features/PulumiCommand/index.js +0 -2
  136. package/features/RefreshCommand/RefreshCommand.js +42 -36
  137. package/features/RefreshCommand/RefreshCommand.js.map +1 -1
  138. package/features/RefreshCommand/index.js +0 -2
  139. package/features/UpgradeCommand/UpgradeCommand.d.ts +29 -0
  140. package/features/UpgradeCommand/UpgradeCommand.js +123 -0
  141. package/features/UpgradeCommand/UpgradeCommand.js.map +1 -0
  142. package/features/UpgradeCommand/UpgradeCommandHandler.d.ts +11 -0
  143. package/features/UpgradeCommand/UpgradeCommandHandler.js +102 -0
  144. package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -0
  145. package/features/UpgradeCommand/abstraction.d.ts +23 -0
  146. package/features/UpgradeCommand/abstraction.js +5 -0
  147. package/features/UpgradeCommand/abstraction.js.map +1 -0
  148. package/features/UpgradeCommand/feature.d.ts +4 -0
  149. package/features/UpgradeCommand/feature.js +13 -0
  150. package/features/UpgradeCommand/feature.js.map +1 -0
  151. package/features/UpgradeCommand/index.d.ts +2 -0
  152. package/features/UpgradeCommand/index.js +2 -0
  153. package/features/WatchCommand/WatchCommand.js +131 -131
  154. package/features/WatchCommand/WatchCommand.js.map +1 -1
  155. package/features/WatchCommand/createPrefixer.js +11 -15
  156. package/features/WatchCommand/createPrefixer.js.map +1 -1
  157. package/features/WatchCommand/getRandomColorForString.js +86 -8
  158. package/features/WatchCommand/getRandomColorForString.js.map +1 -1
  159. package/features/WatchCommand/index.js +0 -2
  160. package/features/Wcp/LinkProjectCommand.js +119 -138
  161. package/features/Wcp/LinkProjectCommand.js.map +1 -1
  162. package/features/Wcp/LoginCommand.js +104 -118
  163. package/features/Wcp/LoginCommand.js.map +1 -1
  164. package/features/Wcp/LogoutCommand.js +29 -23
  165. package/features/Wcp/LogoutCommand.js.map +1 -1
  166. package/features/Wcp/WhoAmICommand.js +33 -29
  167. package/features/Wcp/WhoAmICommand.js.map +1 -1
  168. package/features/common/index.js +0 -2
  169. package/features/common/options.js +41 -50
  170. package/features/common/options.js.map +1 -1
  171. package/features/globalOptions/LogLevelGlobalOption.js +25 -16
  172. package/features/globalOptions/LogLevelGlobalOption.js.map +1 -1
  173. package/features/globalOptions/ShowLogsGlobalOption.js +16 -15
  174. package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -1
  175. package/features/globalOptions/StackTraceGlobalOption.js +16 -15
  176. package/features/globalOptions/StackTraceGlobalOption.js.map +1 -1
  177. package/features/globalOptions/index.js +0 -2
  178. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +17 -16
  179. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -1
  180. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
  181. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
  182. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +19 -19
  183. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -1
  184. package/features/gracefulErrorHandlers/index.js +0 -2
  185. package/features/index.d.ts +1 -0
  186. package/features/index.js +1 -2
  187. package/features/utils/index.js +0 -2
  188. package/features/utils/measureDuration.js +7 -8
  189. package/features/utils/measureDuration.js.map +1 -1
  190. package/index.js +0 -2
  191. package/package.json +29 -24
  192. package/services/ArgvParserService/ArgvParserService.js +27 -33
  193. package/services/ArgvParserService/ArgvParserService.js.map +1 -1
  194. package/services/ArgvParserService/index.js +0 -2
  195. package/services/CliParamsService/CliParamsService.js +18 -15
  196. package/services/CliParamsService/CliParamsService.js.map +1 -1
  197. package/services/CliParamsService/index.js +0 -2
  198. package/services/CommandsRegistryService/CommandsRegistryService.js +19 -13
  199. package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -1
  200. package/services/CommandsRegistryService/index.js +0 -2
  201. package/services/GetArgvService/GetArgvService.js +14 -11
  202. package/services/GetArgvService/GetArgvService.js.map +1 -1
  203. package/services/GetArgvService/index.js +0 -2
  204. package/services/GetCliRunnerService/GetCliRunnerService.js +119 -148
  205. package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -1
  206. package/services/GetCliRunnerService/index.js +0 -2
  207. package/services/GetIsCiService/GetIsCiService.js +9 -8
  208. package/services/GetIsCiService/GetIsCiService.js.map +1 -1
  209. package/services/GetIsCiService/index.js +1 -3
  210. package/services/GetProjectSdkService/GetProjectSdkService.js +25 -24
  211. package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -1
  212. package/services/GetProjectSdkService/index.js +0 -2
  213. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -13
  214. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -1
  215. package/services/GlobalOptionsRegistryService/index.js +0 -2
  216. package/services/LoggerService/LoggerService.js +76 -88
  217. package/services/LoggerService/LoggerService.js.map +1 -1
  218. package/services/LoggerService/index.js +0 -2
  219. package/services/RunCliRunnerService/RunCliRunnerService.js +15 -13
  220. package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -1
  221. package/services/RunCliRunnerService/index.js +0 -2
  222. package/services/StdioService/StdioService.js +15 -14
  223. package/services/StdioService/StdioService.js.map +1 -1
  224. package/services/StdioService/index.js +0 -2
  225. package/services/UiService/UiService.js +55 -58
  226. package/services/UiService/UiService.js.map +1 -1
  227. package/services/UiService/index.js +0 -2
  228. package/services/index.js +0 -2
  229. package/utils/ManuallyReportedError.js +7 -6
  230. package/utils/ManuallyReportedError.js.map +1 -1
  231. package/abstractions/features/index.js.map +0 -1
  232. package/abstractions/features/types.js.map +0 -1
  233. package/abstractions/index.js.map +0 -1
  234. package/abstractions/services/index.js.map +0 -1
  235. package/decorators/index.js.map +0 -1
  236. package/exports/cli/command.js.map +0 -1
  237. package/exports/cli/index.d.ts +0 -2
  238. package/exports/cli/index.js +0 -4
  239. package/exports/cli/index.js.map +0 -1
  240. package/features/BuildCommand/index.js.map +0 -1
  241. package/features/DeployCommand/index.js.map +0 -1
  242. package/features/DepsSync/index.js.map +0 -1
  243. package/features/DestroyCommand/index.js.map +0 -1
  244. package/features/ExtensionCommand/index.js.map +0 -1
  245. package/features/InfoCommand/index.js.map +0 -1
  246. package/features/IsCi/index.js.map +0 -1
  247. package/features/PulumiCommand/index.js.map +0 -1
  248. package/features/RefreshCommand/index.js.map +0 -1
  249. package/features/WatchCommand/index.js.map +0 -1
  250. package/features/common/index.js.map +0 -1
  251. package/features/globalOptions/index.js.map +0 -1
  252. package/features/gracefulErrorHandlers/index.js.map +0 -1
  253. package/features/index.js.map +0 -1
  254. package/features/utils/index.js.map +0 -1
  255. package/index.js.map +0 -1
  256. package/services/ArgvParserService/index.js.map +0 -1
  257. package/services/CliParamsService/index.js.map +0 -1
  258. package/services/CommandsRegistryService/index.js.map +0 -1
  259. package/services/GetArgvService/index.js.map +0 -1
  260. package/services/GetCliRunnerService/index.js.map +0 -1
  261. package/services/GetIsCiService/index.js.map +0 -1
  262. package/services/GetProjectSdkService/index.js.map +0 -1
  263. package/services/GlobalOptionsRegistryService/index.js.map +0 -1
  264. package/services/LoggerService/index.js.map +0 -1
  265. package/services/RunCliRunnerService/index.js.map +0 -1
  266. package/services/StdioService/index.js.map +0 -1
  267. package/services/UiService/index.js.map +0 -1
  268. package/services/index.js.map +0 -1
@@ -1 +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":[]}
1
+ {"version":3,"file":"services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js","sources":["../../../src/services/GlobalOptionsRegistryService/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"],"names":["DefaultGlobalOptionsRegistryService","globalOptions","globalOptionsRegistryService","createImplementation","GlobalOptionsRegistryService","GlobalCliOption"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,aAA0C,CAAE;aAA5CA,aAAa,GAAbA;IAA6C;IAEjE,UAAU;QACN,OAAO,IAAI,CAAC,aAAa;IAC7B;AACJ;AAEO,MAAMC,+BAA+BC,qBAAqB;IAC7D,aAAaC;IACb,gBAAgBJ;IAChB,cAAc;QAAC;YAACK;YAAiB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACzD"}
@@ -1,3 +1 @@
1
1
  export * from "./GlobalOptionsRegistryService.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,100 +1,88 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import { GetArgvService, LoggerService } from "../../abstractions/index.js";
3
- import * as fs from "node:fs";
4
- import path from "node:path";
5
- import findUp from "find-up";
3
+ import node_path from "node:path";
4
+ import { findUpSync } from "find-up";
6
5
  import { pino } from "pino";
7
- import pinoPretty from "pino-pretty";
6
+ import pino_pretty from "pino-pretty";
7
+ import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
8
8
  const DEFAULT_LOG_LEVEL = "info";
9
- export class DefaultLoggerService {
10
- pinoLogger = null;
11
- constructor(getArgvService) {
12
- this.getArgvService = getArgvService;
13
- }
14
- trace(message, ...optionalParams) {
15
- const logger = this.getLogger();
16
- logger.trace(message, ...optionalParams);
17
- }
18
- fatal(message, ...optionalParams) {
19
- const logger = this.getLogger();
20
- logger.fatal(message, ...optionalParams);
21
- }
22
- debug(message, ...optionalParams) {
23
- const logger = this.getLogger();
24
- logger.debug(message, ...optionalParams);
25
- }
26
- info(message, ...optionalParams) {
27
- const logger = this.getLogger();
28
- logger.info(message, ...optionalParams);
29
- }
30
- warn(message, ...optionalParams) {
31
- const logger = this.getLogger();
32
- logger.warn(message, ...optionalParams);
33
- }
34
- error(message, ...optionalParams) {
35
- const logger = this.getLogger();
36
- logger.error(message, ...optionalParams);
37
- }
38
- log(message, ...optionalParams) {
39
- const logger = this.getLogger();
40
- logger.info(message, ...optionalParams);
41
- }
42
- getLogger() {
43
- if (this.pinoLogger) {
44
- return this.pinoLogger;
9
+ class DefaultLoggerService {
10
+ constructor(getArgvService){
11
+ this.getArgvService = getArgvService;
12
+ this.pinoLogger = null;
45
13
  }
46
- const logStream = this.getLogStream();
47
- const level = this.getLogLevel();
48
- this.pinoLogger = pino({
49
- level
50
- }, logStream);
51
- return this.pinoLogger;
52
- }
53
- getLogStream() {
54
- const argv = this.getArgvService.execute();
55
- if (argv.showLogs) {
56
- return pinoPretty({
57
- ignore: "pid,hostname"
58
- });
14
+ trace(message, ...optionalParams) {
15
+ const logger = this.getLogger();
16
+ logger.trace(message, ...optionalParams);
59
17
  }
60
-
61
- // Wanted to use `GetProjectSdkService` to get project root path, but
62
- // to get that, had to call async method, which is not allowed in constructor.
63
- // TODO: implement a better way to get project root path.
64
- const webinyConfigPath = findUp.sync("webiny.config.tsx");
65
- if (!webinyConfigPath) {
66
- // Should not happen, but just in case.
67
- throw new Error("Could not find project root path.");
18
+ fatal(message, ...optionalParams) {
19
+ const logger = this.getLogger();
20
+ logger.fatal(message, ...optionalParams);
68
21
  }
69
- const projectRootPath = path.dirname(webinyConfigPath);
70
- const logsFolderPath = path.join(projectRootPath, ".webiny", "logs");
71
- const logsFileName = this.getLogFileName();
72
- if (!fs.existsSync(logsFolderPath)) {
73
- fs.mkdirSync(logsFolderPath, {
74
- recursive: true
75
- });
22
+ debug(message, ...optionalParams) {
23
+ const logger = this.getLogger();
24
+ logger.debug(message, ...optionalParams);
25
+ }
26
+ info(message, ...optionalParams) {
27
+ const logger = this.getLogger();
28
+ logger.info(message, ...optionalParams);
29
+ }
30
+ warn(message, ...optionalParams) {
31
+ const logger = this.getLogger();
32
+ logger.warn(message, ...optionalParams);
33
+ }
34
+ error(message, ...optionalParams) {
35
+ const logger = this.getLogger();
36
+ logger.error(message, ...optionalParams);
37
+ }
38
+ log(message, ...optionalParams) {
39
+ const logger = this.getLogger();
40
+ logger.info(message, ...optionalParams);
41
+ }
42
+ getLogger() {
43
+ if (this.pinoLogger) return this.pinoLogger;
44
+ const logStream = this.getLogStream();
45
+ const level = this.getLogLevel();
46
+ this.pinoLogger = pino({
47
+ level
48
+ }, logStream);
49
+ return this.pinoLogger;
50
+ }
51
+ getLogStream() {
52
+ const argv = this.getArgvService.execute();
53
+ if (argv.showLogs) return pino_pretty({
54
+ ignore: "pid,hostname"
55
+ });
56
+ const webinyConfigPath = findUpSync("webiny.config.tsx");
57
+ if (!webinyConfigPath) throw new Error("Could not find project root path.");
58
+ const projectRootPath = node_path.dirname(webinyConfigPath);
59
+ const logsFolderPath = node_path.join(projectRootPath, ".webiny", "logs");
60
+ const logsFileName = this.getLogFileName();
61
+ if (!__rspack_external_node_fs_5ea92f0c.existsSync(logsFolderPath)) __rspack_external_node_fs_5ea92f0c.mkdirSync(logsFolderPath, {
62
+ recursive: true
63
+ });
64
+ const logFilePath = node_path.join(logsFolderPath, logsFileName);
65
+ return __rspack_external_node_fs_5ea92f0c.createWriteStream(logFilePath, {
66
+ flags: "a"
67
+ });
68
+ }
69
+ getLogFileName() {
70
+ const now = new Date();
71
+ const dateStr = now.toISOString().split("T")[0];
72
+ return `logs-${dateStr}.log`;
73
+ }
74
+ getLogLevel() {
75
+ const argv = this.getArgvService.execute();
76
+ return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;
76
77
  }
77
- const logFilePath = path.join(logsFolderPath, logsFileName);
78
-
79
- // Ensure the file exists or can be appended to
80
- return fs.createWriteStream(logFilePath, {
81
- flags: "a"
82
- });
83
- }
84
- getLogFileName() {
85
- const now = new Date();
86
- const dateStr = now.toISOString().split("T")[0];
87
- return `logs-${dateStr}.log`;
88
- }
89
- getLogLevel() {
90
- const argv = this.getArgvService.execute();
91
- return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;
92
- }
93
78
  }
94
- export const loggerService = createImplementation({
95
- abstraction: LoggerService,
96
- implementation: DefaultLoggerService,
97
- dependencies: [GetArgvService]
79
+ const loggerService = createImplementation({
80
+ abstraction: LoggerService,
81
+ implementation: DefaultLoggerService,
82
+ dependencies: [
83
+ GetArgvService
84
+ ]
98
85
  });
86
+ export { DefaultLoggerService, loggerService };
99
87
 
100
88
  //# sourceMappingURL=LoggerService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","GetArgvService","LoggerService","fs","path","findUp","pino","pinoPretty","DEFAULT_LOG_LEVEL","DefaultLoggerService","pinoLogger","constructor","getArgvService","trace","message","optionalParams","logger","getLogger","fatal","debug","info","warn","error","log","logStream","getLogStream","level","getLogLevel","argv","execute","showLogs","ignore","webinyConfigPath","sync","Error","projectRootPath","dirname","logsFolderPath","join","logsFileName","getLogFileName","existsSync","mkdirSync","recursive","logFilePath","createWriteStream","flags","now","Date","dateStr","toISOString","split","process","env","WEBINY_CLI_LOG_LEVEL","logLevel","loggerService","abstraction","implementation","dependencies"],"sources":["LoggerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetArgvService, LoggerService } from \"~/abstractions/index.js\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport findUp from \"find-up\";\nimport { pino, type Logger } from \"pino\";\nimport pinoPretty from \"pino-pretty\";\n\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport class DefaultLoggerService implements LoggerService.Interface {\n private pinoLogger: Logger | null = null;\n\n constructor(private readonly getArgvService: GetArgvService.Interface) {}\n\n trace(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.trace(message, ...optionalParams);\n }\n\n fatal(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.fatal(message, ...optionalParams);\n }\n\n debug(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.debug(message, ...optionalParams);\n }\n\n info(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.info(message, ...optionalParams);\n }\n\n warn(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.warn(message, ...optionalParams);\n }\n\n error(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.error(message, ...optionalParams);\n }\n\n log(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.info(message, ...optionalParams);\n }\n\n private getLogger() {\n if (this.pinoLogger) {\n return this.pinoLogger;\n }\n\n const logStream = this.getLogStream();\n const level = this.getLogLevel();\n\n this.pinoLogger = pino({ level }, logStream);\n\n return this.pinoLogger;\n }\n\n private getLogStream() {\n const argv = this.getArgvService.execute();\n if (argv.showLogs) {\n return pinoPretty({\n ignore: \"pid,hostname\"\n });\n }\n\n // Wanted to use `GetProjectSdkService` to get project root path, but\n // to get that, had to call async method, which is not allowed in constructor.\n // TODO: implement a better way to get project root path.\n const webinyConfigPath = findUp.sync(\"webiny.config.tsx\");\n if (!webinyConfigPath) {\n // Should not happen, but just in case.\n throw new Error(\"Could not find project root path.\");\n }\n\n const projectRootPath = path.dirname(webinyConfigPath!);\n\n const logsFolderPath = path.join(projectRootPath, \".webiny\", \"logs\");\n const logsFileName = this.getLogFileName();\n\n if (!fs.existsSync(logsFolderPath)) {\n fs.mkdirSync(logsFolderPath, { recursive: true });\n }\n\n const logFilePath = path.join(logsFolderPath, logsFileName);\n\n // Ensure the file exists or can be appended to\n return fs.createWriteStream(logFilePath, { flags: \"a\" });\n }\n\n private getLogFileName() {\n const now = new Date();\n const dateStr = now.toISOString().split(\"T\")[0];\n return `logs-${dateStr}.log`;\n }\n\n private getLogLevel() {\n const argv = this.getArgvService.execute();\n return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;\n }\n}\n\nexport const loggerService = createImplementation({\n abstraction: LoggerService,\n implementation: DefaultLoggerService,\n dependencies: [GetArgvService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,cAAc,EAAEC,aAAa;AACtC,OAAO,KAAKC,EAAE,MAAM,SAAS;AAC7B,OAAOC,IAAI,MAAM,WAAW;AAC5B,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAASC,IAAI,QAAqB,MAAM;AACxC,OAAOC,UAAU,MAAM,aAAa;AAEpC,MAAMC,iBAAiB,GAAG,MAAM;AAEhC,OAAO,MAAMC,oBAAoB,CAAoC;EACzDC,UAAU,GAAkB,IAAI;EAExCC,WAAWA,CAAkBC,cAAwC,EAAE;IAAA,KAA1CA,cAAwC,GAAxCA,cAAwC;EAAG;EAExEC,KAAKA,CAACC,OAAa,EAAE,GAAGC,cAAqB,EAAE;IAC3C,MAAMC,MAAM,GAAG,IAAI,C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EAAG;IACrB,MAAMO,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;IACtB,MAAMC,OAAO,GAAGF,GAAG,CAACG,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,QAAQF,OAAO,MAAM;EAChC;EAEQtB,WAAWA,CAAA,EAAG;IAClB,MAAMC,IAAI,GAAG,IAAI,CAAChB,cAAc,CAACiB,OAAO,CAAC,CAAC;IAC1C,OAAOuB,OAAO,CAACC,GAAG,CAACC,oBAAoB,IAAI1B,IAAI,CAAC2B,QAAQ,IAAI/C,iBAAiB;EACjF;AACJ;AAEA,OAAO,MAAMgD,aAAa,GAAGxD,oBAAoB,CAAC;EAC9CyD,WAAW,EAAEvD,aAAa;EAC1BwD,cAAc,EAAEjD,oBAAoB;EACpCkD,YAAY,EAAE,CAAC1D,cAAc;AACjC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/LoggerService/LoggerService.js","sources":["../../../src/services/LoggerService/LoggerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetArgvService, LoggerService } from \"~/abstractions/index.js\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport { findUpSync } from \"find-up\";\nimport { pino, type Logger } from \"pino\";\nimport pinoPretty from \"pino-pretty\";\n\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport class DefaultLoggerService implements LoggerService.Interface {\n private pinoLogger: Logger | null = null;\n\n constructor(private readonly getArgvService: GetArgvService.Interface) {}\n\n trace(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.trace(message, ...optionalParams);\n }\n\n fatal(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.fatal(message, ...optionalParams);\n }\n\n debug(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.debug(message, ...optionalParams);\n }\n\n info(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.info(message, ...optionalParams);\n }\n\n warn(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.warn(message, ...optionalParams);\n }\n\n error(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.error(message, ...optionalParams);\n }\n\n log(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.info(message, ...optionalParams);\n }\n\n private getLogger() {\n if (this.pinoLogger) {\n return this.pinoLogger;\n }\n\n const logStream = this.getLogStream();\n const level = this.getLogLevel();\n\n this.pinoLogger = pino({ level }, logStream);\n\n return this.pinoLogger;\n }\n\n private getLogStream() {\n const argv = this.getArgvService.execute();\n if (argv.showLogs) {\n return pinoPretty({\n ignore: \"pid,hostname\"\n });\n }\n\n // Wanted to use `GetProjectSdkService` to get project root path, but\n // to get that, had to call async method, which is not allowed in constructor.\n // TODO: implement a better way to get project root path.\n const webinyConfigPath = findUpSync(\"webiny.config.tsx\");\n if (!webinyConfigPath) {\n // Should not happen, but just in case.\n throw new Error(\"Could not find project root path.\");\n }\n\n const projectRootPath = path.dirname(webinyConfigPath!);\n\n const logsFolderPath = path.join(projectRootPath, \".webiny\", \"logs\");\n const logsFileName = this.getLogFileName();\n\n if (!fs.existsSync(logsFolderPath)) {\n fs.mkdirSync(logsFolderPath, { recursive: true });\n }\n\n const logFilePath = path.join(logsFolderPath, logsFileName);\n\n // Ensure the file exists or can be appended to\n return fs.createWriteStream(logFilePath, { flags: \"a\" });\n }\n\n private getLogFileName() {\n const now = new Date();\n const dateStr = now.toISOString().split(\"T\")[0];\n return `logs-${dateStr}.log`;\n }\n\n private getLogLevel() {\n const argv = this.getArgvService.execute();\n return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;\n }\n}\n\nexport const loggerService = createImplementation({\n abstraction: LoggerService,\n implementation: DefaultLoggerService,\n dependencies: [GetArgvService]\n});\n"],"names":["DEFAULT_LOG_LEVEL","DefaultLoggerService","getArgvService","message","optionalParams","logger","logStream","level","pino","argv","pinoPretty","webinyConfigPath","findUpSync","Error","projectRootPath","path","logsFolderPath","logsFileName","fs","logFilePath","now","Date","dateStr","process","loggerService","createImplementation","LoggerService","GetArgvService"],"mappings":";;;;;;;AAQA,MAAMA,oBAAoB;AAEnB,MAAMC;IAGT,YAA6BC,cAAwC,CAAE;aAA1CA,cAAc,GAAdA;aAFrB,UAAU,GAAkB;IAEoC;IAExE,MAAMC,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,MAAMD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,MAAMD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,KAAKD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC1C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,IAAI,CAACF,YAAYC;IAC5B;IAEA,KAAKD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC1C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,IAAI,CAACF,YAAYC;IAC5B;IAEA,MAAMD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,IAAID,OAAa,EAAE,GAAGC,cAAqB,EAAE;QACzC,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,IAAI,CAACF,YAAYC;IAC5B;IAEQ,YAAY;QAChB,IAAI,IAAI,CAAC,UAAU,EACf,OAAO,IAAI,CAAC,UAAU;QAG1B,MAAME,YAAY,IAAI,CAAC,YAAY;QACnC,MAAMC,QAAQ,IAAI,CAAC,WAAW;QAE9B,IAAI,CAAC,UAAU,GAAGC,KAAK;YAAED;QAAM,GAAGD;QAElC,OAAO,IAAI,CAAC,UAAU;IAC1B;IAEQ,eAAe;QACnB,MAAMG,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO;QACxC,IAAIA,KAAK,QAAQ,EACb,OAAOC,YAAW;YACd,QAAQ;QACZ;QAMJ,MAAMC,mBAAmBC,WAAW;QACpC,IAAI,CAACD,kBAED,MAAM,IAAIE,MAAM;QAGpB,MAAMC,kBAAkBC,UAAAA,OAAY,CAACJ;QAErC,MAAMK,iBAAiBD,UAAAA,IAAS,CAACD,iBAAiB,WAAW;QAC7D,MAAMG,eAAe,IAAI,CAAC,cAAc;QAExC,IAAI,CAACC,mCAAAA,UAAa,CAACF,iBACfE,mCAAAA,SAAY,CAACF,gBAAgB;YAAE,WAAW;QAAK;QAGnD,MAAMG,cAAcJ,UAAAA,IAAS,CAACC,gBAAgBC;QAG9C,OAAOC,mCAAAA,iBAAoB,CAACC,aAAa;YAAE,OAAO;QAAI;IAC1D;IAEQ,iBAAiB;QACrB,MAAMC,MAAM,IAAIC;QAChB,MAAMC,UAAUF,IAAI,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;QAC/C,OAAO,CAAC,KAAK,EAAEE,QAAQ,IAAI,CAAC;IAChC;IAEQ,cAAc;QAClB,MAAMb,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO;QACxC,OAAOc,QAAQ,GAAG,CAAC,oBAAoB,IAAId,KAAK,QAAQ,IAAIT;IAChE;AACJ;AAEO,MAAMwB,gBAAgBC,qBAAqB;IAC9C,aAAaC;IACb,gBAAgBzB;IAChB,cAAc;QAAC0B;KAAe;AAClC"}
@@ -1,3 +1 @@
1
1
  export * from "./LoggerService.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,20 +1,22 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import { GetCliRunnerService, RunCliRunnerService } from "../../abstractions/index.js";
3
3
  import { hideBin } from "yargs/helpers";
4
- export class DefaultRunCliRunnerService {
5
- constructor(getCliRunnerService) {
6
- this.getCliRunnerService = getCliRunnerService;
7
- }
8
- async execute() {
9
- const cliRunner = await this.getCliRunnerService.execute();
10
- // Use process.argv directly since it's the actual argv being used
11
- return cliRunner.parseAsync(hideBin(process.argv));
12
- }
4
+ class DefaultRunCliRunnerService {
5
+ constructor(getCliRunnerService){
6
+ this.getCliRunnerService = getCliRunnerService;
7
+ }
8
+ async execute() {
9
+ const cliRunner = await this.getCliRunnerService.execute();
10
+ return cliRunner.parseAsync(hideBin(process.argv));
11
+ }
13
12
  }
14
- export const runCliRunnerService = createImplementation({
15
- abstraction: RunCliRunnerService,
16
- implementation: DefaultRunCliRunnerService,
17
- dependencies: [GetCliRunnerService]
13
+ const runCliRunnerService = createImplementation({
14
+ abstraction: RunCliRunnerService,
15
+ implementation: DefaultRunCliRunnerService,
16
+ dependencies: [
17
+ GetCliRunnerService
18
+ ]
18
19
  });
20
+ export { DefaultRunCliRunnerService, runCliRunnerService };
19
21
 
20
22
  //# sourceMappingURL=RunCliRunnerService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","GetCliRunnerService","RunCliRunnerService","hideBin","DefaultRunCliRunnerService","constructor","getCliRunnerService","execute","cliRunner","parseAsync","process","argv","runCliRunnerService","abstraction","implementation","dependencies"],"sources":["RunCliRunnerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetCliRunnerService, RunCliRunnerService } from \"~/abstractions/index.js\";\nimport { hideBin } from \"yargs/helpers\";\nimport { Argv } from \"yargs\";\n\nexport class DefaultRunCliRunnerService implements RunCliRunnerService.Interface {\n constructor(private readonly getCliRunnerService: GetCliRunnerService.Interface) {}\n\n async execute() {\n const cliRunner = (await this.getCliRunnerService.execute()) as Argv;\n // Use process.argv directly since it's the actual argv being used\n return cliRunner.parseAsync(hideBin(process.argv));\n }\n}\n\nexport const runCliRunnerService = createImplementation({\n abstraction: RunCliRunnerService,\n implementation: DefaultRunCliRunnerService,\n dependencies: [GetCliRunnerService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,mBAAmB,EAAEC,mBAAmB;AACjD,SAASC,OAAO,QAAQ,eAAe;AAGvC,OAAO,MAAMC,0BAA0B,CAA0C;EAC7EC,WAAWA,CAAkBC,mBAAkD,EAAE;IAAA,KAApDA,mBAAkD,GAAlDA,mBAAkD;EAAG;EAElF,MAAMC,OAAOA,CAAA,EAAG;IACZ,MAAMC,SAAS,GAAI,MAAM,IAAI,CAACF,mBAAmB,CAACC,OAAO,CAAC,CAAU;IACpE;IACA,OAAOC,SAAS,CAACC,UAAU,CAACN,OAAO,CAACO,OAAO,CAACC,IAAI,CAAC,CAAC;EACtD;AACJ;AAEA,OAAO,MAAMC,mBAAmB,GAAGZ,oBAAoB,CAAC;EACpDa,WAAW,EAAEX,mBAAmB;EAChCY,cAAc,EAAEV,0BAA0B;EAC1CW,YAAY,EAAE,CAACd,mBAAmB;AACtC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/RunCliRunnerService/RunCliRunnerService.js","sources":["../../../src/services/RunCliRunnerService/RunCliRunnerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetCliRunnerService, RunCliRunnerService } from \"~/abstractions/index.js\";\nimport { hideBin } from \"yargs/helpers\";\nimport { Argv } from \"yargs\";\n\nexport class DefaultRunCliRunnerService implements RunCliRunnerService.Interface {\n constructor(private readonly getCliRunnerService: GetCliRunnerService.Interface) {}\n\n async execute() {\n const cliRunner = (await this.getCliRunnerService.execute()) as Argv;\n // Use process.argv directly since it's the actual argv being used\n return cliRunner.parseAsync(hideBin(process.argv));\n }\n}\n\nexport const runCliRunnerService = createImplementation({\n abstraction: RunCliRunnerService,\n implementation: DefaultRunCliRunnerService,\n dependencies: [GetCliRunnerService]\n});\n"],"names":["DefaultRunCliRunnerService","getCliRunnerService","cliRunner","hideBin","process","runCliRunnerService","createImplementation","RunCliRunnerService","GetCliRunnerService"],"mappings":";;;AAKO,MAAMA;IACT,YAA6BC,mBAAkD,CAAE;aAApDA,mBAAmB,GAAnBA;IAAqD;IAElF,MAAM,UAAU;QACZ,MAAMC,YAAa,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO;QAEzD,OAAOA,UAAU,UAAU,CAACC,QAAQC,QAAQ,IAAI;IACpD;AACJ;AAEO,MAAMC,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBP;IAChB,cAAc;QAACQ;KAAoB;AACvC"}
@@ -1,3 +1 @@
1
1
  export * from "./RunCliRunnerService.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,20 +1,21 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import { StdioService } from "../../abstractions/index.js";
3
- export class DefaultStdioService {
4
- getStdout() {
5
- return process.stdout;
6
- }
7
- getStderr() {
8
- return process.stderr;
9
- }
10
- getStdin() {
11
- return process.stdin;
12
- }
3
+ class DefaultStdioService {
4
+ getStdout() {
5
+ return process.stdout;
6
+ }
7
+ getStderr() {
8
+ return process.stderr;
9
+ }
10
+ getStdin() {
11
+ return process.stdin;
12
+ }
13
13
  }
14
- export const stdioService = createImplementation({
15
- abstraction: StdioService,
16
- implementation: DefaultStdioService,
17
- dependencies: []
14
+ const stdioService = createImplementation({
15
+ abstraction: StdioService,
16
+ implementation: DefaultStdioService,
17
+ dependencies: []
18
18
  });
19
+ export { DefaultStdioService, stdioService };
19
20
 
20
21
  //# sourceMappingURL=StdioService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","StdioService","DefaultStdioService","getStdout","process","stdout","getStderr","stderr","getStdin","stdin","stdioService","abstraction","implementation","dependencies"],"sources":["StdioService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { StdioService } from \"~/abstractions/index.js\";\n\nexport class DefaultStdioService implements StdioService.Interface {\n getStdout() {\n return process.stdout;\n }\n\n getStderr() {\n return process.stderr;\n }\n\n getStdin() {\n return process.stdin;\n }\n}\n\nexport const stdioService = createImplementation({\n abstraction: StdioService,\n implementation: DefaultStdioService,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,YAAY;AAErB,OAAO,MAAMC,mBAAmB,CAAmC;EAC/DC,SAASA,CAAA,EAAG;IACR,OAAOC,OAAO,CAACC,MAAM;EACzB;EAEAC,SAASA,CAAA,EAAG;IACR,OAAOF,OAAO,CAACG,MAAM;EACzB;EAEAC,QAAQA,CAAA,EAAG;IACP,OAAOJ,OAAO,CAACK,KAAK;EACxB;AACJ;AAEA,OAAO,MAAMC,YAAY,GAAGV,oBAAoB,CAAC;EAC7CW,WAAW,EAAEV,YAAY;EACzBW,cAAc,EAAEV,mBAAmB;EACnCW,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/StdioService/StdioService.js","sources":["../../../src/services/StdioService/StdioService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { StdioService } from \"~/abstractions/index.js\";\n\nexport class DefaultStdioService implements StdioService.Interface {\n getStdout() {\n return process.stdout;\n }\n\n getStderr() {\n return process.stderr;\n }\n\n getStdin() {\n return process.stdin;\n }\n}\n\nexport const stdioService = createImplementation({\n abstraction: StdioService,\n implementation: DefaultStdioService,\n dependencies: []\n});\n"],"names":["DefaultStdioService","process","stdioService","createImplementation","StdioService"],"mappings":";;AAGO,MAAMA;IACT,YAAY;QACR,OAAOC,QAAQ,MAAM;IACzB;IAEA,YAAY;QACR,OAAOA,QAAQ,MAAM;IACzB;IAEA,WAAW;QACP,OAAOA,QAAQ,KAAK;IACxB;AACJ;AAEO,MAAMC,eAAeC,qBAAqB;IAC7C,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
@@ -1,3 +1 @@
1
1
  export * from "./StdioService.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,70 +1,67 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import chalk from "chalk";
3
3
  import util from "util";
4
- import { UiService, StdioService, IsCi } from "../../abstractions/index.js";
4
+ import { IsCi, StdioService, UiService } from "../../abstractions/index.js";
5
5
  const NEW_LINE = "\n";
6
6
  const PIPE_SYMBOL = "┃";
7
7
  const LOG_COLORS = {
8
- info: chalk.blueBright,
9
- error: chalk.red,
10
- warning: chalk.yellow,
11
- success: chalk.green,
12
- debug: chalk.gray
8
+ info: chalk.blueBright,
9
+ error: chalk.red,
10
+ warning: chalk.yellow,
11
+ success: chalk.green,
12
+ debug: chalk.gray
13
13
  };
14
- export class DefaultUiService {
15
- constructor(stdio, isCi) {
16
- this.stdio = stdio;
17
- this.isCi = isCi;
18
- }
19
- raw(text) {
20
- this.stdio.getStdout().write(text);
21
- }
22
- text(text) {
23
- this.stdio.getStdout().write(text);
24
- this.stdio.getStdout().write(NEW_LINE);
25
- }
26
- textBold(text) {
27
- this.text(chalk.bold(text));
28
- }
29
- emptyLine() {
30
- this.stdio.getStdout().write(chalk.gray("∙") + NEW_LINE);
31
- }
32
-
33
- // The following methods are used to print texts with a specific type prefix.
34
- success(text, ...args) {
35
- this.typedColorizedText("success", text, ...args);
36
- }
37
- info(text, ...args) {
38
- this.typedColorizedText("info", text, ...args);
39
- }
40
- warning(text, ...args) {
41
- this.typedColorizedText("warning", text, ...args);
42
- }
43
- error(text, ...args) {
44
- this.typedColorizedText("error", text, ...args);
45
- }
46
- debug(text, ...args) {
47
- this.typedColorizedText("debug", text, ...args);
48
- }
49
- typedColorizedText(type, text, ...args) {
50
- // Use plain text format in CI environments.
51
- if (this.isCi.execute()) {
52
- const prefix = `${type}: `;
53
- return this.text(prefix + util.format(text, ...args));
14
+ class DefaultUiService {
15
+ constructor(stdio, isCi){
16
+ this.stdio = stdio;
17
+ this.isCi = isCi;
18
+ }
19
+ raw(text) {
20
+ this.stdio.getStdout().write(text);
21
+ }
22
+ text(text) {
23
+ this.stdio.getStdout().write(text);
24
+ this.stdio.getStdout().write(NEW_LINE);
25
+ }
26
+ textBold(text) {
27
+ this.text(chalk.bold(text));
28
+ }
29
+ emptyLine() {
30
+ this.stdio.getStdout().write(chalk.gray("∙") + NEW_LINE);
31
+ }
32
+ success(text, ...args) {
33
+ this.typedColorizedText("success", text, ...args);
34
+ }
35
+ info(text, ...args) {
36
+ this.typedColorizedText("info", text, ...args);
37
+ }
38
+ warning(text, ...args) {
39
+ this.typedColorizedText("warning", text, ...args);
40
+ }
41
+ error(text, ...args) {
42
+ this.typedColorizedText("error", text, ...args);
43
+ }
44
+ debug(text, ...args) {
45
+ this.typedColorizedText("debug", text, ...args);
46
+ }
47
+ typedColorizedText(type, text, ...args) {
48
+ if (this.isCi.execute()) {
49
+ const prefix = `${type}: `;
50
+ return this.text(prefix + util.format(text, ...args));
51
+ }
52
+ const prefix = `${LOG_COLORS[type](PIPE_SYMBOL)} `;
53
+ const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, (match)=>LOG_COLORS[type](match));
54
+ return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));
54
55
  }
55
- const prefix = `${LOG_COLORS[type](PIPE_SYMBOL)} `;
56
-
57
- // Replace all placeholders (match with `/%[a-zA-Z]/g` regex) with colorized values.
58
- const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, match => {
59
- return LOG_COLORS[type](match);
60
- });
61
- return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));
62
- }
63
56
  }
64
- export const uiService = createImplementation({
65
- abstraction: UiService,
66
- implementation: DefaultUiService,
67
- dependencies: [StdioService, IsCi]
57
+ const uiService = createImplementation({
58
+ abstraction: UiService,
59
+ implementation: DefaultUiService,
60
+ dependencies: [
61
+ StdioService,
62
+ IsCi
63
+ ]
68
64
  });
65
+ export { DefaultUiService, uiService };
69
66
 
70
67
  //# sourceMappingURL=UiService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","chalk","util","UiService","StdioService","IsCi","NEW_LINE","PIPE_SYMBOL","LOG_COLORS","info","blueBright","error","red","warning","yellow","success","green","debug","gray","DefaultUiService","constructor","stdio","isCi","raw","text","getStdout","write","textBold","bold","emptyLine","args","typedColorizedText","type","execute","prefix","format","textWithColorizedPlaceholders","replace","match","uiService","abstraction","implementation","dependencies"],"sources":["UiService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport chalk from \"chalk\";\nimport util from \"util\";\nimport { UiService, StdioService, IsCi } from \"~/abstractions/index.js\";\n\nconst NEW_LINE = \"\\n\";\nconst PIPE_SYMBOL = \"┃\";\n\nconst LOG_COLORS = {\n info: chalk.blueBright,\n error: chalk.red,\n warning: chalk.yellow,\n success: chalk.green,\n debug: chalk.gray\n} as const;\n\nexport class DefaultUiService implements UiService.Interface {\n constructor(\n private readonly stdio: StdioService.Interface,\n private readonly isCi: IsCi.Interface\n ) {}\n\n raw(text: string) {\n this.stdio.getStdout().write(text);\n }\n\n text(text: string) {\n this.stdio.getStdout().write(text);\n this.stdio.getStdout().write(NEW_LINE);\n }\n\n textBold(text: string) {\n this.text(chalk.bold(text));\n }\n\n emptyLine() {\n this.stdio.getStdout().write(chalk.gray(\"∙\") + NEW_LINE);\n }\n\n // The following methods are used to print texts with a specific type prefix.\n success(text: string, ...args: any[]) {\n this.typedColorizedText(\"success\", text, ...args);\n }\n\n info(text: string, ...args: any[]) {\n this.typedColorizedText(\"info\", text, ...args);\n }\n\n warning(text: string, ...args: any[]) {\n this.typedColorizedText(\"warning\", text, ...args);\n }\n\n error(text: string, ...args: any[]) {\n this.typedColorizedText(\"error\", text, ...args);\n }\n\n debug(text: string, ...args: any[]) {\n this.typedColorizedText(\"debug\", text, ...args);\n }\n\n private typedColorizedText(type: keyof typeof LOG_COLORS, text: string, ...args: any[]) {\n // Use plain text format in CI environments.\n if (this.isCi.execute()) {\n const prefix = `${type}: `;\n return this.text(prefix + util.format(text, ...args));\n }\n\n const prefix = `${LOG_COLORS[type](PIPE_SYMBOL)} `;\n\n // Replace all placeholders (match with `/%[a-zA-Z]/g` regex) with colorized values.\n const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, match => {\n return LOG_COLORS[type](match);\n });\n\n return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));\n }\n}\n\nexport const uiService = createImplementation({\n abstraction: UiService,\n implementation: DefaultUiService,\n dependencies: [StdioService, IsCi]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,SAAS,EAAEC,YAAY,EAAEC,IAAI;AAEtC,MAAMC,QAAQ,GAAG,IAAI;AACrB,MAAMC,WAAW,GAAG,GAAG;AAEvB,MAAMC,UAAU,GAAG;EACfC,IAAI,EAAER,KAAK,CAACS,UAAU;EACtBC,KAAK,EAAEV,KAAK,CAACW,GAAG;EAChBC,OAAO,EAAEZ,KAAK,CAACa,MAAM;EACrBC,OAAO,EAAEd,KAAK,CAACe,KAAK;EACpBC,KAAK,EAAEhB,KAAK,CAACiB;AACjB,CAAU;AAEV,OAAO,MAAMC,gBAAgB,CAAgC;EACzDC,WAAWA,CACUC,KAA6B,EAC7BC,IAAoB,EACvC;IAAA,KAFmBD,KAA6B,GAA7BA,KAA6B;IAAA,KAC7BC,IAAoB,GAApBA,IAAoB;EACtC;EAEHC,GAAGA,CAACC,IAAY,EAAE;IACd,IAAI,CAACH,KAAK,CAACI,SAAS,CAAC,CAAC,CAACC,KAAK,CAACF,IAAI,CAAC;EACtC;EAEAA,IAAIA,CAACA,IAAY,EAAE;IACf,IAAI,CAACH,KAAK,CAACI,SAAS,CAAC,CAAC,CAACC,KAAK,CAACF,IAAI,CAAC;IAClC,IAAI,CAACH,KAAK,CAACI,SAAS,CAAC,CAAC,CAACC,KAAK,CAACpB,QAAQ,CAAC;EAC1C;EAEAqB,QAAQA,CAACH,IAAY,EAAE;IACnB,IAAI,CAACA,IAAI,CAACv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,CAACwB,IAAI,CAAC,CAACzB,WAAW,CAAC,GAAG;;IAElD;IACA,MAAM6B,6BAA6B,GAAGZ,IAAI,CAACa,OAAO,CAAC,YAAY,EAAEC,KAAK,IAAI;MACtE,OAAO9B,UAAU,CAACwB,IAAI,CAAC,CAACM,KAAK,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO,IAAI,CAACd,IAAI,CAACU,MAAM,GAAGhC,IAAI,CAACiC,MAAM,CAACC,6BAA6B,EAAE,GAAGN,IAAI,CAAC,CAAC;EAClF;AACJ;AAEA,OAAO,MAAMS,SAAS,GAAGvC,oBAAoB,CAAC;EAC1CwC,WAAW,EAAErC,SAAS;EACtBsC,cAAc,EAAEtB,gBAAgB;EAChCuB,YAAY,EAAE,CAACtC,YAAY,EAAEC,IAAI;AACrC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/UiService/UiService.js","sources":["../../../src/services/UiService/UiService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport chalk from \"chalk\";\nimport util from \"util\";\nimport { UiService, StdioService, IsCi } from \"~/abstractions/index.js\";\n\nconst NEW_LINE = \"\\n\";\nconst PIPE_SYMBOL = \"┃\";\n\nconst LOG_COLORS = {\n info: chalk.blueBright,\n error: chalk.red,\n warning: chalk.yellow,\n success: chalk.green,\n debug: chalk.gray\n} as const;\n\nexport class DefaultUiService implements UiService.Interface {\n constructor(\n private readonly stdio: StdioService.Interface,\n private readonly isCi: IsCi.Interface\n ) {}\n\n raw(text: string) {\n this.stdio.getStdout().write(text);\n }\n\n text(text: string) {\n this.stdio.getStdout().write(text);\n this.stdio.getStdout().write(NEW_LINE);\n }\n\n textBold(text: string) {\n this.text(chalk.bold(text));\n }\n\n emptyLine() {\n this.stdio.getStdout().write(chalk.gray(\"∙\") + NEW_LINE);\n }\n\n // The following methods are used to print texts with a specific type prefix.\n success(text: string, ...args: any[]) {\n this.typedColorizedText(\"success\", text, ...args);\n }\n\n info(text: string, ...args: any[]) {\n this.typedColorizedText(\"info\", text, ...args);\n }\n\n warning(text: string, ...args: any[]) {\n this.typedColorizedText(\"warning\", text, ...args);\n }\n\n error(text: string, ...args: any[]) {\n this.typedColorizedText(\"error\", text, ...args);\n }\n\n debug(text: string, ...args: any[]) {\n this.typedColorizedText(\"debug\", text, ...args);\n }\n\n private typedColorizedText(type: keyof typeof LOG_COLORS, text: string, ...args: any[]) {\n // Use plain text format in CI environments.\n if (this.isCi.execute()) {\n const prefix = `${type}: `;\n return this.text(prefix + util.format(text, ...args));\n }\n\n const prefix = `${LOG_COLORS[type](PIPE_SYMBOL)} `;\n\n // Replace all placeholders (match with `/%[a-zA-Z]/g` regex) with colorized values.\n const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, match => {\n return LOG_COLORS[type](match);\n });\n\n return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));\n }\n}\n\nexport const uiService = createImplementation({\n abstraction: UiService,\n implementation: DefaultUiService,\n dependencies: [StdioService, IsCi]\n});\n"],"names":["NEW_LINE","PIPE_SYMBOL","LOG_COLORS","chalk","DefaultUiService","stdio","isCi","text","args","type","prefix","util","textWithColorizedPlaceholders","match","uiService","createImplementation","UiService","StdioService","IsCi"],"mappings":";;;;AAKA,MAAMA,WAAW;AACjB,MAAMC,cAAc;AAEpB,MAAMC,aAAa;IACf,MAAMC,MAAM,UAAU;IACtB,OAAOA,MAAM,GAAG;IAChB,SAASA,MAAM,MAAM;IACrB,SAASA,MAAM,KAAK;IACpB,OAAOA,MAAM,IAAI;AACrB;AAEO,MAAMC;IACT,YACqBC,KAA6B,EAC7BC,IAAoB,CACvC;aAFmBD,KAAK,GAALA;aACAC,IAAI,GAAJA;IAClB;IAEH,IAAIC,IAAY,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAACA;IACjC;IAEA,KAAKA,IAAY,EAAE;QACf,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAACA;QAC7B,IAAI,CAAC,KAAK,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cAAc;QAACa;QAAcC;KAAK;AACtC"}
@@ -1,3 +1 @@
1
1
  export * from "./UiService.js";
2
-
3
- //# sourceMappingURL=index.js.map
package/services/index.js CHANGED
@@ -10,5 +10,3 @@ export * from "./LoggerService/index.js";
10
10
  export * from "./RunCliRunnerService/index.js";
11
11
  export * from "./StdioService/index.js";
12
12
  export * from "./UiService/index.js";
13
-
14
- //# sourceMappingURL=index.js.map
@@ -1,9 +1,10 @@
1
- export class ManuallyReportedError extends Error {
2
- static from(cause) {
3
- return new ManuallyReportedError(cause.message, {
4
- cause
5
- });
6
- }
1
+ class ManuallyReportedError extends Error {
2
+ static from(cause) {
3
+ return new ManuallyReportedError(cause.message, {
4
+ cause
5
+ });
6
+ }
7
7
  }
8
+ export { ManuallyReportedError };
8
9
 
9
10
  //# sourceMappingURL=ManuallyReportedError.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ManuallyReportedError","Error","from","cause","message"],"sources":["ManuallyReportedError.ts"],"sourcesContent":["export class ManuallyReportedError extends Error {\n static from(cause: Error): ManuallyReportedError {\n return new ManuallyReportedError(cause.message, { cause });\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,SAASC,KAAK,CAAC;EAC7C,OAAOC,IAAIA,CAACC,KAAY,EAAyB;IAC7C,OAAO,IAAIH,qBAAqB,CAACG,KAAK,CAACC,OAAO,EAAE;MAAED;IAAM,CAAC,CAAC;EAC9D;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"utils/ManuallyReportedError.js","sources":["../../src/utils/ManuallyReportedError.ts"],"sourcesContent":["export class ManuallyReportedError extends Error {\n static from(cause: Error): ManuallyReportedError {\n return new ManuallyReportedError(cause.message, { cause });\n }\n}\n"],"names":["ManuallyReportedError","Error","cause"],"mappings":"AAAO,MAAMA,8BAA8BC;IACvC,OAAO,KAAKC,KAAY,EAAyB;QAC7C,OAAO,IAAIF,sBAAsBE,MAAM,OAAO,EAAE;YAAEA;QAAM;IAC5D;AACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["CliCommandFactory","ErrorHandler","GlobalCliOption","IsCi"],"sources":["index.ts"],"sourcesContent":["export { CliCommandFactory } from \"./CliCommand.js\";\nexport { ErrorHandler } from \"./ErrorHandler.js\";\nexport { GlobalCliOption } from \"./GlobalCliOption.js\";\nexport { IsCi } from \"./IsCi.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,eAAe;AACxB,SAASC,IAAI","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { AppName } from \"@webiny/project\";\n\nexport interface IBaseAppParams {\n _: string[]; // TODO: implement this in a better way (handler method probably should have this in its context/meta data)\n app: AppName;\n env: string;\n variant?: string;\n region?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./features/index.js\";\nexport * from \"./services/index.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ArgvParserService.js\";\nexport * from \"./CliParamsService.js\";\nexport * from \"./CommandsRegistryService.js\";\nexport * from \"./GetArgvService.js\";\nexport * from \"./GetCliRunnerService.js\";\nexport * from \"./GetIsCiService.js\";\nexport * from \"./GlobalOptionsRegistryService.js\";\nexport * from \"./GetProjectSdkService.js\";\nexport * from \"./LoggerService.js\";\nexport * from \"./RunCliRunnerService.js\";\nexport * from \"./StdioService.js\";\nexport * from \"./UiService.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CommandsWithGracefulErrorHandling.js\";\nexport * from \"./DeployCommandWithTelemetry.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["CliCommandFactory"],"sources":["command.ts"],"sourcesContent":["export { CliCommandFactory } from \"~/abstractions/features/CliCommand.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export { LoggerService as Logger } from "../../abstractions/services/LoggerService.js";
2
- export { UiService as Ui } from "../../abstractions/services/UiService.js";
@@ -1,4 +0,0 @@
1
- export { LoggerService as Logger } from "../../abstractions/services/LoggerService.js";
2
- export { UiService as Ui } from "../../abstractions/services/UiService.js";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["LoggerService","Logger","UiService","Ui"],"sources":["index.ts"],"sourcesContent":["export { LoggerService as Logger } from \"~/abstractions/services/LoggerService.js\";\nexport { UiService as Ui } from \"~/abstractions/services/UiService.js\";\n"],"mappings":"AAAA,SAASA,aAAa,IAAIC,MAAM;AAChC,SAASC,SAAS,IAAIC,EAAE","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./BuildCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DeployCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./commands/SyncDepsCommand.js\";\nexport * from \"./commands/VerifyDepsCommand.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DestroyCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ExtensionCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./InfoCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["isCi","DefaultIsCi"],"sources":["index.ts"],"sourcesContent":["export { isCi, DefaultIsCi } from \"./IsCi.js\";\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,WAAW","ignoreList":[]}