@webiny/project 6.3.0-beta.4 → 6.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (875) hide show
  1. package/GracefulError.js +13 -15
  2. package/GracefulError.js.map +1 -1
  3. package/ProjectError.js +11 -13
  4. package/ProjectError.js.map +1 -1
  5. package/ProjectSdk.js +113 -129
  6. package/ProjectSdk.js.map +1 -1
  7. package/abstractions/createAbstraction.js +3 -2
  8. package/abstractions/createAbstraction.js.map +1 -1
  9. package/abstractions/features/BuildApp.js +2 -1
  10. package/abstractions/features/BuildApp.js.map +1 -1
  11. package/abstractions/features/BuildExtension.js +2 -1
  12. package/abstractions/features/BuildExtension.js.map +1 -1
  13. package/abstractions/features/DeployApp.js +2 -1
  14. package/abstractions/features/DeployApp.js.map +1 -1
  15. package/abstractions/features/DestroyApp.js +2 -1
  16. package/abstractions/features/DestroyApp.js.map +1 -1
  17. package/abstractions/features/ExportStack.js +2 -1
  18. package/abstractions/features/ExportStack.js.map +1 -1
  19. package/abstractions/features/GetApp.js +2 -1
  20. package/abstractions/features/GetApp.js.map +1 -1
  21. package/abstractions/features/GetAppOutput.js +2 -1
  22. package/abstractions/features/GetAppOutput.js.map +1 -1
  23. package/abstractions/features/GetAppStackOutput.js +2 -6
  24. package/abstractions/features/GetAppStackOutput.js.map +1 -1
  25. package/abstractions/features/GetFeatureFlags.js +2 -1
  26. package/abstractions/features/GetFeatureFlags.js.map +1 -1
  27. package/abstractions/features/GetLogger.js +2 -1
  28. package/abstractions/features/GetLogger.js.map +1 -1
  29. package/abstractions/features/GetProductionEnvironments.js +2 -1
  30. package/abstractions/features/GetProductionEnvironments.js.map +1 -1
  31. package/abstractions/features/GetProject.js +2 -1
  32. package/abstractions/features/GetProject.js.map +1 -1
  33. package/abstractions/features/GetProjectConfig.js +2 -1
  34. package/abstractions/features/GetProjectConfig.js.map +1 -1
  35. package/abstractions/features/GetProjectInfo.js +2 -1
  36. package/abstractions/features/GetProjectInfo.js.map +1 -1
  37. package/abstractions/features/GetPulumiResourceNamePrefix.js +2 -1
  38. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +1 -1
  39. package/abstractions/features/InstallExtension.js +2 -1
  40. package/abstractions/features/InstallExtension.js.map +1 -1
  41. package/abstractions/features/IsCi.js +2 -1
  42. package/abstractions/features/IsCi.js.map +1 -1
  43. package/abstractions/features/IsTelemetryEnabled.js +2 -1
  44. package/abstractions/features/IsTelemetryEnabled.js.map +1 -1
  45. package/abstractions/features/IsWcpEnabled.js +2 -1
  46. package/abstractions/features/IsWcpEnabled.js.map +1 -1
  47. package/abstractions/features/IsWebinyJsRepo.js +2 -1
  48. package/abstractions/features/IsWebinyJsRepo.js.map +1 -1
  49. package/abstractions/features/RefreshApp.js +2 -1
  50. package/abstractions/features/RefreshApp.js.map +1 -1
  51. package/abstractions/features/RunPulumiCommand.js +2 -1
  52. package/abstractions/features/RunPulumiCommand.js.map +1 -1
  53. package/abstractions/features/ValidateProjectConfig.js +2 -1
  54. package/abstractions/features/ValidateProjectConfig.js.map +1 -1
  55. package/abstractions/features/Watch.js +2 -1
  56. package/abstractions/features/Watch.js.map +1 -1
  57. package/abstractions/features/hooks/AdminAfterBuild.js +2 -1
  58. package/abstractions/features/hooks/AdminAfterBuild.js.map +1 -1
  59. package/abstractions/features/hooks/AdminAfterDeploy.js +2 -1
  60. package/abstractions/features/hooks/AdminAfterDeploy.js.map +1 -1
  61. package/abstractions/features/hooks/AdminBeforeBuild.js +2 -1
  62. package/abstractions/features/hooks/AdminBeforeBuild.js.map +1 -1
  63. package/abstractions/features/hooks/AdminBeforeDeploy.js +2 -1
  64. package/abstractions/features/hooks/AdminBeforeDeploy.js.map +1 -1
  65. package/abstractions/features/hooks/AdminBeforeWatch.js +2 -1
  66. package/abstractions/features/hooks/AdminBeforeWatch.js.map +1 -1
  67. package/abstractions/features/hooks/AfterBuild.js +2 -1
  68. package/abstractions/features/hooks/AfterBuild.js.map +1 -1
  69. package/abstractions/features/hooks/AfterDeploy.js +2 -1
  70. package/abstractions/features/hooks/AfterDeploy.js.map +1 -1
  71. package/abstractions/features/hooks/ApiAfterBuild.js +2 -1
  72. package/abstractions/features/hooks/ApiAfterBuild.js.map +1 -1
  73. package/abstractions/features/hooks/ApiAfterDeploy.js +2 -1
  74. package/abstractions/features/hooks/ApiAfterDeploy.js.map +1 -1
  75. package/abstractions/features/hooks/ApiBeforeBuild.js +2 -1
  76. package/abstractions/features/hooks/ApiBeforeBuild.js.map +1 -1
  77. package/abstractions/features/hooks/ApiBeforeDeploy.js +2 -1
  78. package/abstractions/features/hooks/ApiBeforeDeploy.js.map +1 -1
  79. package/abstractions/features/hooks/ApiBeforeWatch.js +2 -1
  80. package/abstractions/features/hooks/ApiBeforeWatch.js.map +1 -1
  81. package/abstractions/features/hooks/BeforeBuild.js +2 -1
  82. package/abstractions/features/hooks/BeforeBuild.js.map +1 -1
  83. package/abstractions/features/hooks/BeforeDeploy.js +2 -1
  84. package/abstractions/features/hooks/BeforeDeploy.js.map +1 -1
  85. package/abstractions/features/hooks/BeforeWatch.js +2 -1
  86. package/abstractions/features/hooks/BeforeWatch.js.map +1 -1
  87. package/abstractions/features/hooks/CoreAfterBuild.js +2 -1
  88. package/abstractions/features/hooks/CoreAfterBuild.js.map +1 -1
  89. package/abstractions/features/hooks/CoreAfterDeploy.js +2 -1
  90. package/abstractions/features/hooks/CoreAfterDeploy.js.map +1 -1
  91. package/abstractions/features/hooks/CoreBeforeBuild.js +2 -1
  92. package/abstractions/features/hooks/CoreBeforeBuild.js.map +1 -1
  93. package/abstractions/features/hooks/CoreBeforeDeploy.js +2 -1
  94. package/abstractions/features/hooks/CoreBeforeDeploy.js.map +1 -1
  95. package/abstractions/features/hooks/CoreBeforeWatch.js +2 -1
  96. package/abstractions/features/hooks/CoreBeforeWatch.js.map +1 -1
  97. package/abstractions/features/hooks/index.js +0 -2
  98. package/abstractions/features/index.js +0 -2
  99. package/abstractions/index.js +0 -2
  100. package/abstractions/models/IAppModel.js +0 -3
  101. package/abstractions/models/IAppPackageModel.js +0 -3
  102. package/abstractions/models/IPathModel.js +0 -3
  103. package/abstractions/models/IProjectConfigDto.js +0 -3
  104. package/abstractions/models/IProjectConfigModel.js +0 -3
  105. package/abstractions/models/IProjectModel.js +0 -3
  106. package/abstractions/models/IUrlModel.js +0 -3
  107. package/abstractions/models/IWcpEnvironmentDto.js +0 -3
  108. package/abstractions/models/IWcpEnvironmentModel.js +0 -3
  109. package/abstractions/models/IWcpUserDto.js +0 -3
  110. package/abstractions/models/IWcpUserModel.js +0 -3
  111. package/abstractions/models/IWcpUserPatDto.js +0 -3
  112. package/abstractions/models/IWcpUserPatModel.js +0 -3
  113. package/abstractions/models/PackagesBuilder/IPackagesBuilder.js +0 -3
  114. package/abstractions/models/PackagesBuilder/IRunnableBuildProcess.js +0 -3
  115. package/abstractions/models/PackagesBuilder/IRunnableBuildProcesses.js +0 -3
  116. package/abstractions/models/PackagesBuilder/index.js +0 -3
  117. package/abstractions/models/index.js +0 -3
  118. package/abstractions/services/BuildAppWorkspaceService.js +2 -1
  119. package/abstractions/services/BuildAppWorkspaceService.js.map +1 -1
  120. package/abstractions/services/BuildProjectWorkspaceService.js +2 -1
  121. package/abstractions/services/BuildProjectWorkspaceService.js.map +1 -1
  122. package/abstractions/services/GetAppPackagesService.js +2 -1
  123. package/abstractions/services/GetAppPackagesService.js.map +1 -1
  124. package/abstractions/services/GetAppService.js +2 -1
  125. package/abstractions/services/GetAppService.js.map +1 -1
  126. package/abstractions/services/GetCwdService.js +2 -1
  127. package/abstractions/services/GetCwdService.js.map +1 -1
  128. package/abstractions/services/GetProjectConfigService.js +2 -1
  129. package/abstractions/services/GetProjectConfigService.js.map +1 -1
  130. package/abstractions/services/GetProjectIdService.js +2 -1
  131. package/abstractions/services/GetProjectIdService.js.map +1 -1
  132. package/abstractions/services/GetProjectService.js +2 -1
  133. package/abstractions/services/GetProjectService.js.map +1 -1
  134. package/abstractions/services/GetProjectVersionService.js +2 -1
  135. package/abstractions/services/GetProjectVersionService.js.map +1 -1
  136. package/abstractions/services/GetPulumiService.js +2 -1
  137. package/abstractions/services/GetPulumiService.js.map +1 -1
  138. package/abstractions/services/InitProjectSdkService.js +2 -1
  139. package/abstractions/services/InitProjectSdkService.js.map +1 -1
  140. package/abstractions/services/InstallExtensionService.js +2 -1
  141. package/abstractions/services/InstallExtensionService.js.map +1 -1
  142. package/abstractions/services/IsRemotePulumiBackendService.js +2 -1
  143. package/abstractions/services/IsRemotePulumiBackendService.js.map +1 -1
  144. package/abstractions/services/ListAppLambdaFunctionsService.js +2 -1
  145. package/abstractions/services/ListAppLambdaFunctionsService.js.map +1 -1
  146. package/abstractions/services/ListDeployedEnvironmentsService.js +2 -1
  147. package/abstractions/services/ListDeployedEnvironmentsService.js.map +1 -1
  148. package/abstractions/services/ListPackagesInAppWorkspaceService.js +2 -1
  149. package/abstractions/services/ListPackagesInAppWorkspaceService.js.map +1 -1
  150. package/abstractions/services/ListPackagesService.js +2 -1
  151. package/abstractions/services/ListPackagesService.js.map +1 -1
  152. package/abstractions/services/LoadEnvVarsService.js +2 -1
  153. package/abstractions/services/LoadEnvVarsService.js.map +1 -1
  154. package/abstractions/services/LocalStorageService.js +2 -1
  155. package/abstractions/services/LocalStorageService.js.map +1 -1
  156. package/abstractions/services/LoggerService.js +2 -1
  157. package/abstractions/services/LoggerService.js.map +1 -1
  158. package/abstractions/services/ProjectInfoService/GetIsCiService.js +2 -1
  159. package/abstractions/services/ProjectInfoService/GetIsCiService.js.map +1 -1
  160. package/abstractions/services/ProjectInfoService/GetNpmVersionService.js +2 -1
  161. package/abstractions/services/ProjectInfoService/GetNpmVersionService.js.map +1 -1
  162. package/abstractions/services/ProjectInfoService/GetNpxVersionService.js +2 -1
  163. package/abstractions/services/ProjectInfoService/GetNpxVersionService.js.map +1 -1
  164. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js +2 -1
  165. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js.map +1 -1
  166. package/abstractions/services/ProjectInfoService/GetYarnVersionService.js +2 -1
  167. package/abstractions/services/ProjectInfoService/GetYarnVersionService.js.map +1 -1
  168. package/abstractions/services/ProjectInfoService/ProjectInfoService.js +2 -1
  169. package/abstractions/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  170. package/abstractions/services/ProjectInfoService/index.js +0 -2
  171. package/abstractions/services/ProjectSdkParamsService.js +2 -1
  172. package/abstractions/services/ProjectSdkParamsService.js.map +1 -1
  173. package/abstractions/services/PulumiExportService.js +3 -4
  174. package/abstractions/services/PulumiExportService.js.map +1 -1
  175. package/abstractions/services/PulumiGetConfigPassphraseService.js +2 -1
  176. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +1 -1
  177. package/abstractions/services/PulumiGetSecretsProviderService.js +2 -1
  178. package/abstractions/services/PulumiGetSecretsProviderService.js.map +1 -1
  179. package/abstractions/services/PulumiGetStackOutputService.js +2 -1
  180. package/abstractions/services/PulumiGetStackOutputService.js.map +1 -1
  181. package/abstractions/services/PulumiImportService.js +2 -1
  182. package/abstractions/services/PulumiImportService.js.map +1 -1
  183. package/abstractions/services/PulumiLoginService.js +2 -1
  184. package/abstractions/services/PulumiLoginService.js.map +1 -1
  185. package/abstractions/services/PulumiSelectStackService.js +2 -1
  186. package/abstractions/services/PulumiSelectStackService.js.map +1 -1
  187. package/abstractions/services/SetProjectIdService.js +2 -1
  188. package/abstractions/services/SetProjectIdService.js.map +1 -1
  189. package/abstractions/services/StdioService.js +2 -1
  190. package/abstractions/services/StdioService.js.map +1 -1
  191. package/abstractions/services/UiService.js +2 -1
  192. package/abstractions/services/UiService.js.map +1 -1
  193. package/abstractions/services/ValidateProjectConfigService.js +2 -1
  194. package/abstractions/services/ValidateProjectConfigService.js.map +1 -1
  195. package/abstractions/services/WatchedLambdaFunctionsService.js +2 -1
  196. package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -1
  197. package/abstractions/services/WcpService.js +2 -1
  198. package/abstractions/services/WcpService.js.map +1 -1
  199. package/abstractions/services/index.js +0 -2
  200. package/abstractions/types.js +0 -3
  201. package/components/Wcp.js +27 -38
  202. package/components/Wcp.js.map +1 -1
  203. package/createProjectSdkContainer.js +103 -112
  204. package/createProjectSdkContainer.js.map +1 -1
  205. package/decorators/BuildAppWithHooks.js +54 -44
  206. package/decorators/BuildAppWithHooks.js.map +1 -1
  207. package/decorators/DeployAppClearWatchedLambdaFunctions.js +27 -29
  208. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -1
  209. package/decorators/DeployAppRefreshStackOutputCache.js +26 -30
  210. package/decorators/DeployAppRefreshStackOutputCache.js.map +1 -1
  211. package/decorators/DeployAppWithHooks.js +51 -41
  212. package/decorators/DeployAppWithHooks.js.map +1 -1
  213. package/decorators/DeployAppWithWatchedLambdaReplacement.js +33 -37
  214. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -1
  215. package/decorators/GetFeatureFlagsWithLicense.js +36 -57
  216. package/decorators/GetFeatureFlagsWithLicense.js.map +1 -1
  217. package/decorators/GetPulumiServiceWithDownloadInfo.js +21 -19
  218. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -1
  219. package/decorators/WatchWithHooks.js +30 -27
  220. package/decorators/WatchWithHooks.js.map +1 -1
  221. package/decorators/index.js +0 -2
  222. package/defineExtension/createExtensionDefinition.js +12 -19
  223. package/defineExtension/createExtensionDefinition.js.map +1 -1
  224. package/defineExtension/createExtensionReactComponent.js +40 -46
  225. package/defineExtension/createExtensionReactComponent.js.map +1 -1
  226. package/defineExtension/defineExtension.js +8 -9
  227. package/defineExtension/defineExtension.js.map +1 -1
  228. package/defineExtension/index.js +0 -2
  229. package/defineExtension/models/ExtensionDefinitionModel.js +11 -10
  230. package/defineExtension/models/ExtensionDefinitionModel.js.map +1 -1
  231. package/defineExtension/models/ExtensionInstanceModel.js +23 -24
  232. package/defineExtension/models/ExtensionInstanceModel.js.map +1 -1
  233. package/defineExtension/models/index.js +0 -2
  234. package/defineExtension/types.js +0 -3
  235. package/defineExtension/zodTypes/zodSrcPath.js +35 -61
  236. package/defineExtension/zodTypes/zodSrcPath.js.map +1 -1
  237. package/exports/infra/admin.js +0 -2
  238. package/exports/infra/api.js +0 -2
  239. package/exports/infra/core.js +0 -2
  240. package/exports/infra.js +0 -2
  241. package/extensions/AdminBuildParam.js +105 -147
  242. package/extensions/AdminBuildParam.js.map +1 -1
  243. package/extensions/AdminExtension.js +64 -90
  244. package/extensions/AdminExtension.js.map +1 -1
  245. package/extensions/ApiBuildParam.js +71 -97
  246. package/extensions/ApiBuildParam.js.map +1 -1
  247. package/extensions/ApiExtension.js +71 -92
  248. package/extensions/ApiExtension.js.map +1 -1
  249. package/extensions/DatabaseSetup.js +14 -9
  250. package/extensions/DatabaseSetup.js.map +1 -1
  251. package/extensions/EnvVar.js +12 -16
  252. package/extensions/EnvVar.js.map +1 -1
  253. package/extensions/ExtensionDefinitions.js +11 -10
  254. package/extensions/ExtensionDefinitions.js.map +1 -1
  255. package/extensions/FeatureFlags.js +47 -48
  256. package/extensions/FeatureFlags.js.map +1 -1
  257. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js +20 -21
  258. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js.map +1 -1
  259. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js +20 -21
  260. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js.map +1 -1
  261. package/extensions/Project/EnsureApiDeployedBeforeWatch.js +20 -21
  262. package/extensions/Project/EnsureApiDeployedBeforeWatch.js.map +1 -1
  263. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js +22 -25
  264. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -1
  265. package/extensions/Project/EnsureTelemetryEnabledForOss.js +25 -28
  266. package/extensions/Project/EnsureTelemetryEnabledForOss.js.map +1 -1
  267. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js +29 -34
  268. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js.map +1 -1
  269. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js +30 -35
  270. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js.map +1 -1
  271. package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js +12 -9
  272. package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js.map +1 -1
  273. package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js +12 -9
  274. package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js.map +1 -1
  275. package/extensions/Project/TelemetryNoLongerNewUser.js +7 -7
  276. package/extensions/Project/TelemetryNoLongerNewUser.js.map +1 -1
  277. package/extensions/Project/ValidateEncryptionBeforeDeploy.js +22 -23
  278. package/extensions/Project/ValidateEncryptionBeforeDeploy.js.map +1 -1
  279. package/extensions/Project/ValidateProductionPulumiState.js +25 -28
  280. package/extensions/Project/ValidateProductionPulumiState.js.map +1 -1
  281. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js +46 -51
  282. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js.map +1 -1
  283. package/extensions/Project.js +29 -30
  284. package/extensions/Project.js.map +1 -1
  285. package/extensions/ProjectDecorator.js +13 -16
  286. package/extensions/ProjectDecorator.js.map +1 -1
  287. package/extensions/ProjectId.js +11 -13
  288. package/extensions/ProjectId.js.map +1 -1
  289. package/extensions/ProjectImplementation.js +14 -17
  290. package/extensions/ProjectImplementation.js.map +1 -1
  291. package/extensions/Telemetry.js +10 -9
  292. package/extensions/Telemetry.js.map +1 -1
  293. package/extensions/hooks/AdminAfterBuild.js +16 -19
  294. package/extensions/hooks/AdminAfterBuild.js.map +1 -1
  295. package/extensions/hooks/AdminAfterDeploy.js +16 -19
  296. package/extensions/hooks/AdminAfterDeploy.js.map +1 -1
  297. package/extensions/hooks/AdminBeforeBuild.js +16 -19
  298. package/extensions/hooks/AdminBeforeBuild.js.map +1 -1
  299. package/extensions/hooks/AdminBeforeDeploy.js +16 -19
  300. package/extensions/hooks/AdminBeforeDeploy.js.map +1 -1
  301. package/extensions/hooks/AdminBeforeWatch.js +16 -19
  302. package/extensions/hooks/AdminBeforeWatch.js.map +1 -1
  303. package/extensions/hooks/AfterBuild.js +15 -18
  304. package/extensions/hooks/AfterBuild.js.map +1 -1
  305. package/extensions/hooks/AfterDeploy.js +15 -18
  306. package/extensions/hooks/AfterDeploy.js.map +1 -1
  307. package/extensions/hooks/ApiAfterBuild.js +16 -19
  308. package/extensions/hooks/ApiAfterBuild.js.map +1 -1
  309. package/extensions/hooks/ApiAfterDeploy.js +16 -19
  310. package/extensions/hooks/ApiAfterDeploy.js.map +1 -1
  311. package/extensions/hooks/ApiBeforeBuild.js +16 -19
  312. package/extensions/hooks/ApiBeforeBuild.js.map +1 -1
  313. package/extensions/hooks/ApiBeforeDeploy.js +16 -19
  314. package/extensions/hooks/ApiBeforeDeploy.js.map +1 -1
  315. package/extensions/hooks/ApiBeforeWatch.js +16 -19
  316. package/extensions/hooks/ApiBeforeWatch.js.map +1 -1
  317. package/extensions/hooks/BeforeBuild.js +15 -18
  318. package/extensions/hooks/BeforeBuild.js.map +1 -1
  319. package/extensions/hooks/BeforeDeploy.js +15 -18
  320. package/extensions/hooks/BeforeDeploy.js.map +1 -1
  321. package/extensions/hooks/BeforeWatch.js +15 -18
  322. package/extensions/hooks/BeforeWatch.js.map +1 -1
  323. package/extensions/hooks/CoreAfterBuild.js +16 -19
  324. package/extensions/hooks/CoreAfterBuild.js.map +1 -1
  325. package/extensions/hooks/CoreAfterDeploy.js +16 -19
  326. package/extensions/hooks/CoreAfterDeploy.js.map +1 -1
  327. package/extensions/hooks/CoreBeforeBuild.js +16 -19
  328. package/extensions/hooks/CoreBeforeBuild.js.map +1 -1
  329. package/extensions/hooks/CoreBeforeDeploy.js +16 -19
  330. package/extensions/hooks/CoreBeforeDeploy.js.map +1 -1
  331. package/extensions/hooks/CoreBeforeWatch.js +16 -19
  332. package/extensions/hooks/CoreBeforeWatch.js.map +1 -1
  333. package/extensions/hooks/index.js +0 -2
  334. package/extensions/index.js +43 -57
  335. package/extensions/index.js.map +1 -1
  336. package/extensions/infra/Ci.js +8 -24
  337. package/extensions/infra/Ci.js.map +1 -1
  338. package/extensions/infra/Env.js +35 -92
  339. package/extensions/infra/Env.js.map +1 -1
  340. package/extensions/infra/index.js +0 -2
  341. package/extensions/pulumi/AdminStackOutputValue.js +13 -12
  342. package/extensions/pulumi/AdminStackOutputValue.js.map +1 -1
  343. package/extensions/pulumi/ApiStackOutputValue.js +13 -12
  344. package/extensions/pulumi/ApiStackOutputValue.js.map +1 -1
  345. package/extensions/pulumi/CoreStackOutputValue.js +13 -12
  346. package/extensions/pulumi/CoreStackOutputValue.js.map +1 -1
  347. package/extensions/pulumi/ProductionEnvironments.js +29 -39
  348. package/extensions/pulumi/ProductionEnvironments.js.map +1 -1
  349. package/extensions/pulumi/PulumiResourceNamePrefix.js +10 -9
  350. package/extensions/pulumi/PulumiResourceNamePrefix.js.map +1 -1
  351. package/extensions/pulumi/index.js +0 -2
  352. package/features/BuildApp/BuildApp.js +49 -40
  353. package/features/BuildApp/BuildApp.js.map +1 -1
  354. package/features/BuildApp/PackagesBuilder/PackagesBuilder.js +34 -39
  355. package/features/BuildApp/PackagesBuilder/PackagesBuilder.js.map +1 -1
  356. package/features/BuildApp/PackagesBuilder/RunnableBuildProcess.js +39 -33
  357. package/features/BuildApp/PackagesBuilder/RunnableBuildProcess.js.map +1 -1
  358. package/features/BuildApp/PackagesBuilder/RunnableBuildProcesses.js +39 -46
  359. package/features/BuildApp/PackagesBuilder/RunnableBuildProcesses.js.map +1 -1
  360. package/features/BuildApp/PackagesBuilder/worker.js +26 -34
  361. package/features/BuildApp/PackagesBuilder/worker.js.map +1 -1
  362. package/features/BuildApp/index.js +0 -2
  363. package/features/DeployApp/DeployApp.js +79 -79
  364. package/features/DeployApp/DeployApp.js.map +1 -1
  365. package/features/DeployApp/index.js +0 -2
  366. package/features/DestroyApp/DestroyApp.js +60 -46
  367. package/features/DestroyApp/DestroyApp.js.map +1 -1
  368. package/features/DestroyApp/index.js +0 -2
  369. package/features/ExportStack/ExportStack.js +21 -16
  370. package/features/ExportStack/ExportStack.js.map +1 -1
  371. package/features/ExportStack/index.js +0 -2
  372. package/features/GetApp/GetApp.js +14 -11
  373. package/features/GetApp/GetApp.js.map +1 -1
  374. package/features/GetApp/index.js +0 -2
  375. package/features/GetAppOutput/GetAppOutput.js +44 -33
  376. package/features/GetAppOutput/GetAppOutput.js.map +1 -1
  377. package/features/GetAppOutput/index.js +0 -2
  378. package/features/GetAppStackOutput/GetAppStackOutput.js +20 -15
  379. package/features/GetAppStackOutput/GetAppStackOutput.js.map +1 -1
  380. package/features/GetAppStackOutput/index.js +0 -2
  381. package/features/GetFeatureFlags/GetFeatureFlags.js +20 -19
  382. package/features/GetFeatureFlags/GetFeatureFlags.js.map +1 -1
  383. package/features/GetFeatureFlags/index.js +0 -2
  384. package/features/GetLogger/GetLogger.js +14 -11
  385. package/features/GetLogger/GetLogger.js.map +1 -1
  386. package/features/GetLogger/index.js +0 -2
  387. package/features/GetProductionEnvironments/GetProductionEnvironments.js +24 -19
  388. package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
  389. package/features/GetProductionEnvironments/index.js +0 -2
  390. package/features/GetProject/GetProject.js +14 -11
  391. package/features/GetProject/GetProject.js.map +1 -1
  392. package/features/GetProject/index.js +0 -2
  393. package/features/GetProjectConfig/GetProjectConfig.js +14 -11
  394. package/features/GetProjectConfig/GetProjectConfig.js.map +1 -1
  395. package/features/GetProjectConfig/index.js +0 -2
  396. package/features/GetProjectInfo/GetProjectInfo.js +14 -11
  397. package/features/GetProjectInfo/GetProjectInfo.js.map +1 -1
  398. package/features/GetProjectInfo/index.js +0 -2
  399. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +18 -17
  400. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +1 -1
  401. package/features/GetPulumiResourceNamePrefix/index.js +0 -2
  402. package/features/InstallExtension/InstallExtension.js +14 -11
  403. package/features/InstallExtension/InstallExtension.js.map +1 -1
  404. package/features/InstallExtension/index.js +0 -2
  405. package/features/IsCi/IsCi.js +14 -11
  406. package/features/IsCi/IsCi.js.map +1 -1
  407. package/features/IsCi/index.js +0 -2
  408. package/features/IsTelemetryEnabled/IsTelemetryEnabled.js +19 -18
  409. package/features/IsTelemetryEnabled/IsTelemetryEnabled.js.map +1 -1
  410. package/features/IsTelemetryEnabled/index.js +0 -2
  411. package/features/IsWcpEnabled/IsWcpEnabled.js +15 -12
  412. package/features/IsWcpEnabled/IsWcpEnabled.js.map +1 -1
  413. package/features/IsWcpEnabled/index.js +0 -2
  414. package/features/IsWebinyJsRepo/IsWebinyJsRepo.js +17 -14
  415. package/features/IsWebinyJsRepo/IsWebinyJsRepo.js.map +1 -1
  416. package/features/IsWebinyJsRepo/index.js +0 -2
  417. package/features/RefreshApp/RefreshApp.js +57 -46
  418. package/features/RefreshApp/RefreshApp.js.map +1 -1
  419. package/features/RefreshApp/index.js +0 -2
  420. package/features/RunPulumiCommand/RunPulumiCommand.js +54 -43
  421. package/features/RunPulumiCommand/RunPulumiCommand.js.map +1 -1
  422. package/features/RunPulumiCommand/index.js +0 -2
  423. package/features/ValidateProjectConfig/ValidateProjectConfig.js +14 -11
  424. package/features/ValidateProjectConfig/ValidateProjectConfig.js.map +1 -1
  425. package/features/ValidateProjectConfig/index.js +0 -2
  426. package/features/Watch/Watch.js +178 -181
  427. package/features/Watch/Watch.js.map +1 -1
  428. package/features/Watch/getIotEndpoint.js +14 -12
  429. package/features/Watch/getIotEndpoint.js.map +1 -1
  430. package/features/Watch/index.js +0 -2
  431. package/features/Watch/initInvocationForwarding.js +76 -95
  432. package/features/Watch/initInvocationForwarding.js.map +1 -1
  433. package/features/Watch/localInvocationWorker.js +24 -33
  434. package/features/Watch/localInvocationWorker.js.map +1 -1
  435. package/features/Watch/replaceLambdaFunctions.js +61 -84
  436. package/features/Watch/replaceLambdaFunctions.js.map +1 -1
  437. package/features/Watch/watchers/BasePackagesWatcher.js +10 -13
  438. package/features/Watch/watchers/BasePackagesWatcher.js.map +1 -1
  439. package/features/Watch/watchers/MultiplePackagesWatcher.js +11 -12
  440. package/features/Watch/watchers/MultiplePackagesWatcher.js.map +1 -1
  441. package/features/Watch/watchers/PackagesWatcher.js +15 -18
  442. package/features/Watch/watchers/PackagesWatcher.js.map +1 -1
  443. package/features/Watch/watchers/RunnableWatchProcess.js +41 -40
  444. package/features/Watch/watchers/RunnableWatchProcess.js.map +1 -1
  445. package/features/Watch/watchers/RunnableWatchProcesses.js +35 -34
  446. package/features/Watch/watchers/RunnableWatchProcesses.js.map +1 -1
  447. package/features/Watch/watchers/SinglePackageWatcher.js +11 -8
  448. package/features/Watch/watchers/SinglePackageWatcher.js.map +1 -1
  449. package/features/Watch/watchers/WebinyConfigWatcher.js +30 -40
  450. package/features/Watch/watchers/WebinyConfigWatcher.js.map +1 -1
  451. package/features/Watch/watchers/ZeroPackagesWatcher.js +5 -5
  452. package/features/Watch/watchers/ZeroPackagesWatcher.js.map +1 -1
  453. package/features/Watch/watchers/utils/measureDuration.js +7 -8
  454. package/features/Watch/watchers/utils/measureDuration.js.map +1 -1
  455. package/features/Watch/watchers/worker.js +12 -21
  456. package/features/Watch/watchers/worker.js.map +1 -1
  457. package/features/hooks/AdminAfterBuild/AdminBeforeBuild.js +19 -15
  458. package/features/hooks/AdminAfterBuild/AdminBeforeBuild.js.map +1 -1
  459. package/features/hooks/AdminAfterBuild/index.js +0 -2
  460. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js +19 -15
  461. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js.map +1 -1
  462. package/features/hooks/AdminAfterDeploy/index.js +0 -2
  463. package/features/hooks/AdminBeforeBuild/AdminBeforeBuild.js +19 -15
  464. package/features/hooks/AdminBeforeBuild/AdminBeforeBuild.js.map +1 -1
  465. package/features/hooks/AdminBeforeBuild/index.js +0 -2
  466. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +19 -15
  467. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +1 -1
  468. package/features/hooks/AdminBeforeDeploy/index.js +0 -2
  469. package/features/hooks/AdminBeforeWatch/AdminBeforeWatch.js +18 -14
  470. package/features/hooks/AdminBeforeWatch/AdminBeforeWatch.js.map +1 -1
  471. package/features/hooks/AdminBeforeWatch/index.js +0 -2
  472. package/features/hooks/AfterBuild/AfterBuild.js +19 -15
  473. package/features/hooks/AfterBuild/AfterBuild.js.map +1 -1
  474. package/features/hooks/AfterBuild/index.js +0 -2
  475. package/features/hooks/AfterDeploy/AfterDeploy.js +19 -15
  476. package/features/hooks/AfterDeploy/AfterDeploy.js.map +1 -1
  477. package/features/hooks/AfterDeploy/index.js +0 -2
  478. package/features/hooks/ApiAfterBuild/ApiBeforeBuild.js +18 -14
  479. package/features/hooks/ApiAfterBuild/ApiBeforeBuild.js.map +1 -1
  480. package/features/hooks/ApiAfterBuild/index.js +0 -2
  481. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js +18 -14
  482. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js.map +1 -1
  483. package/features/hooks/ApiAfterDeploy/index.js +0 -2
  484. package/features/hooks/ApiBeforeBuild/ApiBeforeBuild.js +18 -14
  485. package/features/hooks/ApiBeforeBuild/ApiBeforeBuild.js.map +1 -1
  486. package/features/hooks/ApiBeforeBuild/index.js +0 -2
  487. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +18 -14
  488. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +1 -1
  489. package/features/hooks/ApiBeforeDeploy/index.js +0 -2
  490. package/features/hooks/ApiBeforeWatch/ApiBeforeWatch.js +18 -14
  491. package/features/hooks/ApiBeforeWatch/ApiBeforeWatch.js.map +1 -1
  492. package/features/hooks/ApiBeforeWatch/index.js +0 -2
  493. package/features/hooks/BeforeBuild/BeforeBuild.js +19 -15
  494. package/features/hooks/BeforeBuild/BeforeBuild.js.map +1 -1
  495. package/features/hooks/BeforeBuild/index.js +0 -2
  496. package/features/hooks/BeforeDeploy/BeforeDeploy.js +19 -15
  497. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +1 -1
  498. package/features/hooks/BeforeDeploy/index.js +0 -2
  499. package/features/hooks/BeforeWatch/BeforeWatch.js +19 -15
  500. package/features/hooks/BeforeWatch/BeforeWatch.js.map +1 -1
  501. package/features/hooks/BeforeWatch/index.js +0 -2
  502. package/features/hooks/CoreAfterBuild/CoreBeforeBuild.js +18 -14
  503. package/features/hooks/CoreAfterBuild/CoreBeforeBuild.js.map +1 -1
  504. package/features/hooks/CoreAfterBuild/index.js +0 -2
  505. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js +18 -14
  506. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js.map +1 -1
  507. package/features/hooks/CoreAfterDeploy/index.js +0 -2
  508. package/features/hooks/CoreBeforeBuild/CoreBeforeBuild.js +18 -14
  509. package/features/hooks/CoreBeforeBuild/CoreBeforeBuild.js.map +1 -1
  510. package/features/hooks/CoreBeforeBuild/index.js +0 -2
  511. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +18 -14
  512. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +1 -1
  513. package/features/hooks/CoreBeforeDeploy/index.js +0 -2
  514. package/features/hooks/CoreBeforeWatch/CoreBeforeWatch.js +18 -14
  515. package/features/hooks/CoreBeforeWatch/CoreBeforeWatch.js.map +1 -1
  516. package/features/hooks/CoreBeforeWatch/index.js +0 -2
  517. package/features/hooks/index.js +0 -2
  518. package/features/index.js +0 -2
  519. package/index.js +5 -10
  520. package/index.js.map +1 -1
  521. package/models/AppModel.js +20 -19
  522. package/models/AppModel.js.map +1 -1
  523. package/models/AppPackageModel.js +10 -9
  524. package/models/AppPackageModel.js.map +1 -1
  525. package/models/PathModel.js +23 -26
  526. package/models/PathModel.js.map +1 -1
  527. package/models/ProjectConfigModel.js +12 -16
  528. package/models/ProjectConfigModel.js.map +1 -1
  529. package/models/ProjectModel.js +37 -36
  530. package/models/ProjectModel.js.map +1 -1
  531. package/models/UrlModel.js +23 -23
  532. package/models/UrlModel.js.map +1 -1
  533. package/models/WcpEnvironmentModel.js +23 -22
  534. package/models/WcpEnvironmentModel.js.map +1 -1
  535. package/models/WcpUserModel.js +13 -12
  536. package/models/WcpUserModel.js.map +1 -1
  537. package/models/WcpUserPatModel.js +12 -11
  538. package/models/WcpUserPatModel.js.map +1 -1
  539. package/models/index.js +0 -2
  540. package/package.json +14 -14
  541. package/rslib-runtime.js +14 -0
  542. package/rslib-runtime.js.map +1 -0
  543. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js +62 -69
  544. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js.map +1 -1
  545. package/services/BuildAppWorkspaceService/index.js +0 -2
  546. package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js +21 -17
  547. package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js.map +1 -1
  548. package/services/BuildProjectWorkspaceService/index.js +0 -2
  549. package/services/GetAppPackagesService/GetAppPackagesService.js +24 -23
  550. package/services/GetAppPackagesService/GetAppPackagesService.js.map +1 -1
  551. package/services/GetAppPackagesService/index.js +0 -2
  552. package/services/GetAppService/GetAppService.js +24 -27
  553. package/services/GetAppService/GetAppService.js.map +1 -1
  554. package/services/GetAppService/index.js +0 -2
  555. package/services/GetCwdService/GetCwdService.js +15 -12
  556. package/services/GetCwdService/GetCwdService.js.map +1 -1
  557. package/services/GetCwdService/index.js +0 -2
  558. package/services/GetProjectConfigService/EnvContext.js +29 -38
  559. package/services/GetProjectConfigService/EnvContext.js.map +1 -1
  560. package/services/GetProjectConfigService/GetProjectConfigService.js +102 -115
  561. package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
  562. package/services/GetProjectConfigService/ProductionEnvironmentsContext.js +13 -18
  563. package/services/GetProjectConfigService/ProductionEnvironmentsContext.js.map +1 -1
  564. package/services/GetProjectConfigService/WcpProjectLicenseContext.js +32 -37
  565. package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
  566. package/services/GetProjectConfigService/index.js +0 -2
  567. package/services/GetProjectConfigService/renderConfig.js +32 -38
  568. package/services/GetProjectConfigService/renderConfig.js.map +1 -1
  569. package/services/GetProjectConfigService/renderConfigWorker.js +37 -48
  570. package/services/GetProjectConfigService/renderConfigWorker.js.map +1 -1
  571. package/services/GetProjectIdService/GetProjectIdService.js +22 -23
  572. package/services/GetProjectIdService/GetProjectIdService.js.map +1 -1
  573. package/services/GetProjectIdService/index.js +0 -2
  574. package/services/GetProjectService/GetProjectService.js +43 -45
  575. package/services/GetProjectService/GetProjectService.js.map +1 -1
  576. package/services/GetProjectService/index.js +0 -2
  577. package/services/GetProjectVersionService/GetProjectVersionService.js +23 -22
  578. package/services/GetProjectVersionService/GetProjectVersionService.js.map +1 -1
  579. package/services/GetProjectVersionService/index.js +0 -2
  580. package/services/GetPulumiService/GetPulumiService.js +36 -41
  581. package/services/GetPulumiService/GetPulumiService.js.map +1 -1
  582. package/services/GetPulumiService/index.js +0 -2
  583. package/services/InitProjectSdkService/InitProjectSdkService.js +36 -46
  584. package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
  585. package/services/InitProjectSdkService/applyEnvVars.js +5 -8
  586. package/services/InitProjectSdkService/applyEnvVars.js.map +1 -1
  587. package/services/InitProjectSdkService/applyWcpEnvVars.js +91 -136
  588. package/services/InitProjectSdkService/applyWcpEnvVars.js.map +1 -1
  589. package/services/InitProjectSdkService/index.js +0 -2
  590. package/services/InitProjectSdkService/registerDecorators.js +10 -7
  591. package/services/InitProjectSdkService/registerDecorators.js.map +1 -1
  592. package/services/InitProjectSdkService/registerHooks.js +30 -7
  593. package/services/InitProjectSdkService/registerHooks.js.map +1 -1
  594. package/services/InitProjectSdkService/registerImplementations.js +10 -11
  595. package/services/InitProjectSdkService/registerImplementations.js.map +1 -1
  596. package/services/InitProjectSdkService/registerPulumiExtensions.js +12 -9
  597. package/services/InitProjectSdkService/registerPulumiExtensions.js.map +1 -1
  598. package/services/InstallExtensionService/InstallExtensionService.js +78 -121
  599. package/services/InstallExtensionService/InstallExtensionService.js.map +1 -1
  600. package/services/InstallExtensionService/downloadFolderFromS3.js +46 -65
  601. package/services/InstallExtensionService/downloadFolderFromS3.js.map +1 -1
  602. package/services/InstallExtensionService/index.js +0 -2
  603. package/services/InstallExtensionService/mergePackageJson.js +15 -25
  604. package/services/InstallExtensionService/mergePackageJson.js.map +1 -1
  605. package/services/InstallExtensionService/types.js +0 -3
  606. package/services/InstallExtensionService/updateWebinyConfig.js +60 -137
  607. package/services/InstallExtensionService/updateWebinyConfig.js.map +1 -1
  608. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +9 -17
  609. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +1 -1
  610. package/services/IsRemotePulumiBackendService/index.js +0 -2
  611. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +50 -73
  612. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +1 -1
  613. package/services/ListAppLambdaFunctionsService/index.js +0 -2
  614. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +21 -23
  615. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +1 -1
  616. package/services/ListDeployedEnvironmentsService/index.js +0 -2
  617. package/services/ListPackagesInAppWorkspaceService/ListPackagesInAppWorkspaceService.js +34 -29
  618. package/services/ListPackagesInAppWorkspaceService/ListPackagesInAppWorkspaceService.js.map +1 -1
  619. package/services/ListPackagesInAppWorkspaceService/index.js +0 -2
  620. package/services/ListPackagesService/ListPackagesService.js +81 -114
  621. package/services/ListPackagesService/ListPackagesService.js.map +1 -1
  622. package/services/ListPackagesService/index.js +0 -2
  623. package/services/LoadEnvVarsService/LoadEnvVarsService.js +28 -29
  624. package/services/LoadEnvVarsService/LoadEnvVarsService.js.map +1 -1
  625. package/services/LoadEnvVarsService/index.js +0 -2
  626. package/services/LocalStorageService/LocalStorageService.js +41 -44
  627. package/services/LocalStorageService/LocalStorageService.js.map +1 -1
  628. package/services/LocalStorageService/index.js +0 -2
  629. package/services/LoggerService/LoggerService.js +76 -84
  630. package/services/LoggerService/LoggerService.js.map +1 -1
  631. package/services/LoggerService/index.js +0 -2
  632. package/services/ProjectInfoService/GetIsCiService.js +9 -8
  633. package/services/ProjectInfoService/GetIsCiService.js.map +1 -1
  634. package/services/ProjectInfoService/GetNpmVersionService.js +9 -8
  635. package/services/ProjectInfoService/GetNpmVersionService.js.map +1 -1
  636. package/services/ProjectInfoService/GetNpxVersionService.js +9 -8
  637. package/services/ProjectInfoService/GetNpxVersionService.js.map +1 -1
  638. package/services/ProjectInfoService/GetPulumiVersionService.js +38 -30
  639. package/services/ProjectInfoService/GetPulumiVersionService.js.map +1 -1
  640. package/services/ProjectInfoService/GetYarnVersionService.js +9 -8
  641. package/services/ProjectInfoService/GetYarnVersionService.js.map +1 -1
  642. package/services/ProjectInfoService/ProjectInfoService.js +56 -51
  643. package/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  644. package/services/ProjectInfoService/index.js +0 -2
  645. package/services/ProjectSdkParamsService/ProjectSdkParamsService.js +37 -34
  646. package/services/ProjectSdkParamsService/ProjectSdkParamsService.js.map +1 -1
  647. package/services/ProjectSdkParamsService/index.js +0 -2
  648. package/services/PulumiExportService/PulumiExportService.js +42 -35
  649. package/services/PulumiExportService/PulumiExportService.js.map +1 -1
  650. package/services/PulumiExportService/index.js +0 -2
  651. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +9 -8
  652. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +1 -1
  653. package/services/PulumiGetConfigPassphraseService/index.js +0 -2
  654. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +9 -8
  655. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +1 -1
  656. package/services/PulumiGetSecretsProviderService/index.js +0 -2
  657. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +108 -100
  658. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -1
  659. package/services/PulumiGetStackOutputService/index.js +0 -2
  660. package/services/PulumiGetStackOutputService/mapStackOutput.js +17 -29
  661. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -1
  662. package/services/PulumiImportService/PulumiImportService.js +48 -45
  663. package/services/PulumiImportService/PulumiImportService.js.map +1 -1
  664. package/services/PulumiImportService/index.js +0 -2
  665. package/services/PulumiLoginService/PulumiLoginService.js +43 -40
  666. package/services/PulumiLoginService/PulumiLoginService.js.map +1 -1
  667. package/services/PulumiLoginService/index.js +0 -2
  668. package/services/PulumiSelectStackService/PulumiSelectStackService.js +91 -86
  669. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -1
  670. package/services/PulumiSelectStackService/index.js +0 -2
  671. package/services/SetProjectIdService/SetProjectIdService.js +43 -57
  672. package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
  673. package/services/SetProjectIdService/index.js +0 -2
  674. package/services/StdioService/StdioService.js +15 -14
  675. package/services/StdioService/StdioService.js.map +1 -1
  676. package/services/StdioService/index.js +0 -2
  677. package/services/UiService/UiService.js +55 -58
  678. package/services/UiService/UiService.js.map +1 -1
  679. package/services/UiService/index.js +0 -2
  680. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js +18 -19
  681. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js.map +1 -1
  682. package/services/ValidateProjectConfigService/index.js +0 -2
  683. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +47 -54
  684. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -1
  685. package/services/WatchedLambdaFunctionsService/index.js +0 -2
  686. package/services/WcpService/CreateUserPat.js +20 -23
  687. package/services/WcpService/CreateUserPat.js.map +1 -1
  688. package/services/WcpService/GenerateUserPat.js +15 -18
  689. package/services/WcpService/GenerateUserPat.js.map +1 -1
  690. package/services/WcpService/GetPatFromLocalStorage.js +9 -10
  691. package/services/WcpService/GetPatFromLocalStorage.js.map +1 -1
  692. package/services/WcpService/GetProjectEnvironment.js +34 -47
  693. package/services/WcpService/GetProjectEnvironment.js.map +1 -1
  694. package/services/WcpService/GetProjectLicense.js +28 -38
  695. package/services/WcpService/GetProjectLicense.js.map +1 -1
  696. package/services/WcpService/GetUser.js +43 -46
  697. package/services/WcpService/GetUser.js.map +1 -1
  698. package/services/WcpService/GetUserPat.js +20 -23
  699. package/services/WcpService/GetUserPat.js.map +1 -1
  700. package/services/WcpService/LogoutUser.js +9 -8
  701. package/services/WcpService/LogoutUser.js.map +1 -1
  702. package/services/WcpService/StorePatToLocalStorage.js +9 -10
  703. package/services/WcpService/StorePatToLocalStorage.js.map +1 -1
  704. package/services/WcpService/UnsetPatFromLocalStorage.js +9 -10
  705. package/services/WcpService/UnsetPatFromLocalStorage.js.map +1 -1
  706. package/services/WcpService/WcpGqlClient.js +6 -5
  707. package/services/WcpService/WcpGqlClient.js.map +1 -1
  708. package/services/WcpService/WcpService.js +74 -75
  709. package/services/WcpService/WcpService.js.map +1 -1
  710. package/services/WcpService/index.js +0 -2
  711. package/services/index.js +0 -2
  712. package/utils/ExtensionSrcResolver.js +51 -106
  713. package/utils/ExtensionSrcResolver.js.map +1 -1
  714. package/utils/constants.js +8 -7
  715. package/utils/constants.js.map +1 -1
  716. package/utils/createPathResolver.js +2 -5
  717. package/utils/createPathResolver.js.map +1 -1
  718. package/utils/env/configuration.js +16 -25
  719. package/utils/env/configuration.js.map +1 -1
  720. package/utils/env/index.js +0 -2
  721. package/utils/env/types.js +0 -3
  722. package/utils/env/withEnv.js +4 -7
  723. package/utils/env/withEnv.js.map +1 -1
  724. package/utils/env/withEnvVariant.js +8 -11
  725. package/utils/env/withEnvVariant.js.map +1 -1
  726. package/utils/env/withProjectName.js +4 -9
  727. package/utils/env/withProjectName.js.map +1 -1
  728. package/utils/env/withPulumiConfigPassphrase.js +4 -8
  729. package/utils/env/withPulumiConfigPassphrase.js.map +1 -1
  730. package/utils/env/withRegion.js +10 -17
  731. package/utils/env/withRegion.js.map +1 -1
  732. package/utils/getRandomColorForString.js +86 -8
  733. package/utils/getRandomColorForString.js.map +1 -1
  734. package/utils/getStackName.js +11 -18
  735. package/utils/getStackName.js.map +1 -1
  736. package/utils/getTemplatesFolderPath.js +6 -8
  737. package/utils/getTemplatesFolderPath.js.map +1 -1
  738. package/utils/index.js +0 -2
  739. package/utils/isValidRegionName.js +8 -13
  740. package/utils/isValidRegionName.js.map +1 -1
  741. package/utils/isValidVariantName.js +11 -10
  742. package/utils/isValidVariantName.js.map +1 -1
  743. package/utils/measureDuration.js +7 -8
  744. package/utils/measureDuration.js.map +1 -1
  745. package/utils/projectSdkContext.js +23 -39
  746. package/utils/projectSdkContext.js.map +1 -1
  747. package/utils/regions.js +75 -63
  748. package/utils/regions.js.map +1 -1
  749. package/utils/registerExtension.js +6 -15
  750. package/utils/registerExtension.js.map +1 -1
  751. package/utils/requireConfig.js +7 -12
  752. package/utils/requireConfig.js.map +1 -1
  753. package/utils/toImportSpecifier.js +3 -9
  754. package/utils/toImportSpecifier.js.map +1 -1
  755. package/abstractions/features/hooks/index.js.map +0 -1
  756. package/abstractions/features/index.js.map +0 -1
  757. package/abstractions/index.js.map +0 -1
  758. package/abstractions/models/IAppModel.js.map +0 -1
  759. package/abstractions/models/IAppPackageModel.js.map +0 -1
  760. package/abstractions/models/IPathModel.js.map +0 -1
  761. package/abstractions/models/IProjectConfigDto.js.map +0 -1
  762. package/abstractions/models/IProjectConfigModel.js.map +0 -1
  763. package/abstractions/models/IProjectModel.js.map +0 -1
  764. package/abstractions/models/IUrlModel.js.map +0 -1
  765. package/abstractions/models/IWcpEnvironmentDto.js.map +0 -1
  766. package/abstractions/models/IWcpEnvironmentModel.js.map +0 -1
  767. package/abstractions/models/IWcpUserDto.js.map +0 -1
  768. package/abstractions/models/IWcpUserModel.js.map +0 -1
  769. package/abstractions/models/IWcpUserPatDto.js.map +0 -1
  770. package/abstractions/models/IWcpUserPatModel.js.map +0 -1
  771. package/abstractions/models/PackagesBuilder/IPackagesBuilder.js.map +0 -1
  772. package/abstractions/models/PackagesBuilder/IRunnableBuildProcess.js.map +0 -1
  773. package/abstractions/models/PackagesBuilder/IRunnableBuildProcesses.js.map +0 -1
  774. package/abstractions/models/PackagesBuilder/index.js.map +0 -1
  775. package/abstractions/models/index.js.map +0 -1
  776. package/abstractions/services/ProjectInfoService/index.js.map +0 -1
  777. package/abstractions/services/index.js.map +0 -1
  778. package/abstractions/types.js.map +0 -1
  779. package/decorators/index.js.map +0 -1
  780. package/defineExtension/index.js.map +0 -1
  781. package/defineExtension/models/index.js.map +0 -1
  782. package/defineExtension/types.js.map +0 -1
  783. package/exports/infra/admin.js.map +0 -1
  784. package/exports/infra/api.js.map +0 -1
  785. package/exports/infra/core.js.map +0 -1
  786. package/exports/infra.js.map +0 -1
  787. package/extensions/hooks/index.js.map +0 -1
  788. package/extensions/infra/index.js.map +0 -1
  789. package/extensions/pulumi/index.js.map +0 -1
  790. package/features/BuildApp/index.js.map +0 -1
  791. package/features/DeployApp/index.js.map +0 -1
  792. package/features/DestroyApp/index.js.map +0 -1
  793. package/features/ExportStack/index.js.map +0 -1
  794. package/features/GetApp/index.js.map +0 -1
  795. package/features/GetAppOutput/index.js.map +0 -1
  796. package/features/GetAppStackOutput/index.js.map +0 -1
  797. package/features/GetFeatureFlags/index.js.map +0 -1
  798. package/features/GetLogger/index.js.map +0 -1
  799. package/features/GetProductionEnvironments/index.js.map +0 -1
  800. package/features/GetProject/index.js.map +0 -1
  801. package/features/GetProjectConfig/index.js.map +0 -1
  802. package/features/GetProjectInfo/index.js.map +0 -1
  803. package/features/GetPulumiResourceNamePrefix/index.js.map +0 -1
  804. package/features/InstallExtension/index.js.map +0 -1
  805. package/features/IsCi/index.js.map +0 -1
  806. package/features/IsTelemetryEnabled/index.js.map +0 -1
  807. package/features/IsWcpEnabled/index.js.map +0 -1
  808. package/features/IsWebinyJsRepo/index.js.map +0 -1
  809. package/features/RefreshApp/index.js.map +0 -1
  810. package/features/RunPulumiCommand/index.js.map +0 -1
  811. package/features/ValidateProjectConfig/index.js.map +0 -1
  812. package/features/Watch/index.js.map +0 -1
  813. package/features/hooks/AdminAfterBuild/index.js.map +0 -1
  814. package/features/hooks/AdminAfterDeploy/index.js.map +0 -1
  815. package/features/hooks/AdminBeforeBuild/index.js.map +0 -1
  816. package/features/hooks/AdminBeforeDeploy/index.js.map +0 -1
  817. package/features/hooks/AdminBeforeWatch/index.js.map +0 -1
  818. package/features/hooks/AfterBuild/index.js.map +0 -1
  819. package/features/hooks/AfterDeploy/index.js.map +0 -1
  820. package/features/hooks/ApiAfterBuild/index.js.map +0 -1
  821. package/features/hooks/ApiAfterDeploy/index.js.map +0 -1
  822. package/features/hooks/ApiBeforeBuild/index.js.map +0 -1
  823. package/features/hooks/ApiBeforeDeploy/index.js.map +0 -1
  824. package/features/hooks/ApiBeforeWatch/index.js.map +0 -1
  825. package/features/hooks/BeforeBuild/index.js.map +0 -1
  826. package/features/hooks/BeforeDeploy/index.js.map +0 -1
  827. package/features/hooks/BeforeWatch/index.js.map +0 -1
  828. package/features/hooks/CoreAfterBuild/index.js.map +0 -1
  829. package/features/hooks/CoreAfterDeploy/index.js.map +0 -1
  830. package/features/hooks/CoreBeforeBuild/index.js.map +0 -1
  831. package/features/hooks/CoreBeforeDeploy/index.js.map +0 -1
  832. package/features/hooks/CoreBeforeWatch/index.js.map +0 -1
  833. package/features/hooks/index.js.map +0 -1
  834. package/features/index.js.map +0 -1
  835. package/models/index.js.map +0 -1
  836. package/services/BuildAppWorkspaceService/index.js.map +0 -1
  837. package/services/BuildProjectWorkspaceService/index.js.map +0 -1
  838. package/services/GetAppPackagesService/index.js.map +0 -1
  839. package/services/GetAppService/index.js.map +0 -1
  840. package/services/GetCwdService/index.js.map +0 -1
  841. package/services/GetProjectConfigService/index.js.map +0 -1
  842. package/services/GetProjectIdService/index.js.map +0 -1
  843. package/services/GetProjectService/index.js.map +0 -1
  844. package/services/GetProjectVersionService/index.js.map +0 -1
  845. package/services/GetPulumiService/index.js.map +0 -1
  846. package/services/InitProjectSdkService/index.js.map +0 -1
  847. package/services/InstallExtensionService/index.js.map +0 -1
  848. package/services/InstallExtensionService/types.js.map +0 -1
  849. package/services/IsRemotePulumiBackendService/index.js.map +0 -1
  850. package/services/ListAppLambdaFunctionsService/index.js.map +0 -1
  851. package/services/ListDeployedEnvironmentsService/index.js.map +0 -1
  852. package/services/ListPackagesInAppWorkspaceService/index.js.map +0 -1
  853. package/services/ListPackagesService/index.js.map +0 -1
  854. package/services/LoadEnvVarsService/index.js.map +0 -1
  855. package/services/LocalStorageService/index.js.map +0 -1
  856. package/services/LoggerService/index.js.map +0 -1
  857. package/services/ProjectInfoService/index.js.map +0 -1
  858. package/services/ProjectSdkParamsService/index.js.map +0 -1
  859. package/services/PulumiExportService/index.js.map +0 -1
  860. package/services/PulumiGetConfigPassphraseService/index.js.map +0 -1
  861. package/services/PulumiGetSecretsProviderService/index.js.map +0 -1
  862. package/services/PulumiGetStackOutputService/index.js.map +0 -1
  863. package/services/PulumiImportService/index.js.map +0 -1
  864. package/services/PulumiLoginService/index.js.map +0 -1
  865. package/services/PulumiSelectStackService/index.js.map +0 -1
  866. package/services/SetProjectIdService/index.js.map +0 -1
  867. package/services/StdioService/index.js.map +0 -1
  868. package/services/UiService/index.js.map +0 -1
  869. package/services/ValidateProjectConfigService/index.js.map +0 -1
  870. package/services/WatchedLambdaFunctionsService/index.js.map +0 -1
  871. package/services/WcpService/index.js.map +0 -1
  872. package/services/index.js.map +0 -1
  873. package/utils/env/index.js.map +0 -1
  874. package/utils/env/types.js.map +0 -1
  875. package/utils/index.js.map +0 -1
@@ -1,147 +1,70 @@
1
1
  import fs from "fs";
2
- /**
3
- * Serializes a props object to JSX attribute syntax.
4
- * Examples:
5
- * - { secretKey: "value" } => 'secretKey={"value"}'
6
- * - { enabled: true } => 'enabled={true}'
7
- * - { count: 42 } => 'count={42}'
8
- * - { config: { key: "value" } } => 'config={{"key":"value"}}'
9
- */
10
- const serializePropsToJsx = props => {
11
- const attributes = [];
12
- for (const [key, value] of Object.entries(props)) {
13
- // Skip undefined values.
14
- if (value === undefined) {
15
- continue;
2
+ const serializePropsToJsx = (props)=>{
3
+ const attributes = [];
4
+ for (const [key, value] of Object.entries(props)){
5
+ if (void 0 === value) continue;
6
+ let serializedValue;
7
+ if ("string" == typeof value) serializedValue = `{${JSON.stringify(value)}}`;
8
+ else if ("number" == typeof value || "boolean" == typeof value) serializedValue = `{${value}}`;
9
+ else if (null === value) serializedValue = "{null}";
10
+ else Array.isArray(value), serializedValue = `{${JSON.stringify(value)}}`;
11
+ attributes.push(`${key}=${serializedValue}`);
16
12
  }
17
-
18
- // Determine the serialization based on value type.
19
- let serializedValue;
20
- if (typeof value === "string") {
21
- // Strings: use JSON.stringify to handle escaping, then wrap in curly braces.
22
- serializedValue = `{${JSON.stringify(value)}}`;
23
- } else if (typeof value === "number" || typeof value === "boolean") {
24
- // Numbers and booleans: wrap in curly braces without quotes.
25
- serializedValue = `{${value}}`;
26
- } else if (value === null) {
27
- // Null values.
28
- serializedValue = `{null}`;
29
- } else if (Array.isArray(value) || typeof value === "object") {
30
- // Arrays and objects: use JSON.stringify, then wrap in curly braces.
31
- serializedValue = `{${JSON.stringify(value)}}`;
32
- } else {
33
- // Fallback for any other types.
34
- serializedValue = `{${JSON.stringify(value)}}`;
35
- }
36
- attributes.push(`${key}=${serializedValue}`);
37
- }
38
- return attributes.join(" ");
13
+ return attributes.join(" ");
39
14
  };
40
-
41
- /**
42
- * Adds a component to the Extensions function in the webiny.config.tsx content.
43
- */
44
- const addComponentToExtensions = (content, componentName, props) => {
45
- // Serialize props to JSX attributes.
46
- const propsString = props ? serializePropsToJsx(props) : "";
47
-
48
- // Generate component tag with or without props.
49
- const componentTag = propsString ? `<${componentName} ${propsString} />` : `<${componentName} />`;
50
-
51
- // Check if component already exists.
52
- if (content.includes(componentTag)) {
53
- return content;
54
- }
55
-
56
- // Find the Extensions function's return statement and add component before the final </>.
57
- // Strategy: Find "export const Extensions" block, then find the last </> and insert before it.
58
- const extensionsFuncRegex = /export const Extensions = \(\) => \{[\s\S]*?\};/;
59
- const extensionsFuncMatch = content.match(extensionsFuncRegex);
60
- if (!extensionsFuncMatch) {
61
- return content;
62
- }
63
- const funcContent = extensionsFuncMatch[0];
64
- // Find all </> in the function - the last one closes the return statement.
65
- const closingTags = [...funcContent.matchAll(/<\/>/g)];
66
- if (closingTags.length === 0) {
67
- return content;
68
- }
69
- const lastClosingTag = closingTags[closingTags.length - 1];
70
- const lastClosingTagIndex = lastClosingTag.index;
71
-
72
- // Find the indentation of the line containing the last </>.
73
- const beforeClosing = funcContent.substring(0, lastClosingTagIndex);
74
- const lines = beforeClosing.split("\n");
75
- const lastLine = lines[lines.length - 1];
76
- const indent = lastLine.match(/^(\s*)/)?.[1] || " ";
77
-
78
- // Insert the component before the last </>.
79
- const newFuncContent = funcContent.substring(0, lastClosingTagIndex) + `${indent}${componentTag}\n${indent}` + funcContent.substring(lastClosingTagIndex);
80
- return content.replace(extensionsFuncRegex, newFuncContent);
15
+ const addComponentToExtensions = (content, componentName, props)=>{
16
+ const propsString = props ? serializePropsToJsx(props) : "";
17
+ const componentTag = propsString ? `<${componentName} ${propsString} />` : `<${componentName} />`;
18
+ if (content.includes(componentTag)) return content;
19
+ const extensionsFuncRegex = /export const Extensions = \(\) => \{[\s\S]*?\};/;
20
+ const extensionsFuncMatch = content.match(extensionsFuncRegex);
21
+ if (!extensionsFuncMatch) return content;
22
+ const funcContent = extensionsFuncMatch[0];
23
+ const closingTags = [
24
+ ...funcContent.matchAll(/<\/>/g)
25
+ ];
26
+ if (0 === closingTags.length) return content;
27
+ const lastClosingTag = closingTags[closingTags.length - 1];
28
+ const lastClosingTagIndex = lastClosingTag.index;
29
+ const beforeClosing = funcContent.substring(0, lastClosingTagIndex);
30
+ const lines = beforeClosing.split("\n");
31
+ const lastLine = lines[lines.length - 1];
32
+ const indent = lastLine.match(/^(\s*)/)?.[1] || " ";
33
+ const newFuncContent = funcContent.substring(0, lastClosingTagIndex) + `${indent}${componentTag}\n${indent}` + funcContent.substring(lastClosingTagIndex);
34
+ return content.replace(extensionsFuncRegex, newFuncContent);
81
35
  };
82
-
83
- /**
84
- * Update the webiny.config.tsx file to add extension imports and component.
85
- */
86
- export const updateWebinyConfig = async params => {
87
- const {
88
- projectRoot,
89
- webinyConfigTsx
90
- } = params;
91
- const webinyConfigPath = `${projectRoot}/webiny.config.tsx`;
92
-
93
- // Read the current webiny.config.tsx
94
- let content = fs.readFileSync(webinyConfigPath, "utf-8");
95
-
96
- // Add imports at the top (after existing imports)
97
- if (webinyConfigTsx.imports && webinyConfigTsx.imports.length > 0) {
98
- for (const importStatement of webinyConfigTsx.imports) {
99
- // Check if we need to add to an existing import from the same path.
100
- const existingImportRegex = new RegExp(`import\\s+{([^}]+)}\\s+from\\s+["']${importStatement.path.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}["'];?`, "m");
101
- const existingImportMatch = content.match(existingImportRegex);
102
- if (existingImportMatch) {
103
- // Import from this path exists, check if specifier is already imported.
104
- const existingSpecifiers = existingImportMatch[1].split(",").map(s => s.trim());
105
- if (!existingSpecifiers.includes(importStatement.specifier)) {
106
- // Append the new specifier to the existing import.
107
- const updatedSpecifiers = [...existingSpecifiers, importStatement.specifier].join(", ");
108
- const updatedImportLine = `import { ${updatedSpecifiers} } from "${importStatement.path}";`;
109
- content = content.replace(existingImportRegex, updatedImportLine);
110
- }
111
- } else {
112
- // No existing import from this path, add a new import line.
113
- const importLine = `import { ${importStatement.specifier} } from "${importStatement.path}";`;
114
-
115
- // Find the position after the last import or at the beginning.
116
- const importRegex = /^import\s+.*?from\s+["'].*?["'];?\s*$/gm;
117
- const matches = Array.from(content.matchAll(importRegex));
118
- if (matches.length > 0) {
119
- // Add after the last import.
120
- const lastImport = matches[matches.length - 1];
121
- const lastImportEnd = lastImport.index + lastImport[0].length;
122
- content = content.slice(0, lastImportEnd) + "\n" + importLine + content.slice(lastImportEnd);
36
+ const updateWebinyConfig = async (params)=>{
37
+ const { projectRoot, webinyConfigTsx } = params;
38
+ const webinyConfigPath = `${projectRoot}/webiny.config.tsx`;
39
+ let content = fs.readFileSync(webinyConfigPath, "utf-8");
40
+ if (webinyConfigTsx.imports && webinyConfigTsx.imports.length > 0) for (const importStatement of webinyConfigTsx.imports){
41
+ const existingImportRegex = new RegExp(`import\\s+{([^}]+)}\\s+from\\s+["']${importStatement.path.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}["'];?`, "m");
42
+ const existingImportMatch = content.match(existingImportRegex);
43
+ if (existingImportMatch) {
44
+ const existingSpecifiers = existingImportMatch[1].split(",").map((s)=>s.trim());
45
+ if (!existingSpecifiers.includes(importStatement.specifier)) {
46
+ const updatedSpecifiers = [
47
+ ...existingSpecifiers,
48
+ importStatement.specifier
49
+ ].join(", ");
50
+ const updatedImportLine = `import { ${updatedSpecifiers} } from "${importStatement.path}";`;
51
+ content = content.replace(existingImportRegex, updatedImportLine);
52
+ }
123
53
  } else {
124
- // No imports found, add at the beginning.
125
- content = importLine + "\n\n" + content;
54
+ const importLine = `import { ${importStatement.specifier} } from "${importStatement.path}";`;
55
+ const importRegex = /^import\s+.*?from\s+["'].*?["'];?\s*$/gm;
56
+ const matches = Array.from(content.matchAll(importRegex));
57
+ if (matches.length > 0) {
58
+ const lastImport = matches[matches.length - 1];
59
+ const lastImportEnd = lastImport.index + lastImport[0].length;
60
+ content = content.slice(0, lastImportEnd) + "\n" + importLine + content.slice(lastImportEnd);
61
+ } else content = importLine + "\n\n" + content;
126
62
  }
127
- }
128
63
  }
129
- }
130
-
131
- // Add component to the Extensions function.
132
- if (webinyConfigTsx.component) {
133
- content = addComponentToExtensions(content, webinyConfigTsx.component.name, webinyConfigTsx.component.props);
134
- }
135
-
136
- // Add multiple components to the Extensions function.
137
- if (webinyConfigTsx.components && webinyConfigTsx.components.length > 0) {
138
- for (const component of webinyConfigTsx.components) {
139
- content = addComponentToExtensions(content, component.name, component.props);
140
- }
141
- }
142
-
143
- // Write the updated content back
144
- fs.writeFileSync(webinyConfigPath, content, "utf-8");
64
+ if (webinyConfigTsx.component) content = addComponentToExtensions(content, webinyConfigTsx.component.name, webinyConfigTsx.component.props);
65
+ if (webinyConfigTsx.components && webinyConfigTsx.components.length > 0) for (const component of webinyConfigTsx.components)content = addComponentToExtensions(content, component.name, component.props);
66
+ fs.writeFileSync(webinyConfigPath, content, "utf-8");
145
67
  };
68
+ export { updateWebinyConfig };
146
69
 
147
70
  //# sourceMappingURL=updateWebinyConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["fs","serializePropsToJsx","props","attributes","key","value","Object","entries","undefined","serializedValue","JSON","stringify","Array","isArray","push","join","addComponentToExtensions","content","componentName","propsString","componentTag","includes","extensionsFuncRegex","extensionsFuncMatch","match","funcContent","closingTags","matchAll","length","lastClosingTag","lastClosingTagIndex","index","beforeClosing","substring","lines","split","lastLine","indent","newFuncContent","replace","updateWebinyConfig","params","projectRoot","webinyConfigTsx","webinyConfigPath","readFileSync","imports","importStatement","existingImportRegex","RegExp","path","existingImportMatch","existingSpecifiers","map","s","trim","specifier","updatedSpecifiers","updatedImportLine","importLine","importRegex","matches","from","lastImport","lastImportEnd","slice","component","name","components","writeFileSync"],"sources":["updateWebinyConfig.ts"],"sourcesContent":["import fs from \"fs\";\nimport { ExtensionWebinyConfigTsx } from \"./types.js\";\n\ninterface UpdateWebinyConfigParams {\n projectRoot: string;\n webinyConfigTsx: ExtensionWebinyConfigTsx;\n}\n\n/**\n * Serializes a props object to JSX attribute syntax.\n * Examples:\n * - { secretKey: \"value\" } => 'secretKey={\"value\"}'\n * - { enabled: true } => 'enabled={true}'\n * - { count: 42 } => 'count={42}'\n * - { config: { key: \"value\" } } => 'config={{\"key\":\"value\"}}'\n */\nconst serializePropsToJsx = (props: Record<string, any>): string => {\n const attributes: string[] = [];\n\n for (const [key, value] of Object.entries(props)) {\n // Skip undefined values.\n if (value === undefined) {\n continue;\n }\n\n // Determine the serialization based on value type.\n let serializedValue: string;\n\n if (typeof value === \"string\") {\n // Strings: use JSON.stringify to handle escaping, then wrap in curly braces.\n serializedValue = `{${JSON.stringify(value)}}`;\n } else if (typeof value === \"number\" || typeof value === \"boolean\") {\n // Numbers and booleans: wrap in curly braces without quotes.\n serializedValue = `{${value}}`;\n } else if (value === null) {\n // Null values.\n serializedValue = `{null}`;\n } else if (Array.isArray(value) || typeof value === \"object\") {\n // Arrays and objects: use JSON.stringify, then wrap in curly braces.\n serializedValue = `{${JSON.stringify(value)}}`;\n } else {\n // Fallback for any other types.\n serializedValue = `{${JSON.stringify(value)}}`;\n }\n\n attributes.push(`${key}=${serializedValue}`);\n }\n\n return attributes.join(\" \");\n};\n\n/**\n * Adds a component to the Extensions function in the webiny.config.tsx content.\n */\nconst addComponentToExtensions = (\n content: string,\n componentName: string,\n props?: Record<string, any>\n): string => {\n // Serialize props to JSX attributes.\n const propsString = props ? serializePropsToJsx(props) : \"\";\n\n // Generate component tag with or without props.\n const componentTag = propsString\n ? `<${componentName} ${propsString} />`\n : `<${componentName} />`;\n\n // Check if component already exists.\n if (content.includes(componentTag)) {\n return content;\n }\n\n // Find the Extensions function's return statement and add component before the final </>.\n // Strategy: Find \"export const Extensions\" block, then find the last </> and insert before it.\n const extensionsFuncRegex = /export const Extensions = \\(\\) => \\{[\\s\\S]*?\\};/;\n const extensionsFuncMatch = content.match(extensionsFuncRegex);\n\n if (!extensionsFuncMatch) {\n return content;\n }\n\n const funcContent = extensionsFuncMatch[0];\n // Find all </> in the function - the last one closes the return statement.\n const closingTags = [...funcContent.matchAll(/<\\/>/g)];\n\n if (closingTags.length === 0) {\n return content;\n }\n\n const lastClosingTag = closingTags[closingTags.length - 1];\n const lastClosingTagIndex = lastClosingTag.index!;\n\n // Find the indentation of the line containing the last </>.\n const beforeClosing = funcContent.substring(0, lastClosingTagIndex);\n const lines = beforeClosing.split(\"\\n\");\n const lastLine = lines[lines.length - 1];\n const indent = lastLine.match(/^(\\s*)/)?.[1] || \" \";\n\n // Insert the component before the last </>.\n const newFuncContent =\n funcContent.substring(0, lastClosingTagIndex) +\n `${indent}${componentTag}\\n${indent}` +\n funcContent.substring(lastClosingTagIndex);\n\n return content.replace(extensionsFuncRegex, newFuncContent);\n};\n\n/**\n * Update the webiny.config.tsx file to add extension imports and component.\n */\nexport const updateWebinyConfig = async (params: UpdateWebinyConfigParams): Promise<void> => {\n const { projectRoot, webinyConfigTsx } = params;\n\n const webinyConfigPath = `${projectRoot}/webiny.config.tsx`;\n\n // Read the current webiny.config.tsx\n let content = fs.readFileSync(webinyConfigPath, \"utf-8\");\n\n // Add imports at the top (after existing imports)\n if (webinyConfigTsx.imports && webinyConfigTsx.imports.length > 0) {\n for (const importStatement of webinyConfigTsx.imports) {\n // Check if we need to add to an existing import from the same path.\n const existingImportRegex = new RegExp(\n `import\\\\s+{([^}]+)}\\\\s+from\\\\s+[\"']${importStatement.path.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}[\"'];?`,\n \"m\"\n );\n const existingImportMatch = content.match(existingImportRegex);\n\n if (existingImportMatch) {\n // Import from this path exists, check if specifier is already imported.\n const existingSpecifiers = existingImportMatch[1].split(\",\").map(s => s.trim());\n\n if (!existingSpecifiers.includes(importStatement.specifier)) {\n // Append the new specifier to the existing import.\n const updatedSpecifiers = [\n ...existingSpecifiers,\n importStatement.specifier\n ].join(\", \");\n const updatedImportLine = `import { ${updatedSpecifiers} } from \"${importStatement.path}\";`;\n content = content.replace(existingImportRegex, updatedImportLine);\n }\n } else {\n // No existing import from this path, add a new import line.\n const importLine = `import { ${importStatement.specifier} } from \"${importStatement.path}\";`;\n\n // Find the position after the last import or at the beginning.\n const importRegex = /^import\\s+.*?from\\s+[\"'].*?[\"'];?\\s*$/gm;\n const matches = Array.from(content.matchAll(importRegex));\n\n if (matches.length > 0) {\n // Add after the last import.\n const lastImport = matches[matches.length - 1];\n const lastImportEnd = lastImport.index! + lastImport[0].length;\n content =\n content.slice(0, lastImportEnd) +\n \"\\n\" +\n importLine +\n content.slice(lastImportEnd);\n } else {\n // No imports found, add at the beginning.\n content = importLine + \"\\n\\n\" + content;\n }\n }\n }\n }\n\n // Add component to the Extensions function.\n if (webinyConfigTsx.component) {\n content = addComponentToExtensions(\n content,\n webinyConfigTsx.component.name,\n webinyConfigTsx.component.props\n );\n }\n\n // Add multiple components to the Extensions function.\n if (webinyConfigTsx.components && webinyConfigTsx.components.length > 0) {\n for (const component of webinyConfigTsx.components) {\n content = addComponentToExtensions(content, component.name, component.props);\n }\n }\n\n // Write the updated content back\n fs.writeFileSync(webinyConfigPath, content, \"utf-8\");\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AAQnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAIC,KAA0B,IAAa;EAChE,MAAMC,UAAoB,GAAG,EAAE;EAE/B,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,KAAK,CAAC,EAAE;IAC9C;IACA,IAAIG,KAAK,KAAKG,SAAS,EAAE;MACrB;IACJ;;IAEA;IACA,IAAIC,eAAuB;IAE3B,IAAI,OAAOJ,KAAK,KAAK,QAAQ,EAAE;MAC3B;MACAI,eAAe,GAAG,IAAIC,IAAI,CAACC,SAAS,CAACN,KAAK,CAAC,GAAG;IAClD,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;MAChE;MACAI,eAAe,GAAG,IAAIJ,KAAK,GAAG;IAClC,CAAC,MAAM,IAAIA,KAAK,KAAK,IAAI,EAAE;MACvB;MACAI,eAAe,GAAG,QAAQ;IAC9B,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H;UACA/C,OAAO,GAAG0C,UAAU,GAAG,MAAM,GAAG1C,OAAO;QAC3C;MACJ;IACJ;EACJ;;EAEA;EACA,IAAI0B,eAAe,CAACuB,SAAS,EAAE;IAC3BjD,OAAO,GAAGD,wBAAwB,CAC9BC,OAAO,EACP0B,eAAe,CAACuB,SAAS,CAACC,IAAI,EAC9BxB,eAAe,CAACuB,SAAS,CAAChE,KAC9B,CAAC;EACL;;EAEA;EACA,IAAIyC,eAAe,CAACyB,UAAU,IAAIzB,eAAe,CAACyB,UAAU,CAACxC,MAAM,GAAG,CAAC,EAAE;IACrE,KAAK,MAAMsC,SAAS,IAAIvB,eAAe,CAACyB,UAAU,EAAE;MAChDnD,OAAO,GAAGD,wBAAwB,CAACC,OAAO,EAAEiD,SAAS,CAACC,IAAI,EAAED,SAAS,CAAChE,KAAK,CAAC;IAChF;EACJ;;EAEA;EACAF,EAAE,CAACqE,aAAa,CAACzB,gBAAgB,EAAE3B,OAAO,EAAE,OAAO,CAAC;AACxD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/InstallExtensionService/updateWebinyConfig.js","sources":["../../../src/services/InstallExtensionService/updateWebinyConfig.ts"],"sourcesContent":["import fs from \"fs\";\nimport { ExtensionWebinyConfigTsx } from \"./types.js\";\n\ninterface UpdateWebinyConfigParams {\n projectRoot: string;\n webinyConfigTsx: ExtensionWebinyConfigTsx;\n}\n\n/**\n * Serializes a props object to JSX attribute syntax.\n * Examples:\n * - { secretKey: \"value\" } => 'secretKey={\"value\"}'\n * - { enabled: true } => 'enabled={true}'\n * - { count: 42 } => 'count={42}'\n * - { config: { key: \"value\" } } => 'config={{\"key\":\"value\"}}'\n */\nconst serializePropsToJsx = (props: Record<string, any>): string => {\n const attributes: string[] = [];\n\n for (const [key, value] of Object.entries(props)) {\n // Skip undefined values.\n if (value === undefined) {\n continue;\n }\n\n // Determine the serialization based on value type.\n let serializedValue: string;\n\n if (typeof value === \"string\") {\n // Strings: use JSON.stringify to handle escaping, then wrap in curly braces.\n serializedValue = `{${JSON.stringify(value)}}`;\n } else if (typeof value === \"number\" || typeof value === \"boolean\") {\n // Numbers and booleans: wrap in curly braces without quotes.\n serializedValue = `{${value}}`;\n } else if (value === null) {\n // Null values.\n serializedValue = `{null}`;\n } else if (Array.isArray(value) || typeof value === \"object\") {\n // Arrays and objects: use JSON.stringify, then wrap in curly braces.\n serializedValue = `{${JSON.stringify(value)}}`;\n } else {\n // Fallback for any other types.\n serializedValue = `{${JSON.stringify(value)}}`;\n }\n\n attributes.push(`${key}=${serializedValue}`);\n }\n\n return attributes.join(\" \");\n};\n\n/**\n * Adds a component to the Extensions function in the webiny.config.tsx content.\n */\nconst addComponentToExtensions = (\n content: string,\n componentName: string,\n props?: Record<string, any>\n): string => {\n // Serialize props to JSX attributes.\n const propsString = props ? serializePropsToJsx(props) : \"\";\n\n // Generate component tag with or without props.\n const componentTag = propsString\n ? `<${componentName} ${propsString} />`\n : `<${componentName} />`;\n\n // Check if component already exists.\n if (content.includes(componentTag)) {\n return content;\n }\n\n // Find the Extensions function's return statement and add component before the final </>.\n // Strategy: Find \"export const Extensions\" block, then find the last </> and insert before it.\n const extensionsFuncRegex = /export const Extensions = \\(\\) => \\{[\\s\\S]*?\\};/;\n const extensionsFuncMatch = content.match(extensionsFuncRegex);\n\n if (!extensionsFuncMatch) {\n return content;\n }\n\n const funcContent = extensionsFuncMatch[0];\n // Find all </> in the function - the last one closes the return statement.\n const closingTags = [...funcContent.matchAll(/<\\/>/g)];\n\n if (closingTags.length === 0) {\n return content;\n }\n\n const lastClosingTag = closingTags[closingTags.length - 1];\n const lastClosingTagIndex = lastClosingTag.index!;\n\n // Find the indentation of the line containing the last </>.\n const beforeClosing = funcContent.substring(0, lastClosingTagIndex);\n const lines = beforeClosing.split(\"\\n\");\n const lastLine = lines[lines.length - 1];\n const indent = lastLine.match(/^(\\s*)/)?.[1] || \" \";\n\n // Insert the component before the last </>.\n const newFuncContent =\n funcContent.substring(0, lastClosingTagIndex) +\n `${indent}${componentTag}\\n${indent}` +\n funcContent.substring(lastClosingTagIndex);\n\n return content.replace(extensionsFuncRegex, newFuncContent);\n};\n\n/**\n * Update the webiny.config.tsx file to add extension imports and component.\n */\nexport const updateWebinyConfig = async (params: UpdateWebinyConfigParams): Promise<void> => {\n const { projectRoot, webinyConfigTsx } = params;\n\n const webinyConfigPath = `${projectRoot}/webiny.config.tsx`;\n\n // Read the current webiny.config.tsx\n let content = fs.readFileSync(webinyConfigPath, \"utf-8\");\n\n // Add imports at the top (after existing imports)\n if (webinyConfigTsx.imports && webinyConfigTsx.imports.length > 0) {\n for (const importStatement of webinyConfigTsx.imports) {\n // Check if we need to add to an existing import from the same path.\n const existingImportRegex = new RegExp(\n `import\\\\s+{([^}]+)}\\\\s+from\\\\s+[\"']${importStatement.path.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}[\"'];?`,\n \"m\"\n );\n const existingImportMatch = content.match(existingImportRegex);\n\n if (existingImportMatch) {\n // Import from this path exists, check if specifier is already imported.\n const existingSpecifiers = existingImportMatch[1].split(\",\").map(s => s.trim());\n\n if (!existingSpecifiers.includes(importStatement.specifier)) {\n // Append the new specifier to the existing import.\n const updatedSpecifiers = [\n ...existingSpecifiers,\n importStatement.specifier\n ].join(\", \");\n const updatedImportLine = `import { ${updatedSpecifiers} } from \"${importStatement.path}\";`;\n content = content.replace(existingImportRegex, updatedImportLine);\n }\n } else {\n // No existing import from this path, add a new import line.\n const importLine = `import { ${importStatement.specifier} } from \"${importStatement.path}\";`;\n\n // Find the position after the last import or at the beginning.\n const importRegex = /^import\\s+.*?from\\s+[\"'].*?[\"'];?\\s*$/gm;\n const matches = Array.from(content.matchAll(importRegex));\n\n if (matches.length > 0) {\n // Add after the last import.\n const lastImport = matches[matches.length - 1];\n const lastImportEnd = lastImport.index! + lastImport[0].length;\n content =\n content.slice(0, lastImportEnd) +\n \"\\n\" +\n importLine +\n content.slice(lastImportEnd);\n } else {\n // No imports found, add at the beginning.\n content = importLine + \"\\n\\n\" + content;\n }\n }\n }\n }\n\n // Add component to the Extensions function.\n if (webinyConfigTsx.component) {\n content = addComponentToExtensions(\n content,\n webinyConfigTsx.component.name,\n webinyConfigTsx.component.props\n );\n }\n\n // Add multiple components to the Extensions function.\n if (webinyConfigTsx.components && webinyConfigTsx.components.length > 0) {\n for (const component of webinyConfigTsx.components) {\n content = addComponentToExtensions(content, component.name, component.props);\n }\n }\n\n // Write the updated content back\n fs.writeFileSync(webinyConfigPath, content, \"utf-8\");\n};\n"],"names":["serializePropsToJsx","props","attributes","key","value","Object","undefined","serializedValue","JSON","Array","addComponentToExtensions","content","componentName","propsString","componentTag","extensionsFuncRegex","extensionsFuncMatch","funcContent","closingTags","lastClosingTag","lastClosingTagIndex","beforeClosing","lines","lastLine","indent","newFuncContent","updateWebinyConfig","params","projectRoot","webinyConfigTsx","webinyConfigPath","fs","importStatement","existingImportRegex","RegExp","existingImportMatch","existingSpecifiers","s","updatedSpecifiers","updatedImportLine","importLine","importRegex","matches","lastImport","lastImportEnd","component"],"mappings":";AAgBA,MAAMA,sBAAsB,CAACC;IACzB,MAAMC,aAAuB,EAAE;IAE/B,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAO,OAAO,CAACJ,OAAQ;QAE9C,IAAIG,AAAUE,WAAVF,OACA;QAIJ,IAAIG;QAEJ,IAAI,AAAiB,YAAjB,OAAOH,OAEPG,kBAAkB,CAAC,CAAC,EAAEC,KAAK,SAAS,CAACJ,OAAO,CAAC,CAAC;aAC3C,IAAI,AAAiB,YAAjB,OAAOA,SAAsB,AAAiB,aAAjB,OAAOA,OAE3CG,kBAAkB,CAAC,CAAC,EAAEH,MAAM,CAAC,CAAC;aAC3B,IAAIA,AAAU,SAAVA,OAEPG,kBAAkB;aACXE,MAAM,OAAO,CAACL,QAErBG,kBAAkB,CAAC,CAAC,EAAEC,KAAK,SAAS,CAACJ,OAAO,CAAC,CAAC;QAMlDF,WAAW,IAAI,CAAC,GAAGC,IAAI,C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EACzBlB,UAAUD,yBACNC,SACAkB,gBAAgB,SAAS,CAAC,IAAI,EAC9BA,gBAAgB,SAAS,CAAC,KAAK;IAKvC,IAAIA,gBAAgB,UAAU,IAAIA,gBAAgB,UAAU,CAAC,MAAM,GAAG,GAClE,KAAK,MAAMgB,aAAahB,gBAAgB,UAAU,CAC9ClB,UAAUD,yBAAyBC,SAASkC,UAAU,IAAI,EAAEA,UAAU,KAAK;IAKnFd,GAAG,aAAa,CAACD,kBAAkBnB,SAAS;AAChD"}
@@ -1,23 +1,15 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import { IsRemotePulumiBackendService } from "../../abstractions/index.js";
3
-
4
- /**
5
- * Service to check if a remote Pulumi backend is configured via environment variables.
6
- *
7
- * Checks for the following environment variables in order:
8
- * - WEBINY_CLI_PULUMI_BACKEND
9
- * - WEBINY_CLI_PULUMI_BACKEND_URL
10
- * - PULUMI_LOGIN (fallback for standard Pulumi configuration)
11
- */
12
- export class DefaultIsRemotePulumiBackendService {
13
- execute() {
14
- return !!(process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_CLI_PULUMI_BACKEND_URL || process.env.PULUMI_LOGIN);
15
- }
3
+ class DefaultIsRemotePulumiBackendService {
4
+ execute() {
5
+ return !!(process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_CLI_PULUMI_BACKEND_URL || process.env.PULUMI_LOGIN);
6
+ }
16
7
  }
17
- export const isRemotePulumiBackendService = createImplementation({
18
- abstraction: IsRemotePulumiBackendService,
19
- implementation: DefaultIsRemotePulumiBackendService,
20
- dependencies: []
8
+ const isRemotePulumiBackendService = createImplementation({
9
+ abstraction: IsRemotePulumiBackendService,
10
+ implementation: DefaultIsRemotePulumiBackendService,
11
+ dependencies: []
21
12
  });
13
+ export { DefaultIsRemotePulumiBackendService, isRemotePulumiBackendService };
22
14
 
23
15
  //# sourceMappingURL=IsRemotePulumiBackendService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","IsRemotePulumiBackendService","DefaultIsRemotePulumiBackendService","execute","process","env","WEBINY_CLI_PULUMI_BACKEND","WEBINY_CLI_PULUMI_BACKEND_URL","PULUMI_LOGIN","isRemotePulumiBackendService","abstraction","implementation","dependencies"],"sources":["IsRemotePulumiBackendService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { IsRemotePulumiBackendService } from \"~/abstractions/index.js\";\n\n/**\n * Service to check if a remote Pulumi backend is configured via environment variables.\n *\n * Checks for the following environment variables in order:\n * - WEBINY_CLI_PULUMI_BACKEND\n * - WEBINY_CLI_PULUMI_BACKEND_URL\n * - PULUMI_LOGIN (fallback for standard Pulumi configuration)\n */\nexport class DefaultIsRemotePulumiBackendService implements IsRemotePulumiBackendService.Interface {\n execute(): boolean {\n return !!(\n process.env.WEBINY_CLI_PULUMI_BACKEND ||\n process.env.WEBINY_CLI_PULUMI_BACKEND_URL ||\n process.env.PULUMI_LOGIN\n );\n }\n}\n\nexport const isRemotePulumiBackendService = createImplementation({\n abstraction: IsRemotePulumiBackendService,\n implementation: DefaultIsRemotePulumiBackendService,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,4BAA4B;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mCAAmC,CAAmD;EAC/FC,OAAOA,CAAA,EAAY;IACf,OAAO,CAAC,EACJC,OAAO,CAACC,GAAG,CAACC,yBAAyB,IACrCF,OAAO,CAACC,GAAG,CAACE,6BAA6B,IACzCH,OAAO,CAACC,GAAG,CAACG,YAAY,CAC3B;EACL;AACJ;AAEA,OAAO,MAAMC,4BAA4B,GAAGT,oBAAoB,CAAC;EAC7DU,WAAW,EAAET,4BAA4B;EACzCU,cAAc,EAAET,mCAAmC;EACnDU,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js","sources":["../../../src/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { IsRemotePulumiBackendService } from \"~/abstractions/index.js\";\n\n/**\n * Service to check if a remote Pulumi backend is configured via environment variables.\n *\n * Checks for the following environment variables in order:\n * - WEBINY_CLI_PULUMI_BACKEND\n * - WEBINY_CLI_PULUMI_BACKEND_URL\n * - PULUMI_LOGIN (fallback for standard Pulumi configuration)\n */\nexport class DefaultIsRemotePulumiBackendService implements IsRemotePulumiBackendService.Interface {\n execute(): boolean {\n return !!(\n process.env.WEBINY_CLI_PULUMI_BACKEND ||\n process.env.WEBINY_CLI_PULUMI_BACKEND_URL ||\n process.env.PULUMI_LOGIN\n );\n }\n}\n\nexport const isRemotePulumiBackendService = createImplementation({\n abstraction: IsRemotePulumiBackendService,\n implementation: DefaultIsRemotePulumiBackendService,\n dependencies: []\n});\n"],"names":["DefaultIsRemotePulumiBackendService","process","isRemotePulumiBackendService","createImplementation","IsRemotePulumiBackendService"],"mappings":";;AAWO,MAAMA;IACT,UAAmB;QACf,OAAO,CAAC,CACJC,CAAAA,QAAQ,GAAG,CAAC,yBAAyB,IACrCA,QAAQ,GAAG,CAAC,6BAA6B,IACzCA,QAAQ,GAAG,CAAC,YAAW;IAE/B;AACJ;AAEO,MAAMC,+BAA+BC,qBAAqB;IAC7D,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
@@ -1,3 +1 @@
1
1
  export * from "./IsRemotePulumiBackendService.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,84 +1,61 @@
1
1
  import { createImplementation } from "@webiny/di";
2
- import { ListAppLambdaFunctionsService, PulumiExportService, LoggerService } from "../../abstractions/index.js";
2
+ import { ListAppLambdaFunctionsService, LoggerService, PulumiExportService } from "../../abstractions/index.js";
3
3
  import path from "path";
4
4
  import { minimatch } from "minimatch";
5
- export class DefaultListAppLambdaFunctionsService {
6
- constructor(pulumiExportService, loggerService) {
7
- this.pulumiExportService = pulumiExportService;
8
- this.loggerService = loggerService;
9
- }
10
- async execute(app, params) {
11
- const stackExport = await this.pulumiExportService.execute(app);
12
- if (!stackExport) {
13
- // If no stack export is found, return an empty array. This is a valid scenario.
14
- // For example, watching the Admin app locally, but not deploying it.
15
- return {
16
- list: [],
17
- meta: {
18
- count: 0,
19
- totalCount: 0
20
- }
21
- };
5
+ class DefaultListAppLambdaFunctionsService {
6
+ constructor(pulumiExportService, loggerService){
7
+ this.pulumiExportService = pulumiExportService;
8
+ this.loggerService = loggerService;
22
9
  }
23
-
24
- // If an app is not deployed, resources will not exist.
25
- const resources = stackExport.deployment?.resources ?? [];
26
- const allFunctionsList = resources.filter(r => r.type === "aws:lambda/function:Function")
27
- // We don't need to watch the authorizer function.
28
- .filter(resource => {
29
- const isAuthorizerFunction = resource.inputs.name.includes("watch-command-iot-authorizer");
30
- return !isAuthorizerFunction;
31
- });
32
- let filteredFunctionsList = allFunctionsList
33
- // First, this filter ensures that Lambda@Edge functions are excluded. Second,
34
- // it also ensures a function is filtered out if a `pulumi refresh` was called.
35
- // This is because, when called, the paths in Pulumi state file disappear, and
36
- // we can't determine the path to the handler. Probably needs revisiting. 🤦‍♂️
37
- .filter(resource => {
38
- return "." in resource.inputs.code.assets;
39
- }).map(resource => {
40
- const fnName = resource.inputs.name;
41
- const handlerBuildFolderPath = resource.inputs.code.assets["."].path;
42
- const handlerPath = path.join(handlerBuildFolderPath, "handler.mjs");
43
- return {
44
- name: fnName,
45
- path: handlerPath
46
- };
47
- });
48
- if (params?.whitelist?.length) {
49
- const functionNamesToMatch = Array.isArray(params.whitelist) ? params.whitelist : [params.whitelist];
50
-
51
- // `functionNamesToWatch` is an array of glob patterns, which denote which functions to watch.
52
- filteredFunctionsList = filteredFunctionsList.filter(fn => {
53
- return functionNamesToMatch.some(pattern => {
54
- if (pattern.includes("*")) {
55
- return minimatch(fn.name, pattern);
56
- }
57
- return fn.name.includes(pattern);
10
+ async execute(app, params) {
11
+ const stackExport = await this.pulumiExportService.execute(app);
12
+ if (!stackExport) return {
13
+ list: [],
14
+ meta: {
15
+ count: 0,
16
+ totalCount: 0
17
+ }
18
+ };
19
+ const resources = stackExport.deployment?.resources ?? [];
20
+ const allFunctionsList = resources.filter((r)=>"aws:lambda/function:Function" === r.type).filter((resource)=>{
21
+ const isAuthorizerFunction = resource.inputs.name.includes("watch-command-iot-authorizer");
22
+ return !isAuthorizerFunction;
58
23
  });
59
- });
60
- } else {
61
- // We've hardcoded this filtering here just because of lack of time.
62
- // With v5, these "presets" were located within `webiny.application.ts` files.
63
- if (app.name === "api") {
64
- filteredFunctionsList = filteredFunctionsList.filter(fn => {
65
- return fn.name.includes("graphql");
24
+ let filteredFunctionsList = allFunctionsList.filter((resource)=>"." in resource.inputs.code.assets).map((resource)=>{
25
+ const fnName = resource.inputs.name;
26
+ const handlerBuildFolderPath = resource.inputs.code.assets["."].path;
27
+ const handlerPath = path.join(handlerBuildFolderPath, "handler.mjs");
28
+ return {
29
+ name: fnName,
30
+ path: handlerPath
31
+ };
66
32
  });
67
- }
33
+ if (params?.whitelist?.length) {
34
+ const functionNamesToMatch = Array.isArray(params.whitelist) ? params.whitelist : [
35
+ params.whitelist
36
+ ];
37
+ filteredFunctionsList = filteredFunctionsList.filter((fn)=>functionNamesToMatch.some((pattern)=>{
38
+ if (pattern.includes("*")) return minimatch(fn.name, pattern);
39
+ return fn.name.includes(pattern);
40
+ }));
41
+ } else if ("api" === app.name) filteredFunctionsList = filteredFunctionsList.filter((fn)=>fn.name.includes("graphql"));
42
+ return {
43
+ list: filteredFunctionsList,
44
+ meta: {
45
+ count: filteredFunctionsList.length,
46
+ totalCount: allFunctionsList.length
47
+ }
48
+ };
68
49
  }
69
- return {
70
- list: filteredFunctionsList,
71
- meta: {
72
- count: filteredFunctionsList.length,
73
- totalCount: allFunctionsList.length
74
- }
75
- };
76
- }
77
50
  }
78
- export const listAppLambdaFunctionsService = createImplementation({
79
- abstraction: ListAppLambdaFunctionsService,
80
- implementation: DefaultListAppLambdaFunctionsService,
81
- dependencies: [PulumiExportService, LoggerService]
51
+ const listAppLambdaFunctionsService = createImplementation({
52
+ abstraction: ListAppLambdaFunctionsService,
53
+ implementation: DefaultListAppLambdaFunctionsService,
54
+ dependencies: [
55
+ PulumiExportService,
56
+ LoggerService
57
+ ]
82
58
  });
59
+ export { DefaultListAppLambdaFunctionsService, listAppLambdaFunctionsService };
83
60
 
84
61
  //# sourceMappingURL=ListAppLambdaFunctionsService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","ListAppLambdaFunctionsService","PulumiExportService","LoggerService","path","minimatch","DefaultListAppLambdaFunctionsService","constructor","pulumiExportService","loggerService","execute","app","params","stackExport","list","meta","count","totalCount","resources","deployment","allFunctionsList","filter","r","type","resource","isAuthorizerFunction","inputs","name","includes","filteredFunctionsList","code","assets","map","fnName","handlerBuildFolderPath","handlerPath","join","whitelist","length","functionNamesToMatch","Array","isArray","fn","some","pattern","listAppLambdaFunctionsService","abstraction","implementation","dependencies"],"sources":["ListAppLambdaFunctionsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n ListAppLambdaFunctionsService,\n PulumiExportService,\n LoggerService\n} from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport path from \"path\";\nimport { minimatch } from \"minimatch\";\n\ninterface ExpectedStackExport {\n deployment: {\n resources: Array<{\n type: string;\n inputs: {\n name: string;\n code: {\n assets: Record<string, { path: string }>;\n };\n };\n }>;\n };\n}\n\nexport class DefaultListAppLambdaFunctionsService\n implements ListAppLambdaFunctionsService.Interface\n{\n constructor(\n private pulumiExportService: PulumiExportService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: AppModel, params?: ListAppLambdaFunctionsService.Params) {\n const stackExport = await this.pulumiExportService.execute<ExpectedStackExport>(app);\n\n if (!stackExport) {\n // If no stack export is found, return an empty array. This is a valid scenario.\n // For example, watching the Admin app locally, but not deploying it.\n return {\n list: [],\n meta: {\n count: 0,\n totalCount: 0\n }\n };\n }\n\n // If an app is not deployed, resources will not exist.\n const resources = stackExport.deployment?.resources ?? [];\n\n const allFunctionsList = resources\n .filter(r => r.type === \"aws:lambda/function:Function\")\n // We don't need to watch the authorizer function.\n .filter(resource => {\n const isAuthorizerFunction = resource.inputs.name.includes(\n \"watch-command-iot-authorizer\"\n );\n return !isAuthorizerFunction;\n });\n\n let filteredFunctionsList = allFunctionsList\n // First, this filter ensures that Lambda@Edge functions are excluded. Second,\n // it also ensures a function is filtered out if a `pulumi refresh` was called.\n // This is because, when called, the paths in Pulumi state file disappear, and\n // we can't determine the path to the handler. Probably needs revisiting. 🤦‍♂️\n .filter(resource => {\n return \".\" in resource.inputs.code.assets;\n })\n .map(resource => {\n const fnName = resource.inputs.name;\n const handlerBuildFolderPath = resource.inputs.code.assets[\".\"].path;\n\n const handlerPath = path.join(handlerBuildFolderPath, \"handler.mjs\");\n return {\n name: fnName,\n path: handlerPath\n };\n });\n\n if (params?.whitelist?.length) {\n const functionNamesToMatch = Array.isArray(params.whitelist)\n ? params.whitelist\n : [params.whitelist];\n\n // `functionNamesToWatch` is an array of glob patterns, which denote which functions to watch.\n filteredFunctionsList = filteredFunctionsList.filter(fn => {\n return functionNamesToMatch.some(pattern => {\n if (pattern.includes(\"*\")) {\n return minimatch(fn.name, pattern);\n }\n\n return fn.name.includes(pattern);\n });\n });\n } else {\n // We've hardcoded this filtering here just because of lack of time.\n // With v5, these \"presets\" were located within `webiny.application.ts` files.\n if (app.name === \"api\") {\n filteredFunctionsList = filteredFunctionsList.filter(fn => {\n return fn.name.includes(\"graphql\");\n });\n }\n }\n\n return {\n list: filteredFunctionsList,\n meta: { count: filteredFunctionsList.length, totalCount: allFunctionsList.length }\n };\n }\n}\n\nexport const listAppLambdaFunctionsService = createImplementation({\n abstraction: ListAppLambdaFunctionsService,\n implementation: DefaultListAppLambdaFunctionsService,\n dependencies: [PulumiExportService, LoggerService]\n});\n"],"mappings":"AAA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O,6BAA6B,GAAG7C,oBAAoB,CAAC;EAC9D8C,WAAW,EAAE7C,6BAA6B;EAC1C8C,cAAc,EAAEzC,oCAAoC;EACpD0C,YAAY,EAAE,CAAC9C,mBAAmB,EAAEC,aAAa;AACrD,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js","sources":["../../../src/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n ListAppLambdaFunctionsService,\n PulumiExportService,\n LoggerService\n} from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport path from \"path\";\nimport { minimatch } from \"minimatch\";\n\ninterface ExpectedStackExport {\n deployment: {\n resources: Array<{\n type: string;\n inputs: {\n name: string;\n code: {\n assets: Record<string, { path: string }>;\n };\n };\n }>;\n };\n}\n\nexport class DefaultListAppLambdaFunctionsService\n implements ListAppLambdaFunctionsService.Interface\n{\n constructor(\n private pulumiExportService: PulumiExportService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: AppModel, params?: ListAppLambdaFunctionsService.Params) {\n const stackExport = await this.pulumiExportService.execute<ExpectedStackExport>(app);\n\n if (!stackExport) {\n // If no stack export is found, return an empty array. This is a valid scenario.\n // For example, watching the Admin app locally, but not deploying it.\n return {\n list: [],\n meta: {\n count: 0,\n totalCount: 0\n }\n };\n }\n\n // If an app is not deployed, resources will not exist.\n const resources = stackExport.deployment?.resources ?? [];\n\n const allFunctionsList = resources\n .filter(r => r.type === \"aws:lambda/function:Function\")\n // We don't need to watch the authorizer function.\n .filter(resource => {\n const isAuthorizerFunction = resource.inputs.name.includes(\n \"watch-command-iot-authorizer\"\n );\n return !isAuthorizerFunction;\n });\n\n let filteredFunctionsList = allFunctionsList\n // First, this filter ensures that Lambda@Edge functions are excluded. Second,\n // it also ensures a function is filtered out if a `pulumi refresh` was called.\n // This is because, when called, the paths in Pulumi state file disappear, and\n // we can't determine the path to the handler. Probably needs revisiting. 🤦‍♂️\n .filter(resource => {\n return \".\" in resource.inputs.code.assets;\n })\n .map(resource => {\n const fnName = resource.inputs.name;\n const handlerBuildFolderPath = resource.inputs.code.assets[\".\"].path;\n\n const handlerPath = path.join(handlerBuildFolderPath, \"handler.mjs\");\n return {\n name: fnName,\n path: handlerPath\n };\n });\n\n if (params?.whitelist?.length) {\n const functionNamesToMatch = Array.isArray(params.whitelist)\n ? params.whitelist\n : [params.whitelist];\n\n // `functionNamesToWatch` is an array of glob patterns, which denote which functions to watch.\n filteredFunctionsList = filteredFunctionsList.filter(fn => {\n return functionNamesToMatch.some(pattern => {\n if (pattern.includes(\"*\")) {\n return minimatch(fn.name, pattern);\n }\n\n return fn.name.includes(pattern);\n });\n });\n } else {\n // We've hardcoded this filtering here just because of lack of time.\n // With v5, these \"presets\" were located within `webiny.application.ts` files.\n if (app.name === \"api\") {\n filteredFunctionsList = filteredFunctionsList.filter(fn => {\n return fn.name.includes(\"graphql\");\n });\n }\n }\n\n return {\n list: filteredFunctionsList,\n meta: { count: filteredFunctionsList.length, totalCount: allFunctionsList.length }\n };\n }\n}\n\nexport const listAppLambdaFunctionsService = createImplementation({\n abstraction: ListAppLambdaFunctionsService,\n implementation: DefaultListAppLambdaFunctionsService,\n dependencies: [PulumiExportService, LoggerService]\n});\n"],"names":["DefaultListAppLambdaFunctionsService","pulumiExportService","loggerService","app","params","stackExport","resources","allFunctionsList","r","resource","isAuthorizerFunction","filteredFunctionsList","fnName","handlerBuildFolderPath","handlerPath","path","functionNamesToMatch","Array","fn","pattern","minimatch","listAppLambdaFunctionsService","createImplementation","ListAppLambdaFunctionsService","PulumiExportService","LoggerService"],"mappings":";;;;AAwBO,MAAMA;IAGT,YACYC,mBAAkD,EAClDC,aAAsC,CAChD;aAFUD,mBAAmB,GAAnBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,GAAa,EAAEC,MAA6C,EAAE;QACxE,MAA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;QAKpC,OAAO;YACH,MAAMP;YACN,MAAM;gBAAE,OAAOA,sBAAsB,MAAM;gBAAE,YAAYJ,iBAAiB,MAAM;YAAC;QACrF;IACJ;AACJ;AAEO,MAAMc,gCAAgCC,qBAAqB;IAC9D,aAAaC;IACb,gBAAgBvB;IAChB,cAAc;QAACwB;QAAqBC;KAAc;AACtD"}
@@ -1,3 +1 @@
1
1
  export * from "./ListAppLambdaFunctionsService.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,32 +1,30 @@
1
1
  import { createImplementation } from "@webiny/di";
2
2
  import { GetProjectService, ListDeployedEnvironmentsService } from "../../abstractions/index.js";
3
3
  import path from "path";
4
- import glob from "fast-glob";
4
+ import fast_glob from "fast-glob";
5
5
  import { splitStackName } from "../../utils/index.js";
6
6
  const STACK_JSONS_GLOB = ".pulumi/**/apps/core/.pulumi/stacks/**/*.json";
7
- export class DefaultListDeployedEnvironmentsService {
8
- constructor(getProjectService) {
9
- this.getProjectService = getProjectService;
10
- }
11
- async execute() {
12
- const project = this.getProjectService.execute();
13
-
14
- // We just get stack files for deployed Core application. That's enough
15
- // to determine into which environments the user has deployed their project.
16
- const pulumiCoreStackFilesPaths = glob.sync(STACK_JSONS_GLOB, {
17
- cwd: project.paths.rootFolder.toString(),
18
- onlyFiles: true,
19
- dot: true
20
- });
21
- return pulumiCoreStackFilesPaths.map(current => {
22
- return splitStackName(path.basename(current, ".json"));
23
- });
24
- }
7
+ class DefaultListDeployedEnvironmentsService {
8
+ constructor(getProjectService){
9
+ this.getProjectService = getProjectService;
10
+ }
11
+ async execute() {
12
+ const project = this.getProjectService.execute();
13
+ const pulumiCoreStackFilesPaths = fast_glob.sync(STACK_JSONS_GLOB, {
14
+ cwd: project.paths.rootFolder.toString(),
15
+ onlyFiles: true,
16
+ dot: true
17
+ });
18
+ return pulumiCoreStackFilesPaths.map((current)=>splitStackName(path.basename(current, ".json")));
19
+ }
25
20
  }
26
- export const listDeployedEnvironmentsService = createImplementation({
27
- abstraction: ListDeployedEnvironmentsService,
28
- implementation: DefaultListDeployedEnvironmentsService,
29
- dependencies: [GetProjectService]
21
+ const listDeployedEnvironmentsService = createImplementation({
22
+ abstraction: ListDeployedEnvironmentsService,
23
+ implementation: DefaultListDeployedEnvironmentsService,
24
+ dependencies: [
25
+ GetProjectService
26
+ ]
30
27
  });
28
+ export { DefaultListDeployedEnvironmentsService, listDeployedEnvironmentsService };
31
29
 
32
30
  //# sourceMappingURL=ListDeployedEnvironmentsService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","GetProjectService","ListDeployedEnvironmentsService","path","glob","splitStackName","STACK_JSONS_GLOB","DefaultListDeployedEnvironmentsService","constructor","getProjectService","execute","project","pulumiCoreStackFilesPaths","sync","cwd","paths","rootFolder","toString","onlyFiles","dot","map","current","basename","listDeployedEnvironmentsService","abstraction","implementation","dependencies"],"sources":["ListDeployedEnvironmentsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetProjectService, ListDeployedEnvironmentsService } from \"~/abstractions/index.js\";\nimport path from \"path\";\nimport glob from \"fast-glob\";\nimport { splitStackName } from \"~/utils/index.js\";\n\nconst STACK_JSONS_GLOB = \".pulumi/**/apps/core/.pulumi/stacks/**/*.json\";\n\nexport class DefaultListDeployedEnvironmentsService\n implements ListDeployedEnvironmentsService.Interface\n{\n constructor(private getProjectService: GetProjectService.Interface) {}\n\n async execute() {\n const project = this.getProjectService.execute();\n\n // We just get stack files for deployed Core application. That's enough\n // to determine into which environments the user has deployed their project.\n const pulumiCoreStackFilesPaths = glob.sync(STACK_JSONS_GLOB, {\n cwd: project.paths.rootFolder.toString(),\n onlyFiles: true,\n dot: true\n });\n\n return pulumiCoreStackFilesPaths.map(current => {\n return splitStackName(path.basename(current, \".json\"));\n });\n }\n}\n\nexport const listDeployedEnvironmentsService = createImplementation({\n abstraction: ListDeployedEnvironmentsService,\n implementation: DefaultListDeployedEnvironmentsService,\n dependencies: [GetProjectService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAEC,+BAA+B;AAC3D,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,IAAI,MAAM,WAAW;AAC5B,SAASC,cAAc;AAEvB,MAAMC,gBAAgB,GAAG,+CAA+C;AAExE,OAAO,MAAMC,sCAAsC,CAEnD;EACIC,WAAWA,CAASC,iBAA8C,EAAE;IAAA,KAAhDA,iBAA8C,GAA9CA,iBAA8C;EAAG;EAErE,MAAMC,OAAOA,CAAA,EAAG;IACZ,MAAMC,OAAO,GAAG,IAAI,CAACF,iBAAiB,CAACC,OAAO,CAAC,CAAC;;IAEhD;IACA;IACA,MAAME,yBAAyB,GAAGR,IAAI,CAACS,IAAI,CAACP,gBAAgB,EAAE;MAC1DQ,GAAG,EAAEH,OAAO,CAACI,KAAK,CAACC,UAAU,CAACC,QAAQ,CAAC,CAAC;MACxCC,SAAS,EAAE,IAAI;MACfC,GAAG,EAAE;IACT,CAAC,CAAC;IAEF,OAAOP,yBAAyB,CAACQ,GAAG,CAACC,OAAO,IAAI;MAC5C,OAAOhB,cAAc,CAACF,IAAI,CAACmB,QAAQ,CAACD,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAME,+BAA+B,GAAGvB,oBAAoB,CAAC;EAChEwB,WAAW,EAAEtB,+BAA+B;EAC5CuB,cAAc,EAAElB,sCAAsC;EACtDmB,YAAY,EAAE,CAACzB,iBAAiB;AACpC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js","sources":["../../../src/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetProjectService, ListDeployedEnvironmentsService } from \"~/abstractions/index.js\";\nimport path from \"path\";\nimport glob from \"fast-glob\";\nimport { splitStackName } from \"~/utils/index.js\";\n\nconst STACK_JSONS_GLOB = \".pulumi/**/apps/core/.pulumi/stacks/**/*.json\";\n\nexport class DefaultListDeployedEnvironmentsService\n implements ListDeployedEnvironmentsService.Interface\n{\n constructor(private getProjectService: GetProjectService.Interface) {}\n\n async execute() {\n const project = this.getProjectService.execute();\n\n // We just get stack files for deployed Core application. That's enough\n // to determine into which environments the user has deployed their project.\n const pulumiCoreStackFilesPaths = glob.sync(STACK_JSONS_GLOB, {\n cwd: project.paths.rootFolder.toString(),\n onlyFiles: true,\n dot: true\n });\n\n return pulumiCoreStackFilesPaths.map(current => {\n return splitStackName(path.basename(current, \".json\"));\n });\n }\n}\n\nexport const listDeployedEnvironmentsService = createImplementation({\n abstraction: ListDeployedEnvironmentsService,\n implementation: DefaultListDeployedEnvironmentsService,\n dependencies: [GetProjectService]\n});\n"],"names":["STACK_JSONS_GLOB","DefaultListDeployedEnvironmentsService","getProjectService","project","pulumiCoreStackFilesPaths","glob","current","splitStackName","path","listDeployedEnvironmentsService","createImplementation","ListDeployedEnvironmentsService","GetProjectService"],"mappings":";;;;;AAMA,MAAMA,mBAAmB;AAElB,MAAMC;IAGT,YAAoBC,iBAA8C,CAAE;aAAhDA,iBAAiB,GAAjBA;IAAiD;IAErE,MAAM,UAAU;QACZ,MAAMC,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAI9C,MAAMC,4BAA4BC,UAAAA,IAAS,CAACL,kBAAkB;YAC1D,KAAKG,QAAQ,KAAK,CAAC,UAAU,CAAC,QAAQ;YACtC,WAAW;YACX,KAAK;QACT;QAEA,OAAOC,0BAA0B,GAAG,CAACE,CAAAA,UAC1BC,eAAeC,KAAK,QAAQ,CAACF,SAAS;IAErD;AACJ;AAEO,MAAMG,kCAAkCC,qBAAqB;IAChE,aAAaC;IACb,gBAAgBV;IAChB,cAAc;QAACW;KAAkB;AACrC"}
@@ -1,3 +1 @@
1
1
  export * from "./ListDeployedEnvironmentsService.js";
2
-
3
- //# sourceMappingURL=index.js.map