@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,23 @@
1
+ /// <reference types="node" />
2
+ export type ImageVariant = 'large' | 'medium' | 'thumb' | 'avatar';
3
+ export type ImageScene = 'default' | 'content' | 'cover' | 'avatar';
4
+ export interface ProcessedImageVariant {
5
+ buffer: Buffer;
6
+ width: number;
7
+ height: number;
8
+ size: number;
9
+ }
10
+ export interface ImageVariantMeta {
11
+ url: string;
12
+ filename: string;
13
+ width: number;
14
+ height: number;
15
+ size: number;
16
+ }
17
+ export declare function isProcessableImage(mimetype: string): boolean;
18
+ export declare function variantsForScene(scene: ImageScene): ImageVariant[];
19
+ export declare function primaryVariantForScene(scene: ImageScene): ImageVariant;
20
+ export declare function buildVariantFilename(baseFilename: string, variant: ImageVariant): string;
21
+ export declare function listVariantFilenames(baseFilename: string): string[];
22
+ export declare function processImageBuffer(buffer: Buffer, variant: ImageVariant): Promise<ProcessedImageVariant>;
23
+ export declare function processImageVariants(buffer: Buffer, variants: ImageVariant[]): Promise<Map<ImageVariant, ProcessedImageVariant>>;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processImageVariants = exports.processImageBuffer = exports.listVariantFilenames = exports.buildVariantFilename = exports.primaryVariantForScene = exports.variantsForScene = exports.isProcessableImage = void 0;
4
+ const path = require("path");
5
+ const sharp = require("sharp");
6
+ const PROCESSABLE_MIMETYPES = new Set(['image/jpeg', 'image/jpg', 'image/png', 'image/webp', 'image/gif']);
7
+ const IMAGE_VARIANT_CONFIG = {
8
+ large: { maxWidth: 1920, quality: 82, fit: 'inside' },
9
+ medium: { maxWidth: 1200, quality: 80, fit: 'inside' },
10
+ thumb: { maxWidth: 400, quality: 75, fit: 'inside' },
11
+ avatar: { maxWidth: 256, maxHeight: 256, quality: 80, fit: 'cover' },
12
+ };
13
+ function isProcessableImage(mimetype) {
14
+ return PROCESSABLE_MIMETYPES.has(String(mimetype || '').toLowerCase());
15
+ }
16
+ exports.isProcessableImage = isProcessableImage;
17
+ function variantsForScene(scene) {
18
+ switch (scene) {
19
+ case 'avatar':
20
+ return ['avatar'];
21
+ case 'content':
22
+ return ['large', 'medium', 'thumb'];
23
+ case 'cover':
24
+ return ['large', 'medium', 'thumb'];
25
+ default:
26
+ return ['large', 'medium', 'thumb'];
27
+ }
28
+ }
29
+ exports.variantsForScene = variantsForScene;
30
+ function primaryVariantForScene(scene) {
31
+ switch (scene) {
32
+ case 'avatar':
33
+ return 'avatar';
34
+ case 'content':
35
+ return 'medium';
36
+ case 'cover':
37
+ return 'large';
38
+ default:
39
+ return 'large';
40
+ }
41
+ }
42
+ exports.primaryVariantForScene = primaryVariantForScene;
43
+ function buildVariantFilename(baseFilename, variant) {
44
+ const parsed = path.parse(baseFilename);
45
+ const baseName = parsed.name.replace(/_(medium|thumb|avatar)$/i, '');
46
+ if (variant === 'large') {
47
+ return path.join(parsed.dir, `${baseName}.webp`);
48
+ }
49
+ return path.join(parsed.dir, `${baseName}_${variant}.webp`);
50
+ }
51
+ exports.buildVariantFilename = buildVariantFilename;
52
+ function listVariantFilenames(baseFilename) {
53
+ return ['large', 'medium', 'thumb', 'avatar'].map((variant) => buildVariantFilename(baseFilename, variant));
54
+ }
55
+ exports.listVariantFilenames = listVariantFilenames;
56
+ async function processImageBuffer(buffer, variant) {
57
+ const config = IMAGE_VARIANT_CONFIG[variant];
58
+ let pipeline = sharp(buffer, { animated: false }).rotate();
59
+ if (config.fit === 'cover' && config.maxHeight) {
60
+ pipeline = pipeline.resize(config.maxWidth, config.maxHeight, {
61
+ fit: 'cover',
62
+ position: 'centre',
63
+ });
64
+ }
65
+ else {
66
+ pipeline = pipeline.resize(config.maxWidth, undefined, {
67
+ fit: 'inside',
68
+ withoutEnlargement: true,
69
+ });
70
+ }
71
+ const output = await pipeline.webp({ quality: config.quality, effort: 4 }).toBuffer({ resolveWithObject: true });
72
+ return {
73
+ buffer: output.data,
74
+ width: output.info.width,
75
+ height: output.info.height,
76
+ size: output.info.size,
77
+ };
78
+ }
79
+ exports.processImageBuffer = processImageBuffer;
80
+ async function processImageVariants(buffer, variants) {
81
+ const results = new Map();
82
+ for (const variant of variants) {
83
+ results.set(variant, await processImageBuffer(buffer, variant));
84
+ }
85
+ return results;
86
+ }
87
+ exports.processImageVariants = processImageVariants;
88
+ //# sourceMappingURL=image-processor.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-processor.util.js","sourceRoot":"","sources":["../../src/utils/image-processor.util.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,+BAAgC;AAoBhC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC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;KACJ;SAAM;QACL,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE;YACrD,GAAG,EAAE,QAAQ;YACb,kBAAkB,EAAE,IAAI;SACzB,CAAC,CAAC;KACJ;IAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;IAEjH,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK;QACxB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM;QAC1B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;KACvB,CAAC;AACJ,CAAC;AAxBD,gDAwBC;AAEM,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,QAAwB;IAExB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuC,CAAC;IAE/D,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACjE;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,oDAWC"}
@@ -0,0 +1 @@
1
+ export declare function isLocalApiQuiet(): boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isLocalApiQuiet = void 0;
4
+ function isLocalApiQuiet() {
5
+ return process.env.REACTPRESS_LOCAL_API_QUIET === '1';
6
+ }
7
+ exports.isLocalApiQuiet = isLocalApiQuiet;
8
+ //# sourceMappingURL=local-api-quiet.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-api-quiet.util.js","sourceRoot":"","sources":["../../src/utils/local-api-quiet.util.ts"],"names":[],"mappings":";;;AACA,SAAgB,eAAe;IAC7B,OAAO,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,GAAG,CAAC;AACxD,CAAC;AAFD,0CAEC"}
@@ -0,0 +1,2 @@
1
+ export declare function resolveProjectRoot(): string;
2
+ export declare function resolveMonorepoRoot(): string;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveMonorepoRoot = exports.resolveProjectRoot = void 0;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ function resolveProjectRoot() {
7
+ if (process.env.REACTPRESS_ORIGINAL_CWD) {
8
+ return process.env.REACTPRESS_ORIGINAL_CWD;
9
+ }
10
+ let dir = process.cwd();
11
+ for (let depth = 0; depth < 8; depth += 1) {
12
+ if (fs.existsSync(path.join(dir, 'themes'))) {
13
+ process.env.REACTPRESS_ORIGINAL_CWD = dir;
14
+ return dir;
15
+ }
16
+ const parent = path.dirname(dir);
17
+ if (parent === dir)
18
+ break;
19
+ dir = parent;
20
+ }
21
+ return process.cwd();
22
+ }
23
+ exports.resolveProjectRoot = resolveProjectRoot;
24
+ function resolveMonorepoRoot() {
25
+ if (process.env.REACTPRESS_MONOREPO_ROOT) {
26
+ return process.env.REACTPRESS_MONOREPO_ROOT;
27
+ }
28
+ let dir = process.cwd();
29
+ for (let depth = 0; depth < 10; depth += 1) {
30
+ if (fs.existsSync(path.join(dir, 'cli', 'out', 'lib', 'theme-registry.js'))) {
31
+ process.env.REACTPRESS_MONOREPO_ROOT = dir;
32
+ return dir;
33
+ }
34
+ const parent = path.dirname(dir);
35
+ if (parent === dir)
36
+ break;
37
+ dir = parent;
38
+ }
39
+ return process.cwd();
40
+ }
41
+ exports.resolveMonorepoRoot = resolveMonorepoRoot;
42
+ //# sourceMappingURL=project-root.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-root.util.js","sourceRoot":"","sources":["../../src/utils/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MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;KACd;IAED,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC;AAjBD,kDAiBC"}
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": 1,
3
+ "database": {
4
+ "mode": "embedded-sqlite",
5
+ "sqlitePath": "data/reactpress.db"
6
+ },
7
+ "server": {
8
+ "port": 3002,
9
+ "clientUrl": "http://localhost:3001",
10
+ "serverUrl": "http://127.0.0.1:3002",
11
+ "apiPrefix": "/api"
12
+ }
13
+ }
@@ -0,0 +1,10 @@
1
+ # ReactPress — local SQLite mode (auto-generated)
2
+ DB_TYPE=sqlite
3
+ DB_DATABASE=data/reactpress.db
4
+ SERVER_PORT=3002
5
+ SERVER_SITE_URL=http://127.0.0.1:3002
6
+ CLIENT_SITE_URL=http://localhost:3001
7
+ SERVER_API_PREFIX=/api
8
+ REACTPRESS_UPLOAD_DIR=uploads
9
+ ADMIN_USER=admin
10
+ ADMIN_PASSWD=admin
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": 1,
3
+ "themes": [
4
+ {
5
+ "id": "reactpress-theme-starter",
6
+ "name": "ReactPress Theme Starter",
7
+ "version": "1.0.0-beta.0",
8
+ "description": "官方 Next.js 15 主题 — Tailwind CSS、知识库、评论、深色模式,Lighthouse 95+。",
9
+ "author": "ReactPress",
10
+ "themeUri": "https://github.com/fecommunity/reactpress-theme-starter",
11
+ "previewUrl": "https://reactpress-theme-starter.vercel.app",
12
+ "tags": [
13
+ "官方",
14
+ "Tailwind",
15
+ "App Router",
16
+ "Next.js 15"
17
+ ],
18
+ "dependency": {
19
+ "name": "@fecommunity/reactpress-theme-starter",
20
+ "version": "1.0.0-beta.0"
21
+ },
22
+ "npm": "@fecommunity/reactpress-theme-starter@1.0.0-beta.0",
23
+ "featured": true,
24
+ "requires": ">=3.0.0"
25
+ }
26
+ ]
27
+ }
package/lib/api-dev.js DELETED
@@ -1,89 +0,0 @@
1
- const { spawn } = require('child_process');
2
- const path = require('path');
3
- const { ensureProjectEnvironment } = require('./bootstrap');
4
- const {
5
- getServerBin,
6
- getServerDir,
7
- isUsingMonorepoServer,
8
- canStartLocalApi,
9
- } = require('./paths');
10
- const { stopApi } = require('./lifecycle');
11
- const { ensureOriginalCwd } = require('./root');
12
- const { t } = require('./i18n');
13
-
14
- let apiChild;
15
-
16
- function stopApiDev(projectRoot) {
17
- if (apiChild && !apiChild.killed) {
18
- apiChild.kill('SIGTERM');
19
- }
20
- if (!isUsingMonorepoServer(projectRoot)) {
21
- stopApi(projectRoot);
22
- }
23
- }
24
-
25
- function startApiDev(projectRoot) {
26
- if (isUsingMonorepoServer(projectRoot)) {
27
- console.log(t('apiDev.modeServer'));
28
- apiChild = spawn('pnpm', ['run', '--dir', './server', 'dev'], {
29
- cwd: projectRoot,
30
- stdio: 'inherit',
31
- shell: true,
32
- env: {
33
- ...process.env,
34
- REACTPRESS_ORIGINAL_CWD: projectRoot,
35
- },
36
- });
37
- } else if (canStartLocalApi(projectRoot)) {
38
- console.log(t('apiDev.modeBundled'));
39
- apiChild = spawn(process.execPath, [getServerBin(projectRoot)], {
40
- cwd: getServerDir(projectRoot),
41
- stdio: 'inherit',
42
- env: {
43
- ...process.env,
44
- REACTPRESS_ORIGINAL_CWD: projectRoot,
45
- },
46
- });
47
- } else {
48
- console.error(t('lifecycle.noServerAvailable'));
49
- process.exit(1);
50
- }
51
-
52
- if (apiChild) {
53
- apiChild.on('close', (code) => {
54
- process.exit(code ?? 0);
55
- });
56
- console.log(t('apiDev.ctrlCHint'));
57
- console.log(t('apiDev.stopHint'));
58
- }
59
- }
60
-
61
- async function runApiDev(projectRoot = ensureOriginalCwd()) {
62
- try {
63
- await ensureProjectEnvironment(projectRoot);
64
- } catch (err) {
65
- console.error(t('dev.envFailed'), err.message || err);
66
- process.exit(1);
67
- }
68
-
69
- process.on('SIGINT', () => {
70
- stopApiDev(projectRoot);
71
- process.exit(0);
72
- });
73
- process.on('SIGTERM', () => {
74
- stopApiDev(projectRoot);
75
- process.exit(0);
76
- });
77
-
78
- startApiDev(projectRoot);
79
- }
80
-
81
- function getApiDevScriptPath() {
82
- return path.join(__dirname, 'api-dev-runner.js');
83
- }
84
-
85
- module.exports = {
86
- runApiDev,
87
- stopApiDev,
88
- getApiDevScriptPath,
89
- };
package/lib/bootstrap.js DELETED
@@ -1,114 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const { pathToFileURL } = require('url');
4
- const { ensureOriginalCwd, isMonorepoCheckout } = require('./root');
5
- const { getCliPackageRoot } = require('./paths');
6
- const { t } = require('./i18n');
7
-
8
- async function importCliModule(relativePath) {
9
- const modulePath = path.join(getCliPackageRoot(), 'dist', relativePath);
10
- return import(pathToFileURL(modulePath).href);
11
- }
12
-
13
- async function copyTemplateFile(src, dest) {
14
- await fs.promises.mkdir(path.dirname(dest), { recursive: true });
15
- await fs.promises.copyFile(src, dest);
16
- }
17
-
18
- async function initMonorepoProject(projectRoot, { force = false } = {}) {
19
- const { getProjectPaths, getTemplatesDir } = await importCliModule('utils/paths.js');
20
- const { saveConfig, syncEnvFromConfig } = await importCliModule('services/config.js');
21
- const { ensureDatabase, ensureDatabaseHostPort } = await importCliModule('services/database.js');
22
-
23
- const paths = getProjectPaths(projectRoot);
24
- const templatesDir = getTemplatesDir();
25
-
26
- if (fs.existsSync(paths.configPath) && !force) {
27
- const config = await (await importCliModule('services/config.js')).loadConfig(projectRoot);
28
- await ensureDatabaseHostPort(projectRoot, undefined, config);
29
- const dbResult = await ensureDatabase(projectRoot, config);
30
- if (!dbResult.ok) {
31
- return { ok: false, projectRoot, message: dbResult.message };
32
- }
33
- return { ok: true, projectRoot, message: t('bootstrap.configReady') };
34
- }
35
-
36
- await fs.promises.mkdir(paths.reactpressDir, { recursive: true });
37
- await copyTemplateFile(
38
- path.join(templatesDir, 'docker-compose.yml'),
39
- paths.dockerComposePath
40
- );
41
-
42
- const config = JSON.parse(
43
- await fs.promises.readFile(path.join(templatesDir, 'config.default.json'), 'utf8')
44
- );
45
- await saveConfig(projectRoot, config);
46
- await syncEnvFromConfig(projectRoot, config);
47
-
48
- if (!fs.existsSync(paths.envPath) || force) {
49
- await copyTemplateFile(path.join(templatesDir, 'env.default'), paths.envPath);
50
- await syncEnvFromConfig(projectRoot, config);
51
- }
52
-
53
- await ensureDatabaseHostPort(projectRoot, undefined, config);
54
- const dbResult = await ensureDatabase(projectRoot, config);
55
-
56
- if (!dbResult.ok) {
57
- return {
58
- ok: true,
59
- projectRoot,
60
- message: t('bootstrap.projectDbPending', { message: dbResult.message }),
61
- };
62
- }
63
-
64
- return {
65
- ok: true,
66
- projectRoot,
67
- message: t('bootstrap.ready'),
68
- };
69
- }
70
-
71
- async function ensureProjectEnvironment(projectRoot = ensureOriginalCwd()) {
72
- const root = path.resolve(projectRoot);
73
- const { setProjectCwd } = await importCliModule('utils/cli-context.js');
74
- setProjectCwd(root);
75
-
76
- const { isReactPressProject, loadConfig } = await importCliModule('services/config.js');
77
- const { ensureDatabase, ensureDatabaseHostPort } = await importCliModule('services/database.js');
78
-
79
- if (!(await isReactPressProject(root))) {
80
- if (isMonorepoCheckout(root)) {
81
- const result = await initMonorepoProject(root);
82
- if (!result.ok) {
83
- throw new Error(result.message || t('bootstrap.initFailed'));
84
- }
85
- return result;
86
- }
87
-
88
- const { initProject } = await importCliModule('services/init.js');
89
- const result = await initProject({ directory: root, force: false });
90
- if (!result.ok) {
91
- throw new Error(result.message || t('bootstrap.cliInitFailed'));
92
- }
93
- return result;
94
- }
95
-
96
- const config = await loadConfig(root);
97
- await ensureDatabaseHostPort(root, undefined, config);
98
- const dbResult = await ensureDatabase(root, config);
99
- if (!dbResult.ok) {
100
- throw new Error(
101
- t('bootstrap.dbNotReady', {
102
- message: dbResult.message || t('bootstrap.dbPendingShort'),
103
- })
104
- );
105
- }
106
-
107
- return { ok: true, projectRoot: root, message: t('bootstrap.dbReady') };
108
- }
109
-
110
- module.exports = {
111
- ensureProjectEnvironment,
112
- initMonorepoProject,
113
- isMonorepoCheckout,
114
- };
package/lib/build.js DELETED
@@ -1,162 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const ora = require('ora');
4
- const { brand, icon, ok, warn, label, chip } = require('../ui/theme');
5
- const { runSync } = require('./spawn');
6
- const { ensureOriginalCwd } = require('./root');
7
- const { t } = require('./i18n');
8
-
9
- const FORBIDDEN_SCRIPTS = new Set(['build']);
10
-
11
- /** @type {Record<string, { script: string, labelKey: string }[]>} */
12
- const BUILD_STEPS = {
13
- toolkit: [{ script: 'build:toolkit', labelKey: 'build.label.toolkit' }],
14
- server: [{ script: 'build:server', labelKey: 'build.label.server' }],
15
- client: [{ script: 'build:client', labelKey: 'build.label.client' }],
16
- docs: [{ script: 'build:docs', labelKey: 'build.label.docs' }],
17
- all: [
18
- { script: 'build:toolkit', labelKey: 'build.label.toolkit' },
19
- { script: 'build:server', labelKey: 'build.label.server' },
20
- { script: 'build:client', labelKey: 'build.label.client' },
21
- ],
22
- };
23
-
24
- const TARGETS = Object.keys(BUILD_STEPS);
25
-
26
- const buildChildEnv = { REACTPRESS_BUILD_ACTIVE: '1' };
27
-
28
- function readPackageScripts(packageJsonPath) {
29
- try {
30
- const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
31
- return pkg.scripts || {};
32
- } catch {
33
- return {};
34
- }
35
- }
36
-
37
- /** Prefer workspace package scripts over root package.json aliases. */
38
- function resolveBuildInvocation(script, projectRoot) {
39
- const root = path.resolve(projectRoot);
40
-
41
- if (script === 'build:toolkit') {
42
- const toolkitDir = path.join(root, 'toolkit');
43
- if (fs.existsSync(path.join(toolkitDir, 'package.json'))) {
44
- return { command: 'pnpm', args: ['run', 'build'], cwd: toolkitDir };
45
- }
46
- const rootScripts = readPackageScripts(path.join(root, 'package.json'));
47
- if (rootScripts['build:toolkit']) {
48
- return { command: 'pnpm', args: ['run', 'build:toolkit'], cwd: root };
49
- }
50
- return null;
51
- }
52
-
53
- if (script === 'build:server') {
54
- const serverDir = path.join(root, 'server');
55
- if (fs.existsSync(path.join(serverDir, 'package.json'))) {
56
- return { command: 'pnpm', args: ['run', 'build'], cwd: serverDir };
57
- }
58
- }
59
-
60
- if (script === 'build:client') {
61
- const clientDir = path.join(root, 'client');
62
- if (fs.existsSync(path.join(clientDir, 'package.json'))) {
63
- return { command: 'pnpm', args: ['run', 'build'], cwd: clientDir };
64
- }
65
- }
66
-
67
- if (script === 'build:docs') {
68
- const docsDir = path.join(root, 'docs');
69
- if (fs.existsSync(path.join(docsDir, 'package.json'))) {
70
- return { command: 'pnpm', args: ['run', 'build'], cwd: docsDir };
71
- }
72
- }
73
-
74
- const rootScripts = readPackageScripts(path.join(root, 'package.json'));
75
- if (rootScripts[script]) {
76
- return { command: 'pnpm', args: ['run', script], cwd: root };
77
- }
78
-
79
- return null;
80
- }
81
-
82
- function stepBadge(current, total) {
83
- return chip(`${current}/${total}`, brand.primary);
84
- }
85
-
86
- async function runBuild(target = 'all', projectRoot = ensureOriginalCwd()) {
87
- if (process.env.REACTPRESS_BUILD_ACTIVE === '1') {
88
- throw new Error(t('build.recursive'));
89
- }
90
-
91
- const steps = BUILD_STEPS[target];
92
- if (!steps) {
93
- throw new Error(
94
- t('build.unknownTarget', {
95
- target,
96
- available: TARGETS.join(', '),
97
- })
98
- );
99
- }
100
-
101
- const total = steps.length;
102
- const buildStarted = Date.now();
103
-
104
- console.log('');
105
- if (total > 1) {
106
- console.log(label(t('build.plan', { total })));
107
- console.log('');
108
- }
109
-
110
- for (let i = 0; i < steps.length; i++) {
111
- const { script, labelKey } = steps[i];
112
- if (FORBIDDEN_SCRIPTS.has(script)) {
113
- throw new Error(t('build.forbiddenScript', { script }));
114
- }
115
-
116
- const current = i + 1;
117
- const stepLabel = t(labelKey);
118
- const stepStarted = Date.now();
119
- const badge = stepBadge(current, total);
120
-
121
- const invocation = resolveBuildInvocation(script, projectRoot);
122
- if (!invocation) {
123
- console.log(` ${badge} ${warn(t('build.stepSkipped', { label: stepLabel }))}`);
124
- continue;
125
- }
126
-
127
- const spinner = ora({
128
- text: `${badge} ${t('build.step', { current, total, label: stepLabel })}`,
129
- color: 'magenta',
130
- spinner: 'dots',
131
- }).start();
132
-
133
- try {
134
- runSync(invocation.command, invocation.args, {
135
- cwd: invocation.cwd,
136
- env: buildChildEnv,
137
- });
138
- } catch (err) {
139
- spinner.fail(`${badge} ${t('build.stepFailed', { current, total, label: stepLabel })}`);
140
- throw err;
141
- }
142
-
143
- const seconds = ((Date.now() - stepStarted) / 1000).toFixed(1);
144
- spinner.succeed(
145
- `${badge} ${ok(t('build.stepDone', { current, total, label: stepLabel, seconds }))}`
146
- );
147
- }
148
-
149
- if (total > 1) {
150
- const totalSeconds = ((Date.now() - buildStarted) / 1000).toFixed(1);
151
- console.log('');
152
- console.log(` ${icon.spark} ${ok(t('build.done', { seconds: totalSeconds }))}`);
153
- }
154
- console.log('');
155
- }
156
-
157
- module.exports = {
158
- runBuild,
159
- TARGETS,
160
- BUILD_STEPS,
161
- resolveBuildInvocation,
162
- };