@fecommunity/reactpress 3.7.0 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +566 -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 +914 -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 +1192 -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 +95 -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 +378 -0
- package/out/ui/interactive.js.map +1 -0
- package/out/ui/prompts.d.ts +2 -0
- package/out/ui/prompts.d.ts.map +1 -0
- package/out/ui/prompts.js +91 -0
- package/out/ui/prompts.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/node-polyfills.d.ts +18 -0
- package/server/dist/node-polyfills.js +24 -0
- package/server/dist/node-polyfills.js.map +1 -0
- 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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @deprecated 3.0 起请使用 `reactpress`(@fecommunity/reactpress)。3.1 将移除此 bin。
|
|
5
5
|
*/
|
|
6
6
|
const chalk = require('chalk');
|
|
7
|
-
const { t } = require('../lib/i18n');
|
|
7
|
+
const { t } = require('../out/lib/i18n');
|
|
8
8
|
|
|
9
9
|
function mapLegacyArgv(argv) {
|
|
10
10
|
const [cmd, ...rest] = argv;
|
|
@@ -16,11 +16,7 @@ function mapLegacyArgv(argv) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
if (!process.env.REACTPRESS_SUPPRESS_DEPRECATION) {
|
|
19
|
-
console.warn(
|
|
20
|
-
chalk.yellow(
|
|
21
|
-
t('shim.deprecated')
|
|
22
|
-
)
|
|
23
|
-
);
|
|
19
|
+
console.warn(chalk.yellow(t('shim.deprecated')));
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
const mapped = mapLegacyArgv(process.argv.slice(2));
|
package/bin/reactpress.js
CHANGED
|
@@ -1,381 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ReactPress unified CLI — init, dev, build, server, docker, publish.
|
|
5
|
-
* Run without arguments for an interactive menu (Claude Code–style).
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { Command } = require('commander');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
const chalk = require('chalk');
|
|
11
|
-
const { brand, divider } = require('../ui/theme');
|
|
12
|
-
const { ensureOriginalCwd } = require('../lib/root');
|
|
13
|
-
const { ensureProjectEnvironment, initMonorepoProject } = require('../lib/bootstrap');
|
|
14
|
-
const { runDev } = require('../lib/dev');
|
|
15
|
-
const { runApiDev } = require('../lib/api-dev');
|
|
16
|
-
const { runLifecycleCommand } = require('../lib/lifecycle');
|
|
17
|
-
const { runDockerCommand } = require('../lib/docker');
|
|
18
|
-
const { runNginxCommand } = require('../lib/nginx');
|
|
19
|
-
const { printUnifiedStatus } = require('../lib/status');
|
|
20
|
-
const { runDoctor } = require('../lib/doctor');
|
|
21
|
-
const { runDbBackup } = require('../lib/db-backup');
|
|
22
|
-
const { runBuild } = require('../lib/build');
|
|
23
|
-
const { startApiWithPm2 } = require('../lib/pm2');
|
|
24
|
-
const { runNodeScript, runReactpressCli } = require('../lib/spawn');
|
|
25
|
-
const { getClientBin } = require('../lib/paths');
|
|
26
|
-
const { runInteractiveLoop } = require('../ui/interactive');
|
|
27
|
-
const { t } = require('../lib/i18n');
|
|
28
|
-
|
|
29
|
-
const rootPkg = require(path.join(__dirname, '..', 'package.json'));
|
|
30
|
-
|
|
31
|
-
const program = new Command();
|
|
32
|
-
|
|
33
|
-
program
|
|
34
|
-
.name('reactpress')
|
|
35
|
-
.description(t('cli.description'))
|
|
36
|
-
.version(rootPkg.version);
|
|
37
|
-
|
|
38
|
-
program
|
|
39
|
-
.command('init')
|
|
40
|
-
.description(t('cli.init.description'))
|
|
41
|
-
.argument('[directory]', t('cli.init.directory'), '.')
|
|
42
|
-
.option('-f, --force', t('cli.init.force'))
|
|
43
|
-
.action(async (directory, options) => {
|
|
44
|
-
const projectRoot = path.resolve(directory);
|
|
45
|
-
process.env.REACTPRESS_ORIGINAL_CWD = projectRoot;
|
|
46
|
-
const { isMonorepoCheckout } = require('../lib/bootstrap');
|
|
47
|
-
if (isMonorepoCheckout(projectRoot)) {
|
|
48
|
-
const result = await initMonorepoProject(projectRoot, { force: !!options.force });
|
|
49
|
-
console.log(`[reactpress] ${result.message}`);
|
|
50
|
-
process.exit(result.ok ? 0 : 1);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const args = ['init', directory];
|
|
54
|
-
if (options.force) args.push('--force');
|
|
55
|
-
runReactpressCli(args, { cwd: projectRoot });
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
program
|
|
59
|
-
.command('dev')
|
|
60
|
-
.description(t('cli.dev.description'))
|
|
61
|
-
.option('--api-only', t('cli.dev.apiOnly'))
|
|
62
|
-
.option('--client-only', t('cli.dev.clientOnly'))
|
|
63
|
-
.action(async (options) => {
|
|
64
|
-
const projectRoot = ensureOriginalCwd();
|
|
65
|
-
try {
|
|
66
|
-
if (options.clientOnly) {
|
|
67
|
-
await runNodeScript(getClientBin(), [], { cwd: projectRoot });
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (options.apiOnly) {
|
|
71
|
-
await runApiDev(projectRoot);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
await runDev(projectRoot);
|
|
75
|
-
} catch (err) {
|
|
76
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
77
|
-
process.exit(err.exitCode ?? 1);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const serverCmd = program.command('server').description(t('cli.server.description'));
|
|
82
|
-
|
|
83
|
-
serverCmd
|
|
84
|
-
.command('start')
|
|
85
|
-
.description(t('cli.server.start.description'))
|
|
86
|
-
.option('--pm2', t('cli.server.start.pm2'))
|
|
87
|
-
.option('--bg', t('cli.server.start.bg'))
|
|
88
|
-
.action(async (options) => {
|
|
89
|
-
const projectRoot = ensureOriginalCwd();
|
|
90
|
-
try {
|
|
91
|
-
if (options.pm2) {
|
|
92
|
-
await startApiWithPm2(projectRoot);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const cmd = options.bg ? 'start:bg' : 'start';
|
|
96
|
-
const code = await runLifecycleCommand(cmd, projectRoot);
|
|
97
|
-
process.exit(code ?? 0);
|
|
98
|
-
} catch (err) {
|
|
99
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
serverCmd.command('stop').description(t('cli.server.stop')).action(async () => {
|
|
105
|
-
const code = await runLifecycleCommand('stop', ensureOriginalCwd());
|
|
106
|
-
process.exit(code ?? 0);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
serverCmd.command('restart').description(t('cli.server.restart')).action(async () => {
|
|
110
|
-
const code = await runLifecycleCommand('restart', ensureOriginalCwd());
|
|
111
|
-
process.exit(code ?? 0);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
serverCmd.command('status').description(t('cli.server.status')).action(async () => {
|
|
115
|
-
await runLifecycleCommand('status', ensureOriginalCwd());
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const clientCmd = program.command('client').description(t('cli.client.description'));
|
|
119
|
-
|
|
120
|
-
clientCmd
|
|
121
|
-
.command('start')
|
|
122
|
-
.description(t('cli.client.start'))
|
|
123
|
-
.option('--pm2', t('cli.client.start.pm2'))
|
|
124
|
-
.action(async (options) => {
|
|
125
|
-
const args = options.pm2 ? ['--pm2'] : [];
|
|
126
|
-
await runNodeScript(getClientBin(), args, { cwd: ensureOriginalCwd() });
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
program
|
|
130
|
-
.command('build')
|
|
131
|
-
.description(t('cli.build.description'))
|
|
132
|
-
.option('-t, --target <target>', t('cli.build.target'), 'all')
|
|
133
|
-
.action(async (options) => {
|
|
134
|
-
try {
|
|
135
|
-
await runBuild(options.target, ensureOriginalCwd());
|
|
136
|
-
} catch (err) {
|
|
137
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
138
|
-
process.exit(1);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const dockerCmd = program.command('docker').description(t('cli.docker.description'));
|
|
143
|
-
|
|
144
|
-
dockerCmd
|
|
145
|
-
.command('up')
|
|
146
|
-
.description(t('cli.docker.up'))
|
|
147
|
-
.action(async () => {
|
|
148
|
-
await runDockerCommand('up', ensureOriginalCwd());
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
dockerCmd
|
|
152
|
-
.command('down')
|
|
153
|
-
.alias('stop')
|
|
154
|
-
.description(t('cli.docker.down'))
|
|
155
|
-
.action(async () => {
|
|
156
|
-
await runDockerCommand('down', ensureOriginalCwd());
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
dockerCmd
|
|
160
|
-
.command('start')
|
|
161
|
-
.description(t('cli.docker.start'))
|
|
162
|
-
.action(async () => {
|
|
163
|
-
await runDockerCommand('start', ensureOriginalCwd());
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
dockerCmd.command('restart').description(t('cli.docker.restart')).action(async () => {
|
|
167
|
-
await runDockerCommand('restart', ensureOriginalCwd());
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
dockerCmd.command('status').description(t('cli.docker.status')).action(async () => {
|
|
171
|
-
await runDockerCommand('status', ensureOriginalCwd());
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
dockerCmd
|
|
175
|
-
.command('logs [service]')
|
|
176
|
-
.description(t('cli.docker.logs'))
|
|
177
|
-
.action(async (service) => {
|
|
178
|
-
await runDockerCommand('logs', ensureOriginalCwd(), service ? [service] : []);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const nginxCmd = program.command('nginx').description(t('cli.nginx.description'));
|
|
182
|
-
|
|
183
|
-
function nginxActionOptions(cmd) {
|
|
184
|
-
return cmd.option('--prod', t('cli.nginx.prod')).option('-f, --force', t('cli.nginx.force'));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
nginxActionOptions(nginxCmd.command('ensure').description(t('cli.nginx.ensure'))).action(async (options) => {
|
|
188
|
-
try {
|
|
189
|
-
await runNginxCommand('ensure', ensureOriginalCwd(), [], options);
|
|
190
|
-
} catch (err) {
|
|
191
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
192
|
-
process.exit(1);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
nginxActionOptions(nginxCmd.command('up').description(t('cli.nginx.up'))).action(async (options) => {
|
|
197
|
-
try {
|
|
198
|
-
await runNginxCommand('up', ensureOriginalCwd(), [], options);
|
|
199
|
-
} catch (err) {
|
|
200
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
201
|
-
process.exit(1);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
nginxCmd
|
|
206
|
-
.command('down')
|
|
207
|
-
.alias('stop')
|
|
208
|
-
.description(t('cli.nginx.down'))
|
|
209
|
-
.option('--prod', t('cli.nginx.prod'))
|
|
210
|
-
.action(async (options) => {
|
|
211
|
-
try {
|
|
212
|
-
await runNginxCommand('down', ensureOriginalCwd(), [], options);
|
|
213
|
-
} catch (err) {
|
|
214
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
215
|
-
process.exit(1);
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
nginxActionOptions(nginxCmd.command('restart').description(t('cli.nginx.restart'))).action(async (options) => {
|
|
220
|
-
try {
|
|
221
|
-
await runNginxCommand('restart', ensureOriginalCwd(), [], options);
|
|
222
|
-
} catch (err) {
|
|
223
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
224
|
-
process.exit(1);
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
nginxCmd
|
|
229
|
-
.command('status')
|
|
230
|
-
.description(t('cli.nginx.status'))
|
|
231
|
-
.option('--prod', t('cli.nginx.prod'))
|
|
232
|
-
.action(async (options) => {
|
|
233
|
-
try {
|
|
234
|
-
await runNginxCommand('status', ensureOriginalCwd(), [], options);
|
|
235
|
-
} catch (err) {
|
|
236
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
237
|
-
process.exit(1);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
nginxCmd.command('logs').description(t('cli.nginx.logs')).action(async () => {
|
|
242
|
-
try {
|
|
243
|
-
await runNginxCommand('logs', ensureOriginalCwd());
|
|
244
|
-
} catch (err) {
|
|
245
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
246
|
-
process.exit(1);
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
nginxCmd.command('test').description(t('cli.nginx.test')).action(async () => {
|
|
251
|
-
try {
|
|
252
|
-
await runNginxCommand('test', ensureOriginalCwd());
|
|
253
|
-
} catch (err) {
|
|
254
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
255
|
-
process.exit(1);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
nginxCmd.command('reload').description(t('cli.nginx.reload')).action(async () => {
|
|
260
|
-
try {
|
|
261
|
-
await runNginxCommand('reload', ensureOriginalCwd());
|
|
262
|
-
} catch (err) {
|
|
263
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
264
|
-
process.exit(1);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
nginxCmd.command('open').description(t('cli.nginx.open')).action(async () => {
|
|
269
|
-
try {
|
|
270
|
-
await runNginxCommand('open', ensureOriginalCwd());
|
|
271
|
-
} catch (err) {
|
|
272
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
273
|
-
process.exit(1);
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
program
|
|
278
|
-
.command('status')
|
|
279
|
-
.description(t('cli.status.description'))
|
|
280
|
-
.action(async () => {
|
|
281
|
-
await printUnifiedStatus(ensureOriginalCwd());
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
program
|
|
285
|
-
.command('doctor')
|
|
286
|
-
.description(t('cli.doctor.description'))
|
|
287
|
-
.action(async () => {
|
|
288
|
-
const code = await runDoctor(ensureOriginalCwd());
|
|
289
|
-
process.exit(code);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
const dbCmd = program.command('db').description(t('cli.db.description'));
|
|
293
|
-
|
|
294
|
-
dbCmd
|
|
295
|
-
.command('backup')
|
|
296
|
-
.description(t('cli.db.backup'))
|
|
297
|
-
.option('-o, --output <file>', t('cli.db.backup.output'))
|
|
298
|
-
.action(async (options) => {
|
|
299
|
-
try {
|
|
300
|
-
await runDbBackup(ensureOriginalCwd(), options.output);
|
|
301
|
-
} catch (err) {
|
|
302
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
303
|
-
process.exit(1);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
program
|
|
308
|
-
.command('publish')
|
|
309
|
-
.description(t('cli.publish.description'))
|
|
310
|
-
.option('--build', t('cli.publish.build'))
|
|
311
|
-
.option('--publish', t('cli.publish.publish'))
|
|
312
|
-
.action(async (options) => {
|
|
313
|
-
try {
|
|
314
|
-
const publish = require('../lib/publish');
|
|
315
|
-
if (options.build) {
|
|
316
|
-
await publish.buildPackages();
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
await publish.publishPackages();
|
|
320
|
-
} catch (err) {
|
|
321
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
322
|
-
process.exit(1);
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
program
|
|
327
|
-
.command('start')
|
|
328
|
-
.description(t('cli.start.description'))
|
|
329
|
-
.action(async () => {
|
|
330
|
-
const projectRoot = ensureOriginalCwd();
|
|
331
|
-
const { hasClient } = require('../lib/project-type');
|
|
332
|
-
const code = await runLifecycleCommand('start', projectRoot);
|
|
333
|
-
if (code !== 0) process.exit(code);
|
|
334
|
-
if (!hasClient(projectRoot)) {
|
|
335
|
-
console.log(t('dev.standaloneHint'));
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
const { spawn } = require('child_process');
|
|
339
|
-
const child = spawn('pnpm', ['run', '--dir', './client', 'start'], {
|
|
340
|
-
stdio: 'inherit',
|
|
341
|
-
shell: true,
|
|
342
|
-
cwd: projectRoot,
|
|
343
|
-
});
|
|
344
|
-
child.on('close', (c) => process.exit(c ?? 0));
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
program.on('--help', () => {
|
|
348
|
-
console.log('');
|
|
349
|
-
console.log(brand.bold(t('cli.help.examples')));
|
|
350
|
-
console.log(divider(40));
|
|
351
|
-
const lines = [
|
|
352
|
-
t('cli.help.interactive'),
|
|
353
|
-
t('cli.help.dev'),
|
|
354
|
-
t('cli.help.init'),
|
|
355
|
-
t('cli.help.server'),
|
|
356
|
-
t('cli.help.status'),
|
|
357
|
-
t('cli.help.doctor'),
|
|
358
|
-
t('cli.help.docker'),
|
|
359
|
-
t('cli.help.nginx'),
|
|
360
|
-
t('cli.help.build'),
|
|
361
|
-
t('cli.help.publish'),
|
|
362
|
-
];
|
|
363
|
-
for (const line of lines) {
|
|
364
|
-
console.log(brand.dim(line));
|
|
365
|
-
}
|
|
366
|
-
console.log('');
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
async function main() {
|
|
370
|
-
const argv = process.argv.slice(2);
|
|
371
|
-
if (argv.length === 0) {
|
|
372
|
-
await runInteractiveLoop();
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
program.parse(process.argv);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
main().catch((err) => {
|
|
379
|
-
console.error(chalk.red('[reactpress]'), err.message || err);
|
|
380
|
-
process.exit(1);
|
|
381
|
-
});
|
|
2
|
+
require('../out/bin/reactpress.js');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b524906a4e938071df11ce580297a66affddfc51a54cd4ea08dadd28648bdfb3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactpress-cli-shim.d.ts","sourceRoot":"","sources":["../../src/bin/reactpress-cli-shim.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated 3.0 起请使用 `reactpress`(@fecommunity/reactpress)。3.1 将移除此 bin。
|
|
7
|
+
*/
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
const { t } = require('../lib/i18n');
|
|
10
|
+
function mapLegacyArgv(argv) {
|
|
11
|
+
const [cmd, ...rest] = argv;
|
|
12
|
+
if (cmd === 'start')
|
|
13
|
+
return ['server', 'start', ...rest];
|
|
14
|
+
if (cmd === 'stop')
|
|
15
|
+
return ['server', 'stop', ...rest];
|
|
16
|
+
if (cmd === 'restart')
|
|
17
|
+
return ['server', 'restart', ...rest];
|
|
18
|
+
if (cmd === 'status')
|
|
19
|
+
return ['server', 'status', ...rest];
|
|
20
|
+
return argv;
|
|
21
|
+
}
|
|
22
|
+
if (!process.env.REACTPRESS_SUPPRESS_DEPRECATION) {
|
|
23
|
+
console.warn(chalk.yellow(t('shim.deprecated')));
|
|
24
|
+
}
|
|
25
|
+
const mapped = mapLegacyArgv(process.argv.slice(2));
|
|
26
|
+
process.argv = [process.argv[0], process.argv[1], ...mapped];
|
|
27
|
+
require('./reactpress.js');
|
|
28
|
+
//# sourceMappingURL=reactpress-cli-shim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactpress-cli-shim.js","sourceRoot":"","sources":["../../src/bin/reactpress-cli-shim.ts"],"names":[],"mappings":";;AACA,cAAc;;AAEd;;GAEG;AACH,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAErC,SAAS,aAAa,CAAC,IAAI;IACzB,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,IAAI,GAAG,KAAK,OAAO;QAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACzD,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IACvD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7D,IAAI,GAAG,KAAK,QAAQ;QAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,CAAC;IACjD,OAAO,CAAC,IAAI,CACV,KAAK,CAAC,MAAM,CACV,CAAC,CAAC,iBAAiB,CAAC,CACrB,CACF,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;AAC7D,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactpress-theme-client.d.ts","sourceRoot":"","sources":["../../src/bin/reactpress-theme-client.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
/**
|
|
6
|
+
* Generic ReactPress theme client launcher (for themes without bin/reactpress-client.js).
|
|
7
|
+
* Set REACTPRESS_THEME_DIR to the active theme package root.
|
|
8
|
+
*/
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const { spawn, spawnSync } = require('child_process');
|
|
12
|
+
const { hasUsableProductionBuild } = require('../lib/theme-prod');
|
|
13
|
+
const { getPm2ClientMemoryRestart, resolveBuildNodeEnv } = require('../lib/prod-memory');
|
|
14
|
+
const { readActiveThemeManifest } = require('../lib/theme-runtime');
|
|
15
|
+
const originalCwd = process.env.REACTPRESS_ORIGINAL_CWD || process.cwd();
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
const usePM2 = args.includes('--pm2');
|
|
18
|
+
const clientDir = process.env.REACTPRESS_THEME_DIR
|
|
19
|
+
? path.resolve(process.env.REACTPRESS_THEME_DIR)
|
|
20
|
+
: null;
|
|
21
|
+
if (!clientDir || !fs.existsSync(path.join(clientDir, 'package.json'))) {
|
|
22
|
+
console.error('[ReactPress Client] REACTPRESS_THEME_DIR must point to a theme package');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const nextDir = path.join(clientDir, '.next');
|
|
26
|
+
const startScript = fs.existsSync(path.join(clientDir, 'server.js')) ? 'server.js' : null;
|
|
27
|
+
function runStartCommand() {
|
|
28
|
+
if (startScript) {
|
|
29
|
+
return ['node', [startScript]];
|
|
30
|
+
}
|
|
31
|
+
return ['npm', ['run', 'start']];
|
|
32
|
+
}
|
|
33
|
+
function ensureBuilt() {
|
|
34
|
+
const { activeTheme } = readActiveThemeManifest(originalCwd);
|
|
35
|
+
const themeId = process.env.REACTPRESS_THEME_ID || activeTheme || path.basename(clientDir);
|
|
36
|
+
if (hasUsableProductionBuild(clientDir, themeId))
|
|
37
|
+
return;
|
|
38
|
+
console.log('[ReactPress Client] Client not built yet. Building…');
|
|
39
|
+
const build = spawnSync('pnpm', ['run', 'build'], {
|
|
40
|
+
stdio: 'inherit',
|
|
41
|
+
cwd: clientDir,
|
|
42
|
+
env: resolveBuildNodeEnv({ ...process.env, REACTPRESS_BUILD_ACTIVE: '1' }),
|
|
43
|
+
});
|
|
44
|
+
if (build.status !== 0)
|
|
45
|
+
process.exit(build.status || 1);
|
|
46
|
+
}
|
|
47
|
+
function startWithPm2() {
|
|
48
|
+
ensureBuilt();
|
|
49
|
+
const [cmd, cmdArgs] = runStartCommand();
|
|
50
|
+
const visitorPort = process.env.CLIENT_PORT || process.env.PORT || '3001';
|
|
51
|
+
const apiPort = process.env.SERVER_PORT || '3002';
|
|
52
|
+
const nginxEntry = (process.env.REACTPRESS_NGINX_ENTRY_URL || process.env.NGINX_ENTRY_URL || '')
|
|
53
|
+
.replace(/\/$/, '');
|
|
54
|
+
const pm2Env = {
|
|
55
|
+
...process.env,
|
|
56
|
+
NODE_ENV: 'production',
|
|
57
|
+
PORT: String(visitorPort),
|
|
58
|
+
CLIENT_PORT: String(visitorPort),
|
|
59
|
+
REACTPRESS_ORIGINAL_CWD: originalCwd,
|
|
60
|
+
REACTPRESS_THEME_DIR: clientDir,
|
|
61
|
+
REACTPRESS_API_URL: process.env.REACTPRESS_API_URL || `http://127.0.0.1:${apiPort}/api`,
|
|
62
|
+
SERVER_API_URL: process.env.SERVER_API_URL || `http://127.0.0.1:${apiPort}/api`,
|
|
63
|
+
NEXT_PUBLIC_REACTPRESS_API_URL: process.env.NEXT_PUBLIC_REACTPRESS_API_URL ||
|
|
64
|
+
(nginxEntry ? `${nginxEntry}/api` : `http://127.0.0.1:${apiPort}/api`),
|
|
65
|
+
...(nginxEntry
|
|
66
|
+
? { REACTPRESS_NGINX_ENTRY_URL: nginxEntry, NGINX_ENTRY_URL: nginxEntry }
|
|
67
|
+
: { REACTPRESS_SKIP_DEV_PORT_REDIRECT: '1' }),
|
|
68
|
+
};
|
|
69
|
+
const pm2Mem = getPm2ClientMemoryRestart();
|
|
70
|
+
const pm2Args = cmd === 'node'
|
|
71
|
+
? [
|
|
72
|
+
'start',
|
|
73
|
+
cmd,
|
|
74
|
+
'--name',
|
|
75
|
+
'reactpress-client',
|
|
76
|
+
'--update-env',
|
|
77
|
+
'--max-memory-restart',
|
|
78
|
+
pm2Mem,
|
|
79
|
+
'--',
|
|
80
|
+
...cmdArgs,
|
|
81
|
+
]
|
|
82
|
+
: [
|
|
83
|
+
'start',
|
|
84
|
+
cmd,
|
|
85
|
+
'--name',
|
|
86
|
+
'reactpress-client',
|
|
87
|
+
'--update-env',
|
|
88
|
+
'--max-memory-restart',
|
|
89
|
+
pm2Mem,
|
|
90
|
+
'--',
|
|
91
|
+
...cmdArgs,
|
|
92
|
+
];
|
|
93
|
+
const child = spawn('pm2', pm2Args, { stdio: 'inherit', cwd: clientDir, env: pm2Env });
|
|
94
|
+
child.on('close', (code) => process.exit(code ?? 0));
|
|
95
|
+
child.on('error', (err) => {
|
|
96
|
+
console.error('[ReactPress Client] PM2 failed:', err);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function startWithNode() {
|
|
101
|
+
ensureBuilt();
|
|
102
|
+
process.chdir(clientDir);
|
|
103
|
+
const [cmd, cmdArgs] = runStartCommand();
|
|
104
|
+
const child = spawn(cmd, cmdArgs, { stdio: 'inherit', cwd: clientDir, env: process.env });
|
|
105
|
+
child.on('close', (code) => process.exit(code ?? 0));
|
|
106
|
+
}
|
|
107
|
+
if (usePM2) {
|
|
108
|
+
startWithPm2();
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
startWithNode();
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=reactpress-theme-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactpress-theme-client.js","sourceRoot":"","sources":["../../src/bin/reactpress-theme-client.ts"],"names":[],"mappings":";;AACA,cAAc;;AAEd;;;GAGG;AAEH,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AACtD,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAClE,MAAM,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAA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