@fecommunity/reactpress 3.7.0 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/reactpress-cli-shim.js +2 -6
- package/bin/reactpress-theme-client.js +2 -0
- package/bin/reactpress.js +1 -380
- package/out/.source-fingerprint-cli +1 -0
- package/out/bin/reactpress-cli-shim.d.ts +3 -0
- package/out/bin/reactpress-cli-shim.d.ts.map +1 -0
- package/out/bin/reactpress-cli-shim.js +28 -0
- package/out/bin/reactpress-cli-shim.js.map +1 -0
- package/out/bin/reactpress-theme-client.d.ts +3 -0
- package/out/bin/reactpress-theme-client.d.ts.map +1 -0
- package/out/bin/reactpress-theme-client.js +113 -0
- package/out/bin/reactpress-theme-client.js.map +1 -0
- package/out/bin/reactpress.d.ts +3 -0
- package/out/bin/reactpress.d.ts.map +1 -0
- package/out/bin/reactpress.js +534 -0
- package/out/bin/reactpress.js.map +1 -0
- package/out/core/services/config.d.ts +12 -0
- package/out/core/services/config.d.ts.map +1 -0
- package/out/core/services/config.js +137 -0
- package/out/core/services/config.js.map +1 -0
- package/out/core/services/database/index.d.ts +17 -0
- package/out/core/services/database/index.d.ts.map +1 -0
- package/out/core/services/database/index.js +242 -0
- package/out/core/services/database/index.js.map +1 -0
- package/out/core/services/database/mysql.d.ts +14 -0
- package/out/core/services/database/mysql.d.ts.map +1 -0
- package/out/core/services/database/mysql.js +82 -0
- package/out/core/services/database/mysql.js.map +1 -0
- package/out/core/services/database/profile.d.ts +6 -0
- package/out/core/services/database/profile.d.ts.map +1 -0
- package/out/core/services/database/profile.js +60 -0
- package/out/core/services/database/profile.js.map +1 -0
- package/out/core/services/database/sqlite.d.ts +10 -0
- package/out/core/services/database/sqlite.d.ts.map +1 -0
- package/out/core/services/database/sqlite.js +73 -0
- package/out/core/services/database/sqlite.js.map +1 -0
- package/out/core/services/exec.d.ts +21 -0
- package/out/core/services/exec.d.ts.map +1 -0
- package/out/core/services/exec.js +56 -0
- package/out/core/services/exec.js.map +1 -0
- package/out/core/services/init.d.ts +11 -0
- package/out/core/services/init.d.ts.map +1 -0
- package/out/core/services/init.js +60 -0
- package/out/core/services/init.js.map +1 -0
- package/out/core/services/local-site.d.ts +24 -0
- package/out/core/services/local-site.d.ts.map +1 -0
- package/out/core/services/local-site.js +144 -0
- package/out/core/services/local-site.js.map +1 -0
- package/out/core/utils/cli-context.d.ts +3 -0
- package/out/core/utils/cli-context.d.ts.map +1 -0
- package/out/core/utils/cli-context.js +12 -0
- package/out/core/utils/cli-context.js.map +1 -0
- package/out/core/utils/paths.d.ts +20 -0
- package/out/core/utils/paths.d.ts.map +1 -0
- package/out/core/utils/paths.js +34 -0
- package/out/core/utils/paths.js.map +1 -0
- package/out/core/utils/platform.d.ts +7 -0
- package/out/core/utils/platform.d.ts.map +1 -0
- package/out/core/utils/platform.js +28 -0
- package/out/core/utils/platform.js.map +1 -0
- package/out/core/utils/port.d.ts +4 -0
- package/out/core/utils/port.d.ts.map +1 -0
- package/out/core/utils/port.js +32 -0
- package/out/core/utils/port.js.map +1 -0
- package/out/lib/api-dev-runner.d.ts +3 -0
- package/out/lib/api-dev-runner.d.ts.map +1 -0
- package/{lib → out/lib}/api-dev-runner.js +4 -1
- package/out/lib/api-dev-runner.js.map +1 -0
- package/out/lib/api-dev.d.ts +2 -0
- package/out/lib/api-dev.d.ts.map +1 -0
- package/out/lib/api-dev.js +101 -0
- package/out/lib/api-dev.js.map +1 -0
- package/out/lib/bootstrap.d.ts +18 -0
- package/out/lib/bootstrap.d.ts.map +1 -0
- package/out/lib/bootstrap.js +93 -0
- package/out/lib/bootstrap.js.map +1 -0
- package/out/lib/build.d.ts +2 -0
- package/out/lib/build.d.ts.map +1 -0
- package/out/lib/build.js +191 -0
- package/out/lib/build.js.map +1 -0
- package/out/lib/db-backup.d.ts +2 -0
- package/out/lib/db-backup.d.ts.map +1 -0
- package/out/lib/db-backup.js +68 -0
- package/out/lib/db-backup.js.map +1 -0
- package/out/lib/dev-banner.d.ts +2 -0
- package/out/lib/dev-banner.d.ts.map +1 -0
- package/out/lib/dev-banner.js +102 -0
- package/out/lib/dev-banner.js.map +1 -0
- package/out/lib/dev-child-io.d.ts +2 -0
- package/out/lib/dev-child-io.d.ts.map +1 -0
- package/out/lib/dev-child-io.js +80 -0
- package/out/lib/dev-child-io.js.map +1 -0
- package/out/lib/dev-log.d.ts +2 -0
- package/out/lib/dev-log.d.ts.map +1 -0
- package/out/lib/dev-log.js +64 -0
- package/out/lib/dev-log.js.map +1 -0
- package/out/lib/dev-session.d.ts +2 -0
- package/out/lib/dev-session.d.ts.map +1 -0
- package/out/lib/dev-session.js +95 -0
- package/out/lib/dev-session.js.map +1 -0
- package/out/lib/dev.d.ts +2 -0
- package/out/lib/dev.d.ts.map +1 -0
- package/out/lib/dev.js +906 -0
- package/out/lib/dev.js.map +1 -0
- package/out/lib/docker.d.ts +2 -0
- package/out/lib/docker.d.ts.map +1 -0
- package/out/lib/docker.js +398 -0
- package/out/lib/docker.js.map +1 -0
- package/out/lib/doctor.d.ts +2 -0
- package/out/lib/doctor.d.ts.map +1 -0
- package/out/lib/doctor.js +260 -0
- package/out/lib/doctor.js.map +1 -0
- package/out/lib/health-parse.d.ts +5 -0
- package/out/lib/health-parse.d.ts.map +1 -0
- package/out/lib/health-parse.js +36 -0
- package/out/lib/health-parse.js.map +1 -0
- package/out/lib/health-parse.test.d.ts +2 -0
- package/out/lib/health-parse.test.d.ts.map +1 -0
- package/out/lib/health-parse.test.js +19 -0
- package/out/lib/health-parse.test.js.map +1 -0
- package/out/lib/http.d.ts +2 -0
- package/out/lib/http.d.ts.map +1 -0
- package/out/lib/http.js +234 -0
- package/out/lib/http.js.map +1 -0
- package/out/lib/i18n/index.d.ts +2 -0
- package/out/lib/i18n/index.d.ts.map +1 -0
- package/out/lib/i18n/index.js +29 -0
- package/out/lib/i18n/index.js.map +1 -0
- package/out/lib/i18n/strings.d.ts +2 -0
- package/out/lib/i18n/strings.d.ts.map +1 -0
- package/out/lib/i18n/strings.js +1140 -0
- package/out/lib/i18n/strings.js.map +1 -0
- package/out/lib/lifecycle.d.ts +2 -0
- package/out/lib/lifecycle.d.ts.map +1 -0
- package/out/lib/lifecycle.js +169 -0
- package/out/lib/lifecycle.js.map +1 -0
- package/out/lib/nginx.d.ts +2 -0
- package/out/lib/nginx.d.ts.map +1 -0
- package/out/lib/nginx.js +618 -0
- package/out/lib/nginx.js.map +1 -0
- package/out/lib/paths.d.ts +2 -0
- package/out/lib/paths.d.ts.map +1 -0
- package/out/lib/paths.js +106 -0
- package/out/lib/paths.js.map +1 -0
- package/out/lib/plugin-build.d.ts +2 -0
- package/out/lib/plugin-build.d.ts.map +1 -0
- package/out/lib/plugin-build.js +104 -0
- package/out/lib/plugin-build.js.map +1 -0
- package/out/lib/plugin-cli.d.ts +2 -0
- package/out/lib/plugin-cli.d.ts.map +1 -0
- package/out/lib/plugin-cli.js +142 -0
- package/out/lib/plugin-cli.js.map +1 -0
- package/out/lib/pm2.d.ts +2 -0
- package/out/lib/pm2.d.ts.map +1 -0
- package/out/lib/pm2.js +32 -0
- package/out/lib/pm2.js.map +1 -0
- package/out/lib/ports.d.ts +2 -0
- package/out/lib/ports.d.ts.map +1 -0
- package/out/lib/ports.js +394 -0
- package/out/lib/ports.js.map +1 -0
- package/out/lib/process.d.ts +2 -0
- package/out/lib/process.d.ts.map +1 -0
- package/out/lib/process.js +47 -0
- package/out/lib/process.js.map +1 -0
- package/out/lib/prod-memory.d.ts +6 -0
- package/out/lib/prod-memory.d.ts.map +1 -0
- package/out/lib/prod-memory.js +57 -0
- package/out/lib/prod-memory.js.map +1 -0
- package/out/lib/project-type.d.ts +2 -0
- package/out/lib/project-type.d.ts.map +1 -0
- package/out/lib/project-type.js +77 -0
- package/out/lib/project-type.js.map +1 -0
- package/out/lib/publish.d.ts +3 -0
- package/out/lib/publish.d.ts.map +1 -0
- package/out/lib/publish.js +388 -0
- package/out/lib/publish.js.map +1 -0
- package/out/lib/remote-dev.d.ts +2 -0
- package/out/lib/remote-dev.d.ts.map +1 -0
- package/out/lib/remote-dev.js +158 -0
- package/out/lib/remote-dev.js.map +1 -0
- package/out/lib/root.d.ts +2 -0
- package/out/lib/root.d.ts.map +1 -0
- package/out/lib/root.js +85 -0
- package/out/lib/root.js.map +1 -0
- package/out/lib/spawn.d.ts +2 -0
- package/out/lib/spawn.d.ts.map +1 -0
- package/out/lib/spawn.js +96 -0
- package/out/lib/spawn.js.map +1 -0
- package/out/lib/status.d.ts +2 -0
- package/out/lib/status.d.ts.map +1 -0
- package/out/lib/status.js +78 -0
- package/out/lib/status.js.map +1 -0
- package/out/lib/theme-catalog.d.ts +2 -0
- package/out/lib/theme-catalog.d.ts.map +1 -0
- package/out/lib/theme-catalog.js +6 -0
- package/out/lib/theme-catalog.js.map +1 -0
- package/out/lib/theme-cli.d.ts +2 -0
- package/out/lib/theme-cli.d.ts.map +1 -0
- package/out/lib/theme-cli.js +50 -0
- package/out/lib/theme-cli.js.map +1 -0
- package/out/lib/theme-dev.d.ts +2 -0
- package/out/lib/theme-dev.d.ts.map +1 -0
- package/out/lib/theme-dev.js +759 -0
- package/out/lib/theme-dev.js.map +1 -0
- package/out/lib/theme-env.d.ts +2 -0
- package/out/lib/theme-env.d.ts.map +1 -0
- package/out/lib/theme-env.js +101 -0
- package/out/lib/theme-env.js.map +1 -0
- package/out/lib/theme-install.d.ts +2 -0
- package/out/lib/theme-install.d.ts.map +1 -0
- package/out/lib/theme-install.js +363 -0
- package/out/lib/theme-install.js.map +1 -0
- package/out/lib/theme-lock.d.ts +2 -0
- package/out/lib/theme-lock.d.ts.map +1 -0
- package/out/lib/theme-lock.js +70 -0
- package/out/lib/theme-lock.js.map +1 -0
- package/out/lib/theme-paths.d.ts +2 -0
- package/out/lib/theme-paths.d.ts.map +1 -0
- package/out/lib/theme-paths.js +73 -0
- package/out/lib/theme-paths.js.map +1 -0
- package/out/lib/theme-placeholder-cover.d.ts +13 -0
- package/out/lib/theme-placeholder-cover.d.ts.map +1 -0
- package/out/lib/theme-placeholder-cover.js +95 -0
- package/out/lib/theme-placeholder-cover.js.map +1 -0
- package/out/lib/theme-preview-frame.d.ts +2 -0
- package/out/lib/theme-preview-frame.d.ts.map +1 -0
- package/out/lib/theme-preview-frame.js +107 -0
- package/out/lib/theme-preview-frame.js.map +1 -0
- package/out/lib/theme-preview-pool.d.ts +2 -0
- package/out/lib/theme-preview-pool.d.ts.map +1 -0
- package/out/lib/theme-preview-pool.js +484 -0
- package/out/lib/theme-preview-pool.js.map +1 -0
- package/out/lib/theme-preview-proxy.d.ts +2 -0
- package/out/lib/theme-preview-proxy.d.ts.map +1 -0
- package/out/lib/theme-preview-proxy.js +101 -0
- package/out/lib/theme-preview-proxy.js.map +1 -0
- package/out/lib/theme-prod.d.ts +2 -0
- package/out/lib/theme-prod.d.ts.map +1 -0
- package/out/lib/theme-prod.js +400 -0
- package/out/lib/theme-prod.js.map +1 -0
- package/out/lib/theme-registry.d.ts +2 -0
- package/out/lib/theme-registry.d.ts.map +1 -0
- package/out/lib/theme-registry.js +135 -0
- package/out/lib/theme-registry.js.map +1 -0
- package/out/lib/theme-runtime.d.ts +2 -0
- package/out/lib/theme-runtime.d.ts.map +1 -0
- package/out/lib/theme-runtime.js +344 -0
- package/out/lib/theme-runtime.js.map +1 -0
- package/out/lib/theme-sources.d.ts +2 -0
- package/out/lib/theme-sources.d.ts.map +1 -0
- package/out/lib/theme-sources.js +347 -0
- package/out/lib/theme-sources.js.map +1 -0
- package/out/lib/theme-warmup.d.ts +2 -0
- package/out/lib/theme-warmup.d.ts.map +1 -0
- package/out/lib/theme-warmup.js +167 -0
- package/out/lib/theme-warmup.js.map +1 -0
- package/out/lib/toolkit-build.d.ts +2 -0
- package/out/lib/toolkit-build.d.ts.map +1 -0
- package/out/lib/toolkit-build.js +57 -0
- package/out/lib/toolkit-build.js.map +1 -0
- package/out/types/config.d.ts +57 -0
- package/out/types/config.d.ts.map +1 -0
- package/out/types/config.js +3 -0
- package/out/types/config.js.map +1 -0
- package/out/ui/banner.d.ts +2 -0
- package/out/ui/banner.d.ts.map +1 -0
- package/out/ui/banner.js +358 -0
- package/out/ui/banner.js.map +1 -0
- package/out/ui/interactive.d.ts +2 -0
- package/out/ui/interactive.d.ts.map +1 -0
- package/out/ui/interactive.js +328 -0
- package/out/ui/interactive.js.map +1 -0
- package/out/ui/theme.d.ts +2 -0
- package/out/ui/theme.d.ts.map +1 -0
- package/out/ui/theme.js +250 -0
- package/out/ui/theme.js.map +1 -0
- package/package.json +13 -7
- package/server/dist/common/api-messages.d.ts +9 -0
- package/server/dist/common/api-messages.js +9 -0
- package/server/dist/common/api-messages.js.map +1 -1
- package/server/dist/database/typeorm-options.d.ts +3 -0
- package/server/dist/database/typeorm-options.js +60 -0
- package/server/dist/database/typeorm-options.js.map +1 -0
- package/server/dist/modules/api-key/api-key.controller.js.map +1 -1
- package/server/dist/modules/api-key/api-key.entity.js.map +1 -1
- package/server/dist/modules/api-key/api-key.guard.js +2 -3
- package/server/dist/modules/api-key/api-key.guard.js.map +1 -1
- package/server/dist/modules/api-key/api-key.module.js.map +1 -1
- package/server/dist/modules/api-key/api-key.service.js +1 -1
- package/server/dist/modules/api-key/api-key.service.js.map +1 -1
- package/server/dist/modules/article/article-revision.entity.js +3 -3
- package/server/dist/modules/article/article-revision.entity.js.map +1 -1
- package/server/dist/modules/article/article-slug.util.d.ts +2 -0
- package/server/dist/modules/article/article-slug.util.js +19 -0
- package/server/dist/modules/article/article-slug.util.js.map +1 -0
- package/server/dist/modules/article/scheduled-publish.service.js.map +1 -1
- package/server/dist/modules/bootstrap/bootstrap.constants.d.ts +20 -0
- package/server/dist/modules/bootstrap/bootstrap.constants.js +171 -0
- package/server/dist/modules/bootstrap/bootstrap.constants.js.map +1 -0
- package/server/dist/modules/bootstrap/bootstrap.service.d.ts +22 -0
- package/server/dist/modules/bootstrap/bootstrap.service.js +183 -0
- package/server/dist/modules/bootstrap/bootstrap.service.js.map +1 -0
- package/server/dist/modules/bootstrap/install-locale.d.ts +2 -0
- package/server/dist/modules/bootstrap/install-locale.js +11 -0
- package/server/dist/modules/bootstrap/install-locale.js.map +1 -0
- package/server/dist/modules/extension/extension.module.d.ts +9 -0
- package/server/dist/modules/extension/extension.module.js +50 -0
- package/server/dist/modules/extension/extension.module.js.map +1 -0
- package/server/dist/modules/extension/plugin-loader.service.d.ts +12 -0
- package/server/dist/modules/extension/plugin-loader.service.js +96 -0
- package/server/dist/modules/extension/plugin-loader.service.js.map +1 -0
- package/server/dist/modules/extension/plugin-registry.bridge.d.ts +3 -0
- package/server/dist/modules/extension/plugin-registry.bridge.js +44 -0
- package/server/dist/modules/extension/plugin-registry.bridge.js.map +1 -0
- package/server/dist/modules/extension/plugin.controller.d.ts +22 -0
- package/server/dist/modules/extension/plugin.controller.js +155 -0
- package/server/dist/modules/extension/plugin.controller.js.map +1 -0
- package/server/dist/modules/extension/plugin.service.d.ts +52 -0
- package/server/dist/modules/extension/plugin.service.js +391 -0
- package/server/dist/modules/extension/plugin.service.js.map +1 -0
- package/server/dist/modules/extension/preview-draft.store.d.ts +13 -0
- package/server/dist/modules/extension/preview-draft.store.js +41 -0
- package/server/dist/modules/extension/preview-draft.store.js.map +1 -0
- package/server/dist/modules/extension/theme-registry.bridge.d.ts +56 -0
- package/server/dist/modules/extension/theme-registry.bridge.js +46 -0
- package/server/dist/modules/extension/theme-registry.bridge.js.map +1 -0
- package/server/dist/modules/extension/theme.controller.d.ts +66 -0
- package/server/dist/modules/extension/theme.controller.js +301 -0
- package/server/dist/modules/extension/theme.controller.js.map +1 -0
- package/server/dist/modules/extension/theme.service.d.ts +140 -0
- package/server/dist/modules/extension/theme.service.js +1039 -0
- package/server/dist/modules/extension/theme.service.js.map +1 -0
- package/server/dist/modules/file/file-optimization.controller.d.ts +12 -0
- package/server/dist/modules/file/file-optimization.controller.js +79 -0
- package/server/dist/modules/file/file-optimization.controller.js.map +1 -0
- package/server/dist/modules/file/file-optimization.service.d.ts +36 -0
- package/server/dist/modules/file/file-optimization.service.js +385 -0
- package/server/dist/modules/file/file-optimization.service.js.map +1 -0
- package/server/dist/modules/file/file-optimization.types.d.ts +66 -0
- package/server/dist/modules/file/file-optimization.types.js +5 -0
- package/server/dist/modules/file/file-optimization.types.js.map +1 -0
- package/server/dist/modules/file/image-optimizer-plugin.guard.d.ts +7 -0
- package/server/dist/modules/file/image-optimizer-plugin.guard.js +33 -0
- package/server/dist/modules/file/image-optimizer-plugin.guard.js.map +1 -0
- package/server/dist/modules/health/health.controller.js +2 -4
- package/server/dist/modules/health/health.controller.js.map +1 -1
- package/server/dist/modules/health/health.module.js.map +1 -1
- package/server/dist/modules/hook/hook.module.d.ts +2 -0
- package/server/dist/modules/hook/hook.module.js +22 -0
- package/server/dist/modules/hook/hook.module.js.map +1 -0
- package/server/dist/modules/hook/hook.service.d.ts +26 -0
- package/server/dist/modules/hook/hook.service.js +105 -0
- package/server/dist/modules/hook/hook.service.js.map +1 -0
- package/server/dist/modules/webhook/webhook.controller.js.map +1 -1
- package/server/dist/modules/webhook/webhook.entity.js.map +1 -1
- package/server/dist/modules/webhook/webhook.module.js.map +1 -1
- package/server/dist/modules/webhook/webhook.service.d.ts +1 -1
- package/server/dist/modules/webhook/webhook.service.js +5 -2
- package/server/dist/modules/webhook/webhook.service.js.map +1 -1
- 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/tsconfig.tsbuildinfo +1 -0
- package/server/dist/utils/image-processor.util.d.ts +23 -0
- package/server/dist/utils/image-processor.util.js +88 -0
- package/server/dist/utils/image-processor.util.js.map +1 -0
- package/server/dist/utils/local-api-quiet.util.d.ts +1 -0
- package/server/dist/utils/local-api-quiet.util.js +8 -0
- package/server/dist/utils/local-api-quiet.util.js.map +1 -0
- package/server/dist/utils/project-root.util.d.ts +2 -0
- package/server/dist/utils/project-root.util.js +42 -0
- package/server/dist/utils/project-root.util.js.map +1 -0
- 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/templates/config.local.json +13 -0
- package/templates/env.local.default +10 -0
- package/templates/theme-catalog.json +27 -0
- package/lib/api-dev.js +0 -89
- package/lib/bootstrap.js +0 -114
- package/lib/build.js +0 -162
- package/lib/db-backup.js +0 -67
- package/lib/dev-banner.js +0 -72
- package/lib/dev.js +0 -141
- package/lib/docker.js +0 -275
- package/lib/doctor.js +0 -266
- package/lib/http.js +0 -182
- package/lib/i18n/index.js +0 -32
- package/lib/i18n/strings.js +0 -846
- package/lib/lifecycle.js +0 -190
- package/lib/nginx.js +0 -342
- package/lib/paths.js +0 -108
- package/lib/pm2.js +0 -32
- package/lib/process.js +0 -45
- package/lib/project-type.js +0 -72
- package/lib/publish.js +0 -968
- package/lib/root.js +0 -88
- package/lib/spawn.js +0 -92
- package/lib/status.js +0 -132
- package/ui/banner.js +0 -441
- package/ui/interactive.js +0 -380
- package/ui/theme.js +0 -265
package/lib/doctor.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const net = require('net');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { execSync } = require('child_process');
|
|
5
|
-
const ora = require('ora');
|
|
6
|
-
const {
|
|
7
|
-
brand,
|
|
8
|
-
icon,
|
|
9
|
-
ok,
|
|
10
|
-
warn,
|
|
11
|
-
divider,
|
|
12
|
-
sectionHeader,
|
|
13
|
-
terminalWidth,
|
|
14
|
-
gradientText,
|
|
15
|
-
palette,
|
|
16
|
-
} = require('../ui/theme');
|
|
17
|
-
const { getHealthUrl, checkHealth } = require('./http');
|
|
18
|
-
const { isDockerRunning } = require('./docker');
|
|
19
|
-
const { checkNginx } = require('./nginx');
|
|
20
|
-
const { envFileStatus } = require('./status');
|
|
21
|
-
const { t } = require('./i18n');
|
|
22
|
-
|
|
23
|
-
function checkNodeVersion() {
|
|
24
|
-
const major = parseInt(process.versions.node.split('.')[0], 10);
|
|
25
|
-
if (major >= 18) {
|
|
26
|
-
return { ok: true, message: `Node.js ${process.version}` };
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
ok: false,
|
|
30
|
-
message: t('doctor.nodeBad', { version: process.version }),
|
|
31
|
-
fix: t('doctor.nodeFix'),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function checkDocker() {
|
|
36
|
-
if (isDockerRunning()) {
|
|
37
|
-
return { ok: true, message: t('doctor.dockerOk') };
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
ok: false,
|
|
41
|
-
message: t('doctor.dockerBad'),
|
|
42
|
-
fix: t('doctor.dockerFix'),
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function parseEnv(projectRoot) {
|
|
47
|
-
const envPath = path.join(projectRoot, '.env');
|
|
48
|
-
const out = {};
|
|
49
|
-
try {
|
|
50
|
-
const content = fs.readFileSync(envPath, 'utf8');
|
|
51
|
-
for (const line of content.split('\n')) {
|
|
52
|
-
const m = line.match(/^([A-Z_]+)=(.*)$/);
|
|
53
|
-
if (m) out[m[1]] = m[2].trim().replace(/^['"]|['"]$/g, '');
|
|
54
|
-
}
|
|
55
|
-
} catch {
|
|
56
|
-
// ignore
|
|
57
|
-
}
|
|
58
|
-
return out;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function checkPort(port, host = '127.0.0.1') {
|
|
62
|
-
return new Promise((resolve) => {
|
|
63
|
-
const socket = net.createConnection({ port, host }, () => {
|
|
64
|
-
socket.destroy();
|
|
65
|
-
resolve(true);
|
|
66
|
-
});
|
|
67
|
-
socket.on('error', () => resolve(false));
|
|
68
|
-
socket.setTimeout(1000, () => {
|
|
69
|
-
socket.destroy();
|
|
70
|
-
resolve(false);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function checkPorts(projectRoot) {
|
|
76
|
-
const env = parseEnv(projectRoot);
|
|
77
|
-
const apiPort = parseInt(env.SERVER_PORT || '3002', 10);
|
|
78
|
-
const clientPort = parseInt(env.CLIENT_PORT || '3001', 10);
|
|
79
|
-
|
|
80
|
-
const healthUrl = getHealthUrl(projectRoot);
|
|
81
|
-
const apiHealth = await checkHealth(healthUrl);
|
|
82
|
-
if (apiHealth.ok) {
|
|
83
|
-
return {
|
|
84
|
-
ok: true,
|
|
85
|
-
message: t('doctor.portOk', { apiPort, clientPort }),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const [apiBusy, clientBusy] = await Promise.all([checkPort(apiPort), checkPort(clientPort)]);
|
|
90
|
-
const issues = [];
|
|
91
|
-
if (apiBusy) issues.push(t('doctor.portApiBusy', { port: apiPort }));
|
|
92
|
-
if (clientBusy) issues.push(t('doctor.portClientBusy', { port: clientPort }));
|
|
93
|
-
if (issues.length) {
|
|
94
|
-
return {
|
|
95
|
-
ok: false,
|
|
96
|
-
message: issues.join('; '),
|
|
97
|
-
fix: t('doctor.portFix'),
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
ok: true,
|
|
102
|
-
message: t('doctor.portOk', { apiPort, clientPort }),
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async function checkDatabase(projectRoot) {
|
|
107
|
-
const env = parseEnv(projectRoot);
|
|
108
|
-
const host = env.DB_HOST || '127.0.0.1';
|
|
109
|
-
const port = parseInt(env.DB_PORT || '3306', 10);
|
|
110
|
-
const user = env.DB_USER || 'root';
|
|
111
|
-
const password = env.DB_PASSWD || env.DB_PASSWORD || 'root';
|
|
112
|
-
const database = env.DB_DATABASE || 'reactpress';
|
|
113
|
-
|
|
114
|
-
return new Promise((resolve) => {
|
|
115
|
-
let mysql;
|
|
116
|
-
try {
|
|
117
|
-
mysql = require('mysql2/promise');
|
|
118
|
-
} catch {
|
|
119
|
-
try {
|
|
120
|
-
mysql = require(path.join(projectRoot, 'server/node_modules/mysql2/promise'));
|
|
121
|
-
} catch {
|
|
122
|
-
resolve({
|
|
123
|
-
ok: false,
|
|
124
|
-
message: t('doctor.dbNoMysql2'),
|
|
125
|
-
fix: t('doctor.dbMysql2Fix'),
|
|
126
|
-
});
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
mysql
|
|
132
|
-
.createConnection({ host, port, user, password, database, connectTimeout: 5000 })
|
|
133
|
-
.then(async (conn) => {
|
|
134
|
-
await conn.ping();
|
|
135
|
-
await conn.end();
|
|
136
|
-
resolve({
|
|
137
|
-
ok: true,
|
|
138
|
-
message: t('doctor.dbOk', { host, port, database }),
|
|
139
|
-
});
|
|
140
|
-
})
|
|
141
|
-
.catch((err) => {
|
|
142
|
-
resolve({
|
|
143
|
-
ok: false,
|
|
144
|
-
message: t('doctor.dbBad', { error: err.message }),
|
|
145
|
-
fix: t('doctor.dbFix'),
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async function checkApiHealth(projectRoot) {
|
|
152
|
-
const healthUrl = getHealthUrl(projectRoot);
|
|
153
|
-
const result = await checkHealth(healthUrl);
|
|
154
|
-
if (result.ok) {
|
|
155
|
-
return { ok: true, message: t('doctor.apiOk', { url: healthUrl }) };
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
ok: false,
|
|
159
|
-
message: t('doctor.apiBad', { url: healthUrl }),
|
|
160
|
-
fix: t('doctor.apiFix'),
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function checkPnpm() {
|
|
165
|
-
try {
|
|
166
|
-
const v = execSync('pnpm -v', { encoding: 'utf8' }).trim();
|
|
167
|
-
return { ok: true, message: `pnpm ${v}` };
|
|
168
|
-
} catch {
|
|
169
|
-
return {
|
|
170
|
-
ok: false,
|
|
171
|
-
message: t('doctor.pnpmBad'),
|
|
172
|
-
fix: t('doctor.pnpmFix'),
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
async function runCheckWithSpinner(name, run) {
|
|
178
|
-
const spinner = ora({
|
|
179
|
-
text: t('doctor.checking', { name }),
|
|
180
|
-
color: 'magenta',
|
|
181
|
-
spinner: 'dots',
|
|
182
|
-
}).start();
|
|
183
|
-
const result = await run();
|
|
184
|
-
if (result.ok) {
|
|
185
|
-
spinner.stop();
|
|
186
|
-
} else {
|
|
187
|
-
spinner.stop();
|
|
188
|
-
}
|
|
189
|
-
return result;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
async function runDoctor(projectRoot) {
|
|
193
|
-
const env = envFileStatus(projectRoot);
|
|
194
|
-
const checks = [
|
|
195
|
-
{ name: 'Node.js', run: () => checkNodeVersion() },
|
|
196
|
-
{ name: 'pnpm', run: () => checkPnpm() },
|
|
197
|
-
{
|
|
198
|
-
name: t('doctor.check.config'),
|
|
199
|
-
run: () => ({
|
|
200
|
-
ok: env.config,
|
|
201
|
-
message: env.config ? t('doctor.configOk') : t('doctor.configBad'),
|
|
202
|
-
fix: t('doctor.configFix'),
|
|
203
|
-
}),
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
name: t('doctor.check.env'),
|
|
207
|
-
run: () => ({
|
|
208
|
-
ok: env.env,
|
|
209
|
-
message: env.env ? t('doctor.envOk') : t('doctor.envBad'),
|
|
210
|
-
fix: t('doctor.envFix'),
|
|
211
|
-
}),
|
|
212
|
-
},
|
|
213
|
-
{ name: 'Docker', run: () => checkDocker() },
|
|
214
|
-
{ name: t('doctor.check.nginx'), run: () => checkNginx(projectRoot) },
|
|
215
|
-
{ name: t('doctor.check.ports'), run: () => checkPorts(projectRoot) },
|
|
216
|
-
{ name: t('doctor.check.database'), run: () => checkDatabase(projectRoot) },
|
|
217
|
-
{ name: t('doctor.check.api'), run: () => checkApiHealth(projectRoot) },
|
|
218
|
-
];
|
|
219
|
-
|
|
220
|
-
const w = Math.min(terminalWidth() - 4, 52);
|
|
221
|
-
const results = [];
|
|
222
|
-
const fixes = [];
|
|
223
|
-
|
|
224
|
-
console.log('');
|
|
225
|
-
console.log(
|
|
226
|
-
` ${gradientText(t('doctor.title'), [palette.primary, palette.accent], { bold: true })} ${brand.dim(t('doctor.subtitle'))}`
|
|
227
|
-
);
|
|
228
|
-
console.log(` ${brand.dim(t('doctor.project', { path: projectRoot }))}`);
|
|
229
|
-
console.log(` ${divider(w)}`);
|
|
230
|
-
|
|
231
|
-
for (const { name, run } of checks) {
|
|
232
|
-
const result = await runCheckWithSpinner(name, run);
|
|
233
|
-
results.push({ name, ...result });
|
|
234
|
-
const mark = result.ok ? icon.ok : icon.fail;
|
|
235
|
-
const msgColor = result.ok ? brand.dim : brand.warn;
|
|
236
|
-
console.log(` ${mark} ${brand.bold(name)} ${msgColor(result.message)}`);
|
|
237
|
-
if (!result.ok && result.fix) {
|
|
238
|
-
fixes.push({ name, fix: result.fix });
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const passed = results.filter((r) => r.ok).length;
|
|
243
|
-
const failed = results.length - passed;
|
|
244
|
-
|
|
245
|
-
console.log(` ${divider(w)}`);
|
|
246
|
-
console.log(
|
|
247
|
-
` ${brand.dim(t('doctor.summary', { passed, failed, total: results.length }))}`
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
if (failed === 0) {
|
|
251
|
-
console.log(` ${ok(t('doctor.allPass'))}`);
|
|
252
|
-
} else {
|
|
253
|
-
console.log(` ${warn(t('doctor.failed', { count: failed }))}`);
|
|
254
|
-
if (fixes.length) {
|
|
255
|
-
console.log('');
|
|
256
|
-
console.log(sectionHeader(t('doctor.fixesHeader')));
|
|
257
|
-
for (const { name, fix } of fixes) {
|
|
258
|
-
console.log(` ${brand.primary('→')} ${brand.dim(name)} ${brand.warn(fix)}`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
console.log('');
|
|
263
|
-
return failed === 0 ? 0 : 1;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
module.exports = { runDoctor };
|
package/lib/http.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const http = require('http');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
function loadServerSiteUrl(projectRoot) {
|
|
6
|
-
const envPath = path.join(projectRoot, '.env');
|
|
7
|
-
try {
|
|
8
|
-
const content = fs.readFileSync(envPath, 'utf8');
|
|
9
|
-
const match = content.match(/^SERVER_SITE_URL=(.+)$/m);
|
|
10
|
-
if (match) {
|
|
11
|
-
return match[1].trim().replace(/^['"]|['"]$/g, '');
|
|
12
|
-
}
|
|
13
|
-
} catch {
|
|
14
|
-
// ignore
|
|
15
|
-
}
|
|
16
|
-
return 'http://localhost:3002';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function loadClientSiteUrl(projectRoot) {
|
|
20
|
-
const envPath = path.join(projectRoot, '.env');
|
|
21
|
-
try {
|
|
22
|
-
const content = fs.readFileSync(envPath, 'utf8');
|
|
23
|
-
const match = content.match(/^CLIENT_SITE_URL=(.+)$/m);
|
|
24
|
-
if (match) {
|
|
25
|
-
return match[1].trim().replace(/^['"]|['"]$/g, '');
|
|
26
|
-
}
|
|
27
|
-
} catch {
|
|
28
|
-
// ignore
|
|
29
|
-
}
|
|
30
|
-
return 'http://localhost:3001';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function getApiPrefix(projectRoot) {
|
|
34
|
-
const envPath = path.join(projectRoot, '.env');
|
|
35
|
-
try {
|
|
36
|
-
const content = fs.readFileSync(envPath, 'utf8');
|
|
37
|
-
const match = content.match(/^SERVER_API_PREFIX=(.+)$/m);
|
|
38
|
-
if (match) {
|
|
39
|
-
return match[1].trim().replace(/^['"]|['"]$/g, '');
|
|
40
|
-
}
|
|
41
|
-
} catch {
|
|
42
|
-
// ignore
|
|
43
|
-
}
|
|
44
|
-
return '/api';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function getHealthUrl(projectRoot) {
|
|
48
|
-
const base = loadServerSiteUrl(projectRoot).replace(/\/$/, '');
|
|
49
|
-
const prefix = getApiPrefix(projectRoot).replace(/\/$/, '');
|
|
50
|
-
return `${base}${prefix}/health`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function probeHttp(url, timeoutMs = 3000) {
|
|
54
|
-
return new Promise((resolve) => {
|
|
55
|
-
let parsed;
|
|
56
|
-
try {
|
|
57
|
-
parsed = new URL(url);
|
|
58
|
-
} catch {
|
|
59
|
-
resolve({ ok: false, statusCode: 0, data: null });
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const port = parsed.port || (parsed.protocol === 'https:' ? 443 : 80);
|
|
63
|
-
const req = http.request(
|
|
64
|
-
{
|
|
65
|
-
hostname: parsed.hostname,
|
|
66
|
-
port,
|
|
67
|
-
path: parsed.pathname + (parsed.search || ''),
|
|
68
|
-
method: 'GET',
|
|
69
|
-
timeout: timeoutMs,
|
|
70
|
-
},
|
|
71
|
-
(res) => {
|
|
72
|
-
let body = '';
|
|
73
|
-
res.on('data', (chunk) => {
|
|
74
|
-
body += chunk;
|
|
75
|
-
});
|
|
76
|
-
res.on('end', () => {
|
|
77
|
-
const ok = res.statusCode === 200;
|
|
78
|
-
let data = null;
|
|
79
|
-
try {
|
|
80
|
-
data = JSON.parse(body);
|
|
81
|
-
} catch {
|
|
82
|
-
// ignore
|
|
83
|
-
}
|
|
84
|
-
resolve({ ok, statusCode: res.statusCode, data });
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
req.on('timeout', () => {
|
|
89
|
-
req.destroy();
|
|
90
|
-
resolve({ ok: false, statusCode: 0, data: null });
|
|
91
|
-
});
|
|
92
|
-
req.on('error', () => resolve({ ok: false, statusCode: 0, data: null }));
|
|
93
|
-
req.end();
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Health probe: prefers `/api/health` JSON; falls back to API prefix (e.g. Swagger)
|
|
99
|
-
* for older bundled servers that omit the health route.
|
|
100
|
-
*/
|
|
101
|
-
async function checkHealth(url, timeoutMs = 3000) {
|
|
102
|
-
const primary = await probeHttp(url, timeoutMs);
|
|
103
|
-
if (primary.ok) return primary;
|
|
104
|
-
|
|
105
|
-
if (primary.statusCode === 404 || primary.statusCode === 0) {
|
|
106
|
-
try {
|
|
107
|
-
const parsed = new URL(url);
|
|
108
|
-
const prefix = parsed.pathname.replace(/\/health\/?$/, '') || '/api';
|
|
109
|
-
const candidates = [
|
|
110
|
-
`${parsed.origin}${prefix}/`,
|
|
111
|
-
`${parsed.origin}${prefix}`,
|
|
112
|
-
parsed.origin,
|
|
113
|
-
];
|
|
114
|
-
for (const fallback of candidates) {
|
|
115
|
-
const alt = await probeHttp(fallback, timeoutMs);
|
|
116
|
-
if (alt.statusCode === 200) {
|
|
117
|
-
return {
|
|
118
|
-
ok: true,
|
|
119
|
-
statusCode: 200,
|
|
120
|
-
data: { status: 'ok', database: 'unknown' },
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
} catch {
|
|
125
|
-
// ignore
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return primary;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function isHttpResponding(url, timeoutMs = 2000) {
|
|
133
|
-
return new Promise((resolve) => {
|
|
134
|
-
let parsed;
|
|
135
|
-
try {
|
|
136
|
-
parsed = new URL(url);
|
|
137
|
-
} catch {
|
|
138
|
-
resolve(false);
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const port = parsed.port || (parsed.protocol === 'https:' ? 443 : 80);
|
|
143
|
-
const req = http.request(
|
|
144
|
-
{
|
|
145
|
-
hostname: parsed.hostname,
|
|
146
|
-
port,
|
|
147
|
-
path: parsed.pathname || '/',
|
|
148
|
-
method: 'GET',
|
|
149
|
-
timeout: timeoutMs,
|
|
150
|
-
},
|
|
151
|
-
(res) => resolve(res.statusCode > 0)
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
req.on('timeout', () => {
|
|
155
|
-
req.destroy();
|
|
156
|
-
resolve(false);
|
|
157
|
-
});
|
|
158
|
-
req.on('error', () => resolve(false));
|
|
159
|
-
req.end();
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async function waitForHttp(url, timeoutMs = 120_000, intervalMs = 500) {
|
|
164
|
-
const deadline = Date.now() + timeoutMs;
|
|
165
|
-
while (Date.now() < deadline) {
|
|
166
|
-
if (await isHttpResponding(url)) {
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
await new Promise((r) => setTimeout(r, intervalMs));
|
|
170
|
-
}
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
module.exports = {
|
|
175
|
-
loadServerSiteUrl,
|
|
176
|
-
loadClientSiteUrl,
|
|
177
|
-
getApiPrefix,
|
|
178
|
-
getHealthUrl,
|
|
179
|
-
checkHealth,
|
|
180
|
-
isHttpResponding,
|
|
181
|
-
waitForHttp,
|
|
182
|
-
};
|
package/lib/i18n/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const { STRINGS } = require('./strings');
|
|
2
|
-
|
|
3
|
-
function resolveLocale() {
|
|
4
|
-
const raw = process.env.REACTPRESS_LANG || process.env.LANG || 'en';
|
|
5
|
-
const code = String(raw).split(/[._-]/)[0].toLowerCase();
|
|
6
|
-
return code === 'zh' ? 'zh' : 'en';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let locale = resolveLocale();
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param {string} key
|
|
13
|
-
* @param {Record<string, string | number>} [vars]
|
|
14
|
-
*/
|
|
15
|
-
function t(key, vars = {}) {
|
|
16
|
-
const table = STRINGS[locale] || STRINGS.en;
|
|
17
|
-
let text = table[key] ?? STRINGS.en[key] ?? key;
|
|
18
|
-
for (const [name, value] of Object.entries(vars)) {
|
|
19
|
-
text = text.replace(new RegExp(`\\{${name}\\}`, 'g'), String(value));
|
|
20
|
-
}
|
|
21
|
-
return text;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function getLocale() {
|
|
25
|
-
return locale;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function setLocale(next) {
|
|
29
|
-
locale = next === 'zh' ? 'zh' : 'en';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = { t, getLocale, setLocale, resolveLocale };
|