@fecommunity/reactpress 3.7.0 → 4.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/bin/reactpress-cli-shim.js +2 -6
  2. package/bin/reactpress-theme-client.js +2 -0
  3. package/bin/reactpress.js +1 -380
  4. package/out/.source-fingerprint-cli +1 -0
  5. package/out/bin/reactpress-cli-shim.d.ts +3 -0
  6. package/out/bin/reactpress-cli-shim.d.ts.map +1 -0
  7. package/out/bin/reactpress-cli-shim.js +28 -0
  8. package/out/bin/reactpress-cli-shim.js.map +1 -0
  9. package/out/bin/reactpress-theme-client.d.ts +3 -0
  10. package/out/bin/reactpress-theme-client.d.ts.map +1 -0
  11. package/out/bin/reactpress-theme-client.js +113 -0
  12. package/out/bin/reactpress-theme-client.js.map +1 -0
  13. package/out/bin/reactpress.d.ts +3 -0
  14. package/out/bin/reactpress.d.ts.map +1 -0
  15. package/out/bin/reactpress.js +534 -0
  16. package/out/bin/reactpress.js.map +1 -0
  17. package/out/core/services/config.d.ts +12 -0
  18. package/out/core/services/config.d.ts.map +1 -0
  19. package/out/core/services/config.js +137 -0
  20. package/out/core/services/config.js.map +1 -0
  21. package/out/core/services/database/index.d.ts +17 -0
  22. package/out/core/services/database/index.d.ts.map +1 -0
  23. package/out/core/services/database/index.js +242 -0
  24. package/out/core/services/database/index.js.map +1 -0
  25. package/out/core/services/database/mysql.d.ts +14 -0
  26. package/out/core/services/database/mysql.d.ts.map +1 -0
  27. package/out/core/services/database/mysql.js +82 -0
  28. package/out/core/services/database/mysql.js.map +1 -0
  29. package/out/core/services/database/profile.d.ts +6 -0
  30. package/out/core/services/database/profile.d.ts.map +1 -0
  31. package/out/core/services/database/profile.js +60 -0
  32. package/out/core/services/database/profile.js.map +1 -0
  33. package/out/core/services/database/sqlite.d.ts +10 -0
  34. package/out/core/services/database/sqlite.d.ts.map +1 -0
  35. package/out/core/services/database/sqlite.js +73 -0
  36. package/out/core/services/database/sqlite.js.map +1 -0
  37. package/out/core/services/exec.d.ts +21 -0
  38. package/out/core/services/exec.d.ts.map +1 -0
  39. package/out/core/services/exec.js +56 -0
  40. package/out/core/services/exec.js.map +1 -0
  41. package/out/core/services/init.d.ts +11 -0
  42. package/out/core/services/init.d.ts.map +1 -0
  43. package/out/core/services/init.js +60 -0
  44. package/out/core/services/init.js.map +1 -0
  45. package/out/core/services/local-site.d.ts +24 -0
  46. package/out/core/services/local-site.d.ts.map +1 -0
  47. package/out/core/services/local-site.js +144 -0
  48. package/out/core/services/local-site.js.map +1 -0
  49. package/out/core/utils/cli-context.d.ts +3 -0
  50. package/out/core/utils/cli-context.d.ts.map +1 -0
  51. package/out/core/utils/cli-context.js +12 -0
  52. package/out/core/utils/cli-context.js.map +1 -0
  53. package/out/core/utils/paths.d.ts +20 -0
  54. package/out/core/utils/paths.d.ts.map +1 -0
  55. package/out/core/utils/paths.js +34 -0
  56. package/out/core/utils/paths.js.map +1 -0
  57. package/out/core/utils/platform.d.ts +7 -0
  58. package/out/core/utils/platform.d.ts.map +1 -0
  59. package/out/core/utils/platform.js +28 -0
  60. package/out/core/utils/platform.js.map +1 -0
  61. package/out/core/utils/port.d.ts +4 -0
  62. package/out/core/utils/port.d.ts.map +1 -0
  63. package/out/core/utils/port.js +32 -0
  64. package/out/core/utils/port.js.map +1 -0
  65. package/out/lib/api-dev-runner.d.ts +3 -0
  66. package/out/lib/api-dev-runner.d.ts.map +1 -0
  67. package/{lib → out/lib}/api-dev-runner.js +4 -1
  68. package/out/lib/api-dev-runner.js.map +1 -0
  69. package/out/lib/api-dev.d.ts +2 -0
  70. package/out/lib/api-dev.d.ts.map +1 -0
  71. package/out/lib/api-dev.js +101 -0
  72. package/out/lib/api-dev.js.map +1 -0
  73. package/out/lib/bootstrap.d.ts +18 -0
  74. package/out/lib/bootstrap.d.ts.map +1 -0
  75. package/out/lib/bootstrap.js +93 -0
  76. package/out/lib/bootstrap.js.map +1 -0
  77. package/out/lib/build.d.ts +2 -0
  78. package/out/lib/build.d.ts.map +1 -0
  79. package/out/lib/build.js +191 -0
  80. package/out/lib/build.js.map +1 -0
  81. package/out/lib/db-backup.d.ts +2 -0
  82. package/out/lib/db-backup.d.ts.map +1 -0
  83. package/out/lib/db-backup.js +68 -0
  84. package/out/lib/db-backup.js.map +1 -0
  85. package/out/lib/dev-banner.d.ts +2 -0
  86. package/out/lib/dev-banner.d.ts.map +1 -0
  87. package/out/lib/dev-banner.js +102 -0
  88. package/out/lib/dev-banner.js.map +1 -0
  89. package/out/lib/dev-child-io.d.ts +2 -0
  90. package/out/lib/dev-child-io.d.ts.map +1 -0
  91. package/out/lib/dev-child-io.js +80 -0
  92. package/out/lib/dev-child-io.js.map +1 -0
  93. package/out/lib/dev-log.d.ts +2 -0
  94. package/out/lib/dev-log.d.ts.map +1 -0
  95. package/out/lib/dev-log.js +64 -0
  96. package/out/lib/dev-log.js.map +1 -0
  97. package/out/lib/dev-session.d.ts +2 -0
  98. package/out/lib/dev-session.d.ts.map +1 -0
  99. package/out/lib/dev-session.js +95 -0
  100. package/out/lib/dev-session.js.map +1 -0
  101. package/out/lib/dev.d.ts +2 -0
  102. package/out/lib/dev.d.ts.map +1 -0
  103. package/out/lib/dev.js +906 -0
  104. package/out/lib/dev.js.map +1 -0
  105. package/out/lib/docker.d.ts +2 -0
  106. package/out/lib/docker.d.ts.map +1 -0
  107. package/out/lib/docker.js +398 -0
  108. package/out/lib/docker.js.map +1 -0
  109. package/out/lib/doctor.d.ts +2 -0
  110. package/out/lib/doctor.d.ts.map +1 -0
  111. package/out/lib/doctor.js +260 -0
  112. package/out/lib/doctor.js.map +1 -0
  113. package/out/lib/health-parse.d.ts +5 -0
  114. package/out/lib/health-parse.d.ts.map +1 -0
  115. package/out/lib/health-parse.js +36 -0
  116. package/out/lib/health-parse.js.map +1 -0
  117. package/out/lib/health-parse.test.d.ts +2 -0
  118. package/out/lib/health-parse.test.d.ts.map +1 -0
  119. package/out/lib/health-parse.test.js +19 -0
  120. package/out/lib/health-parse.test.js.map +1 -0
  121. package/out/lib/http.d.ts +2 -0
  122. package/out/lib/http.d.ts.map +1 -0
  123. package/out/lib/http.js +234 -0
  124. package/out/lib/http.js.map +1 -0
  125. package/out/lib/i18n/index.d.ts +2 -0
  126. package/out/lib/i18n/index.d.ts.map +1 -0
  127. package/out/lib/i18n/index.js +29 -0
  128. package/out/lib/i18n/index.js.map +1 -0
  129. package/out/lib/i18n/strings.d.ts +2 -0
  130. package/out/lib/i18n/strings.d.ts.map +1 -0
  131. package/out/lib/i18n/strings.js +1140 -0
  132. package/out/lib/i18n/strings.js.map +1 -0
  133. package/out/lib/lifecycle.d.ts +2 -0
  134. package/out/lib/lifecycle.d.ts.map +1 -0
  135. package/out/lib/lifecycle.js +169 -0
  136. package/out/lib/lifecycle.js.map +1 -0
  137. package/out/lib/nginx.d.ts +2 -0
  138. package/out/lib/nginx.d.ts.map +1 -0
  139. package/out/lib/nginx.js +618 -0
  140. package/out/lib/nginx.js.map +1 -0
  141. package/out/lib/paths.d.ts +2 -0
  142. package/out/lib/paths.d.ts.map +1 -0
  143. package/out/lib/paths.js +106 -0
  144. package/out/lib/paths.js.map +1 -0
  145. package/out/lib/plugin-build.d.ts +2 -0
  146. package/out/lib/plugin-build.d.ts.map +1 -0
  147. package/out/lib/plugin-build.js +104 -0
  148. package/out/lib/plugin-build.js.map +1 -0
  149. package/out/lib/plugin-cli.d.ts +2 -0
  150. package/out/lib/plugin-cli.d.ts.map +1 -0
  151. package/out/lib/plugin-cli.js +142 -0
  152. package/out/lib/plugin-cli.js.map +1 -0
  153. package/out/lib/pm2.d.ts +2 -0
  154. package/out/lib/pm2.d.ts.map +1 -0
  155. package/out/lib/pm2.js +32 -0
  156. package/out/lib/pm2.js.map +1 -0
  157. package/out/lib/ports.d.ts +2 -0
  158. package/out/lib/ports.d.ts.map +1 -0
  159. package/out/lib/ports.js +394 -0
  160. package/out/lib/ports.js.map +1 -0
  161. package/out/lib/process.d.ts +2 -0
  162. package/out/lib/process.d.ts.map +1 -0
  163. package/out/lib/process.js +47 -0
  164. package/out/lib/process.js.map +1 -0
  165. package/out/lib/prod-memory.d.ts +6 -0
  166. package/out/lib/prod-memory.d.ts.map +1 -0
  167. package/out/lib/prod-memory.js +57 -0
  168. package/out/lib/prod-memory.js.map +1 -0
  169. package/out/lib/project-type.d.ts +2 -0
  170. package/out/lib/project-type.d.ts.map +1 -0
  171. package/out/lib/project-type.js +77 -0
  172. package/out/lib/project-type.js.map +1 -0
  173. package/out/lib/publish.d.ts +3 -0
  174. package/out/lib/publish.d.ts.map +1 -0
  175. package/out/lib/publish.js +388 -0
  176. package/out/lib/publish.js.map +1 -0
  177. package/out/lib/remote-dev.d.ts +2 -0
  178. package/out/lib/remote-dev.d.ts.map +1 -0
  179. package/out/lib/remote-dev.js +158 -0
  180. package/out/lib/remote-dev.js.map +1 -0
  181. package/out/lib/root.d.ts +2 -0
  182. package/out/lib/root.d.ts.map +1 -0
  183. package/out/lib/root.js +85 -0
  184. package/out/lib/root.js.map +1 -0
  185. package/out/lib/spawn.d.ts +2 -0
  186. package/out/lib/spawn.d.ts.map +1 -0
  187. package/out/lib/spawn.js +96 -0
  188. package/out/lib/spawn.js.map +1 -0
  189. package/out/lib/status.d.ts +2 -0
  190. package/out/lib/status.d.ts.map +1 -0
  191. package/out/lib/status.js +78 -0
  192. package/out/lib/status.js.map +1 -0
  193. package/out/lib/theme-catalog.d.ts +2 -0
  194. package/out/lib/theme-catalog.d.ts.map +1 -0
  195. package/out/lib/theme-catalog.js +6 -0
  196. package/out/lib/theme-catalog.js.map +1 -0
  197. package/out/lib/theme-cli.d.ts +2 -0
  198. package/out/lib/theme-cli.d.ts.map +1 -0
  199. package/out/lib/theme-cli.js +50 -0
  200. package/out/lib/theme-cli.js.map +1 -0
  201. package/out/lib/theme-dev.d.ts +2 -0
  202. package/out/lib/theme-dev.d.ts.map +1 -0
  203. package/out/lib/theme-dev.js +759 -0
  204. package/out/lib/theme-dev.js.map +1 -0
  205. package/out/lib/theme-env.d.ts +2 -0
  206. package/out/lib/theme-env.d.ts.map +1 -0
  207. package/out/lib/theme-env.js +101 -0
  208. package/out/lib/theme-env.js.map +1 -0
  209. package/out/lib/theme-install.d.ts +2 -0
  210. package/out/lib/theme-install.d.ts.map +1 -0
  211. package/out/lib/theme-install.js +363 -0
  212. package/out/lib/theme-install.js.map +1 -0
  213. package/out/lib/theme-lock.d.ts +2 -0
  214. package/out/lib/theme-lock.d.ts.map +1 -0
  215. package/out/lib/theme-lock.js +70 -0
  216. package/out/lib/theme-lock.js.map +1 -0
  217. package/out/lib/theme-paths.d.ts +2 -0
  218. package/out/lib/theme-paths.d.ts.map +1 -0
  219. package/out/lib/theme-paths.js +73 -0
  220. package/out/lib/theme-paths.js.map +1 -0
  221. package/out/lib/theme-placeholder-cover.d.ts +13 -0
  222. package/out/lib/theme-placeholder-cover.d.ts.map +1 -0
  223. package/out/lib/theme-placeholder-cover.js +95 -0
  224. package/out/lib/theme-placeholder-cover.js.map +1 -0
  225. package/out/lib/theme-preview-frame.d.ts +2 -0
  226. package/out/lib/theme-preview-frame.d.ts.map +1 -0
  227. package/out/lib/theme-preview-frame.js +107 -0
  228. package/out/lib/theme-preview-frame.js.map +1 -0
  229. package/out/lib/theme-preview-pool.d.ts +2 -0
  230. package/out/lib/theme-preview-pool.d.ts.map +1 -0
  231. package/out/lib/theme-preview-pool.js +484 -0
  232. package/out/lib/theme-preview-pool.js.map +1 -0
  233. package/out/lib/theme-preview-proxy.d.ts +2 -0
  234. package/out/lib/theme-preview-proxy.d.ts.map +1 -0
  235. package/out/lib/theme-preview-proxy.js +101 -0
  236. package/out/lib/theme-preview-proxy.js.map +1 -0
  237. package/out/lib/theme-prod.d.ts +2 -0
  238. package/out/lib/theme-prod.d.ts.map +1 -0
  239. package/out/lib/theme-prod.js +400 -0
  240. package/out/lib/theme-prod.js.map +1 -0
  241. package/out/lib/theme-registry.d.ts +2 -0
  242. package/out/lib/theme-registry.d.ts.map +1 -0
  243. package/out/lib/theme-registry.js +135 -0
  244. package/out/lib/theme-registry.js.map +1 -0
  245. package/out/lib/theme-runtime.d.ts +2 -0
  246. package/out/lib/theme-runtime.d.ts.map +1 -0
  247. package/out/lib/theme-runtime.js +344 -0
  248. package/out/lib/theme-runtime.js.map +1 -0
  249. package/out/lib/theme-sources.d.ts +2 -0
  250. package/out/lib/theme-sources.d.ts.map +1 -0
  251. package/out/lib/theme-sources.js +347 -0
  252. package/out/lib/theme-sources.js.map +1 -0
  253. package/out/lib/theme-warmup.d.ts +2 -0
  254. package/out/lib/theme-warmup.d.ts.map +1 -0
  255. package/out/lib/theme-warmup.js +167 -0
  256. package/out/lib/theme-warmup.js.map +1 -0
  257. package/out/lib/toolkit-build.d.ts +2 -0
  258. package/out/lib/toolkit-build.d.ts.map +1 -0
  259. package/out/lib/toolkit-build.js +57 -0
  260. package/out/lib/toolkit-build.js.map +1 -0
  261. package/out/types/config.d.ts +57 -0
  262. package/out/types/config.d.ts.map +1 -0
  263. package/out/types/config.js +3 -0
  264. package/out/types/config.js.map +1 -0
  265. package/out/ui/banner.d.ts +2 -0
  266. package/out/ui/banner.d.ts.map +1 -0
  267. package/out/ui/banner.js +358 -0
  268. package/out/ui/banner.js.map +1 -0
  269. package/out/ui/interactive.d.ts +2 -0
  270. package/out/ui/interactive.d.ts.map +1 -0
  271. package/out/ui/interactive.js +328 -0
  272. package/out/ui/interactive.js.map +1 -0
  273. package/out/ui/theme.d.ts +2 -0
  274. package/out/ui/theme.d.ts.map +1 -0
  275. package/out/ui/theme.js +250 -0
  276. package/out/ui/theme.js.map +1 -0
  277. package/package.json +13 -7
  278. package/server/dist/common/api-messages.d.ts +9 -0
  279. package/server/dist/common/api-messages.js +9 -0
  280. package/server/dist/common/api-messages.js.map +1 -1
  281. package/server/dist/database/typeorm-options.d.ts +3 -0
  282. package/server/dist/database/typeorm-options.js +60 -0
  283. package/server/dist/database/typeorm-options.js.map +1 -0
  284. package/server/dist/modules/api-key/api-key.controller.js.map +1 -1
  285. package/server/dist/modules/api-key/api-key.entity.js.map +1 -1
  286. package/server/dist/modules/api-key/api-key.guard.js +2 -3
  287. package/server/dist/modules/api-key/api-key.guard.js.map +1 -1
  288. package/server/dist/modules/api-key/api-key.module.js.map +1 -1
  289. package/server/dist/modules/api-key/api-key.service.js +1 -1
  290. package/server/dist/modules/api-key/api-key.service.js.map +1 -1
  291. package/server/dist/modules/article/article-revision.entity.js +3 -3
  292. package/server/dist/modules/article/article-revision.entity.js.map +1 -1
  293. package/server/dist/modules/article/article-slug.util.d.ts +2 -0
  294. package/server/dist/modules/article/article-slug.util.js +19 -0
  295. package/server/dist/modules/article/article-slug.util.js.map +1 -0
  296. package/server/dist/modules/article/scheduled-publish.service.js.map +1 -1
  297. package/server/dist/modules/bootstrap/bootstrap.constants.d.ts +20 -0
  298. package/server/dist/modules/bootstrap/bootstrap.constants.js +171 -0
  299. package/server/dist/modules/bootstrap/bootstrap.constants.js.map +1 -0
  300. package/server/dist/modules/bootstrap/bootstrap.service.d.ts +22 -0
  301. package/server/dist/modules/bootstrap/bootstrap.service.js +183 -0
  302. package/server/dist/modules/bootstrap/bootstrap.service.js.map +1 -0
  303. package/server/dist/modules/bootstrap/install-locale.d.ts +2 -0
  304. package/server/dist/modules/bootstrap/install-locale.js +11 -0
  305. package/server/dist/modules/bootstrap/install-locale.js.map +1 -0
  306. package/server/dist/modules/extension/extension.module.d.ts +9 -0
  307. package/server/dist/modules/extension/extension.module.js +50 -0
  308. package/server/dist/modules/extension/extension.module.js.map +1 -0
  309. package/server/dist/modules/extension/plugin-loader.service.d.ts +12 -0
  310. package/server/dist/modules/extension/plugin-loader.service.js +96 -0
  311. package/server/dist/modules/extension/plugin-loader.service.js.map +1 -0
  312. package/server/dist/modules/extension/plugin-registry.bridge.d.ts +3 -0
  313. package/server/dist/modules/extension/plugin-registry.bridge.js +44 -0
  314. package/server/dist/modules/extension/plugin-registry.bridge.js.map +1 -0
  315. package/server/dist/modules/extension/plugin.controller.d.ts +22 -0
  316. package/server/dist/modules/extension/plugin.controller.js +155 -0
  317. package/server/dist/modules/extension/plugin.controller.js.map +1 -0
  318. package/server/dist/modules/extension/plugin.service.d.ts +52 -0
  319. package/server/dist/modules/extension/plugin.service.js +391 -0
  320. package/server/dist/modules/extension/plugin.service.js.map +1 -0
  321. package/server/dist/modules/extension/preview-draft.store.d.ts +13 -0
  322. package/server/dist/modules/extension/preview-draft.store.js +41 -0
  323. package/server/dist/modules/extension/preview-draft.store.js.map +1 -0
  324. package/server/dist/modules/extension/theme-registry.bridge.d.ts +56 -0
  325. package/server/dist/modules/extension/theme-registry.bridge.js +46 -0
  326. package/server/dist/modules/extension/theme-registry.bridge.js.map +1 -0
  327. package/server/dist/modules/extension/theme.controller.d.ts +66 -0
  328. package/server/dist/modules/extension/theme.controller.js +301 -0
  329. package/server/dist/modules/extension/theme.controller.js.map +1 -0
  330. package/server/dist/modules/extension/theme.service.d.ts +140 -0
  331. package/server/dist/modules/extension/theme.service.js +1039 -0
  332. package/server/dist/modules/extension/theme.service.js.map +1 -0
  333. package/server/dist/modules/file/file-optimization.controller.d.ts +12 -0
  334. package/server/dist/modules/file/file-optimization.controller.js +79 -0
  335. package/server/dist/modules/file/file-optimization.controller.js.map +1 -0
  336. package/server/dist/modules/file/file-optimization.service.d.ts +36 -0
  337. package/server/dist/modules/file/file-optimization.service.js +385 -0
  338. package/server/dist/modules/file/file-optimization.service.js.map +1 -0
  339. package/server/dist/modules/file/file-optimization.types.d.ts +66 -0
  340. package/server/dist/modules/file/file-optimization.types.js +5 -0
  341. package/server/dist/modules/file/file-optimization.types.js.map +1 -0
  342. package/server/dist/modules/file/image-optimizer-plugin.guard.d.ts +7 -0
  343. package/server/dist/modules/file/image-optimizer-plugin.guard.js +33 -0
  344. package/server/dist/modules/file/image-optimizer-plugin.guard.js.map +1 -0
  345. package/server/dist/modules/health/health.controller.js +2 -4
  346. package/server/dist/modules/health/health.controller.js.map +1 -1
  347. package/server/dist/modules/health/health.module.js.map +1 -1
  348. package/server/dist/modules/hook/hook.module.d.ts +2 -0
  349. package/server/dist/modules/hook/hook.module.js +22 -0
  350. package/server/dist/modules/hook/hook.module.js.map +1 -0
  351. package/server/dist/modules/hook/hook.service.d.ts +26 -0
  352. package/server/dist/modules/hook/hook.service.js +105 -0
  353. package/server/dist/modules/hook/hook.service.js.map +1 -0
  354. package/server/dist/modules/webhook/webhook.controller.js.map +1 -1
  355. package/server/dist/modules/webhook/webhook.entity.js.map +1 -1
  356. package/server/dist/modules/webhook/webhook.module.js.map +1 -1
  357. package/server/dist/modules/webhook/webhook.service.d.ts +1 -1
  358. package/server/dist/modules/webhook/webhook.service.js +5 -2
  359. package/server/dist/modules/webhook/webhook.service.js.map +1 -1
  360. package/server/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  361. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  362. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  363. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  364. package/server/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  365. package/server/dist/tsconfig.tsbuildinfo +1 -0
  366. package/server/dist/utils/image-processor.util.d.ts +23 -0
  367. package/server/dist/utils/image-processor.util.js +88 -0
  368. package/server/dist/utils/image-processor.util.js.map +1 -0
  369. package/server/dist/utils/local-api-quiet.util.d.ts +1 -0
  370. package/server/dist/utils/local-api-quiet.util.js +8 -0
  371. package/server/dist/utils/local-api-quiet.util.js.map +1 -0
  372. package/server/dist/utils/project-root.util.d.ts +2 -0
  373. package/server/dist/utils/project-root.util.js +42 -0
  374. package/server/dist/utils/project-root.util.js.map +1 -0
  375. package/server/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  376. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  377. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  378. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  379. package/server/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  380. package/templates/config.local.json +13 -0
  381. package/templates/env.local.default +10 -0
  382. package/templates/theme-catalog.json +27 -0
  383. package/lib/api-dev.js +0 -89
  384. package/lib/bootstrap.js +0 -114
  385. package/lib/build.js +0 -162
  386. package/lib/db-backup.js +0 -67
  387. package/lib/dev-banner.js +0 -72
  388. package/lib/dev.js +0 -141
  389. package/lib/docker.js +0 -275
  390. package/lib/doctor.js +0 -266
  391. package/lib/http.js +0 -182
  392. package/lib/i18n/index.js +0 -32
  393. package/lib/i18n/strings.js +0 -846
  394. package/lib/lifecycle.js +0 -190
  395. package/lib/nginx.js +0 -342
  396. package/lib/paths.js +0 -108
  397. package/lib/pm2.js +0 -32
  398. package/lib/process.js +0 -45
  399. package/lib/project-type.js +0 -72
  400. package/lib/publish.js +0 -968
  401. package/lib/root.js +0 -88
  402. package/lib/spawn.js +0 -92
  403. package/lib/status.js +0 -132
  404. package/ui/banner.js +0 -441
  405. package/ui/interactive.js +0 -380
  406. package/ui/theme.js +0 -265
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var BootstrapService_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.BootstrapService = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const config_1 = require("@nestjs/config");
19
+ const typeorm_1 = require("@nestjs/typeorm");
20
+ const typeorm_2 = require("typeorm");
21
+ const markdown_util_1 = require("../../utils/markdown.util");
22
+ const article_service_1 = require("../article/article.service");
23
+ const article_entity_1 = require("../article/article.entity");
24
+ const category_entity_1 = require("../category/category.entity");
25
+ const tag_entity_1 = require("../tag/tag.entity");
26
+ const bootstrap_constants_1 = require("./bootstrap.constants");
27
+ const install_locale_1 = require("./install-locale");
28
+ function extractSummary(markdown) {
29
+ var _a;
30
+ const plain = (_a = markdown
31
+ .replace(/^<!--.*-->$/gm, '')
32
+ .replace(/^#+\s+.*$/gm, '')
33
+ .replace(/\*\*([^*]+)\*\*/g, '$1')
34
+ .replace(/`([^`]+)`/g, '$1')
35
+ .replace(/^\d+\.\s+/gm, '')
36
+ .replace(/^>\s+.*/gm, '')
37
+ .replace(/^---$/gm, '')
38
+ .trim()
39
+ .split('\n\n')
40
+ .find((block) => block.trim() && !block.startsWith('```'))) !== null && _a !== void 0 ? _a : '';
41
+ const line = plain.replace(/\n/g, ' ').trim();
42
+ if (!line)
43
+ return '';
44
+ return line.length > 160 ? `${line.slice(0, 157)}...` : line;
45
+ }
46
+ function needsTocRepair(toc) {
47
+ if (!(toc === null || toc === void 0 ? void 0 : toc.trim()))
48
+ return true;
49
+ try {
50
+ const parsed = JSON.parse(toc);
51
+ if (!Array.isArray(parsed) || parsed.length === 0)
52
+ return true;
53
+ const first = parsed[0];
54
+ return Array.isArray(first) || !(first && typeof first === 'object' && 'id' in first);
55
+ }
56
+ catch (_a) {
57
+ return true;
58
+ }
59
+ }
60
+ function needsContentRefresh(content, locale) {
61
+ if (!(content === null || content === void 0 ? void 0 : content.trim()))
62
+ return true;
63
+ const marker = `<!-- ${bootstrap_constants_1.HELLO_WORLD_SEED_MARKER}:${locale} -->`;
64
+ if (content.includes(marker))
65
+ return false;
66
+ return (content.includes('## English') ||
67
+ content.includes('## 中文') ||
68
+ content.includes('Hello World / 欢迎使用') ||
69
+ content.includes('reactpress-seed:'));
70
+ }
71
+ const HELLO_WORLD_COVER = '/logo.png';
72
+ function ensureHelloWorldHomeRecommend(article) {
73
+ var _a;
74
+ let changed = false;
75
+ if (!article.isRecommended) {
76
+ article.isRecommended = true;
77
+ changed = true;
78
+ }
79
+ if (!((_a = article.cover) === null || _a === void 0 ? void 0 : _a.trim())) {
80
+ article.cover = HELLO_WORLD_COVER;
81
+ changed = true;
82
+ }
83
+ return changed;
84
+ }
85
+ let BootstrapService = BootstrapService_1 = class BootstrapService {
86
+ constructor(articleRepository, categoryRepository, tagRepository, articleService, configService) {
87
+ this.articleRepository = articleRepository;
88
+ this.categoryRepository = categoryRepository;
89
+ this.tagRepository = tagRepository;
90
+ this.articleService = articleService;
91
+ this.configService = configService;
92
+ this.logger = new common_1.Logger(BootstrapService_1.name);
93
+ }
94
+ onModuleInit() {
95
+ void this.runFirstRunBootstrap();
96
+ }
97
+ resolveLocale() {
98
+ return (0, install_locale_1.resolveInstallLocale)(this.configService.get('REACTPRESS_LANG') || this.configService.get('LANG'));
99
+ }
100
+ async runFirstRunBootstrap() {
101
+ try {
102
+ await this.seedHelloWorldArticle();
103
+ }
104
+ catch (error) {
105
+ this.logger.error('First-run bootstrap failed', error instanceof Error ? error.stack : String(error));
106
+ }
107
+ }
108
+ async seedHelloWorldArticle() {
109
+ const locale = this.resolveLocale();
110
+ const seed = (0, bootstrap_constants_1.getHelloWorldSeed)(locale);
111
+ const { html, toc } = (0, markdown_util_1.marked)(seed.markdown);
112
+ const summary = extractSummary(seed.markdown);
113
+ const existing = await this.articleRepository.findOne({
114
+ where: { title: (0, typeorm_2.In)([...bootstrap_constants_1.HELLO_WORLD_LEGACY_TITLES, seed.articleTitle]) },
115
+ });
116
+ if (existing) {
117
+ const refreshContent = needsContentRefresh(existing.content, locale);
118
+ const refreshToc = needsTocRepair(existing.toc);
119
+ const refreshRecommend = ensureHelloWorldHomeRecommend(existing);
120
+ if (!refreshContent && !refreshToc && !refreshRecommend)
121
+ return;
122
+ if (refreshContent) {
123
+ existing.title = seed.articleTitle;
124
+ existing.content = seed.markdown;
125
+ existing.summary = summary;
126
+ }
127
+ if (refreshContent || refreshToc) {
128
+ existing.html = html;
129
+ existing.toc = toc;
130
+ }
131
+ await this.articleRepository.save(existing);
132
+ this.logger.log(`Hello World sample article updated (${locale})`);
133
+ return;
134
+ }
135
+ if ((await this.articleRepository.count()) > 0)
136
+ return;
137
+ const category = await this.findOrCreateCategory(seed.category);
138
+ const tags = await Promise.all(seed.tags.map((tag) => this.findOrCreateTag(tag)));
139
+ await this.articleService.create({
140
+ title: seed.articleTitle,
141
+ content: seed.markdown,
142
+ html,
143
+ toc,
144
+ summary,
145
+ status: 'publish',
146
+ cover: HELLO_WORLD_COVER,
147
+ category: category.id,
148
+ tags: tags.map((tag) => tag.id).join(','),
149
+ isRecommended: true,
150
+ isCommentable: true,
151
+ });
152
+ this.logger.log(`Hello World sample article seeded (${locale})`);
153
+ }
154
+ async findOrCreateCategory(def) {
155
+ var _a;
156
+ let category = (_a = (await this.categoryRepository.findOne({ where: { value: def.value } }))) !== null && _a !== void 0 ? _a : (await this.categoryRepository.findOne({ where: { label: def.label } }));
157
+ if (category)
158
+ return category;
159
+ category = this.categoryRepository.create(def);
160
+ return this.categoryRepository.save(category);
161
+ }
162
+ async findOrCreateTag(def) {
163
+ var _a;
164
+ let tag = (_a = (await this.tagRepository.findOne({ where: { value: def.value } }))) !== null && _a !== void 0 ? _a : (await this.tagRepository.findOne({ where: { label: def.label } }));
165
+ if (tag)
166
+ return tag;
167
+ tag = this.tagRepository.create(def);
168
+ return this.tagRepository.save(tag);
169
+ }
170
+ };
171
+ BootstrapService = BootstrapService_1 = __decorate([
172
+ (0, common_1.Injectable)(),
173
+ __param(0, (0, typeorm_1.InjectRepository)(article_entity_1.Article)),
174
+ __param(1, (0, typeorm_1.InjectRepository)(category_entity_1.Category)),
175
+ __param(2, (0, typeorm_1.InjectRepository)(tag_entity_1.Tag)),
176
+ __metadata("design:paramtypes", [typeorm_2.Repository,
177
+ typeorm_2.Repository,
178
+ typeorm_2.Repository,
179
+ article_service_1.ArticleService,
180
+ config_1.ConfigService])
181
+ ], BootstrapService);
182
+ exports.BootstrapService = BootstrapService;
183
+ //# sourceMappingURL=bootstrap.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.service.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/bootstrap.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkE;AAClE,2CAA+C;AAC/C,6CAAmD;AACnD,qCAAyC;AAEzC,6DAAmD;AACnD,gEAA4D;AAC5D,8DAAoD;AACpD,iEAAuD;AACvD,kDAAwC;AACxC,+DAI+B;AAC/B,qDAAuE;AAEvE,SAAS,cAAc,CAAC,QAAgB;;IACtC,MAAM,KAAK,GAAG,MAAA,QAAQ;SACnB,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC;SACjC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC;SAC3B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,IAAI,EAAE;SACN,KAAK,CAAC,MAAM,CAAC;SACb,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,K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,CAAA;IAEzB,WAAA,IAAA,0BAAgB,EAAC,0BAAQ,CAAC,CAAA;IAE1B,WAAA,IAAA,0BAAgB,EAAC,gBAAG,CAAC,CAAA;qCAHc,oBAAU;QAET,oBAAU;QAEf,oBAAU;QACT,gCAAc;QACf,sBAAa;GAXpC,gBAAgB,CA0G5B;AA1GY,4CAAgB"}
@@ -0,0 +1,2 @@
1
+ export type InstallLocale = 'zh' | 'en';
2
+ export declare function resolveInstallLocale(raw?: string): InstallLocale;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveInstallLocale = void 0;
4
+ function resolveInstallLocale(raw) {
5
+ const code = String(raw || process.env.REACTPRESS_LANG || process.env.LANG || 'en')
6
+ .split(/[._-]/)[0]
7
+ .toLowerCase();
8
+ return code === 'zh' ? 'zh' : 'en';
9
+ }
10
+ exports.resolveInstallLocale = resolveInstallLocale;
11
+ //# sourceMappingURL=install-locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-locale.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/install-locale.ts"],"names":[],"mappings":";;;AAGA,SAAgB,oBAAoB,CAAC,GAAY;IAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;SAChF,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACjB,WAAW,EAAE,CAAC;IACjB,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACrC,CAAC;AALD,oDAKC"}
@@ -0,0 +1,9 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { PluginLoaderService } from './plugin-loader.service';
3
+ import { ThemeService } from './theme.service';
4
+ export declare class ExtensionModule implements OnModuleInit {
5
+ private readonly themeService;
6
+ private readonly pluginLoader;
7
+ constructor(themeService: ThemeService, pluginLoader: PluginLoaderService);
8
+ onModuleInit(): void;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ExtensionModule = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const typeorm_1 = require("@nestjs/typeorm");
15
+ const auth_module_1 = require("../auth/auth.module");
16
+ const hook_module_1 = require("../hook/hook.module");
17
+ const setting_module_1 = require("../setting/setting.module");
18
+ const setting_entity_1 = require("../setting/setting.entity");
19
+ const plugin_controller_1 = require("./plugin.controller");
20
+ const plugin_loader_service_1 = require("./plugin-loader.service");
21
+ const plugin_service_1 = require("./plugin.service");
22
+ const theme_controller_1 = require("./theme.controller");
23
+ const theme_service_1 = require("./theme.service");
24
+ let ExtensionModule = class ExtensionModule {
25
+ constructor(themeService, pluginLoader) {
26
+ this.themeService = themeService;
27
+ this.pluginLoader = pluginLoader;
28
+ }
29
+ onModuleInit() {
30
+ void this.themeService.ensureDefaultTheme();
31
+ void this.pluginLoader.loadActivePlugins();
32
+ }
33
+ };
34
+ ExtensionModule = __decorate([
35
+ (0, common_1.Module)({
36
+ imports: [
37
+ typeorm_1.TypeOrmModule.forFeature([setting_entity_1.Setting]),
38
+ (0, common_1.forwardRef)(() => auth_module_1.AuthModule),
39
+ setting_module_1.SettingModule,
40
+ hook_module_1.HookModule,
41
+ ],
42
+ controllers: [theme_controller_1.ThemeController, plugin_controller_1.PluginController],
43
+ providers: [theme_service_1.ThemeService, plugin_service_1.PluginService, plugin_loader_service_1.PluginLoaderService],
44
+ exports: [theme_service_1.ThemeService, plugin_service_1.PluginService, plugin_loader_service_1.PluginLoaderService],
45
+ }),
46
+ __metadata("design:paramtypes", [theme_service_1.ThemeService,
47
+ plugin_loader_service_1.PluginLoaderService])
48
+ ], ExtensionModule);
49
+ exports.ExtensionModule = ExtensionModule;
50
+ //# sourceMappingURL=extension.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.module.js","sourceRoot":"","sources":["../../../src/modules/extension/extension.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAkE;AAClE,6CAAgD;AAEhD,qDAAiD;AACjD,qDAAiD;AACjD,8DAA0D;AAC1D,8DAAoD;AACpD,2DAAuD;AACvD,mEAA8D;AAC9D,qDAAiD;AACjD,yDAAqD;AACrD,mDAA+C;AAaxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YACmB,YAA0B,EAC1B,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAqB;IACjD,CAAC;IAEJ,YAAY;QACV,KAAK,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,CAAC;QAC5C,KAAK,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC;IAC7C,CAAC;CACF,CAAA;AAVY,eAAe;IAX3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC;YACnC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,8BAAa;YACb,wBAAU;SACX;QACD,WAAW,EAAE,CAAC,kCAAe,EAAE,oCAAgB,CAAC;QAChD,SAAS,EAAE,CAAC,4BAAY,EAAE,8BAAa,EAAE,2CAAmB,CAAC;QAC7D,OAAO,EAAE,CAAC,4BAAY,EAAE,8BAAa,EAAE,2CAAmB,CAAC;KAC5D,CAAC;qCAGiC,4BAAY;QACZ,2CAAmB;GAHzC,eAAe,CAU3B;AAVY,0CAAe"}
@@ -0,0 +1,12 @@
1
+ import { HookService } from '../hook/hook.service';
2
+ import { PluginService } from './plugin.service';
3
+ export declare class PluginLoaderService {
4
+ private readonly hookService;
5
+ private readonly pluginService;
6
+ private readonly logger;
7
+ constructor(hookService: HookService, pluginService: PluginService);
8
+ loadActivePlugins(): Promise<void>;
9
+ loadPlugin(pluginId: string): Promise<void>;
10
+ unloadPlugin(pluginId: string): Promise<void>;
11
+ reloadPlugin(pluginId: string): Promise<void>;
12
+ }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var PluginLoaderService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.PluginLoaderService = void 0;
14
+ const extension_1 = require("../../../../toolkit/dist/plugin/extension");
15
+ const extension_2 = require("../../../../toolkit/dist/plugin/extension");
16
+ const server_1 = require("../../../../toolkit/dist/plugin/server");
17
+ const common_1 = require("@nestjs/common");
18
+ const fs = require("fs");
19
+ const hook_service_1 = require("../hook/hook.service");
20
+ const plugin_service_1 = require("./plugin.service");
21
+ let PluginLoaderService = PluginLoaderService_1 = class PluginLoaderService {
22
+ constructor(hookService, pluginService) {
23
+ this.hookService = hookService;
24
+ this.pluginService = pluginService;
25
+ this.logger = new common_1.Logger(PluginLoaderService_1.name);
26
+ }
27
+ async loadActivePlugins() {
28
+ const state = await this.pluginService.getPluginState();
29
+ for (const pluginId of state.activePlugins) {
30
+ if (!(0, extension_2.isValidPluginId)(pluginId)) {
31
+ this.logger.warn(`Skipping active plugin with invalid id: ${pluginId}`);
32
+ continue;
33
+ }
34
+ await this.loadPlugin(pluginId);
35
+ }
36
+ }
37
+ async loadPlugin(pluginId) {
38
+ var _a, _b;
39
+ if (!(0, extension_2.isValidPluginId)(pluginId)) {
40
+ this.logger.warn(`Refusing to load plugin with invalid id: ${pluginId}`);
41
+ return;
42
+ }
43
+ await this.unloadPlugin(pluginId);
44
+ const manifest = this.pluginService.readRuntimeManifest(pluginId);
45
+ if (!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.server) === null || _a === void 0 ? void 0 : _a.module)) {
46
+ return;
47
+ }
48
+ const modulePath = this.pluginService.resolveServerModulePath(pluginId, manifest.server.module);
49
+ if (!modulePath || !fs.existsSync(modulePath)) {
50
+ await this.pluginService.recordLoadError(pluginId, `Server module not found: ${manifest.server.module}`);
51
+ return;
52
+ }
53
+ try {
54
+ try {
55
+ delete require.cache[require.resolve(modulePath)];
56
+ }
57
+ catch (_c) {
58
+ }
59
+ const loaded = require(modulePath);
60
+ const mod = ((_b = loaded.default) !== null && _b !== void 0 ? _b : loaded);
61
+ if (typeof mod.register !== 'function') {
62
+ await this.pluginService.recordLoadError(pluginId, 'Plugin server module has no register() export');
63
+ return;
64
+ }
65
+ this.hookService.registerLoadedModule(pluginId, loaded);
66
+ const ctx = await this.pluginService.createPluginContext(pluginId, manifest);
67
+ await mod.register(this.hookService, ctx);
68
+ await this.pluginService.clearLoadError(pluginId);
69
+ this.logger.log(`Loaded plugin "${pluginId}" v${manifest.version}`);
70
+ }
71
+ catch (err) {
72
+ await this.unloadPlugin(pluginId);
73
+ const message = err instanceof Error ? err.message : String(err);
74
+ await this.pluginService.recordLoadError(pluginId, message);
75
+ this.logger.error(`Failed to load plugin "${pluginId}": ${message}`);
76
+ }
77
+ }
78
+ async unloadPlugin(pluginId) {
79
+ this.hookService.removePluginHooks(pluginId);
80
+ await this.hookService.deactivatePluginModule(pluginId);
81
+ }
82
+ async reloadPlugin(pluginId) {
83
+ await this.unloadPlugin(pluginId);
84
+ const state = await this.pluginService.getPluginState();
85
+ if (state.activePlugins.includes(pluginId)) {
86
+ await this.loadPlugin(pluginId);
87
+ }
88
+ }
89
+ };
90
+ PluginLoaderService = PluginLoaderService_1 = __decorate([
91
+ (0, common_1.Injectable)(),
92
+ __metadata("design:paramtypes", [hook_service_1.HookService,
93
+ plugin_service_1.PluginService])
94
+ ], PluginLoaderService);
95
+ exports.PluginLoaderService = PluginLoaderService;
96
+ //# sourceMappingURL=plugin-loader.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-loader.service.js","sourceRoot":"","sources":["../../../src/modules/extension/plugin-loader.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yEAAuF;AACvF,yEAAmF;AACnF,mEAAmF;AACnF,2CAAoD;AACpD,yBAAyB;AAEzB,uDAAmD;AACnD,qDAAiD;AAG1C,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAG9B,YACmB,WAAwB,EACxB,aAA4B;QAD5B,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;QAJ9B,WAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;IAK5D,CAAC;IAEJ,KAAK,CAAC,iBAAiB;QACrB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;QACxD,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,aAAa,EAAE;YAC1C,IAAI,CAAC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IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;QACxD,IAAI,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAC1C,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;SACjC;IACH,CAAC;CACF,CAAA;AAjFY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAKqB,0BAAW;QACT,8BAAa;GALpC,mBAAmB,CAiF/B;AAjFY,kDAAmB"}
@@ -0,0 +1,3 @@
1
+ export declare function readPluginsPackageMeta(root?: string): {
2
+ local: string[];
3
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readPluginsPackageMeta = void 0;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const project_root_util_1 = require("../../utils/project-root.util");
7
+ const extension_1 = require("../../../../toolkit/dist/plugin/extension");
8
+ function scanPluginDirectories(pluginsDir) {
9
+ if (!fs.existsSync(pluginsDir))
10
+ return [];
11
+ const discovered = [];
12
+ for (const entry of fs.readdirSync(pluginsDir, { withFileTypes: true })) {
13
+ if (!entry.isDirectory())
14
+ continue;
15
+ if (!(0, extension_1.isValidPluginId)(entry.name))
16
+ continue;
17
+ if (fs.existsSync(path.join(pluginsDir, entry.name, 'plugin.json'))) {
18
+ discovered.push(entry.name);
19
+ }
20
+ }
21
+ return discovered.sort();
22
+ }
23
+ function readPluginsPackageMeta(root = (0, project_root_util_1.resolveProjectRoot)()) {
24
+ var _a;
25
+ const pluginsDir = path.join(root, 'plugins');
26
+ const pkgPath = path.join(pluginsDir, 'package.json');
27
+ let fromRegistry = [];
28
+ if (fs.existsSync(pkgPath)) {
29
+ try {
30
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
31
+ fromRegistry = Array.isArray((_a = pkg.reactpress) === null || _a === void 0 ? void 0 : _a.local)
32
+ ? pkg.reactpress.local.filter((id) => typeof id === 'string' && (0, extension_1.isValidPluginId)(id))
33
+ : [];
34
+ }
35
+ catch (_b) {
36
+ fromRegistry = [];
37
+ }
38
+ }
39
+ const discovered = scanPluginDirectories(pluginsDir);
40
+ const local = [...new Set([...fromRegistry, ...discovered])].sort();
41
+ return { local };
42
+ }
43
+ exports.readPluginsPackageMeta = readPluginsPackageMeta;
44
+ //# sourceMappingURL=plugin-registry.bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-registry.bridge.js","sourceRoot":"","sources":["../../../src/modules/extension/plugin-registry.bridge.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,qEAAmE;AACnE,yEAAmF;AAEnF,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1C,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE;QACvE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,SAAS;QACnC,IAAI,CAAC,IAAA,2BAAe,EAAC,KAAK,CAAC,IAAI,CAAC;YAAE,SAAS;QAC3C,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,EAAE;YACnE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC7B;KACF;IACD,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,SAAgB,sBAAsB,CAAC,IAAI,GAAG,IAAA,sCAAkB,GAAE;;IAChE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEtD,IAAI,YAAY,GAAa,EAAE,CAAC;IAChC,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC1B,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAEtD,CAAC;YACF,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAA,GAAG,CAAC,UAAU,0CAAE,KAAK,CAAC;gBACjD,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CACzB,CAAC,EAAE,EAAgB,EAAE,CAAC,OAAO,EAAE,KAAK,QAAQ,IAAI,IAAA,2BAAe,EAAC,EAAE,CAAC,CACpE;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QAAC,WAAM;YACN,YAAY,GAAG,EAAE,CAAC;SACnB;KACF;IAED,MAAM,UAAU,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,YAAY,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACpE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC;AAvBD,wDAuBC"}
@@ -0,0 +1,22 @@
1
+ import { PluginLoaderService } from './plugin-loader.service';
2
+ import { PluginService } from './plugin.service';
3
+ export declare class PluginController {
4
+ private readonly pluginService;
5
+ private readonly pluginLoader;
6
+ constructor(pluginService: PluginService, pluginLoader: PluginLoaderService);
7
+ list(): Promise<import("./plugin.service").PluginListItem[]>;
8
+ state(): Promise<import("@fecommunity/reactpress-toolkit/plugin").SitePluginState>;
9
+ getLocale(id: string, locale: string): Promise<{
10
+ pluginId: string;
11
+ locale: string;
12
+ messages: import("@fecommunity/reactpress-toolkit/plugin").PluginAdminLocaleMessages;
13
+ }>;
14
+ getOne(id: string): Promise<import("./plugin.service").PluginListItem>;
15
+ install(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin").SitePluginState>;
16
+ activate(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin").SitePluginState>;
17
+ deactivate(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin").SitePluginState>;
18
+ uninstall(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin").SitePluginState>;
19
+ updateConfig(id: string, body: {
20
+ config?: Record<string, unknown>;
21
+ }): Promise<import("@fecommunity/reactpress-toolkit/plugin").SitePluginState>;
22
+ }
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PluginController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const jwt_auth_guard_1 = require("../auth/jwt-auth.guard");
19
+ const roles_guard_1 = require("../auth/roles.guard");
20
+ const plugin_loader_service_1 = require("./plugin-loader.service");
21
+ const plugin_service_1 = require("./plugin.service");
22
+ let PluginController = class PluginController {
23
+ constructor(pluginService, pluginLoader) {
24
+ this.pluginService = pluginService;
25
+ this.pluginLoader = pluginLoader;
26
+ }
27
+ list() {
28
+ return this.pluginService.listPlugins();
29
+ }
30
+ state() {
31
+ return this.pluginService.getPluginState();
32
+ }
33
+ getLocale(id, locale) {
34
+ return this.pluginService.getPluginAdminLocale(id, locale);
35
+ }
36
+ getOne(id) {
37
+ return this.pluginService.getPlugin(id);
38
+ }
39
+ async install(id) {
40
+ return this.pluginService.installPlugin(id);
41
+ }
42
+ async activate(id) {
43
+ const state = await this.pluginService.activatePlugin(id);
44
+ await this.pluginLoader.reloadPlugin(id);
45
+ return state;
46
+ }
47
+ async deactivate(id) {
48
+ await this.pluginLoader.unloadPlugin(id);
49
+ return this.pluginService.deactivatePlugin(id);
50
+ }
51
+ async uninstall(id) {
52
+ return this.pluginService.uninstallPlugin(id);
53
+ }
54
+ async updateConfig(id, body) {
55
+ var _a;
56
+ const state = await this.pluginService.updatePluginConfig(id, (_a = body === null || body === void 0 ? void 0 : body.config) !== null && _a !== void 0 ? _a : {});
57
+ const current = await this.pluginService.getPluginState();
58
+ if (current.activePlugins.includes(id)) {
59
+ await this.pluginLoader.reloadPlugin(id);
60
+ }
61
+ return state;
62
+ }
63
+ };
64
+ __decorate([
65
+ (0, common_1.Get)(),
66
+ (0, roles_guard_1.Roles)('admin'),
67
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
68
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'List registered and installed plugins' }),
69
+ __metadata("design:type", Function),
70
+ __metadata("design:paramtypes", []),
71
+ __metadata("design:returntype", void 0)
72
+ ], PluginController.prototype, "list", null);
73
+ __decorate([
74
+ (0, common_1.Get)('state'),
75
+ (0, roles_guard_1.Roles)('admin'),
76
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
77
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Current plugin activation state' }),
78
+ __metadata("design:type", Function),
79
+ __metadata("design:paramtypes", []),
80
+ __metadata("design:returntype", void 0)
81
+ ], PluginController.prototype, "state", null);
82
+ __decorate([
83
+ (0, common_1.Get)(':id/locales/:locale'),
84
+ (0, roles_guard_1.Roles)('admin'),
85
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
86
+ (0, swagger_1.ApiResponse)({ status: 200, description: 'Admin locale strings bundled with the plugin' }),
87
+ __param(0, (0, common_1.Param)('id')),
88
+ __param(1, (0, common_1.Param)('locale')),
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", [String, String]),
91
+ __metadata("design:returntype", void 0)
92
+ ], PluginController.prototype, "getLocale", null);
93
+ __decorate([
94
+ (0, common_1.Get)(':id'),
95
+ (0, roles_guard_1.Roles)('admin'),
96
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
97
+ __param(0, (0, common_1.Param)('id')),
98
+ __metadata("design:type", Function),
99
+ __metadata("design:paramtypes", [String]),
100
+ __metadata("design:returntype", void 0)
101
+ ], PluginController.prototype, "getOne", null);
102
+ __decorate([
103
+ (0, common_1.Post)(':id/install'),
104
+ (0, roles_guard_1.Roles)('admin'),
105
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
106
+ __param(0, (0, common_1.Param)('id')),
107
+ __metadata("design:type", Function),
108
+ __metadata("design:paramtypes", [String]),
109
+ __metadata("design:returntype", Promise)
110
+ ], PluginController.prototype, "install", null);
111
+ __decorate([
112
+ (0, common_1.Post)(':id/activate'),
113
+ (0, roles_guard_1.Roles)('admin'),
114
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
115
+ __param(0, (0, common_1.Param)('id')),
116
+ __metadata("design:type", Function),
117
+ __metadata("design:paramtypes", [String]),
118
+ __metadata("design:returntype", Promise)
119
+ ], PluginController.prototype, "activate", null);
120
+ __decorate([
121
+ (0, common_1.Post)(':id/deactivate'),
122
+ (0, roles_guard_1.Roles)('admin'),
123
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
124
+ __param(0, (0, common_1.Param)('id')),
125
+ __metadata("design:type", Function),
126
+ __metadata("design:paramtypes", [String]),
127
+ __metadata("design:returntype", Promise)
128
+ ], PluginController.prototype, "deactivate", null);
129
+ __decorate([
130
+ (0, common_1.Delete)(':id'),
131
+ (0, roles_guard_1.Roles)('admin'),
132
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
133
+ __param(0, (0, common_1.Param)('id')),
134
+ __metadata("design:type", Function),
135
+ __metadata("design:paramtypes", [String]),
136
+ __metadata("design:returntype", Promise)
137
+ ], PluginController.prototype, "uninstall", null);
138
+ __decorate([
139
+ (0, common_1.Put)(':id/config'),
140
+ (0, roles_guard_1.Roles)('admin'),
141
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
142
+ __param(0, (0, common_1.Param)('id')),
143
+ __param(1, (0, common_1.Body)()),
144
+ __metadata("design:type", Function),
145
+ __metadata("design:paramtypes", [String, Object]),
146
+ __metadata("design:returntype", Promise)
147
+ ], PluginController.prototype, "updateConfig", null);
148
+ PluginController = __decorate([
149
+ (0, swagger_1.ApiTags)('Extension'),
150
+ (0, common_1.Controller)('extension/plugins'),
151
+ __metadata("design:paramtypes", [plugin_service_1.PluginService,
152
+ plugin_loader_service_1.PluginLoaderService])
153
+ ], PluginController);
154
+ exports.PluginController = PluginController;
155
+ //# sourceMappingURL=plugin.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.controller.js","sourceRoot":"","sources":["../../../src/modules/extension/plugin.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4F;AAC5F,6CAAuD;AAEvD,2DAAsD;AACtD,qDAAwD;AAC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