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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/Cli.d.ts +7 -0
  2. package/Cli.js +16 -0
  3. package/Cli.js.map +1 -0
  4. package/LICENSE +21 -0
  5. package/README.md +11 -0
  6. package/abstractions/createAbstraction.d.ts +2 -0
  7. package/abstractions/createAbstraction.js +6 -0
  8. package/abstractions/createAbstraction.js.map +1 -0
  9. package/abstractions/features/CliCommand.d.ts +37 -0
  10. package/abstractions/features/CliCommand.js +4 -0
  11. package/abstractions/features/CliCommand.js.map +1 -0
  12. package/abstractions/features/ErrorHandler.d.ts +15 -0
  13. package/abstractions/features/ErrorHandler.js +4 -0
  14. package/abstractions/features/ErrorHandler.js.map +1 -0
  15. package/abstractions/features/GlobalCliOption.d.ts +20 -0
  16. package/abstractions/features/GlobalCliOption.js +4 -0
  17. package/abstractions/features/GlobalCliOption.js.map +1 -0
  18. package/abstractions/features/IsCi.d.ts +8 -0
  19. package/abstractions/features/IsCi.js +4 -0
  20. package/abstractions/features/IsCi.js.map +1 -0
  21. package/abstractions/features/index.d.ts +4 -0
  22. package/abstractions/features/index.js +6 -0
  23. package/abstractions/features/index.js.map +1 -0
  24. package/abstractions/features/types.d.ts +8 -0
  25. package/abstractions/features/types.js +3 -0
  26. package/abstractions/features/types.js.map +1 -0
  27. package/abstractions/index.d.ts +2 -0
  28. package/abstractions/index.js +4 -0
  29. package/abstractions/index.js.map +1 -0
  30. package/abstractions/services/ArgvParserService.d.ts +7 -0
  31. package/abstractions/services/ArgvParserService.js +4 -0
  32. package/abstractions/services/ArgvParserService.js.map +1 -0
  33. package/abstractions/services/CliParamsService.d.ts +15 -0
  34. package/abstractions/services/CliParamsService.js +4 -0
  35. package/abstractions/services/CliParamsService.js.map +1 -0
  36. package/abstractions/services/CommandsRegistryService.d.ts +8 -0
  37. package/abstractions/services/CommandsRegistryService.js +4 -0
  38. package/abstractions/services/CommandsRegistryService.js.map +1 -0
  39. package/abstractions/services/GetArgvService.d.ts +7 -0
  40. package/abstractions/services/GetArgvService.js +4 -0
  41. package/abstractions/services/GetArgvService.js.map +1 -0
  42. package/abstractions/services/GetCliRunnerService.d.ts +7 -0
  43. package/abstractions/services/GetCliRunnerService.js +4 -0
  44. package/abstractions/services/GetCliRunnerService.js.map +1 -0
  45. package/abstractions/services/GetIsCiService.d.ts +8 -0
  46. package/abstractions/services/GetIsCiService.js +4 -0
  47. package/abstractions/services/GetIsCiService.js.map +1 -0
  48. package/abstractions/services/GetProjectSdkService.d.ts +8 -0
  49. package/abstractions/services/GetProjectSdkService.js +4 -0
  50. package/abstractions/services/GetProjectSdkService.js.map +1 -0
  51. package/abstractions/services/GlobalOptionsRegistryService.d.ts +8 -0
  52. package/abstractions/services/GlobalOptionsRegistryService.js +4 -0
  53. package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -0
  54. package/abstractions/services/LoggerService.d.ts +13 -0
  55. package/abstractions/services/LoggerService.js +4 -0
  56. package/abstractions/services/LoggerService.js.map +1 -0
  57. package/abstractions/services/RunCliRunnerService.d.ts +7 -0
  58. package/abstractions/services/RunCliRunnerService.js +4 -0
  59. package/abstractions/services/RunCliRunnerService.js.map +1 -0
  60. package/abstractions/services/StdioService.d.ts +9 -0
  61. package/abstractions/services/StdioService.js +4 -0
  62. package/abstractions/services/StdioService.js.map +1 -0
  63. package/abstractions/services/UiService.d.ts +15 -0
  64. package/abstractions/services/UiService.js +4 -0
  65. package/abstractions/services/UiService.js.map +1 -0
  66. package/abstractions/services/index.d.ts +12 -0
  67. package/abstractions/services/index.js +14 -0
  68. package/abstractions/services/index.js.map +1 -0
  69. package/createCliContainer.d.ts +3 -0
  70. package/createCliContainer.js +128 -0
  71. package/createCliContainer.js.map +1 -0
  72. package/decorators/CommandsWithGracefulErrorHandling.d.ts +10 -0
  73. package/decorators/CommandsWithGracefulErrorHandling.js +38 -0
  74. package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -0
  75. package/decorators/DeployCommandWithTelemetry.d.ts +11 -0
  76. package/decorators/DeployCommandWithTelemetry.js +91 -0
  77. package/decorators/DeployCommandWithTelemetry.js.map +1 -0
  78. package/decorators/index.d.ts +2 -0
  79. package/decorators/index.js +4 -0
  80. package/decorators/index.js.map +1 -0
  81. package/exports/cli/command.d.ts +1 -0
  82. package/exports/cli/command.js +3 -0
  83. package/exports/cli/command.js.map +1 -0
  84. package/exports/cli/index.d.ts +2 -0
  85. package/exports/cli/index.js +4 -0
  86. package/exports/cli/index.js.map +1 -0
  87. package/extensions/CliCommand.d.ts +8 -0
  88. package/extensions/CliCommand.js +23 -0
  89. package/extensions/CliCommand.js.map +1 -0
  90. package/extensions/CliCommandDecorator.d.ts +8 -0
  91. package/extensions/CliCommandDecorator.js +23 -0
  92. package/extensions/CliCommandDecorator.js.map +1 -0
  93. package/extensions/index.d.ts +9 -0
  94. package/extensions/index.js +6 -0
  95. package/extensions/index.js.map +1 -0
  96. package/features/AboutCommand.d.ts +12 -0
  97. package/features/AboutCommand.js +94 -0
  98. package/features/AboutCommand.js.map +1 -0
  99. package/features/BuildCommand/BuildCommand.d.ts +11 -0
  100. package/features/BuildCommand/BuildCommand.js +44 -0
  101. package/features/BuildCommand/BuildCommand.js.map +1 -0
  102. package/features/BuildCommand/buildRunners/BaseBuildRunner.d.ts +14 -0
  103. package/features/BuildCommand/buildRunners/BaseBuildRunner.js +16 -0
  104. package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -0
  105. package/features/BuildCommand/buildRunners/BuildRunner.d.ts +6 -0
  106. package/features/BuildCommand/buildRunners/BuildRunner.js +30 -0
  107. package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -0
  108. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.d.ts +4 -0
  109. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +25 -0
  110. package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -0
  111. package/features/BuildCommand/buildRunners/SingleBuildRunner.d.ts +4 -0
  112. package/features/BuildCommand/buildRunners/SingleBuildRunner.js +19 -0
  113. package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -0
  114. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.d.ts +4 -0
  115. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +8 -0
  116. package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -0
  117. package/features/BuildCommand/index.d.ts +1 -0
  118. package/features/BuildCommand/index.js +3 -0
  119. package/features/BuildCommand/index.js.map +1 -0
  120. package/features/ConfigCommand.d.ts +16 -0
  121. package/features/ConfigCommand.js +64 -0
  122. package/features/ConfigCommand.js.map +1 -0
  123. package/features/DeployCommand/DeployCommand.d.ts +30 -0
  124. package/features/DeployCommand/DeployCommand.js +168 -0
  125. package/features/DeployCommand/DeployCommand.js.map +1 -0
  126. package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +20 -0
  127. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +20 -0
  128. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -0
  129. package/features/DeployCommand/deployOutputs/DeployOutput.d.ts +5 -0
  130. package/features/DeployCommand/deployOutputs/DeployOutput.js +24 -0
  131. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -0
  132. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.d.ts +4 -0
  133. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +61 -0
  134. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -0
  135. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.d.ts +4 -0
  136. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +44 -0
  137. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -0
  138. package/features/DeployCommand/index.d.ts +1 -0
  139. package/features/DeployCommand/index.js +3 -0
  140. package/features/DeployCommand/index.js.map +1 -0
  141. package/features/DepsSync/BuildDependencyTree.d.ts +9 -0
  142. package/features/DepsSync/BuildDependencyTree.js +27 -0
  143. package/features/DepsSync/BuildDependencyTree.js.map +1 -0
  144. package/features/DepsSync/DependencyTree.d.ts +12 -0
  145. package/features/DepsSync/DependencyTree.js +131 -0
  146. package/features/DepsSync/DependencyTree.js.map +1 -0
  147. package/features/DepsSync/ListAllPackageJsonFiles.d.ts +7 -0
  148. package/features/DepsSync/ListAllPackageJsonFiles.js +18 -0
  149. package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -0
  150. package/features/DepsSync/ListAllPackages.d.ts +3 -0
  151. package/features/DepsSync/ListAllPackages.js +13 -0
  152. package/features/DepsSync/ListAllPackages.js.map +1 -0
  153. package/features/DepsSync/commands/SyncDepsCommand.d.ts +13 -0
  154. package/features/DepsSync/commands/SyncDepsCommand.js +32 -0
  155. package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -0
  156. package/features/DepsSync/commands/VerifyDepsCommand.d.ts +13 -0
  157. package/features/DepsSync/commands/VerifyDepsCommand.js +81 -0
  158. package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -0
  159. package/features/DepsSync/createDependencyTree.d.ts +3 -0
  160. package/features/DepsSync/createDependencyTree.js +24 -0
  161. package/features/DepsSync/createDependencyTree.js.map +1 -0
  162. package/features/DepsSync/createReferenceFile.d.ts +7 -0
  163. package/features/DepsSync/createReferenceFile.js +30 -0
  164. package/features/DepsSync/createReferenceFile.js.map +1 -0
  165. package/features/DepsSync/index.d.ts +2 -0
  166. package/features/DepsSync/index.js +4 -0
  167. package/features/DepsSync/index.js.map +1 -0
  168. package/features/DepsSync/paths.d.ts +3 -0
  169. package/features/DepsSync/paths.js +8 -0
  170. package/features/DepsSync/paths.js.map +1 -0
  171. package/features/DepsSync/types.d.ts +45 -0
  172. package/features/DepsSync/types.js +9 -0
  173. package/features/DepsSync/types.js.map +1 -0
  174. package/features/DestroyCommand/DestroyCommand.d.ts +22 -0
  175. package/features/DestroyCommand/DestroyCommand.js +78 -0
  176. package/features/DestroyCommand/DestroyCommand.js.map +1 -0
  177. package/features/DestroyCommand/index.d.ts +1 -0
  178. package/features/DestroyCommand/index.js +3 -0
  179. package/features/DestroyCommand/index.js.map +1 -0
  180. package/features/DisableTelemetryCommand.d.ts +11 -0
  181. package/features/DisableTelemetryCommand.js +31 -0
  182. package/features/DisableTelemetryCommand.js.map +1 -0
  183. package/features/EnableTelemetryCommand.d.ts +11 -0
  184. package/features/EnableTelemetryCommand.js +31 -0
  185. package/features/EnableTelemetryCommand.js.map +1 -0
  186. package/features/ExtensionCommand/ExtensionCommand.d.ts +12 -0
  187. package/features/ExtensionCommand/ExtensionCommand.js +71 -0
  188. package/features/ExtensionCommand/ExtensionCommand.js.map +1 -0
  189. package/features/ExtensionCommand/index.d.ts +1 -0
  190. package/features/ExtensionCommand/index.js +3 -0
  191. package/features/ExtensionCommand/index.js.map +1 -0
  192. package/features/InfoCommand/InfoCommand.d.ts +10 -0
  193. package/features/InfoCommand/InfoCommand.js +64 -0
  194. package/features/InfoCommand/InfoCommand.js.map +1 -0
  195. package/features/InfoCommand/PrintInfoForEnv.d.ts +14 -0
  196. package/features/InfoCommand/PrintInfoForEnv.js +48 -0
  197. package/features/InfoCommand/PrintInfoForEnv.js.map +1 -0
  198. package/features/InfoCommand/index.d.ts +1 -0
  199. package/features/InfoCommand/index.js +3 -0
  200. package/features/InfoCommand/index.js.map +1 -0
  201. package/features/IsCi/IsCi.d.ts +7 -0
  202. package/features/IsCi/IsCi.js +17 -0
  203. package/features/IsCi/IsCi.js.map +1 -0
  204. package/features/IsCi/index.d.ts +1 -0
  205. package/features/IsCi/index.js +3 -0
  206. package/features/IsCi/index.js.map +1 -0
  207. package/features/OpenCommand.d.ts +10 -0
  208. package/features/OpenCommand.js +54 -0
  209. package/features/OpenCommand.js.map +1 -0
  210. package/features/OutputCommand.d.ts +12 -0
  211. package/features/OutputCommand.js +79 -0
  212. package/features/OutputCommand.js.map +1 -0
  213. package/features/PulumiCommand/PulumiCommand.d.ts +13 -0
  214. package/features/PulumiCommand/PulumiCommand.js +50 -0
  215. package/features/PulumiCommand/PulumiCommand.js.map +1 -0
  216. package/features/PulumiCommand/index.d.ts +1 -0
  217. package/features/PulumiCommand/index.js +3 -0
  218. package/features/PulumiCommand/index.js.map +1 -0
  219. package/features/RefreshCommand/RefreshCommand.d.ts +12 -0
  220. package/features/RefreshCommand/RefreshCommand.js +45 -0
  221. package/features/RefreshCommand/RefreshCommand.js.map +1 -0
  222. package/features/RefreshCommand/index.d.ts +1 -0
  223. package/features/RefreshCommand/index.js +3 -0
  224. package/features/RefreshCommand/index.js.map +1 -0
  225. package/features/WatchCommand/WatchCommand.d.ts +11 -0
  226. package/features/WatchCommand/WatchCommand.js +143 -0
  227. package/features/WatchCommand/WatchCommand.js.map +1 -0
  228. package/features/WatchCommand/createPrefixer.d.ts +2 -0
  229. package/features/WatchCommand/createPrefixer.js +20 -0
  230. package/features/WatchCommand/createPrefixer.js.map +1 -0
  231. package/features/WatchCommand/getRandomColorForString.d.ts +1 -0
  232. package/features/WatchCommand/getRandomColorForString.js +11 -0
  233. package/features/WatchCommand/getRandomColorForString.js.map +1 -0
  234. package/features/WatchCommand/index.d.ts +1 -0
  235. package/features/WatchCommand/index.js +3 -0
  236. package/features/WatchCommand/index.js.map +1 -0
  237. package/features/Wcp/LinkProjectCommand.d.ts +13 -0
  238. package/features/Wcp/LinkProjectCommand.js +146 -0
  239. package/features/Wcp/LinkProjectCommand.js.map +1 -0
  240. package/features/Wcp/LoginCommand.d.ts +13 -0
  241. package/features/Wcp/LoginCommand.js +126 -0
  242. package/features/Wcp/LoginCommand.js.map +1 -0
  243. package/features/Wcp/LogoutCommand.d.ts +13 -0
  244. package/features/Wcp/LogoutCommand.js +29 -0
  245. package/features/Wcp/LogoutCommand.js.map +1 -0
  246. package/features/Wcp/WhoAmICommand.d.ts +15 -0
  247. package/features/Wcp/WhoAmICommand.js +34 -0
  248. package/features/Wcp/WhoAmICommand.js.map +1 -0
  249. package/features/common/index.d.ts +1 -0
  250. package/features/common/index.js +3 -0
  251. package/features/common/index.js.map +1 -0
  252. package/features/common/options.d.ts +20 -0
  253. package/features/common/options.js +52 -0
  254. package/features/common/options.js.map +1 -0
  255. package/features/globalOptions/LogLevelGlobalOption.d.ts +5 -0
  256. package/features/globalOptions/LogLevelGlobalOption.js +22 -0
  257. package/features/globalOptions/LogLevelGlobalOption.js.map +1 -0
  258. package/features/globalOptions/ShowLogsGlobalOption.d.ts +5 -0
  259. package/features/globalOptions/ShowLogsGlobalOption.js +21 -0
  260. package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -0
  261. package/features/globalOptions/StackTraceGlobalOption.d.ts +5 -0
  262. package/features/globalOptions/StackTraceGlobalOption.js +21 -0
  263. package/features/globalOptions/StackTraceGlobalOption.js.map +1 -0
  264. package/features/globalOptions/index.d.ts +3 -0
  265. package/features/globalOptions/index.js +5 -0
  266. package/features/globalOptions/index.js.map +1 -0
  267. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +6 -0
  268. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +26 -0
  269. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -0
  270. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.d.ts +6 -0
  271. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +27 -0
  272. package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -0
  273. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.d.ts +6 -0
  274. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +29 -0
  275. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -0
  276. package/features/gracefulErrorHandlers/index.d.ts +3 -0
  277. package/features/gracefulErrorHandlers/index.js +5 -0
  278. package/features/gracefulErrorHandlers/index.js.map +1 -0
  279. package/features/index.d.ts +22 -0
  280. package/features/index.js +24 -0
  281. package/features/index.js.map +1 -0
  282. package/features/utils/index.d.ts +1 -0
  283. package/features/utils/index.js +3 -0
  284. package/features/utils/index.js.map +1 -0
  285. package/features/utils/measureDuration.d.ts +1 -0
  286. package/features/utils/measureDuration.js +11 -0
  287. package/features/utils/measureDuration.js.map +1 -0
  288. package/index.d.ts +1 -0
  289. package/index.js +3 -0
  290. package/index.js.map +1 -0
  291. package/package.json +48 -0
  292. package/services/ArgvParserService/ArgvParserService.d.ts +7 -0
  293. package/services/ArgvParserService/ArgvParserService.js +41 -0
  294. package/services/ArgvParserService/ArgvParserService.js.map +1 -0
  295. package/services/ArgvParserService/index.d.ts +1 -0
  296. package/services/ArgvParserService/index.js +3 -0
  297. package/services/ArgvParserService/index.js.map +1 -0
  298. package/services/CliParamsService/CliParamsService.d.ts +7 -0
  299. package/services/CliParamsService/CliParamsService.js +21 -0
  300. package/services/CliParamsService/CliParamsService.js.map +1 -0
  301. package/services/CliParamsService/index.d.ts +1 -0
  302. package/services/CliParamsService/index.js +3 -0
  303. package/services/CliParamsService/index.js.map +1 -0
  304. package/services/CommandsRegistryService/CommandsRegistryService.d.ts +7 -0
  305. package/services/CommandsRegistryService/CommandsRegistryService.js +19 -0
  306. package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -0
  307. package/services/CommandsRegistryService/index.d.ts +1 -0
  308. package/services/CommandsRegistryService/index.js +3 -0
  309. package/services/CommandsRegistryService/index.js.map +1 -0
  310. package/services/GetArgvService/GetArgvService.d.ts +7 -0
  311. package/services/GetArgvService/GetArgvService.js +17 -0
  312. package/services/GetArgvService/GetArgvService.js.map +1 -0
  313. package/services/GetArgvService/index.d.ts +1 -0
  314. package/services/GetArgvService/index.js +3 -0
  315. package/services/GetArgvService/index.js.map +1 -0
  316. package/services/GetCliRunnerService/GetCliRunnerService.d.ts +13 -0
  317. package/services/GetCliRunnerService/GetCliRunnerService.js +160 -0
  318. package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -0
  319. package/services/GetCliRunnerService/index.d.ts +1 -0
  320. package/services/GetCliRunnerService/index.js +3 -0
  321. package/services/GetCliRunnerService/index.js.map +1 -0
  322. package/services/GetIsCiService/GetIsCiService.d.ts +5 -0
  323. package/services/GetIsCiService/GetIsCiService.js +15 -0
  324. package/services/GetIsCiService/GetIsCiService.js.map +1 -0
  325. package/services/GetIsCiService/index.d.ts +1 -0
  326. package/services/GetIsCiService/index.js +3 -0
  327. package/services/GetIsCiService/index.js.map +1 -0
  328. package/services/GetProjectSdkService/GetProjectSdkService.d.ts +9 -0
  329. package/services/GetProjectSdkService/GetProjectSdkService.js +31 -0
  330. package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -0
  331. package/services/GetProjectSdkService/index.d.ts +1 -0
  332. package/services/GetProjectSdkService/index.js +3 -0
  333. package/services/GetProjectSdkService/index.js.map +1 -0
  334. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.d.ts +7 -0
  335. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -0
  336. package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -0
  337. package/services/GlobalOptionsRegistryService/index.d.ts +1 -0
  338. package/services/GlobalOptionsRegistryService/index.js +3 -0
  339. package/services/GlobalOptionsRegistryService/index.js.map +1 -0
  340. package/services/LoggerService/LoggerService.d.ts +18 -0
  341. package/services/LoggerService/LoggerService.js +100 -0
  342. package/services/LoggerService/LoggerService.js.map +1 -0
  343. package/services/LoggerService/index.d.ts +1 -0
  344. package/services/LoggerService/index.js +3 -0
  345. package/services/LoggerService/index.js.map +1 -0
  346. package/services/RunCliRunnerService/RunCliRunnerService.d.ts +11 -0
  347. package/services/RunCliRunnerService/RunCliRunnerService.js +20 -0
  348. package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -0
  349. package/services/RunCliRunnerService/index.d.ts +1 -0
  350. package/services/RunCliRunnerService/index.js +3 -0
  351. package/services/RunCliRunnerService/index.js.map +1 -0
  352. package/services/StdioService/StdioService.d.ts +13 -0
  353. package/services/StdioService/StdioService.js +20 -0
  354. package/services/StdioService/StdioService.js.map +1 -0
  355. package/services/StdioService/index.d.ts +1 -0
  356. package/services/StdioService/index.js +3 -0
  357. package/services/StdioService/index.js.map +1 -0
  358. package/services/UiService/UiService.d.ts +17 -0
  359. package/services/UiService/UiService.js +70 -0
  360. package/services/UiService/UiService.js.map +1 -0
  361. package/services/UiService/index.d.ts +1 -0
  362. package/services/UiService/index.js +3 -0
  363. package/services/UiService/index.js.map +1 -0
  364. package/services/index.d.ts +12 -0
  365. package/services/index.js +14 -0
  366. package/services/index.js.map +1 -0
  367. package/utils/ManuallyReportedError.d.ts +3 -0
  368. package/utils/ManuallyReportedError.js +9 -0
  369. package/utils/ManuallyReportedError.js.map +1 -0
@@ -0,0 +1,24 @@
1
+ import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
+ import { NoDeploymentLogsDeployOutput } from "./NoDeploymentLogsDeployOutput.js";
3
+ import { WithDeploymentLogsDeployOutput } from "./WithDeploymentLogsDeployOutput.js";
4
+ export class DeployOutput extends BaseDeployOutput {
5
+ async output() {
6
+ const OutputClass = this.getOutputClass();
7
+ const output = new OutputClass({
8
+ deployProcess: this.deployProcess,
9
+ stdio: this.stdio,
10
+ ui: this.ui,
11
+ showDeploymentLogs: this.showDeploymentLogs,
12
+ deployParams: this.deployParams
13
+ });
14
+ return output.output();
15
+ }
16
+ getOutputClass() {
17
+ if (this.showDeploymentLogs) {
18
+ return WithDeploymentLogsDeployOutput;
19
+ }
20
+ return NoDeploymentLogsDeployOutput;
21
+ }
22
+ }
23
+
24
+ //# sourceMappingURL=DeployOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BaseDeployOutput","NoDeploymentLogsDeployOutput","WithDeploymentLogsDeployOutput","DeployOutput","output","OutputClass","getOutputClass","deployProcess","stdio","ui","showDeploymentLogs","deployParams"],"sources":["DeployOutput.ts"],"sourcesContent":["import { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport { NoDeploymentLogsDeployOutput } from \"./NoDeploymentLogsDeployOutput.js\";\nimport { WithDeploymentLogsDeployOutput } from \"./WithDeploymentLogsDeployOutput.js\";\n\nexport class DeployOutput extends BaseDeployOutput {\n public override async output() {\n const OutputClass = this.getOutputClass();\n\n const output = new OutputClass({\n deployProcess: this.deployProcess,\n stdio: this.stdio,\n ui: this.ui,\n showDeploymentLogs: this.showDeploymentLogs,\n deployParams: this.deployParams\n });\n\n return output.output();\n }\n\n private getOutputClass() {\n if (this.showDeploymentLogs) {\n return WithDeploymentLogsDeployOutput;\n }\n\n return NoDeploymentLogsDeployOutput;\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB;AACzB,SAASC,4BAA4B;AACrC,SAASC,8BAA8B;AAEvC,OAAO,MAAMC,YAAY,SAASH,gBAAgB,CAAC;EAC/C,MAAsBI,MAAMA,CAAA,EAAG;IAC3B,MAAMC,WAAW,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;IAEzC,MAAMF,MAAM,GAAG,IAAIC,WAAW,CAAC;MAC3BE,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,EAAE,EAAE,IAAI,CAACA,EAAE;MACXC,kBAAkB,EAAE,IAAI,CAACA,kBAAkB;MAC3CC,YAAY,EAAE,IAAI,CAACA;IACvB,CAAC,CAAC;IAEF,OAAOP,MAAM,CAACA,MAAM,CAAC,CAAC;EAC1B;EAEQE,cAAcA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACI,kBAAkB,EAAE;MACzB,OAAOR,8BAA8B;IACzC;IAEA,OAAOD,4BAA4B;EACvC;AACJ","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
+ export declare class NoDeploymentLogsDeployOutput extends BaseDeployOutput {
3
+ output(): Promise<void>;
4
+ }
@@ -0,0 +1,61 @@
1
+ import { measureDuration } from "../../utils/index.js";
2
+ import { BaseDeployOutput } from "./BaseDeployOutput.js";
3
+ import ora from "ora";
4
+ const SPINNER_MESSAGES = [[60, "Still deploying..."], [120, "Still deploying, please wait..."], [180, "Some resources take some time to become ready, please wait..."], [270, "Still deploying, please don't interrupt..."], [360, "Still deploying, please be patient..."], [450, "Still deploying, please don't interrupt..."], [540, "Still deploying, please be patient..."], [600, "Deploying for 10 minutes now, probably a couple more to go..."], [720, "Still deploying, shouldn't be much longer now..."], [840, "Looks like it's taking a bit longer than usual, please wait..."], [900, "Deploying for 15 minutes now, hopefully it's almost done..."], [1200, "Deploying for 20 minutes now, hopefully it's almost done..."]];
5
+ export class NoDeploymentLogsDeployOutput extends BaseDeployOutput {
6
+ async output() {
7
+ const deployProcess = this.deployProcess;
8
+ const ui = this.ui;
9
+ const params = this.deployParams;
10
+ const isPreview = !!params.preview;
11
+ const getDeploymentDuration = measureDuration();
12
+ const spinner = ora(isPreview ? "Previewing deployment..." : "Deploying...");
13
+
14
+ // When showing spinner, we want to show a few messages to the user.
15
+ // The deployment process can take in some cases 10-15 minutes, so we want to
16
+ // give the user some feedback.
17
+ const spinnerMessagesTimeouts = SPINNER_MESSAGES.map(([seconds, message]) => {
18
+ return setTimeout(() => {
19
+ spinner.text = message;
20
+ }, seconds * 1000);
21
+ });
22
+
23
+ // Every second, let's add a dot to the end of the message.
24
+ // Once we reach three dots, we start over.
25
+ const threeDotsInterval = setInterval(() => {
26
+ const spinnerText = spinner.text;
27
+ if (spinnerText.endsWith("...")) {
28
+ spinner.text = spinnerText.substring(0, spinnerText.length - 3);
29
+ } else {
30
+ spinner.text = spinnerText + ".";
31
+ }
32
+ }, 1000);
33
+ try {
34
+ spinner.start();
35
+ await deployProcess;
36
+ if (isPreview) {
37
+ spinner.succeed(`Preview completed in ${getDeploymentDuration()}.`);
38
+ } else {
39
+ spinner.succeed(`Deployed in ${getDeploymentDuration()}.`);
40
+ }
41
+ } catch (e) {
42
+ if (isPreview) {
43
+ spinner.fail("Preview failed.");
44
+ ui.emptyLine();
45
+ ui.text(e.message);
46
+ ui.error("Preview failed, please check the details above.");
47
+ } else {
48
+ spinner.fail("Deployment failed.");
49
+ ui.emptyLine();
50
+ ui.text(e.message);
51
+ ui.error("Deployment failed, please check the details above.");
52
+ }
53
+ throw e;
54
+ } finally {
55
+ spinnerMessagesTimeouts.forEach(clearTimeout);
56
+ clearInterval(threeDotsInterval);
57
+ }
58
+ }
59
+ }
60
+
61
+ //# sourceMappingURL=NoDeploymentLogsDeployOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["measureDuration","BaseDeployOutput","ora","SPINNER_MESSAGES","NoDeploymentLogsDeployOutput","output","deployProcess","ui","params","deployParams","isPreview","preview","getDeploymentDuration","spinner","spinnerMessagesTimeouts","map","seconds","message","setTimeout","text","threeDotsInterval","setInterval","spinnerText","endsWith","substring","length","start","succeed","e","fail","emptyLine","error","forEach","clearTimeout","clearInterval"],"sources":["NoDeploymentLogsDeployOutput.ts"],"sourcesContent":["import { measureDuration } from \"~/features/utils/index.js\";\nimport { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport ora from \"ora\";\n\nconst SPINNER_MESSAGES: [number, string][] = [\n [60, \"Still deploying...\"],\n [120, \"Still deploying, please wait...\"],\n [180, \"Some resources take some time to become ready, please wait...\"],\n\n [270, \"Still deploying, please don't interrupt...\"],\n [360, \"Still deploying, please be patient...\"],\n [450, \"Still deploying, please don't interrupt...\"],\n [540, \"Still deploying, please be patient...\"],\n\n [600, \"Deploying for 10 minutes now, probably a couple more to go...\"],\n [720, \"Still deploying, shouldn't be much longer now...\"],\n\n [840, \"Looks like it's taking a bit longer than usual, please wait...\"],\n [900, \"Deploying for 15 minutes now, hopefully it's almost done...\"],\n\n [1200, \"Deploying for 20 minutes now, hopefully it's almost done...\"]\n];\n\nexport class NoDeploymentLogsDeployOutput extends BaseDeployOutput {\n public override async output() {\n const deployProcess = this.deployProcess;\n const ui = this.ui;\n const params = this.deployParams;\n\n const isPreview = !!params.preview;\n\n const getDeploymentDuration = measureDuration();\n\n const spinner = ora(isPreview ? \"Previewing deployment...\" : \"Deploying...\");\n\n // When showing spinner, we want to show a few messages to the user.\n // The deployment process can take in some cases 10-15 minutes, so we want to\n // give the user some feedback.\n const spinnerMessagesTimeouts = SPINNER_MESSAGES.map(([seconds, message]) => {\n return setTimeout(() => {\n spinner.text = message;\n }, seconds * 1000);\n });\n\n // Every second, let's add a dot to the end of the message.\n // Once we reach three dots, we start over.\n const threeDotsInterval = setInterval(() => {\n const spinnerText = spinner.text;\n if (spinnerText.endsWith(\"...\")) {\n spinner.text = spinnerText.substring(0, spinnerText.length - 3);\n } else {\n spinner.text = spinnerText + \".\";\n }\n }, 1000);\n\n try {\n spinner.start();\n await deployProcess;\n\n if (isPreview) {\n spinner.succeed(`Preview completed in ${getDeploymentDuration()}.`);\n } else {\n spinner.succeed(`Deployed in ${getDeploymentDuration()}.`);\n }\n } catch (e) {\n if (isPreview) {\n spinner.fail(\"Preview failed.\");\n ui.emptyLine();\n ui.text(e.message);\n ui.error(\"Preview failed, please check the details above.\");\n } else {\n spinner.fail(\"Deployment failed.\");\n ui.emptyLine();\n ui.text(e.message);\n ui.error(\"Deployment failed, please check the details above.\");\n }\n\n throw e;\n } finally {\n spinnerMessagesTimeouts.forEach(clearTimeout);\n clearInterval(threeDotsInterval);\n }\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,OAAOC,GAAG,MAAM,KAAK;AAErB,MAAMC,gBAAoC,GAAG,CACzC,CAAC,EAAE,EAAE,oBAAoB,CAAC,EAC1B,CAAC,GAAG,EAAE,iCAAiC,CAAC,EACxC,CAAC,GAAG,EAAE,+DAA+D,CAAC,EAEtE,CAAC,GAAG,EAAE,4CAA4C,CAAC,EACnD,CAAC,GAAG,EAAE,uCAAuC,CAAC,EAC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AGG,WAAW,GAAG,GAAG;MACpC;IACJ,CAAC,EAAE,IAAI,CAAC;IAER,IAAI;MACAT,OAAO,CAACa,KAAK,CAAC,CAAC;MACf,MAAMpB,aAAa;MAEnB,IAAII,SAAS,EAAE;QACXG,OAAO,CAACc,OAAO,CAAC,wBAAwBf,qBAAqB,CAAC,CAAC,GAAG,CAAC;MACvE,CAAC,MAAM;QACHC,OAAO,CAACc,OAAO,CAAC,eAAef,qBAAqB,CAAC,CAAC,GAAG,CAAC;MAC9D;IACJ,CAAC,CAAC,OAAOgB,CAAC,EAAE;MACR,IAAIlB,SAAS,EAAE;QACXG,OAAO,CAACgB,IAAI,CAAC,iBAAiB,CAAC;QAC/BtB,EAAE,CAACuB,SAAS,CAAC,CAAC;QACdvB,EAAE,CAACY,IAAI,CAACS,CAAC,CAACX,OAAO,CAAC;QAClBV,EAAE,CAACwB,KAAK,CAAC,iDAAiD,CAAC;MAC/D,CAAC,MAAM;QACHlB,OAAO,CAACgB,IAAI,CAAC,oBAAoB,CAAC;QAClCtB,EAAE,CAACuB,SAAS,CAAC,CAAC;QACdvB,EAAE,CAACY,IAAI,CAACS,CAAC,CAACX,OAAO,CAAC;QAClBV,EAAE,CAACwB,KAAK,CAAC,oDAAoD,CAAC;MAClE;MAEA,MAAMH,CAAC;IACX,CAAC,SAAS;MACNd,uBAAuB,CAACkB,OAAO,CAACC,YAAY,CAAC;MAC7CC,aAAa,CAACd,iBAAiB,CAAC;IACpC;EACJ;AACJ","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
+ export declare class WithDeploymentLogsDeployOutput extends BaseDeployOutput {
3
+ output(): Promise<void>;
4
+ }
@@ -0,0 +1,44 @@
1
+ import { measureDuration } from "../../utils/index.js";
2
+ import { BaseDeployOutput } from "./BaseDeployOutput.js";
3
+ import { PulumiError } from "@webiny/pulumi-sdk";
4
+ export class WithDeploymentLogsDeployOutput extends BaseDeployOutput {
5
+ async output() {
6
+ const deployProcess = this.deployProcess;
7
+ const ui = this.ui;
8
+ const stdio = this.stdio;
9
+ const params = this.deployParams;
10
+ const isPreview = !!params.preview;
11
+ const getDeploymentDuration = measureDuration();
12
+ try {
13
+ if (isPreview) {
14
+ ui.info(`Previewing deployment for %s app...`, params.app);
15
+ } else {
16
+ ui.info(`Deploying %s app...`, params.app);
17
+ }
18
+ ui.emptyLine();
19
+ this.deployProcess.stdout.pipe(stdio.getStdout());
20
+ this.deployProcess.stderr.pipe(stdio.getStderr());
21
+ await deployProcess;
22
+ if (isPreview) {
23
+ ui.success(`Preview completed in ${getDeploymentDuration()}.`);
24
+ } else {
25
+ ui.success(`Deployed in ${getDeploymentDuration()}.`);
26
+ }
27
+ } catch (e) {
28
+ // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.
29
+ if (e instanceof PulumiError) {
30
+ // Do nothing.
31
+ } else {
32
+ ui.text(e.message);
33
+ }
34
+ if (isPreview) {
35
+ ui.error("Preview failed, please check the details above.");
36
+ } else {
37
+ ui.error("Deployment failed, please check the details above.");
38
+ }
39
+ throw e;
40
+ }
41
+ }
42
+ }
43
+
44
+ //# sourceMappingURL=WithDeploymentLogsDeployOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["measureDuration","BaseDeployOutput","PulumiError","WithDeploymentLogsDeployOutput","output","deployProcess","ui","stdio","params","deployParams","isPreview","preview","getDeploymentDuration","info","app","emptyLine","stdout","pipe","getStdout","stderr","getStderr","success","e","text","message","error"],"sources":["WithDeploymentLogsDeployOutput.ts"],"sourcesContent":["import { measureDuration } from \"~/features/utils/index.js\";\nimport { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport { PulumiError } from \"@webiny/pulumi-sdk\";\n\nexport class WithDeploymentLogsDeployOutput extends BaseDeployOutput {\n public override async output() {\n const deployProcess = this.deployProcess;\n const ui = this.ui;\n const stdio = this.stdio;\n const params = this.deployParams;\n\n const isPreview = !!params.preview;\n\n const getDeploymentDuration = measureDuration();\n\n try {\n if (isPreview) {\n ui.info(`Previewing deployment for %s app...`, params.app);\n } else {\n ui.info(`Deploying %s app...`, params.app);\n }\n\n ui.emptyLine();\n\n this.deployProcess.stdout!.pipe(stdio.getStdout());\n this.deployProcess.stderr!.pipe(stdio.getStderr());\n await deployProcess;\n\n if (isPreview) {\n ui.success(`Preview completed in ${getDeploymentDuration()}.`);\n } else {\n ui.success(`Deployed in ${getDeploymentDuration()}.`);\n }\n } catch (e) {\n // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.\n if (e instanceof PulumiError) {\n // Do nothing.\n } else {\n ui.text(e.message);\n }\n\n if (isPreview) {\n ui.error(\"Preview failed, please check the details above.\");\n } else {\n ui.error(\"Deployment failed, please check the details above.\");\n }\n\n throw e;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,8BAA8B,SAASF,gBAAgB,CAAC;EACjE,MAAsBG,MAAMA,CAAA,EAAG;IAC3B,MAAMC,aAAa,GAAG,IAAI,CAACA,aAAa;IACxC,MAAMC,EAAE,GAAG,IAAI,CAACA,EAAE;IAClB,MAAMC,KAAK,GAAG,IAAI,CAACA,KAAK;IACxB,MAAMC,MAAM,GAAG,IAAI,CAACC,YAAY;IAEhC,MAAMC,SAAS,GAAG,CAAC,CAACF,MAAM,CAACG,OAAO;IAElC,MAAMC,qBAAqB,GAAGZ,eAAe,CAAC,CAAC;IAE/C,IAAI;MACA,IAAIU,SAAS,EAAE;QACXJ,EAAE,CAACO,IAAI,CAAC,qCAAqC,EAAEL,MAAM,CAACM,GAAG,CAAC;MAC9D,CAAC,MAAM;QACHR,EAAE,CAACO,IAAI,CAAC,qBAAqB,EAAEL,MAAM,CAACM,GAAG,CAAC;MAC9C;MAEAR,EAAE,CAACS,SAAS,CAAC,CAAC;MAEd,IAAI,CAACV,aAAa,CAACW,MAAM,CAAEC,IAAI,CAACV,KAAK,CAACW,SAAS,CAAC,CAAC,CAAC;MAClD,IAAI,CAACb,aAAa,CAACc,MAAM,CAAEF,IAAI,CAACV,KAAK,CAACa,SAAS,CAAC,CAAC,CAAC;MAClD,MAAMf,aAAa;MAEnB,IAAIK,SAAS,EAAE;QACXJ,EAAE,CAACe,OAAO,CAAC,wBAAwBT,qBAAqB,CAAC,CAAC,GAAG,CAAC;MAClE,CAAC,MAAM;QACHN,EAAE,CAACe,OAAO,CAAC,eAAeT,qBAAqB,CAAC,CAAC,GAAG,CAAC;MACzD;IACJ,CAAC,CAAC,OAAOU,CAAC,EAAE;MACR;MACA,IAAIA,CAAC,YAAYpB,WAAW,EAAE;QAC1B;MAAA,CACH,MAAM;QACHI,EAAE,CAACiB,IAAI,CAACD,CAAC,CAACE,OAAO,CAAC;MACtB;MAEA,IAAId,SAAS,EAAE;QACXJ,EAAE,CAACmB,KAAK,CAAC,iDAAiD,CAAC;MAC/D,CAAC,MAAM;QACHnB,EAAE,CAACmB,KAAK,CAAC,oDAAoD,CAAC;MAClE;MAEA,MAAMH,CAAC;IACX;EACJ;AACJ","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./DeployCommand.js";
@@ -0,0 +1,3 @@
1
+ export * from "./DeployCommand.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DeployCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import type { IDependencyTree } from "./types.js";
2
+ export interface IBuildDependencyTreeParams {
3
+ basePath: string;
4
+ files: string[];
5
+ ignore?: RegExp;
6
+ }
7
+ export declare class BuildDependencyTree {
8
+ build(params: IBuildDependencyTreeParams): IDependencyTree;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { DependencyTree } from "./DependencyTree.js";
2
+ import loadJsonFile from "load-json-file";
3
+ export class BuildDependencyTree {
4
+ build(params) {
5
+ const {
6
+ basePath,
7
+ files,
8
+ ignore
9
+ } = params;
10
+ const tree = new DependencyTree();
11
+ for (const file of files) {
12
+ try {
13
+ const json = loadJsonFile.sync(file);
14
+ tree.push({
15
+ file: file.replace(basePath, ""),
16
+ json,
17
+ ignore
18
+ });
19
+ } catch {
20
+ console.log(`Failed to load "${file}".`);
21
+ }
22
+ }
23
+ return tree;
24
+ }
25
+ }
26
+
27
+ //# sourceMappingURL=BuildDependencyTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DependencyTree","loadJsonFile","BuildDependencyTree","build","params","basePath","files","ignore","tree","file","json","sync","push","replace","console","log"],"sources":["BuildDependencyTree.ts"],"sourcesContent":["import type { IDependencyTree } from \"./types.js\";\nimport { DependencyTree } from \"./DependencyTree.js\";\nimport type { PackageJson } from \"type-fest\";\nimport loadJsonFile from \"load-json-file\";\n\nexport interface IBuildDependencyTreeParams {\n basePath: string;\n files: string[];\n ignore?: RegExp;\n}\n\nexport class BuildDependencyTree {\n public build(params: IBuildDependencyTreeParams): IDependencyTree {\n const { basePath, files, ignore } = params;\n const tree = new DependencyTree();\n for (const file of files) {\n try {\n const json = loadJsonFile.sync<PackageJson>(file);\n tree.push({\n file: file.replace(basePath, \"\"),\n json,\n ignore\n });\n } catch {\n console.log(`Failed to load \"${file}\".`);\n }\n }\n return tree;\n }\n}\n"],"mappings":"AACA,SAASA,cAAc;AAEvB,OAAOC,YAAY,MAAM,gBAAgB;AAQzC,OAAO,MAAMC,mBAAmB,CAAC;EACtBC,KAAKA,CAACC,MAAkC,EAAmB;IAC9D,MAAM;MAAEC,QAAQ;MAAEC,KAAK;MAAEC;IAAO,CAAC,GAAGH,MAAM;IAC1C,MAAMI,IAAI,GAAG,IAAIR,cAAc,CAAC,CAAC;IACjC,KAAK,MAAMS,IAAI,IAAIH,KAAK,EAAE;MACtB,IAAI;QACA,MAAMI,IAAI,GAAGT,YAAY,CAACU,IAAI,CAAcF,IAAI,CAAC;QACjDD,IAAI,CAACI,IAAI,CAAC;UACNH,IAAI,EAAEA,IAAI,CAACI,OAAO,CAACR,QAAQ,EAAE,EAAE,CAAC;UAChCK,IAAI;UACJH;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,MAAM;QACJO,OAAO,CAACC,GAAG,CAAC,mBAAmBN,IAAI,IAAI,CAAC;MAC5C;IACJ;IACA,OAAOD,IAAI;EACf;AACJ","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import type { IDependency, IDependencyTree, IDependencyTreePushParams, IReference } from "./types.js";
2
+ export declare class DependencyTree implements IDependencyTree {
3
+ private readonly packages;
4
+ readonly references: IReference[];
5
+ get dependencies(): IDependency[];
6
+ get devDependencies(): IDependency[];
7
+ get peerDependencies(): IDependency[];
8
+ get resolutions(): IDependency[];
9
+ get duplicates(): IReference[];
10
+ push(params: IDependencyTreePushParams): void;
11
+ private addReference;
12
+ }
@@ -0,0 +1,131 @@
1
+ import semver from "semver";
2
+ import { PackageType } from "./types.js";
3
+ const keys = [PackageType.dependencies, PackageType.devDependencies, PackageType.peerDependencies, PackageType.resolutions];
4
+ const sortByName = (a, b) => {
5
+ return a.name.localeCompare(b.name);
6
+ };
7
+ export class DependencyTree {
8
+ packages = {
9
+ resolutions: [],
10
+ dependencies: [],
11
+ devDependencies: [],
12
+ peerDependencies: []
13
+ };
14
+ references = [];
15
+ get dependencies() {
16
+ return this.packages.dependencies.sort(sortByName);
17
+ }
18
+ get devDependencies() {
19
+ return this.packages.devDependencies.sort(sortByName);
20
+ }
21
+ get peerDependencies() {
22
+ return this.packages.peerDependencies.sort(sortByName);
23
+ }
24
+ get resolutions() {
25
+ return this.packages.resolutions.sort(sortByName);
26
+ }
27
+ get duplicates() {
28
+ return this.references.filter(reference => {
29
+ return reference.versions.length > 1;
30
+ }).sort(sortByName);
31
+ }
32
+ push(params) {
33
+ const {
34
+ file,
35
+ json,
36
+ ignore
37
+ } = params;
38
+ for (const key of keys) {
39
+ const dependencies = json[key];
40
+ if (!dependencies) {
41
+ continue;
42
+ }
43
+ for (const name in dependencies) {
44
+ if (ignore && name.match(ignore) !== null) {
45
+ continue;
46
+ }
47
+ let version = dependencies[name];
48
+ if (!version) {
49
+ continue;
50
+ }
51
+ const semverVersion = semver.validRange(version) || version === "beta" ? version : null;
52
+ if (!semverVersion) {
53
+ process.env.DEBUG === "true" && console.debug(`${version} is not a valid SemVer value in ${file}, package ${name}.`);
54
+ continue;
55
+ }
56
+ version = version.replace(/\^/g, "").replace(/~/g, "").replace(/>/g, "").replace(/</g, "").replace(/=/g, "");
57
+ const existing = this.packages[key].find(item => {
58
+ return item.name === name && item.version === version;
59
+ });
60
+ if (existing) {
61
+ existing.files.push(file);
62
+ this.addReference({
63
+ name,
64
+ version,
65
+ file,
66
+ type: key
67
+ });
68
+ continue;
69
+ }
70
+ this.packages[key].push({
71
+ name,
72
+ version,
73
+ files: [file]
74
+ });
75
+ this.addReference({
76
+ name,
77
+ version,
78
+ file,
79
+ type: key
80
+ });
81
+ }
82
+ }
83
+ }
84
+ addReference(ref) {
85
+ const existing = this.references.find(item => {
86
+ return item.name === ref.name;
87
+ });
88
+ const types = [ref.type];
89
+ if (!existing) {
90
+ this.references.push({
91
+ name: ref.name,
92
+ versions: [{
93
+ version: ref.version,
94
+ files: [{
95
+ file: ref.file,
96
+ types
97
+ }]
98
+ }]
99
+ });
100
+ return;
101
+ }
102
+ const existingVersion = existing.versions.find(item => {
103
+ return item.version === ref.version;
104
+ });
105
+ if (!existingVersion) {
106
+ existing.versions.push({
107
+ version: ref.version,
108
+ files: [{
109
+ file: ref.file,
110
+ types
111
+ }]
112
+ });
113
+ return;
114
+ }
115
+ const existingFile = existingVersion.files.find(item => {
116
+ return item.file === ref.file;
117
+ });
118
+ if (!existingFile) {
119
+ existingVersion.files.push({
120
+ file: ref.file,
121
+ types
122
+ });
123
+ return;
124
+ } else if (existingFile.types.includes(ref.type)) {
125
+ return;
126
+ }
127
+ existingFile.types.push(ref.type);
128
+ }
129
+ }
130
+
131
+ //# sourceMappingURL=DependencyTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["semver","PackageType","keys","dependencies","devDependencies","peerDependencies","resolutions","sortByName","a","b","name","localeCompare","DependencyTree","packages","references","sort","duplicates","filter","reference","versions","length","push","params","file","json","ignore","key","match","version","semverVersion","validRange","process","env","DEBUG","console","debug","replace","existing","find","item","files","addReference","type","ref","types","existingVersion","existingFile","includes"],"sources":["DependencyTree.ts"],"sourcesContent":["import semver from \"semver\";\nimport type {\n IDependency,\n IDependencyTree,\n IDependencyTreePushParams,\n IReference\n} from \"./types.js\";\nimport { PackageType } from \"./types.js\";\n\nconst keys = [\n PackageType.dependencies,\n PackageType.devDependencies,\n PackageType.peerDependencies,\n PackageType.resolutions\n];\n\ninterface IAddReferenceParams {\n name: string;\n version: string;\n file: string;\n type: PackageType;\n}\n\ninterface ISortItem {\n name: string;\n}\n\nconst sortByName = (a: ISortItem, b: ISortItem) => {\n return a.name.localeCompare(b.name);\n};\n\nexport class DependencyTree implements IDependencyTree {\n private readonly packages: Record<(typeof keys)[number], IDependency[]> = {\n resolutions: [],\n dependencies: [],\n devDependencies: [],\n peerDependencies: []\n };\n public readonly references: IReference[] = [];\n\n public get dependencies(): IDependency[] {\n return this.packages.dependencies.sort(sortByName);\n }\n\n public get devDependencies(): IDependency[] {\n return this.packages.devDependencies.sort(sortByName);\n }\n\n public get peerDependencies(): IDependency[] {\n return this.packages.peerDependencies.sort(sortByName);\n }\n\n public get resolutions(): IDependency[] {\n return this.packages.resolutions.sort(sortByName);\n }\n\n public get duplicates(): IReference[] {\n return this.references\n .filter(reference => {\n return reference.versions.length > 1;\n })\n .sort(sortByName);\n }\n\n public push(params: IDependencyTreePushParams): void {\n const { file, json, ignore } = params;\n for (const key of keys) {\n const dependencies = json[key];\n if (!dependencies) {\n continue;\n }\n\n for (const name in dependencies) {\n if (ignore && name.match(ignore) !== null) {\n continue;\n }\n let version = dependencies[name];\n if (!version) {\n continue;\n }\n\n const semverVersion =\n semver.validRange(version) || version === \"beta\" ? version : null;\n if (!semverVersion) {\n process.env.DEBUG === \"true\" &&\n console.debug(\n `${version} is not a valid SemVer value in ${file}, package ${name}.`\n );\n continue;\n }\n version = version\n .replace(/\\^/g, \"\")\n .replace(/~/g, \"\")\n .replace(/>/g, \"\")\n .replace(/</g, \"\")\n .replace(/=/g, \"\");\n const existing = this.packages[key].find(item => {\n return item.name === name && item.version === version;\n });\n if (existing) {\n existing.files.push(file);\n this.addReference({\n name,\n version,\n file,\n type: key\n });\n continue;\n }\n\n this.packages[key].push({\n name,\n version,\n files: [file]\n });\n this.addReference({\n name,\n version,\n file,\n type: key\n });\n }\n }\n }\n\n private addReference(ref: IAddReferenceParams): void {\n const existing = this.references.find(item => {\n return item.name === ref.name;\n });\n const types = [ref.type];\n if (!existing) {\n this.references.push({\n name: ref.name,\n versions: [\n {\n version: ref.version,\n files: [\n {\n file: ref.file,\n types\n }\n ]\n }\n ]\n });\n return;\n }\n const existingVersion = existing.versions.find(item => {\n return item.version === ref.version;\n });\n if (!existingVersion) {\n existing.versions.push({\n version: ref.version,\n files: [\n {\n file: ref.file,\n types\n }\n ]\n });\n return;\n }\n const existingFile = existingVersion.files.find(item => {\n return item.file === ref.file;\n });\n if (!existingFile) {\n existingVersion.files.push({\n file: ref.file,\n types\n });\n return;\n } else if (existingFile.types.includes(ref.type)) {\n return;\n }\n existingFile.types.push(ref.type);\n }\n}\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,QAAQ;AAO3B,SAASC,WAAW;AAEpB,MAAMC,IAAI,GAAG,CACTD,WAAW,CAACE,YAAY,EACxBF,WAAW,CAACG,eAAe,EAC3BH,WAAW,CAACI,gBAAgB,EAC5BJ,WAAW,CAACK,WAAW,CAC1B;AAaD,MAAMC,UAAU,GAAGA,CAACC,CAAY,EAAEC,CAAY,KAAK;EAC/C,OAAOD,CAAC,CAACE,IAAI,CAACC,aAAa,CAACF,CAAC,CAACC,IAAI,CAAC;AACvC,CAAC;AAED,OAAO,MAAME,cAAc,CAA4B;EAClC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CAAC,CAAC;MACF;IACJ,CAAC,MAAM,IAAIE,YAAY,CAACF,KAAK,CAACG,QAAQ,CAACJ,GAAG,CAACD,IAAI,CAAC,EAAE;MAC9C;IACJ;IACAI,YAAY,CAACF,KAAK,CAACvB,IAAI,CAACsB,GAAG,CAACD,IAAI,CAAC;EACrC;AACJ","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ export interface IListAllPackageJsonFilesListParams {
2
+ targets: string[];
3
+ ignore?: string[];
4
+ }
5
+ export declare class ListAllPackageJsonFiles {
6
+ list(params: IListAllPackageJsonFilesListParams): string[];
7
+ }
@@ -0,0 +1,18 @@
1
+ import glob from "glob";
2
+ const defaultIgnore = ["**/node_modules/**", "**/dist/**", "**/build/**"];
3
+ export class ListAllPackageJsonFiles {
4
+ list(params) {
5
+ const targets = params.targets;
6
+ const ignore = defaultIgnore.concat(params.ignore || []);
7
+ const results = [];
8
+ for (const target of targets) {
9
+ const files = glob.sync(`${target}/**/**/{package.json,*.package.json,dependencies.json}`, {
10
+ ignore
11
+ });
12
+ results.push(...files);
13
+ }
14
+ return results;
15
+ }
16
+ }
17
+
18
+ //# sourceMappingURL=ListAllPackageJsonFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["glob","defaultIgnore","ListAllPackageJsonFiles","list","params","targets","ignore","concat","results","target","files","sync","push"],"sources":["ListAllPackageJsonFiles.ts"],"sourcesContent":["import glob from \"glob\";\n\nconst defaultIgnore = [\"**/node_modules/**\", \"**/dist/**\", \"**/build/**\"];\n\nexport interface IListAllPackageJsonFilesListParams {\n targets: string[];\n ignore?: string[];\n}\n\nexport class ListAllPackageJsonFiles {\n public list(params: IListAllPackageJsonFilesListParams): string[] {\n const targets = params.targets;\n const ignore = defaultIgnore.concat(params.ignore || []);\n\n const results: string[] = [];\n\n for (const target of targets) {\n const files = glob.sync(\n `${target}/**/**/{package.json,*.package.json,dependencies.json}`,\n {\n ignore\n }\n );\n results.push(...files);\n }\n\n return results;\n }\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AAEvB,MAAMC,aAAa,GAAG,CAAC,oBAAoB,EAAE,YAAY,EAAE,aAAa,CAAC;AAOzE,OAAO,MAAMC,uBAAuB,CAAC;EAC1BC,IAAIA,CAACC,MAA0C,EAAY;IAC9D,MAAMC,OAAO,GAAGD,MAAM,CAACC,OAAO;IAC9B,MAAMC,MAAM,GAAGL,aAAa,CAACM,MAAM,CAACH,MAAM,CAACE,MAAM,IAAI,EAAE,CAAC;IAExD,MAAME,OAAiB,GAAG,EAAE;IAE5B,KAAK,MAAMC,MAAM,IAAIJ,OAAO,EAAE;MAC1B,MAAMK,KAAK,GAAGV,IAAI,CAACW,IAAI,CACnB,GAAGF,MAAM,wDAAwD,EACjE;QACIH;MACJ,CACJ,CAAC;MACDE,OAAO,CAACI,IAAI,CAAC,GAAGF,KAAK,CAAC;IAC1B;IAEA,OAAOF,OAAO;EAClB;AACJ","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export declare class ListAllPackages {
2
+ list(paths: string[]): string[];
3
+ }
@@ -0,0 +1,13 @@
1
+ // @ts-expect-error
2
+ import getPackages from "get-yarn-workspaces";
3
+ export class ListAllPackages {
4
+ list(paths) {
5
+ const results = [];
6
+ for (const p of paths) {
7
+ results.push(...getPackages(p));
8
+ }
9
+ return results;
10
+ }
11
+ }
12
+
13
+ //# sourceMappingURL=ListAllPackages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getPackages","ListAllPackages","list","paths","results","p","push"],"sources":["ListAllPackages.ts"],"sourcesContent":["// @ts-expect-error\nimport getPackages from \"get-yarn-workspaces\";\n\nexport class ListAllPackages {\n public list(paths: string[]): string[] {\n const results: string[] = [];\n for (const p of paths) {\n results.push(...getPackages(p));\n }\n return results;\n }\n}\n"],"mappings":"AAAA;AACA,OAAOA,WAAW,MAAM,qBAAqB;AAE7C,OAAO,MAAMC,eAAe,CAAC;EAClBC,IAAIA,CAACC,KAAe,EAAY;IACnC,MAAMC,OAAiB,GAAG,EAAE;IAC5B,KAAK,MAAMC,CAAC,IAAIF,KAAK,EAAE;MACnBC,OAAO,CAACE,IAAI,CAAC,GAAGN,WAAW,CAACK,CAAC,CAAC,CAAC;IACnC;IACA,OAAOD,OAAO;EAClB;AACJ","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import { CliCommandFactory, GetProjectSdkService, UiService } from "../../../abstractions/index.js";
2
+ export declare class SyncDepsCommand implements CliCommandFactory.Interface<unknown> {
3
+ private getProjectSdkService;
4
+ private uiService;
5
+ constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface);
6
+ execute(): Promise<{
7
+ name: string;
8
+ description: string;
9
+ examples: string[];
10
+ handler: () => Promise<void>;
11
+ }>;
12
+ }
13
+ export declare const syncDepsCommand: import("@webiny/di").Implementation<typeof SyncDepsCommand>;
@@ -0,0 +1,32 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { CliCommandFactory, GetProjectSdkService, UiService } from "../../../abstractions/index.js";
3
+ import { createDependencyTree } from "../createDependencyTree.js";
4
+ import { createReferenceFile } from "../createReferenceFile.js";
5
+ export class SyncDepsCommand {
6
+ constructor(getProjectSdkService, uiService) {
7
+ this.getProjectSdkService = getProjectSdkService;
8
+ this.uiService = uiService;
9
+ }
10
+ async execute() {
11
+ const projectSdk = await this.getProjectSdkService.execute();
12
+ return {
13
+ name: "sync-dependencies",
14
+ description: "Sync dependencies for all packages.",
15
+ examples: ["$0 sync-dependencies"],
16
+ handler: async () => {
17
+ const project = projectSdk.getProject();
18
+ const tree = createDependencyTree(project);
19
+ return createReferenceFile(project, tree, {
20
+ uiService: this.uiService
21
+ });
22
+ }
23
+ };
24
+ }
25
+ }
26
+ export const syncDepsCommand = createImplementation({
27
+ abstraction: CliCommandFactory,
28
+ implementation: SyncDepsCommand,
29
+ dependencies: [GetProjectSdkService, UiService]
30
+ });
31
+
32
+ //# sourceMappingURL=SyncDepsCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","UiService","createDependencyTree","createReferenceFile","SyncDepsCommand","constructor","getProjectSdkService","uiService","execute","projectSdk","name","description","examples","handler","project","getProject","tree","syncDepsCommand","abstraction","implementation","dependencies"],"sources":["SyncDepsCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\n\nimport { createDependencyTree } from \"../createDependencyTree.js\";\nimport { createReferenceFile } from \"../createReferenceFile.js\";\n\nexport class SyncDepsCommand implements CliCommandFactory.Interface<unknown> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"sync-dependencies\",\n description: \"Sync dependencies for all packages.\",\n examples: [\"$0 sync-dependencies\"],\n handler: async () => {\n const project = projectSdk.getProject();\n const tree = createDependencyTree(project);\n\n return createReferenceFile(project, tree, { uiService: this.uiService });\n }\n };\n }\n}\n\nexport const syncDepsCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: SyncDepsCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAEC,oBAAoB,EAAEC,SAAS;AAE3D,SAASC,oBAAoB;AAC7B,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,eAAe,CAAiD;EACzEC,WAAWA,CACCC,oBAAoD,EACpDC,SAA8B,EACxC;IAAA,KAFUD,oBAAoD,GAApDA,oBAAoD;IAAA,KACpDC,SAA8B,GAA9BA,SAA8B;EACvC;EAEH,MAAMC,OAAOA,CAAA,EAAG;IACZ,MAAMC,UAAU,GAAG,MAAM,IAAI,CAACH,oBAAoB,CAACE,OAAO,CAAC,CAAC;IAE5D,OAAO;MACHE,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAE,qCAAqC;MAClDC,QAAQ,EAAE,CAAC,sBAAsB,CAAC;MAClCC,OAAO,EAAE,MAAAA,CAAA,KAAY;QACjB,MAAMC,OAAO,GAAGL,UAAU,CAACM,UAAU,CAAC,CAAC;QACvC,MAAMC,IAAI,GAAGd,oBAAoB,CAACY,OAAO,CAAC;QAE1C,OAAOX,mBAAmB,CAACW,OAAO,EAAEE,IAAI,EAAE;UAAET,SAAS,EAAE,IAAI,CAACA;QAAU,CAAC,CAAC;MAC5E;IACJ,CAAC;EACL;AACJ;AAEA,OAAO,MAAMU,eAAe,GAAGnB,oBAAoB,CAAC;EAChDoB,WAAW,EAAEnB,iBAAiB;EAC9BoB,cAAc,EAAEf,eAAe;EAC/BgB,YAAY,EAAE,CAACpB,oBAAoB,EAAEC,SAAS;AAClD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import { CliCommandFactory, GetProjectSdkService, UiService } from "../../../abstractions/index.js";
2
+ export declare class VerifyDepsCommand implements CliCommandFactory.Interface<unknown> {
3
+ private getProjectSdkService;
4
+ private uiService;
5
+ constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface);
6
+ execute(): Promise<{
7
+ name: string;
8
+ description: string;
9
+ examples: string[];
10
+ handler: () => Promise<void>;
11
+ }>;
12
+ }
13
+ export declare const verifyDepsCommand: import("@webiny/di").Implementation<typeof VerifyDepsCommand>;
@@ -0,0 +1,81 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { CliCommandFactory, GetProjectSdkService, UiService } from "../../../abstractions/index.js";
3
+ import loadJsonFile from "load-json-file";
4
+ import { getDuplicatesFilePath, getReferencesFilePath } from "../paths.js";
5
+ import fs from "fs";
6
+ import { createDependencyTree } from "../createDependencyTree.js";
7
+ export class VerifyDepsCommand {
8
+ constructor(getProjectSdkService, uiService) {
9
+ this.getProjectSdkService = getProjectSdkService;
10
+ this.uiService = uiService;
11
+ }
12
+ async execute() {
13
+ return {
14
+ name: "verify-dependencies",
15
+ description: "Verify dependencies for all packages.",
16
+ examples: ["$0 verify-dependencies"],
17
+ handler: async () => {
18
+ const ui = this.uiService;
19
+ const projectSdk = await this.getProjectSdkService.execute();
20
+ const project = projectSdk.getProject();
21
+ const referencesFile = getReferencesFilePath(project);
22
+ const duplicatesFile = getDuplicatesFilePath(project);
23
+ const tree = createDependencyTree(project);
24
+ const references = {
25
+ dependencies: tree.dependencies,
26
+ devDependencies: tree.devDependencies,
27
+ peerDependencies: tree.peerDependencies,
28
+ resolutions: tree.resolutions,
29
+ references: tree.references
30
+ };
31
+ ui.info("Checking references file...");
32
+ if (fs.existsSync(referencesFile)) {
33
+ const json = loadJsonFile.sync(referencesFile);
34
+ if (JSON.stringify(references) !== JSON.stringify(json)) {
35
+ for (const type in references) {
36
+ const refDependencies = references[type];
37
+ const fileDependencies = json[type];
38
+ for (const dep in refDependencies) {
39
+ const refDep = refDependencies[dep];
40
+ const fileDep = fileDependencies[dep];
41
+ if (!fileDep) {
42
+ console.log("Missing dependency:", refDep.name, "in", type);
43
+ continue;
44
+ }
45
+ if (JSON.stringify(refDep) !== JSON.stringify(fileDep)) {
46
+ console.log("Mismatch in dependency:", refDep.name, "in", type);
47
+ console.log({
48
+ refDep: JSON.stringify(refDep),
49
+ fileDep: JSON.stringify(fileDep)
50
+ });
51
+ }
52
+ }
53
+ }
54
+ throw new Error("References are not in sync. Please run `yarn webiny sync-dependencies` command.");
55
+ }
56
+ } else {
57
+ throw new Error("References file does not exist. Please run `yarn webiny sync-dependencies` command.");
58
+ }
59
+ ui.info("Checking duplicates file...");
60
+ if (fs.existsSync(duplicatesFile)) {
61
+ const json = loadJsonFile.sync(duplicatesFile);
62
+ if (JSON.stringify(tree.duplicates) !== JSON.stringify(json)) {
63
+ throw new Error("Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command.");
64
+ } else if (Array.isArray(json) && json.length > 0) {
65
+ throw new Error("There are still duplicates in the project. Please sort them out and run `yarn webiny sync-dependencies` command to regenerate files.");
66
+ }
67
+ } else {
68
+ throw new Error("Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command.");
69
+ }
70
+ ui.info("✅ All package reference files are in sync.");
71
+ }
72
+ };
73
+ }
74
+ }
75
+ export const verifyDepsCommand = createImplementation({
76
+ abstraction: CliCommandFactory,
77
+ implementation: VerifyDepsCommand,
78
+ dependencies: [GetProjectSdkService, UiService]
79
+ });
80
+
81
+ //# sourceMappingURL=VerifyDepsCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","UiService","loadJsonFile","getDuplicatesFilePath","getReferencesFilePath","fs","createDependencyTree","VerifyDepsCommand","constructor","getProjectSdkService","uiService","execute","name","description","examples","handler","ui","projectSdk","project","getProject","referencesFile","duplicatesFile","tree","references","dependencies","devDependencies","peerDependencies","resolutions","info","existsSync","json","sync","JSON","stringify","type","refDependencies","fileDependencies","dep","refDep","fileDep","console","log","Error","duplicates","Array","isArray","length","verifyDepsCommand","abstraction","implementation"],"sources":["VerifyDepsCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport loadJsonFile from \"load-json-file\";\nimport { getDuplicatesFilePath, getReferencesFilePath } from \"../paths.js\";\nimport fs from \"fs\";\nimport { createDependencyTree } from \"../createDependencyTree.js\";\nimport type { IDependencyCollection } from \"~/features/DepsSync/types.js\";\n\nexport class VerifyDepsCommand implements CliCommandFactory.Interface<unknown> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n return {\n name: \"verify-dependencies\",\n description: \"Verify dependencies for all packages.\",\n examples: [\"$0 verify-dependencies\"],\n handler: async () => {\n const ui = this.uiService;\n const projectSdk = await this.getProjectSdkService.execute();\n const project = projectSdk.getProject();\n const referencesFile = getReferencesFilePath(project);\n const duplicatesFile = getDuplicatesFilePath(project);\n\n const tree = createDependencyTree(project);\n\n const references: IDependencyCollection = {\n dependencies: tree.dependencies,\n devDependencies: tree.devDependencies,\n peerDependencies: tree.peerDependencies,\n resolutions: tree.resolutions,\n references: tree.references\n };\n\n ui.info(\"Checking references file...\");\n\n if (fs.existsSync(referencesFile)) {\n const json = loadJsonFile.sync<IDependencyCollection>(referencesFile)!;\n if (JSON.stringify(references) !== JSON.stringify(json)) {\n for (const type in references) {\n const refDependencies = references[type as keyof typeof references];\n const fileDependencies = json[type as keyof typeof json];\n for (const dep in refDependencies) {\n const refDep = refDependencies[dep];\n const fileDep = fileDependencies[dep];\n if (!fileDep) {\n console.log(\"Missing dependency:\", refDep.name, \"in\", type);\n continue;\n }\n if (JSON.stringify(refDep) !== JSON.stringify(fileDep)) {\n console.log(\"Mismatch in dependency:\", refDep.name, \"in\", type);\n console.log({\n refDep: JSON.stringify(refDep),\n fileDep: JSON.stringify(fileDep)\n });\n }\n }\n }\n throw new Error(\n \"References are not in sync. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n } else {\n throw new Error(\n \"References file does not exist. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n\n ui.info(\"Checking duplicates file...\");\n\n if (fs.existsSync(duplicatesFile)) {\n const json = loadJsonFile.sync(duplicatesFile);\n if (JSON.stringify(tree.duplicates) !== JSON.stringify(json)) {\n throw new Error(\n \"Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command.\"\n );\n } else if (Array.isArray(json) && json.length > 0) {\n throw new Error(\n \"There are still duplicates in the project. Please sort them out and run `yarn webiny sync-dependencies` command to regenerate files.\"\n );\n }\n } else {\n throw new Error(\n \"Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n\n ui.info(\"✅ All package reference files are in sync.\");\n }\n };\n }\n}\n\nexport const verifyDepsCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: VerifyDepsCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAE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