@fecommunity/reactpress 4.0.0-beta.1 → 4.0.0-beta.10

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 (955) hide show
  1. package/dist/utils/server-bundle.js +7 -0
  2. package/out/bin/reactpress-theme-client.js +64 -1
  3. package/out/bin/reactpress.js +94 -514
  4. package/out/core/services/config.js +4 -1
  5. package/out/core/services/database/index.js +18 -5
  6. package/out/core/services/database/sqlite.js +28 -5
  7. package/out/core/services/init.js +1 -53
  8. package/out/core/services/local-site.js +15 -10
  9. package/out/core/services/theme-bootstrap.js +50 -0
  10. package/out/core/utils/env-file.js +99 -0
  11. package/out/core/utils/paths.js +5 -4
  12. package/out/lib/api-dev.js +11 -1
  13. package/out/lib/bootstrap.js +13 -40
  14. package/out/lib/cli-events.js +54 -0
  15. package/out/lib/command-palette.js +53 -0
  16. package/out/lib/context-status.js +154 -0
  17. package/out/lib/create-site.js +187 -0
  18. package/out/lib/database-mode.js +45 -0
  19. package/out/lib/design-tokens.js +55 -0
  20. package/out/lib/dev-banner.js +10 -5
  21. package/out/lib/dev-session.js +9 -2
  22. package/out/lib/dev.js +68 -25
  23. package/out/lib/docker.js +12 -0
  24. package/out/lib/doctor.js +131 -10
  25. package/out/lib/http.js +20 -0
  26. package/out/lib/i18n/index.js +5 -1
  27. package/out/lib/i18n/strings.js +161 -81
  28. package/out/lib/lifecycle.js +21 -1
  29. package/out/lib/menu-actions.js +418 -0
  30. package/out/lib/nginx.js +5 -2
  31. package/out/lib/paths.js +11 -0
  32. package/out/lib/pm2.js +9 -2
  33. package/out/lib/ports.js +134 -13
  34. package/out/lib/publish.js +3 -0
  35. package/out/lib/remote-dev.js +5 -1
  36. package/out/lib/server-bundle.js +84 -0
  37. package/out/lib/shell-mode.js +23 -0
  38. package/out/lib/theme-warmup.js +1 -1
  39. package/out/shell/app.js +384 -0
  40. package/out/shell/components/brand-banner.js +93 -0
  41. package/out/shell/components/command-palette.js +77 -0
  42. package/out/shell/components/dev-stepper.js +54 -0
  43. package/out/shell/components/ink-theme.js +86 -0
  44. package/out/shell/components/menu-list.js +49 -0
  45. package/out/shell/components/pulse-bar.js +55 -0
  46. package/out/shell/components/status-rack.js +47 -0
  47. package/out/shell/hooks/use-terminal-size.js +27 -0
  48. package/out/shell/ink-shell.mjs +12056 -0
  49. package/out/shell/lib/shell-layout.js +60 -0
  50. package/out/shell/runtime/render-ink.js +89 -0
  51. package/out/ui/banner-startup.js +117 -0
  52. package/out/ui/banner.js +404 -277
  53. package/out/ui/interactive.js +149 -125
  54. package/out/ui/startup-splash.js +185 -0
  55. package/out/ui/theme.js +62 -10
  56. package/package.json +5 -3
  57. package/server/bin/reactpress-server.js +10 -2
  58. package/server/dist/app.module.js +13 -25
  59. package/server/dist/filters/http-exception.filter.js +1 -1
  60. package/server/dist/generate-swagger.js +12 -11
  61. package/server/dist/interceptors/transform.interceptor.js +10 -5
  62. package/server/dist/logger/index.js +5 -4
  63. package/server/dist/main.js +45 -23
  64. package/server/dist/modules/article/article.controller.js +103 -48
  65. package/server/dist/modules/article/article.entity.js +61 -41
  66. package/server/dist/modules/article/article.module.js +18 -3
  67. package/server/dist/modules/article/article.service.js +151 -29
  68. package/server/dist/modules/auth/auth.controller.js +11 -11
  69. package/server/dist/modules/auth/auth.module.js +4 -4
  70. package/server/dist/modules/auth/auth.service.js +8 -7
  71. package/server/dist/modules/auth/jwt-auth.guard.js +4 -3
  72. package/server/dist/modules/auth/jwt.strategy.js +4 -3
  73. package/server/dist/modules/auth/roles.guard.js +2 -2
  74. package/server/dist/modules/category/category.controller.js +21 -20
  75. package/server/dist/modules/category/category.entity.js +13 -13
  76. package/server/dist/modules/category/category.module.js +1 -1
  77. package/server/dist/modules/category/category.service.js +5 -4
  78. package/server/dist/modules/comment/comment.controller.js +24 -20
  79. package/server/dist/modules/comment/comment.entity.js +31 -31
  80. package/server/dist/modules/comment/comment.module.js +11 -2
  81. package/server/dist/modules/comment/comment.service.js +43 -16
  82. package/server/dist/modules/comment/html.js +3 -3
  83. package/server/dist/modules/file/file.controller.js +22 -20
  84. package/server/dist/modules/file/file.entity.js +20 -15
  85. package/server/dist/modules/file/file.module.js +16 -4
  86. package/server/dist/modules/file/file.service.js +70 -24
  87. package/server/dist/modules/install/install.controller.js +5 -5
  88. package/server/dist/modules/install/install.module.js +1 -1
  89. package/server/dist/modules/install/install.service.js +2 -2
  90. package/server/dist/modules/knowledge/knowledge.controller.js +35 -33
  91. package/server/dist/modules/knowledge/knowledge.entity.js +33 -33
  92. package/server/dist/modules/knowledge/knowledge.module.js +1 -1
  93. package/server/dist/modules/knowledge/knowledge.service.js +12 -11
  94. package/server/dist/modules/page/page.controller.js +24 -23
  95. package/server/dist/modules/page/page.entity.js +27 -27
  96. package/server/dist/modules/page/page.module.js +1 -1
  97. package/server/dist/modules/page/page.service.js +12 -12
  98. package/server/dist/modules/search/search.controller.js +12 -12
  99. package/server/dist/modules/search/search.entity.js +13 -13
  100. package/server/dist/modules/search/search.module.js +1 -1
  101. package/server/dist/modules/search/search.service.js +2 -2
  102. package/server/dist/modules/setting/setting.constant.js +3 -19
  103. package/server/dist/modules/setting/setting.controller.js +11 -11
  104. package/server/dist/modules/setting/setting.entity.js +64 -49
  105. package/server/dist/modules/setting/setting.module.js +2 -2
  106. package/server/dist/modules/setting/setting.service.js +169 -24
  107. package/server/dist/modules/smtp/mail.util.js +5 -9
  108. package/server/dist/modules/smtp/smtp.controller.js +27 -14
  109. package/server/dist/modules/smtp/smtp.entity.js +15 -15
  110. package/server/dist/modules/smtp/smtp.module.js +2 -2
  111. package/server/dist/modules/smtp/smtp.service.js +40 -12
  112. package/server/dist/modules/tag/tag.controller.js +24 -22
  113. package/server/dist/modules/tag/tag.entity.js +12 -12
  114. package/server/dist/modules/tag/tag.module.js +1 -1
  115. package/server/dist/modules/tag/tag.service.js +5 -4
  116. package/server/dist/modules/user/user.controller.js +39 -28
  117. package/server/dist/modules/user/user.entity.js +22 -22
  118. package/server/dist/modules/user/user.module.js +2 -2
  119. package/server/dist/modules/user/user.service.js +16 -12
  120. package/server/dist/modules/view/view.controller.js +20 -19
  121. package/server/dist/modules/view/view.entity.js +24 -24
  122. package/server/dist/modules/view/view.module.js +1 -1
  123. package/server/dist/modules/view/view.service.js +4 -4
  124. package/server/dist/starter.js +202 -14
  125. package/server/dist/utils/date.util.js +1 -1
  126. package/server/dist/utils/markdown.util.js +1 -1
  127. package/server/dist/utils/oss/aliyun-oss-client.js +5 -0
  128. package/server/dist/utils/oss.util.js +6 -1
  129. package/server/dist/utils/theme-placeholder-cover.js +94 -0
  130. package/server/dist/utils/uniqueid.util.js +1 -1
  131. package/server/dist/utils/upload.util.js +23 -8
  132. package/server/dist/utils/user.util.js +6 -2
  133. package/server/package-lock.json +21077 -0
  134. package/server/package.json +13 -10
  135. package/server/public/favicon.png +0 -0
  136. package/templates/config.local.json +1 -1
  137. package/templates/env.local.default +1 -1
  138. package/toolkit/dist/.source-fingerprint-toolkit +1 -0
  139. package/toolkit/dist/admin/index.js +18 -0
  140. package/toolkit/dist/admin/permissions.js +33 -0
  141. package/toolkit/dist/admin/registry.js +79 -0
  142. package/toolkit/dist/api/Article.js +188 -0
  143. package/toolkit/dist/api/Auth.js +58 -0
  144. package/toolkit/dist/api/Category.js +84 -0
  145. package/toolkit/dist/api/Comment.js +97 -0
  146. package/toolkit/dist/api/File.js +71 -0
  147. package/toolkit/dist/api/HttpClient.js +96 -0
  148. package/toolkit/dist/api/Knowledge.js +123 -0
  149. package/toolkit/dist/api/Page.js +97 -0
  150. package/toolkit/dist/api/Search.js +58 -0
  151. package/toolkit/dist/api/Setting.js +45 -0
  152. package/toolkit/dist/api/Smtp.js +73 -0
  153. package/toolkit/dist/api/Tag.js +97 -0
  154. package/toolkit/dist/api/User.js +72 -0
  155. package/toolkit/dist/api/View.js +84 -0
  156. package/toolkit/dist/api/index.js +30 -0
  157. package/toolkit/dist/api/instance.js +71 -0
  158. package/toolkit/dist/app/createReactPressApp.js +265 -0
  159. package/toolkit/dist/app/createThemeApp.js +51 -0
  160. package/toolkit/dist/app/devChunkRecovery.js +68 -0
  161. package/toolkit/dist/app/index.js +11 -0
  162. package/toolkit/dist/config/env.js +103 -0
  163. package/toolkit/dist/config/global.js +396 -0
  164. package/toolkit/dist/config/i18n.js +59 -0
  165. package/toolkit/dist/config/index.js +26 -0
  166. package/toolkit/dist/config/locales/en.json +125 -0
  167. package/toolkit/dist/config/locales/zh.json +125 -0
  168. package/toolkit/dist/dev/index.js +12 -0
  169. package/toolkit/dist/dev/portRedirect.js +93 -0
  170. package/toolkit/dist/dev/vitePortRedirectPlugin.js +40 -0
  171. package/toolkit/dist/extension/branding-mods.js +65 -0
  172. package/toolkit/dist/extension/configuration/defaults.js +32 -0
  173. package/toolkit/dist/extension/configuration/formily.js +170 -0
  174. package/toolkit/dist/extension/configuration/index.js +28 -0
  175. package/toolkit/dist/extension/configuration/paths.js +50 -0
  176. package/toolkit/dist/extension/configuration/presets/twentytwentyfive.js +94 -0
  177. package/toolkit/dist/extension/configuration/resolve.js +98 -0
  178. package/toolkit/dist/extension/configuration/types.js +3 -0
  179. package/toolkit/dist/extension/configuration/validate.js +21 -0
  180. package/toolkit/dist/extension/index.js +35 -0
  181. package/toolkit/dist/extension/manifest-normalize.js +75 -0
  182. package/toolkit/dist/extension/node.js +6 -0
  183. package/toolkit/dist/extension/presets/twentytwentyfive-appearance.js +193 -0
  184. package/toolkit/dist/extension/presets/twentytwentyfive-customizer.js +199 -0
  185. package/toolkit/dist/extension/preview.js +92 -0
  186. package/toolkit/dist/extension/site-notices.js +88 -0
  187. package/toolkit/dist/extension/site-settings.js +144 -0
  188. package/toolkit/dist/extension/theme-admin-locale.io.js +54 -0
  189. package/toolkit/dist/extension/theme-admin-locale.js +81 -0
  190. package/toolkit/dist/extension/theme.js +93 -0
  191. package/toolkit/dist/extension/twentytwentyfive-vars.js +100 -0
  192. package/toolkit/dist/index.js +60 -0
  193. package/toolkit/dist/plugin/admin/index.js +20 -0
  194. package/toolkit/dist/plugin/admin/permissions.js +33 -0
  195. package/toolkit/dist/plugin/admin/plugin-admin.js +41 -0
  196. package/toolkit/dist/plugin/admin/registry.js +79 -0
  197. package/toolkit/dist/plugin/admin/slots.js +16 -0
  198. package/toolkit/dist/plugin/client/client.js +95 -0
  199. package/toolkit/dist/plugin/client/index.js +11 -0
  200. package/toolkit/dist/plugin/client/runtime.js +30 -0
  201. package/toolkit/dist/plugin/dev/index.js +16 -0
  202. package/toolkit/dist/plugin/dev/portRedirect.js +111 -0
  203. package/toolkit/dist/plugin/dev/vitePortRedirectPlugin.js +40 -0
  204. package/toolkit/dist/plugin/extension/index.js +20 -0
  205. package/toolkit/dist/plugin/extension/plugin-admin-locale.io.js +54 -0
  206. package/toolkit/dist/plugin/extension/plugin-admin-locale.js +60 -0
  207. package/toolkit/dist/plugin/extension/plugin.js +146 -0
  208. package/toolkit/dist/plugin/extension/security.js +74 -0
  209. package/toolkit/dist/plugin/extension/validate.js +55 -0
  210. package/toolkit/dist/plugin/index.js +52 -0
  211. package/toolkit/dist/plugin/node.js +6 -0
  212. package/toolkit/dist/plugin/react/client.js +95 -0
  213. package/toolkit/dist/plugin/react/index.js +19 -0
  214. package/toolkit/dist/plugin/react/plugin-admin-ui.js +38 -0
  215. package/toolkit/dist/plugin/react/runtime.js +30 -0
  216. package/toolkit/dist/plugin/server/hook-reject.js +39 -0
  217. package/toolkit/dist/plugin/server/index.js +18 -0
  218. package/toolkit/dist/plugin/server/types.js +3 -0
  219. package/toolkit/dist/primitives/AntdStyleTransitionFix.js +16 -0
  220. package/toolkit/dist/primitives/Badge.js +9 -0
  221. package/toolkit/dist/primitives/Button.js +38 -0
  222. package/toolkit/dist/primitives/ColorModeToggle.js +13 -0
  223. package/toolkit/dist/primitives/IconButton.js +13 -0
  224. package/toolkit/dist/primitives/ScrollToTarget.js +48 -0
  225. package/toolkit/dist/primitives/Separator.js +9 -0
  226. package/toolkit/dist/primitives/Skeleton.js +9 -0
  227. package/toolkit/dist/primitives/Slot.js +25 -0
  228. package/toolkit/dist/primitives/Spinner.js +9 -0
  229. package/toolkit/dist/primitives/animation/ConditionTransition.js +13 -0
  230. package/toolkit/dist/primitives/animation/ListTrail.js +14 -0
  231. package/toolkit/dist/primitives/animation/Opacity.js +10 -0
  232. package/toolkit/dist/primitives/animation/Spring.js +29 -0
  233. package/toolkit/dist/primitives/animation/index.js +11 -0
  234. package/toolkit/dist/primitives/cn.js +7 -0
  235. package/toolkit/dist/primitives/icons.js +15 -0
  236. package/toolkit/dist/primitives/index.js +44 -0
  237. package/toolkit/dist/react/client.js +95 -0
  238. package/toolkit/dist/react/index.js +11 -0
  239. package/toolkit/dist/react/runtime.js +30 -0
  240. package/toolkit/dist/theme/antdDocument.js +59 -0
  241. package/toolkit/dist/theme/api/api-data.js +8 -0
  242. package/toolkit/dist/theme/api/api.js +27 -0
  243. package/toolkit/dist/theme/api/httpClient.js +83 -0
  244. package/toolkit/dist/theme/api/json.js +5 -0
  245. package/toolkit/dist/theme/api/jsonp.js +5 -0
  246. package/toolkit/dist/theme/api-data.js +22 -0
  247. package/toolkit/dist/theme/api.js +27 -0
  248. package/toolkit/dist/theme/appearance.js +16 -0
  249. package/toolkit/dist/theme/assets.js +27 -0
  250. package/toolkit/dist/theme/authSession.js +92 -0
  251. package/toolkit/dist/theme/build/antdDocument.js +70 -0
  252. package/toolkit/dist/theme/build/next-config.js +63 -0
  253. package/toolkit/dist/theme/build/node.js +6 -0
  254. package/toolkit/dist/theme/colorMode.js +45 -0
  255. package/toolkit/dist/theme/commentAuthor.js +48 -0
  256. package/toolkit/dist/theme/content/archiveSlim.js +38 -0
  257. package/toolkit/dist/theme/content/articleSlim.js +35 -0
  258. package/toolkit/dist/theme/content/assets.js +106 -0
  259. package/toolkit/dist/theme/content/carouselArticles.js +39 -0
  260. package/toolkit/dist/theme/content/excerpt.js +42 -0
  261. package/toolkit/dist/theme/content/nav.js +30 -0
  262. package/toolkit/dist/theme/content/seo.js +12 -0
  263. package/toolkit/dist/theme/createAntdApp.js +175 -0
  264. package/toolkit/dist/theme/createApp.js +141 -0
  265. package/toolkit/dist/theme/createCatalogApp.js +168 -0
  266. package/toolkit/dist/theme/customizer.js +5 -0
  267. package/toolkit/dist/theme/excerpt.js +31 -0
  268. package/toolkit/dist/theme/extension/branding-mods.js +65 -0
  269. package/toolkit/dist/theme/extension/configuration/defaults.js +32 -0
  270. package/toolkit/dist/theme/extension/configuration/formily.js +170 -0
  271. package/toolkit/dist/theme/extension/configuration/index.js +28 -0
  272. package/toolkit/dist/theme/extension/configuration/paths.js +7 -0
  273. package/toolkit/dist/theme/extension/configuration/presets/twentytwentyfive.js +94 -0
  274. package/toolkit/dist/theme/extension/configuration/resolve.js +98 -0
  275. package/toolkit/dist/theme/extension/configuration/types.js +3 -0
  276. package/toolkit/dist/theme/extension/configuration/validate.js +21 -0
  277. package/toolkit/dist/theme/extension/index.js +38 -0
  278. package/toolkit/dist/theme/extension/manifest-normalize.js +75 -0
  279. package/toolkit/dist/theme/extension/presets/twentytwentyfive-appearance.js +193 -0
  280. package/toolkit/dist/theme/extension/preview.js +92 -0
  281. package/toolkit/dist/theme/extension/site-notices.js +88 -0
  282. package/toolkit/dist/theme/extension/site-settings.js +144 -0
  283. package/toolkit/dist/theme/extension/siteNav.js +17 -0
  284. package/toolkit/dist/theme/extension/theme-admin-locale.io.js +54 -0
  285. package/toolkit/dist/theme/extension/theme-admin-locale.js +68 -0
  286. package/toolkit/dist/theme/extension/theme.js +93 -0
  287. package/toolkit/dist/theme/extension/twentytwentyfive-vars.js +103 -0
  288. package/toolkit/dist/theme/fetch.js +241 -0
  289. package/toolkit/dist/theme/format.js +48 -0
  290. package/toolkit/dist/theme/httpClient.js +89 -0
  291. package/toolkit/dist/theme/index.js +226 -0
  292. package/toolkit/dist/theme/json.js +17 -0
  293. package/toolkit/dist/theme/jsonp.js +27 -0
  294. package/toolkit/dist/theme/locale.js +55 -0
  295. package/toolkit/dist/theme/nav.js +30 -0
  296. package/toolkit/dist/theme/next-config.js +18 -0
  297. package/toolkit/dist/theme/node.js +18 -0
  298. package/toolkit/dist/theme/preview/preview-config.js +65 -0
  299. package/toolkit/dist/theme/preview/preview-draft.js +51 -0
  300. package/toolkit/dist/theme/preview/preview-mods.js +78 -0
  301. package/toolkit/dist/theme/preview-config.js +65 -0
  302. package/toolkit/dist/theme/preview-draft.js +51 -0
  303. package/toolkit/dist/theme/preview-mods.js +78 -0
  304. package/toolkit/dist/theme/providers/index.js +251 -0
  305. package/toolkit/dist/theme/providers/setup.js +29 -0
  306. package/toolkit/dist/theme/runtime.js +19 -0
  307. package/toolkit/dist/theme/seo.js +12 -0
  308. package/toolkit/dist/theme/server.js +177 -0
  309. package/toolkit/dist/theme/setting.js +42 -0
  310. package/toolkit/dist/theme/ssr/bootstrap.js +112 -0
  311. package/toolkit/dist/theme/ssr/fetch.js +264 -0
  312. package/toolkit/dist/theme/ssr/format.js +8 -0
  313. package/toolkit/dist/theme/ssr/pageProps.js +155 -0
  314. package/toolkit/dist/theme/ssr/setting.js +45 -0
  315. package/toolkit/dist/theme/ssr/slimBootstrap.js +75 -0
  316. package/toolkit/dist/theme/ssr/static.js +17 -0
  317. package/toolkit/dist/theme/ssr/templates.js +50 -0
  318. package/toolkit/dist/theme/static.js +17 -0
  319. package/toolkit/dist/theme/templates.js +38 -0
  320. package/toolkit/dist/theme/ui-optional.js +21 -0
  321. package/toolkit/dist/theme/visitor/appearance.js +16 -0
  322. package/toolkit/dist/theme/visitor/authSession.js +92 -0
  323. package/toolkit/dist/theme/visitor/colorMode.js +59 -0
  324. package/toolkit/dist/theme/visitor/commentAuthor.js +45 -0
  325. package/toolkit/dist/theme/visitor/i18n.js +28 -0
  326. package/toolkit/dist/theme/visitor/locale.js +72 -0
  327. package/toolkit/dist/theme/visitor/runtime.js +19 -0
  328. package/toolkit/dist/theme/visitor/visitorLocale.js +56 -0
  329. package/toolkit/dist/theme/visitorLocale.js +39 -0
  330. package/toolkit/dist/types/index.js +12 -0
  331. package/toolkit/dist/ui/AntdStyleTransitionFix.js +16 -0
  332. package/toolkit/dist/ui/ArchiveEmptyState.js +8 -0
  333. package/toolkit/dist/ui/ArchivePageLayout.js +8 -0
  334. package/toolkit/dist/ui/ArticleCard.js +16 -0
  335. package/toolkit/dist/ui/ArticleList.js +16 -0
  336. package/toolkit/dist/ui/BaseGlobalStyles.js +18 -0
  337. package/toolkit/dist/ui/LocaleSwitcher.js +15 -0
  338. package/toolkit/dist/ui/NavMenu.js +8 -0
  339. package/toolkit/dist/ui/NotFoundPanel.js +8 -0
  340. package/toolkit/dist/ui/PageHeader.js +8 -0
  341. package/toolkit/dist/ui/SiteBranding.js +14 -0
  342. package/toolkit/dist/ui/SiteDocument.js +13 -0
  343. package/toolkit/dist/ui/SiteDocumentFallback.js +9 -0
  344. package/toolkit/dist/ui/SiteLogo.js +16 -0
  345. package/toolkit/dist/ui/SiteTagline.js +15 -0
  346. package/toolkit/dist/ui/TaxonomyList.js +30 -0
  347. package/toolkit/dist/ui/ThemeCssVars.js +85 -0
  348. package/toolkit/dist/ui/ThemeLayout.js +11 -0
  349. package/toolkit/dist/ui/components/AntdStyleTransitionFix.js +16 -0
  350. package/toolkit/dist/ui/components/ArchiveEmptyState.js +8 -0
  351. package/toolkit/dist/ui/components/ArchivePageLayout.js +8 -0
  352. package/toolkit/dist/ui/components/ArticleCard.js +16 -0
  353. package/toolkit/dist/ui/components/ArticleList.js +16 -0
  354. package/toolkit/dist/ui/components/BaseGlobalStyles.js +18 -0
  355. package/toolkit/dist/ui/components/LocaleSwitcher.js +11 -0
  356. package/toolkit/dist/ui/components/NavMenu.js +8 -0
  357. package/toolkit/dist/ui/components/NotFoundPanel.js +8 -0
  358. package/toolkit/dist/ui/components/PageHeader.js +8 -0
  359. package/toolkit/dist/ui/components/RouteProgress.js +40 -0
  360. package/toolkit/dist/ui/components/SiteAnalytics.js +42 -0
  361. package/toolkit/dist/ui/components/SiteBranding.js +14 -0
  362. package/toolkit/dist/ui/components/SiteDocument.js +13 -0
  363. package/toolkit/dist/ui/components/SiteDocumentFallback.js +9 -0
  364. package/toolkit/dist/ui/components/SiteLogo.js +23 -0
  365. package/toolkit/dist/ui/components/SiteSeo.js +19 -0
  366. package/toolkit/dist/ui/components/SiteTagline.js +15 -0
  367. package/toolkit/dist/ui/components/TaxonomyList.js +30 -0
  368. package/toolkit/dist/ui/components/ThemeCssVars.js +85 -0
  369. package/toolkit/dist/ui/components/ThemeLayout.js +11 -0
  370. package/toolkit/dist/ui/components/content/ArticleReader.js +23 -0
  371. package/toolkit/dist/ui/components/content/ArticleToc.js +75 -0
  372. package/toolkit/dist/ui/components/content/HtmlContent.js +237 -0
  373. package/toolkit/dist/ui/components/content/Image.js +13 -0
  374. package/toolkit/dist/ui/components/content/ImageViewer.js +33 -0
  375. package/toolkit/dist/ui/components/content/LocaleTime.js +63 -0
  376. package/toolkit/dist/ui/components/content/index.js +18 -0
  377. package/toolkit/dist/ui/components/toolbar/LocaleToggleButton.js +18 -0
  378. package/toolkit/dist/ui/components/toolbar/ThemeToggleButton.js +10 -0
  379. package/toolkit/dist/ui/components/toolbar/ToolbarIconButton.js +22 -0
  380. package/toolkit/dist/ui/components/toolbar/constants.js +8 -0
  381. package/toolkit/dist/ui/components/toolbar/icons.js +44 -0
  382. package/toolkit/dist/ui/components/toolbar/index.js +25 -0
  383. package/toolkit/dist/ui/components/toolbar/locale-label.js +19 -0
  384. package/toolkit/dist/ui/context/LocaleContext.js +59 -0
  385. package/toolkit/dist/ui/context/ReactPressProvider.js +10 -0
  386. package/toolkit/dist/ui/context/SiteCatalogContext.js +60 -0
  387. package/toolkit/dist/ui/context/ThemeRuntimeContext.js +59 -0
  388. package/toolkit/dist/ui/context/index.js +26 -0
  389. package/toolkit/dist/ui/context/siteCatalogTypes.js +20 -0
  390. package/toolkit/dist/ui/context/types.js +2 -0
  391. package/toolkit/dist/ui/hooks/index.js +29 -0
  392. package/toolkit/dist/ui/hooks/useAsyncLoading.js +31 -0
  393. package/toolkit/dist/ui/hooks/useForceUpdate.js +11 -0
  394. package/toolkit/dist/ui/hooks/useNavActive.js +11 -0
  395. package/toolkit/dist/ui/hooks/usePagination.js +55 -0
  396. package/toolkit/dist/ui/hooks/useReportArticleView.js +40 -0
  397. package/toolkit/dist/ui/hooks/useReportPageView.js +28 -0
  398. package/toolkit/dist/ui/hooks/useRouteParam.js +15 -0
  399. package/toolkit/dist/ui/hooks/useToggle.js +17 -0
  400. package/toolkit/dist/ui/hooks/useWarningOnExit.js +59 -0
  401. package/toolkit/dist/ui/index.js +87 -0
  402. package/toolkit/dist/utils/api-envelope.js +31 -0
  403. package/toolkit/dist/utils/clipboard.js +24 -0
  404. package/toolkit/dist/utils/cookie.js +15 -0
  405. package/toolkit/dist/utils/date.js +45 -0
  406. package/toolkit/dist/utils/email.js +9 -0
  407. package/toolkit/dist/utils/error.js +26 -0
  408. package/toolkit/dist/utils/image.js +34 -0
  409. package/toolkit/dist/utils/index.js +39 -0
  410. package/toolkit/dist/utils/json.js +18 -0
  411. package/toolkit/dist/utils/jsonp.js +27 -0
  412. package/toolkit/dist/utils/object.js +63 -0
  413. package/toolkit/dist/utils/setting.js +13 -0
  414. package/toolkit/dist/utils/string.js +15 -0
  415. package/toolkit/dist/utils/viewport.js +14 -0
  416. package/toolkit/package-lock.json +452 -0
  417. package/toolkit/package.json +96 -0
  418. package/dist/cli.d.ts +0 -4
  419. package/dist/cli.d.ts.map +0 -1
  420. package/dist/cli.js.map +0 -1
  421. package/dist/commands/config.d.ts +0 -8
  422. package/dist/commands/config.d.ts.map +0 -1
  423. package/dist/commands/config.js.map +0 -1
  424. package/dist/commands/init.d.ts +0 -6
  425. package/dist/commands/init.d.ts.map +0 -1
  426. package/dist/commands/init.js.map +0 -1
  427. package/dist/commands/restart.d.ts +0 -2
  428. package/dist/commands/restart.d.ts.map +0 -1
  429. package/dist/commands/restart.js.map +0 -1
  430. package/dist/commands/start.d.ts +0 -2
  431. package/dist/commands/start.d.ts.map +0 -1
  432. package/dist/commands/start.js.map +0 -1
  433. package/dist/commands/status.d.ts +0 -2
  434. package/dist/commands/status.d.ts.map +0 -1
  435. package/dist/commands/status.js.map +0 -1
  436. package/dist/commands/stop.d.ts +0 -5
  437. package/dist/commands/stop.d.ts.map +0 -1
  438. package/dist/commands/stop.js.map +0 -1
  439. package/dist/index.d.ts +0 -3
  440. package/dist/index.d.ts.map +0 -1
  441. package/dist/index.js.map +0 -1
  442. package/dist/services/config.d.ts +0 -11
  443. package/dist/services/config.d.ts.map +0 -1
  444. package/dist/services/config.js.map +0 -1
  445. package/dist/services/database.d.ts +0 -43
  446. package/dist/services/database.d.ts.map +0 -1
  447. package/dist/services/database.js.map +0 -1
  448. package/dist/services/exec.d.ts +0 -22
  449. package/dist/services/exec.d.ts.map +0 -1
  450. package/dist/services/exec.js.map +0 -1
  451. package/dist/services/init.d.ts +0 -10
  452. package/dist/services/init.d.ts.map +0 -1
  453. package/dist/services/init.js.map +0 -1
  454. package/dist/services/process.d.ts +0 -9
  455. package/dist/services/process.d.ts.map +0 -1
  456. package/dist/services/process.js.map +0 -1
  457. package/dist/services/server-health.d.ts +0 -4
  458. package/dist/services/server-health.d.ts.map +0 -1
  459. package/dist/services/server-health.js.map +0 -1
  460. package/dist/services/server.d.ts +0 -19
  461. package/dist/services/server.d.ts.map +0 -1
  462. package/dist/services/server.js.map +0 -1
  463. package/dist/types/config.d.ts +0 -30
  464. package/dist/types/config.d.ts.map +0 -1
  465. package/dist/types/config.js.map +0 -1
  466. package/dist/utils/cli-context.d.ts +0 -4
  467. package/dist/utils/cli-context.d.ts.map +0 -1
  468. package/dist/utils/cli-context.js.map +0 -1
  469. package/dist/utils/logger.d.ts +0 -10
  470. package/dist/utils/logger.d.ts.map +0 -1
  471. package/dist/utils/logger.js.map +0 -1
  472. package/dist/utils/paths.d.ts +0 -17
  473. package/dist/utils/paths.d.ts.map +0 -1
  474. package/dist/utils/paths.js.map +0 -1
  475. package/dist/utils/platform.d.ts +0 -8
  476. package/dist/utils/platform.d.ts.map +0 -1
  477. package/dist/utils/platform.js.map +0 -1
  478. package/dist/utils/port.d.ts +0 -5
  479. package/dist/utils/port.d.ts.map +0 -1
  480. package/dist/utils/port.js.map +0 -1
  481. package/dist/utils/server-bundle.d.ts +0 -11
  482. package/dist/utils/server-bundle.d.ts.map +0 -1
  483. package/dist/utils/server-bundle.js.map +0 -1
  484. package/out/bin/reactpress-cli-shim.d.ts +0 -3
  485. package/out/bin/reactpress-cli-shim.d.ts.map +0 -1
  486. package/out/bin/reactpress-cli-shim.js.map +0 -1
  487. package/out/bin/reactpress-theme-client.d.ts +0 -3
  488. package/out/bin/reactpress-theme-client.d.ts.map +0 -1
  489. package/out/bin/reactpress-theme-client.js.map +0 -1
  490. package/out/bin/reactpress.d.ts +0 -3
  491. package/out/bin/reactpress.d.ts.map +0 -1
  492. package/out/bin/reactpress.js.map +0 -1
  493. package/out/core/services/config.d.ts +0 -12
  494. package/out/core/services/config.d.ts.map +0 -1
  495. package/out/core/services/config.js.map +0 -1
  496. package/out/core/services/database/index.d.ts +0 -17
  497. package/out/core/services/database/index.d.ts.map +0 -1
  498. package/out/core/services/database/index.js.map +0 -1
  499. package/out/core/services/database/mysql.d.ts +0 -14
  500. package/out/core/services/database/mysql.d.ts.map +0 -1
  501. package/out/core/services/database/mysql.js.map +0 -1
  502. package/out/core/services/database/profile.d.ts +0 -6
  503. package/out/core/services/database/profile.d.ts.map +0 -1
  504. package/out/core/services/database/profile.js.map +0 -1
  505. package/out/core/services/database/sqlite.d.ts +0 -10
  506. package/out/core/services/database/sqlite.d.ts.map +0 -1
  507. package/out/core/services/database/sqlite.js.map +0 -1
  508. package/out/core/services/exec.d.ts +0 -21
  509. package/out/core/services/exec.d.ts.map +0 -1
  510. package/out/core/services/exec.js.map +0 -1
  511. package/out/core/services/init.d.ts +0 -11
  512. package/out/core/services/init.d.ts.map +0 -1
  513. package/out/core/services/init.js.map +0 -1
  514. package/out/core/services/local-site.d.ts +0 -24
  515. package/out/core/services/local-site.d.ts.map +0 -1
  516. package/out/core/services/local-site.js.map +0 -1
  517. package/out/core/utils/cli-context.d.ts +0 -3
  518. package/out/core/utils/cli-context.d.ts.map +0 -1
  519. package/out/core/utils/cli-context.js.map +0 -1
  520. package/out/core/utils/paths.d.ts +0 -20
  521. package/out/core/utils/paths.d.ts.map +0 -1
  522. package/out/core/utils/paths.js.map +0 -1
  523. package/out/core/utils/platform.d.ts +0 -7
  524. package/out/core/utils/platform.d.ts.map +0 -1
  525. package/out/core/utils/platform.js.map +0 -1
  526. package/out/core/utils/port.d.ts +0 -4
  527. package/out/core/utils/port.d.ts.map +0 -1
  528. package/out/core/utils/port.js.map +0 -1
  529. package/out/lib/api-dev-runner.d.ts +0 -3
  530. package/out/lib/api-dev-runner.d.ts.map +0 -1
  531. package/out/lib/api-dev-runner.js.map +0 -1
  532. package/out/lib/api-dev.d.ts +0 -2
  533. package/out/lib/api-dev.d.ts.map +0 -1
  534. package/out/lib/api-dev.js.map +0 -1
  535. package/out/lib/bootstrap.d.ts +0 -18
  536. package/out/lib/bootstrap.d.ts.map +0 -1
  537. package/out/lib/bootstrap.js.map +0 -1
  538. package/out/lib/build.d.ts +0 -2
  539. package/out/lib/build.d.ts.map +0 -1
  540. package/out/lib/build.js.map +0 -1
  541. package/out/lib/db-backup.d.ts +0 -2
  542. package/out/lib/db-backup.d.ts.map +0 -1
  543. package/out/lib/db-backup.js.map +0 -1
  544. package/out/lib/dev-banner.d.ts +0 -2
  545. package/out/lib/dev-banner.d.ts.map +0 -1
  546. package/out/lib/dev-banner.js.map +0 -1
  547. package/out/lib/dev-child-io.d.ts +0 -2
  548. package/out/lib/dev-child-io.d.ts.map +0 -1
  549. package/out/lib/dev-child-io.js.map +0 -1
  550. package/out/lib/dev-log.d.ts +0 -2
  551. package/out/lib/dev-log.d.ts.map +0 -1
  552. package/out/lib/dev-log.js.map +0 -1
  553. package/out/lib/dev-session.d.ts +0 -2
  554. package/out/lib/dev-session.d.ts.map +0 -1
  555. package/out/lib/dev-session.js.map +0 -1
  556. package/out/lib/dev.d.ts +0 -2
  557. package/out/lib/dev.d.ts.map +0 -1
  558. package/out/lib/dev.js.map +0 -1
  559. package/out/lib/docker.d.ts +0 -2
  560. package/out/lib/docker.d.ts.map +0 -1
  561. package/out/lib/docker.js.map +0 -1
  562. package/out/lib/doctor.d.ts +0 -2
  563. package/out/lib/doctor.d.ts.map +0 -1
  564. package/out/lib/doctor.js.map +0 -1
  565. package/out/lib/health-parse.d.ts +0 -5
  566. package/out/lib/health-parse.d.ts.map +0 -1
  567. package/out/lib/health-parse.js.map +0 -1
  568. package/out/lib/health-parse.test.d.ts +0 -2
  569. package/out/lib/health-parse.test.d.ts.map +0 -1
  570. package/out/lib/health-parse.test.js.map +0 -1
  571. package/out/lib/http.d.ts +0 -2
  572. package/out/lib/http.d.ts.map +0 -1
  573. package/out/lib/http.js.map +0 -1
  574. package/out/lib/i18n/index.d.ts +0 -2
  575. package/out/lib/i18n/index.d.ts.map +0 -1
  576. package/out/lib/i18n/index.js.map +0 -1
  577. package/out/lib/i18n/strings.d.ts +0 -2
  578. package/out/lib/i18n/strings.d.ts.map +0 -1
  579. package/out/lib/i18n/strings.js.map +0 -1
  580. package/out/lib/lifecycle.d.ts +0 -2
  581. package/out/lib/lifecycle.d.ts.map +0 -1
  582. package/out/lib/lifecycle.js.map +0 -1
  583. package/out/lib/nginx.d.ts +0 -2
  584. package/out/lib/nginx.d.ts.map +0 -1
  585. package/out/lib/nginx.js.map +0 -1
  586. package/out/lib/paths.d.ts +0 -2
  587. package/out/lib/paths.d.ts.map +0 -1
  588. package/out/lib/paths.js.map +0 -1
  589. package/out/lib/plugin-build.d.ts +0 -2
  590. package/out/lib/plugin-build.d.ts.map +0 -1
  591. package/out/lib/plugin-build.js.map +0 -1
  592. package/out/lib/plugin-cli.d.ts +0 -2
  593. package/out/lib/plugin-cli.d.ts.map +0 -1
  594. package/out/lib/plugin-cli.js.map +0 -1
  595. package/out/lib/pm2.d.ts +0 -2
  596. package/out/lib/pm2.d.ts.map +0 -1
  597. package/out/lib/pm2.js.map +0 -1
  598. package/out/lib/ports.d.ts +0 -2
  599. package/out/lib/ports.d.ts.map +0 -1
  600. package/out/lib/ports.js.map +0 -1
  601. package/out/lib/process.d.ts +0 -2
  602. package/out/lib/process.d.ts.map +0 -1
  603. package/out/lib/process.js.map +0 -1
  604. package/out/lib/prod-memory.d.ts +0 -6
  605. package/out/lib/prod-memory.d.ts.map +0 -1
  606. package/out/lib/prod-memory.js.map +0 -1
  607. package/out/lib/project-type.d.ts +0 -2
  608. package/out/lib/project-type.d.ts.map +0 -1
  609. package/out/lib/project-type.js.map +0 -1
  610. package/out/lib/publish.d.ts +0 -3
  611. package/out/lib/publish.d.ts.map +0 -1
  612. package/out/lib/publish.js.map +0 -1
  613. package/out/lib/remote-dev.d.ts +0 -2
  614. package/out/lib/remote-dev.d.ts.map +0 -1
  615. package/out/lib/remote-dev.js.map +0 -1
  616. package/out/lib/root.d.ts +0 -2
  617. package/out/lib/root.d.ts.map +0 -1
  618. package/out/lib/root.js.map +0 -1
  619. package/out/lib/spawn.d.ts +0 -2
  620. package/out/lib/spawn.d.ts.map +0 -1
  621. package/out/lib/spawn.js.map +0 -1
  622. package/out/lib/status.d.ts +0 -2
  623. package/out/lib/status.d.ts.map +0 -1
  624. package/out/lib/status.js.map +0 -1
  625. package/out/lib/theme-catalog.d.ts +0 -2
  626. package/out/lib/theme-catalog.d.ts.map +0 -1
  627. package/out/lib/theme-catalog.js.map +0 -1
  628. package/out/lib/theme-cli.d.ts +0 -2
  629. package/out/lib/theme-cli.d.ts.map +0 -1
  630. package/out/lib/theme-cli.js.map +0 -1
  631. package/out/lib/theme-dev.d.ts +0 -2
  632. package/out/lib/theme-dev.d.ts.map +0 -1
  633. package/out/lib/theme-dev.js.map +0 -1
  634. package/out/lib/theme-env.d.ts +0 -2
  635. package/out/lib/theme-env.d.ts.map +0 -1
  636. package/out/lib/theme-env.js.map +0 -1
  637. package/out/lib/theme-install.d.ts +0 -2
  638. package/out/lib/theme-install.d.ts.map +0 -1
  639. package/out/lib/theme-install.js.map +0 -1
  640. package/out/lib/theme-lock.d.ts +0 -2
  641. package/out/lib/theme-lock.d.ts.map +0 -1
  642. package/out/lib/theme-lock.js.map +0 -1
  643. package/out/lib/theme-paths.d.ts +0 -2
  644. package/out/lib/theme-paths.d.ts.map +0 -1
  645. package/out/lib/theme-paths.js.map +0 -1
  646. package/out/lib/theme-placeholder-cover.d.ts +0 -13
  647. package/out/lib/theme-placeholder-cover.d.ts.map +0 -1
  648. package/out/lib/theme-placeholder-cover.js.map +0 -1
  649. package/out/lib/theme-preview-frame.d.ts +0 -2
  650. package/out/lib/theme-preview-frame.d.ts.map +0 -1
  651. package/out/lib/theme-preview-frame.js.map +0 -1
  652. package/out/lib/theme-preview-pool.d.ts +0 -2
  653. package/out/lib/theme-preview-pool.d.ts.map +0 -1
  654. package/out/lib/theme-preview-pool.js.map +0 -1
  655. package/out/lib/theme-preview-proxy.d.ts +0 -2
  656. package/out/lib/theme-preview-proxy.d.ts.map +0 -1
  657. package/out/lib/theme-preview-proxy.js.map +0 -1
  658. package/out/lib/theme-prod.d.ts +0 -2
  659. package/out/lib/theme-prod.d.ts.map +0 -1
  660. package/out/lib/theme-prod.js.map +0 -1
  661. package/out/lib/theme-registry.d.ts +0 -2
  662. package/out/lib/theme-registry.d.ts.map +0 -1
  663. package/out/lib/theme-registry.js.map +0 -1
  664. package/out/lib/theme-runtime.d.ts +0 -2
  665. package/out/lib/theme-runtime.d.ts.map +0 -1
  666. package/out/lib/theme-runtime.js.map +0 -1
  667. package/out/lib/theme-sources.d.ts +0 -2
  668. package/out/lib/theme-sources.d.ts.map +0 -1
  669. package/out/lib/theme-sources.js.map +0 -1
  670. package/out/lib/theme-warmup.d.ts +0 -2
  671. package/out/lib/theme-warmup.d.ts.map +0 -1
  672. package/out/lib/theme-warmup.js.map +0 -1
  673. package/out/lib/toolkit-build.d.ts +0 -2
  674. package/out/lib/toolkit-build.d.ts.map +0 -1
  675. package/out/lib/toolkit-build.js.map +0 -1
  676. package/out/types/config.d.ts +0 -57
  677. package/out/types/config.d.ts.map +0 -1
  678. package/out/types/config.js.map +0 -1
  679. package/out/ui/banner.d.ts +0 -2
  680. package/out/ui/banner.d.ts.map +0 -1
  681. package/out/ui/banner.js.map +0 -1
  682. package/out/ui/interactive.d.ts +0 -2
  683. package/out/ui/interactive.d.ts.map +0 -1
  684. package/out/ui/interactive.js.map +0 -1
  685. package/out/ui/prompts.d.ts +0 -2
  686. package/out/ui/prompts.d.ts.map +0 -1
  687. package/out/ui/prompts.js.map +0 -1
  688. package/out/ui/theme.d.ts +0 -2
  689. package/out/ui/theme.d.ts.map +0 -1
  690. package/out/ui/theme.js.map +0 -1
  691. package/server/dist/app.module.d.ts +0 -2
  692. package/server/dist/app.module.js.map +0 -1
  693. package/server/dist/common/api-messages.d.ts +0 -41
  694. package/server/dist/common/api-messages.js.map +0 -1
  695. package/server/dist/database/typeorm-options.d.ts +0 -3
  696. package/server/dist/database/typeorm-options.js.map +0 -1
  697. package/server/dist/filters/http-exception.filter.d.ts +0 -4
  698. package/server/dist/filters/http-exception.filter.js.map +0 -1
  699. package/server/dist/generate-swagger.d.ts +0 -1
  700. package/server/dist/generate-swagger.js.map +0 -1
  701. package/server/dist/interceptors/transform.interceptor.d.ts +0 -9
  702. package/server/dist/interceptors/transform.interceptor.js.map +0 -1
  703. package/server/dist/logger/index.d.ts +0 -4
  704. package/server/dist/logger/index.js.map +0 -1
  705. package/server/dist/main.d.ts +0 -6
  706. package/server/dist/main.js.map +0 -1
  707. package/server/dist/modules/api-key/api-key.controller.d.ts +0 -14
  708. package/server/dist/modules/api-key/api-key.controller.js.map +0 -1
  709. package/server/dist/modules/api-key/api-key.entity.d.ts +0 -11
  710. package/server/dist/modules/api-key/api-key.entity.js.map +0 -1
  711. package/server/dist/modules/api-key/api-key.guard.d.ts +0 -7
  712. package/server/dist/modules/api-key/api-key.guard.js.map +0 -1
  713. package/server/dist/modules/api-key/api-key.module.d.ts +0 -2
  714. package/server/dist/modules/api-key/api-key.module.js.map +0 -1
  715. package/server/dist/modules/api-key/api-key.service.d.ts +0 -15
  716. package/server/dist/modules/api-key/api-key.service.js.map +0 -1
  717. package/server/dist/modules/article/article-revision.entity.d.ts +0 -11
  718. package/server/dist/modules/article/article-revision.entity.js.map +0 -1
  719. package/server/dist/modules/article/article-slug.util.d.ts +0 -2
  720. package/server/dist/modules/article/article-slug.util.js.map +0 -1
  721. package/server/dist/modules/article/article.controller.d.ts +0 -27
  722. package/server/dist/modules/article/article.controller.js.map +0 -1
  723. package/server/dist/modules/article/article.entity.d.ts +0 -23
  724. package/server/dist/modules/article/article.entity.js.map +0 -1
  725. package/server/dist/modules/article/article.module.d.ts +0 -2
  726. package/server/dist/modules/article/article.module.js.map +0 -1
  727. package/server/dist/modules/article/article.service.d.ts +0 -30
  728. package/server/dist/modules/article/article.service.js.map +0 -1
  729. package/server/dist/modules/article/article.util.d.ts +0 -1
  730. package/server/dist/modules/article/article.util.js.map +0 -1
  731. package/server/dist/modules/article/scheduled-publish.service.d.ts +0 -13
  732. package/server/dist/modules/article/scheduled-publish.service.js.map +0 -1
  733. package/server/dist/modules/auth/auth.controller.d.ts +0 -12
  734. package/server/dist/modules/auth/auth.controller.js.map +0 -1
  735. package/server/dist/modules/auth/auth.module.d.ts +0 -2
  736. package/server/dist/modules/auth/auth.module.js.map +0 -1
  737. package/server/dist/modules/auth/auth.service.d.ts +0 -26
  738. package/server/dist/modules/auth/auth.service.js.map +0 -1
  739. package/server/dist/modules/auth/jwt-auth.guard.d.ts +0 -7
  740. package/server/dist/modules/auth/jwt-auth.guard.js.map +0 -1
  741. package/server/dist/modules/auth/jwt.strategy.d.ts +0 -9
  742. package/server/dist/modules/auth/jwt.strategy.js.map +0 -1
  743. package/server/dist/modules/auth/roles.guard.d.ts +0 -10
  744. package/server/dist/modules/auth/roles.guard.js.map +0 -1
  745. package/server/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
  746. package/server/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
  747. package/server/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
  748. package/server/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
  749. package/server/dist/modules/bootstrap/install-locale.d.ts +0 -2
  750. package/server/dist/modules/bootstrap/install-locale.js.map +0 -1
  751. package/server/dist/modules/category/category.controller.d.ts +0 -11
  752. package/server/dist/modules/category/category.controller.js.map +0 -1
  753. package/server/dist/modules/category/category.entity.d.ts +0 -9
  754. package/server/dist/modules/category/category.entity.js.map +0 -1
  755. package/server/dist/modules/category/category.module.d.ts +0 -2
  756. package/server/dist/modules/category/category.module.js.map +0 -1
  757. package/server/dist/modules/category/category.service.d.ts +0 -12
  758. package/server/dist/modules/category/category.service.js.map +0 -1
  759. package/server/dist/modules/comment/comment.controller.d.ts +0 -12
  760. package/server/dist/modules/comment/comment.controller.js.map +0 -1
  761. package/server/dist/modules/comment/comment.entity.d.ts +0 -17
  762. package/server/dist/modules/comment/comment.entity.js.map +0 -1
  763. package/server/dist/modules/comment/comment.module.d.ts +0 -2
  764. package/server/dist/modules/comment/comment.module.js.map +0 -1
  765. package/server/dist/modules/comment/comment.service.d.ts +0 -24
  766. package/server/dist/modules/comment/comment.service.js.map +0 -1
  767. package/server/dist/modules/comment/html.d.ts +0 -15
  768. package/server/dist/modules/comment/html.js.map +0 -1
  769. package/server/dist/modules/extension/extension.module.d.ts +0 -9
  770. package/server/dist/modules/extension/extension.module.js.map +0 -1
  771. package/server/dist/modules/extension/plugin-loader.service.d.ts +0 -12
  772. package/server/dist/modules/extension/plugin-loader.service.js.map +0 -1
  773. package/server/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
  774. package/server/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
  775. package/server/dist/modules/extension/plugin.controller.d.ts +0 -22
  776. package/server/dist/modules/extension/plugin.controller.js.map +0 -1
  777. package/server/dist/modules/extension/plugin.service.d.ts +0 -52
  778. package/server/dist/modules/extension/plugin.service.js.map +0 -1
  779. package/server/dist/modules/extension/preview-draft.store.d.ts +0 -13
  780. package/server/dist/modules/extension/preview-draft.store.js.map +0 -1
  781. package/server/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
  782. package/server/dist/modules/extension/theme-registry.bridge.js.map +0 -1
  783. package/server/dist/modules/extension/theme.controller.d.ts +0 -66
  784. package/server/dist/modules/extension/theme.controller.js.map +0 -1
  785. package/server/dist/modules/extension/theme.service.d.ts +0 -140
  786. package/server/dist/modules/extension/theme.service.js.map +0 -1
  787. package/server/dist/modules/file/file-optimization.controller.d.ts +0 -12
  788. package/server/dist/modules/file/file-optimization.controller.js.map +0 -1
  789. package/server/dist/modules/file/file-optimization.service.d.ts +0 -36
  790. package/server/dist/modules/file/file-optimization.service.js.map +0 -1
  791. package/server/dist/modules/file/file-optimization.types.d.ts +0 -66
  792. package/server/dist/modules/file/file-optimization.types.js.map +0 -1
  793. package/server/dist/modules/file/file.controller.d.ts +0 -10
  794. package/server/dist/modules/file/file.controller.js.map +0 -1
  795. package/server/dist/modules/file/file.entity.d.ts +0 -9
  796. package/server/dist/modules/file/file.entity.js.map +0 -1
  797. package/server/dist/modules/file/file.module.d.ts +0 -2
  798. package/server/dist/modules/file/file.module.js.map +0 -1
  799. package/server/dist/modules/file/file.service.d.ts +0 -17
  800. package/server/dist/modules/file/file.service.js.map +0 -1
  801. package/server/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
  802. package/server/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
  803. package/server/dist/modules/health/health.controller.d.ts +0 -11
  804. package/server/dist/modules/health/health.controller.js.map +0 -1
  805. package/server/dist/modules/health/health.module.d.ts +0 -2
  806. package/server/dist/modules/health/health.module.js.map +0 -1
  807. package/server/dist/modules/hook/hook.module.d.ts +0 -2
  808. package/server/dist/modules/hook/hook.module.js.map +0 -1
  809. package/server/dist/modules/hook/hook.service.d.ts +0 -26
  810. package/server/dist/modules/hook/hook.service.js.map +0 -1
  811. package/server/dist/modules/install/install.controller.d.ts +0 -11
  812. package/server/dist/modules/install/install.controller.js.map +0 -1
  813. package/server/dist/modules/install/install.module.d.ts +0 -2
  814. package/server/dist/modules/install/install.module.js.map +0 -1
  815. package/server/dist/modules/install/install.service.d.ts +0 -12
  816. package/server/dist/modules/install/install.service.js.map +0 -1
  817. package/server/dist/modules/knowledge/knowledge.controller.d.ts +0 -14
  818. package/server/dist/modules/knowledge/knowledge.controller.js.map +0 -1
  819. package/server/dist/modules/knowledge/knowledge.entity.d.ts +0 -18
  820. package/server/dist/modules/knowledge/knowledge.entity.js.map +0 -1
  821. package/server/dist/modules/knowledge/knowledge.module.d.ts +0 -2
  822. package/server/dist/modules/knowledge/knowledge.module.js.map +0 -1
  823. package/server/dist/modules/knowledge/knowledge.service.d.ts +0 -14
  824. package/server/dist/modules/knowledge/knowledge.service.js.map +0 -1
  825. package/server/dist/modules/page/page.controller.d.ts +0 -12
  826. package/server/dist/modules/page/page.controller.js.map +0 -1
  827. package/server/dist/modules/page/page.entity.d.ts +0 -15
  828. package/server/dist/modules/page/page.entity.js.map +0 -1
  829. package/server/dist/modules/page/page.module.d.ts +0 -2
  830. package/server/dist/modules/page/page.module.js.map +0 -1
  831. package/server/dist/modules/page/page.service.d.ts +0 -12
  832. package/server/dist/modules/page/page.service.js.map +0 -1
  833. package/server/dist/modules/search/search.controller.d.ts +0 -8
  834. package/server/dist/modules/search/search.controller.js.map +0 -1
  835. package/server/dist/modules/search/search.entity.d.ts +0 -8
  836. package/server/dist/modules/search/search.entity.js.map +0 -1
  837. package/server/dist/modules/search/search.module.d.ts +0 -2
  838. package/server/dist/modules/search/search.module.js.map +0 -1
  839. package/server/dist/modules/search/search.service.d.ts +0 -12
  840. package/server/dist/modules/search/search.service.js.map +0 -1
  841. package/server/dist/modules/setting/setting.constant.d.ts +0 -3
  842. package/server/dist/modules/setting/setting.constant.js.map +0 -1
  843. package/server/dist/modules/setting/setting.controller.d.ts +0 -12
  844. package/server/dist/modules/setting/setting.controller.js.map +0 -1
  845. package/server/dist/modules/setting/setting.entity.d.ts +0 -26
  846. package/server/dist/modules/setting/setting.entity.js.map +0 -1
  847. package/server/dist/modules/setting/setting.module.d.ts +0 -2
  848. package/server/dist/modules/setting/setting.module.js.map +0 -1
  849. package/server/dist/modules/setting/setting.service.d.ts +0 -10
  850. package/server/dist/modules/setting/setting.service.js.map +0 -1
  851. package/server/dist/modules/smtp/mail.util.d.ts +0 -6
  852. package/server/dist/modules/smtp/mail.util.js.map +0 -1
  853. package/server/dist/modules/smtp/smtp.controller.d.ts +0 -9
  854. package/server/dist/modules/smtp/smtp.controller.js.map +0 -1
  855. package/server/dist/modules/smtp/smtp.entity.d.ts +0 -9
  856. package/server/dist/modules/smtp/smtp.entity.js.map +0 -1
  857. package/server/dist/modules/smtp/smtp.module.d.ts +0 -2
  858. package/server/dist/modules/smtp/smtp.module.js.map +0 -1
  859. package/server/dist/modules/smtp/smtp.service.d.ts +0 -11
  860. package/server/dist/modules/smtp/smtp.service.js.map +0 -1
  861. package/server/dist/modules/tag/tag.controller.d.ts +0 -12
  862. package/server/dist/modules/tag/tag.controller.js.map +0 -1
  863. package/server/dist/modules/tag/tag.entity.d.ts +0 -9
  864. package/server/dist/modules/tag/tag.entity.js.map +0 -1
  865. package/server/dist/modules/tag/tag.module.d.ts +0 -2
  866. package/server/dist/modules/tag/tag.module.js.map +0 -1
  867. package/server/dist/modules/tag/tag.service.d.ts +0 -13
  868. package/server/dist/modules/tag/tag.service.js.map +0 -1
  869. package/server/dist/modules/user/user.controller.d.ts +0 -13
  870. package/server/dist/modules/user/user.controller.js.map +0 -1
  871. package/server/dist/modules/user/user.entity.d.ts +0 -15
  872. package/server/dist/modules/user/user.entity.js.map +0 -1
  873. package/server/dist/modules/user/user.module.d.ts +0 -2
  874. package/server/dist/modules/user/user.module.js.map +0 -1
  875. package/server/dist/modules/user/user.service.d.ts +0 -16
  876. package/server/dist/modules/user/user.service.js.map +0 -1
  877. package/server/dist/modules/view/view.controller.d.ts +0 -11
  878. package/server/dist/modules/view/view.controller.js.map +0 -1
  879. package/server/dist/modules/view/view.entity.d.ts +0 -14
  880. package/server/dist/modules/view/view.entity.js.map +0 -1
  881. package/server/dist/modules/view/view.module.d.ts +0 -2
  882. package/server/dist/modules/view/view.module.js.map +0 -1
  883. package/server/dist/modules/view/view.service.d.ts +0 -11
  884. package/server/dist/modules/view/view.service.js.map +0 -1
  885. package/server/dist/modules/webhook/webhook.controller.d.ts +0 -12
  886. package/server/dist/modules/webhook/webhook.controller.js.map +0 -1
  887. package/server/dist/modules/webhook/webhook.entity.d.ts +0 -9
  888. package/server/dist/modules/webhook/webhook.entity.js.map +0 -1
  889. package/server/dist/modules/webhook/webhook.module.d.ts +0 -2
  890. package/server/dist/modules/webhook/webhook.module.js.map +0 -1
  891. package/server/dist/modules/webhook/webhook.service.d.ts +0 -16
  892. package/server/dist/modules/webhook/webhook.service.js.map +0 -1
  893. package/server/dist/node-polyfills.d.ts +0 -18
  894. package/server/dist/node-polyfills.js.map +0 -1
  895. package/server/dist/public/apple-touch-icon.png +0 -0
  896. package/server/dist/public/favicon-16.png +0 -0
  897. package/server/dist/public/favicon-32.png +0 -0
  898. package/server/dist/public/favicon-48.png +0 -0
  899. package/server/dist/public/favicon.ico +0 -0
  900. package/server/dist/public/favicon.png +0 -0
  901. package/server/dist/public/icon-192.png +0 -0
  902. package/server/dist/public/icon-512.png +0 -0
  903. package/server/dist/public/index.html +0 -439
  904. package/server/dist/public/logo-200.png +0 -0
  905. package/server/dist/public/logo-400.png +0 -0
  906. package/server/dist/public/logo.png +0 -0
  907. package/server/dist/public/logo.svg +0 -7
  908. package/server/dist/public/swagger/custom.css +0 -11
  909. package/server/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  910. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  911. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  912. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  913. package/server/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  914. package/server/dist/starter.d.ts +0 -1
  915. package/server/dist/starter.js.map +0 -1
  916. package/server/dist/tsconfig.build.tsbuildinfo +0 -16764
  917. package/server/dist/tsconfig.tsbuildinfo +0 -1
  918. package/server/dist/utils/date.util.d.ts +0 -1
  919. package/server/dist/utils/date.util.js.map +0 -1
  920. package/server/dist/utils/html-sanitize.util.d.ts +0 -1
  921. package/server/dist/utils/html-sanitize.util.js.map +0 -1
  922. package/server/dist/utils/image-processor.util.d.ts +0 -23
  923. package/server/dist/utils/image-processor.util.js.map +0 -1
  924. package/server/dist/utils/ip.util.d.ts +0 -2
  925. package/server/dist/utils/ip.util.js.map +0 -1
  926. package/server/dist/utils/local-api-quiet.util.d.ts +0 -1
  927. package/server/dist/utils/local-api-quiet.util.js.map +0 -1
  928. package/server/dist/utils/markdown.util.d.ts +0 -4
  929. package/server/dist/utils/markdown.util.js.map +0 -1
  930. package/server/dist/utils/oss/aliyun-oss-client.d.ts +0 -6
  931. package/server/dist/utils/oss/aliyun-oss-client.js.map +0 -1
  932. package/server/dist/utils/oss/oss-client.d.ts +0 -6
  933. package/server/dist/utils/oss/oss-client.js.map +0 -1
  934. package/server/dist/utils/oss.util.d.ts +0 -13
  935. package/server/dist/utils/oss.util.js.map +0 -1
  936. package/server/dist/utils/project-root.util.d.ts +0 -2
  937. package/server/dist/utils/project-root.util.js.map +0 -1
  938. package/server/dist/utils/query-whitelist.util.d.ts +0 -1
  939. package/server/dist/utils/query-whitelist.util.js.map +0 -1
  940. package/server/dist/utils/ua.util.d.ts +0 -9
  941. package/server/dist/utils/ua.util.js.map +0 -1
  942. package/server/dist/utils/uniqueid.util.d.ts +0 -1
  943. package/server/dist/utils/uniqueid.util.js.map +0 -1
  944. package/server/dist/utils/upload.util.d.ts +0 -5
  945. package/server/dist/utils/upload.util.js.map +0 -1
  946. package/server/dist/utils/user.util.d.ts +0 -1
  947. package/server/dist/utils/user.util.js.map +0 -1
  948. package/server/logs/error/error.log.-2026-05-19.log +0 -135
  949. package/server/logs/request/request.log.-2026-05-19.log +0 -0
  950. package/server/logs/response/response.log.-2026-05-19.log +0 -121
  951. package/server/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  952. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  953. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  954. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  955. package/server/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { describeProject } = require('./project-type');
7
+ const { isDockerRunning } = require('./docker');
8
+ const { isNginxContainerRunning } = require('./nginx');
9
+ const { DEV_PORTS, readEnvPort, isPortListening, } = require('./ports');
10
+ const { loadServerSiteUrl, loadWebAdminUrl, loadAdminConsoleUrl, isHttpResponding, checkHealth, getHealthUrl, } = require('./http');
11
+ const SERVICE_ORDER = ['sqlite', 'mysql', 'server', 'docker', 'nginx', 'web'];
12
+ function parseEnvFile(projectRoot) {
13
+ const envPath = path.join(projectRoot, '.env');
14
+ const env = {};
15
+ try {
16
+ if (!fs.existsSync(envPath))
17
+ return env;
18
+ for (const line of fs.readFileSync(envPath, 'utf8').split('\n')) {
19
+ const m = line.match(/^([A-Z_]+)=(.*)$/);
20
+ if (m)
21
+ env[m[1]] = m[2].trim().replace(/^['"]|['"]$/g, '');
22
+ }
23
+ }
24
+ catch {
25
+ // ignore
26
+ }
27
+ return env;
28
+ }
29
+ async function resolveDbType(projectRoot) {
30
+ try {
31
+ const { resolveDatabaseProfile } = require('../core/services/database/profile');
32
+ const profile = await resolveDatabaseProfile(projectRoot);
33
+ return profile.type;
34
+ }
35
+ catch {
36
+ const env = parseEnvFile(projectRoot);
37
+ if (String(env.DB_TYPE || '').toLowerCase() === 'sqlite')
38
+ return 'sqlite';
39
+ try {
40
+ const configPath = path.join(projectRoot, '.reactpress/config.json');
41
+ if (fs.existsSync(configPath)) {
42
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
43
+ if (config.database && config.database.mode === 'embedded-sqlite')
44
+ return 'sqlite';
45
+ }
46
+ }
47
+ catch {
48
+ // ignore
49
+ }
50
+ return 'mysql';
51
+ }
52
+ }
53
+ async function probeMysql(projectRoot) {
54
+ const port = readEnvPort(projectRoot, 'DB_PORT', DEV_PORTS.MYSQL);
55
+ if (isPortListening(port))
56
+ return true;
57
+ try {
58
+ const mysql = require('mysql2/promise');
59
+ const env = parseEnvFile(projectRoot);
60
+ const conn = await mysql.createConnection({
61
+ host: env.DB_HOST || '127.0.0.1',
62
+ port: Number(env.DB_PORT || DEV_PORTS.MYSQL),
63
+ user: env.DB_USER || 'reactpress',
64
+ password: env.DB_PASSWD || env.DB_PASSWORD || 'reactpress',
65
+ database: env.DB_DATABASE || 'reactpress',
66
+ connectTimeout: 2000,
67
+ });
68
+ await conn.ping();
69
+ await conn.end();
70
+ return true;
71
+ }
72
+ catch {
73
+ return false;
74
+ }
75
+ }
76
+ async function probeSqlite(projectRoot) {
77
+ const { probeSqliteDatabase } = require('../core/services/database/sqlite');
78
+ const result = await probeSqliteDatabase(projectRoot);
79
+ return result.ok;
80
+ }
81
+ async function probeServer(projectRoot) {
82
+ const port = readEnvPort(projectRoot, 'SERVER_PORT', DEV_PORTS.API);
83
+ if (isPortListening(port))
84
+ return true;
85
+ const [httpOk, health] = await Promise.all([
86
+ isHttpResponding(loadServerSiteUrl(projectRoot), 1500),
87
+ checkHealth(getHealthUrl(projectRoot)),
88
+ ]);
89
+ return httpOk || health.ok;
90
+ }
91
+ async function probeWeb(projectRoot) {
92
+ if (process.env.REACTPRESS_LOCAL_MODE === '1' || process.env.REACTPRESS_SKIP_NGINX === '1') {
93
+ return isHttpResponding(loadAdminConsoleUrl(projectRoot), 1500);
94
+ }
95
+ const port = readEnvPort(projectRoot, 'WEB_ADMIN_PORT', DEV_PORTS.ADMIN_WEB);
96
+ if (isPortListening(port))
97
+ return true;
98
+ return isHttpResponding(loadWebAdminUrl(projectRoot), 1500);
99
+ }
100
+ function resolveServiceChecks(dbType) {
101
+ const dbId = dbType === 'sqlite' ? 'sqlite' : 'mysql';
102
+ if (dbType === 'sqlite') {
103
+ return [dbId, 'server', 'web'];
104
+ }
105
+ return [dbId, 'server', 'web'];
106
+ }
107
+ async function probeService(projectRoot, id) {
108
+ switch (id) {
109
+ case 'sqlite':
110
+ return probeSqlite(projectRoot);
111
+ case 'mysql':
112
+ return probeMysql(projectRoot);
113
+ case 'server':
114
+ return probeServer(projectRoot);
115
+ case 'docker':
116
+ return Promise.resolve(isDockerRunning());
117
+ case 'nginx':
118
+ return Promise.resolve(isNginxContainerRunning());
119
+ case 'web':
120
+ return probeWeb(projectRoot);
121
+ default:
122
+ return false;
123
+ }
124
+ }
125
+ async function emitProgress(onProgress, payload) {
126
+ if (!onProgress)
127
+ return;
128
+ onProgress(payload);
129
+ await new Promise((resolve) => setImmediate(resolve));
130
+ }
131
+ async function fetchContextStatus(projectRoot, { onProgress } = {}) {
132
+ const project = describeProject(projectRoot);
133
+ await emitProgress(onProgress, { phase: 'start', id: '__config' });
134
+ const dbType = await resolveDbType(projectRoot);
135
+ const ids = resolveServiceChecks(dbType);
136
+ await emitProgress(onProgress, { phase: 'ready', total: ids.length + 1 });
137
+ await emitProgress(onProgress, { phase: 'done', id: '__config' });
138
+ const components = await Promise.all(ids.map(async (id) => {
139
+ await emitProgress(onProgress, { phase: 'start', id });
140
+ const ok = await probeService(projectRoot, id);
141
+ await emitProgress(onProgress, { phase: 'done', id, ok });
142
+ return { id, ok };
143
+ }));
144
+ return { components, project, dbType };
145
+ }
146
+ module.exports = {
147
+ fetchContextStatus,
148
+ resolveServiceChecks,
149
+ resolveDbType,
150
+ parseEnvFile,
151
+ probeService,
152
+ SERVICE_ORDER,
153
+ };
154
+ //# sourceMappingURL=context-status.js.map
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createSite = createSite;
7
+ // @ts-nocheck
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const node_child_process_1 = require("node:child_process");
11
+ const local_site_1 = require("../core/services/local-site");
12
+ const paths_1 = require("./paths");
13
+ const i18n_1 = require("./i18n");
14
+ const THEME_RUNTIME_REL = node_path_1.default.join('.reactpress', 'runtime', 'hello-world');
15
+ const ACTIVE_THEME_MANIFEST_REL = node_path_1.default.join('.reactpress', 'active-theme.json');
16
+ const THEME_COPY_SKIP = new Set([
17
+ 'node_modules',
18
+ '.next',
19
+ '.git',
20
+ 'coverage',
21
+ '.turbo',
22
+ '.cache',
23
+ 'package-lock.json',
24
+ ]);
25
+ function getTemplatesDir() {
26
+ return node_path_1.default.join((0, paths_1.getCliPackageRoot)(), 'templates');
27
+ }
28
+ function copyDirFiltered(srcDir, destDir, skipNames = THEME_COPY_SKIP) {
29
+ node_fs_1.default.mkdirSync(destDir, { recursive: true });
30
+ for (const entry of node_fs_1.default.readdirSync(srcDir, { withFileTypes: true })) {
31
+ if (skipNames.has(entry.name))
32
+ continue;
33
+ const from = node_path_1.default.join(srcDir, entry.name);
34
+ const to = node_path_1.default.join(destDir, entry.name);
35
+ if (entry.isDirectory()) {
36
+ copyDirFiltered(from, to, skipNames);
37
+ }
38
+ else if (entry.isFile()) {
39
+ node_fs_1.default.copyFileSync(from, to);
40
+ }
41
+ }
42
+ }
43
+ function resolveThemeTemplateDir() {
44
+ const bundled = node_path_1.default.join(getTemplatesDir(), 'site-theme');
45
+ if (node_fs_1.default.existsSync(node_path_1.default.join(bundled, 'theme.json'))) {
46
+ return bundled;
47
+ }
48
+ const monorepoTheme = node_path_1.default.join((0, paths_1.getCliPackageRoot)(), '..', 'themes', 'hello-world');
49
+ if (node_fs_1.default.existsSync(node_path_1.default.join(monorepoTheme, 'theme.json'))) {
50
+ return monorepoTheme;
51
+ }
52
+ return null;
53
+ }
54
+ function writeActiveThemeManifest(projectRoot) {
55
+ const manifestPath = node_path_1.default.join(projectRoot, ACTIVE_THEME_MANIFEST_REL);
56
+ node_fs_1.default.mkdirSync(node_path_1.default.dirname(manifestPath), { recursive: true });
57
+ node_fs_1.default.writeFileSync(manifestPath, JSON.stringify({
58
+ activeTheme: 'hello-world',
59
+ themeDir: THEME_RUNTIME_REL.replace(/\\/g, '/'),
60
+ updatedAt: new Date().toISOString(),
61
+ }, null, 2), 'utf8');
62
+ }
63
+ function seedBundledTheme(projectRoot) {
64
+ const themeTemplate = resolveThemeTemplateDir();
65
+ if (!themeTemplate) {
66
+ throw new Error((0, i18n_1.t)('createSite.themeTemplateMissing'));
67
+ }
68
+ const targetDir = node_path_1.default.join(projectRoot, THEME_RUNTIME_REL);
69
+ if (node_fs_1.default.existsSync(targetDir)) {
70
+ node_fs_1.default.rmSync(targetDir, { recursive: true, force: true });
71
+ }
72
+ copyDirFiltered(themeTemplate, targetDir);
73
+ const themePkgPath = node_path_1.default.join(targetDir, 'package.json');
74
+ if (node_fs_1.default.existsSync(themePkgPath)) {
75
+ const pkg = JSON.parse(node_fs_1.default.readFileSync(themePkgPath, 'utf8'));
76
+ pkg.dependencies = pkg.dependencies || {};
77
+ pkg.dependencies['@fecommunity/reactpress-toolkit'] =
78
+ pkg.dependencies['@fecommunity/reactpress-toolkit'] || `^${(0, paths_1.getCliVersion)()}`;
79
+ delete pkg.dependencies['@fecommunity/reactpress-web'];
80
+ node_fs_1.default.writeFileSync(themePkgPath, JSON.stringify(pkg, null, 2), 'utf8');
81
+ }
82
+ writeActiveThemeManifest(projectRoot);
83
+ }
84
+ function linkThemeNodeModules(projectRoot) {
85
+ const siteModules = node_path_1.default.join(projectRoot, 'node_modules');
86
+ const themeModules = node_path_1.default.join(projectRoot, THEME_RUNTIME_REL, 'node_modules');
87
+ if (!node_fs_1.default.existsSync(siteModules))
88
+ return;
89
+ if (node_fs_1.default.existsSync(themeModules)) {
90
+ try {
91
+ const stat = node_fs_1.default.lstatSync(themeModules);
92
+ if (stat.isSymbolicLink())
93
+ return;
94
+ }
95
+ catch {
96
+ // fall through
97
+ }
98
+ node_fs_1.default.rmSync(themeModules, { recursive: true, force: true });
99
+ }
100
+ node_fs_1.default.symlinkSync(node_path_1.default.relative(node_path_1.default.dirname(themeModules), siteModules), themeModules, 'dir');
101
+ }
102
+ function renderSitePackageJson(projectName) {
103
+ const templatePath = node_path_1.default.join(getTemplatesDir(), 'site', 'package.json');
104
+ const raw = node_fs_1.default.readFileSync(templatePath, 'utf8');
105
+ return raw
106
+ .replace(/\{\{name\}\}/g, projectName)
107
+ .replace(/\{\{reactpressVersion\}\}/g, `^${(0, paths_1.getCliVersion)()}`);
108
+ }
109
+ function copySiteScaffold(projectRoot, projectName) {
110
+ node_fs_1.default.mkdirSync(projectRoot, { recursive: true });
111
+ node_fs_1.default.writeFileSync(node_path_1.default.join(projectRoot, 'package.json'), renderSitePackageJson(projectName), 'utf8');
112
+ const gitignoreSrc = node_path_1.default.join(getTemplatesDir(), 'site', 'gitignore');
113
+ if (node_fs_1.default.existsSync(gitignoreSrc)) {
114
+ node_fs_1.default.copyFileSync(gitignoreSrc, node_path_1.default.join(projectRoot, '.gitignore'));
115
+ }
116
+ }
117
+ function getNpmCommand() {
118
+ return process.platform === 'win32' ? 'npm.cmd' : 'npm';
119
+ }
120
+ function installSiteDependencies(projectRoot, { quiet = false } = {}) {
121
+ console.log(`[reactpress] ${(0, i18n_1.t)('createSite.installingDeps')}`);
122
+ const result = (0, node_child_process_1.spawnSync)(getNpmCommand(), ['install', '--legacy-peer-deps', '--no-fund', '--no-audit'], {
123
+ cwd: projectRoot,
124
+ stdio: quiet ? 'pipe' : 'inherit',
125
+ shell: process.platform === 'win32',
126
+ env: {
127
+ ...process.env,
128
+ npm_config_ignore_scripts: 'true',
129
+ },
130
+ });
131
+ if (result.status !== 0) {
132
+ throw new Error((0, i18n_1.t)('createSite.installFailed'));
133
+ }
134
+ }
135
+ async function createSite(options) {
136
+ const projectRoot = node_path_1.default.resolve(options.directory);
137
+ const projectName = options.name ||
138
+ (node_path_1.default.basename(projectRoot) || 'reactpress-site').replace(/^@/, '').replace(/\//g, '-');
139
+ if (node_fs_1.default.existsSync(node_path_1.default.join(projectRoot, '.reactpress', 'config.json')) && !options.force) {
140
+ return {
141
+ ok: false,
142
+ projectRoot,
143
+ message: (0, i18n_1.t)('createSite.alreadyExists'),
144
+ };
145
+ }
146
+ console.log(`[reactpress] ${(0, i18n_1.t)('createSite.scaffolding', { dir: projectRoot })}`);
147
+ copySiteScaffold(projectRoot, projectName);
148
+ process.env.REACTPRESS_LOCAL_MODE = '1';
149
+ process.env.REACTPRESS_SKIP_NGINX = '1';
150
+ const initResult = await (0, local_site_1.initLocalProject)(projectRoot, { force: options.force });
151
+ if (!initResult.ok) {
152
+ return initResult;
153
+ }
154
+ seedBundledTheme(projectRoot);
155
+ if (!options.skipInstall) {
156
+ try {
157
+ installSiteDependencies(projectRoot);
158
+ linkThemeNodeModules(projectRoot);
159
+ }
160
+ catch (err) {
161
+ return {
162
+ ok: true,
163
+ projectRoot,
164
+ message: (0, i18n_1.t)('createSite.createdInstallSkipped', {
165
+ error: err.message || String(err),
166
+ }),
167
+ };
168
+ }
169
+ }
170
+ console.log('');
171
+ console.log(`[reactpress] ${(0, i18n_1.t)('createSite.ready')}`);
172
+ console.log(` cd ${projectRoot === process.cwd() ? '.' : projectRoot}`);
173
+ console.log(` npm run dev`);
174
+ console.log('');
175
+ console.log((0, i18n_1.t)('createSite.urlsHint'));
176
+ return {
177
+ ok: true,
178
+ projectRoot,
179
+ message: (0, i18n_1.t)('createSite.done'),
180
+ };
181
+ }
182
+ module.exports = {
183
+ createSite,
184
+ seedBundledTheme,
185
+ linkThemeNodeModules,
186
+ };
187
+ //# sourceMappingURL=create-site.js.map
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { ensureOriginalCwd } = require('./root');
7
+ function isDesktopLocalMode() {
8
+ return process.env.REACTPRESS_DESKTOP_LOCAL === '1';
9
+ }
10
+ function readSqliteModeFromProject(projectRoot) {
11
+ try {
12
+ const configPath = path.join(projectRoot, '.reactpress/config.json');
13
+ if (fs.existsSync(configPath)) {
14
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
15
+ if (config.database?.mode === 'embedded-sqlite')
16
+ return true;
17
+ }
18
+ }
19
+ catch {
20
+ // ignore
21
+ }
22
+ try {
23
+ const envPath = path.join(projectRoot, '.env');
24
+ if (fs.existsSync(envPath)) {
25
+ const content = fs.readFileSync(envPath, 'utf8');
26
+ if (/^DB_TYPE=sqlite/m.test(content))
27
+ return true;
28
+ }
29
+ }
30
+ catch {
31
+ // ignore
32
+ }
33
+ return false;
34
+ }
35
+ function isLocalSqliteMode(projectRoot = ensureOriginalCwd()) {
36
+ if (process.env.REACTPRESS_LOCAL_MODE === '1' || isDesktopLocalMode())
37
+ return true;
38
+ return readSqliteModeFromProject(projectRoot);
39
+ }
40
+ module.exports = {
41
+ isDesktopLocalMode,
42
+ isLocalSqliteMode,
43
+ readSqliteModeFromProject,
44
+ };
45
+ //# sourceMappingURL=database-mode.js.map
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REPO_DISPLAY = exports.REPO_URL = exports.TECH_LOGO = exports.logoGradients = exports.layout = exports.motion = exports.palette = void 0;
4
+ /** Shared visual tokens for legacy chalk UI and Ink shell. */
5
+ exports.palette = {
6
+ primary: '#7C5CFF',
7
+ accent: '#22D3EE',
8
+ pink: '#F472B6',
9
+ green: '#22C55E',
10
+ amber: '#F59E0B',
11
+ red: '#EF4444',
12
+ gray: '#6B7280',
13
+ dim: '#9CA3AF',
14
+ border: '#4A4580',
15
+ surface: '#12152A',
16
+ surfaceRaised: '#1A1F3A',
17
+ ink: '#0B1220',
18
+ };
19
+ exports.motion = {
20
+ bootLogoMs: 90,
21
+ bootMetaMs: 180,
22
+ pulsePeriodMs: 800,
23
+ shimmerMs: 1200,
24
+ statusPollMs: 2000,
25
+ transitionMs: 150,
26
+ maxFps: 15,
27
+ };
28
+ exports.layout = {
29
+ cardPadX: 2,
30
+ sectionGap: 1,
31
+ shellPadX: 1,
32
+ minContentWidth: 40,
33
+ maxContentWidth: 96,
34
+ stackBreakpoint: 68,
35
+ };
36
+ /** Per-line gradient pairs for the ASCII logo (from → to). */
37
+ exports.logoGradients = [
38
+ [exports.palette.pink, exports.palette.primary],
39
+ [exports.palette.pink, exports.palette.primary],
40
+ [exports.palette.primary, exports.palette.accent],
41
+ [exports.palette.primary, exports.palette.accent],
42
+ [exports.palette.accent, exports.palette.primary],
43
+ [exports.palette.accent, exports.palette.primary],
44
+ ];
45
+ exports.TECH_LOGO = [
46
+ '██████╗ ███████╗ █████╗ ██████╗████████╗██████╗ ██████╗ ███████╗███████╗███████╗',
47
+ '██╔══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝',
48
+ '██████╔╝█████╗ ███████║██║ ██║ ██████╔╝██████╔╝█████╗ ███████╗███████╗',
49
+ '██╔══██╗██╔══╝ ██╔══██║██║ ██║ ██╔═══╝ ██╔══██╗██╔══╝ ╚════██║╚════██║',
50
+ '██║ ██║███████╗██║ ██║╚██████╗ ██║ ██║ ██║ ██║███████╗███████║███████║',
51
+ '╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝',
52
+ ];
53
+ exports.REPO_URL = 'https://github.com/fecommunity/reactpress';
54
+ exports.REPO_DISPLAY = 'github.com/fecommunity/reactpress';
55
+ //# sourceMappingURL=design-tokens.js.map
@@ -6,12 +6,16 @@ const { loadClientSiteUrl, loadWebAdminUrl, loadServerSiteUrl, getApiPrefix, get
6
6
  const { hasWeb } = require('./project-type');
7
7
  const { nginxEntryUrl } = require('./nginx');
8
8
  const { t } = require('./i18n');
9
+ function normalizeUrl(value, fallback) {
10
+ const raw = String(value || fallback || '').trim();
11
+ return raw.replace(/\/$/, '');
12
+ }
9
13
  function getDevUrls(projectRoot) {
10
- const client = loadClientSiteUrl(projectRoot).replace(/\/$/, '');
11
- const server = loadServerSiteUrl(projectRoot).replace(/\/$/, '');
12
- const prefix = getApiPrefix(projectRoot).replace(/\/$/, '') || '/api';
14
+ const client = normalizeUrl(loadClientSiteUrl(projectRoot), 'http://localhost:3001');
15
+ const server = normalizeUrl(loadServerSiteUrl(projectRoot), 'http://localhost:3002');
16
+ const prefix = normalizeUrl(getApiPrefix(projectRoot), '/api') || '/api';
13
17
  const admin = hasWeb(projectRoot)
14
- ? loadWebAdminUrl(projectRoot).replace(/\/$/, '')
18
+ ? normalizeUrl(loadWebAdminUrl(projectRoot), 'http://localhost:3000')
15
19
  : `${client}/admin`;
16
20
  return {
17
21
  site: client,
@@ -52,7 +56,8 @@ function printDevReadyBanner(projectRoot, { apiOnly = false, webOnly = false, de
52
56
  if (hasThemeSite) {
53
57
  console.log(urlLine(t('devBanner.site'), urls.site));
54
58
  }
55
- const healthUrl = localApiUrl.replace(/\/api\/?$/, '') + '/api/health';
59
+ const healthUrl = String(localApiUrl || '')
60
+ .replace(/\/api\/?$/, '') + '/api/health';
56
61
  console.log(urlLine(t('devBanner.health'), healthUrl, { underline: false }));
57
62
  console.log(` ${brand.muted(' ')}${brand.dim(t(localWeb ? 'devBanner.localWebHint' : 'devBanner.desktopLocalHint'))}`);
58
63
  }
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
  function lockFilePath(projectRoot) {
7
- return path.join(projectRoot, '.reactpress', 'dev-session.json');
7
+ const { devSessionSuffix } = require('./ports');
8
+ return path.join(projectRoot, '.reactpress', `dev-session${devSessionSuffix()}.json`);
8
9
  }
9
10
  function isPidAlive(pid) {
10
11
  const n = parseInt(pid, 10);
@@ -60,7 +61,13 @@ async function acquireDevSession(projectRoot) {
60
61
  // Do not run `docker compose down` here — DB/nginx containers must survive dev restarts.
61
62
  }
62
63
  }
63
- const { releaseStaleDevStackPorts } = require('./ports');
64
+ const { releaseStaleDevStackPorts, resolveDevStackPorts, applyDevStackPortsToEnv, readInstanceIndex, } = require('./ports');
65
+ const stack = resolveDevStackPorts(resolvedRoot);
66
+ applyDevStackPortsToEnv(stack);
67
+ const instance = stack.admin !== 3000 || stack.api !== 3002 ? readInstanceIndex() : 0;
68
+ if (instance > 0) {
69
+ console.log(`[reactpress] Dev instance ${instance} — admin :${stack.admin}, api :${stack.api}, visitor :${stack.visitor}, preview :${stack.preview}`);
70
+ }
64
71
  await releaseStaleDevStackPorts(resolvedRoot);
65
72
  fs.mkdirSync(path.dirname(lockPath), { recursive: true });
66
73
  fs.writeFileSync(lockPath, `${JSON.stringify({
package/out/lib/dev.js CHANGED
@@ -25,6 +25,7 @@ const { acquireDevSession, releaseDevSession } = require('./dev-session');
25
25
  const { checkNodeVersion, checkDocker } = require('./doctor');
26
26
  const { startDevTimer, markDevPhase, isDevVerbose, logDevLine, logDevDetail, logDevStatus, logDevTimingSummary, } = require('./dev-log');
27
27
  const { t } = require('./i18n');
28
+ const { isDesktopLocalMode, isLocalSqliteMode } = require('./database-mode');
28
29
  const { resolveRemoteThemeApiBase, readDevClientApiOrigin, normalizeRemoteOrigin, } = require('./remote-dev');
29
30
  const CLIENT_READY_TIMEOUT_MS = 120_000;
30
31
  const API_READY_TIMEOUT_MS = 180_000;
@@ -39,11 +40,24 @@ function logDevPhase(step, total, messageKey, vars = {}) {
39
40
  console.log('');
40
41
  console.log(`[reactpress] [${step}/${total}] ${t(messageKey, vars)}`);
41
42
  }
42
- function isDesktopLocalMode() {
43
- return process.env.REACTPRESS_DESKTOP_LOCAL === '1';
44
- }
45
- function isLocalSqliteMode() {
46
- return process.env.REACTPRESS_LOCAL_MODE === '1' || isDesktopLocalMode();
43
+ async function applyAutoLocalDevFallback(projectRoot, { needsLocalApi = true } = {}) {
44
+ if (!needsLocalApi)
45
+ return false;
46
+ if (isLocalSqliteMode(projectRoot)) {
47
+ process.env.REACTPRESS_SKIP_NGINX = '1';
48
+ return false;
49
+ }
50
+ if (process.env.REACTPRESS_FORCE_MYSQL === '1')
51
+ return false;
52
+ const docker = checkDocker();
53
+ const mysqlOk = docker.ok ? await probeMysqlHost(projectRoot) : false;
54
+ if (docker.ok && mysqlOk)
55
+ return false;
56
+ process.env.REACTPRESS_LOCAL_MODE = '1';
57
+ process.env.REACTPRESS_SKIP_NGINX = '1';
58
+ console.log('');
59
+ console.log(`[reactpress] ${t(docker.ok ? 'dev.autoLocalNoMysql' : 'dev.autoLocalNoDocker')}`);
60
+ return true;
47
61
  }
48
62
  function desktopPhaseKey(defaultKey) {
49
63
  if (isLocalSqliteMode()) {
@@ -263,7 +277,7 @@ async function spawnAdminWeb(projectRoot, { behindNginx = false, integratedStack
263
277
  adminEnv.VITE_DEV_API_PROXY_TARGET = normalizeRemoteOrigin(adminApiOrigin) || adminApiOrigin;
264
278
  }
265
279
  else if (isDesktopLocalMode() && process.env.REACTPRESS_DESKTOP_LOCAL_API) {
266
- // Desktop dev embeds SQLite API on a dedicated port (default :13102), not :3002.
280
+ // Local SQLite API uses the same port as SERVER_PORT (default :3002).
267
281
  adminEnv.VITE_DEV_API_PROXY_TARGET = process.env.REACTPRESS_DESKTOP_LOCAL_API.replace(/\/api\/?$/, '');
268
282
  }
269
283
  else {
@@ -323,17 +337,22 @@ function assertDevPrerequisites() {
323
337
  }
324
338
  async function prepareDevInfrastructure(projectRoot, { needsLocalApi = true } = {}) {
325
339
  await acquireDevSession(projectRoot);
326
- if (isLocalSqliteMode()) {
340
+ if (isLocalSqliteMode(projectRoot)) {
341
+ const { ensureLocalSite } = require('../core/services/local-site');
342
+ const { ensureSqliteDatabase } = require('../core/services/database/sqlite');
343
+ const { syncEnvFromConfig, loadConfig } = require('../core/services/config');
344
+ const { getMonorepoRoot } = require('./root');
345
+ const port = readEnvPort(projectRoot, 'SERVER_PORT', DEV_PORTS.API);
327
346
  if (process.env.REACTPRESS_LOCAL_MODE === '1') {
328
- const { ensureLocalSite } = require('../core/services/local-site');
329
- const { ensureSqliteDatabase } = require('../core/services/database/sqlite');
330
- const { getMonorepoRoot } = require('./root');
331
- const port = readEnvPort(projectRoot, 'SERVER_PORT', DEV_PORTS.API);
332
347
  ensureLocalSite(projectRoot, port, { monorepoRoot: getMonorepoRoot() });
333
- const sqliteResult = await ensureSqliteDatabase(projectRoot);
334
- if (!sqliteResult.ok) {
335
- throw new Error(sqliteResult.message || 'SQLite 数据库未就绪');
336
- }
348
+ }
349
+ else {
350
+ const config = await loadConfig(projectRoot);
351
+ await syncEnvFromConfig(projectRoot, config);
352
+ }
353
+ const sqliteResult = await ensureSqliteDatabase(projectRoot);
354
+ if (!sqliteResult.ok) {
355
+ throw new Error(sqliteResult.message || 'SQLite 数据库未就绪');
337
356
  }
338
357
  nginxEnabled = false;
339
358
  delete process.env.REACTPRESS_NGINX_ENTRY_URL;
@@ -380,7 +399,9 @@ async function startDevStack(projectRoot, { webOnly = false, themeOnly = false,
380
399
  process.exit(1);
381
400
  }
382
401
  }
383
- else if (needsLocalApi && !isLocalSqliteMode() && !(await probeMysqlHost(projectRoot))) {
402
+ else if (needsLocalApi &&
403
+ !isLocalSqliteMode(projectRoot) &&
404
+ !(await probeMysqlHost(projectRoot))) {
384
405
  console.error(t('dev.dbEnsureFailed', {
385
406
  message: t('docker.devStartBlocked', {
386
407
  port: readEnvPort(projectRoot, 'DB_PORT', DEV_PORTS.MYSQL),
@@ -542,7 +563,7 @@ async function startDevStack(projectRoot, { webOnly = false, themeOnly = false,
542
563
  themeWait.then((ready) => {
543
564
  if (ready)
544
565
  logDevDetail('dev.themeReadyQuiet', { url: loadClientSiteUrl(projectRoot) });
545
- });
566
+ }).catch(() => { });
546
567
  }
547
568
  }
548
569
  if (readinessWaits.length > 1) {
@@ -568,12 +589,17 @@ async function startDevStack(projectRoot, { webOnly = false, themeOnly = false,
568
589
  }
569
590
  });
570
591
  }
571
- const dbOk = isDesktopLocalMode()
572
- ? true
573
- : needsLocalApi
574
- ? await probeMysqlHost(projectRoot)
575
- : true;
576
- if (needsLocalApi && !dbOk && !isDesktopLocalMode()) {
592
+ let dbOk = true;
593
+ if (needsLocalApi) {
594
+ if (isDesktopLocalMode() || isLocalSqliteMode(projectRoot)) {
595
+ const { probeSqliteDatabase } = require('../core/services/database/sqlite');
596
+ dbOk = (await probeSqliteDatabase(projectRoot)).ok;
597
+ }
598
+ else {
599
+ dbOk = await probeMysqlHost(projectRoot);
600
+ }
601
+ }
602
+ if (needsLocalApi && !dbOk && !isDesktopLocalMode() && !isLocalSqliteMode(projectRoot)) {
577
603
  console.warn(t('dev.mysqlUnreachable'));
578
604
  }
579
605
  if (includeThemeSite && process.env.REACTPRESS_SKIP_PREVIEW_BUILD !== '1' && !prewarmPreviewBuilds) {
@@ -590,7 +616,11 @@ async function startDevStack(projectRoot, { webOnly = false, themeOnly = false,
590
616
  adminApiOrigin,
591
617
  clientApiOrigin,
592
618
  localApiUrl: isDesktopLocalMode() ? process.env.REACTPRESS_DESKTOP_LOCAL_API || null : null,
593
- dbType: isDesktopLocalMode() ? 'sqlite' : needsLocalApi ? 'mysql' : null,
619
+ dbType: isDesktopLocalMode() || isLocalSqliteMode(projectRoot)
620
+ ? 'sqlite'
621
+ : needsLocalApi
622
+ ? 'mysql'
623
+ : null,
594
624
  });
595
625
  logDevTimingSummary({
596
626
  apiReused: Boolean(apiSpawn?.reused),
@@ -609,6 +639,7 @@ async function runDevStartup(projectRoot, { webOnly = false, themeOnly = false,
609
639
  console.error(formatDevFailureHint());
610
640
  process.exit(1);
611
641
  }
642
+ await applyAutoLocalDevFallback(projectRoot, { needsLocalApi: apiOrigins.needsLocalApi });
612
643
  logDevPhase(1, 3, desktopPhaseKey('dev.phasePrerequisites'));
613
644
  assertDevPrerequisites();
614
645
  logDevPhase(2, 3, desktopPhaseKey('dev.phaseInfra'));
@@ -643,10 +674,21 @@ async function startDesktopLocalApi(projectRoot, { forceRestart = false } = {})
643
674
  console.error(`[reactpress] ${t('dev.desktopMissing')}`);
644
675
  process.exit(1);
645
676
  }
677
+ const { resolveDevStackPorts, applyDevStackPortsToEnv, resolveApiPortForBind, } = require('./ports');
678
+ let stack = resolveDevStackPorts(projectRoot);
679
+ applyDevStackPortsToEnv(stack);
646
680
  const boot = await loadDesktopBootstrap(projectRoot);
647
681
  console.log('');
648
682
  logDevStatus('dev.desktopLocalApiStarting');
649
- const { siteRoot, localApiBase } = await boot.startDesktopLocalApi(projectRoot, { forceRestart });
683
+ const resolved = await resolveApiPortForBind(projectRoot, { preferred: stack.api });
684
+ if (resolved.shifted || resolved.port !== stack.api) {
685
+ stack = { ...stack, api: resolved.port };
686
+ applyDevStackPortsToEnv(stack);
687
+ }
688
+ const { siteRoot, localApiBase } = await boot.startDesktopLocalApi(projectRoot, {
689
+ forceRestart,
690
+ port: resolved.port,
691
+ });
650
692
  process.env.REACTPRESS_DESKTOP_LOCAL_API = localApiBase;
651
693
  process.env.REACTPRESS_DESKTOP_SITE_ROOT = siteRoot;
652
694
  process.env.REACTPRESS_THEME_API_URL = localApiBase;
@@ -906,6 +948,7 @@ module.exports = {
906
948
  runDevStartup,
907
949
  buildToolkit,
908
950
  assertDevPrerequisites,
951
+ applyAutoLocalDevFallback,
909
952
  prepareDevInfrastructure,
910
953
  startDevStack,
911
954
  detectProjectType,