@fecommunity/reactpress 3.7.0 → 4.0.0-beta.1

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 (413) 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 +566 -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 +914 -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 +1192 -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 +95 -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 +378 -0
  272. package/out/ui/interactive.js.map +1 -0
  273. package/out/ui/prompts.d.ts +2 -0
  274. package/out/ui/prompts.d.ts.map +1 -0
  275. package/out/ui/prompts.js +91 -0
  276. package/out/ui/prompts.js.map +1 -0
  277. package/out/ui/theme.d.ts +2 -0
  278. package/out/ui/theme.d.ts.map +1 -0
  279. package/out/ui/theme.js +250 -0
  280. package/out/ui/theme.js.map +1 -0
  281. package/package.json +13 -7
  282. package/server/dist/common/api-messages.d.ts +9 -0
  283. package/server/dist/common/api-messages.js +9 -0
  284. package/server/dist/common/api-messages.js.map +1 -1
  285. package/server/dist/database/typeorm-options.d.ts +3 -0
  286. package/server/dist/database/typeorm-options.js +60 -0
  287. package/server/dist/database/typeorm-options.js.map +1 -0
  288. package/server/dist/modules/api-key/api-key.controller.js.map +1 -1
  289. package/server/dist/modules/api-key/api-key.entity.js.map +1 -1
  290. package/server/dist/modules/api-key/api-key.guard.js +2 -3
  291. package/server/dist/modules/api-key/api-key.guard.js.map +1 -1
  292. package/server/dist/modules/api-key/api-key.module.js.map +1 -1
  293. package/server/dist/modules/api-key/api-key.service.js +1 -1
  294. package/server/dist/modules/api-key/api-key.service.js.map +1 -1
  295. package/server/dist/modules/article/article-revision.entity.js +3 -3
  296. package/server/dist/modules/article/article-revision.entity.js.map +1 -1
  297. package/server/dist/modules/article/article-slug.util.d.ts +2 -0
  298. package/server/dist/modules/article/article-slug.util.js +19 -0
  299. package/server/dist/modules/article/article-slug.util.js.map +1 -0
  300. package/server/dist/modules/article/scheduled-publish.service.js.map +1 -1
  301. package/server/dist/modules/bootstrap/bootstrap.constants.d.ts +20 -0
  302. package/server/dist/modules/bootstrap/bootstrap.constants.js +171 -0
  303. package/server/dist/modules/bootstrap/bootstrap.constants.js.map +1 -0
  304. package/server/dist/modules/bootstrap/bootstrap.service.d.ts +22 -0
  305. package/server/dist/modules/bootstrap/bootstrap.service.js +183 -0
  306. package/server/dist/modules/bootstrap/bootstrap.service.js.map +1 -0
  307. package/server/dist/modules/bootstrap/install-locale.d.ts +2 -0
  308. package/server/dist/modules/bootstrap/install-locale.js +11 -0
  309. package/server/dist/modules/bootstrap/install-locale.js.map +1 -0
  310. package/server/dist/modules/extension/extension.module.d.ts +9 -0
  311. package/server/dist/modules/extension/extension.module.js +50 -0
  312. package/server/dist/modules/extension/extension.module.js.map +1 -0
  313. package/server/dist/modules/extension/plugin-loader.service.d.ts +12 -0
  314. package/server/dist/modules/extension/plugin-loader.service.js +96 -0
  315. package/server/dist/modules/extension/plugin-loader.service.js.map +1 -0
  316. package/server/dist/modules/extension/plugin-registry.bridge.d.ts +3 -0
  317. package/server/dist/modules/extension/plugin-registry.bridge.js +44 -0
  318. package/server/dist/modules/extension/plugin-registry.bridge.js.map +1 -0
  319. package/server/dist/modules/extension/plugin.controller.d.ts +22 -0
  320. package/server/dist/modules/extension/plugin.controller.js +155 -0
  321. package/server/dist/modules/extension/plugin.controller.js.map +1 -0
  322. package/server/dist/modules/extension/plugin.service.d.ts +52 -0
  323. package/server/dist/modules/extension/plugin.service.js +391 -0
  324. package/server/dist/modules/extension/plugin.service.js.map +1 -0
  325. package/server/dist/modules/extension/preview-draft.store.d.ts +13 -0
  326. package/server/dist/modules/extension/preview-draft.store.js +41 -0
  327. package/server/dist/modules/extension/preview-draft.store.js.map +1 -0
  328. package/server/dist/modules/extension/theme-registry.bridge.d.ts +56 -0
  329. package/server/dist/modules/extension/theme-registry.bridge.js +46 -0
  330. package/server/dist/modules/extension/theme-registry.bridge.js.map +1 -0
  331. package/server/dist/modules/extension/theme.controller.d.ts +66 -0
  332. package/server/dist/modules/extension/theme.controller.js +301 -0
  333. package/server/dist/modules/extension/theme.controller.js.map +1 -0
  334. package/server/dist/modules/extension/theme.service.d.ts +140 -0
  335. package/server/dist/modules/extension/theme.service.js +1039 -0
  336. package/server/dist/modules/extension/theme.service.js.map +1 -0
  337. package/server/dist/modules/file/file-optimization.controller.d.ts +12 -0
  338. package/server/dist/modules/file/file-optimization.controller.js +79 -0
  339. package/server/dist/modules/file/file-optimization.controller.js.map +1 -0
  340. package/server/dist/modules/file/file-optimization.service.d.ts +36 -0
  341. package/server/dist/modules/file/file-optimization.service.js +385 -0
  342. package/server/dist/modules/file/file-optimization.service.js.map +1 -0
  343. package/server/dist/modules/file/file-optimization.types.d.ts +66 -0
  344. package/server/dist/modules/file/file-optimization.types.js +5 -0
  345. package/server/dist/modules/file/file-optimization.types.js.map +1 -0
  346. package/server/dist/modules/file/image-optimizer-plugin.guard.d.ts +7 -0
  347. package/server/dist/modules/file/image-optimizer-plugin.guard.js +33 -0
  348. package/server/dist/modules/file/image-optimizer-plugin.guard.js.map +1 -0
  349. package/server/dist/modules/health/health.controller.js +2 -4
  350. package/server/dist/modules/health/health.controller.js.map +1 -1
  351. package/server/dist/modules/health/health.module.js.map +1 -1
  352. package/server/dist/modules/hook/hook.module.d.ts +2 -0
  353. package/server/dist/modules/hook/hook.module.js +22 -0
  354. package/server/dist/modules/hook/hook.module.js.map +1 -0
  355. package/server/dist/modules/hook/hook.service.d.ts +26 -0
  356. package/server/dist/modules/hook/hook.service.js +105 -0
  357. package/server/dist/modules/hook/hook.service.js.map +1 -0
  358. package/server/dist/modules/webhook/webhook.controller.js.map +1 -1
  359. package/server/dist/modules/webhook/webhook.entity.js.map +1 -1
  360. package/server/dist/modules/webhook/webhook.module.js.map +1 -1
  361. package/server/dist/modules/webhook/webhook.service.d.ts +1 -1
  362. package/server/dist/modules/webhook/webhook.service.js +5 -2
  363. package/server/dist/modules/webhook/webhook.service.js.map +1 -1
  364. package/server/dist/node-polyfills.d.ts +18 -0
  365. package/server/dist/node-polyfills.js +24 -0
  366. package/server/dist/node-polyfills.js.map +1 -0
  367. package/server/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  368. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  369. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  370. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  371. package/server/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  372. package/server/dist/tsconfig.tsbuildinfo +1 -0
  373. package/server/dist/utils/image-processor.util.d.ts +23 -0
  374. package/server/dist/utils/image-processor.util.js +88 -0
  375. package/server/dist/utils/image-processor.util.js.map +1 -0
  376. package/server/dist/utils/local-api-quiet.util.d.ts +1 -0
  377. package/server/dist/utils/local-api-quiet.util.js +8 -0
  378. package/server/dist/utils/local-api-quiet.util.js.map +1 -0
  379. package/server/dist/utils/project-root.util.d.ts +2 -0
  380. package/server/dist/utils/project-root.util.js +42 -0
  381. package/server/dist/utils/project-root.util.js.map +1 -0
  382. package/server/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  383. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  384. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  385. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  386. package/server/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  387. package/templates/config.local.json +13 -0
  388. package/templates/env.local.default +10 -0
  389. package/templates/theme-catalog.json +27 -0
  390. package/lib/api-dev.js +0 -89
  391. package/lib/bootstrap.js +0 -114
  392. package/lib/build.js +0 -162
  393. package/lib/db-backup.js +0 -67
  394. package/lib/dev-banner.js +0 -72
  395. package/lib/dev.js +0 -141
  396. package/lib/docker.js +0 -275
  397. package/lib/doctor.js +0 -266
  398. package/lib/http.js +0 -182
  399. package/lib/i18n/index.js +0 -32
  400. package/lib/i18n/strings.js +0 -846
  401. package/lib/lifecycle.js +0 -190
  402. package/lib/nginx.js +0 -342
  403. package/lib/paths.js +0 -108
  404. package/lib/pm2.js +0 -32
  405. package/lib/process.js +0 -45
  406. package/lib/project-type.js +0 -72
  407. package/lib/publish.js +0 -968
  408. package/lib/root.js +0 -88
  409. package/lib/spawn.js +0 -92
  410. package/lib/status.js +0 -132
  411. package/ui/banner.js +0 -441
  412. package/ui/interactive.js +0 -380
  413. package/ui/theme.js +0 -265
package/lib/publish.js DELETED
@@ -1,968 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { execSync } = require('child_process');
4
- const fs = require('fs');
5
- const path = require('path');
6
- const chalk = require('chalk');
7
- const inquirer = require('inquirer');
8
- const crypto = require('crypto');
9
- const { t } = require('./i18n');
10
- const { getMonorepoRoot } = require('./root');
11
-
12
- function getWorkspaceRoot() {
13
- const root = getMonorepoRoot();
14
- if (fs.existsSync(path.join(root, 'pnpm-workspace.yaml'))) {
15
- return root;
16
- }
17
- return process.cwd();
18
- }
19
-
20
- function getPackages() {
21
- return [
22
- {
23
- name: '@fecommunity/reactpress',
24
- path: 'cli',
25
- description: t('publish.pkg.main')
26
- },
27
- {
28
- name: '@fecommunity/reactpress-toolkit',
29
- path: 'toolkit',
30
- description: 'API client and utilities toolkit'
31
- },
32
- {
33
- name: '@fecommunity/reactpress-client',
34
- path: 'client',
35
- description: 'Frontend application package'
36
- },
37
- {
38
- name: '@fecommunity/reactpress-server',
39
- path: 'server',
40
- description: t('publish.pkg.server'),
41
- deprecated: true
42
- },
43
- {
44
- name: '@fecommunity/reactpress-template-hello-world',
45
- path: 'templates/hello-world',
46
- description: 'Hello World template for ReactPress'
47
- },
48
- {
49
- name: '@fecommunity/reactpress-template-twentytwentyfive',
50
- path: 'templates/twentytwentyfive',
51
- description: 'Twenty Twenty Five blog template for ReactPress'
52
- }
53
- ];
54
- }
55
-
56
- const packages = getPackages();
57
-
58
- // Generate a hash for a file or directory
59
- function generateHash(filePath) {
60
- try {
61
- if (fs.statSync(filePath).isDirectory()) {
62
- const files = fs.readdirSync(filePath);
63
- const hashes = files
64
- .filter(file => !file.startsWith('.') && file !== 'node_modules' && file !== 'dist' && file !== '.next') // Ignore hidden files and build directories
65
- .map(file => generateHash(path.join(filePath, file)))
66
- .sort();
67
- return crypto.createHash('md5').update(hashes.join('')).digest('hex');
68
- } else {
69
- const content = fs.readFileSync(filePath);
70
- return crypto.createHash('md5').update(content).digest('hex');
71
- }
72
- } catch (error) {
73
- return '';
74
- }
75
- }
76
-
77
- // Get package content hash
78
- function getPackageHash(packagePath) {
79
- const fullPath = path.join(getWorkspaceRoot(), packagePath);
80
- return generateHash(fullPath);
81
- }
82
-
83
- // Check if package has meaningful changes (for build)
84
- function hasMeaningfulChangesForBuild(packagePath, packageName) {
85
- try {
86
- // Create a hash file path to store previous hash in node_modules
87
- const hashFilePath = path.join(getWorkspaceRoot(), 'node_modules', '.build-cache', `${packageName.replace('/', '_')}.hash`);
88
-
89
- // Generate current hash
90
- const currentHash = getPackageHash(packagePath);
91
-
92
- // Check if we have a previous hash
93
- if (fs.existsSync(hashFilePath)) {
94
- const previousHash = fs.readFileSync(hashFilePath, 'utf8').trim();
95
- return currentHash !== previousHash;
96
- }
97
-
98
- // If no previous hash, consider it as having changes
99
- return true;
100
- } catch (error) {
101
- console.log(chalk.yellow(`āš ļø Could not check changes for ${packageName}, assuming changes exist`));
102
- return true;
103
- }
104
- }
105
-
106
- // Check if package has meaningful changes (for publish)
107
- function hasMeaningfulChangesForPublish(packagePath, packageName) {
108
- try {
109
- // Create a hash file path to store previous hash in node_modules
110
- const hashFilePath = path.join(getWorkspaceRoot(), 'node_modules', '.publish-cache', `${packageName.replace('/', '_')}.hash`);
111
-
112
- // Generate current hash
113
- const currentHash = getPackageHash(packagePath);
114
-
115
- // Check if we have a previous hash
116
- if (fs.existsSync(hashFilePath)) {
117
- const previousHash = fs.readFileSync(hashFilePath, 'utf8').trim();
118
- return currentHash !== previousHash;
119
- }
120
-
121
- // If no previous hash, consider it as having changes
122
- return true;
123
- } catch (error) {
124
- console.log(chalk.yellow(`āš ļø Could not check changes for ${packageName}, assuming changes exist`));
125
- return true;
126
- }
127
- }
128
-
129
- // Save package hash (for build)
130
- function savePackageHashForBuild(packagePath, packageName) {
131
- try {
132
- const hashFilePath = path.join(getWorkspaceRoot(), 'node_modules', '.build-cache', `${packageName.replace('/', '_')}.hash`);
133
-
134
- // Ensure cache directory exists
135
- const cacheDir = path.dirname(hashFilePath);
136
- if (!fs.existsSync(cacheDir)) {
137
- fs.mkdirSync(cacheDir, { recursive: true });
138
- }
139
-
140
- // Generate and save current hash
141
- const currentHash = getPackageHash(packagePath);
142
- fs.writeFileSync(hashFilePath, currentHash);
143
- } catch (error) {
144
- console.log(chalk.yellow(`āš ļø Could not save hash for ${packageName}`));
145
- }
146
- }
147
-
148
- // Save package hash (for publish)
149
- function savePackageHashForPublish(packagePath, packageName) {
150
- try {
151
- const hashFilePath = path.join(getWorkspaceRoot(), 'node_modules', '.publish-cache', `${packageName.replace('/', '_')}.hash`);
152
-
153
- // Ensure cache directory exists
154
- const cacheDir = path.dirname(hashFilePath);
155
- if (!fs.existsSync(cacheDir)) {
156
- fs.mkdirSync(cacheDir, { recursive: true });
157
- }
158
-
159
- // Generate and save current hash
160
- const currentHash = getPackageHash(packagePath);
161
- fs.writeFileSync(hashFilePath, currentHash);
162
- } catch (error) {
163
- console.log(chalk.yellow(`āš ļø Could not save hash for ${packageName}`));
164
- }
165
- }
166
-
167
- // Get current versions
168
- function getCurrentVersion(packagePath) {
169
- try {
170
- const pkgPath = path.join(getWorkspaceRoot(), packagePath, 'package.json');
171
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
172
- return pkg.version;
173
- } catch (error) {
174
- return 'unknown';
175
- }
176
- }
177
-
178
- // Increment version based on type
179
- function incrementVersion(version, type) {
180
- const base = String(version).split('-')[0];
181
- const parts = base.split('.').map((p) => parseInt(p, 10));
182
- while (parts.length < 3) parts.push(0);
183
- const major = Number.isFinite(parts[0]) ? parts[0] : 0;
184
- const minor = Number.isFinite(parts[1]) ? parts[1] : 0;
185
- const patch = Number.isFinite(parts[2]) ? parts[2] : 0;
186
-
187
- switch (type) {
188
- case 'major':
189
- return `${major + 1}.0.0`;
190
- case 'minor':
191
- return `${major}.${minor + 1}.0`;
192
- case 'patch':
193
- return `${major}.${minor}.${patch + 1}`;
194
- case 'beta':
195
- // For beta, we increment the beta number or add beta.1 if not present
196
- const match = version.match(/^(.*)-beta\.(\d+)$/);
197
- if (match) {
198
- const baseVersion = match[1];
199
- const betaNumber = parseInt(match[2]);
200
- return `${baseVersion}-beta.${betaNumber + 1}`;
201
- } else {
202
- // If no beta version exists, add beta.1
203
- return `${version}-beta.1`;
204
- }
205
- case 'alpha':
206
- // For alpha, we increment the alpha number or add alpha.1 if not present
207
- const alphaMatch = version.match(/^(.*)-alpha\.(\d+)$/);
208
- if (alphaMatch) {
209
- const baseVersion = alphaMatch[1];
210
- const alphaNumber = parseInt(alphaMatch[2]);
211
- return `${baseVersion}-alpha.${alphaNumber + 1}`;
212
- } else {
213
- // If no alpha version exists, add alpha.1
214
- return `${version}-alpha.1`;
215
- }
216
- default:
217
- return version;
218
- }
219
- }
220
-
221
- // Get next available version from npm registry
222
- function getNextAvailableVersion(packageName, currentVersion, versionType) {
223
- try {
224
- // First, increment the version locally
225
- let nextVersion = incrementVersion(currentVersion, versionType);
226
-
227
- // Check if this version already exists on npm
228
- let versionExists = true;
229
- let attempts = 0;
230
- const maxAttempts = 100; // Prevent infinite loop
231
-
232
- while (versionExists && attempts < maxAttempts) {
233
- try {
234
- execSync(`npm view ${packageName}@${nextVersion} version`, { stdio: 'ignore' });
235
- // If we get here, the version exists, so we need to increment again
236
- nextVersion = incrementVersion(nextVersion, versionType);
237
- attempts++;
238
- } catch (error) {
239
- // If we get an error, the version doesn't exist, which is what we want
240
- versionExists = false;
241
- }
242
- }
243
-
244
- if (attempts >= maxAttempts) {
245
- throw new Error('Too many attempts to find available version');
246
- }
247
-
248
- return nextVersion;
249
- } catch (error) {
250
- // Fallback to simple increment if npm view fails
251
- console.log(chalk.yellow(`āš ļø Could not check npm registry, using local increment for ${packageName}`));
252
- return incrementVersion(currentVersion, versionType);
253
- }
254
- }
255
-
256
- // Update package version
257
- function updateVersion(packagePath, newVersion) {
258
- console.log(chalk.blue(`\nāœļø Updating version to ${newVersion}...`));
259
-
260
- const pkgPath = path.join(getWorkspaceRoot(), packagePath, 'package.json');
261
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
262
-
263
- const oldVersion = pkg.version;
264
- pkg.version = newVersion;
265
-
266
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
267
- console.log(chalk.green(`āœ… Version updated from ${oldVersion} to ${newVersion}`));
268
- }
269
-
270
- // Fix workspace dependencies for build
271
- function fixWorkspaceDependenciesForBuild(packagePath) {
272
- console.log(chalk.blue(`šŸ”§ Fixing workspace dependencies for build: ${packagePath}...`));
273
-
274
- const pkgPath = path.join(getWorkspaceRoot(), packagePath, 'package.json');
275
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
276
-
277
- // Fix dependencies
278
- const depTypes = ['dependencies', 'devDependencies', 'peerDependencies'];
279
-
280
- depTypes.forEach(depType => {
281
- if (pkg[depType]) {
282
- Object.keys(pkg[depType]).forEach(depName => {
283
- // Check if it's a workspace dependency
284
- if (pkg[depType][depName] === 'workspace:*' || pkg[depType][depName].startsWith('workspace:')) {
285
- // For build purposes, we'll use the file: protocol to reference local packages
286
- const depPackage = packages.find(p => p.name === depName);
287
- if (depPackage) {
288
- console.log(chalk.gray(` Replacing ${depName} workspace dependency with file reference`));
289
- pkg[depType][depName] = `file:../${depPackage.path}`;
290
- }
291
- }
292
- });
293
- }
294
- });
295
-
296
- // Write the updated package.json
297
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
298
- console.log(chalk.green(`āœ… Workspace dependencies fixed for build: ${packagePath}`));
299
- }
300
-
301
- // Restore workspace dependencies after build
302
- function restoreWorkspaceDependenciesAfterBuild(packagePath) {
303
- console.log(chalk.blue(`šŸ”„ Restoring workspace dependencies after build: ${packagePath}...`));
304
-
305
- const pkgPath = path.join(getWorkspaceRoot(), packagePath, 'package.json');
306
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
307
-
308
- // Restore dependencies
309
- const depTypes = ['dependencies', 'devDependencies', 'peerDependencies'];
310
-
311
- depTypes.forEach(depType => {
312
- if (pkg[depType]) {
313
- Object.keys(pkg[depType]).forEach(depName => {
314
- // Check if this is one of our internal packages referenced with file:
315
- const depPackage = packages.find(p => p.name === depName);
316
- if (depPackage && pkg[depType][depName].startsWith('file:')) {
317
- console.log(chalk.gray(` Restoring ${depName} to workspace dependency`));
318
- pkg[depType][depName] = 'workspace:*';
319
- }
320
- });
321
- }
322
- });
323
-
324
- // Write the updated package.json
325
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
326
- console.log(chalk.green(`āœ… Workspace dependencies restored after build: ${packagePath}`));
327
- }
328
-
329
- // Fix workspace dependencies for publish
330
- function fixWorkspaceDependenciesForPublish(packagePath, packageVersions) {
331
- console.log(chalk.blue(`šŸ”§ Fixing workspace dependencies for publish: ${packagePath}...`));
332
-
333
- const pkgPath = path.join(getWorkspaceRoot(), packagePath, 'package.json');
334
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
335
-
336
- // Fix dependencies
337
- const depTypes = ['dependencies', 'devDependencies', 'peerDependencies'];
338
-
339
- depTypes.forEach(depType => {
340
- if (pkg[depType]) {
341
- Object.keys(pkg[depType]).forEach(depName => {
342
- // Check if it's a workspace dependency
343
- if (pkg[depType][depName] === 'workspace:*' || pkg[depType][depName].startsWith('workspace:')) {
344
- // Replace with actual version
345
- const depPackage = packages.find(p => p.name === depName);
346
- if (depPackage && packageVersions[depName]) {
347
- console.log(chalk.gray(` Replacing ${depName} workspace dependency with version ${packageVersions[depName]}`));
348
- pkg[depType][depName] = packageVersions[depName];
349
- }
350
- }
351
- });
352
- }
353
- });
354
-
355
- // Write the updated package.json
356
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
357
- console.log(chalk.green(`āœ… Workspace dependencies fixed for publish: ${packagePath}`));
358
- }
359
-
360
- // Restore workspace dependencies after publish
361
- function restoreWorkspaceDependenciesAfterPublish(packagePath) {
362
- console.log(chalk.blue(`šŸ”„ Restoring workspace dependencies for ${packagePath}...`));
363
-
364
- const pkgPath = path.join(getWorkspaceRoot(), packagePath, 'package.json');
365
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
366
-
367
- // Restore dependencies
368
- const depTypes = ['dependencies', 'devDependencies', 'peerDependencies'];
369
-
370
- depTypes.forEach(depType => {
371
- if (pkg[depType]) {
372
- Object.keys(pkg[depType]).forEach(depName => {
373
- // Check if this is one of our internal packages
374
- const depPackage = packages.find(p => p.name === depName);
375
- if (depPackage) {
376
- console.log(chalk.gray(` Restoring ${depName} to workspace dependency`));
377
- pkg[depType][depName] = 'workspace:*';
378
- }
379
- });
380
- }
381
- });
382
-
383
- // Write the updated package.json
384
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
385
- console.log(chalk.green(`āœ… Workspace dependencies restored for ${packagePath}`));
386
- }
387
-
388
- // Build package
389
- function buildPackage(pkg) {
390
- console.log(chalk.blue(`\nšŸ”Ø Building ${pkg.name} (${pkg.description})...`));
391
-
392
- try {
393
- // Fix workspace dependencies for build
394
- fixWorkspaceDependenciesForBuild(pkg.path);
395
-
396
- try {
397
- const pkgDir = path.join(getWorkspaceRoot(), pkg.path);
398
- if (pkg.path === 'cli') {
399
- execSync('node scripts/sync-bundled-core.mjs', { cwd: pkgDir, stdio: 'inherit' });
400
- if (fs.existsSync(path.join(pkgDir, 'server', 'package.json'))) {
401
- execSync('pnpm run build', { cwd: path.join(pkgDir, 'server'), stdio: 'inherit' });
402
- }
403
- } else if (pkg.path === 'server') {
404
- execSync('pnpm run build', { cwd: pkgDir, stdio: 'inherit' });
405
- } else if (pkg.path === 'client') {
406
- execSync('pnpm run prebuild && pnpm run build', { cwd: pkgDir, stdio: 'inherit' });
407
- } else if (pkg.path === 'toolkit') {
408
- execSync('pnpm run build', { cwd: pkgDir, stdio: 'inherit' });
409
- } else if (pkg.path === 'templates/hello-world' || pkg.path === 'templates/twentytwentyfive') {
410
- console.log(chalk.gray(' Templates do not require building, skipping...'));
411
- } else if (fs.existsSync(path.join(pkgDir, 'package.json'))) {
412
- execSync('pnpm run build', { cwd: pkgDir, stdio: 'inherit' });
413
- }
414
- console.log(chalk.green(`āœ… ${pkg.name} built successfully`));
415
- } finally {
416
- // Always restore workspace dependencies
417
- restoreWorkspaceDependenciesAfterBuild(pkg.path);
418
- }
419
- } catch (error) {
420
- console.log(chalk.red(`āŒ Failed to build ${pkg.name}`));
421
- throw error;
422
- }
423
- }
424
-
425
- // Publish package
426
- function publishPackage(packagePath, packageName, tag = 'latest') {
427
- console.log(chalk.blue(`\nšŸš€ Publishing ${packageName} with tag ${tag}...`));
428
-
429
- try {
430
- const command = `pnpm publish --access public --tag ${tag} --registry https://registry.npmjs.org --no-git-checks`;
431
- execSync(command, { cwd: path.join(getWorkspaceRoot(), packagePath), stdio: 'inherit' });
432
- console.log(chalk.green(`āœ… ${packageName} published successfully!`));
433
- } catch (error) {
434
- console.log(chalk.red(`āŒ Failed to publish ${packageName}`));
435
- throw error;
436
- }
437
- }
438
-
439
- // Create GitHub release
440
- function createGitHubRelease(tagName, releaseNotes) {
441
- console.log(chalk.blue(`\nšŸ“ Creating GitHub release ${tagName}...`));
442
-
443
- try {
444
- // Create release using GitHub CLI if available
445
- const command = `gh release create ${tagName} --title "${tagName}" --notes "${releaseNotes}"`;
446
- execSync(command, { stdio: 'inherit' });
447
- console.log(chalk.green(`āœ… GitHub release ${tagName} created successfully!`));
448
- } catch (error) {
449
- console.log(chalk.yellow(`āš ļø Failed to create GitHub release (GitHub CLI may not be installed or configured)`));
450
- console.log(chalk.gray('You can manually create the release at: https://github.com/fecommunity/reactpress/releases/new'));
451
- }
452
- }
453
-
454
- // Check environment
455
- function checkEnvironment() {
456
- // Check if pnpm is installed
457
- try {
458
- execSync('pnpm --version', { stdio: 'ignore' });
459
- } catch (error) {
460
- console.log(chalk.red('āŒ pnpm is not installed. Please install pnpm first.'));
461
- return false;
462
- }
463
-
464
- // Check if logged in to npm
465
- try {
466
- execSync('pnpm whoami --registry https://registry.npmjs.org', { stdio: 'ignore' });
467
- } catch (error) {
468
- console.log(chalk.red('āŒ Not logged in to npm. Please run "pnpm login --registry https://registry.npmjs.org" first.'));
469
- return false;
470
- }
471
-
472
- return true;
473
- }
474
-
475
- // Build packages function
476
- async function buildPackages() {
477
- console.log(chalk.blue('šŸ—ļø ReactPress Package Builder\n'));
478
-
479
- // Show current versions
480
- console.log(chalk.cyan('šŸ“‹ Current package versions:'));
481
- packages.forEach(pkg => {
482
- const version = getCurrentVersion(pkg.path);
483
- console.log(chalk.gray(` ${pkg.name}: ${version}`));
484
- });
485
- console.log();
486
-
487
- try {
488
- // Track which packages actually need to be built
489
- const packagesToBuild = [];
490
-
491
- // Check for meaningful changes in each package
492
- for (const pkg of packages) {
493
- if (fs.existsSync(path.join(getWorkspaceRoot(), pkg.path))) {
494
- if (hasMeaningfulChangesForBuild(pkg.path, pkg.name)) {
495
- packagesToBuild.push(pkg);
496
- console.log(chalk.blue(`\nšŸ“¦ ${pkg.name} has changes, will be built`));
497
- } else {
498
- console.log(chalk.gray(`\nā­ļø ${pkg.name} has no meaningful changes, skipping...`));
499
- }
500
- } else {
501
- console.log(chalk.yellow(`āš ļø Package ${pkg.name} directory not found, skipping...`));
502
- }
503
- }
504
-
505
- if (packagesToBuild.length === 0) {
506
- console.log(chalk.green('\nāœ… No packages have meaningful changes. Nothing to build!'));
507
- return;
508
- }
509
-
510
- // Build packages that have changes
511
- for (const pkg of packagesToBuild) {
512
- await buildPackage(pkg);
513
- // Save the hash after successful build
514
- savePackageHashForBuild(pkg.path, pkg.name);
515
- }
516
-
517
- console.log(chalk.green(`\nšŸŽ‰ ${packagesToBuild.length} package(s) built successfully!`));
518
- } catch (error) {
519
- console.error(chalk.red('āŒ Build failed:'), error);
520
- process.exit(1);
521
- }
522
- }
523
-
524
- // Publish packages function
525
- async function publishPackages() {
526
- // Check if called with --no-build flag
527
- const noBuild = process.argv.includes('--no-build');
528
-
529
- console.log(chalk.blue('šŸ“¦ ReactPress Package Publisher\n'));
530
-
531
- // Run environment checks
532
- if (!checkEnvironment()) {
533
- process.exit(1);
534
- }
535
-
536
- // Show current versions
537
- console.log(chalk.cyan('šŸ“‹ Current package versions:'));
538
- packages.forEach(pkg => {
539
- const version = getCurrentVersion(pkg.path);
540
- console.log(chalk.gray(` ${pkg.name}: ${version}`));
541
- });
542
- console.log();
543
-
544
- // Ask for publishing options
545
- const { action } = await inquirer.prompt([
546
- {
547
- type: 'list',
548
- name: 'action',
549
- message: 'What would you like to do?',
550
- choices: [
551
- { name: 'šŸš€ Publish all packages with version bump', value: 'publish-all' },
552
- { name: 'šŸ“¦ Publish specific package', value: 'publish-one' },
553
- { name: 'šŸ”Ø Build all packages only', value: 'build-all' },
554
- { name: 'šŸ·ļø Publish as beta/alpha', value: 'publish-prerelease' },
555
- { name: 'āŒ Cancel', value: 'cancel' }
556
- ]
557
- }
558
- ]);
559
-
560
- if (action === 'cancel') {
561
- console.log(chalk.yellow('Operation cancelled.'));
562
- return;
563
- }
564
-
565
- if (action === 'build-all') {
566
- console.log(chalk.blue('šŸ”Ø Building all packages...\n'));
567
-
568
- // Track which packages actually need to be built
569
- const packagesToBuild = [];
570
-
571
- // Check for meaningful changes in each package
572
- for (const pkg of packages) {
573
- if (fs.existsSync(path.join(getWorkspaceRoot(), pkg.path))) {
574
- if (hasMeaningfulChangesForPublish(pkg.path, pkg.name)) {
575
- packagesToBuild.push(pkg);
576
- console.log(chalk.blue(`\nšŸ“¦ ${pkg.name} has changes, will be built`));
577
- } else {
578
- console.log(chalk.gray(`\nā­ļø ${pkg.name} has no meaningful changes, skipping...`));
579
- }
580
- } else {
581
- console.log(chalk.yellow(`āš ļø Package ${pkg.name} directory not found, skipping...`));
582
- }
583
- }
584
-
585
- if (packagesToBuild.length === 0) {
586
- console.log(chalk.green('\nāœ… No packages have meaningful changes. Nothing to build!'));
587
- return;
588
- }
589
-
590
- for (const pkg of packagesToBuild) {
591
- await buildPackage(pkg);
592
- savePackageHashForPublish(pkg.path, pkg.name);
593
- }
594
-
595
- console.log(chalk.green(`\nšŸŽ‰ ${packagesToBuild.length} package(s) built successfully!`));
596
- return;
597
- }
598
-
599
- if (action === 'publish-one') {
600
- const { selectedPackage } = await inquirer.prompt([
601
- {
602
- type: 'list',
603
- name: 'selectedPackage',
604
- message: 'Which package would you like to publish?',
605
- choices: packages.map(pkg => ({
606
- name: `${pkg.name} (${pkg.description})`,
607
- value: pkg
608
- }))
609
- }
610
- ]);
611
-
612
- // Check if the selected package has meaningful changes
613
- if (!hasMeaningfulChangesForPublish(selectedPackage.path, selectedPackage.name)) {
614
- console.log(chalk.gray(`\nā­ļø ${selectedPackage.name} has no meaningful changes, skipping...`));
615
- console.log(chalk.green('āœ… Nothing to publish!'));
616
- return;
617
- }
618
-
619
- const { versionType } = await inquirer.prompt([
620
- {
621
- type: 'list',
622
- name: 'versionType',
623
- message: 'Version bump type:',
624
- choices: [
625
- { name: 'Beta (1.0.0-beta.1 -> 1.0.0-beta.2)', value: 'beta' },
626
- { name: 'Patch (1.0.0 -> 1.0.1)', value: 'patch' },
627
- { name: 'Minor (1.0.0 -> 1.1.0)', value: 'minor' },
628
- { name: 'Major (1.0.0 -> 2.0.0)', value: 'major' },
629
- { name: 'Custom version', value: 'custom' }
630
- ]
631
- }
632
- ]);
633
-
634
- let newVersion;
635
- const currentVersion = getCurrentVersion(selectedPackage.path);
636
-
637
- if (versionType === 'custom') {
638
- const { customVersion } = await inquirer.prompt([
639
- {
640
- type: 'input',
641
- name: 'customVersion',
642
- message: `Enter new version for ${selectedPackage.name} (current: ${currentVersion}):`,
643
- validate: (input) => {
644
- const semverRegex = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?$/;
645
- return semverRegex.test(input) || 'Please enter a valid semver version (e.g., 1.0.0)';
646
- }
647
- }
648
- ]);
649
- newVersion = customVersion;
650
- } else {
651
- newVersion = getNextAvailableVersion(selectedPackage.name, currentVersion, versionType);
652
- }
653
-
654
- // Get all package versions for dependency resolution
655
- const packageVersions = {};
656
- packages.forEach(pkg => {
657
- packageVersions[pkg.name] = getCurrentVersion(pkg.path);
658
- });
659
- // Update the selected package version
660
- packageVersions[selectedPackage.name] = newVersion;
661
-
662
- // Fix workspace dependencies before publishing
663
- fixWorkspaceDependenciesForPublish(selectedPackage.path, packageVersions);
664
-
665
- try {
666
- updateVersion(selectedPackage.path, newVersion);
667
- // Only build if not disabled
668
- if (!noBuild) {
669
- buildPackage(selectedPackage);
670
- }
671
-
672
- // Determine tag based on version type
673
- const tag = versionType === 'beta' ? 'beta' : 'latest';
674
- publishPackage(selectedPackage.path, selectedPackage.name, tag);
675
-
676
- // Save the hash after successful publish
677
- savePackageHashForPublish(selectedPackage.path, selectedPackage.name);
678
-
679
- console.log(chalk.green(`\nšŸŽ‰ ${selectedPackage.name} v${newVersion} published successfully!`));
680
- } finally {
681
- // Always restore workspace dependencies
682
- restoreWorkspaceDependenciesAfterPublish(selectedPackage.path);
683
- }
684
-
685
- return;
686
- }
687
-
688
- if (action === 'publish-prerelease') {
689
- const { tag } = await inquirer.prompt([
690
- {
691
- type: 'list',
692
- name: 'tag',
693
- message: 'Select prerelease tag:',
694
- choices: ['beta', 'alpha', 'rc', 'next']
695
- }
696
- ]);
697
-
698
- const { versionType } = await inquirer.prompt([
699
- {
700
- type: 'list',
701
- name: 'versionType',
702
- message: 'Version bump type:',
703
- choices: [
704
- { name: `Prerelease (${tag})`, value: tag },
705
- { name: 'Patch (1.0.0 -> 1.0.1)', value: 'patch' },
706
- { name: 'Minor (1.0.0 -> 1.1.0)', value: 'minor' },
707
- { name: 'Major (1.0.0 -> 2.0.0)', value: 'major' },
708
- { name: 'Custom version', value: 'custom' }
709
- ]
710
- }
711
- ]);
712
-
713
- // Get all package versions for dependency resolution
714
- const packageVersions = {};
715
- packages.forEach(pkg => {
716
- const currentVersion = getCurrentVersion(pkg.path);
717
- packageVersions[pkg.name] = currentVersion;
718
- });
719
-
720
- // Track which packages actually need to be published
721
- const packagesToPublish = [];
722
-
723
- // Check for meaningful changes in each package
724
- for (const pkg of packages) {
725
- if (!fs.existsSync(path.join(getWorkspaceRoot(), pkg.path))) {
726
- console.log(chalk.yellow(`āš ļø Package ${pkg.name} directory not found, skipping...`));
727
- continue;
728
- }
729
-
730
- if (hasMeaningfulChangesForPublish(pkg.path, pkg.name)) {
731
- packagesToPublish.push(pkg);
732
- console.log(chalk.blue(`\nšŸ“¦ ${pkg.name} has changes, will be published`));
733
- } else {
734
- console.log(chalk.gray(`\nā­ļø ${pkg.name} has no meaningful changes, skipping...`));
735
- }
736
- }
737
-
738
- if (packagesToPublish.length === 0) {
739
- console.log(chalk.green('\nāœ… No packages have meaningful changes. Nothing to publish!'));
740
- return;
741
- }
742
-
743
- // Process each package that has changes
744
- for (const pkg of packagesToPublish) {
745
- let newVersion;
746
- const currentVersion = getCurrentVersion(pkg.path);
747
-
748
- if (versionType === 'custom') {
749
- const { customVersion } = await inquirer.prompt([
750
- {
751
- type: 'input',
752
- name: 'customVersion',
753
- message: `Enter version for ${pkg.name} (current: ${currentVersion}):`,
754
- default: currentVersion
755
- }
756
- ]);
757
- newVersion = customVersion;
758
- } else {
759
- newVersion = getNextAvailableVersion(pkg.name, currentVersion, versionType);
760
- }
761
-
762
- // Update package version in our tracking
763
- packageVersions[pkg.name] = newVersion;
764
-
765
- // Fix workspace dependencies before publishing
766
- fixWorkspaceDependenciesForPublish(pkg.path, packageVersions);
767
-
768
- try {
769
- updateVersion(pkg.path, newVersion);
770
- // Only build if not disabled
771
- if (!noBuild) {
772
- buildPackage(pkg);
773
- }
774
- publishPackage(pkg.path, pkg.name, tag);
775
-
776
- // Save the hash after successful publish
777
- savePackageHashForPublish(pkg.path, pkg.name);
778
- } finally {
779
- // Always restore workspace dependencies
780
- restoreWorkspaceDependenciesAfterPublish(pkg.path);
781
- }
782
- }
783
-
784
- console.log(chalk.green(`\nšŸŽ‰ ${packagesToPublish.length} package(s) published with ${tag} tag!`));
785
- return;
786
- }
787
-
788
- if (action === 'publish-all') {
789
- // Check if we're on master branch for final release
790
- let isMasterBranch = false;
791
- try {
792
- const branch = execSync('git branch --show-current', { encoding: 'utf8' }).trim();
793
- isMasterBranch = branch === 'master' || branch === 'main';
794
- } catch (error) {
795
- console.log(chalk.yellow('āš ļø Unable to determine current branch'));
796
- }
797
-
798
- const { versionType } = await inquirer.prompt([
799
- {
800
- type: 'list',
801
- name: 'versionType',
802
- message: 'Version bump type:',
803
- choices: [
804
- { name: `Beta ${isMasterBranch ? '(will publish as final)' : '(will publish as beta)'}`, value: 'beta' },
805
- { name: 'Patch (1.0.0 -> 1.0.1)', value: 'patch' },
806
- { name: 'Minor (1.0.0 -> 1.1.0)', value: 'minor' },
807
- { name: 'Major (1.0.0 -> 2.0.0)', value: 'major' },
808
- { name: 'Custom version', value: 'custom' }
809
- ]
810
- }
811
- ]);
812
-
813
- // Get all package versions for dependency resolution
814
- const packageVersions = {};
815
- const originalVersions = {};
816
-
817
- packages.forEach(pkg => {
818
- const currentVersion = getCurrentVersion(pkg.path);
819
- originalVersions[pkg.name] = currentVersion;
820
- packageVersions[pkg.name] = currentVersion;
821
- });
822
-
823
- let baseVersion;
824
- if (versionType === 'custom') {
825
- const { customVersion } = await inquirer.prompt([
826
- {
827
- type: 'input',
828
- name: 'customVersion',
829
- message: 'Enter new version for all packages:',
830
- validate: (input) => {
831
- const semverRegex = /^\d+\.\d+\.\d+$/;
832
- return semverRegex.test(input) || 'Please enter a valid semver version (e.g., 1.0.0)';
833
- }
834
- }
835
- ]);
836
- baseVersion = customVersion;
837
- } else {
838
- // Use the highest current version as base and increment
839
- const nextVersion = getNextAvailableVersion(packages[0].name, originalVersions[packages[0].name], versionType);
840
- baseVersion = nextVersion;
841
- }
842
-
843
- console.log(chalk.cyan(`\nšŸ“‹ Will publish all packages with version: ${baseVersion}\n`));
844
-
845
- const { confirm } = await inquirer.prompt([
846
- {
847
- type: 'confirm',
848
- name: 'confirm',
849
- message: 'Are you sure you want to proceed?',
850
- default: false
851
- }
852
- ]);
853
-
854
- if (!confirm) {
855
- console.log(chalk.yellow('Operation cancelled.'));
856
- return;
857
- }
858
-
859
- // Track which packages actually need to be published
860
- const packagesToPublish = [];
861
-
862
- // Check for meaningful changes in each package
863
- for (const pkg of packages) {
864
- if (!fs.existsSync(path.join(getWorkspaceRoot(), pkg.path))) {
865
- console.log(chalk.yellow(`āš ļø Package ${pkg.name} directory not found, skipping...`));
866
- continue;
867
- }
868
-
869
- if (hasMeaningfulChangesForPublish(pkg.path, pkg.name)) {
870
- packagesToPublish.push(pkg);
871
- console.log(chalk.blue(`\nšŸ“¦ ${pkg.name} has changes, will be published`));
872
- } else {
873
- console.log(chalk.gray(`\nā­ļø ${pkg.name} has no meaningful changes, skipping...`));
874
- }
875
- }
876
-
877
- if (packagesToPublish.length === 0) {
878
- console.log(chalk.green('\nāœ… No packages have meaningful changes. Nothing to publish!'));
879
- return;
880
- }
881
-
882
- // Update versions, build and publish only packages with changes
883
- for (const pkg of packagesToPublish) {
884
- console.log(chalk.blue(`\nšŸ“¦ Processing ${pkg.name}...`));
885
-
886
- // For publish-all, we use the same version for all packages
887
- const pkgVersion = baseVersion;
888
- packageVersions[pkg.name] = pkgVersion;
889
-
890
- // Fix workspace dependencies before publishing
891
- fixWorkspaceDependenciesForPublish(pkg.path, packageVersions);
892
-
893
- try {
894
- updateVersion(pkg.path, pkgVersion);
895
- // Only build if not disabled
896
- if (!noBuild) {
897
- buildPackage(pkg);
898
- }
899
-
900
- // Determine tag based on version type and branch
901
- const tag = (versionType === 'beta' && !isMasterBranch) ? 'beta' : 'latest';
902
- publishPackage(pkg.path, pkg.name, tag);
903
-
904
- // Save the hash after successful publish
905
- savePackageHashForPublish(pkg.path, pkg.name);
906
- } finally {
907
- // Always restore workspace dependencies
908
- restoreWorkspaceDependenciesAfterPublish(pkg.path);
909
- }
910
- }
911
-
912
- // Create GitHub release if on master and we actually published something
913
- if (isMasterBranch && packagesToPublish.length > 0) {
914
- const tagName = `v${baseVersion}`;
915
- const releaseNotes = `Release ${baseVersion}
916
-
917
- Packages released:
918
- ${Object.entries(packageVersions).map(([name, version]) => `- ${name}@${version}`).join('\n')}`;
919
- createGitHubRelease(tagName, releaseNotes);
920
- }
921
-
922
- console.log(chalk.green(`\nšŸŽ‰ ${packagesToPublish.length} package(s) published successfully with version ${baseVersion}!`));
923
- console.log(chalk.cyan('\nšŸ“‹ Next steps:'));
924
- console.log(chalk.gray('1. Create a git tag: git tag v' + baseVersion));
925
- console.log(chalk.gray('2. Push changes: git push && git push --tags'));
926
- }
927
- }
928
-
929
- // Main function
930
- async function main() {
931
- // Check command line arguments
932
- const args = process.argv.slice(2);
933
-
934
- if (args.includes('--publish')) {
935
- // When called with --publish, start the publish process
936
- console.log(chalk.blue('šŸ—ļø ReactPress Package Builder\n'));
937
-
938
- // Show current versions
939
- console.log(chalk.cyan('šŸ“‹ Current package versions:'));
940
- packages.forEach(pkg => {
941
- const version = getCurrentVersion(pkg.path);
942
- console.log(chalk.gray(` ${pkg.name}: ${version}`));
943
- });
944
- console.log();
945
-
946
- // Start the publish process
947
- await publishPackages();
948
- } else if (args.includes('--build')) {
949
- // When called with --build, just build packages
950
- await buildPackages();
951
- } else {
952
- // Default behavior - show help
953
- console.log(chalk.blue('šŸ—ļø ReactPress CLI\n'));
954
- console.log('Usage:');
955
- console.log(' reactpress publish --build Build all packages');
956
- console.log(' reactpress publish --publish Publish packages (interactive)');
957
- console.log('');
958
- }
959
- }
960
-
961
- module.exports = { main, buildPackages, publishPackages };
962
-
963
- if (require.main === module) {
964
- main().catch((error) => {
965
- console.error(chalk.red('āŒ Operation failed:'), error);
966
- process.exit(1);
967
- });
968
- }