@fecommunity/reactpress 4.0.0-beta.0 → 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.
- package/dist/utils/server-bundle.js +7 -0
- package/out/bin/reactpress-theme-client.js +64 -1
- package/out/bin/reactpress.js +94 -482
- package/out/core/services/config.js +4 -1
- package/out/core/services/database/index.js +18 -5
- package/out/core/services/database/sqlite.js +28 -5
- package/out/core/services/init.js +1 -53
- package/out/core/services/local-site.js +15 -10
- package/out/core/services/theme-bootstrap.js +50 -0
- package/out/core/utils/env-file.js +99 -0
- package/out/core/utils/paths.js +5 -4
- package/out/lib/api-dev.js +11 -1
- package/out/lib/bootstrap.js +13 -40
- package/out/lib/cli-events.js +54 -0
- package/out/lib/command-palette.js +53 -0
- package/out/lib/context-status.js +154 -0
- package/out/lib/create-site.js +187 -0
- package/out/lib/database-mode.js +45 -0
- package/out/lib/design-tokens.js +55 -0
- package/out/lib/dev-banner.js +10 -5
- package/out/lib/dev-session.js +9 -2
- package/out/lib/dev.js +117 -66
- package/out/lib/docker.js +12 -0
- package/out/lib/doctor.js +131 -10
- package/out/lib/http.js +20 -0
- package/out/lib/i18n/index.js +5 -1
- package/out/lib/i18n/strings.js +184 -52
- package/out/lib/lifecycle.js +21 -1
- package/out/lib/menu-actions.js +418 -0
- package/out/lib/nginx.js +5 -2
- package/out/lib/paths.js +11 -0
- package/out/lib/pm2.js +9 -2
- package/out/lib/ports.js +134 -13
- package/out/lib/project-type.js +18 -0
- package/out/lib/publish.js +3 -0
- package/out/lib/remote-dev.js +5 -1
- package/out/lib/server-bundle.js +84 -0
- package/out/lib/shell-mode.js +23 -0
- package/out/lib/theme-warmup.js +1 -1
- package/out/shell/app.js +384 -0
- package/out/shell/components/brand-banner.js +93 -0
- package/out/shell/components/command-palette.js +77 -0
- package/out/shell/components/dev-stepper.js +54 -0
- package/out/shell/components/ink-theme.js +86 -0
- package/out/shell/components/menu-list.js +49 -0
- package/out/shell/components/pulse-bar.js +55 -0
- package/out/shell/components/status-rack.js +47 -0
- package/out/shell/hooks/use-terminal-size.js +27 -0
- package/out/shell/ink-shell.mjs +12056 -0
- package/out/shell/lib/shell-layout.js +60 -0
- package/out/shell/runtime/render-ink.js +89 -0
- package/out/ui/banner-startup.js +117 -0
- package/out/ui/banner.js +404 -277
- package/out/ui/interactive.js +199 -125
- package/out/ui/prompts.js +91 -0
- package/out/ui/startup-splash.js +185 -0
- package/out/ui/theme.js +62 -10
- package/package.json +5 -3
- package/server/bin/reactpress-server.js +10 -2
- package/server/dist/app.module.js +13 -25
- package/server/dist/filters/http-exception.filter.js +1 -1
- package/server/dist/generate-swagger.js +12 -11
- package/server/dist/interceptors/transform.interceptor.js +10 -5
- package/server/dist/logger/index.js +5 -4
- package/server/dist/main.js +45 -23
- package/server/dist/modules/article/article-revision.entity.js +1 -1
- package/server/dist/modules/article/article.controller.js +103 -48
- package/server/dist/modules/article/article.entity.js +61 -41
- package/server/dist/modules/article/article.module.js +18 -3
- package/server/dist/modules/article/article.service.js +151 -29
- package/server/dist/modules/auth/auth.controller.js +11 -11
- package/server/dist/modules/auth/auth.module.js +4 -4
- package/server/dist/modules/auth/auth.service.js +8 -7
- package/server/dist/modules/auth/jwt-auth.guard.js +4 -3
- package/server/dist/modules/auth/jwt.strategy.js +4 -3
- package/server/dist/modules/auth/roles.guard.js +2 -2
- package/server/dist/modules/category/category.controller.js +21 -20
- package/server/dist/modules/category/category.entity.js +13 -13
- package/server/dist/modules/category/category.module.js +1 -1
- package/server/dist/modules/category/category.service.js +5 -4
- package/server/dist/modules/comment/comment.controller.js +24 -20
- package/server/dist/modules/comment/comment.entity.js +31 -31
- package/server/dist/modules/comment/comment.module.js +11 -2
- package/server/dist/modules/comment/comment.service.js +43 -16
- package/server/dist/modules/comment/html.js +3 -3
- package/server/dist/modules/file/file.controller.js +22 -20
- package/server/dist/modules/file/file.entity.js +20 -15
- package/server/dist/modules/file/file.module.js +16 -4
- package/server/dist/modules/file/file.service.js +70 -24
- package/server/dist/modules/install/install.controller.js +5 -5
- package/server/dist/modules/install/install.module.js +1 -1
- package/server/dist/modules/install/install.service.js +2 -2
- package/server/dist/modules/knowledge/knowledge.controller.js +35 -33
- package/server/dist/modules/knowledge/knowledge.entity.js +33 -33
- package/server/dist/modules/knowledge/knowledge.module.js +1 -1
- package/server/dist/modules/knowledge/knowledge.service.js +12 -11
- package/server/dist/modules/page/page.controller.js +24 -23
- package/server/dist/modules/page/page.entity.js +27 -27
- package/server/dist/modules/page/page.module.js +1 -1
- package/server/dist/modules/page/page.service.js +12 -12
- package/server/dist/modules/search/search.controller.js +12 -12
- package/server/dist/modules/search/search.entity.js +13 -13
- package/server/dist/modules/search/search.module.js +1 -1
- package/server/dist/modules/search/search.service.js +2 -2
- package/server/dist/modules/setting/setting.constant.js +3 -19
- package/server/dist/modules/setting/setting.controller.js +11 -11
- package/server/dist/modules/setting/setting.entity.js +64 -49
- package/server/dist/modules/setting/setting.module.js +2 -2
- package/server/dist/modules/setting/setting.service.js +169 -24
- package/server/dist/modules/smtp/mail.util.js +5 -9
- package/server/dist/modules/smtp/smtp.controller.js +27 -14
- package/server/dist/modules/smtp/smtp.entity.js +15 -15
- package/server/dist/modules/smtp/smtp.module.js +2 -2
- package/server/dist/modules/smtp/smtp.service.js +40 -12
- package/server/dist/modules/tag/tag.controller.js +24 -22
- package/server/dist/modules/tag/tag.entity.js +12 -12
- package/server/dist/modules/tag/tag.module.js +1 -1
- package/server/dist/modules/tag/tag.service.js +5 -4
- package/server/dist/modules/user/user.controller.js +39 -28
- package/server/dist/modules/user/user.entity.js +22 -22
- package/server/dist/modules/user/user.module.js +2 -2
- package/server/dist/modules/user/user.service.js +16 -12
- package/server/dist/modules/view/view.controller.js +20 -19
- package/server/dist/modules/view/view.entity.js +24 -24
- package/server/dist/modules/view/view.module.js +1 -1
- package/server/dist/modules/view/view.service.js +4 -4
- package/server/dist/node-polyfills.js +24 -0
- package/server/dist/starter.js +202 -14
- package/server/dist/utils/date.util.js +1 -1
- package/server/dist/utils/markdown.util.js +1 -1
- package/server/dist/utils/oss/aliyun-oss-client.js +5 -0
- package/server/dist/utils/oss.util.js +6 -1
- package/server/dist/utils/theme-placeholder-cover.js +94 -0
- package/server/dist/utils/uniqueid.util.js +1 -1
- package/server/dist/utils/upload.util.js +23 -8
- package/server/dist/utils/user.util.js +6 -2
- package/server/package-lock.json +21077 -0
- package/server/package.json +13 -10
- package/server/public/favicon.png +0 -0
- package/templates/config.local.json +1 -1
- package/templates/env.local.default +1 -1
- package/toolkit/dist/.source-fingerprint-toolkit +1 -0
- package/toolkit/dist/admin/index.js +18 -0
- package/toolkit/dist/admin/permissions.js +33 -0
- package/toolkit/dist/admin/registry.js +79 -0
- package/toolkit/dist/api/Article.js +188 -0
- package/toolkit/dist/api/Auth.js +58 -0
- package/toolkit/dist/api/Category.js +84 -0
- package/toolkit/dist/api/Comment.js +97 -0
- package/toolkit/dist/api/File.js +71 -0
- package/toolkit/dist/api/HttpClient.js +96 -0
- package/toolkit/dist/api/Knowledge.js +123 -0
- package/toolkit/dist/api/Page.js +97 -0
- package/toolkit/dist/api/Search.js +58 -0
- package/toolkit/dist/api/Setting.js +45 -0
- package/toolkit/dist/api/Smtp.js +73 -0
- package/toolkit/dist/api/Tag.js +97 -0
- package/toolkit/dist/api/User.js +72 -0
- package/toolkit/dist/api/View.js +84 -0
- package/toolkit/dist/api/index.js +30 -0
- package/toolkit/dist/api/instance.js +71 -0
- package/toolkit/dist/app/createReactPressApp.js +265 -0
- package/toolkit/dist/app/createThemeApp.js +51 -0
- package/toolkit/dist/app/devChunkRecovery.js +68 -0
- package/toolkit/dist/app/index.js +11 -0
- package/toolkit/dist/config/env.js +103 -0
- package/toolkit/dist/config/global.js +396 -0
- package/toolkit/dist/config/i18n.js +59 -0
- package/toolkit/dist/config/index.js +26 -0
- package/toolkit/dist/config/locales/en.json +125 -0
- package/toolkit/dist/config/locales/zh.json +125 -0
- package/toolkit/dist/dev/index.js +12 -0
- package/toolkit/dist/dev/portRedirect.js +93 -0
- package/toolkit/dist/dev/vitePortRedirectPlugin.js +40 -0
- package/toolkit/dist/extension/branding-mods.js +65 -0
- package/toolkit/dist/extension/configuration/defaults.js +32 -0
- package/toolkit/dist/extension/configuration/formily.js +170 -0
- package/toolkit/dist/extension/configuration/index.js +28 -0
- package/toolkit/dist/extension/configuration/paths.js +50 -0
- package/toolkit/dist/extension/configuration/presets/twentytwentyfive.js +94 -0
- package/toolkit/dist/extension/configuration/resolve.js +98 -0
- package/toolkit/dist/extension/configuration/types.js +3 -0
- package/toolkit/dist/extension/configuration/validate.js +21 -0
- package/toolkit/dist/extension/index.js +35 -0
- package/toolkit/dist/extension/manifest-normalize.js +75 -0
- package/toolkit/dist/extension/node.js +6 -0
- package/toolkit/dist/extension/presets/twentytwentyfive-appearance.js +193 -0
- package/toolkit/dist/extension/presets/twentytwentyfive-customizer.js +199 -0
- package/toolkit/dist/extension/preview.js +92 -0
- package/toolkit/dist/extension/site-notices.js +88 -0
- package/toolkit/dist/extension/site-settings.js +144 -0
- package/toolkit/dist/extension/theme-admin-locale.io.js +54 -0
- package/toolkit/dist/extension/theme-admin-locale.js +81 -0
- package/toolkit/dist/extension/theme.js +93 -0
- package/toolkit/dist/extension/twentytwentyfive-vars.js +100 -0
- package/toolkit/dist/index.js +60 -0
- package/toolkit/dist/plugin/admin/index.js +20 -0
- package/toolkit/dist/plugin/admin/permissions.js +33 -0
- package/toolkit/dist/plugin/admin/plugin-admin.js +41 -0
- package/toolkit/dist/plugin/admin/registry.js +79 -0
- package/toolkit/dist/plugin/admin/slots.js +16 -0
- package/toolkit/dist/plugin/client/client.js +95 -0
- package/toolkit/dist/plugin/client/index.js +11 -0
- package/toolkit/dist/plugin/client/runtime.js +30 -0
- package/toolkit/dist/plugin/dev/index.js +16 -0
- package/toolkit/dist/plugin/dev/portRedirect.js +111 -0
- package/toolkit/dist/plugin/dev/vitePortRedirectPlugin.js +40 -0
- package/toolkit/dist/plugin/extension/index.js +20 -0
- package/toolkit/dist/plugin/extension/plugin-admin-locale.io.js +54 -0
- package/toolkit/dist/plugin/extension/plugin-admin-locale.js +60 -0
- package/toolkit/dist/plugin/extension/plugin.js +146 -0
- package/toolkit/dist/plugin/extension/security.js +74 -0
- package/toolkit/dist/plugin/extension/validate.js +55 -0
- package/toolkit/dist/plugin/index.js +52 -0
- package/toolkit/dist/plugin/node.js +6 -0
- package/toolkit/dist/plugin/react/client.js +95 -0
- package/toolkit/dist/plugin/react/index.js +19 -0
- package/toolkit/dist/plugin/react/plugin-admin-ui.js +38 -0
- package/toolkit/dist/plugin/react/runtime.js +30 -0
- package/toolkit/dist/plugin/server/hook-reject.js +39 -0
- package/toolkit/dist/plugin/server/index.js +18 -0
- package/toolkit/dist/plugin/server/types.js +3 -0
- package/toolkit/dist/primitives/AntdStyleTransitionFix.js +16 -0
- package/toolkit/dist/primitives/Badge.js +9 -0
- package/toolkit/dist/primitives/Button.js +38 -0
- package/toolkit/dist/primitives/ColorModeToggle.js +13 -0
- package/toolkit/dist/primitives/IconButton.js +13 -0
- package/toolkit/dist/primitives/ScrollToTarget.js +48 -0
- package/toolkit/dist/primitives/Separator.js +9 -0
- package/toolkit/dist/primitives/Skeleton.js +9 -0
- package/toolkit/dist/primitives/Slot.js +25 -0
- package/toolkit/dist/primitives/Spinner.js +9 -0
- package/toolkit/dist/primitives/animation/ConditionTransition.js +13 -0
- package/toolkit/dist/primitives/animation/ListTrail.js +14 -0
- package/toolkit/dist/primitives/animation/Opacity.js +10 -0
- package/toolkit/dist/primitives/animation/Spring.js +29 -0
- package/toolkit/dist/primitives/animation/index.js +11 -0
- package/toolkit/dist/primitives/cn.js +7 -0
- package/toolkit/dist/primitives/icons.js +15 -0
- package/toolkit/dist/primitives/index.js +44 -0
- package/toolkit/dist/react/client.js +95 -0
- package/toolkit/dist/react/index.js +11 -0
- package/toolkit/dist/react/runtime.js +30 -0
- package/toolkit/dist/theme/antdDocument.js +59 -0
- package/toolkit/dist/theme/api/api-data.js +8 -0
- package/toolkit/dist/theme/api/api.js +27 -0
- package/toolkit/dist/theme/api/httpClient.js +83 -0
- package/toolkit/dist/theme/api/json.js +5 -0
- package/toolkit/dist/theme/api/jsonp.js +5 -0
- package/toolkit/dist/theme/api-data.js +22 -0
- package/toolkit/dist/theme/api.js +27 -0
- package/toolkit/dist/theme/appearance.js +16 -0
- package/toolkit/dist/theme/assets.js +27 -0
- package/toolkit/dist/theme/authSession.js +92 -0
- package/toolkit/dist/theme/build/antdDocument.js +70 -0
- package/toolkit/dist/theme/build/next-config.js +63 -0
- package/toolkit/dist/theme/build/node.js +6 -0
- package/toolkit/dist/theme/colorMode.js +45 -0
- package/toolkit/dist/theme/commentAuthor.js +48 -0
- package/toolkit/dist/theme/content/archiveSlim.js +38 -0
- package/toolkit/dist/theme/content/articleSlim.js +35 -0
- package/toolkit/dist/theme/content/assets.js +106 -0
- package/toolkit/dist/theme/content/carouselArticles.js +39 -0
- package/toolkit/dist/theme/content/excerpt.js +42 -0
- package/toolkit/dist/theme/content/nav.js +30 -0
- package/toolkit/dist/theme/content/seo.js +12 -0
- package/toolkit/dist/theme/createAntdApp.js +175 -0
- package/toolkit/dist/theme/createApp.js +141 -0
- package/toolkit/dist/theme/createCatalogApp.js +168 -0
- package/toolkit/dist/theme/customizer.js +5 -0
- package/toolkit/dist/theme/excerpt.js +31 -0
- package/toolkit/dist/theme/extension/branding-mods.js +65 -0
- package/toolkit/dist/theme/extension/configuration/defaults.js +32 -0
- package/toolkit/dist/theme/extension/configuration/formily.js +170 -0
- package/toolkit/dist/theme/extension/configuration/index.js +28 -0
- package/toolkit/dist/theme/extension/configuration/paths.js +7 -0
- package/toolkit/dist/theme/extension/configuration/presets/twentytwentyfive.js +94 -0
- package/toolkit/dist/theme/extension/configuration/resolve.js +98 -0
- package/toolkit/dist/theme/extension/configuration/types.js +3 -0
- package/toolkit/dist/theme/extension/configuration/validate.js +21 -0
- package/toolkit/dist/theme/extension/index.js +38 -0
- package/toolkit/dist/theme/extension/manifest-normalize.js +75 -0
- package/toolkit/dist/theme/extension/presets/twentytwentyfive-appearance.js +193 -0
- package/toolkit/dist/theme/extension/preview.js +92 -0
- package/toolkit/dist/theme/extension/site-notices.js +88 -0
- package/toolkit/dist/theme/extension/site-settings.js +144 -0
- package/toolkit/dist/theme/extension/siteNav.js +17 -0
- package/toolkit/dist/theme/extension/theme-admin-locale.io.js +54 -0
- package/toolkit/dist/theme/extension/theme-admin-locale.js +68 -0
- package/toolkit/dist/theme/extension/theme.js +93 -0
- package/toolkit/dist/theme/extension/twentytwentyfive-vars.js +103 -0
- package/toolkit/dist/theme/fetch.js +241 -0
- package/toolkit/dist/theme/format.js +48 -0
- package/toolkit/dist/theme/httpClient.js +89 -0
- package/toolkit/dist/theme/index.js +226 -0
- package/toolkit/dist/theme/json.js +17 -0
- package/toolkit/dist/theme/jsonp.js +27 -0
- package/toolkit/dist/theme/locale.js +55 -0
- package/toolkit/dist/theme/nav.js +30 -0
- package/toolkit/dist/theme/next-config.js +18 -0
- package/toolkit/dist/theme/node.js +18 -0
- package/toolkit/dist/theme/preview/preview-config.js +65 -0
- package/toolkit/dist/theme/preview/preview-draft.js +51 -0
- package/toolkit/dist/theme/preview/preview-mods.js +78 -0
- package/toolkit/dist/theme/preview-config.js +65 -0
- package/toolkit/dist/theme/preview-draft.js +51 -0
- package/toolkit/dist/theme/preview-mods.js +78 -0
- package/toolkit/dist/theme/providers/index.js +251 -0
- package/toolkit/dist/theme/providers/setup.js +29 -0
- package/toolkit/dist/theme/runtime.js +19 -0
- package/toolkit/dist/theme/seo.js +12 -0
- package/toolkit/dist/theme/server.js +177 -0
- package/toolkit/dist/theme/setting.js +42 -0
- package/toolkit/dist/theme/ssr/bootstrap.js +112 -0
- package/toolkit/dist/theme/ssr/fetch.js +264 -0
- package/toolkit/dist/theme/ssr/format.js +8 -0
- package/toolkit/dist/theme/ssr/pageProps.js +155 -0
- package/toolkit/dist/theme/ssr/setting.js +45 -0
- package/toolkit/dist/theme/ssr/slimBootstrap.js +75 -0
- package/toolkit/dist/theme/ssr/static.js +17 -0
- package/toolkit/dist/theme/ssr/templates.js +50 -0
- package/toolkit/dist/theme/static.js +17 -0
- package/toolkit/dist/theme/templates.js +38 -0
- package/toolkit/dist/theme/ui-optional.js +21 -0
- package/toolkit/dist/theme/visitor/appearance.js +16 -0
- package/toolkit/dist/theme/visitor/authSession.js +92 -0
- package/toolkit/dist/theme/visitor/colorMode.js +59 -0
- package/toolkit/dist/theme/visitor/commentAuthor.js +45 -0
- package/toolkit/dist/theme/visitor/i18n.js +28 -0
- package/toolkit/dist/theme/visitor/locale.js +72 -0
- package/toolkit/dist/theme/visitor/runtime.js +19 -0
- package/toolkit/dist/theme/visitor/visitorLocale.js +56 -0
- package/toolkit/dist/theme/visitorLocale.js +39 -0
- package/toolkit/dist/types/index.js +12 -0
- package/toolkit/dist/ui/AntdStyleTransitionFix.js +16 -0
- package/toolkit/dist/ui/ArchiveEmptyState.js +8 -0
- package/toolkit/dist/ui/ArchivePageLayout.js +8 -0
- package/toolkit/dist/ui/ArticleCard.js +16 -0
- package/toolkit/dist/ui/ArticleList.js +16 -0
- package/toolkit/dist/ui/BaseGlobalStyles.js +18 -0
- package/toolkit/dist/ui/LocaleSwitcher.js +15 -0
- package/toolkit/dist/ui/NavMenu.js +8 -0
- package/toolkit/dist/ui/NotFoundPanel.js +8 -0
- package/toolkit/dist/ui/PageHeader.js +8 -0
- package/toolkit/dist/ui/SiteBranding.js +14 -0
- package/toolkit/dist/ui/SiteDocument.js +13 -0
- package/toolkit/dist/ui/SiteDocumentFallback.js +9 -0
- package/toolkit/dist/ui/SiteLogo.js +16 -0
- package/toolkit/dist/ui/SiteTagline.js +15 -0
- package/toolkit/dist/ui/TaxonomyList.js +30 -0
- package/toolkit/dist/ui/ThemeCssVars.js +85 -0
- package/toolkit/dist/ui/ThemeLayout.js +11 -0
- package/toolkit/dist/ui/components/AntdStyleTransitionFix.js +16 -0
- package/toolkit/dist/ui/components/ArchiveEmptyState.js +8 -0
- package/toolkit/dist/ui/components/ArchivePageLayout.js +8 -0
- package/toolkit/dist/ui/components/ArticleCard.js +16 -0
- package/toolkit/dist/ui/components/ArticleList.js +16 -0
- package/toolkit/dist/ui/components/BaseGlobalStyles.js +18 -0
- package/toolkit/dist/ui/components/LocaleSwitcher.js +11 -0
- package/toolkit/dist/ui/components/NavMenu.js +8 -0
- package/toolkit/dist/ui/components/NotFoundPanel.js +8 -0
- package/toolkit/dist/ui/components/PageHeader.js +8 -0
- package/toolkit/dist/ui/components/RouteProgress.js +40 -0
- package/toolkit/dist/ui/components/SiteAnalytics.js +42 -0
- package/toolkit/dist/ui/components/SiteBranding.js +14 -0
- package/toolkit/dist/ui/components/SiteDocument.js +13 -0
- package/toolkit/dist/ui/components/SiteDocumentFallback.js +9 -0
- package/toolkit/dist/ui/components/SiteLogo.js +23 -0
- package/toolkit/dist/ui/components/SiteSeo.js +19 -0
- package/toolkit/dist/ui/components/SiteTagline.js +15 -0
- package/toolkit/dist/ui/components/TaxonomyList.js +30 -0
- package/toolkit/dist/ui/components/ThemeCssVars.js +85 -0
- package/toolkit/dist/ui/components/ThemeLayout.js +11 -0
- package/toolkit/dist/ui/components/content/ArticleReader.js +23 -0
- package/toolkit/dist/ui/components/content/ArticleToc.js +75 -0
- package/toolkit/dist/ui/components/content/HtmlContent.js +237 -0
- package/toolkit/dist/ui/components/content/Image.js +13 -0
- package/toolkit/dist/ui/components/content/ImageViewer.js +33 -0
- package/toolkit/dist/ui/components/content/LocaleTime.js +63 -0
- package/toolkit/dist/ui/components/content/index.js +18 -0
- package/toolkit/dist/ui/components/toolbar/LocaleToggleButton.js +18 -0
- package/toolkit/dist/ui/components/toolbar/ThemeToggleButton.js +10 -0
- package/toolkit/dist/ui/components/toolbar/ToolbarIconButton.js +22 -0
- package/toolkit/dist/ui/components/toolbar/constants.js +8 -0
- package/toolkit/dist/ui/components/toolbar/icons.js +44 -0
- package/toolkit/dist/ui/components/toolbar/index.js +25 -0
- package/toolkit/dist/ui/components/toolbar/locale-label.js +19 -0
- package/toolkit/dist/ui/context/LocaleContext.js +59 -0
- package/toolkit/dist/ui/context/ReactPressProvider.js +10 -0
- package/toolkit/dist/ui/context/SiteCatalogContext.js +60 -0
- package/toolkit/dist/ui/context/ThemeRuntimeContext.js +59 -0
- package/toolkit/dist/ui/context/index.js +26 -0
- package/toolkit/dist/ui/context/siteCatalogTypes.js +20 -0
- package/toolkit/dist/ui/context/types.js +2 -0
- package/toolkit/dist/ui/hooks/index.js +29 -0
- package/toolkit/dist/ui/hooks/useAsyncLoading.js +31 -0
- package/toolkit/dist/ui/hooks/useForceUpdate.js +11 -0
- package/toolkit/dist/ui/hooks/useNavActive.js +11 -0
- package/toolkit/dist/ui/hooks/usePagination.js +55 -0
- package/toolkit/dist/ui/hooks/useReportArticleView.js +40 -0
- package/toolkit/dist/ui/hooks/useReportPageView.js +28 -0
- package/toolkit/dist/ui/hooks/useRouteParam.js +15 -0
- package/toolkit/dist/ui/hooks/useToggle.js +17 -0
- package/toolkit/dist/ui/hooks/useWarningOnExit.js +59 -0
- package/toolkit/dist/ui/index.js +87 -0
- package/toolkit/dist/utils/api-envelope.js +31 -0
- package/toolkit/dist/utils/clipboard.js +24 -0
- package/toolkit/dist/utils/cookie.js +15 -0
- package/toolkit/dist/utils/date.js +45 -0
- package/toolkit/dist/utils/email.js +9 -0
- package/toolkit/dist/utils/error.js +26 -0
- package/toolkit/dist/utils/image.js +34 -0
- package/toolkit/dist/utils/index.js +39 -0
- package/toolkit/dist/utils/json.js +18 -0
- package/toolkit/dist/utils/jsonp.js +27 -0
- package/toolkit/dist/utils/object.js +63 -0
- package/toolkit/dist/utils/setting.js +13 -0
- package/toolkit/dist/utils/string.js +15 -0
- package/toolkit/dist/utils/viewport.js +14 -0
- package/toolkit/package-lock.json +452 -0
- package/toolkit/package.json +96 -0
- package/dist/cli.d.ts +0 -4
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/config.d.ts +0 -8
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/init.d.ts +0 -6
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/restart.d.ts +0 -2
- package/dist/commands/restart.d.ts.map +0 -1
- package/dist/commands/restart.js.map +0 -1
- package/dist/commands/start.d.ts +0 -2
- package/dist/commands/start.d.ts.map +0 -1
- package/dist/commands/start.js.map +0 -1
- package/dist/commands/status.d.ts +0 -2
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/stop.d.ts +0 -5
- package/dist/commands/stop.d.ts.map +0 -1
- package/dist/commands/stop.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/services/config.d.ts +0 -11
- package/dist/services/config.d.ts.map +0 -1
- package/dist/services/config.js.map +0 -1
- package/dist/services/database.d.ts +0 -43
- package/dist/services/database.d.ts.map +0 -1
- package/dist/services/database.js.map +0 -1
- package/dist/services/exec.d.ts +0 -22
- package/dist/services/exec.d.ts.map +0 -1
- package/dist/services/exec.js.map +0 -1
- package/dist/services/init.d.ts +0 -10
- package/dist/services/init.d.ts.map +0 -1
- package/dist/services/init.js.map +0 -1
- package/dist/services/process.d.ts +0 -9
- package/dist/services/process.d.ts.map +0 -1
- package/dist/services/process.js.map +0 -1
- package/dist/services/server-health.d.ts +0 -4
- package/dist/services/server-health.d.ts.map +0 -1
- package/dist/services/server-health.js.map +0 -1
- package/dist/services/server.d.ts +0 -19
- package/dist/services/server.d.ts.map +0 -1
- package/dist/services/server.js.map +0 -1
- package/dist/types/config.d.ts +0 -30
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js.map +0 -1
- package/dist/utils/cli-context.d.ts +0 -4
- package/dist/utils/cli-context.d.ts.map +0 -1
- package/dist/utils/cli-context.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -10
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -17
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/platform.d.ts +0 -8
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/port.d.ts +0 -5
- package/dist/utils/port.d.ts.map +0 -1
- package/dist/utils/port.js.map +0 -1
- package/dist/utils/server-bundle.d.ts +0 -11
- package/dist/utils/server-bundle.d.ts.map +0 -1
- package/dist/utils/server-bundle.js.map +0 -1
- package/out/bin/reactpress-cli-shim.d.ts +0 -3
- package/out/bin/reactpress-cli-shim.d.ts.map +0 -1
- package/out/bin/reactpress-cli-shim.js.map +0 -1
- package/out/bin/reactpress-theme-client.d.ts +0 -3
- package/out/bin/reactpress-theme-client.d.ts.map +0 -1
- package/out/bin/reactpress-theme-client.js.map +0 -1
- package/out/bin/reactpress.d.ts +0 -3
- package/out/bin/reactpress.d.ts.map +0 -1
- package/out/bin/reactpress.js.map +0 -1
- package/out/core/services/config.d.ts +0 -12
- package/out/core/services/config.d.ts.map +0 -1
- package/out/core/services/config.js.map +0 -1
- package/out/core/services/database/index.d.ts +0 -17
- package/out/core/services/database/index.d.ts.map +0 -1
- package/out/core/services/database/index.js.map +0 -1
- package/out/core/services/database/mysql.d.ts +0 -14
- package/out/core/services/database/mysql.d.ts.map +0 -1
- package/out/core/services/database/mysql.js.map +0 -1
- package/out/core/services/database/profile.d.ts +0 -6
- package/out/core/services/database/profile.d.ts.map +0 -1
- package/out/core/services/database/profile.js.map +0 -1
- package/out/core/services/database/sqlite.d.ts +0 -10
- package/out/core/services/database/sqlite.d.ts.map +0 -1
- package/out/core/services/database/sqlite.js.map +0 -1
- package/out/core/services/exec.d.ts +0 -21
- package/out/core/services/exec.d.ts.map +0 -1
- package/out/core/services/exec.js.map +0 -1
- package/out/core/services/init.d.ts +0 -11
- package/out/core/services/init.d.ts.map +0 -1
- package/out/core/services/init.js.map +0 -1
- package/out/core/services/local-site.d.ts +0 -24
- package/out/core/services/local-site.d.ts.map +0 -1
- package/out/core/services/local-site.js.map +0 -1
- package/out/core/utils/cli-context.d.ts +0 -3
- package/out/core/utils/cli-context.d.ts.map +0 -1
- package/out/core/utils/cli-context.js.map +0 -1
- package/out/core/utils/paths.d.ts +0 -20
- package/out/core/utils/paths.d.ts.map +0 -1
- package/out/core/utils/paths.js.map +0 -1
- package/out/core/utils/platform.d.ts +0 -7
- package/out/core/utils/platform.d.ts.map +0 -1
- package/out/core/utils/platform.js.map +0 -1
- package/out/core/utils/port.d.ts +0 -4
- package/out/core/utils/port.d.ts.map +0 -1
- package/out/core/utils/port.js.map +0 -1
- package/out/lib/api-dev-runner.d.ts +0 -3
- package/out/lib/api-dev-runner.d.ts.map +0 -1
- package/out/lib/api-dev-runner.js.map +0 -1
- package/out/lib/api-dev.d.ts +0 -2
- package/out/lib/api-dev.d.ts.map +0 -1
- package/out/lib/api-dev.js.map +0 -1
- package/out/lib/bootstrap.d.ts +0 -18
- package/out/lib/bootstrap.d.ts.map +0 -1
- package/out/lib/bootstrap.js.map +0 -1
- package/out/lib/build.d.ts +0 -2
- package/out/lib/build.d.ts.map +0 -1
- package/out/lib/build.js.map +0 -1
- package/out/lib/db-backup.d.ts +0 -2
- package/out/lib/db-backup.d.ts.map +0 -1
- package/out/lib/db-backup.js.map +0 -1
- package/out/lib/dev-banner.d.ts +0 -2
- package/out/lib/dev-banner.d.ts.map +0 -1
- package/out/lib/dev-banner.js.map +0 -1
- package/out/lib/dev-child-io.d.ts +0 -2
- package/out/lib/dev-child-io.d.ts.map +0 -1
- package/out/lib/dev-child-io.js.map +0 -1
- package/out/lib/dev-log.d.ts +0 -2
- package/out/lib/dev-log.d.ts.map +0 -1
- package/out/lib/dev-log.js.map +0 -1
- package/out/lib/dev-session.d.ts +0 -2
- package/out/lib/dev-session.d.ts.map +0 -1
- package/out/lib/dev-session.js.map +0 -1
- package/out/lib/dev.d.ts +0 -2
- package/out/lib/dev.d.ts.map +0 -1
- package/out/lib/dev.js.map +0 -1
- package/out/lib/docker.d.ts +0 -2
- package/out/lib/docker.d.ts.map +0 -1
- package/out/lib/docker.js.map +0 -1
- package/out/lib/doctor.d.ts +0 -2
- package/out/lib/doctor.d.ts.map +0 -1
- package/out/lib/doctor.js.map +0 -1
- package/out/lib/health-parse.d.ts +0 -5
- package/out/lib/health-parse.d.ts.map +0 -1
- package/out/lib/health-parse.js.map +0 -1
- package/out/lib/health-parse.test.d.ts +0 -2
- package/out/lib/health-parse.test.d.ts.map +0 -1
- package/out/lib/health-parse.test.js.map +0 -1
- package/out/lib/http.d.ts +0 -2
- package/out/lib/http.d.ts.map +0 -1
- package/out/lib/http.js.map +0 -1
- package/out/lib/i18n/index.d.ts +0 -2
- package/out/lib/i18n/index.d.ts.map +0 -1
- package/out/lib/i18n/index.js.map +0 -1
- package/out/lib/i18n/strings.d.ts +0 -2
- package/out/lib/i18n/strings.d.ts.map +0 -1
- package/out/lib/i18n/strings.js.map +0 -1
- package/out/lib/lifecycle.d.ts +0 -2
- package/out/lib/lifecycle.d.ts.map +0 -1
- package/out/lib/lifecycle.js.map +0 -1
- package/out/lib/nginx.d.ts +0 -2
- package/out/lib/nginx.d.ts.map +0 -1
- package/out/lib/nginx.js.map +0 -1
- package/out/lib/paths.d.ts +0 -2
- package/out/lib/paths.d.ts.map +0 -1
- package/out/lib/paths.js.map +0 -1
- package/out/lib/plugin-build.d.ts +0 -2
- package/out/lib/plugin-build.d.ts.map +0 -1
- package/out/lib/plugin-build.js.map +0 -1
- package/out/lib/plugin-cli.d.ts +0 -2
- package/out/lib/plugin-cli.d.ts.map +0 -1
- package/out/lib/plugin-cli.js.map +0 -1
- package/out/lib/pm2.d.ts +0 -2
- package/out/lib/pm2.d.ts.map +0 -1
- package/out/lib/pm2.js.map +0 -1
- package/out/lib/ports.d.ts +0 -2
- package/out/lib/ports.d.ts.map +0 -1
- package/out/lib/ports.js.map +0 -1
- package/out/lib/process.d.ts +0 -2
- package/out/lib/process.d.ts.map +0 -1
- package/out/lib/process.js.map +0 -1
- package/out/lib/prod-memory.d.ts +0 -6
- package/out/lib/prod-memory.d.ts.map +0 -1
- package/out/lib/prod-memory.js.map +0 -1
- package/out/lib/project-type.d.ts +0 -2
- package/out/lib/project-type.d.ts.map +0 -1
- package/out/lib/project-type.js.map +0 -1
- package/out/lib/publish.d.ts +0 -3
- package/out/lib/publish.d.ts.map +0 -1
- package/out/lib/publish.js.map +0 -1
- package/out/lib/remote-dev.d.ts +0 -2
- package/out/lib/remote-dev.d.ts.map +0 -1
- package/out/lib/remote-dev.js.map +0 -1
- package/out/lib/root.d.ts +0 -2
- package/out/lib/root.d.ts.map +0 -1
- package/out/lib/root.js.map +0 -1
- package/out/lib/spawn.d.ts +0 -2
- package/out/lib/spawn.d.ts.map +0 -1
- package/out/lib/spawn.js.map +0 -1
- package/out/lib/status.d.ts +0 -2
- package/out/lib/status.d.ts.map +0 -1
- package/out/lib/status.js.map +0 -1
- package/out/lib/theme-catalog.d.ts +0 -2
- package/out/lib/theme-catalog.d.ts.map +0 -1
- package/out/lib/theme-catalog.js.map +0 -1
- package/out/lib/theme-cli.d.ts +0 -2
- package/out/lib/theme-cli.d.ts.map +0 -1
- package/out/lib/theme-cli.js.map +0 -1
- package/out/lib/theme-dev.d.ts +0 -2
- package/out/lib/theme-dev.d.ts.map +0 -1
- package/out/lib/theme-dev.js.map +0 -1
- package/out/lib/theme-env.d.ts +0 -2
- package/out/lib/theme-env.d.ts.map +0 -1
- package/out/lib/theme-env.js.map +0 -1
- package/out/lib/theme-install.d.ts +0 -2
- package/out/lib/theme-install.d.ts.map +0 -1
- package/out/lib/theme-install.js.map +0 -1
- package/out/lib/theme-lock.d.ts +0 -2
- package/out/lib/theme-lock.d.ts.map +0 -1
- package/out/lib/theme-lock.js.map +0 -1
- package/out/lib/theme-paths.d.ts +0 -2
- package/out/lib/theme-paths.d.ts.map +0 -1
- package/out/lib/theme-paths.js.map +0 -1
- package/out/lib/theme-placeholder-cover.d.ts +0 -13
- package/out/lib/theme-placeholder-cover.d.ts.map +0 -1
- package/out/lib/theme-placeholder-cover.js.map +0 -1
- package/out/lib/theme-preview-frame.d.ts +0 -2
- package/out/lib/theme-preview-frame.d.ts.map +0 -1
- package/out/lib/theme-preview-frame.js.map +0 -1
- package/out/lib/theme-preview-pool.d.ts +0 -2
- package/out/lib/theme-preview-pool.d.ts.map +0 -1
- package/out/lib/theme-preview-pool.js.map +0 -1
- package/out/lib/theme-preview-proxy.d.ts +0 -2
- package/out/lib/theme-preview-proxy.d.ts.map +0 -1
- package/out/lib/theme-preview-proxy.js.map +0 -1
- package/out/lib/theme-prod.d.ts +0 -2
- package/out/lib/theme-prod.d.ts.map +0 -1
- package/out/lib/theme-prod.js.map +0 -1
- package/out/lib/theme-registry.d.ts +0 -2
- package/out/lib/theme-registry.d.ts.map +0 -1
- package/out/lib/theme-registry.js.map +0 -1
- package/out/lib/theme-runtime.d.ts +0 -2
- package/out/lib/theme-runtime.d.ts.map +0 -1
- package/out/lib/theme-runtime.js.map +0 -1
- package/out/lib/theme-sources.d.ts +0 -2
- package/out/lib/theme-sources.d.ts.map +0 -1
- package/out/lib/theme-sources.js.map +0 -1
- package/out/lib/theme-warmup.d.ts +0 -2
- package/out/lib/theme-warmup.d.ts.map +0 -1
- package/out/lib/theme-warmup.js.map +0 -1
- package/out/lib/toolkit-build.d.ts +0 -2
- package/out/lib/toolkit-build.d.ts.map +0 -1
- package/out/lib/toolkit-build.js.map +0 -1
- package/out/types/config.d.ts +0 -57
- package/out/types/config.d.ts.map +0 -1
- package/out/types/config.js.map +0 -1
- package/out/ui/banner.d.ts +0 -2
- package/out/ui/banner.d.ts.map +0 -1
- package/out/ui/banner.js.map +0 -1
- package/out/ui/interactive.d.ts +0 -2
- package/out/ui/interactive.d.ts.map +0 -1
- package/out/ui/interactive.js.map +0 -1
- package/out/ui/theme.d.ts +0 -2
- package/out/ui/theme.d.ts.map +0 -1
- package/out/ui/theme.js.map +0 -1
- package/server/dist/app.module.d.ts +0 -2
- package/server/dist/app.module.js.map +0 -1
- package/server/dist/common/api-messages.d.ts +0 -41
- package/server/dist/common/api-messages.js.map +0 -1
- package/server/dist/database/typeorm-options.d.ts +0 -3
- package/server/dist/database/typeorm-options.js.map +0 -1
- package/server/dist/filters/http-exception.filter.d.ts +0 -4
- package/server/dist/filters/http-exception.filter.js.map +0 -1
- package/server/dist/generate-swagger.d.ts +0 -1
- package/server/dist/generate-swagger.js.map +0 -1
- package/server/dist/interceptors/transform.interceptor.d.ts +0 -9
- package/server/dist/interceptors/transform.interceptor.js.map +0 -1
- package/server/dist/logger/index.d.ts +0 -4
- package/server/dist/logger/index.js.map +0 -1
- package/server/dist/main.d.ts +0 -6
- package/server/dist/main.js.map +0 -1
- package/server/dist/modules/api-key/api-key.controller.d.ts +0 -14
- package/server/dist/modules/api-key/api-key.controller.js.map +0 -1
- package/server/dist/modules/api-key/api-key.entity.d.ts +0 -11
- package/server/dist/modules/api-key/api-key.entity.js.map +0 -1
- package/server/dist/modules/api-key/api-key.guard.d.ts +0 -7
- package/server/dist/modules/api-key/api-key.guard.js.map +0 -1
- package/server/dist/modules/api-key/api-key.module.d.ts +0 -2
- package/server/dist/modules/api-key/api-key.module.js.map +0 -1
- package/server/dist/modules/api-key/api-key.service.d.ts +0 -15
- package/server/dist/modules/api-key/api-key.service.js.map +0 -1
- package/server/dist/modules/article/article-revision.entity.d.ts +0 -11
- package/server/dist/modules/article/article-revision.entity.js.map +0 -1
- package/server/dist/modules/article/article-slug.util.d.ts +0 -2
- package/server/dist/modules/article/article-slug.util.js.map +0 -1
- package/server/dist/modules/article/article.controller.d.ts +0 -27
- package/server/dist/modules/article/article.controller.js.map +0 -1
- package/server/dist/modules/article/article.entity.d.ts +0 -23
- package/server/dist/modules/article/article.entity.js.map +0 -1
- package/server/dist/modules/article/article.module.d.ts +0 -2
- package/server/dist/modules/article/article.module.js.map +0 -1
- package/server/dist/modules/article/article.service.d.ts +0 -30
- package/server/dist/modules/article/article.service.js.map +0 -1
- package/server/dist/modules/article/article.util.d.ts +0 -1
- package/server/dist/modules/article/article.util.js.map +0 -1
- package/server/dist/modules/article/scheduled-publish.service.d.ts +0 -13
- package/server/dist/modules/article/scheduled-publish.service.js.map +0 -1
- package/server/dist/modules/auth/auth.controller.d.ts +0 -12
- package/server/dist/modules/auth/auth.controller.js.map +0 -1
- package/server/dist/modules/auth/auth.module.d.ts +0 -2
- package/server/dist/modules/auth/auth.module.js.map +0 -1
- package/server/dist/modules/auth/auth.service.d.ts +0 -26
- package/server/dist/modules/auth/auth.service.js.map +0 -1
- package/server/dist/modules/auth/jwt-auth.guard.d.ts +0 -7
- package/server/dist/modules/auth/jwt-auth.guard.js.map +0 -1
- package/server/dist/modules/auth/jwt.strategy.d.ts +0 -9
- package/server/dist/modules/auth/jwt.strategy.js.map +0 -1
- package/server/dist/modules/auth/roles.guard.d.ts +0 -10
- package/server/dist/modules/auth/roles.guard.js.map +0 -1
- package/server/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
- package/server/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
- package/server/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
- package/server/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
- package/server/dist/modules/bootstrap/install-locale.d.ts +0 -2
- package/server/dist/modules/bootstrap/install-locale.js.map +0 -1
- package/server/dist/modules/category/category.controller.d.ts +0 -11
- package/server/dist/modules/category/category.controller.js.map +0 -1
- package/server/dist/modules/category/category.entity.d.ts +0 -9
- package/server/dist/modules/category/category.entity.js.map +0 -1
- package/server/dist/modules/category/category.module.d.ts +0 -2
- package/server/dist/modules/category/category.module.js.map +0 -1
- package/server/dist/modules/category/category.service.d.ts +0 -12
- package/server/dist/modules/category/category.service.js.map +0 -1
- package/server/dist/modules/comment/comment.controller.d.ts +0 -12
- package/server/dist/modules/comment/comment.controller.js.map +0 -1
- package/server/dist/modules/comment/comment.entity.d.ts +0 -17
- package/server/dist/modules/comment/comment.entity.js.map +0 -1
- package/server/dist/modules/comment/comment.module.d.ts +0 -2
- package/server/dist/modules/comment/comment.module.js.map +0 -1
- package/server/dist/modules/comment/comment.service.d.ts +0 -24
- package/server/dist/modules/comment/comment.service.js.map +0 -1
- package/server/dist/modules/comment/html.d.ts +0 -15
- package/server/dist/modules/comment/html.js.map +0 -1
- package/server/dist/modules/extension/extension.module.d.ts +0 -9
- package/server/dist/modules/extension/extension.module.js.map +0 -1
- package/server/dist/modules/extension/plugin-loader.service.d.ts +0 -12
- package/server/dist/modules/extension/plugin-loader.service.js.map +0 -1
- package/server/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
- package/server/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
- package/server/dist/modules/extension/plugin.controller.d.ts +0 -22
- package/server/dist/modules/extension/plugin.controller.js.map +0 -1
- package/server/dist/modules/extension/plugin.service.d.ts +0 -52
- package/server/dist/modules/extension/plugin.service.js.map +0 -1
- package/server/dist/modules/extension/preview-draft.store.d.ts +0 -13
- package/server/dist/modules/extension/preview-draft.store.js.map +0 -1
- package/server/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
- package/server/dist/modules/extension/theme-registry.bridge.js.map +0 -1
- package/server/dist/modules/extension/theme.controller.d.ts +0 -66
- package/server/dist/modules/extension/theme.controller.js.map +0 -1
- package/server/dist/modules/extension/theme.service.d.ts +0 -140
- package/server/dist/modules/extension/theme.service.js.map +0 -1
- package/server/dist/modules/file/file-optimization.controller.d.ts +0 -12
- package/server/dist/modules/file/file-optimization.controller.js.map +0 -1
- package/server/dist/modules/file/file-optimization.service.d.ts +0 -36
- package/server/dist/modules/file/file-optimization.service.js.map +0 -1
- package/server/dist/modules/file/file-optimization.types.d.ts +0 -66
- package/server/dist/modules/file/file-optimization.types.js.map +0 -1
- package/server/dist/modules/file/file.controller.d.ts +0 -10
- package/server/dist/modules/file/file.controller.js.map +0 -1
- package/server/dist/modules/file/file.entity.d.ts +0 -9
- package/server/dist/modules/file/file.entity.js.map +0 -1
- package/server/dist/modules/file/file.module.d.ts +0 -2
- package/server/dist/modules/file/file.module.js.map +0 -1
- package/server/dist/modules/file/file.service.d.ts +0 -17
- package/server/dist/modules/file/file.service.js.map +0 -1
- package/server/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
- package/server/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
- package/server/dist/modules/health/health.controller.d.ts +0 -11
- package/server/dist/modules/health/health.controller.js.map +0 -1
- package/server/dist/modules/health/health.module.d.ts +0 -2
- package/server/dist/modules/health/health.module.js.map +0 -1
- package/server/dist/modules/hook/hook.module.d.ts +0 -2
- package/server/dist/modules/hook/hook.module.js.map +0 -1
- package/server/dist/modules/hook/hook.service.d.ts +0 -26
- package/server/dist/modules/hook/hook.service.js.map +0 -1
- package/server/dist/modules/install/install.controller.d.ts +0 -11
- package/server/dist/modules/install/install.controller.js.map +0 -1
- package/server/dist/modules/install/install.module.d.ts +0 -2
- package/server/dist/modules/install/install.module.js.map +0 -1
- package/server/dist/modules/install/install.service.d.ts +0 -12
- package/server/dist/modules/install/install.service.js.map +0 -1
- package/server/dist/modules/knowledge/knowledge.controller.d.ts +0 -14
- package/server/dist/modules/knowledge/knowledge.controller.js.map +0 -1
- package/server/dist/modules/knowledge/knowledge.entity.d.ts +0 -18
- package/server/dist/modules/knowledge/knowledge.entity.js.map +0 -1
- package/server/dist/modules/knowledge/knowledge.module.d.ts +0 -2
- package/server/dist/modules/knowledge/knowledge.module.js.map +0 -1
- package/server/dist/modules/knowledge/knowledge.service.d.ts +0 -14
- package/server/dist/modules/knowledge/knowledge.service.js.map +0 -1
- package/server/dist/modules/page/page.controller.d.ts +0 -12
- package/server/dist/modules/page/page.controller.js.map +0 -1
- package/server/dist/modules/page/page.entity.d.ts +0 -15
- package/server/dist/modules/page/page.entity.js.map +0 -1
- package/server/dist/modules/page/page.module.d.ts +0 -2
- package/server/dist/modules/page/page.module.js.map +0 -1
- package/server/dist/modules/page/page.service.d.ts +0 -12
- package/server/dist/modules/page/page.service.js.map +0 -1
- package/server/dist/modules/search/search.controller.d.ts +0 -8
- package/server/dist/modules/search/search.controller.js.map +0 -1
- package/server/dist/modules/search/search.entity.d.ts +0 -8
- package/server/dist/modules/search/search.entity.js.map +0 -1
- package/server/dist/modules/search/search.module.d.ts +0 -2
- package/server/dist/modules/search/search.module.js.map +0 -1
- package/server/dist/modules/search/search.service.d.ts +0 -12
- package/server/dist/modules/search/search.service.js.map +0 -1
- package/server/dist/modules/setting/setting.constant.d.ts +0 -3
- package/server/dist/modules/setting/setting.constant.js.map +0 -1
- package/server/dist/modules/setting/setting.controller.d.ts +0 -12
- package/server/dist/modules/setting/setting.controller.js.map +0 -1
- package/server/dist/modules/setting/setting.entity.d.ts +0 -26
- package/server/dist/modules/setting/setting.entity.js.map +0 -1
- package/server/dist/modules/setting/setting.module.d.ts +0 -2
- package/server/dist/modules/setting/setting.module.js.map +0 -1
- package/server/dist/modules/setting/setting.service.d.ts +0 -10
- package/server/dist/modules/setting/setting.service.js.map +0 -1
- package/server/dist/modules/smtp/mail.util.d.ts +0 -6
- package/server/dist/modules/smtp/mail.util.js.map +0 -1
- package/server/dist/modules/smtp/smtp.controller.d.ts +0 -9
- package/server/dist/modules/smtp/smtp.controller.js.map +0 -1
- package/server/dist/modules/smtp/smtp.entity.d.ts +0 -9
- package/server/dist/modules/smtp/smtp.entity.js.map +0 -1
- package/server/dist/modules/smtp/smtp.module.d.ts +0 -2
- package/server/dist/modules/smtp/smtp.module.js.map +0 -1
- package/server/dist/modules/smtp/smtp.service.d.ts +0 -11
- package/server/dist/modules/smtp/smtp.service.js.map +0 -1
- package/server/dist/modules/tag/tag.controller.d.ts +0 -12
- package/server/dist/modules/tag/tag.controller.js.map +0 -1
- package/server/dist/modules/tag/tag.entity.d.ts +0 -9
- package/server/dist/modules/tag/tag.entity.js.map +0 -1
- package/server/dist/modules/tag/tag.module.d.ts +0 -2
- package/server/dist/modules/tag/tag.module.js.map +0 -1
- package/server/dist/modules/tag/tag.service.d.ts +0 -13
- package/server/dist/modules/tag/tag.service.js.map +0 -1
- package/server/dist/modules/user/user.controller.d.ts +0 -13
- package/server/dist/modules/user/user.controller.js.map +0 -1
- package/server/dist/modules/user/user.entity.d.ts +0 -15
- package/server/dist/modules/user/user.entity.js.map +0 -1
- package/server/dist/modules/user/user.module.d.ts +0 -2
- package/server/dist/modules/user/user.module.js.map +0 -1
- package/server/dist/modules/user/user.service.d.ts +0 -16
- package/server/dist/modules/user/user.service.js.map +0 -1
- package/server/dist/modules/view/view.controller.d.ts +0 -11
- package/server/dist/modules/view/view.controller.js.map +0 -1
- package/server/dist/modules/view/view.entity.d.ts +0 -14
- package/server/dist/modules/view/view.entity.js.map +0 -1
- package/server/dist/modules/view/view.module.d.ts +0 -2
- package/server/dist/modules/view/view.module.js.map +0 -1
- package/server/dist/modules/view/view.service.d.ts +0 -11
- package/server/dist/modules/view/view.service.js.map +0 -1
- package/server/dist/modules/webhook/webhook.controller.d.ts +0 -12
- package/server/dist/modules/webhook/webhook.controller.js.map +0 -1
- package/server/dist/modules/webhook/webhook.entity.d.ts +0 -9
- package/server/dist/modules/webhook/webhook.entity.js.map +0 -1
- package/server/dist/modules/webhook/webhook.module.d.ts +0 -2
- package/server/dist/modules/webhook/webhook.module.js.map +0 -1
- package/server/dist/modules/webhook/webhook.service.d.ts +0 -16
- package/server/dist/modules/webhook/webhook.service.js.map +0 -1
- package/server/dist/public/apple-touch-icon.png +0 -0
- package/server/dist/public/favicon-16.png +0 -0
- package/server/dist/public/favicon-32.png +0 -0
- package/server/dist/public/favicon-48.png +0 -0
- package/server/dist/public/favicon.ico +0 -0
- package/server/dist/public/favicon.png +0 -0
- package/server/dist/public/icon-192.png +0 -0
- package/server/dist/public/icon-512.png +0 -0
- package/server/dist/public/index.html +0 -439
- package/server/dist/public/logo-200.png +0 -0
- package/server/dist/public/logo-400.png +0 -0
- package/server/dist/public/logo.png +0 -0
- package/server/dist/public/logo.svg +0 -7
- package/server/dist/public/swagger/custom.css +0 -11
- package/server/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/server/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
- package/server/dist/starter.d.ts +0 -1
- package/server/dist/starter.js.map +0 -1
- package/server/dist/tsconfig.build.tsbuildinfo +0 -16764
- package/server/dist/tsconfig.tsbuildinfo +0 -1
- package/server/dist/utils/date.util.d.ts +0 -1
- package/server/dist/utils/date.util.js.map +0 -1
- package/server/dist/utils/html-sanitize.util.d.ts +0 -1
- package/server/dist/utils/html-sanitize.util.js.map +0 -1
- package/server/dist/utils/image-processor.util.d.ts +0 -23
- package/server/dist/utils/image-processor.util.js.map +0 -1
- package/server/dist/utils/ip.util.d.ts +0 -2
- package/server/dist/utils/ip.util.js.map +0 -1
- package/server/dist/utils/local-api-quiet.util.d.ts +0 -1
- package/server/dist/utils/local-api-quiet.util.js.map +0 -1
- package/server/dist/utils/markdown.util.d.ts +0 -4
- package/server/dist/utils/markdown.util.js.map +0 -1
- package/server/dist/utils/oss/aliyun-oss-client.d.ts +0 -6
- package/server/dist/utils/oss/aliyun-oss-client.js.map +0 -1
- package/server/dist/utils/oss/oss-client.d.ts +0 -6
- package/server/dist/utils/oss/oss-client.js.map +0 -1
- package/server/dist/utils/oss.util.d.ts +0 -13
- package/server/dist/utils/oss.util.js.map +0 -1
- package/server/dist/utils/project-root.util.d.ts +0 -2
- package/server/dist/utils/project-root.util.js.map +0 -1
- package/server/dist/utils/query-whitelist.util.d.ts +0 -1
- package/server/dist/utils/query-whitelist.util.js.map +0 -1
- package/server/dist/utils/ua.util.d.ts +0 -9
- package/server/dist/utils/ua.util.js.map +0 -1
- package/server/dist/utils/uniqueid.util.d.ts +0 -1
- package/server/dist/utils/uniqueid.util.js.map +0 -1
- package/server/dist/utils/upload.util.d.ts +0 -5
- package/server/dist/utils/upload.util.js.map +0 -1
- package/server/dist/utils/user.util.d.ts +0 -1
- package/server/dist/utils/user.util.js.map +0 -1
- package/server/logs/error/error.log.-2026-05-19.log +0 -135
- package/server/logs/request/request.log.-2026-05-19.log +0 -0
- package/server/logs/response/response.log.-2026-05-19.log +0 -121
- package/server/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/server/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
package/out/bin/reactpress.js
CHANGED
|
@@ -3,526 +3,138 @@
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
/**
|
|
6
|
-
* ReactPress
|
|
7
|
-
*
|
|
6
|
+
* ReactPress 4 — zero-dependency publishing platform.
|
|
7
|
+
* Commands: `reactpress init` (default), `reactpress doctor`.
|
|
8
8
|
*/
|
|
9
9
|
const { Command } = require('commander');
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const chalk = require('chalk');
|
|
12
12
|
const { brand, divider } = require('../ui/theme');
|
|
13
|
-
const {
|
|
14
|
-
const {
|
|
15
|
-
const { runDev, runWebDev, runLocalWebDev, runThemeDev, runDesktopDev } = require('../lib/dev');
|
|
16
|
-
const { resolveDevApiOrigins, applyDevApiOriginsToEnv } = require('../lib/remote-dev');
|
|
17
|
-
const { runApiDev } = require('../lib/api-dev');
|
|
13
|
+
const { initMonorepoProject, isMonorepoCheckout } = require('../lib/bootstrap');
|
|
14
|
+
const { initProject } = require('../core/services/init');
|
|
18
15
|
const { runLifecycleCommand } = require('../lib/lifecycle');
|
|
19
|
-
const {
|
|
20
|
-
const {
|
|
21
|
-
const {
|
|
22
|
-
const { runDoctor } = require('../lib/doctor');
|
|
23
|
-
const { runDbBackup } = require('../lib/db-backup');
|
|
24
|
-
const { runBuild } = require('../lib/build');
|
|
25
|
-
const { startApiWithPm2 } = require('../lib/pm2');
|
|
26
|
-
const { runNodeScript, runReactpressCli } = require('../lib/spawn');
|
|
27
|
-
const { getThemeBin } = require('../lib/paths');
|
|
28
|
-
const { runInteractiveLoop } = require('../ui/interactive');
|
|
16
|
+
const { runNodeScript } = require('../lib/spawn');
|
|
17
|
+
const { getThemeBin, getCliVersion } = require('../lib/paths');
|
|
18
|
+
const { loadServerSiteUrl, loadAdminConsoleUrl, loadClientSiteUrl, getApiPrefix, } = require('../lib/http');
|
|
29
19
|
const { t } = require('../lib/i18n');
|
|
30
|
-
const
|
|
20
|
+
const { describeProject } = require('../lib/project-type');
|
|
21
|
+
const { refreshBannerWithStartup } = require('../ui/banner-startup');
|
|
22
|
+
const { runDoctor } = require('../lib/doctor');
|
|
23
|
+
const LEGACY_COMMANDS = new Set([
|
|
24
|
+
'start',
|
|
25
|
+
'dev',
|
|
26
|
+
'docker',
|
|
27
|
+
'nginx',
|
|
28
|
+
'server',
|
|
29
|
+
'build',
|
|
30
|
+
'status',
|
|
31
|
+
'publish',
|
|
32
|
+
'theme',
|
|
33
|
+
'plugin',
|
|
34
|
+
'db',
|
|
35
|
+
'desktop',
|
|
36
|
+
'client',
|
|
37
|
+
]);
|
|
38
|
+
if (!process.env.REACTPRESS_LOCAL_MODE) {
|
|
39
|
+
process.env.REACTPRESS_LOCAL_MODE = '1';
|
|
40
|
+
}
|
|
41
|
+
if (!process.env.REACTPRESS_SKIP_NGINX) {
|
|
42
|
+
process.env.REACTPRESS_SKIP_NGINX = '1';
|
|
43
|
+
}
|
|
31
44
|
const program = new Command();
|
|
32
45
|
program
|
|
33
46
|
.name('reactpress')
|
|
34
47
|
.description(t('cli.description'))
|
|
35
|
-
.version(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
.version(getCliVersion());
|
|
49
|
+
function printRunningPanel(projectRoot) {
|
|
50
|
+
const apiUrl = loadServerSiteUrl(projectRoot);
|
|
51
|
+
const adminUrl = loadAdminConsoleUrl(projectRoot);
|
|
52
|
+
const siteUrl = loadClientSiteUrl(projectRoot);
|
|
53
|
+
const apiPrefix = getApiPrefix(projectRoot);
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(brand.bold(t('init.readyTitle')));
|
|
56
|
+
console.log(divider(48));
|
|
57
|
+
console.log(` ${brand.muted(t('init.label.site'))} ${brand.primary(siteUrl)}`);
|
|
58
|
+
console.log(` ${brand.muted(t('init.label.admin'))} ${brand.primary(adminUrl)}`);
|
|
59
|
+
console.log(` ${brand.muted(t('init.label.api'))} ${brand.primary(`${apiUrl}${apiPrefix}`)}`);
|
|
60
|
+
console.log(divider(48));
|
|
61
|
+
console.log(` ${brand.dim(t('init.hint'))}`);
|
|
62
|
+
console.log('');
|
|
63
|
+
}
|
|
64
|
+
async function startServices(projectRoot) {
|
|
65
|
+
const code = await runLifecycleCommand('start', projectRoot);
|
|
66
|
+
if (code !== 0)
|
|
67
|
+
process.exit(code);
|
|
68
|
+
printRunningPanel(projectRoot);
|
|
69
|
+
try {
|
|
70
|
+
const themeBin = getThemeBin(projectRoot);
|
|
71
|
+
const { resolveThemeDirectory, readActiveThemeManifest } = require('../lib/theme-runtime');
|
|
72
|
+
const { activeTheme } = readActiveThemeManifest(projectRoot);
|
|
73
|
+
const themeDir = resolveThemeDirectory(projectRoot, activeTheme);
|
|
74
|
+
await runNodeScript(themeBin, [], {
|
|
75
|
+
cwd: projectRoot,
|
|
76
|
+
env: themeDir ? { REACTPRESS_THEME_DIR: themeDir } : undefined,
|
|
50
77
|
});
|
|
51
|
-
console.log(`[reactpress] ${result.message}`);
|
|
52
|
-
process.exit(result.ok ? 0 : 1);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const args = ['init', directory];
|
|
56
|
-
if (options.force)
|
|
57
|
-
args.push('--force');
|
|
58
|
-
if (options.local)
|
|
59
|
-
args.push('--local');
|
|
60
|
-
await runReactpressCli(args, { cwd: projectRoot });
|
|
61
|
-
});
|
|
62
|
-
program
|
|
63
|
-
.command('dev')
|
|
64
|
-
.description(t('cli.dev.description'))
|
|
65
|
-
.option('--api-only', t('cli.dev.apiOnly'))
|
|
66
|
-
.option('--client-only', t('cli.dev.clientOnly'))
|
|
67
|
-
.option('--web-only', t('cli.dev.webOnly'))
|
|
68
|
-
.option('--remote-origin <url>', t('cli.dev.remoteOrigin'))
|
|
69
|
-
.option('--admin-origin <value>', t('cli.dev.adminOrigin'))
|
|
70
|
-
.option('--client-origin <value>', t('cli.dev.clientOrigin'))
|
|
71
|
-
.option('--local', t('cli.dev.local'))
|
|
72
|
-
.action(async (options) => {
|
|
73
|
-
const projectRoot = ensureOriginalCwd();
|
|
74
|
-
if (options.local) {
|
|
75
|
-
process.env.REACTPRESS_LOCAL_MODE = '1';
|
|
76
|
-
process.env.REACTPRESS_SKIP_NGINX = '1';
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
const hasOriginFlag = options.remoteOrigin !== undefined ||
|
|
80
|
-
options.adminOrigin !== undefined ||
|
|
81
|
-
options.clientOrigin !== undefined;
|
|
82
|
-
let apiOrigins = { admin: null, client: null, needsLocalApi: true };
|
|
83
|
-
if (hasOriginFlag) {
|
|
84
|
-
const resolved = resolveDevApiOrigins(projectRoot, {
|
|
85
|
-
remoteOrigin: options.remoteOrigin,
|
|
86
|
-
adminOrigin: options.adminOrigin,
|
|
87
|
-
clientOrigin: options.clientOrigin,
|
|
88
|
-
});
|
|
89
|
-
if (resolved.error === 'REMOTE_DEFAULT_REQUIRED') {
|
|
90
|
-
console.error(chalk.red('[reactpress]'), t('cli.dev.remoteDefaultRequired'));
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
if (resolved.error === 'INVALID_ORIGIN') {
|
|
94
|
-
console.error(chalk.red('[reactpress]'), t('cli.dev.invalidOrigin'));
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
97
|
-
if (options.remoteOrigin !== undefined &&
|
|
98
|
-
!resolved.remoteDefault &&
|
|
99
|
-
options.adminOrigin === undefined &&
|
|
100
|
-
options.clientOrigin === undefined) {
|
|
101
|
-
console.error(chalk.red('[reactpress]'), t('cli.dev.remoteOriginRequired'));
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
apiOrigins = resolved;
|
|
105
|
-
applyDevApiOriginsToEnv(apiOrigins);
|
|
106
|
-
}
|
|
107
|
-
if (options.clientOnly) {
|
|
108
|
-
await runThemeDev(projectRoot, { apiOrigins });
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (options.webOnly) {
|
|
112
|
-
if (options.local) {
|
|
113
|
-
await runLocalWebDev(projectRoot, { apiOrigins });
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
await runWebDev(projectRoot, { apiOrigins });
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (options.apiOnly) {
|
|
120
|
-
if (!apiOrigins.needsLocalApi) {
|
|
121
|
-
console.error(chalk.red('[reactpress]'), t('cli.dev.remoteOriginIncompatibleApiOnly'));
|
|
122
|
-
process.exit(1);
|
|
123
|
-
}
|
|
124
|
-
await runApiDev(projectRoot);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
await runDev(projectRoot, { apiOrigins });
|
|
128
|
-
}
|
|
129
|
-
catch (err) {
|
|
130
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
131
|
-
process.exit(err.exitCode ?? 1);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
const desktopCmd = program.command('desktop').description(t('cli.desktopDev.description'));
|
|
135
|
-
desktopCmd
|
|
136
|
-
.command('dev')
|
|
137
|
-
.description(t('cli.desktopDev.description'))
|
|
138
|
-
.action(async () => {
|
|
139
|
-
const projectRoot = ensureOriginalCwd();
|
|
140
|
-
try {
|
|
141
|
-
await runDesktopDev(projectRoot);
|
|
142
78
|
}
|
|
143
79
|
catch (err) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
const serverCmd = program.command('server').description(t('cli.server.description'));
|
|
149
|
-
serverCmd
|
|
150
|
-
.command('start')
|
|
151
|
-
.description(t('cli.server.start.description'))
|
|
152
|
-
.option('--pm2', t('cli.server.start.pm2'))
|
|
153
|
-
.option('--bg', t('cli.server.start.bg'))
|
|
154
|
-
.action(async (options) => {
|
|
155
|
-
const projectRoot = ensureOriginalCwd();
|
|
156
|
-
try {
|
|
157
|
-
if (options.pm2) {
|
|
158
|
-
await startApiWithPm2(projectRoot);
|
|
80
|
+
if (err.code === 'REACTPRESS_THEME_NOT_FOUND' ||
|
|
81
|
+
err.code === 'REACTPRESS_THEME_BIN_NOT_FOUND') {
|
|
82
|
+
console.log(brand.dim(t('init.apiOnlyHint')));
|
|
159
83
|
return;
|
|
160
84
|
}
|
|
161
|
-
const cmd = options.bg ? 'start:bg' : 'start';
|
|
162
|
-
const code = await runLifecycleCommand(cmd, projectRoot);
|
|
163
|
-
process.exit(code ?? 0);
|
|
164
|
-
}
|
|
165
|
-
catch (err) {
|
|
166
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
167
|
-
process.exit(1);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
serverCmd.command('stop').description(t('cli.server.stop')).action(async () => {
|
|
171
|
-
const code = await runLifecycleCommand('stop', ensureOriginalCwd());
|
|
172
|
-
process.exit(code ?? 0);
|
|
173
|
-
});
|
|
174
|
-
serverCmd.command('restart').description(t('cli.server.restart')).action(async () => {
|
|
175
|
-
const code = await runLifecycleCommand('restart', ensureOriginalCwd());
|
|
176
|
-
process.exit(code ?? 0);
|
|
177
|
-
});
|
|
178
|
-
serverCmd.command('status').description(t('cli.server.status')).action(async () => {
|
|
179
|
-
await runLifecycleCommand('status', ensureOriginalCwd());
|
|
180
|
-
});
|
|
181
|
-
const clientCmd = program.command('client').description(t('cli.client.description'));
|
|
182
|
-
clientCmd
|
|
183
|
-
.command('start')
|
|
184
|
-
.description(t('cli.client.start'))
|
|
185
|
-
.option('--pm2', t('cli.client.start.pm2'))
|
|
186
|
-
.action(async (options) => {
|
|
187
|
-
const projectRoot = ensureOriginalCwd();
|
|
188
|
-
const { resolveThemeDirectory, readActiveThemeManifest } = require('../lib/theme-runtime');
|
|
189
|
-
const { resolveProductionThemeEnv } = require('../lib/theme-prod');
|
|
190
|
-
const { activeTheme } = readActiveThemeManifest(projectRoot);
|
|
191
|
-
const themeDir = resolveThemeDirectory(projectRoot, activeTheme);
|
|
192
|
-
const args = options.pm2 ? ['--pm2'] : [];
|
|
193
|
-
const env = themeDir && options.pm2
|
|
194
|
-
? resolveProductionThemeEnv(projectRoot, themeDir)
|
|
195
|
-
: themeDir
|
|
196
|
-
? { REACTPRESS_THEME_DIR: themeDir }
|
|
197
|
-
: undefined;
|
|
198
|
-
await runNodeScript(getThemeBin(projectRoot), args, {
|
|
199
|
-
cwd: projectRoot,
|
|
200
|
-
env,
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
clientCmd
|
|
204
|
-
.command('restart')
|
|
205
|
-
.description(t('cli.client.restart'))
|
|
206
|
-
.option('--pm2', t('cli.client.start.pm2'))
|
|
207
|
-
.action(async (options) => {
|
|
208
|
-
try {
|
|
209
|
-
const projectRoot = ensureOriginalCwd();
|
|
210
|
-
const { restartProductionVisitorClient } = require('../lib/theme-prod');
|
|
211
|
-
if (options.pm2) {
|
|
212
|
-
await restartProductionVisitorClient(projectRoot);
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
const { buildActiveTheme } = require('../lib/theme-prod');
|
|
216
|
-
const { activeTheme, themeDir } = buildActiveTheme(projectRoot);
|
|
217
|
-
const args = [];
|
|
218
|
-
await runNodeScript(getThemeBin(projectRoot), args, {
|
|
219
|
-
cwd: projectRoot,
|
|
220
|
-
env: { REACTPRESS_THEME_DIR: themeDir },
|
|
221
|
-
});
|
|
222
|
-
console.log(`[reactpress] ${require('../lib/i18n').t('themeProd.restarted', { id: activeTheme })}`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
catch (err) {
|
|
226
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
227
|
-
process.exit(1);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
program
|
|
231
|
-
.command('build')
|
|
232
|
-
.description(t('cli.build.description'))
|
|
233
|
-
.option('-t, --target <target>', t('cli.build.target'), 'all')
|
|
234
|
-
.option('--low-mem', t('cli.build.lowMem'))
|
|
235
|
-
.action(async (options) => {
|
|
236
|
-
try {
|
|
237
|
-
if (options.lowMem) {
|
|
238
|
-
process.env.REACTPRESS_LOW_MEM = '1';
|
|
239
|
-
}
|
|
240
|
-
await runBuild(options.target, ensureOriginalCwd());
|
|
241
|
-
}
|
|
242
|
-
catch (err) {
|
|
243
85
|
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
244
|
-
process.exit(1);
|
|
86
|
+
process.exit(err.exitCode ?? 1);
|
|
245
87
|
}
|
|
246
|
-
});
|
|
247
|
-
const dockerCmd = program.command('docker').description(t('cli.docker.description'));
|
|
248
|
-
dockerCmd
|
|
249
|
-
.command('up')
|
|
250
|
-
.description(t('cli.docker.up'))
|
|
251
|
-
.action(async () => {
|
|
252
|
-
await runDockerCommand('up', ensureOriginalCwd());
|
|
253
|
-
});
|
|
254
|
-
dockerCmd
|
|
255
|
-
.command('down')
|
|
256
|
-
.alias('stop')
|
|
257
|
-
.description(t('cli.docker.down'))
|
|
258
|
-
.action(async () => {
|
|
259
|
-
await runDockerCommand('down', ensureOriginalCwd());
|
|
260
|
-
});
|
|
261
|
-
dockerCmd
|
|
262
|
-
.command('start')
|
|
263
|
-
.description(t('cli.docker.start'))
|
|
264
|
-
.action(async () => {
|
|
265
|
-
await runDockerCommand('start', ensureOriginalCwd());
|
|
266
|
-
});
|
|
267
|
-
dockerCmd.command('restart').description(t('cli.docker.restart')).action(async () => {
|
|
268
|
-
await runDockerCommand('restart', ensureOriginalCwd());
|
|
269
|
-
});
|
|
270
|
-
dockerCmd.command('status').description(t('cli.docker.status')).action(async () => {
|
|
271
|
-
await runDockerCommand('status', ensureOriginalCwd());
|
|
272
|
-
});
|
|
273
|
-
dockerCmd
|
|
274
|
-
.command('logs [service]')
|
|
275
|
-
.description(t('cli.docker.logs'))
|
|
276
|
-
.action(async (service) => {
|
|
277
|
-
await runDockerCommand('logs', ensureOriginalCwd(), service ? [service] : []);
|
|
278
|
-
});
|
|
279
|
-
const nginxCmd = program.command('nginx').description(t('cli.nginx.description'));
|
|
280
|
-
function nginxActionOptions(cmd) {
|
|
281
|
-
return cmd.option('--prod', t('cli.nginx.prod')).option('-f, --force', t('cli.nginx.force'));
|
|
282
88
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
try {
|
|
294
|
-
await runNginxCommand('up', ensureOriginalCwd(), [], options);
|
|
295
|
-
}
|
|
296
|
-
catch (err) {
|
|
297
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
298
|
-
process.exit(1);
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
nginxCmd
|
|
302
|
-
.command('down')
|
|
303
|
-
.alias('stop')
|
|
304
|
-
.description(t('cli.nginx.down'))
|
|
305
|
-
.option('--prod', t('cli.nginx.prod'))
|
|
306
|
-
.action(async (options) => {
|
|
307
|
-
try {
|
|
308
|
-
await runNginxCommand('down', ensureOriginalCwd(), [], options);
|
|
309
|
-
}
|
|
310
|
-
catch (err) {
|
|
311
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
312
|
-
process.exit(1);
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
nginxActionOptions(nginxCmd.command('restart').description(t('cli.nginx.restart'))).action(async (options) => {
|
|
316
|
-
try {
|
|
317
|
-
await runNginxCommand('restart', ensureOriginalCwd(), [], options);
|
|
318
|
-
}
|
|
319
|
-
catch (err) {
|
|
320
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
321
|
-
process.exit(1);
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
nginxCmd
|
|
325
|
-
.command('status')
|
|
326
|
-
.description(t('cli.nginx.status'))
|
|
327
|
-
.option('--prod', t('cli.nginx.prod'))
|
|
328
|
-
.action(async (options) => {
|
|
329
|
-
try {
|
|
330
|
-
await runNginxCommand('status', ensureOriginalCwd(), [], options);
|
|
331
|
-
}
|
|
332
|
-
catch (err) {
|
|
333
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
334
|
-
process.exit(1);
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
nginxCmd.command('logs').description(t('cli.nginx.logs')).action(async () => {
|
|
338
|
-
try {
|
|
339
|
-
await runNginxCommand('logs', ensureOriginalCwd());
|
|
340
|
-
}
|
|
341
|
-
catch (err) {
|
|
342
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
343
|
-
process.exit(1);
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
nginxCmd.command('test').description(t('cli.nginx.test')).action(async () => {
|
|
347
|
-
try {
|
|
348
|
-
await runNginxCommand('test', ensureOriginalCwd());
|
|
349
|
-
}
|
|
350
|
-
catch (err) {
|
|
351
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
352
|
-
process.exit(1);
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
nginxCmd.command('reload').description(t('cli.nginx.reload')).action(async () => {
|
|
356
|
-
try {
|
|
357
|
-
await runNginxCommand('reload', ensureOriginalCwd());
|
|
358
|
-
}
|
|
359
|
-
catch (err) {
|
|
360
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
361
|
-
process.exit(1);
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
nginxCmd.command('open').description(t('cli.nginx.open')).action(async () => {
|
|
365
|
-
try {
|
|
366
|
-
await runNginxCommand('open', ensureOriginalCwd());
|
|
367
|
-
}
|
|
368
|
-
catch (err) {
|
|
369
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
89
|
+
async function runInit(directory = '.', options = { force: false }) {
|
|
90
|
+
const projectRoot = path.resolve(directory);
|
|
91
|
+
process.env.REACTPRESS_ORIGINAL_CWD = projectRoot;
|
|
92
|
+
const project = describeProject(projectRoot);
|
|
93
|
+
await refreshBannerWithStartup(projectRoot, project);
|
|
94
|
+
const result = isMonorepoCheckout(projectRoot)
|
|
95
|
+
? await initMonorepoProject(projectRoot, { force: !!options.force })
|
|
96
|
+
: await initProject({ directory: projectRoot, force: !!options.force });
|
|
97
|
+
if (!result.ok) {
|
|
98
|
+
console.error(chalk.red('[reactpress]'), result.message);
|
|
370
99
|
process.exit(1);
|
|
371
100
|
}
|
|
372
|
-
});
|
|
101
|
+
console.log(`${brand.success('✓')} ${result.message}`);
|
|
102
|
+
await startServices(projectRoot);
|
|
103
|
+
}
|
|
373
104
|
program
|
|
374
|
-
.command('
|
|
375
|
-
.description(t('cli.
|
|
376
|
-
.
|
|
377
|
-
|
|
105
|
+
.command('init [directory]', { isDefault: true })
|
|
106
|
+
.description(t('cli.init.description'))
|
|
107
|
+
.option('-f, --force', t('cli.init.force'))
|
|
108
|
+
.action(async (directory, options) => {
|
|
109
|
+
await runInit(directory || '.', options);
|
|
378
110
|
});
|
|
379
111
|
program
|
|
380
|
-
.command('doctor')
|
|
112
|
+
.command('doctor [directory]')
|
|
381
113
|
.description(t('cli.doctor.description'))
|
|
382
|
-
.action(async () => {
|
|
383
|
-
const
|
|
114
|
+
.action(async (directory) => {
|
|
115
|
+
const projectRoot = path.resolve(directory || '.');
|
|
116
|
+
process.env.REACTPRESS_ORIGINAL_CWD = projectRoot;
|
|
117
|
+
const code = await runDoctor(projectRoot);
|
|
384
118
|
process.exit(code);
|
|
385
119
|
});
|
|
386
|
-
const dbCmd = program.command('db').description(t('cli.db.description'));
|
|
387
|
-
dbCmd
|
|
388
|
-
.command('backup')
|
|
389
|
-
.description(t('cli.db.backup'))
|
|
390
|
-
.option('-o, --output <file>', t('cli.db.backup.output'))
|
|
391
|
-
.action(async (options) => {
|
|
392
|
-
try {
|
|
393
|
-
await runDbBackup(ensureOriginalCwd(), options.output);
|
|
394
|
-
}
|
|
395
|
-
catch (err) {
|
|
396
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
397
|
-
process.exit(1);
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
program
|
|
401
|
-
.command('publish')
|
|
402
|
-
.description(t('cli.publish.description'))
|
|
403
|
-
.option('--build', t('cli.publish.build'))
|
|
404
|
-
.option('--publish', t('cli.publish.publish'))
|
|
405
|
-
.option('--tag <tag>', 'npm dist-tag: beta or latest')
|
|
406
|
-
.option('--version <version>', 'semver for all core packages')
|
|
407
|
-
.option('--yes', 'skip confirmation prompt')
|
|
408
|
-
.option('--no-build', 'skip build before publish')
|
|
409
|
-
.option('--otp <code>', 'npm 2FA one-time password')
|
|
410
|
-
.action(async (options) => {
|
|
411
|
-
try {
|
|
412
|
-
const publish = require('../lib/publish');
|
|
413
|
-
if (options.build) {
|
|
414
|
-
await publish.buildPackages();
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
if (options.publish) {
|
|
418
|
-
await publish.publishPackages({
|
|
419
|
-
tag: options.tag,
|
|
420
|
-
version: options.version,
|
|
421
|
-
yes: Boolean(options.yes),
|
|
422
|
-
noBuild: Boolean(options.noBuild),
|
|
423
|
-
otp: options.otp || process.env.NPM_OTP,
|
|
424
|
-
});
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
await publish.main();
|
|
428
|
-
}
|
|
429
|
-
catch (err) {
|
|
430
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
431
|
-
process.exit(1);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
const themeCmd = program.command('theme').description(t('cli.theme.description'));
|
|
435
|
-
themeCmd
|
|
436
|
-
.command('add')
|
|
437
|
-
.description(t('cli.theme.add.description'))
|
|
438
|
-
.argument('[spec]', t('cli.theme.add.spec'))
|
|
439
|
-
.option('--catalog <id>', t('cli.theme.add.catalog'))
|
|
440
|
-
.option('--skip-deps', t('cli.theme.add.skipDeps'))
|
|
441
|
-
.action(async (spec, options) => {
|
|
442
|
-
try {
|
|
443
|
-
const projectRoot = ensureOriginalCwd();
|
|
444
|
-
const targetSpec = options.catalog || spec;
|
|
445
|
-
if (!targetSpec) {
|
|
446
|
-
throw new Error(t('themeInstall.specRequired'));
|
|
447
|
-
}
|
|
448
|
-
await require('../lib/theme-cli').runThemeAdd(projectRoot, targetSpec, {
|
|
449
|
-
skipDependencies: !!options.skipDeps,
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
catch (err) {
|
|
453
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
454
|
-
process.exit(1);
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
themeCmd.command('list').description(t('cli.theme.list.description')).action(() => {
|
|
458
|
-
require('../lib/theme-cli').runThemeList(ensureOriginalCwd());
|
|
459
|
-
});
|
|
460
|
-
const pluginCmd = program.command('plugin').description('Manage ReactPress plugins');
|
|
461
|
-
pluginCmd
|
|
462
|
-
.command('install')
|
|
463
|
-
.description('Install a local plugin into .reactpress/plugins')
|
|
464
|
-
.argument('<id>', 'Plugin id from plugins/ registry')
|
|
465
|
-
.action((id) => {
|
|
466
|
-
try {
|
|
467
|
-
require('../lib/plugin-cli').runPluginInstall(ensureOriginalCwd(), id);
|
|
468
|
-
}
|
|
469
|
-
catch (err) {
|
|
470
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
471
|
-
process.exit(1);
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
pluginCmd.command('list').description('List registered plugins').action(() => {
|
|
475
|
-
require('../lib/plugin-cli').runPluginList(ensureOriginalCwd());
|
|
476
|
-
});
|
|
477
|
-
program
|
|
478
|
-
.command('start')
|
|
479
|
-
.description(t('cli.start.description'))
|
|
480
|
-
.action(async () => {
|
|
481
|
-
const projectRoot = ensureOriginalCwd();
|
|
482
|
-
const code = await runLifecycleCommand('start', projectRoot);
|
|
483
|
-
if (code !== 0)
|
|
484
|
-
process.exit(code);
|
|
485
|
-
const { resolveThemeDirectory, readActiveThemeManifest } = require('../lib/theme-runtime');
|
|
486
|
-
const { activeTheme } = readActiveThemeManifest(projectRoot);
|
|
487
|
-
const themeDir = resolveThemeDirectory(projectRoot, activeTheme);
|
|
488
|
-
if (!themeDir) {
|
|
489
|
-
console.log(t('dev.standaloneHint'));
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
const { spawn } = require('child_process');
|
|
493
|
-
const child = spawn('pnpm', ['run', 'start'], {
|
|
494
|
-
stdio: 'inherit',
|
|
495
|
-
shell: true,
|
|
496
|
-
cwd: themeDir,
|
|
497
|
-
});
|
|
498
|
-
child.on('close', (c) => process.exit(c ?? 0));
|
|
499
|
-
});
|
|
500
120
|
program.on('--help', () => {
|
|
501
121
|
console.log('');
|
|
502
122
|
console.log(brand.bold(t('cli.help.examples')));
|
|
503
123
|
console.log(divider(40));
|
|
504
|
-
const
|
|
505
|
-
t('cli.help.interactive'),
|
|
506
|
-
t('cli.help.dev'),
|
|
507
|
-
t('cli.help.init'),
|
|
508
|
-
t('cli.help.server'),
|
|
509
|
-
t('cli.help.status'),
|
|
510
|
-
t('cli.help.doctor'),
|
|
511
|
-
t('cli.help.docker'),
|
|
512
|
-
t('cli.help.nginx'),
|
|
513
|
-
t('cli.help.build'),
|
|
514
|
-
t('cli.help.publish'),
|
|
515
|
-
t('cli.help.theme'),
|
|
516
|
-
];
|
|
517
|
-
for (const line of lines) {
|
|
124
|
+
for (const line of [t('cli.help.init'), t('cli.help.doctor'), t('cli.help.zeroDep')]) {
|
|
518
125
|
console.log(brand.dim(line));
|
|
519
126
|
}
|
|
520
127
|
console.log('');
|
|
521
128
|
});
|
|
522
129
|
async function main() {
|
|
523
130
|
const argv = process.argv.slice(2);
|
|
131
|
+
if (argv[0] && LEGACY_COMMANDS.has(argv[0])) {
|
|
132
|
+
console.error(chalk.red('[reactpress]'), t('init.unknownCommand', { cmd: argv[0] }));
|
|
133
|
+
console.error(brand.dim(t('init.useInitOnly')));
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
524
136
|
if (argv.length === 0) {
|
|
525
|
-
await
|
|
137
|
+
await runInit('.', { force: false });
|
|
526
138
|
return;
|
|
527
139
|
}
|
|
528
140
|
program.parse(process.argv);
|
|
@@ -56,7 +56,10 @@ async function syncEnvFromConfig(projectRoot, config) {
|
|
|
56
56
|
const { envPath, sqlitePath, uploadsDir } = (0, paths_1.getProjectPaths)(projectRoot);
|
|
57
57
|
const existing = (await fs_extra_1.default.pathExists(envPath)) ? await loadEnvFile(envPath) : {};
|
|
58
58
|
if (isSqliteMode(config)) {
|
|
59
|
-
const
|
|
59
|
+
const rawDbFile = config.database.sqlitePath ?? sqlitePath;
|
|
60
|
+
const dbFile = rawDbFile === 'data/reactpress.db' || rawDbFile.endsWith('/data/reactpress.db')
|
|
61
|
+
? paths_1.SQLITE_REL_PATH
|
|
62
|
+
: rawDbFile;
|
|
60
63
|
const port = config.server.port;
|
|
61
64
|
const siteUrl = config.server.serverUrl ?? config.server.siteUrl ?? `http://127.0.0.1:${port}`;
|
|
62
65
|
const clientUrl = config.server.clientUrl ?? 'http://localhost:3001';
|