@webiny/project 0.0.0-unstable.dbdf5d6258 → 0.0.0-unstable.e1999482d0

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 (1243) 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.d.ts +12 -20
  6. package/ProjectSdk.js +93 -126
  7. package/ProjectSdk.js.map +1 -1
  8. package/abstractions/createAbstraction.js +3 -2
  9. package/abstractions/createAbstraction.js.map +1 -1
  10. package/abstractions/features/BuildApp.js +2 -1
  11. package/abstractions/features/BuildApp.js.map +1 -1
  12. package/abstractions/features/BuildExtension.js +2 -1
  13. package/abstractions/features/BuildExtension.js.map +1 -1
  14. package/abstractions/features/GetApp.js +2 -1
  15. package/abstractions/features/GetApp.js.map +1 -1
  16. package/abstractions/features/GetFeatureFlags.d.ts +8 -0
  17. package/abstractions/features/GetFeatureFlags.js +5 -0
  18. package/abstractions/features/GetFeatureFlags.js.map +1 -0
  19. package/abstractions/features/GetLogger.js +2 -1
  20. package/abstractions/features/GetLogger.js.map +1 -1
  21. package/abstractions/features/GetProductionEnvironments.js +2 -1
  22. package/abstractions/features/GetProductionEnvironments.js.map +1 -1
  23. package/abstractions/features/GetProject.js +2 -1
  24. package/abstractions/features/GetProject.js.map +1 -1
  25. package/abstractions/features/GetProjectConfig.js +2 -1
  26. package/abstractions/features/GetProjectConfig.js.map +1 -1
  27. package/abstractions/features/GetProjectInfo.js +2 -1
  28. package/abstractions/features/GetProjectInfo.js.map +1 -1
  29. package/abstractions/features/InstallExtension.js +2 -1
  30. package/abstractions/features/InstallExtension.js.map +1 -1
  31. package/abstractions/features/IsCi.js +2 -1
  32. package/abstractions/features/IsCi.js.map +1 -1
  33. package/abstractions/features/IsTelemetryEnabled.js +2 -1
  34. package/abstractions/features/IsTelemetryEnabled.js.map +1 -1
  35. package/abstractions/features/IsWcpEnabled.js +2 -1
  36. package/abstractions/features/IsWcpEnabled.js.map +1 -1
  37. package/abstractions/features/IsWebinyJsRepo.js +2 -1
  38. package/abstractions/features/IsWebinyJsRepo.js.map +1 -1
  39. package/abstractions/features/Serve.d.ts +27 -0
  40. package/abstractions/features/Serve.js +5 -0
  41. package/abstractions/features/Serve.js.map +1 -0
  42. package/abstractions/features/ValidateProjectConfig.js +2 -1
  43. package/abstractions/features/ValidateProjectConfig.js.map +1 -1
  44. package/abstractions/features/Watch.d.ts +10 -0
  45. package/abstractions/features/Watch.js +2 -1
  46. package/abstractions/features/Watch.js.map +1 -1
  47. package/abstractions/features/hooks/AdminAfterBuild.js +2 -1
  48. package/abstractions/features/hooks/AdminAfterBuild.js.map +1 -1
  49. package/abstractions/features/hooks/AdminBeforeBuild.js +2 -1
  50. package/abstractions/features/hooks/AdminBeforeBuild.js.map +1 -1
  51. package/abstractions/features/hooks/AdminBeforeWatch.js +2 -1
  52. package/abstractions/features/hooks/AdminBeforeWatch.js.map +1 -1
  53. package/abstractions/features/hooks/AfterBuild.js +2 -1
  54. package/abstractions/features/hooks/AfterBuild.js.map +1 -1
  55. package/abstractions/features/hooks/ApiAfterBuild.js +2 -1
  56. package/abstractions/features/hooks/ApiAfterBuild.js.map +1 -1
  57. package/abstractions/features/hooks/ApiBeforeBuild.js +2 -1
  58. package/abstractions/features/hooks/ApiBeforeBuild.js.map +1 -1
  59. package/abstractions/features/hooks/ApiBeforeWatch.js +2 -1
  60. package/abstractions/features/hooks/ApiBeforeWatch.js.map +1 -1
  61. package/abstractions/features/hooks/BeforeBuild.js +2 -1
  62. package/abstractions/features/hooks/BeforeBuild.js.map +1 -1
  63. package/abstractions/features/hooks/BeforeWatch.js +2 -1
  64. package/abstractions/features/hooks/BeforeWatch.js.map +1 -1
  65. package/abstractions/features/hooks/CoreAfterBuild.js +2 -1
  66. package/abstractions/features/hooks/CoreAfterBuild.js.map +1 -1
  67. package/abstractions/features/hooks/CoreBeforeBuild.js +2 -1
  68. package/abstractions/features/hooks/CoreBeforeBuild.js.map +1 -1
  69. package/abstractions/features/hooks/CoreBeforeWatch.js +2 -1
  70. package/abstractions/features/hooks/CoreBeforeWatch.js.map +1 -1
  71. package/abstractions/features/hooks/index.d.ts +0 -8
  72. package/abstractions/features/hooks/index.js +0 -10
  73. package/abstractions/features/index.d.ts +2 -9
  74. package/abstractions/features/index.js +2 -11
  75. package/abstractions/index.js +0 -2
  76. package/abstractions/models/IAppModel.d.ts +0 -2
  77. package/abstractions/models/IAppModel.js +0 -3
  78. package/abstractions/models/IAppPackageModel.js +0 -3
  79. package/abstractions/models/IPathModel.js +0 -3
  80. package/abstractions/models/IProjectConfigDto.js +0 -3
  81. package/abstractions/models/IProjectConfigModel.js +0 -3
  82. package/abstractions/models/IProjectModel.d.ts +0 -2
  83. package/abstractions/models/IProjectModel.js +0 -3
  84. package/abstractions/models/IUrlModel.js +0 -3
  85. package/abstractions/models/IWcpEnvironmentDto.js +0 -3
  86. package/abstractions/models/IWcpEnvironmentModel.js +0 -3
  87. package/abstractions/models/IWcpUserDto.js +0 -3
  88. package/abstractions/models/IWcpUserModel.js +0 -3
  89. package/abstractions/models/IWcpUserPatDto.js +0 -3
  90. package/abstractions/models/IWcpUserPatModel.js +0 -3
  91. package/abstractions/models/PackagesBuilder/IPackagesBuilder.js +0 -3
  92. package/abstractions/models/PackagesBuilder/IRunnableBuildProcess.js +0 -3
  93. package/abstractions/models/PackagesBuilder/IRunnableBuildProcesses.js +0 -3
  94. package/abstractions/models/PackagesBuilder/index.js +0 -3
  95. package/abstractions/models/index.js +0 -3
  96. package/abstractions/services/BuildAppWorkspaceService.js +2 -1
  97. package/abstractions/services/BuildAppWorkspaceService.js.map +1 -1
  98. package/abstractions/services/BuildProjectWorkspaceService.js +2 -1
  99. package/abstractions/services/BuildProjectWorkspaceService.js.map +1 -1
  100. package/abstractions/services/GetAppPackagesService.js +2 -1
  101. package/abstractions/services/GetAppPackagesService.js.map +1 -1
  102. package/abstractions/services/GetAppService.js +2 -1
  103. package/abstractions/services/GetAppService.js.map +1 -1
  104. package/abstractions/services/GetCwdService.js +2 -1
  105. package/abstractions/services/GetCwdService.js.map +1 -1
  106. package/abstractions/services/GetProjectConfigService.js +2 -1
  107. package/abstractions/services/GetProjectConfigService.js.map +1 -1
  108. package/abstractions/services/GetProjectIdService.js +2 -1
  109. package/abstractions/services/GetProjectIdService.js.map +1 -1
  110. package/abstractions/services/GetProjectInstallationIdService.d.ts +10 -0
  111. package/abstractions/services/GetProjectInstallationIdService.js +5 -0
  112. package/abstractions/services/GetProjectInstallationIdService.js.map +1 -0
  113. package/abstractions/services/GetProjectService.js +2 -1
  114. package/abstractions/services/GetProjectService.js.map +1 -1
  115. package/abstractions/services/GetProjectVersionService.js +2 -1
  116. package/abstractions/services/GetProjectVersionService.js.map +1 -1
  117. package/abstractions/services/InitHostingSdkService.d.ts +21 -0
  118. package/abstractions/services/InitHostingSdkService.js +5 -0
  119. package/abstractions/services/InitHostingSdkService.js.map +1 -0
  120. package/abstractions/services/InitProjectSdkService.js +2 -1
  121. package/abstractions/services/InitProjectSdkService.js.map +1 -1
  122. package/abstractions/services/InstallExtensionService.js +2 -1
  123. package/abstractions/services/InstallExtensionService.js.map +1 -1
  124. package/abstractions/services/ListPackagesInAppWorkspaceService.js +2 -1
  125. package/abstractions/services/ListPackagesInAppWorkspaceService.js.map +1 -1
  126. package/abstractions/services/ListPackagesService.js +2 -1
  127. package/abstractions/services/ListPackagesService.js.map +1 -1
  128. package/abstractions/services/LoadEnvVarsService.js +2 -1
  129. package/abstractions/services/LoadEnvVarsService.js.map +1 -1
  130. package/abstractions/services/LocalStorageService.js +2 -1
  131. package/abstractions/services/LocalStorageService.js.map +1 -1
  132. package/abstractions/services/LoggerService.js +2 -1
  133. package/abstractions/services/LoggerService.js.map +1 -1
  134. package/abstractions/services/ProjectInfoService/GetIsCiService.js +2 -1
  135. package/abstractions/services/ProjectInfoService/GetIsCiService.js.map +1 -1
  136. package/abstractions/services/ProjectInfoService/GetNpmVersionService.js +2 -1
  137. package/abstractions/services/ProjectInfoService/GetNpmVersionService.js.map +1 -1
  138. package/abstractions/services/ProjectInfoService/GetNpxVersionService.js +2 -1
  139. package/abstractions/services/ProjectInfoService/GetNpxVersionService.js.map +1 -1
  140. package/abstractions/services/ProjectInfoService/GetYarnVersionService.js +2 -1
  141. package/abstractions/services/ProjectInfoService/GetYarnVersionService.js.map +1 -1
  142. package/abstractions/services/ProjectInfoService/ProjectInfoService.d.ts +6 -6
  143. package/abstractions/services/ProjectInfoService/ProjectInfoService.js +2 -1
  144. package/abstractions/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  145. package/abstractions/services/ProjectInfoService/index.d.ts +0 -1
  146. package/abstractions/services/ProjectInfoService/index.js +0 -3
  147. package/abstractions/services/ProjectSdkParamsService.js +2 -1
  148. package/abstractions/services/ProjectSdkParamsService.js.map +1 -1
  149. package/abstractions/services/SetProjectIdService.js +2 -1
  150. package/abstractions/services/SetProjectIdService.js.map +1 -1
  151. package/abstractions/services/StdioService.js +2 -1
  152. package/abstractions/services/StdioService.js.map +1 -1
  153. package/abstractions/services/UiService.js +2 -1
  154. package/abstractions/services/UiService.js.map +1 -1
  155. package/abstractions/services/ValidateProjectConfigService.js +2 -1
  156. package/abstractions/services/ValidateProjectConfigService.js.map +1 -1
  157. package/abstractions/services/WcpService.js +2 -1
  158. package/abstractions/services/WcpService.js.map +1 -1
  159. package/abstractions/services/index.d.ts +2 -12
  160. package/abstractions/services/index.js +2 -14
  161. package/abstractions/types.js +0 -3
  162. package/components/FeatureFlag.d.ts +48 -0
  163. package/components/FeatureFlag.js +59 -0
  164. package/components/FeatureFlag.js.map +1 -0
  165. package/createProjectSdkContainer.d.ts +1 -1
  166. package/createProjectSdkContainer.js +91 -110
  167. package/createProjectSdkContainer.js.map +1 -1
  168. package/decorators/BuildAppWithHooks.js +54 -44
  169. package/decorators/BuildAppWithHooks.js.map +1 -1
  170. package/decorators/GetFeatureFlagsWithLicense.d.ts +12 -0
  171. package/decorators/GetFeatureFlagsWithLicense.js +58 -0
  172. package/decorators/GetFeatureFlagsWithLicense.js.map +1 -0
  173. package/decorators/WatchWithHooks.js +30 -27
  174. package/decorators/WatchWithHooks.js.map +1 -1
  175. package/decorators/index.d.ts +1 -5
  176. package/decorators/index.js +1 -7
  177. package/defineExtension/createExtensionDefinition.js +12 -19
  178. package/defineExtension/createExtensionDefinition.js.map +1 -1
  179. package/defineExtension/createExtensionReactComponent.js +48 -46
  180. package/defineExtension/createExtensionReactComponent.js.map +1 -1
  181. package/defineExtension/defineExtension.js +8 -9
  182. package/defineExtension/defineExtension.js.map +1 -1
  183. package/defineExtension/index.js +0 -2
  184. package/defineExtension/models/ExtensionDefinitionModel.d.ts +4 -4
  185. package/defineExtension/models/ExtensionDefinitionModel.js +11 -10
  186. package/defineExtension/models/ExtensionDefinitionModel.js.map +1 -1
  187. package/defineExtension/models/ExtensionInstanceModel.js +23 -21
  188. package/defineExtension/models/ExtensionInstanceModel.js.map +1 -1
  189. package/defineExtension/models/index.js +0 -2
  190. package/defineExtension/types.d.ts +7 -2
  191. package/defineExtension/types.js +0 -3
  192. package/defineExtension/zodTypes/zodSrcPath.d.ts +1 -1
  193. package/defineExtension/zodTypes/zodSrcPath.js +36 -51
  194. package/defineExtension/zodTypes/zodSrcPath.js.map +1 -1
  195. package/exports/infra/admin.d.ts +0 -3
  196. package/exports/infra/admin.js +0 -5
  197. package/exports/infra/api.d.ts +0 -3
  198. package/exports/infra/api.js +0 -5
  199. package/exports/infra/core.d.ts +0 -3
  200. package/exports/infra/core.js +0 -5
  201. package/exports/infra.d.ts +6 -0
  202. package/exports/infra.js +6 -0
  203. package/extensions/AdminApiUrl.d.ts +10 -0
  204. package/extensions/AdminApiUrl.js +22 -0
  205. package/extensions/AdminApiUrl.js.map +1 -0
  206. package/extensions/AdminBuildParam.d.ts +2 -8
  207. package/extensions/AdminBuildParam.js +105 -147
  208. package/extensions/AdminBuildParam.js.map +1 -1
  209. package/extensions/AdminExtension.d.ts +3 -9
  210. package/extensions/AdminExtension.js +67 -92
  211. package/extensions/AdminExtension.js.map +1 -1
  212. package/extensions/AdminWebsocketsUrl.d.ts +14 -0
  213. package/extensions/AdminWebsocketsUrl.js +22 -0
  214. package/extensions/AdminWebsocketsUrl.js.map +1 -0
  215. package/extensions/ApiBuildParam.d.ts +2 -8
  216. package/extensions/ApiBuildParam.js +72 -97
  217. package/extensions/ApiBuildParam.js.map +1 -1
  218. package/extensions/ApiExtension.d.ts +3 -9
  219. package/extensions/ApiExtension.js +76 -94
  220. package/extensions/ApiExtension.js.map +1 -1
  221. package/extensions/BugReporter.d.ts +6 -0
  222. package/extensions/BugReporter.js +34 -0
  223. package/extensions/BugReporter.js.map +1 -0
  224. package/extensions/DatabaseSetup.d.ts +8 -7
  225. package/extensions/DatabaseSetup.js +16 -9
  226. package/extensions/DatabaseSetup.js.map +1 -1
  227. package/extensions/EnvVar.d.ts +4 -7
  228. package/extensions/EnvVar.js +13 -12
  229. package/extensions/EnvVar.js.map +1 -1
  230. package/extensions/ExtensionDefinitions.d.ts +1 -5
  231. package/extensions/ExtensionDefinitions.js +12 -10
  232. package/extensions/ExtensionDefinitions.js.map +1 -1
  233. package/extensions/FeatureFlags.d.ts +31 -74
  234. package/extensions/FeatureFlags.js +70 -35
  235. package/extensions/FeatureFlags.js.map +1 -1
  236. package/extensions/ProductionEnvironments.d.ts +4 -0
  237. package/extensions/ProductionEnvironments.js +37 -0
  238. package/extensions/ProductionEnvironments.js.map +1 -0
  239. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.d.ts +3 -2
  240. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js +37 -34
  241. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js.map +1 -1
  242. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.d.ts +3 -2
  243. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js +37 -34
  244. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js.map +1 -1
  245. package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js +13 -9
  246. package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js.map +1 -1
  247. package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js +13 -9
  248. package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js.map +1 -1
  249. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js +47 -51
  250. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js.map +1 -1
  251. package/extensions/Project/showConfigChangeNotice.d.ts +7 -0
  252. package/extensions/Project/showConfigChangeNotice.js +9 -0
  253. package/extensions/Project/showConfigChangeNotice.js.map +1 -0
  254. package/extensions/Project.js +14 -29
  255. package/extensions/Project.js.map +1 -1
  256. package/extensions/ProjectDecorator.d.ts +3 -7
  257. package/extensions/ProjectDecorator.js +14 -16
  258. package/extensions/ProjectDecorator.js.map +1 -1
  259. package/extensions/ProjectId.d.ts +3 -7
  260. package/extensions/ProjectId.js +12 -13
  261. package/extensions/ProjectId.js.map +1 -1
  262. package/extensions/ProjectImplementation.d.ts +3 -9
  263. package/extensions/ProjectImplementation.js +15 -17
  264. package/extensions/ProjectImplementation.js.map +1 -1
  265. package/extensions/Telemetry.d.ts +2 -6
  266. package/extensions/Telemetry.js +11 -9
  267. package/extensions/Telemetry.js.map +1 -1
  268. package/extensions/api/BackgroundTasks.d.ts +4 -0
  269. package/extensions/api/BackgroundTasks.js +25 -0
  270. package/extensions/api/BackgroundTasks.js.map +1 -0
  271. package/extensions/api/Cms/ModelFieldCompression.d.ts +4 -0
  272. package/extensions/api/Cms/ModelFieldCompression.js +25 -0
  273. package/extensions/api/Cms/ModelFieldCompression.js.map +1 -0
  274. package/extensions/api/Route/ApiRoute.d.ts +23 -0
  275. package/extensions/api/Route/ApiRoute.js +92 -0
  276. package/extensions/api/Route/ApiRoute.js.map +1 -0
  277. package/extensions/api/Route/index.d.ts +2 -0
  278. package/extensions/api/Route/index.js +2 -0
  279. package/extensions/api/Route/routePath.d.ts +21 -0
  280. package/extensions/api/Route/routePath.js +10 -0
  281. package/extensions/api/Route/routePath.js.map +1 -0
  282. package/extensions/api/index.d.ts +3 -0
  283. package/extensions/api/index.js +3 -0
  284. package/extensions/hasDefaultExport.d.ts +2 -0
  285. package/extensions/hasDefaultExport.js +17 -0
  286. package/extensions/hasDefaultExport.js.map +1 -0
  287. package/extensions/hooks/AdminAfterBuild.d.ts +2 -6
  288. package/extensions/hooks/AdminAfterBuild.js +17 -19
  289. package/extensions/hooks/AdminAfterBuild.js.map +1 -1
  290. package/extensions/hooks/AdminBeforeBuild.d.ts +2 -6
  291. package/extensions/hooks/AdminBeforeBuild.js +17 -19
  292. package/extensions/hooks/AdminBeforeBuild.js.map +1 -1
  293. package/extensions/hooks/AdminBeforeWatch.d.ts +2 -6
  294. package/extensions/hooks/AdminBeforeWatch.js +17 -19
  295. package/extensions/hooks/AdminBeforeWatch.js.map +1 -1
  296. package/extensions/hooks/AfterBuild.d.ts +2 -6
  297. package/extensions/hooks/AfterBuild.js +16 -18
  298. package/extensions/hooks/AfterBuild.js.map +1 -1
  299. package/extensions/hooks/ApiAfterBuild.d.ts +2 -6
  300. package/extensions/hooks/ApiAfterBuild.js +17 -19
  301. package/extensions/hooks/ApiAfterBuild.js.map +1 -1
  302. package/extensions/hooks/ApiBeforeBuild.d.ts +2 -6
  303. package/extensions/hooks/ApiBeforeBuild.js +17 -19
  304. package/extensions/hooks/ApiBeforeBuild.js.map +1 -1
  305. package/extensions/hooks/ApiBeforeWatch.d.ts +2 -6
  306. package/extensions/hooks/ApiBeforeWatch.js +17 -19
  307. package/extensions/hooks/ApiBeforeWatch.js.map +1 -1
  308. package/extensions/hooks/BeforeBuild.d.ts +2 -6
  309. package/extensions/hooks/BeforeBuild.js +16 -18
  310. package/extensions/hooks/BeforeBuild.js.map +1 -1
  311. package/extensions/hooks/BeforeWatch.d.ts +2 -6
  312. package/extensions/hooks/BeforeWatch.js +16 -18
  313. package/extensions/hooks/BeforeWatch.js.map +1 -1
  314. package/extensions/hooks/CoreAfterBuild.d.ts +2 -6
  315. package/extensions/hooks/CoreAfterBuild.js +17 -19
  316. package/extensions/hooks/CoreAfterBuild.js.map +1 -1
  317. package/extensions/hooks/CoreBeforeBuild.d.ts +2 -6
  318. package/extensions/hooks/CoreBeforeBuild.js +17 -19
  319. package/extensions/hooks/CoreBeforeBuild.js.map +1 -1
  320. package/extensions/hooks/CoreBeforeWatch.d.ts +2 -6
  321. package/extensions/hooks/CoreBeforeWatch.js +17 -19
  322. package/extensions/hooks/CoreBeforeWatch.js.map +1 -1
  323. package/extensions/hooks/index.d.ts +0 -8
  324. package/extensions/hooks/index.js +0 -10
  325. package/extensions/hosting/assertHostingType.d.ts +13 -0
  326. package/extensions/hosting/assertHostingType.js +12 -0
  327. package/extensions/hosting/assertHostingType.js.map +1 -0
  328. package/extensions/hosting/extensionImplementations.d.ts +13 -0
  329. package/extensions/hosting/extensionImplementations.js +4 -0
  330. package/extensions/hosting/extensionImplementations.js.map +1 -0
  331. package/extensions/hosting/getExtensionImplementation.d.ts +1 -0
  332. package/extensions/hosting/getExtensionImplementation.js +9 -0
  333. package/extensions/hosting/getExtensionImplementation.js.map +1 -0
  334. package/extensions/hosting/hostingType.d.ts +2 -0
  335. package/extensions/hosting/hostingType.js +0 -0
  336. package/extensions/hosting/index.d.ts +4 -0
  337. package/extensions/hosting/index.js +4 -0
  338. package/extensions/hosting/registerExtensionImplementation.d.ts +12 -0
  339. package/extensions/hosting/registerExtensionImplementation.js +13 -0
  340. package/extensions/hosting/registerExtensionImplementation.js.map +1 -0
  341. package/extensions/index.d.ts +71 -159
  342. package/extensions/index.js +41 -60
  343. package/extensions/index.js.map +1 -1
  344. package/extensions/infra/Ci.d.ts +14 -0
  345. package/extensions/infra/Ci.js +13 -0
  346. package/extensions/infra/Ci.js.map +1 -0
  347. package/extensions/infra/Env.d.ts +6 -0
  348. package/extensions/infra/Env.js +43 -74
  349. package/extensions/infra/Env.js.map +1 -1
  350. package/extensions/infra/index.d.ts +1 -0
  351. package/extensions/infra/index.js +1 -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 +27 -35
  361. package/features/BuildApp/PackagesBuilder/worker.js.map +1 -1
  362. package/features/BuildApp/index.js +0 -2
  363. package/features/GetApp/GetApp.js +14 -11
  364. package/features/GetApp/GetApp.js.map +1 -1
  365. package/features/GetApp/index.js +0 -2
  366. package/features/GetFeatureFlags/GetFeatureFlags.d.ts +9 -0
  367. package/features/GetFeatureFlags/GetFeatureFlags.js +29 -0
  368. package/features/GetFeatureFlags/GetFeatureFlags.js.map +1 -0
  369. package/features/GetFeatureFlags/index.d.ts +1 -0
  370. package/features/GetFeatureFlags/index.js +1 -0
  371. package/features/GetLogger/GetLogger.js +14 -11
  372. package/features/GetLogger/GetLogger.js.map +1 -1
  373. package/features/GetLogger/index.js +0 -2
  374. package/features/GetProductionEnvironments/GetProductionEnvironments.js +24 -19
  375. package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
  376. package/features/GetProductionEnvironments/index.js +0 -2
  377. package/features/GetProject/GetProject.js +14 -11
  378. package/features/GetProject/GetProject.js.map +1 -1
  379. package/features/GetProject/index.js +0 -2
  380. package/features/GetProjectConfig/GetProjectConfig.js +14 -11
  381. package/features/GetProjectConfig/GetProjectConfig.js.map +1 -1
  382. package/features/GetProjectConfig/index.js +0 -2
  383. package/features/GetProjectInfo/GetProjectInfo.js +14 -11
  384. package/features/GetProjectInfo/GetProjectInfo.js.map +1 -1
  385. package/features/GetProjectInfo/index.js +0 -2
  386. package/features/InstallExtension/InstallExtension.js +14 -11
  387. package/features/InstallExtension/InstallExtension.js.map +1 -1
  388. package/features/InstallExtension/index.js +0 -2
  389. package/features/IsCi/IsCi.js +14 -11
  390. package/features/IsCi/IsCi.js.map +1 -1
  391. package/features/IsCi/index.js +0 -2
  392. package/features/IsTelemetryEnabled/IsTelemetryEnabled.js +19 -18
  393. package/features/IsTelemetryEnabled/IsTelemetryEnabled.js.map +1 -1
  394. package/features/IsTelemetryEnabled/index.js +0 -2
  395. package/features/IsWcpEnabled/IsWcpEnabled.js +15 -12
  396. package/features/IsWcpEnabled/IsWcpEnabled.js.map +1 -1
  397. package/features/IsWcpEnabled/index.js +0 -2
  398. package/features/IsWebinyJsRepo/IsWebinyJsRepo.js +17 -14
  399. package/features/IsWebinyJsRepo/IsWebinyJsRepo.js.map +1 -1
  400. package/features/IsWebinyJsRepo/index.js +0 -2
  401. package/features/Serve/Serve.d.ts +10 -0
  402. package/features/Serve/Serve.js +15 -0
  403. package/features/Serve/Serve.js.map +1 -0
  404. package/features/Serve/index.d.ts +1 -0
  405. package/features/Serve/index.js +1 -0
  406. package/features/ValidateProjectConfig/ValidateProjectConfig.js +14 -11
  407. package/features/ValidateProjectConfig/ValidateProjectConfig.js.map +1 -1
  408. package/features/ValidateProjectConfig/index.js +0 -2
  409. package/features/Watch/Watch.d.ts +3 -16
  410. package/features/Watch/Watch.js +99 -183
  411. package/features/Watch/Watch.js.map +1 -1
  412. package/features/Watch/index.js +0 -2
  413. package/features/Watch/watchers/BasePackagesWatcher.js +10 -13
  414. package/features/Watch/watchers/BasePackagesWatcher.js.map +1 -1
  415. package/features/Watch/watchers/MultiplePackagesWatcher.js +11 -12
  416. package/features/Watch/watchers/MultiplePackagesWatcher.js.map +1 -1
  417. package/features/Watch/watchers/PackagesWatcher.js +15 -18
  418. package/features/Watch/watchers/PackagesWatcher.js.map +1 -1
  419. package/features/Watch/watchers/RunnableWatchProcess.js +41 -40
  420. package/features/Watch/watchers/RunnableWatchProcess.js.map +1 -1
  421. package/features/Watch/watchers/RunnableWatchProcesses.js +35 -34
  422. package/features/Watch/watchers/RunnableWatchProcesses.js.map +1 -1
  423. package/features/Watch/watchers/ServersWatcher.d.ts +36 -0
  424. package/features/Watch/watchers/ServersWatcher.js +38 -0
  425. package/features/Watch/watchers/ServersWatcher.js.map +1 -0
  426. package/features/Watch/watchers/SinglePackageWatcher.js +11 -8
  427. package/features/Watch/watchers/SinglePackageWatcher.js.map +1 -1
  428. package/features/Watch/watchers/WebinyConfigWatcher.js +30 -40
  429. package/features/Watch/watchers/WebinyConfigWatcher.js.map +1 -1
  430. package/features/Watch/watchers/ZeroPackagesWatcher.js +5 -5
  431. package/features/Watch/watchers/ZeroPackagesWatcher.js.map +1 -1
  432. package/features/Watch/watchers/utils/measureDuration.js +7 -8
  433. package/features/Watch/watchers/utils/measureDuration.js.map +1 -1
  434. package/features/Watch/watchers/worker.js +15 -21
  435. package/features/Watch/watchers/worker.js.map +1 -1
  436. package/features/hooks/AdminAfterBuild/AdminBeforeBuild.js +19 -15
  437. package/features/hooks/AdminAfterBuild/AdminBeforeBuild.js.map +1 -1
  438. package/features/hooks/AdminAfterBuild/index.js +0 -2
  439. package/features/hooks/AdminBeforeBuild/AdminBeforeBuild.js +19 -15
  440. package/features/hooks/AdminBeforeBuild/AdminBeforeBuild.js.map +1 -1
  441. package/features/hooks/AdminBeforeBuild/index.js +0 -2
  442. package/features/hooks/AdminBeforeWatch/AdminBeforeWatch.js +18 -14
  443. package/features/hooks/AdminBeforeWatch/AdminBeforeWatch.js.map +1 -1
  444. package/features/hooks/AdminBeforeWatch/index.js +0 -2
  445. package/features/hooks/AfterBuild/AfterBuild.js +19 -15
  446. package/features/hooks/AfterBuild/AfterBuild.js.map +1 -1
  447. package/features/hooks/AfterBuild/index.js +0 -2
  448. package/features/hooks/ApiAfterBuild/ApiBeforeBuild.js +18 -14
  449. package/features/hooks/ApiAfterBuild/ApiBeforeBuild.js.map +1 -1
  450. package/features/hooks/ApiAfterBuild/index.js +0 -2
  451. package/features/hooks/ApiBeforeBuild/ApiBeforeBuild.js +18 -14
  452. package/features/hooks/ApiBeforeBuild/ApiBeforeBuild.js.map +1 -1
  453. package/features/hooks/ApiBeforeBuild/index.js +0 -2
  454. package/features/hooks/ApiBeforeWatch/ApiBeforeWatch.js +18 -14
  455. package/features/hooks/ApiBeforeWatch/ApiBeforeWatch.js.map +1 -1
  456. package/features/hooks/ApiBeforeWatch/index.js +0 -2
  457. package/features/hooks/BeforeBuild/BeforeBuild.js +19 -15
  458. package/features/hooks/BeforeBuild/BeforeBuild.js.map +1 -1
  459. package/features/hooks/BeforeBuild/index.js +0 -2
  460. package/features/hooks/BeforeWatch/BeforeWatch.js +19 -15
  461. package/features/hooks/BeforeWatch/BeforeWatch.js.map +1 -1
  462. package/features/hooks/BeforeWatch/index.js +0 -2
  463. package/features/hooks/CoreAfterBuild/CoreBeforeBuild.js +18 -14
  464. package/features/hooks/CoreAfterBuild/CoreBeforeBuild.js.map +1 -1
  465. package/features/hooks/CoreAfterBuild/index.js +0 -2
  466. package/features/hooks/CoreBeforeBuild/CoreBeforeBuild.js +18 -14
  467. package/features/hooks/CoreBeforeBuild/CoreBeforeBuild.js.map +1 -1
  468. package/features/hooks/CoreBeforeBuild/index.js +0 -2
  469. package/features/hooks/CoreBeforeWatch/CoreBeforeWatch.js +18 -14
  470. package/features/hooks/CoreBeforeWatch/CoreBeforeWatch.js.map +1 -1
  471. package/features/hooks/CoreBeforeWatch/index.js +0 -2
  472. package/features/hooks/index.d.ts +0 -8
  473. package/features/hooks/index.js +0 -10
  474. package/features/index.d.ts +2 -9
  475. package/features/index.js +2 -11
  476. package/index.d.ts +4 -5
  477. package/index.js +6 -12
  478. package/index.js.map +1 -1
  479. package/models/AppModel.js +19 -19
  480. package/models/AppModel.js.map +1 -1
  481. package/models/AppPackageModel.js +10 -9
  482. package/models/AppPackageModel.js.map +1 -1
  483. package/models/PathModel.js +23 -26
  484. package/models/PathModel.js.map +1 -1
  485. package/models/ProjectConfigModel.js +12 -16
  486. package/models/ProjectConfigModel.js.map +1 -1
  487. package/models/ProjectModel.js +35 -36
  488. package/models/ProjectModel.js.map +1 -1
  489. package/models/UrlModel.js +23 -23
  490. package/models/UrlModel.js.map +1 -1
  491. package/models/WcpEnvironmentModel.js +23 -22
  492. package/models/WcpEnvironmentModel.js.map +1 -1
  493. package/models/WcpUserModel.js +13 -12
  494. package/models/WcpUserModel.js.map +1 -1
  495. package/models/WcpUserPatModel.js +12 -11
  496. package/models/WcpUserPatModel.js.map +1 -1
  497. package/models/index.js +0 -2
  498. package/package.json +44 -48
  499. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.d.ts +2 -3
  500. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js +33 -73
  501. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js.map +1 -1
  502. package/services/BuildAppWorkspaceService/index.js +0 -2
  503. package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js +21 -19
  504. package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js.map +1 -1
  505. package/services/BuildProjectWorkspaceService/index.js +0 -2
  506. package/services/GetAppPackagesService/GetAppPackagesService.js +24 -23
  507. package/services/GetAppPackagesService/GetAppPackagesService.js.map +1 -1
  508. package/services/GetAppPackagesService/index.js +0 -2
  509. package/services/GetAppService/GetAppService.js +22 -27
  510. package/services/GetAppService/GetAppService.js.map +1 -1
  511. package/services/GetAppService/index.js +0 -2
  512. package/services/GetCwdService/GetCwdService.js +15 -12
  513. package/services/GetCwdService/GetCwdService.js.map +1 -1
  514. package/services/GetCwdService/index.js +0 -2
  515. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.d.ts +15 -0
  516. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js +23 -0
  517. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js.map +1 -0
  518. package/services/GetProjectConfigService/EnvContext.d.ts +3 -2
  519. package/services/GetProjectConfigService/EnvContext.js +28 -39
  520. package/services/GetProjectConfigService/EnvContext.js.map +1 -1
  521. package/services/GetProjectConfigService/FeatureFlagsContext.d.ts +26 -0
  522. package/services/GetProjectConfigService/FeatureFlagsContext.js +41 -0
  523. package/services/GetProjectConfigService/FeatureFlagsContext.js.map +1 -0
  524. package/services/GetProjectConfigService/GetProjectConfigService.js +106 -115
  525. package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
  526. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.d.ts +8 -0
  527. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js +28 -0
  528. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js.map +1 -0
  529. package/services/GetProjectConfigService/ProductionEnvironmentsContext.d.ts +6 -0
  530. package/services/GetProjectConfigService/ProductionEnvironmentsContext.js +16 -0
  531. package/services/GetProjectConfigService/ProductionEnvironmentsContext.js.map +1 -0
  532. package/services/GetProjectConfigService/WcpProjectLicenseContext.d.ts +3 -0
  533. package/services/GetProjectConfigService/WcpProjectLicenseContext.js +34 -36
  534. package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
  535. package/services/GetProjectConfigService/getRenderCacheKey.d.ts +1 -0
  536. package/services/GetProjectConfigService/getRenderCacheKey.js +13 -0
  537. package/services/GetProjectConfigService/getRenderCacheKey.js.map +1 -0
  538. package/services/GetProjectConfigService/index.js +0 -2
  539. package/services/GetProjectConfigService/nullRenderer.d.ts +4 -0
  540. package/services/GetProjectConfigService/nullRenderer.js +83 -0
  541. package/services/GetProjectConfigService/nullRenderer.js.map +1 -0
  542. package/services/GetProjectConfigService/renderConfig.d.ts +3 -12
  543. package/services/GetProjectConfigService/renderConfig.js +11 -42
  544. package/services/GetProjectConfigService/renderConfig.js.map +1 -1
  545. package/services/GetProjectConfigService/renderExtensions.d.ts +8 -0
  546. package/services/GetProjectConfigService/renderExtensions.js +52 -0
  547. package/services/GetProjectConfigService/renderExtensions.js.map +1 -0
  548. package/services/GetProjectIdService/GetProjectIdService.js +22 -23
  549. package/services/GetProjectIdService/GetProjectIdService.js.map +1 -1
  550. package/services/GetProjectIdService/index.js +0 -2
  551. package/services/GetProjectInstallationIdService/GetProjectInstallationIdService.d.ts +10 -0
  552. package/services/GetProjectInstallationIdService/GetProjectInstallationIdService.js +34 -0
  553. package/services/GetProjectInstallationIdService/GetProjectInstallationIdService.js.map +1 -0
  554. package/services/GetProjectInstallationIdService/index.d.ts +1 -0
  555. package/services/GetProjectInstallationIdService/index.js +1 -0
  556. package/services/GetProjectService/GetProjectService.js +42 -46
  557. package/services/GetProjectService/GetProjectService.js.map +1 -1
  558. package/services/GetProjectService/index.js +0 -2
  559. package/services/GetProjectVersionService/GetProjectVersionService.js +25 -24
  560. package/services/GetProjectVersionService/GetProjectVersionService.js.map +1 -1
  561. package/services/GetProjectVersionService/index.js +0 -2
  562. package/services/InitProjectSdkService/InitProjectSdkService.d.ts +6 -2
  563. package/services/InitProjectSdkService/InitProjectSdkService.js +43 -55
  564. package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
  565. package/services/InitProjectSdkService/applyEnvVars.js +5 -8
  566. package/services/InitProjectSdkService/applyEnvVars.js.map +1 -1
  567. package/services/InitProjectSdkService/applyWcpEnvVars.js +110 -135
  568. package/services/InitProjectSdkService/applyWcpEnvVars.js.map +1 -1
  569. package/services/InitProjectSdkService/index.js +0 -2
  570. package/services/InitProjectSdkService/registerDecorators.js +10 -7
  571. package/services/InitProjectSdkService/registerDecorators.js.map +1 -1
  572. package/services/InitProjectSdkService/registerHooks.js +19 -8
  573. package/services/InitProjectSdkService/registerHooks.js.map +1 -1
  574. package/services/InitProjectSdkService/registerImplementations.js +10 -11
  575. package/services/InitProjectSdkService/registerImplementations.js.map +1 -1
  576. package/services/InstallExtensionService/InstallExtensionService.js +78 -121
  577. package/services/InstallExtensionService/InstallExtensionService.js.map +1 -1
  578. package/services/InstallExtensionService/downloadFolderFromS3.js +46 -74
  579. package/services/InstallExtensionService/downloadFolderFromS3.js.map +1 -1
  580. package/services/InstallExtensionService/index.js +0 -2
  581. package/services/InstallExtensionService/mergePackageJson.js +15 -25
  582. package/services/InstallExtensionService/mergePackageJson.js.map +1 -1
  583. package/services/InstallExtensionService/types.d.ts +4 -0
  584. package/services/InstallExtensionService/types.js +0 -3
  585. package/services/InstallExtensionService/updateWebinyConfig.js +47 -111
  586. package/services/InstallExtensionService/updateWebinyConfig.js.map +1 -1
  587. package/services/ListPackagesInAppWorkspaceService/ListPackagesInAppWorkspaceService.js +34 -29
  588. package/services/ListPackagesInAppWorkspaceService/ListPackagesInAppWorkspaceService.js.map +1 -1
  589. package/services/ListPackagesInAppWorkspaceService/index.js +0 -2
  590. package/services/ListPackagesService/ListPackagesService.js +81 -114
  591. package/services/ListPackagesService/ListPackagesService.js.map +1 -1
  592. package/services/ListPackagesService/index.js +0 -2
  593. package/services/LoadEnvVarsService/LoadEnvVarsService.d.ts +3 -2
  594. package/services/LoadEnvVarsService/LoadEnvVarsService.js +37 -30
  595. package/services/LoadEnvVarsService/LoadEnvVarsService.js.map +1 -1
  596. package/services/LoadEnvVarsService/index.js +0 -2
  597. package/services/LocalStorageService/LocalStorageService.js +41 -44
  598. package/services/LocalStorageService/LocalStorageService.js.map +1 -1
  599. package/services/LocalStorageService/index.js +0 -2
  600. package/services/LoggerService/LoggerService.js +76 -84
  601. package/services/LoggerService/LoggerService.js.map +1 -1
  602. package/services/LoggerService/index.js +0 -2
  603. package/services/ProjectInfoService/GetIsCiService.js +9 -8
  604. package/services/ProjectInfoService/GetIsCiService.js.map +1 -1
  605. package/services/ProjectInfoService/GetNpmVersionService.js +9 -8
  606. package/services/ProjectInfoService/GetNpmVersionService.js.map +1 -1
  607. package/services/ProjectInfoService/GetNpxVersionService.js +9 -8
  608. package/services/ProjectInfoService/GetNpxVersionService.js.map +1 -1
  609. package/services/ProjectInfoService/GetYarnVersionService.js +9 -8
  610. package/services/ProjectInfoService/GetYarnVersionService.js.map +1 -1
  611. package/services/ProjectInfoService/ProjectInfoService.d.ts +7 -3
  612. package/services/ProjectInfoService/ProjectInfoService.js +48 -51
  613. package/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  614. package/services/ProjectInfoService/index.d.ts +0 -1
  615. package/services/ProjectInfoService/index.js +0 -3
  616. package/services/ProjectSdkParamsService/ProjectSdkParamsService.js +37 -34
  617. package/services/ProjectSdkParamsService/ProjectSdkParamsService.js.map +1 -1
  618. package/services/ProjectSdkParamsService/index.js +0 -2
  619. package/services/SetProjectIdService/SetProjectIdService.js +37 -46
  620. package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
  621. package/services/SetProjectIdService/index.js +0 -2
  622. package/services/StdioService/StdioService.js +15 -14
  623. package/services/StdioService/StdioService.js.map +1 -1
  624. package/services/StdioService/index.js +0 -2
  625. package/services/UiService/UiService.d.ts +18 -0
  626. package/services/UiService/UiService.js +71 -58
  627. package/services/UiService/UiService.js.map +1 -1
  628. package/services/UiService/index.js +0 -2
  629. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js +21 -19
  630. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js.map +1 -1
  631. package/services/ValidateProjectConfigService/index.js +0 -2
  632. package/services/WcpService/CreateUserPat.js +20 -23
  633. package/services/WcpService/CreateUserPat.js.map +1 -1
  634. package/services/WcpService/GenerateUserPat.js +15 -18
  635. package/services/WcpService/GenerateUserPat.js.map +1 -1
  636. package/services/WcpService/GetPatFromLocalStorage.js +9 -10
  637. package/services/WcpService/GetPatFromLocalStorage.js.map +1 -1
  638. package/services/WcpService/GetProjectEnvironment.js +45 -47
  639. package/services/WcpService/GetProjectEnvironment.js.map +1 -1
  640. package/services/WcpService/GetProjectLicense.js +28 -38
  641. package/services/WcpService/GetProjectLicense.js.map +1 -1
  642. package/services/WcpService/GetUser.js +43 -46
  643. package/services/WcpService/GetUser.js.map +1 -1
  644. package/services/WcpService/GetUserPat.js +20 -23
  645. package/services/WcpService/GetUserPat.js.map +1 -1
  646. package/services/WcpService/LogoutUser.js +9 -8
  647. package/services/WcpService/LogoutUser.js.map +1 -1
  648. package/services/WcpService/StorePatToLocalStorage.js +9 -10
  649. package/services/WcpService/StorePatToLocalStorage.js.map +1 -1
  650. package/services/WcpService/UnsetPatFromLocalStorage.js +9 -10
  651. package/services/WcpService/UnsetPatFromLocalStorage.js.map +1 -1
  652. package/services/WcpService/WcpGqlClient.js +7 -6
  653. package/services/WcpService/WcpGqlClient.js.map +1 -1
  654. package/services/WcpService/WcpService.js +74 -75
  655. package/services/WcpService/WcpService.js.map +1 -1
  656. package/services/WcpService/fetchProjectEnvironmentByApiKey.d.ts +8 -0
  657. package/services/WcpService/fetchProjectEnvironmentByApiKey.js +21 -0
  658. package/services/WcpService/fetchProjectEnvironmentByApiKey.js.map +1 -0
  659. package/services/WcpService/index.js +0 -2
  660. package/services/index.d.ts +1 -12
  661. package/services/index.js +1 -14
  662. package/utils/ExtensionSrcResolver.js +52 -106
  663. package/utils/ExtensionSrcResolver.js.map +1 -1
  664. package/utils/apiRuntimeEnv.d.ts +20 -0
  665. package/utils/apiRuntimeEnv.js +51 -0
  666. package/utils/apiRuntimeEnv.js.map +1 -0
  667. package/utils/constants.js +8 -7
  668. package/utils/constants.js.map +1 -1
  669. package/utils/createPathResolver.js +2 -5
  670. package/utils/createPathResolver.js.map +1 -1
  671. package/utils/ensureNamedImport.d.ts +12 -0
  672. package/utils/ensureNamedImport.js +27 -0
  673. package/utils/ensureNamedImport.js.map +1 -0
  674. package/utils/env/configuration.js +16 -25
  675. package/utils/env/configuration.js.map +1 -1
  676. package/utils/env/index.d.ts +0 -1
  677. package/utils/env/index.js +0 -3
  678. package/utils/env/types.js +0 -3
  679. package/utils/env/withEnv.js +4 -7
  680. package/utils/env/withEnv.js.map +1 -1
  681. package/utils/env/withEnvVariant.js +8 -11
  682. package/utils/env/withEnvVariant.js.map +1 -1
  683. package/utils/env/withProjectName.js +4 -9
  684. package/utils/env/withProjectName.js.map +1 -1
  685. package/utils/env/withRegion.js +10 -17
  686. package/utils/env/withRegion.js.map +1 -1
  687. package/utils/getRandomColorForString.js +86 -8
  688. package/utils/getRandomColorForString.js.map +1 -1
  689. package/utils/getStackName.js +11 -18
  690. package/utils/getStackName.js.map +1 -1
  691. package/utils/index.d.ts +5 -1
  692. package/utils/index.js +5 -3
  693. package/utils/isValidRegionName.js +8 -13
  694. package/utils/isValidRegionName.js.map +1 -1
  695. package/utils/isValidVariantName.js +11 -10
  696. package/utils/isValidVariantName.js.map +1 -1
  697. package/utils/measureDuration.js +7 -8
  698. package/utils/measureDuration.js.map +1 -1
  699. package/utils/projectSdkContext.js +23 -39
  700. package/utils/projectSdkContext.js.map +1 -1
  701. package/utils/regions.js +75 -63
  702. package/utils/regions.js.map +1 -1
  703. package/utils/registerExtension.js +6 -15
  704. package/utils/registerExtension.js.map +1 -1
  705. package/utils/registerSrcExtensions.d.ts +13 -0
  706. package/utils/registerSrcExtensions.js +10 -0
  707. package/utils/registerSrcExtensions.js.map +1 -0
  708. package/utils/requireConfig.js +8 -9
  709. package/utils/requireConfig.js.map +1 -1
  710. package/utils/toImportSpecifier.d.ts +5 -0
  711. package/utils/toImportSpecifier.js +6 -0
  712. package/utils/toImportSpecifier.js.map +1 -0
  713. package/utils/trace/TraceRecorder.d.ts +17 -0
  714. package/utils/trace/TraceRecorder.js +51 -0
  715. package/utils/trace/TraceRecorder.js.map +1 -0
  716. package/utils/trace/formatTraceReport.d.ts +2 -0
  717. package/utils/trace/formatTraceReport.js +53 -0
  718. package/utils/trace/formatTraceReport.js.map +1 -0
  719. package/utils/trace/index.d.ts +6 -0
  720. package/utils/trace/index.js +6 -0
  721. package/utils/trace/isTraceRequested.d.ts +1 -0
  722. package/utils/trace/isTraceRequested.js +12 -0
  723. package/utils/trace/isTraceRequested.js.map +1 -0
  724. package/utils/trace/startTrace.d.ts +1 -0
  725. package/utils/trace/startTrace.js +19 -0
  726. package/utils/trace/startTrace.js.map +1 -0
  727. package/utils/trace/trace.d.ts +1 -0
  728. package/utils/trace/trace.js +13 -0
  729. package/utils/trace/trace.js.map +1 -0
  730. package/utils/trace/traceAsync.d.ts +1 -0
  731. package/utils/trace/traceAsync.js +13 -0
  732. package/utils/trace/traceAsync.js.map +1 -0
  733. package/abstractions/features/DeployApp.d.ts +0 -21
  734. package/abstractions/features/DeployApp.js +0 -4
  735. package/abstractions/features/DeployApp.js.map +0 -1
  736. package/abstractions/features/DestroyApp.d.ts +0 -18
  737. package/abstractions/features/DestroyApp.js +0 -4
  738. package/abstractions/features/DestroyApp.js.map +0 -1
  739. package/abstractions/features/ExportStack.d.ts +0 -18
  740. package/abstractions/features/ExportStack.js +0 -4
  741. package/abstractions/features/ExportStack.js.map +0 -1
  742. package/abstractions/features/GetAppOutput.d.ts +0 -18
  743. package/abstractions/features/GetAppOutput.js +0 -4
  744. package/abstractions/features/GetAppOutput.js.map +0 -1
  745. package/abstractions/features/GetAppStackOutput.d.ts +0 -21
  746. package/abstractions/features/GetAppStackOutput.js +0 -9
  747. package/abstractions/features/GetAppStackOutput.js.map +0 -1
  748. package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +0 -7
  749. package/abstractions/features/GetPulumiResourceNamePrefix.js +0 -4
  750. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +0 -1
  751. package/abstractions/features/RefreshApp.d.ts +0 -18
  752. package/abstractions/features/RefreshApp.js +0 -4
  753. package/abstractions/features/RefreshApp.js.map +0 -1
  754. package/abstractions/features/RunPulumiCommand.d.ts +0 -19
  755. package/abstractions/features/RunPulumiCommand.js +0 -4
  756. package/abstractions/features/RunPulumiCommand.js.map +0 -1
  757. package/abstractions/features/hooks/AdminAfterDeploy.d.ts +0 -9
  758. package/abstractions/features/hooks/AdminAfterDeploy.js +0 -4
  759. package/abstractions/features/hooks/AdminAfterDeploy.js.map +0 -1
  760. package/abstractions/features/hooks/AdminBeforeDeploy.d.ts +0 -9
  761. package/abstractions/features/hooks/AdminBeforeDeploy.js +0 -4
  762. package/abstractions/features/hooks/AdminBeforeDeploy.js.map +0 -1
  763. package/abstractions/features/hooks/AfterDeploy.d.ts +0 -9
  764. package/abstractions/features/hooks/AfterDeploy.js +0 -4
  765. package/abstractions/features/hooks/AfterDeploy.js.map +0 -1
  766. package/abstractions/features/hooks/ApiAfterDeploy.d.ts +0 -9
  767. package/abstractions/features/hooks/ApiAfterDeploy.js +0 -4
  768. package/abstractions/features/hooks/ApiAfterDeploy.js.map +0 -1
  769. package/abstractions/features/hooks/ApiBeforeDeploy.d.ts +0 -9
  770. package/abstractions/features/hooks/ApiBeforeDeploy.js +0 -4
  771. package/abstractions/features/hooks/ApiBeforeDeploy.js.map +0 -1
  772. package/abstractions/features/hooks/BeforeDeploy.d.ts +0 -9
  773. package/abstractions/features/hooks/BeforeDeploy.js +0 -4
  774. package/abstractions/features/hooks/BeforeDeploy.js.map +0 -1
  775. package/abstractions/features/hooks/CoreAfterDeploy.d.ts +0 -9
  776. package/abstractions/features/hooks/CoreAfterDeploy.js +0 -4
  777. package/abstractions/features/hooks/CoreAfterDeploy.js.map +0 -1
  778. package/abstractions/features/hooks/CoreBeforeDeploy.d.ts +0 -9
  779. package/abstractions/features/hooks/CoreBeforeDeploy.js +0 -4
  780. package/abstractions/features/hooks/CoreBeforeDeploy.js.map +0 -1
  781. package/abstractions/features/hooks/index.js.map +0 -1
  782. package/abstractions/features/index.js.map +0 -1
  783. package/abstractions/features/pulumi/AdminPulumi.d.ts +0 -8
  784. package/abstractions/features/pulumi/AdminPulumi.js +0 -4
  785. package/abstractions/features/pulumi/AdminPulumi.js.map +0 -1
  786. package/abstractions/features/pulumi/ApiPulumi.d.ts +0 -8
  787. package/abstractions/features/pulumi/ApiPulumi.js +0 -4
  788. package/abstractions/features/pulumi/ApiPulumi.js.map +0 -1
  789. package/abstractions/features/pulumi/CorePulumi.d.ts +0 -8
  790. package/abstractions/features/pulumi/CorePulumi.js +0 -4
  791. package/abstractions/features/pulumi/CorePulumi.js.map +0 -1
  792. package/abstractions/features/pulumi/index.d.ts +0 -3
  793. package/abstractions/features/pulumi/index.js +0 -5
  794. package/abstractions/features/pulumi/index.js.map +0 -1
  795. package/abstractions/index.js.map +0 -1
  796. package/abstractions/models/IAppModel.js.map +0 -1
  797. package/abstractions/models/IAppPackageModel.js.map +0 -1
  798. package/abstractions/models/IPathModel.js.map +0 -1
  799. package/abstractions/models/IProjectConfigDto.js.map +0 -1
  800. package/abstractions/models/IProjectConfigModel.js.map +0 -1
  801. package/abstractions/models/IProjectModel.js.map +0 -1
  802. package/abstractions/models/IUrlModel.js.map +0 -1
  803. package/abstractions/models/IWcpEnvironmentDto.js.map +0 -1
  804. package/abstractions/models/IWcpEnvironmentModel.js.map +0 -1
  805. package/abstractions/models/IWcpUserDto.js.map +0 -1
  806. package/abstractions/models/IWcpUserModel.js.map +0 -1
  807. package/abstractions/models/IWcpUserPatDto.js.map +0 -1
  808. package/abstractions/models/IWcpUserPatModel.js.map +0 -1
  809. package/abstractions/models/PackagesBuilder/IPackagesBuilder.js.map +0 -1
  810. package/abstractions/models/PackagesBuilder/IRunnableBuildProcess.js.map +0 -1
  811. package/abstractions/models/PackagesBuilder/IRunnableBuildProcesses.js.map +0 -1
  812. package/abstractions/models/PackagesBuilder/index.js.map +0 -1
  813. package/abstractions/models/index.js.map +0 -1
  814. package/abstractions/services/GetPulumiService.d.ts +0 -14
  815. package/abstractions/services/GetPulumiService.js +0 -4
  816. package/abstractions/services/GetPulumiService.js.map +0 -1
  817. package/abstractions/services/IsRemotePulumiBackendService.d.ts +0 -7
  818. package/abstractions/services/IsRemotePulumiBackendService.js +0 -4
  819. package/abstractions/services/IsRemotePulumiBackendService.js.map +0 -1
  820. package/abstractions/services/ListAppLambdaFunctionsService.d.ts +0 -23
  821. package/abstractions/services/ListAppLambdaFunctionsService.js +0 -4
  822. package/abstractions/services/ListAppLambdaFunctionsService.js.map +0 -1
  823. package/abstractions/services/ListDeployedEnvironmentsService.d.ts +0 -12
  824. package/abstractions/services/ListDeployedEnvironmentsService.js +0 -4
  825. package/abstractions/services/ListDeployedEnvironmentsService.js.map +0 -1
  826. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -12
  827. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js +0 -4
  828. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
  829. package/abstractions/services/ProjectInfoService/index.js.map +0 -1
  830. package/abstractions/services/PulumiExportService.d.ts +0 -13
  831. package/abstractions/services/PulumiExportService.js +0 -7
  832. package/abstractions/services/PulumiExportService.js.map +0 -1
  833. package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +0 -7
  834. package/abstractions/services/PulumiGetConfigPassphraseService.js +0 -4
  835. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +0 -1
  836. package/abstractions/services/PulumiGetSecretsProviderService.d.ts +0 -7
  837. package/abstractions/services/PulumiGetSecretsProviderService.js +0 -4
  838. package/abstractions/services/PulumiGetSecretsProviderService.js.map +0 -1
  839. package/abstractions/services/PulumiGetStackOutputService.d.ts +0 -13
  840. package/abstractions/services/PulumiGetStackOutputService.js +0 -4
  841. package/abstractions/services/PulumiGetStackOutputService.js.map +0 -1
  842. package/abstractions/services/PulumiImportService.d.ts +0 -8
  843. package/abstractions/services/PulumiImportService.js +0 -4
  844. package/abstractions/services/PulumiImportService.js.map +0 -1
  845. package/abstractions/services/PulumiLoginService.d.ts +0 -16
  846. package/abstractions/services/PulumiLoginService.js +0 -4
  847. package/abstractions/services/PulumiLoginService.js.map +0 -1
  848. package/abstractions/services/PulumiSelectStackService.d.ts +0 -10
  849. package/abstractions/services/PulumiSelectStackService.js +0 -4
  850. package/abstractions/services/PulumiSelectStackService.js.map +0 -1
  851. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +0 -23
  852. package/abstractions/services/WatchedLambdaFunctionsService.js +0 -4
  853. package/abstractions/services/WatchedLambdaFunctionsService.js.map +0 -1
  854. package/abstractions/services/index.js.map +0 -1
  855. package/abstractions/types.js.map +0 -1
  856. package/components/Wcp.d.ts +0 -17
  857. package/components/Wcp.js +0 -41
  858. package/components/Wcp.js.map +0 -1
  859. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +0 -16
  860. package/decorators/DeployAppClearWatchedLambdaFunctions.js +0 -28
  861. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +0 -1
  862. package/decorators/DeployAppRefreshStackOutputCache.d.ts +0 -17
  863. package/decorators/DeployAppRefreshStackOutputCache.js +0 -36
  864. package/decorators/DeployAppRefreshStackOutputCache.js.map +0 -1
  865. package/decorators/DeployAppWithHooks.d.ts +0 -17
  866. package/decorators/DeployAppWithHooks.js +0 -48
  867. package/decorators/DeployAppWithHooks.js.map +0 -1
  868. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +0 -16
  869. package/decorators/DeployAppWithWatchedLambdaReplacement.js +0 -34
  870. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +0 -1
  871. package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +0 -11
  872. package/decorators/GetPulumiServiceWithDownloadInfo.js +0 -25
  873. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +0 -1
  874. package/decorators/index.js.map +0 -1
  875. package/defineExtension/index.js.map +0 -1
  876. package/defineExtension/models/index.js.map +0 -1
  877. package/defineExtension/types.js.map +0 -1
  878. package/exports/extensions.d.ts +0 -2
  879. package/exports/extensions.js +0 -4
  880. package/exports/extensions.js.map +0 -1
  881. package/exports/infra/admin.js.map +0 -1
  882. package/exports/infra/api.js.map +0 -1
  883. package/exports/infra/core.js.map +0 -1
  884. package/exports/infra/index.d.ts +0 -8
  885. package/exports/infra/index.js +0 -10
  886. package/exports/infra/index.js.map +0 -1
  887. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.d.ts +0 -11
  888. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js +0 -31
  889. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js.map +0 -1
  890. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.d.ts +0 -11
  891. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js +0 -31
  892. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js.map +0 -1
  893. package/extensions/Project/EnsureApiDeployedBeforeWatch.d.ts +0 -11
  894. package/extensions/Project/EnsureApiDeployedBeforeWatch.js +0 -31
  895. package/extensions/Project/EnsureApiDeployedBeforeWatch.js.map +0 -1
  896. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.d.ts +0 -11
  897. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js +0 -34
  898. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js.map +0 -1
  899. package/extensions/Project/EnsureTelemetryEnabledForOss.d.ts +0 -13
  900. package/extensions/Project/EnsureTelemetryEnabledForOss.js +0 -37
  901. package/extensions/Project/EnsureTelemetryEnabledForOss.js.map +0 -1
  902. package/extensions/Project/TelemetryNoLongerNewUser.d.ts +0 -8
  903. package/extensions/Project/TelemetryNoLongerNewUser.js +0 -14
  904. package/extensions/Project/TelemetryNoLongerNewUser.js.map +0 -1
  905. package/extensions/Project/ValidateProductionPulumiState.d.ts +0 -11
  906. package/extensions/Project/ValidateProductionPulumiState.js +0 -37
  907. package/extensions/Project/ValidateProductionPulumiState.js.map +0 -1
  908. package/extensions/hooks/AdminAfterDeploy.d.ts +0 -8
  909. package/extensions/hooks/AdminAfterDeploy.js +0 -25
  910. package/extensions/hooks/AdminAfterDeploy.js.map +0 -1
  911. package/extensions/hooks/AdminBeforeDeploy.d.ts +0 -8
  912. package/extensions/hooks/AdminBeforeDeploy.js +0 -25
  913. package/extensions/hooks/AdminBeforeDeploy.js.map +0 -1
  914. package/extensions/hooks/AfterDeploy.d.ts +0 -8
  915. package/extensions/hooks/AfterDeploy.js +0 -24
  916. package/extensions/hooks/AfterDeploy.js.map +0 -1
  917. package/extensions/hooks/ApiAfterDeploy.d.ts +0 -8
  918. package/extensions/hooks/ApiAfterDeploy.js +0 -25
  919. package/extensions/hooks/ApiAfterDeploy.js.map +0 -1
  920. package/extensions/hooks/ApiBeforeDeploy.d.ts +0 -8
  921. package/extensions/hooks/ApiBeforeDeploy.js +0 -25
  922. package/extensions/hooks/ApiBeforeDeploy.js.map +0 -1
  923. package/extensions/hooks/BeforeDeploy.d.ts +0 -8
  924. package/extensions/hooks/BeforeDeploy.js +0 -24
  925. package/extensions/hooks/BeforeDeploy.js.map +0 -1
  926. package/extensions/hooks/CoreAfterDeploy.d.ts +0 -8
  927. package/extensions/hooks/CoreAfterDeploy.js +0 -25
  928. package/extensions/hooks/CoreAfterDeploy.js.map +0 -1
  929. package/extensions/hooks/CoreBeforeDeploy.d.ts +0 -8
  930. package/extensions/hooks/CoreBeforeDeploy.js +0 -25
  931. package/extensions/hooks/CoreBeforeDeploy.js.map +0 -1
  932. package/extensions/hooks/index.js.map +0 -1
  933. package/extensions/infra/index.js.map +0 -1
  934. package/extensions/pulumi/AdminPulumi.d.ts +0 -8
  935. package/extensions/pulumi/AdminPulumi.js +0 -25
  936. package/extensions/pulumi/AdminPulumi.js.map +0 -1
  937. package/extensions/pulumi/AdminStackOutputValue.d.ts +0 -11
  938. package/extensions/pulumi/AdminStackOutputValue.js +0 -17
  939. package/extensions/pulumi/AdminStackOutputValue.js.map +0 -1
  940. package/extensions/pulumi/ApiPulumi.d.ts +0 -8
  941. package/extensions/pulumi/ApiPulumi.js +0 -25
  942. package/extensions/pulumi/ApiPulumi.js.map +0 -1
  943. package/extensions/pulumi/ApiStackOutputValue.d.ts +0 -11
  944. package/extensions/pulumi/ApiStackOutputValue.js +0 -17
  945. package/extensions/pulumi/ApiStackOutputValue.js.map +0 -1
  946. package/extensions/pulumi/CorePulumi.d.ts +0 -8
  947. package/extensions/pulumi/CorePulumi.js +0 -25
  948. package/extensions/pulumi/CorePulumi.js.map +0 -1
  949. package/extensions/pulumi/CoreStackOutputValue.d.ts +0 -11
  950. package/extensions/pulumi/CoreStackOutputValue.js +0 -17
  951. package/extensions/pulumi/CoreStackOutputValue.js.map +0 -1
  952. package/extensions/pulumi/ProductionEnvironments.d.ts +0 -8
  953. package/extensions/pulumi/ProductionEnvironments.js +0 -31
  954. package/extensions/pulumi/ProductionEnvironments.js.map +0 -1
  955. package/extensions/pulumi/PulumiResourceNamePrefix.d.ts +0 -8
  956. package/extensions/pulumi/PulumiResourceNamePrefix.js +0 -14
  957. package/extensions/pulumi/PulumiResourceNamePrefix.js.map +0 -1
  958. package/extensions/pulumi/index.d.ts +0 -8
  959. package/extensions/pulumi/index.js +0 -10
  960. package/extensions/pulumi/index.js.map +0 -1
  961. package/features/BuildApp/PackagesBuilder/utils/requireConfig.d.ts +0 -18
  962. package/features/BuildApp/PackagesBuilder/utils/requireConfig.js +0 -15
  963. package/features/BuildApp/PackagesBuilder/utils/requireConfig.js.map +0 -1
  964. package/features/BuildApp/index.js.map +0 -1
  965. package/features/DeployApp/DeployApp.d.ts +0 -14
  966. package/features/DeployApp/DeployApp.js +0 -86
  967. package/features/DeployApp/DeployApp.js.map +0 -1
  968. package/features/DeployApp/index.d.ts +0 -1
  969. package/features/DeployApp/index.js +0 -3
  970. package/features/DeployApp/index.js.map +0 -1
  971. package/features/DestroyApp/DestroyApp.d.ts +0 -14
  972. package/features/DestroyApp/DestroyApp.js +0 -52
  973. package/features/DestroyApp/DestroyApp.js.map +0 -1
  974. package/features/DestroyApp/index.d.ts +0 -1
  975. package/features/DestroyApp/index.js +0 -3
  976. package/features/DestroyApp/index.js.map +0 -1
  977. package/features/ExportStack/ExportStack.d.ts +0 -9
  978. package/features/ExportStack/ExportStack.js +0 -21
  979. package/features/ExportStack/ExportStack.js.map +0 -1
  980. package/features/ExportStack/index.d.ts +0 -1
  981. package/features/ExportStack/index.js +0 -3
  982. package/features/ExportStack/index.js.map +0 -1
  983. package/features/GetApp/index.js.map +0 -1
  984. package/features/GetAppOutput/GetAppOutput.d.ts +0 -12
  985. package/features/GetAppOutput/GetAppOutput.js +0 -40
  986. package/features/GetAppOutput/GetAppOutput.js.map +0 -1
  987. package/features/GetAppOutput/index.d.ts +0 -1
  988. package/features/GetAppOutput/index.js +0 -3
  989. package/features/GetAppOutput/index.js.map +0 -1
  990. package/features/GetAppStackOutput/GetAppStackOutput.d.ts +0 -10
  991. package/features/GetAppStackOutput/GetAppStackOutput.js +0 -21
  992. package/features/GetAppStackOutput/GetAppStackOutput.js.map +0 -1
  993. package/features/GetAppStackOutput/index.d.ts +0 -1
  994. package/features/GetAppStackOutput/index.js +0 -3
  995. package/features/GetAppStackOutput/index.js.map +0 -1
  996. package/features/GetLogger/index.js.map +0 -1
  997. package/features/GetProductionEnvironments/index.js.map +0 -1
  998. package/features/GetProject/index.js.map +0 -1
  999. package/features/GetProjectConfig/index.js.map +0 -1
  1000. package/features/GetProjectInfo/index.js.map +0 -1
  1001. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +0 -7
  1002. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +0 -24
  1003. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +0 -1
  1004. package/features/GetPulumiResourceNamePrefix/index.d.ts +0 -1
  1005. package/features/GetPulumiResourceNamePrefix/index.js +0 -3
  1006. package/features/GetPulumiResourceNamePrefix/index.js.map +0 -1
  1007. package/features/InstallExtension/index.js.map +0 -1
  1008. package/features/IsCi/index.js.map +0 -1
  1009. package/features/IsTelemetryEnabled/index.js.map +0 -1
  1010. package/features/IsWcpEnabled/index.js.map +0 -1
  1011. package/features/IsWebinyJsRepo/index.js.map +0 -1
  1012. package/features/RefreshApp/RefreshApp.d.ts +0 -13
  1013. package/features/RefreshApp/RefreshApp.js +0 -53
  1014. package/features/RefreshApp/RefreshApp.js.map +0 -1
  1015. package/features/RefreshApp/index.d.ts +0 -1
  1016. package/features/RefreshApp/index.js +0 -3
  1017. package/features/RefreshApp/index.js.map +0 -1
  1018. package/features/RunPulumiCommand/RunPulumiCommand.d.ts +0 -13
  1019. package/features/RunPulumiCommand/RunPulumiCommand.js +0 -50
  1020. package/features/RunPulumiCommand/RunPulumiCommand.js.map +0 -1
  1021. package/features/RunPulumiCommand/index.d.ts +0 -1
  1022. package/features/RunPulumiCommand/index.js +0 -3
  1023. package/features/RunPulumiCommand/index.js.map +0 -1
  1024. package/features/ValidateProjectConfig/index.js.map +0 -1
  1025. package/features/Watch/getIotEndpoint.d.ts +0 -2
  1026. package/features/Watch/getIotEndpoint.js +0 -16
  1027. package/features/Watch/getIotEndpoint.js.map +0 -1
  1028. package/features/Watch/handler/handler.zip +0 -0
  1029. package/features/Watch/index.js.map +0 -1
  1030. package/features/Watch/initInvocationForwarding.d.ts +0 -9
  1031. package/features/Watch/initInvocationForwarding.js +0 -110
  1032. package/features/Watch/initInvocationForwarding.js.map +0 -1
  1033. package/features/Watch/localInvocationWorker.d.ts +0 -1
  1034. package/features/Watch/localInvocationWorker.js +0 -36
  1035. package/features/Watch/localInvocationWorker.js.map +0 -1
  1036. package/features/Watch/replaceLambdaFunctions.d.ts +0 -18
  1037. package/features/Watch/replaceLambdaFunctions.js +0 -91
  1038. package/features/Watch/replaceLambdaFunctions.js.map +0 -1
  1039. package/features/Watch/watchers/utils/requireConfig.d.ts +0 -18
  1040. package/features/Watch/watchers/utils/requireConfig.js +0 -15
  1041. package/features/Watch/watchers/utils/requireConfig.js.map +0 -1
  1042. package/features/hooks/AdminAfterBuild/index.js.map +0 -1
  1043. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.d.ts +0 -7
  1044. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js +0 -21
  1045. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js.map +0 -1
  1046. package/features/hooks/AdminAfterDeploy/index.d.ts +0 -1
  1047. package/features/hooks/AdminAfterDeploy/index.js +0 -3
  1048. package/features/hooks/AdminAfterDeploy/index.js.map +0 -1
  1049. package/features/hooks/AdminBeforeBuild/index.js.map +0 -1
  1050. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +0 -7
  1051. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +0 -21
  1052. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +0 -1
  1053. package/features/hooks/AdminBeforeDeploy/index.d.ts +0 -1
  1054. package/features/hooks/AdminBeforeDeploy/index.js +0 -3
  1055. package/features/hooks/AdminBeforeDeploy/index.js.map +0 -1
  1056. package/features/hooks/AdminBeforeWatch/index.js.map +0 -1
  1057. package/features/hooks/AfterBuild/index.js.map +0 -1
  1058. package/features/hooks/AfterDeploy/AfterDeploy.d.ts +0 -7
  1059. package/features/hooks/AfterDeploy/AfterDeploy.js +0 -21
  1060. package/features/hooks/AfterDeploy/AfterDeploy.js.map +0 -1
  1061. package/features/hooks/AfterDeploy/index.d.ts +0 -1
  1062. package/features/hooks/AfterDeploy/index.js +0 -3
  1063. package/features/hooks/AfterDeploy/index.js.map +0 -1
  1064. package/features/hooks/ApiAfterBuild/index.js.map +0 -1
  1065. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.d.ts +0 -7
  1066. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js +0 -21
  1067. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js.map +0 -1
  1068. package/features/hooks/ApiAfterDeploy/index.d.ts +0 -1
  1069. package/features/hooks/ApiAfterDeploy/index.js +0 -3
  1070. package/features/hooks/ApiAfterDeploy/index.js.map +0 -1
  1071. package/features/hooks/ApiBeforeBuild/index.js.map +0 -1
  1072. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +0 -7
  1073. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +0 -21
  1074. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +0 -1
  1075. package/features/hooks/ApiBeforeDeploy/index.d.ts +0 -1
  1076. package/features/hooks/ApiBeforeDeploy/index.js +0 -3
  1077. package/features/hooks/ApiBeforeDeploy/index.js.map +0 -1
  1078. package/features/hooks/ApiBeforeWatch/index.js.map +0 -1
  1079. package/features/hooks/BeforeBuild/index.js.map +0 -1
  1080. package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +0 -7
  1081. package/features/hooks/BeforeDeploy/BeforeDeploy.js +0 -21
  1082. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +0 -1
  1083. package/features/hooks/BeforeDeploy/index.d.ts +0 -1
  1084. package/features/hooks/BeforeDeploy/index.js +0 -3
  1085. package/features/hooks/BeforeDeploy/index.js.map +0 -1
  1086. package/features/hooks/BeforeWatch/index.js.map +0 -1
  1087. package/features/hooks/CoreAfterBuild/index.js.map +0 -1
  1088. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.d.ts +0 -7
  1089. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js +0 -21
  1090. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js.map +0 -1
  1091. package/features/hooks/CoreAfterDeploy/index.d.ts +0 -1
  1092. package/features/hooks/CoreAfterDeploy/index.js +0 -3
  1093. package/features/hooks/CoreAfterDeploy/index.js.map +0 -1
  1094. package/features/hooks/CoreBeforeBuild/index.js.map +0 -1
  1095. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +0 -7
  1096. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +0 -21
  1097. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +0 -1
  1098. package/features/hooks/CoreBeforeDeploy/index.d.ts +0 -1
  1099. package/features/hooks/CoreBeforeDeploy/index.js +0 -3
  1100. package/features/hooks/CoreBeforeDeploy/index.js.map +0 -1
  1101. package/features/hooks/CoreBeforeWatch/index.js.map +0 -1
  1102. package/features/hooks/index.js.map +0 -1
  1103. package/features/index.js.map +0 -1
  1104. package/features/pulumi/AdminPulumi/AdminPulumi.d.ts +0 -7
  1105. package/features/pulumi/AdminPulumi/AdminPulumi.js +0 -21
  1106. package/features/pulumi/AdminPulumi/AdminPulumi.js.map +0 -1
  1107. package/features/pulumi/AdminPulumi/index.d.ts +0 -1
  1108. package/features/pulumi/AdminPulumi/index.js +0 -3
  1109. package/features/pulumi/AdminPulumi/index.js.map +0 -1
  1110. package/features/pulumi/ApiPulumi/ApiPulumi.d.ts +0 -7
  1111. package/features/pulumi/ApiPulumi/ApiPulumi.js +0 -21
  1112. package/features/pulumi/ApiPulumi/ApiPulumi.js.map +0 -1
  1113. package/features/pulumi/ApiPulumi/index.d.ts +0 -1
  1114. package/features/pulumi/ApiPulumi/index.js +0 -3
  1115. package/features/pulumi/ApiPulumi/index.js.map +0 -1
  1116. package/features/pulumi/CorePulumi/CorePulumi.d.ts +0 -7
  1117. package/features/pulumi/CorePulumi/CorePulumi.js +0 -21
  1118. package/features/pulumi/CorePulumi/CorePulumi.js.map +0 -1
  1119. package/features/pulumi/CorePulumi/index.d.ts +0 -1
  1120. package/features/pulumi/CorePulumi/index.js +0 -3
  1121. package/features/pulumi/CorePulumi/index.js.map +0 -1
  1122. package/features/pulumi/index.d.ts +0 -3
  1123. package/features/pulumi/index.js +0 -5
  1124. package/features/pulumi/index.js.map +0 -1
  1125. package/models/index.js.map +0 -1
  1126. package/services/BuildAppWorkspaceService/index.js.map +0 -1
  1127. package/services/BuildProjectWorkspaceService/index.js.map +0 -1
  1128. package/services/GetAppPackagesService/index.js.map +0 -1
  1129. package/services/GetAppService/index.js.map +0 -1
  1130. package/services/GetCwdService/index.js.map +0 -1
  1131. package/services/GetProjectConfigService/index.js.map +0 -1
  1132. package/services/GetProjectConfigService/renderConfigWorker.d.ts +0 -1
  1133. package/services/GetProjectConfigService/renderConfigWorker.js +0 -58
  1134. package/services/GetProjectConfigService/renderConfigWorker.js.map +0 -1
  1135. package/services/GetProjectIdService/index.js.map +0 -1
  1136. package/services/GetProjectService/index.js.map +0 -1
  1137. package/services/GetProjectVersionService/index.js.map +0 -1
  1138. package/services/GetPulumiService/GetPulumiService.d.ts +0 -9
  1139. package/services/GetPulumiService/GetPulumiService.js +0 -49
  1140. package/services/GetPulumiService/GetPulumiService.js.map +0 -1
  1141. package/services/GetPulumiService/index.d.ts +0 -1
  1142. package/services/GetPulumiService/index.js +0 -3
  1143. package/services/GetPulumiService/index.js.map +0 -1
  1144. package/services/InitProjectSdkService/index.js.map +0 -1
  1145. package/services/InitProjectSdkService/registerPulumiExtensions.d.ts +0 -4
  1146. package/services/InitProjectSdkService/registerPulumiExtensions.js +0 -11
  1147. package/services/InitProjectSdkService/registerPulumiExtensions.js.map +0 -1
  1148. package/services/InstallExtensionService/index.js.map +0 -1
  1149. package/services/InstallExtensionService/types.js.map +0 -1
  1150. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +0 -13
  1151. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +0 -23
  1152. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +0 -1
  1153. package/services/IsRemotePulumiBackendService/index.d.ts +0 -1
  1154. package/services/IsRemotePulumiBackendService/index.js +0 -3
  1155. package/services/IsRemotePulumiBackendService/index.js.map +0 -1
  1156. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +0 -18
  1157. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +0 -84
  1158. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +0 -1
  1159. package/services/ListAppLambdaFunctionsService/index.d.ts +0 -1
  1160. package/services/ListAppLambdaFunctionsService/index.js +0 -3
  1161. package/services/ListAppLambdaFunctionsService/index.js.map +0 -1
  1162. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +0 -7
  1163. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +0 -32
  1164. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +0 -1
  1165. package/services/ListDeployedEnvironmentsService/index.d.ts +0 -1
  1166. package/services/ListDeployedEnvironmentsService/index.js +0 -3
  1167. package/services/ListDeployedEnvironmentsService/index.js.map +0 -1
  1168. package/services/ListPackagesInAppWorkspaceService/index.js.map +0 -1
  1169. package/services/ListPackagesService/index.js.map +0 -1
  1170. package/services/LoadEnvVarsService/index.js.map +0 -1
  1171. package/services/LocalStorageService/index.js.map +0 -1
  1172. package/services/LoggerService/index.js.map +0 -1
  1173. package/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -5
  1174. package/services/ProjectInfoService/GetPulumiVersionService.js +0 -38
  1175. package/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
  1176. package/services/ProjectInfoService/index.js.map +0 -1
  1177. package/services/ProjectSdkParamsService/index.js.map +0 -1
  1178. package/services/PulumiExportService/PulumiExportService.d.ts +0 -13
  1179. package/services/PulumiExportService/PulumiExportService.js +0 -43
  1180. package/services/PulumiExportService/PulumiExportService.js.map +0 -1
  1181. package/services/PulumiExportService/index.d.ts +0 -1
  1182. package/services/PulumiExportService/index.js +0 -3
  1183. package/services/PulumiExportService/index.js.map +0 -1
  1184. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +0 -5
  1185. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +0 -14
  1186. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +0 -1
  1187. package/services/PulumiGetConfigPassphraseService/index.d.ts +0 -1
  1188. package/services/PulumiGetConfigPassphraseService/index.js +0 -3
  1189. package/services/PulumiGetConfigPassphraseService/index.js.map +0 -1
  1190. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +0 -5
  1191. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +0 -14
  1192. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +0 -1
  1193. package/services/PulumiGetSecretsProviderService/index.d.ts +0 -1
  1194. package/services/PulumiGetSecretsProviderService/index.js +0 -3
  1195. package/services/PulumiGetSecretsProviderService/index.js.map +0 -1
  1196. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +0 -20
  1197. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +0 -113
  1198. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +0 -1
  1199. package/services/PulumiGetStackOutputService/index.d.ts +0 -1
  1200. package/services/PulumiGetStackOutputService/index.js +0 -3
  1201. package/services/PulumiGetStackOutputService/index.js.map +0 -1
  1202. package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +0 -1
  1203. package/services/PulumiGetStackOutputService/mapStackOutput.js +0 -34
  1204. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +0 -1
  1205. package/services/PulumiImportService/PulumiImportService.d.ts +0 -10
  1206. package/services/PulumiImportService/PulumiImportService.js +0 -57
  1207. package/services/PulumiImportService/PulumiImportService.js.map +0 -1
  1208. package/services/PulumiImportService/index.d.ts +0 -1
  1209. package/services/PulumiImportService/index.js +0 -3
  1210. package/services/PulumiImportService/index.js.map +0 -1
  1211. package/services/PulumiLoginService/PulumiLoginService.d.ts +0 -10
  1212. package/services/PulumiLoginService/PulumiLoginService.js +0 -51
  1213. package/services/PulumiLoginService/PulumiLoginService.js.map +0 -1
  1214. package/services/PulumiLoginService/index.d.ts +0 -1
  1215. package/services/PulumiLoginService/index.js +0 -3
  1216. package/services/PulumiLoginService/index.js.map +0 -1
  1217. package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +0 -15
  1218. package/services/PulumiSelectStackService/PulumiSelectStackService.js +0 -97
  1219. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +0 -1
  1220. package/services/PulumiSelectStackService/index.d.ts +0 -1
  1221. package/services/PulumiSelectStackService/index.js +0 -3
  1222. package/services/PulumiSelectStackService/index.js.map +0 -1
  1223. package/services/SetProjectIdService/index.js.map +0 -1
  1224. package/services/StdioService/index.js.map +0 -1
  1225. package/services/UiService/index.js.map +0 -1
  1226. package/services/ValidateProjectConfigService/index.js.map +0 -1
  1227. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +0 -13
  1228. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +0 -55
  1229. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +0 -1
  1230. package/services/WatchedLambdaFunctionsService/index.d.ts +0 -1
  1231. package/services/WatchedLambdaFunctionsService/index.js +0 -3
  1232. package/services/WatchedLambdaFunctionsService/index.js.map +0 -1
  1233. package/services/WcpService/index.js.map +0 -1
  1234. package/services/index.js.map +0 -1
  1235. package/utils/env/index.js.map +0 -1
  1236. package/utils/env/types.js.map +0 -1
  1237. package/utils/env/withPulumiConfigPassphrase.d.ts +0 -1
  1238. package/utils/env/withPulumiConfigPassphrase.js +0 -11
  1239. package/utils/env/withPulumiConfigPassphrase.js.map +0 -1
  1240. package/utils/getTemplatesFolderPath.d.ts +0 -1
  1241. package/utils/getTemplatesFolderPath.js +0 -13
  1242. package/utils/getTemplatesFolderPath.js.map +0 -1
  1243. package/utils/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["z","defineExtension","crypto","path","fs","Node","Project","generateBuildParamsFeature","buildParamsDir","ctx","featureFilePath","join","files","readdirSync","filter","f","startsWith","endsWith","imports","map","file","className","parse","name","registrations","featureContent","writeFileSync","updateExtensionsTsx","extensionsTsxFilePath","project","paths","workspaceFolder","toString","addSourceFileAtPath","source","getSourceFileOrThrow","buildParamsFeatureImport","existingFeatureImport","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","namedImports","moduleSpecifier","buildParamsFeatureImportPath","existingBuildParamsImport","getNamedImports","hasBuildParamsFeature","some","ni","getName","addNamedImport","registerFeatureImportPath","existingRegisterFeatureImport","hasRegisterFeature","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","currentContent","getFullText","replace","trim","includes","newContent","replaceWithText","save","AdminBuildParam","type","tags","runtimeContext","appName","description","multiple","paramsSchema","object","paramName","string","value","union","record","any","array","number","boolean","build","params","valueStr","JSON","stringify","hash","createHash","update","digest","slice","fileName","filePath","existsSync","mkdirSync","recursive","fileContent"],"sources":["AdminBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { Node, Project } from \"ts-morph\";\n\nasync function generateBuildParamsFeature(buildParamsDir: string, ctx: any) {\n const featureFilePath = path.join(buildParamsDir, \"feature.ts\");\n\n // Get all BuildParam_*.ts files.\n const files = fs\n .readdirSync(buildParamsDir)\n .filter(f => f.startsWith(\"BuildParam_\") && f.endsWith(\".ts\") && f !== \"feature.ts\");\n\n // Generate imports and registrations.\n const imports = files\n .map(file => {\n const className = path.parse(file).name;\n return `import ${className} from \"./${className}.js\";`;\n })\n .join(\"\\n\");\n\n const registrations = files\n .map(file => {\n const className = path.parse(file).name;\n return ` container.register(${className});`;\n })\n .join(\"\\n\");\n\n const featureContent = `import { createFeature } from \"@webiny/feature/admin\";\nimport { Container } from \"@webiny/di\";\n${imports}\n\nexport const BuildParamsInternalFeature = createFeature({\n name: \"BuildParamsInternal\",\n register(container: Container) {\n${registrations}\n }\n});\n`;\n\n fs.writeFileSync(featureFilePath, featureContent, \"utf8\");\n\n // Now we need to update Extensions.tsx to use RegisterFeature with this feature.\n await updateExtensionsTsx(ctx);\n}\n\nasync function updateExtensionsTsx(ctx: any) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n // Check if we already have the imports.\n const buildParamsFeatureImport = \"./buildParams/feature.js\";\n const existingFeatureImport = source.getImportDeclaration(buildParamsFeatureImport);\n\n if (!existingFeatureImport) {\n let index = 1;\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for BuildParamsInternalFeature.\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsInternalFeature\"],\n moduleSpecifier: buildParamsFeatureImport\n });\n\n // Add import for BuildParamsFeature.\n const buildParamsFeatureImportPath = \"@webiny/app-admin\";\n const existingBuildParamsImport = source.getImportDeclaration(buildParamsFeatureImportPath);\n\n if (!existingBuildParamsImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsFeature\"],\n moduleSpecifier: buildParamsFeatureImportPath\n });\n } else {\n // Add to existing import if BuildParamsFeature not already there.\n const namedImports = existingBuildParamsImport.getNamedImports();\n const hasBuildParamsFeature = namedImports.some(\n ni => ni.getName() === \"BuildParamsFeature\"\n );\n if (!hasBuildParamsFeature) {\n existingBuildParamsImport.addNamedImport(\"BuildParamsFeature\");\n }\n }\n\n // Add import for RegisterFeature if not present.\n const registerFeatureImportPath = \"@webiny/app-admin\";\n const existingRegisterFeatureImport =\n source.getImportDeclaration(registerFeatureImportPath);\n\n if (existingRegisterFeatureImport) {\n const namedImports = existingRegisterFeatureImport.getNamedImports();\n const hasRegisterFeature = namedImports.some(ni => ni.getName() === \"RegisterFeature\");\n if (!hasRegisterFeature) {\n existingRegisterFeatureImport.addNamedImport(\"RegisterFeature\");\n }\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [\"RegisterFeature\"],\n moduleSpecifier: registerFeatureImportPath\n });\n }\n }\n\n // Now add <RegisterFeature> components to the Extensions component.\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\".`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n\n if (!extensionsArrowFn) {\n throw new Error(`Could not find the \"Extensions\" React component arrow function.`);\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n });\n\n if (!extensionsArrowFnFragment) {\n throw new Error(`Could not find JSX fragment in Extensions component.`);\n }\n\n const currentContent = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n // Check if we already have the RegisterFeature components.\n if (!currentContent.includes(\"BuildParamsFeature\")) {\n const newContent = `<><RegisterFeature feature={BuildParamsFeature} /><RegisterFeature feature={BuildParamsInternalFeature} />${currentContent}</>`;\n extensionsArrowFnFragment.replaceWithText(newContent);\n }\n\n await source.save();\n}\n\nexport const AdminBuildParam = defineExtension({\n type: \"Admin/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Add build-time parameter to Admin app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\n });\n },\n async build(params, ctx) {\n const buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Check if file already exists.\n if (!fs.existsSync(filePath)) {\n // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/admin/buildParams\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now we need to generate/update the feature file that imports all BuildParams.\n await generateBuildParamsFeature(buildParamsDir, ctx);\n }\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,eAAe;AACxB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AAExC,eAAeC,0BAA0BA,CAACC,cAAsB,EAAEC,GAAQ,EAAE;EACxE,MAAMC,eAAe,GAAGP,IAAI,CAACQ,IAAI,CAACH,cAAc,EAAE,YAAY,CAAC;;EAE/D;EACA,MAAMI,KAAK,GAAGR,EAAE,CACXS,WAAW,CAACL,cAAc,CAAC,CAC3BM,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,UAAU,CAAC,aAAa,CAAC,IAAID,CAAC,CAACE,QAAQ,CAAC,KAAK,CAAC,IAAIF,CAAC,KAAK,YAAY,CAAC;;EAExF;EACA,MAAMG,OAAO,GAAGN,KAAK,CAChBO,GAAG,CAACC,IAAI,IAAI;IACT,MAAMC,SAAS,GAAGlB,IAAI,CAACmB,KAAK,CAACF,IAAI,CAAC,CAACG,IAAI;IACvC,OAAO,UAAUF,SAAS,YAAYA,SAAS,OAAO;EAC1D,CAAC,CAAC,CACDV,IAAI,CAAC,IAAI,CAAC;EAEf,MAAMa,aAAa,GAAGZ,KAAK,CACtBO,GAAG,CAACC,IAAI,IAAI;IACT,MAAMC,SAAS,GAAGlB,IAAI,CAACmB,KAAK,CAACF,IAAI,CAAC,CAACG,IAAI;IACvC,OAAO,8BAA8BF,SAAS,IAAI;EACtD,CAAC,CAAC,CACDV,IAAI,CAAC,IAAI,CAAC;EAEf,MAAMc,cAAc,GAAG;AAC3B;AACA,EAAEP,OAAO;A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,EAAE;QAAEsG,SAAS,EAAE;MAAK,CAAC,CAAC;IACrD;;IAEA;IACA,IAAI,CAAC1G,EAAE,CAACwG,UAAU,CAACD,QAAQ,CAAC,EAAE;MAC1B;MACA,MAAMI,WAAW,GAAG;AAChC;AACA,QAAQ1F,SAAS;AACjB,aAAakE,SAAS;AACtB,cAAcW,QAAQ;AACtB;AACA;AACA;AACA,sBAAsB7E,SAAS;AAC/B;AACA;AACA,CAAC;MACWjB,EAAE,CAACsB,aAAa,CAACiF,QAAQ,EAAEI,WAAW,EAAE,MAAM,CAAC;IACnD;;IAEA;IACA,MAAMxG,0BAA0B,CAACC,cAAc,EAAEC,GAAG,CAAC;EACzD;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/AdminBuildParam.js","sources":["../../src/extensions/AdminBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { Node, Project } from \"ts-morph\";\n\nasync function generateBuildParamsFeature(buildParamsDir: string, ctx: any) {\n const featureFilePath = path.join(buildParamsDir, \"feature.ts\");\n\n // Get all BuildParam_*.ts files.\n const files = fs\n .readdirSync(buildParamsDir)\n .filter(f => f.startsWith(\"BuildParam_\") && f.endsWith(\".ts\") && f !== \"feature.ts\");\n\n // Generate imports and registrations.\n const imports = files\n .map(file => {\n const className = path.parse(file).name;\n return `import ${className} from \"./${className}.js\";`;\n })\n .join(\"\\n\");\n\n const registrations = files\n .map(file => {\n const className = path.parse(file).name;\n return ` container.register(${className});`;\n })\n .join(\"\\n\");\n\n const featureContent = `import { createFeature } from \"@webiny/feature/admin\";\nimport { Container } from \"@webiny/di\";\n${imports}\n\nexport const BuildParamsInternalFeature = createFeature({\n name: \"BuildParamsInternal\",\n register(container: Container) {\n${registrations}\n }\n});\n`;\n\n fs.writeFileSync(featureFilePath, featureContent, \"utf8\");\n\n // Now we need to update Extensions.tsx to use RegisterFeature with this feature.\n await updateExtensionsTsx(ctx);\n}\n\nasync function updateExtensionsTsx(ctx: any) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n // Check if we already have the imports.\n const buildParamsFeatureImport = \"./buildParams/feature.js\";\n const existingFeatureImport = source.getImportDeclaration(buildParamsFeatureImport);\n\n if (!existingFeatureImport) {\n let index = 1;\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for BuildParamsInternalFeature.\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsInternalFeature\"],\n moduleSpecifier: buildParamsFeatureImport\n });\n\n // Add import for BuildParamsFeature.\n const buildParamsFeatureImportPath = \"@webiny/app-admin\";\n const existingBuildParamsImport = source.getImportDeclaration(buildParamsFeatureImportPath);\n\n if (!existingBuildParamsImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsFeature\"],\n moduleSpecifier: buildParamsFeatureImportPath\n });\n } else {\n // Add to existing import if BuildParamsFeature not already there.\n const namedImports = existingBuildParamsImport.getNamedImports();\n const hasBuildParamsFeature = namedImports.some(\n ni => ni.getName() === \"BuildParamsFeature\"\n );\n if (!hasBuildParamsFeature) {\n existingBuildParamsImport.addNamedImport(\"BuildParamsFeature\");\n }\n }\n\n // Add import for RegisterFeature if not present.\n const registerFeatureImportPath = \"@webiny/app-admin\";\n const existingRegisterFeatureImport =\n source.getImportDeclaration(registerFeatureImportPath);\n\n if (existingRegisterFeatureImport) {\n const namedImports = existingRegisterFeatureImport.getNamedImports();\n const hasRegisterFeature = namedImports.some(ni => ni.getName() === \"RegisterFeature\");\n if (!hasRegisterFeature) {\n existingRegisterFeatureImport.addNamedImport(\"RegisterFeature\");\n }\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [\"RegisterFeature\"],\n moduleSpecifier: registerFeatureImportPath\n });\n }\n }\n\n // Now add <RegisterFeature> components to the Extensions component.\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\".`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n\n if (!extensionsArrowFn) {\n throw new Error(`Could not find the \"Extensions\" React component arrow function.`);\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n });\n\n if (!extensionsArrowFnFragment) {\n throw new Error(`Could not find JSX fragment in Extensions component.`);\n }\n\n const currentContent = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n // Check if we already have the RegisterFeature components.\n if (!currentContent.includes(\"BuildParamsFeature\")) {\n const newContent = `<><RegisterFeature feature={BuildParamsFeature} /><RegisterFeature feature={BuildParamsInternalFeature} />${currentContent}</>`;\n extensionsArrowFnFragment.replaceWithText(newContent);\n }\n\n await source.save();\n}\n\nexport const AdminBuildParam = defineExtension({\n type: \"Admin/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\", hosting: \"all\" },\n description: \"Add build-time parameter to Admin app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.string(), z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\n });\n },\n async build(params, ctx) {\n const buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Written when missing or when its value changed (a config edit), and left alone when equal,\n // so an unchanged param doesn't trigger a rebuild.\n const fileContent = `import { BuildParam } from \"webiny/admin/build-params\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, \"utf8\") : undefined;\n if (existing !== fileContent) {\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now we need to generate/update the feature file that imports all BuildParams.\n await generateBuildParamsFeature(buildParamsDir, ctx);\n }\n});\n"],"names":["generateBuildParamsFeature","buildParamsDir","ctx","featureFilePath","path","files","fs","f","imports","file","className","registrations","featureContent","updateExtensionsTsx","extensionsTsxFilePath","project","Project","source","buildParamsFeatureImport","existingFeatureImport","index","importDeclarations","last","buildParamsFeatureImportPath","existingBuildParamsImport","namedImports","hasBuildParamsFeature","ni","registerFeatureImportPath","existingRegisterFeatureImport","hasRegisterFeature","extensionsIdentifier","node","Node","Error","extensionsArrowFn","extensionsArrowFnFragment","currentContent","newContent","AdminBuildParam","defineExtension","z","params","paramName","value","valueStr","JSON","hash","crypto","fileName","filePath","fileContent","existing","undefined"],"mappings":";;;;;;AAOA,eAAeA,2BAA2BC,cAAsB,EAAEC,GAAQ;IACtE,MAAMC,kBAAkBC,KAAK,IAAI,CAACH,gBAAgB;IAGlD,MAAMI,QAAQC,GAAAA,WACE,CAACL,gBACZ,MAAM,CAACM,CAAAA,IAAKA,EAAE,UAAU,CAAC,kBAAkBA,EAAE,QAA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AAC;QACO,MAAM0C,WAAW9C,GAAG,UAAU,CAAC4C,YAAY5C,GAAG,YAAY,CAAC4C,UAAU,UAAUG;QAC/E,IAAID,aAAaD,aACb7C,GAAG,aAAa,CAAC4C,UAAUC,aAAa;QAI5C,MAAMnD,2BAA2BC,gBAAgBC;IACrD;AACJ"}
@@ -1,11 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const AdminExtension: import("~/extensions/index.js").ExtensionComponent<z.ZodObject<{
3
- src: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
2
+ export declare const AdminExtension: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
4
  exportName: z.ZodOptional<z.ZodString>;
5
- }, "strip", z.ZodTypeAny, {
6
- src: string;
7
- exportName?: string | undefined;
8
- }, {
9
- src: string;
10
- exportName?: string | undefined;
11
- }>>;
5
+ }, z.core.$strip>>;
@@ -1,99 +1,74 @@
1
- import { defineExtension, zodSrcPath } from "./index.js";
2
- import { ExtensionSrcResolver } from "@webiny/project";
1
+ import { defineExtension, zodSrcPath } from "../defineExtension/index.js";
2
+ import { ExtensionSrcResolver } from "../index.js";
3
3
  import { z } from "zod";
4
4
  import path from "path";
5
5
  import { Node, Project } from "ts-morph";
6
- import crypto from "crypto";
7
- export const AdminExtension = defineExtension({
8
- type: "Admin/Extension",
9
- tags: {
10
- runtimeContext: "app-build",
11
- appName: "admin"
12
- },
13
- description: "Extend the Admin application with custom functionality.",
14
- multiple: true,
15
- paramsSchema: ({
16
- project
17
- }) => {
18
- return z.object({
19
- src: zodSrcPath({
20
- project
21
- }),
22
- exportName: z.string().optional()
23
- });
24
- },
25
- async build(params, ctx) {
26
- const extensionsTsxFilePath = ctx.project.paths.workspaceFolder.join("apps", "admin", "src", "Extensions.tsx").toString();
27
- const {
28
- src: extensionFilePath
29
- } = params;
30
-
31
- // Resolve to absolute path for file operations.
32
- const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(extensionFilePath, ctx.project);
33
- const extensionFileName = path.basename(absoluteExtensionFilePath);
34
-
35
- // Export name can be customized or defaults to the file name without extension.
36
- const exportName = params.exportName ?? path.parse(extensionFileName).name;
37
-
38
- // Generate a constant hash-based component name to avoid using timestamps.
39
- const hash = crypto.createHash("sha256").update(extensionFilePath).digest("hex");
40
- const componentName = `AdminExtension_${hash.slice(-10)}`;
41
- const project = new Project();
42
- const importPath = path.relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
43
- project.addSourceFileAtPath(extensionsTsxFilePath);
44
- const source = project.getSourceFileOrThrow(extensionsTsxFilePath);
45
- const existingImportDeclaration = source.getImportDeclaration(importPath);
46
- if (existingImportDeclaration) {
47
- return;
48
- }
49
-
50
- // Check if the extension file has a default export or named export.
51
- const extensionProject = new Project();
52
- extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
53
- const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
54
- const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;
55
- let index = 1;
56
- const importDeclarations = source.getImportDeclarations();
57
- if (importDeclarations.length) {
58
- const last = importDeclarations[importDeclarations.length - 1];
59
- index = last.getChildIndex() + 1;
60
- }
61
-
62
- // Import as default export if available, otherwise import named export.
63
- if (hasDefaultExport) {
64
- source.insertImportDeclaration(index, {
65
- defaultImport: componentName,
66
- moduleSpecifier: importPath
67
- });
68
- } else {
69
- source.insertImportDeclaration(index, {
70
- namedImports: [{
71
- name: exportName,
72
- alias: componentName
73
- }],
74
- moduleSpecifier: importPath
75
- });
76
- }
77
- const extensionsIdentifier = source.getFirstDescendant(node => {
78
- if (!Node.isIdentifier(node)) {
79
- return false;
80
- }
81
- return node.getText() === "Extensions";
82
- });
83
- if (!extensionsIdentifier) {
84
- throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change the name of the component?`);
85
- }
86
- const extensionsArrowFn = extensionsIdentifier.getNextSibling(node => Node.isArrowFunction(node));
87
- if (!extensionsArrowFn) {
88
- throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change its definition? It should be an arrow function.`);
6
+ import crypto_0 from "crypto";
7
+ import { hasDefaultExport } from "./hasDefaultExport.js";
8
+ const AdminExtension = defineExtension({
9
+ type: "Admin/Extension",
10
+ tags: {
11
+ runtimeContext: "app-build",
12
+ appName: "admin",
13
+ hosting: "all"
14
+ },
15
+ description: "Extend the Admin application with custom functionality.",
16
+ multiple: true,
17
+ paramsSchema: ({ project })=>z.object({
18
+ src: zodSrcPath({
19
+ project
20
+ }),
21
+ exportName: z.string().optional()
22
+ }),
23
+ async build (params, ctx) {
24
+ const extensionsTsxFilePath = ctx.project.paths.workspaceFolder.join("apps", "admin", "src", "Extensions.tsx").toString();
25
+ const { src: extensionFilePath } = params;
26
+ const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(extensionFilePath, ctx.project);
27
+ const extensionFileName = path.basename(absoluteExtensionFilePath);
28
+ const exportName = params.exportName ?? path.parse(extensionFileName).name;
29
+ const hash = crypto_0.createHash("sha256").update(extensionFilePath).digest("hex");
30
+ const componentName = `AdminExtension_${hash.slice(-10)}`;
31
+ const project = new Project();
32
+ const importPath = path.relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
33
+ project.addSourceFileAtPath(extensionsTsxFilePath);
34
+ const source = project.getSourceFileOrThrow(extensionsTsxFilePath);
35
+ const existingImportDeclaration = source.getImportDeclaration(importPath);
36
+ if (existingImportDeclaration) return;
37
+ const extensionProject = new Project();
38
+ extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
39
+ const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
40
+ let index = 1;
41
+ const importDeclarations = source.getImportDeclarations();
42
+ if (importDeclarations.length) {
43
+ const last = importDeclarations[importDeclarations.length - 1];
44
+ index = last.getChildIndex() + 1;
45
+ }
46
+ if (hasDefaultExport(extensionSource)) source.insertImportDeclaration(index, {
47
+ defaultImport: componentName,
48
+ moduleSpecifier: importPath
49
+ });
50
+ else source.insertImportDeclaration(index, {
51
+ namedImports: [
52
+ {
53
+ name: exportName,
54
+ alias: componentName
55
+ }
56
+ ],
57
+ moduleSpecifier: importPath
58
+ });
59
+ const extensionsIdentifier = source.getFirstDescendant((node)=>{
60
+ if (!Node.isIdentifier(node)) return false;
61
+ return "Extensions" === node.getText();
62
+ });
63
+ if (!extensionsIdentifier) throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change the name of the component?`);
64
+ const extensionsArrowFn = extensionsIdentifier.getNextSibling((node)=>Node.isArrowFunction(node));
65
+ if (!extensionsArrowFn) throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change its definition? It should be an arrow function.`);
66
+ const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant((node)=>Node.isJsxFragment(node));
67
+ const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment.getFullText().replace("<>", "").replace("</>", "").trim();
68
+ extensionsArrowFnFragment.replaceWithText(`<>${extensionsArrowFnFragmentChildrenText}<${componentName}/></>`);
69
+ await source.save();
89
70
  }
90
- const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {
91
- return Node.isJsxFragment(node);
92
- });
93
- const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment.getFullText().replace("<>", "").replace("</>", "").trim();
94
- extensionsArrowFnFragment.replaceWithText(`<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`);
95
- await source.save();
96
- }
97
71
  });
72
+ export { AdminExtension };
98
73
 
99
74
  //# sourceMappingURL=AdminExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["defineExtension","zodSrcPath","ExtensionSrcResolver","z","path","Node","Project","crypto","AdminExtension","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","src","exportName","string","optional","build","params","ctx","extensionsTsxFilePath","paths","workspaceFolder","join","toString","extensionFilePath","absoluteExtensionFilePath","resolvePath","extensionFileName","basename","parse","name","hash","createHash","update","digest","componentName","slice","importPath","relative","dirname","replace","addSourceFileAtPath","source","getSourceFileOrThrow","existingImportDeclaration","getImportDeclaration","extensionProject","extensionSource","hasDefaultExport","getDefaultExportSymbol","undefined","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","namedImports","alias","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","extensionsArrowFnFragmentChildrenText","getFullText","trim","replaceWithText","save"],"sources":["AdminExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { type JsxFragment, Node, Project } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const AdminExtension = defineExtension({\n type: \"Admin/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Extend the Admin application with custom functionality.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name can be customized or defaults to the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Generate a constant hash-based component name to avoid using timestamps.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const componentName = `AdminExtension_${hash.slice(-10)}`;\n\n const project = new Project();\n\n const importPath = path\n .relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n // Check if the extension file has a default export or named export.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Import as default export if available, otherwise import named export.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: componentName,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: componentName }],\n moduleSpecifier: importPath\n });\n }\n\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change the name of the component?`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n if (!extensionsArrowFn) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change its definition? It should be an arrow function.`\n );\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n }) as JsxFragment;\n\n const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n extensionsArrowF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AAC,CACjBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAClBmC,IAAI,CAAC,CAAC;IAEXJ,yBAAyB,CAACK,eAAe,CACrC,MAAMzC,aAAa,KAAKsC,qCAAqC,KACjE,CAAC;IAED,MAAM/B,MAAM,CAACmC,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/AdminExtension.js","sources":["../../src/extensions/AdminExtension.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { type JsxFragment, Node, Project } from \"ts-morph\";\nimport crypto from \"crypto\";\nimport { hasDefaultExport } from \"./hasDefaultExport.js\";\n\nexport const AdminExtension = defineExtension({\n type: \"Admin/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\", hosting: \"all\" },\n description: \"Extend the Admin application with custom functionality.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name can be customized or defaults to the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Generate a constant hash-based component name to avoid using timestamps.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const componentName = `AdminExtension_${hash.slice(-10)}`;\n\n const project = new Project();\n\n const importPath = path\n .relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n // Check if the extension file has a default export or named export.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Import as default export if available, otherwise import named export.\n if (hasDefaultExport(extensionSource)) {\n source.insertImportDeclaration(index, {\n defaultImport: componentName,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: componentName }],\n moduleSpecifier: importPath\n });\n }\n\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change the name of the component?`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n if (!extensionsArrowFn) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change its definition? It should be an arrow function.`\n );\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n }) as JsxFragment;\n\n const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n /*\n * Append, so extensions mount in the order they're declared, as API extensions register (see\n * ApiExtension). A decorator mounted later wraps the earlier ones, so the last declared\n * extension's decorators are the outermost: project extensions override Webiny's defaults.\n */\n extensionsArrowFnFragment.replaceWithText(\n `<>${extensionsArrowFnFragmentChildrenText}<${componentName}/></>`\n );\n\n await source.save();\n }\n});\n"],"names":["AdminExtension","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsxFilePath","extensionFilePath","absoluteExtensionFilePath","ExtensionSrcResolver","extensionFileName","path","exportName","hash","crypto","componentName","Project","importPath","source","existingImportDeclaration","extensionProject","extensionSource","index","importDeclarations","last","hasDefaultExport","extensionsIdentifier","node","Node","Error","extensionsArrowFn","extensionsArrowFnFragment","extensionsArrowFnFragmentChildrenText"],"mappings":";;;;;;;AASO,MAAMA,iBAAiBC,gBAAgB;IAC1C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;QAAS,SAAS;IAAM;IACtE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;YAC1B,YAAYC,EAAE,MAAM,GAAG,QAAQ;QACnC;IAEJ,MAAM,OAAME,MAAM,EAAEC,GAAG;QACnB,MAAMC,wBAAwBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAC1D,IAAI,CAAC,QAAQ,SAAS,OAAO,kBAC7B,QAAQ;QAEb,MAAM,EAAE,KAAKE,iBAAiB,EAAE,GAAGH;QAGnC,MAAMI,4BAA4BC,qBAAqB,WAAW,CAC9DF,mBACAF,IAAI,OAAO;QAGf,MAAMK,oBAAoBC,KAAK,QAAQ,CAACH;QAGxC,MAAMI,aAAaR,OAAO,UAAU,IAAIO,KAAK,KAAK,CAACD,mBAAmB,IAAI;QAG1E,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACP,mBAAmB,MAAM,CAAC;QAC1E,MAAMQ,gBAAgB,CAAC,eAAe,EAAEF,KAAK,KAAK,CAAC,MAAM;QAEzD,MAAMZ,UAAU,IAAIe;QAEpB,MAAMC,aAAaN,KAAAA,QACN,CAACA,KAAK,OAAO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CAAC,MAAM,IACd,OAAO,CAAC,OAAO,IACf,IAAI;QAOTA,0BAA0B,eAAe,CACrC,CAAC,EAAE,EAAEC,sCAAsC,CAAC,EAAEjB,cAAc,KAAK,CAAC;QAGtE,MAAMG,OAAO,IAAI;IACrB;AACJ"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as
4
+ * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL
5
+ * from the API URL (same origin, http -> ws, plus the `/ws` path the standalone server takes
6
+ * upgrades on), which is what the standalone hosting type needs by default. Set it only when that
7
+ * derivation lands in the wrong place: WebSockets on a different origin, or a proxy that rewrites
8
+ * the path. The value is the full socket URL and is used as is. Because the config is evaluated at
9
+ * build time, the value can come from any env var the user chooses, e.g.
10
+ * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.
11
+ */
12
+ export declare const AdminWebsocketsUrl: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
13
+ url: z.ZodString;
14
+ }, z.core.$strip>>;
@@ -0,0 +1,22 @@
1
+ import react from "react";
2
+ import { z } from "zod";
3
+ import { defineExtension } from "../defineExtension/index.js";
4
+ import { EnvVar } from "./EnvVar.js";
5
+ const AdminWebsocketsUrl = defineExtension({
6
+ type: "Admin/WebsocketsUrl",
7
+ tags: {
8
+ runtimeContext: "project",
9
+ hosting: "all"
10
+ },
11
+ description: "Set a dedicated WebSocket URL for the Admin app.",
12
+ paramsSchema: z.object({
13
+ url: z.string().describe("The full WebSocket URL, e.g. wss://ws.example.com/ws or ws://localhost:3002/ws")
14
+ }),
15
+ render: (props)=>/*#__PURE__*/ react.createElement(EnvVar, {
16
+ varName: "WEBINY_ADMIN_WS_API_URL",
17
+ value: props.url
18
+ })
19
+ });
20
+ export { AdminWebsocketsUrl };
21
+
22
+ //# sourceMappingURL=AdminWebsocketsUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws, plus the `/ws` path the standalone server takes\n * upgrades on), which is what the standalone hosting type needs by default. Set it only when that\n * derivation lands in the wrong place: WebSockets on a different origin, or a proxy that rewrites\n * the path. The value is the full socket URL and is used as is. Because the config is evaluated at\n * build time, the value can come from any env var the user chooses, e.g.\n * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.\n */\nexport const AdminWebsocketsUrl = defineExtension({\n type: \"Admin/WebsocketsUrl\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Set a dedicated WebSocket URL for the Admin app.\",\n paramsSchema: z.object({\n url: z\n .string()\n .describe(\n \"The full WebSocket URL, e.g. wss://ws.example.com/ws or ws://localhost:3002/ws\"\n )\n }),\n render: props => {\n return <EnvVar varName=\"WEBINY_ADMIN_WS_API_URL\" value={props.url} />;\n }\n});\n"],"names":["AdminWebsocketsUrl","defineExtension","z","props","EnvVar"],"mappings":";;;;AAeO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAAA,MACM,GACN,QAAQ,CACL;IAEZ;IACA,QAAQC,CAAAA,QACG,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAA0B,OAAOD,MAAM,GAAG;;AAEzE"}
@@ -1,11 +1,5 @@
1
1
  import { z } from "zod";
2
2
  export declare const BuildParam: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
3
  paramName: z.ZodString;
4
- value: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny, "many">, z.ZodNumber, z.ZodBoolean]>;
5
- }, "strip", z.ZodTypeAny, {
6
- value: string | number | boolean | any[] | Record<string, any>;
7
- paramName: string;
8
- }, {
9
- value: string | number | boolean | any[] | Record<string, any>;
10
- paramName: string;
11
- }>>;
4
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>, z.ZodNumber, z.ZodBoolean]>;
5
+ }, z.core.$strip>>;
@@ -1,53 +1,41 @@
1
1
  import { z } from "zod";
2
2
  import { Node, Project } from "ts-morph";
3
3
  import { defineExtension } from "../defineExtension/index.js";
4
- import crypto from "crypto";
4
+ import crypto_0 from "crypto";
5
5
  import path from "path";
6
6
  import fs from "fs";
7
- export const BuildParam = defineExtension({
8
- type: "Api/BuildParam",
9
- tags: {
10
- runtimeContext: "app-build",
11
- appName: "api"
12
- },
13
- description: "Add build-time parameter to API app.",
14
- multiple: true,
15
- paramsSchema: () => {
16
- return z.object({
17
- paramName: z.string(),
18
- value: z.union([z.string(), z.record(z.any()), z.array(z.any()), z.number(), z.boolean()])
19
- });
20
- },
21
- async build(params, ctx) {
22
- const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
23
- const buildParamsDir = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "buildParams").toString();
24
- const {
25
- paramName,
26
- value
27
- } = params;
28
-
29
- // Serialize value to a TypeScript literal.
30
- const valueStr = JSON.stringify(value, null, 4);
31
-
32
- // Generate a unique class name based on the paramName.
33
- const hash = crypto.createHash("sha256").update(paramName).digest("hex");
34
- const className = `BuildParam_${hash.slice(-10)}`;
35
- const fileName = `${className}.ts`;
36
- const filePath = path.join(buildParamsDir, fileName);
37
-
38
- // Ensure buildParams directory exists.
39
- if (!fs.existsSync(buildParamsDir)) {
40
- fs.mkdirSync(buildParamsDir, {
41
- recursive: true
42
- });
43
- }
44
-
45
- // Check if file already exists.
46
- if (fs.existsSync(filePath)) {
47
- // File exists, just ensure it's imported in extensions.ts
48
- } else {
49
- // Create the BuildParam implementation file.
50
- const fileContent = `import { BuildParam } from "webiny/api/buildParams";
7
+ const BuildParam = defineExtension({
8
+ type: "Api/BuildParam",
9
+ tags: {
10
+ runtimeContext: "app-build",
11
+ appName: "api",
12
+ hosting: "all"
13
+ },
14
+ description: "Add build-time parameter to API app.",
15
+ multiple: true,
16
+ paramsSchema: ()=>z.object({
17
+ paramName: z.string(),
18
+ value: z.union([
19
+ z.string(),
20
+ z.record(z.string(), z.any()),
21
+ z.array(z.any()),
22
+ z.number(),
23
+ z.boolean()
24
+ ])
25
+ }),
26
+ async build (params, ctx) {
27
+ const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
28
+ const buildParamsDir = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "buildParams").toString();
29
+ const { paramName, value } = params;
30
+ const valueStr = JSON.stringify(value, null, 4);
31
+ const hash = crypto_0.createHash("sha256").update(paramName).digest("hex");
32
+ const className = `BuildParam_${hash.slice(-10)}`;
33
+ const fileName = `${className}.ts`;
34
+ const filePath = path.join(buildParamsDir, fileName);
35
+ if (!fs.existsSync(buildParamsDir)) fs.mkdirSync(buildParamsDir, {
36
+ recursive: true
37
+ });
38
+ const fileContent = `import { BuildParam } from "webiny/api/build-params";
51
39
 
52
40
  class ${className} implements BuildParam.Interface {
53
41
  key = "${paramName}";
@@ -59,61 +47,48 @@ export default BuildParam.createImplementation({
59
47
  dependencies: []
60
48
  });
61
49
  `;
62
- fs.writeFileSync(filePath, fileContent, "utf8");
63
- }
64
-
65
- // Now update extensions.ts to import and register this BuildParam.
66
- const project = new Project();
67
- project.addSourceFileAtPath(extensionsTsFilePath);
68
- const source = project.getSourceFileOrThrow(extensionsTsFilePath);
69
-
70
- // Calculate import path relative to extensions.ts.
71
- let importPath = path.relative(path.dirname(extensionsTsFilePath), filePath).replace(/\.tsx?$/, ".js");
72
-
73
- // Ensure the path starts with ./
74
- if (!importPath.startsWith(".")) {
75
- importPath = "./" + importPath;
76
- }
77
-
78
- // Check if import already exists.
79
- const existingImportDeclaration = source.getImportDeclaration(importPath);
80
- if (existingImportDeclaration) {
81
- return;
82
- }
83
- let index = 1;
84
- const importDeclarations = source.getImportDeclarations();
85
- if (importDeclarations.length) {
86
- const last = importDeclarations[importDeclarations.length - 1];
87
- index = last.getChildIndex() + 1;
88
- }
89
-
90
- // Add import for the BuildParam implementation.
91
- source.insertImportDeclaration(index, {
92
- defaultImport: className,
93
- moduleSpecifier: importPath
94
- });
95
-
96
- // Add the registration to the plugins array.
97
- const pluginsArray = source.getFirstDescendant(node => Node.isArrayLiteralExpression(node));
98
- pluginsArray.addElement(`\ncreateContextPlugin(ctx => {\n\tregisterExtension(ctx.container, ${className});\n})`);
99
- {
100
- let index = 1;
101
- const importDeclarations = source.getImportDeclarations();
102
- if (importDeclarations.length) {
103
- const last = importDeclarations[importDeclarations.length - 1];
104
- index = last.getChildIndex() + 1;
105
- }
106
- const contextPluginImportPath = "@webiny/api/plugins/ContextPlugin";
107
- const existingContextPluginImport = source.getImportDeclaration(contextPluginImportPath);
108
- if (!existingContextPluginImport) {
50
+ const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, "utf8") : void 0;
51
+ if (existing !== fileContent) fs.writeFileSync(filePath, fileContent, "utf8");
52
+ const project = new Project();
53
+ project.addSourceFileAtPath(extensionsTsFilePath);
54
+ const source = project.getSourceFileOrThrow(extensionsTsFilePath);
55
+ let importPath = path.relative(path.dirname(extensionsTsFilePath), filePath).replace(/\.tsx?$/, ".js");
56
+ if (!importPath.startsWith(".")) importPath = "./" + importPath;
57
+ const existingImportDeclaration = source.getImportDeclaration(importPath);
58
+ if (existingImportDeclaration) return;
59
+ let index = 1;
60
+ const importDeclarations = source.getImportDeclarations();
61
+ if (importDeclarations.length) {
62
+ const last = importDeclarations[importDeclarations.length - 1];
63
+ index = last.getChildIndex() + 1;
64
+ }
109
65
  source.insertImportDeclaration(index, {
110
- namedImports: ["createContextPlugin"],
111
- moduleSpecifier: contextPluginImportPath
66
+ defaultImport: className,
67
+ moduleSpecifier: importPath
112
68
  });
113
- }
69
+ const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
70
+ pluginsArray.addElement(`\ncreateRegisterBuildParamPlugin(ctx => {\n\tregisterExtension(ctx.container, ${className});\n})`);
71
+ {
72
+ let index = 1;
73
+ const importDeclarations = source.getImportDeclarations();
74
+ if (importDeclarations.length) {
75
+ const last = importDeclarations[importDeclarations.length - 1];
76
+ index = last.getChildIndex() + 1;
77
+ }
78
+ const contextPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
79
+ const existingImport = source.getImportDeclaration(contextPluginImportPath);
80
+ if (existingImport) {
81
+ if (!existingImport.getNamedImports().some((i)=>"createRegisterBuildParamPlugin" === i.getName())) existingImport.addNamedImport("createRegisterBuildParamPlugin");
82
+ } else source.insertImportDeclaration(index, {
83
+ namedImports: [
84
+ "createRegisterBuildParamPlugin"
85
+ ],
86
+ moduleSpecifier: contextPluginImportPath
87
+ });
88
+ }
89
+ await source.save();
114
90
  }
115
- await source.save();
116
- }
117
91
  });
92
+ export { BuildParam };
118
93
 
119
94
  //# sourceMappingURL=ApiBuildParam.js.map