@fecommunity/reactpress 3.0.3 → 3.0.4
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.js +127 -20
- package/dist/index.js +0 -0
- package/lib/build.js +25 -9
- package/lib/db-backup.js +21 -0
- package/lib/dev-banner.js +42 -10
- package/lib/dev.js +48 -29
- package/lib/docker.js +162 -44
- package/lib/doctor.js +71 -15
- package/lib/http.js +39 -4
- package/lib/i18n/strings.js +297 -40
- package/lib/lifecycle.js +43 -2
- package/lib/nginx.js +342 -0
- package/lib/project-type.js +72 -0
- package/lib/publish.js +46 -30
- package/lib/status.js +69 -45
- package/package.json +5 -6
- package/server/dist/dist/app.module.d.ts +2 -0
- package/server/dist/dist/app.module.js +105 -0
- package/server/dist/dist/app.module.js.map +1 -0
- package/server/dist/dist/common/api-messages.d.ts +32 -0
- package/server/dist/dist/common/api-messages.js +36 -0
- package/server/dist/dist/common/api-messages.js.map +1 -0
- package/server/dist/dist/filters/http-exception.filter.d.ts +4 -0
- package/server/dist/dist/filters/http-exception.filter.js +36 -0
- package/server/dist/dist/filters/http-exception.filter.js.map +1 -0
- package/server/dist/dist/generate-swagger.d.ts +1 -0
- package/server/dist/dist/generate-swagger.js +73 -0
- package/server/dist/dist/generate-swagger.js.map +1 -0
- package/server/dist/dist/interceptors/transform.interceptor.d.ts +9 -0
- package/server/dist/dist/interceptors/transform.interceptor.js +36 -0
- package/server/dist/dist/interceptors/transform.interceptor.js.map +1 -0
- package/server/dist/dist/logger/index.d.ts +4 -0
- package/server/dist/dist/logger/index.js +33 -0
- package/server/dist/dist/logger/index.js.map +1 -0
- package/server/dist/dist/main.d.ts +6 -0
- package/server/dist/dist/main.js +263 -0
- package/server/dist/dist/main.js.map +1 -0
- package/server/dist/dist/modules/api-key/api-key.controller.d.ts +14 -0
- package/server/dist/dist/modules/api-key/api-key.controller.js +63 -0
- package/server/dist/dist/modules/api-key/api-key.controller.js.map +1 -0
- package/server/dist/dist/modules/api-key/api-key.entity.d.ts +11 -0
- package/server/dist/dist/modules/api-key/api-key.entity.js +63 -0
- package/server/dist/dist/modules/api-key/api-key.entity.js.map +1 -0
- package/server/dist/dist/modules/api-key/api-key.guard.d.ts +7 -0
- package/server/dist/dist/modules/api-key/api-key.guard.js +40 -0
- package/server/dist/dist/modules/api-key/api-key.guard.js.map +1 -0
- package/server/dist/dist/modules/api-key/api-key.module.d.ts +2 -0
- package/server/dist/dist/modules/api-key/api-key.module.js +28 -0
- package/server/dist/dist/modules/api-key/api-key.module.js.map +1 -0
- package/server/dist/dist/modules/api-key/api-key.service.d.ts +15 -0
- package/server/dist/dist/modules/api-key/api-key.service.js +81 -0
- package/server/dist/dist/modules/api-key/api-key.service.js.map +1 -0
- package/server/dist/dist/modules/article/article-revision.entity.d.ts +11 -0
- package/server/dist/dist/modules/article/article-revision.entity.js +53 -0
- package/server/dist/dist/modules/article/article-revision.entity.js.map +1 -0
- package/server/dist/dist/modules/article/article.controller.d.ts +32 -0
- package/server/dist/dist/modules/article/article.controller.js +242 -0
- package/server/dist/dist/modules/article/article.controller.js.map +1 -0
- package/server/dist/dist/modules/article/article.entity.d.ts +24 -0
- package/server/dist/dist/modules/article/article.entity.js +133 -0
- package/server/dist/dist/modules/article/article.entity.js.map +1 -0
- package/server/dist/dist/modules/article/article.module.d.ts +2 -0
- package/server/dist/dist/modules/article/article.module.js +42 -0
- package/server/dist/dist/modules/article/article.module.js.map +1 -0
- package/server/dist/dist/modules/article/article.service.d.ts +38 -0
- package/server/dist/dist/modules/article/article.service.js +357 -0
- package/server/dist/dist/modules/article/article.service.js.map +1 -0
- package/server/dist/dist/modules/article/article.util.d.ts +1 -0
- package/server/dist/dist/modules/article/article.util.js +9 -0
- package/server/dist/dist/modules/article/article.util.js.map +1 -0
- package/server/dist/dist/modules/article/scheduled-publish.service.d.ts +13 -0
- package/server/dist/dist/modules/article/scheduled-publish.service.js +65 -0
- package/server/dist/dist/modules/article/scheduled-publish.service.js.map +1 -0
- package/server/dist/dist/modules/auth/auth.controller.d.ts +12 -0
- package/server/dist/dist/modules/auth/auth.controller.js +66 -0
- package/server/dist/dist/modules/auth/auth.controller.js.map +1 -0
- package/server/dist/dist/modules/auth/auth.module.d.ts +2 -0
- package/server/dist/dist/modules/auth/auth.module.js +41 -0
- package/server/dist/dist/modules/auth/auth.module.js.map +1 -0
- package/server/dist/dist/modules/auth/auth.service.d.ts +26 -0
- package/server/dist/dist/modules/auth/auth.service.js +128 -0
- package/server/dist/dist/modules/auth/auth.service.js.map +1 -0
- package/server/dist/dist/modules/auth/jwt-auth.guard.d.ts +7 -0
- package/server/dist/dist/modules/auth/jwt-auth.guard.js +30 -0
- package/server/dist/dist/modules/auth/jwt-auth.guard.js.map +1 -0
- package/server/dist/dist/modules/auth/jwt.strategy.d.ts +9 -0
- package/server/dist/dist/modules/auth/jwt.strategy.js +39 -0
- package/server/dist/dist/modules/auth/jwt.strategy.js.map +1 -0
- package/server/dist/dist/modules/auth/roles.guard.d.ts +10 -0
- package/server/dist/dist/modules/auth/roles.guard.js +46 -0
- package/server/dist/dist/modules/auth/roles.guard.js.map +1 -0
- package/server/dist/dist/modules/category/category.controller.d.ts +11 -0
- package/server/dist/dist/modules/category/category.controller.js +91 -0
- package/server/dist/dist/modules/category/category.controller.js.map +1 -0
- package/server/dist/dist/modules/category/category.entity.d.ts +9 -0
- package/server/dist/dist/modules/category/category.entity.js +60 -0
- package/server/dist/dist/modules/category/category.entity.js.map +1 -0
- package/server/dist/dist/modules/category/category.module.d.ts +2 -0
- package/server/dist/dist/modules/category/category.module.js +27 -0
- package/server/dist/dist/modules/category/category.module.js.map +1 -0
- package/server/dist/dist/modules/category/category.service.d.ts +12 -0
- package/server/dist/dist/modules/category/category.service.js +90 -0
- package/server/dist/dist/modules/category/category.service.js.map +1 -0
- package/server/dist/dist/modules/comment/comment.controller.d.ts +12 -0
- package/server/dist/dist/modules/comment/comment.controller.js +100 -0
- package/server/dist/dist/modules/comment/comment.controller.js.map +1 -0
- package/server/dist/dist/modules/comment/comment.entity.d.ts +17 -0
- package/server/dist/dist/modules/comment/comment.entity.js +104 -0
- package/server/dist/dist/modules/comment/comment.entity.js.map +1 -0
- package/server/dist/dist/modules/comment/comment.module.d.ts +2 -0
- package/server/dist/dist/modules/comment/comment.module.js +39 -0
- package/server/dist/dist/modules/comment/comment.module.js.map +1 -0
- package/server/dist/dist/modules/comment/comment.service.d.ts +26 -0
- package/server/dist/dist/modules/comment/comment.service.js +182 -0
- package/server/dist/dist/modules/comment/comment.service.js.map +1 -0
- package/server/dist/dist/modules/comment/html.d.ts +15 -0
- package/server/dist/dist/modules/comment/html.js +632 -0
- package/server/dist/dist/modules/comment/html.js.map +1 -0
- package/server/dist/dist/modules/file/file.controller.d.ts +10 -0
- package/server/dist/dist/modules/file/file.controller.js +84 -0
- package/server/dist/dist/modules/file/file.controller.js.map +1 -0
- package/server/dist/dist/modules/file/file.entity.d.ts +9 -0
- package/server/dist/dist/modules/file/file.entity.js +60 -0
- package/server/dist/dist/modules/file/file.entity.js.map +1 -0
- package/server/dist/dist/modules/file/file.module.d.ts +2 -0
- package/server/dist/dist/modules/file/file.module.js +27 -0
- package/server/dist/dist/modules/file/file.module.js.map +1 -0
- package/server/dist/dist/modules/file/file.service.d.ts +17 -0
- package/server/dist/dist/modules/file/file.service.js +111 -0
- package/server/dist/dist/modules/file/file.service.js.map +1 -0
- package/server/dist/dist/modules/health/health.controller.d.ts +11 -0
- package/server/dist/dist/modules/health/health.controller.js +57 -0
- package/server/dist/dist/modules/health/health.controller.js.map +1 -0
- package/server/dist/dist/modules/health/health.module.d.ts +2 -0
- package/server/dist/dist/modules/health/health.module.js +20 -0
- package/server/dist/dist/modules/health/health.module.js.map +1 -0
- package/server/dist/dist/modules/install/install.controller.d.ts +11 -0
- package/server/dist/dist/modules/install/install.controller.js +49 -0
- package/server/dist/dist/modules/install/install.controller.js.map +1 -0
- package/server/dist/dist/modules/install/install.module.d.ts +2 -0
- package/server/dist/dist/modules/install/install.module.js +26 -0
- package/server/dist/dist/modules/install/install.module.js.map +1 -0
- package/server/dist/dist/modules/install/install.service.d.ts +12 -0
- package/server/dist/dist/modules/install/install.service.js +63 -0
- package/server/dist/dist/modules/install/install.service.js.map +1 -0
- package/server/dist/dist/modules/knowledge/knowledge.controller.d.ts +14 -0
- package/server/dist/dist/modules/knowledge/knowledge.controller.js +128 -0
- package/server/dist/dist/modules/knowledge/knowledge.controller.js.map +1 -0
- package/server/dist/dist/modules/knowledge/knowledge.entity.d.ts +18 -0
- package/server/dist/dist/modules/knowledge/knowledge.entity.js +109 -0
- package/server/dist/dist/modules/knowledge/knowledge.entity.js.map +1 -0
- package/server/dist/dist/modules/knowledge/knowledge.module.d.ts +2 -0
- package/server/dist/dist/modules/knowledge/knowledge.module.js +27 -0
- package/server/dist/dist/modules/knowledge/knowledge.module.js.map +1 -0
- package/server/dist/dist/modules/knowledge/knowledge.service.d.ts +14 -0
- package/server/dist/dist/modules/knowledge/knowledge.service.js +144 -0
- package/server/dist/dist/modules/knowledge/knowledge.service.js.map +1 -0
- package/server/dist/dist/modules/page/page.controller.d.ts +12 -0
- package/server/dist/dist/modules/page/page.controller.js +102 -0
- package/server/dist/dist/modules/page/page.controller.js.map +1 -0
- package/server/dist/dist/modules/page/page.entity.d.ts +15 -0
- package/server/dist/dist/modules/page/page.entity.js +94 -0
- package/server/dist/dist/modules/page/page.entity.js.map +1 -0
- package/server/dist/dist/modules/page/page.module.d.ts +2 -0
- package/server/dist/dist/modules/page/page.module.js +27 -0
- package/server/dist/dist/modules/page/page.module.js.map +1 -0
- package/server/dist/dist/modules/page/page.service.d.ts +12 -0
- package/server/dist/dist/modules/page/page.service.js +98 -0
- package/server/dist/dist/modules/page/page.service.js.map +1 -0
- package/server/dist/dist/modules/search/search.controller.d.ts +8 -0
- package/server/dist/dist/modules/search/search.controller.js +67 -0
- package/server/dist/dist/modules/search/search.controller.js.map +1 -0
- package/server/dist/dist/modules/search/search.entity.d.ts +8 -0
- package/server/dist/dist/modules/search/search.entity.js +59 -0
- package/server/dist/dist/modules/search/search.entity.js.map +1 -0
- package/server/dist/dist/modules/search/search.module.d.ts +2 -0
- package/server/dist/dist/modules/search/search.module.js +27 -0
- package/server/dist/dist/modules/search/search.module.js.map +1 -0
- package/server/dist/dist/modules/search/search.service.d.ts +12 -0
- package/server/dist/dist/modules/search/search.service.js +84 -0
- package/server/dist/dist/modules/search/search.service.js.map +1 -0
- package/server/dist/dist/modules/setting/setting.constant.d.ts +3 -0
- package/server/dist/dist/modules/setting/setting.constant.js +25 -0
- package/server/dist/dist/modules/setting/setting.constant.js.map +1 -0
- package/server/dist/dist/modules/setting/setting.controller.d.ts +12 -0
- package/server/dist/dist/modules/setting/setting.controller.js +77 -0
- package/server/dist/dist/modules/setting/setting.controller.js.map +1 -0
- package/server/dist/dist/modules/setting/setting.entity.d.ts +26 -0
- package/server/dist/dist/modules/setting/setting.entity.js +149 -0
- package/server/dist/dist/modules/setting/setting.entity.js.map +1 -0
- package/server/dist/dist/modules/setting/setting.module.d.ts +2 -0
- package/server/dist/dist/modules/setting/setting.module.js +28 -0
- package/server/dist/dist/modules/setting/setting.module.js.map +1 -0
- package/server/dist/dist/modules/setting/setting.service.d.ts +10 -0
- package/server/dist/dist/modules/setting/setting.service.js +106 -0
- package/server/dist/dist/modules/setting/setting.service.js.map +1 -0
- package/server/dist/dist/modules/smtp/mail.util.d.ts +6 -0
- package/server/dist/dist/modules/smtp/mail.util.js +33 -0
- package/server/dist/dist/modules/smtp/mail.util.js.map +1 -0
- package/server/dist/dist/modules/smtp/smtp.controller.d.ts +9 -0
- package/server/dist/dist/modules/smtp/smtp.controller.js +69 -0
- package/server/dist/dist/modules/smtp/smtp.controller.js.map +1 -0
- package/server/dist/dist/modules/smtp/smtp.entity.d.ts +9 -0
- package/server/dist/dist/modules/smtp/smtp.entity.js +60 -0
- package/server/dist/dist/modules/smtp/smtp.entity.js.map +1 -0
- package/server/dist/dist/modules/smtp/smtp.module.d.ts +2 -0
- package/server/dist/dist/modules/smtp/smtp.module.js +28 -0
- package/server/dist/dist/modules/smtp/smtp.module.js.map +1 -0
- package/server/dist/dist/modules/smtp/smtp.service.d.ts +11 -0
- package/server/dist/dist/modules/smtp/smtp.service.js +83 -0
- package/server/dist/dist/modules/smtp/smtp.service.js.map +1 -0
- package/server/dist/dist/modules/tag/tag.controller.d.ts +12 -0
- package/server/dist/dist/modules/tag/tag.controller.js +101 -0
- package/server/dist/dist/modules/tag/tag.controller.js.map +1 -0
- package/server/dist/dist/modules/tag/tag.entity.d.ts +9 -0
- package/server/dist/dist/modules/tag/tag.entity.js +59 -0
- package/server/dist/dist/modules/tag/tag.entity.js.map +1 -0
- package/server/dist/dist/modules/tag/tag.module.d.ts +2 -0
- package/server/dist/dist/modules/tag/tag.module.js +27 -0
- package/server/dist/dist/modules/tag/tag.module.js.map +1 -0
- package/server/dist/dist/modules/tag/tag.service.d.ts +13 -0
- package/server/dist/dist/modules/tag/tag.service.js +104 -0
- package/server/dist/dist/modules/tag/tag.service.js.map +1 -0
- package/server/dist/dist/modules/user/user.controller.d.ts +13 -0
- package/server/dist/dist/modules/user/user.controller.js +115 -0
- package/server/dist/dist/modules/user/user.controller.js.map +1 -0
- package/server/dist/dist/modules/user/user.entity.d.ts +15 -0
- package/server/dist/dist/modules/user/user.entity.js +96 -0
- package/server/dist/dist/modules/user/user.entity.js.map +1 -0
- package/server/dist/dist/modules/user/user.module.d.ts +2 -0
- package/server/dist/dist/modules/user/user.module.js +28 -0
- package/server/dist/dist/modules/user/user.module.js.map +1 -0
- package/server/dist/dist/modules/user/user.service.d.ts +16 -0
- package/server/dist/dist/modules/user/user.service.js +152 -0
- package/server/dist/dist/modules/user/user.service.js.map +1 -0
- package/server/dist/dist/modules/view/view.controller.d.ts +11 -0
- package/server/dist/dist/modules/view/view.controller.js +92 -0
- package/server/dist/dist/modules/view/view.controller.js.map +1 -0
- package/server/dist/dist/modules/view/view.entity.d.ts +14 -0
- package/server/dist/dist/modules/view/view.entity.js +88 -0
- package/server/dist/dist/modules/view/view.entity.js.map +1 -0
- package/server/dist/dist/modules/view/view.module.d.ts +2 -0
- package/server/dist/dist/modules/view/view.module.js +27 -0
- package/server/dist/dist/modules/view/view.module.js.map +1 -0
- package/server/dist/dist/modules/view/view.service.d.ts +11 -0
- package/server/dist/dist/modules/view/view.service.js +89 -0
- package/server/dist/dist/modules/view/view.service.js.map +1 -0
- package/server/dist/dist/modules/webhook/webhook.controller.d.ts +12 -0
- package/server/dist/dist/modules/webhook/webhook.controller.js +63 -0
- package/server/dist/dist/modules/webhook/webhook.controller.js.map +1 -0
- package/server/dist/dist/modules/webhook/webhook.entity.d.ts +9 -0
- package/server/dist/dist/modules/webhook/webhook.entity.js +54 -0
- package/server/dist/dist/modules/webhook/webhook.entity.js.map +1 -0
- package/server/dist/dist/modules/webhook/webhook.module.d.ts +2 -0
- package/server/dist/dist/modules/webhook/webhook.module.js +27 -0
- package/server/dist/dist/modules/webhook/webhook.module.js.map +1 -0
- package/server/dist/dist/modules/webhook/webhook.service.d.ts +16 -0
- package/server/dist/dist/modules/webhook/webhook.service.js +97 -0
- package/server/dist/dist/modules/webhook/webhook.service.js.map +1 -0
- package/server/dist/dist/public/favicon.png +0 -0
- package/server/dist/dist/public/index.html +439 -0
- package/server/dist/dist/public/swagger/custom.css +11 -0
- package/server/dist/dist/starter.d.ts +1 -0
- package/server/dist/dist/starter.js +84 -0
- package/server/dist/dist/starter.js.map +1 -0
- package/server/dist/dist/tsconfig.build.tsbuildinfo +16966 -0
- package/server/dist/dist/utils/date.util.d.ts +1 -0
- package/server/dist/dist/utils/date.util.js +13 -0
- package/server/dist/dist/utils/date.util.js.map +1 -0
- package/server/dist/dist/utils/ip.util.d.ts +2 -0
- package/server/dist/dist/utils/ip.util.js +27 -0
- package/server/dist/dist/utils/ip.util.js.map +1 -0
- package/server/dist/dist/utils/markdown.util.d.ts +4 -0
- package/server/dist/dist/utils/markdown.util.js +42 -0
- package/server/dist/dist/utils/markdown.util.js.map +1 -0
- package/server/dist/dist/utils/oss/aliyun-oss-client.d.ts +6 -0
- package/server/dist/dist/utils/oss/aliyun-oss-client.js +28 -0
- package/server/dist/dist/utils/oss/aliyun-oss-client.js.map +1 -0
- package/server/dist/dist/utils/oss/oss-client.d.ts +6 -0
- package/server/dist/dist/utils/oss/oss-client.js +10 -0
- package/server/dist/dist/utils/oss/oss-client.js.map +1 -0
- package/server/dist/dist/utils/oss.util.d.ts +13 -0
- package/server/dist/dist/utils/oss.util.js +49 -0
- package/server/dist/dist/utils/oss.util.js.map +1 -0
- package/server/dist/dist/utils/ua.util.d.ts +9 -0
- package/server/dist/dist/utils/ua.util.js +36 -0
- package/server/dist/dist/utils/ua.util.js.map +1 -0
- package/server/dist/dist/utils/uniqueid.util.d.ts +1 -0
- package/server/dist/dist/utils/uniqueid.util.js +9 -0
- package/server/dist/dist/utils/uniqueid.util.js.map +1 -0
- package/server/dist/dist/utils/upload.util.d.ts +5 -0
- package/server/dist/dist/utils/upload.util.js +34 -0
- package/server/dist/dist/utils/upload.util.js.map +1 -0
- package/server/dist/dist/utils/user.util.d.ts +1 -0
- package/server/dist/dist/utils/user.util.js +18 -0
- package/server/dist/dist/utils/user.util.js.map +1 -0
- package/server/logs/error/error.log.-2026-05-19.log +123 -0
- package/server/node_modules/@nestjs/cli/node_modules/rimraf/bin.js +0 -0
- package/server/node_modules/@nestjs/cli/node_modules/typescript/bin/tsc +0 -0
- package/server/node_modules/@nestjs/cli/node_modules/typescript/bin/tsserver +0 -0
- package/server/node_modules/@nestjs/common/node_modules/axios/README.md +0 -0
- package/server/node_modules/@nestjs/common/node_modules/axios/lib/adapters/http.js +0 -0
- package/server/node_modules/@nestjs/config/node_modules/uuid/dist/bin/uuid +0 -0
- package/server/node_modules/@nestjs/platform-express/node_modules/mime/cli.js +0 -0
- package/server/node_modules/@nestjs/platform-express/node_modules/mime/src/build.js +0 -0
- package/server/node_modules/@nestjs/typeorm/node_modules/uuid/dist/bin/uuid +0 -0
- package/server/node_modules/@nuxtjs/opencollective/bin/opencollective.js +0 -0
- package/server/node_modules/@pm2/agent/node_modules/dayjs/plugin/objectSupport.d.ts +0 -0
- package/server/node_modules/@pm2/agent/node_modules/semver/bin/semver.js +0 -0
- package/server/node_modules/@pm2/io/node_modules/semver/bin/semver.js +0 -0
- package/server/node_modules/@types/node/LICENSE +0 -0
- package/server/node_modules/@types/node/README.md +0 -0
- package/server/node_modules/@types/node/assert.d.ts +0 -0
- package/server/node_modules/@types/node/async_hooks.d.ts +0 -0
- package/server/node_modules/@types/node/buffer.d.ts +0 -0
- package/server/node_modules/@types/node/child_process.d.ts +0 -0
- package/server/node_modules/@types/node/cluster.d.ts +0 -0
- package/server/node_modules/@types/node/console.d.ts +0 -0
- package/server/node_modules/@types/node/constants.d.ts +0 -0
- package/server/node_modules/@types/node/crypto.d.ts +0 -0
- package/server/node_modules/@types/node/dgram.d.ts +0 -0
- package/server/node_modules/@types/node/dns.d.ts +0 -0
- package/server/node_modules/@types/node/domain.d.ts +0 -0
- package/server/node_modules/@types/node/events.d.ts +0 -0
- package/server/node_modules/@types/node/fs.d.ts +0 -0
- package/server/node_modules/@types/node/globals.d.ts +0 -0
- package/server/node_modules/@types/node/globals.global.d.ts +0 -0
- package/server/node_modules/@types/node/http.d.ts +0 -0
- package/server/node_modules/@types/node/http2.d.ts +0 -0
- package/server/node_modules/@types/node/https.d.ts +0 -0
- package/server/node_modules/@types/node/index.d.ts +0 -0
- package/server/node_modules/@types/node/inspector.d.ts +0 -0
- package/server/node_modules/@types/node/module.d.ts +0 -0
- package/server/node_modules/@types/node/net.d.ts +0 -0
- package/server/node_modules/@types/node/os.d.ts +0 -0
- package/server/node_modules/@types/node/package.json +0 -0
- package/server/node_modules/@types/node/path.d.ts +0 -0
- package/server/node_modules/@types/node/perf_hooks.d.ts +0 -0
- package/server/node_modules/@types/node/process.d.ts +0 -0
- package/server/node_modules/@types/node/punycode.d.ts +0 -0
- package/server/node_modules/@types/node/querystring.d.ts +0 -0
- package/server/node_modules/@types/node/readline.d.ts +0 -0
- package/server/node_modules/@types/node/repl.d.ts +0 -0
- package/server/node_modules/@types/node/stream.d.ts +0 -0
- package/server/node_modules/@types/node/string_decoder.d.ts +0 -0
- package/server/node_modules/@types/node/timers.d.ts +0 -0
- package/server/node_modules/@types/node/tls.d.ts +0 -0
- package/server/node_modules/@types/node/trace_events.d.ts +0 -0
- package/server/node_modules/@types/node/tty.d.ts +0 -0
- package/server/node_modules/@types/node/url.d.ts +0 -0
- package/server/node_modules/@types/node/util.d.ts +0 -0
- package/server/node_modules/@types/node/v8.d.ts +0 -0
- package/server/node_modules/@types/node/vm.d.ts +0 -0
- package/server/node_modules/@types/node/wasi.d.ts +0 -0
- package/server/node_modules/@types/node/worker_threads.d.ts +0 -0
- package/server/node_modules/@types/node/zlib.d.ts +0 -0
- package/server/node_modules/@types/zen-observable/LICENSE +0 -0
- package/server/node_modules/@types/zen-observable/README.md +0 -0
- package/server/node_modules/@types/zen-observable/esm.d.ts +0 -0
- package/server/node_modules/@types/zen-observable/extras.d.ts +0 -0
- package/server/node_modules/@types/zen-observable/index.d.ts +0 -0
- package/server/node_modules/@types/zen-observable/package.json +0 -0
- package/server/node_modules/ajv/scripts/info +0 -0
- package/server/node_modules/ajv/scripts/prepare-tests +0 -0
- package/server/node_modules/ajv/scripts/publish-built-version +0 -0
- package/server/node_modules/ajv/scripts/travis-gh-pages +0 -0
- package/server/node_modules/arr-diff/LICENSE +0 -0
- package/server/node_modules/arr-flatten/LICENSE +0 -0
- package/server/node_modules/arr-flatten/README.md +0 -0
- package/server/node_modules/array-unique/LICENSE +0 -0
- package/server/node_modules/array-unique/README.md +0 -0
- package/server/node_modules/aws-ssl-profiles/package.json +0 -0
- package/server/node_modules/axios/README.md +0 -0
- package/server/node_modules/axios/lib/adapters/http.js +0 -0
- package/server/node_modules/blessed/bin/tput.js +0 -0
- package/server/node_modules/blessed/example/blessed-telnet.js +0 -0
- package/server/node_modules/blessed/example/multiplex.js +0 -0
- package/server/node_modules/blessed/example/ping +0 -0
- package/server/node_modules/blessed/example/time.js +0 -0
- package/server/node_modules/cacache/node_modules/rimraf/bin.js +0 -0
- package/server/node_modules/cli-color/bin/generate-color-images +0 -0
- package/server/node_modules/cli-color/test/__playground/throbber.formatted.js +0 -0
- package/server/node_modules/cli-color/test/__playground/throbber.js +0 -0
- package/server/node_modules/cli-highlight/node_modules/wrap-ansi/index.js +0 -0
- package/server/node_modules/cliui/node_modules/wrap-ansi/index.js +0 -0
- package/server/node_modules/constants-browserify/build.sh +0 -0
- package/server/node_modules/copy-concurrently/node_modules/rimraf/bin.js +0 -0
- package/server/node_modules/copyfiles/copyfiles +0 -0
- package/server/node_modules/copyfiles/index.js +0 -0
- package/server/node_modules/cross-env/README.md +0 -0
- package/server/node_modules/date-fns/esm/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousDay/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousFriday/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousMonday/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousSaturday/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousSunday/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousThursday/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousTuesday/index.js +0 -0
- package/server/node_modules/date-fns/esm/previousWednesday/index.js +0 -0
- package/server/node_modules/date-fns/index.js +0 -0
- package/server/node_modules/date-fns/previousDay/index.js +0 -0
- package/server/node_modules/date-fns/previousFriday/index.js +0 -0
- package/server/node_modules/date-fns/previousMonday/index.js +0 -0
- package/server/node_modules/date-fns/previousSaturday/index.js +0 -0
- package/server/node_modules/date-fns/previousSunday/index.js +0 -0
- package/server/node_modules/date-fns/previousThursday/index.js +0 -0
- package/server/node_modules/date-fns/previousTuesday/index.js +0 -0
- package/server/node_modules/date-fns/previousWednesday/index.js +0 -0
- package/server/node_modules/dayjs/plugin/arraySupport.d.ts +0 -0
- package/server/node_modules/dayjs/plugin/objectSupport.d.ts +0 -0
- package/server/node_modules/default-user-agent/node_modules/os-name/cli.js +0 -0
- package/server/node_modules/degenerator/node_modules/escodegen/bin/escodegen.js +0 -0
- package/server/node_modules/degenerator/node_modules/escodegen/bin/esgenerate.js +0 -0
- package/server/node_modules/emojis-list/LICENSE.md +0 -0
- package/server/node_modules/emojis-list/README.md +0 -0
- package/server/node_modules/errno/build.js +0 -0
- package/server/node_modules/errno/cli.js +0 -0
- package/server/node_modules/es5-ext/_postinstall.js +0 -0
- package/server/node_modules/esprima/bin/esparse.js +0 -0
- package/server/node_modules/esprima/bin/esvalidate.js +0 -0
- package/server/node_modules/esrecurse/package.json +0 -0
- package/server/node_modules/execa/node_modules/semver/bin/semver +0 -0
- package/server/node_modules/execa/node_modules/which/bin/which +0 -0
- package/server/node_modules/extrareqp2/README.md +0 -0
- package/server/node_modules/extrareqp2/lib/adapters/http.js +0 -0
- package/server/node_modules/fork-ts-checker-webpack-plugin/node_modules/semver/bin/semver +0 -0
- package/server/node_modules/is-class-hotfix/.editorconfig +0 -0
- package/server/node_modules/is-class-hotfix/.gitattributes +0 -0
- package/server/node_modules/is-class-hotfix/CHANGELOG.md +0 -0
- package/server/node_modules/is-class-hotfix/LICENSE.md +0 -0
- package/server/node_modules/is-class-hotfix/README.md +0 -0
- package/server/node_modules/is-class-hotfix/bower.json +0 -0
- package/server/node_modules/is-class-hotfix/is-class.js +0 -0
- package/server/node_modules/is-class-hotfix/package.json +0 -0
- package/server/node_modules/is-class-hotfix/test/is-class.js +0 -0
- package/server/node_modules/is-docker/cli.js +0 -0
- package/server/node_modules/js-yaml/bin/js-yaml.js +0 -0
- package/server/node_modules/jsonwebtoken/node_modules/semver/bin/semver +0 -0
- package/server/node_modules/jstoxml/dist.sh +0 -0
- package/server/node_modules/log4js/lib/appenders/fileSync.js +0 -0
- package/server/node_modules/log4js/lib/connect-logger.js +0 -0
- package/server/node_modules/make-dir/node_modules/semver/bin/semver +0 -0
- package/server/node_modules/micromatch/LICENSE +0 -0
- package/server/node_modules/miller-rabin/bin/miller-rabin +0 -0
- package/server/node_modules/mime/cli.js +0 -0
- package/server/node_modules/mkdirp/bin/cmd.js +0 -0
- package/server/node_modules/move-concurrently/node_modules/rimraf/bin.js +0 -0
- package/server/node_modules/nan/tools/1to2.js +0 -0
- package/server/node_modules/needle/bin/needle +0 -0
- package/server/node_modules/node-libs-browser/node_modules/buffer/bin/download-node-tests.js +0 -0
- package/server/node_modules/node-libs-browser/node_modules/buffer/bin/update-authors.sh +0 -0
- package/server/node_modules/open/xdg-open +0 -0
- package/server/node_modules/osx-release/cli.js +0 -0
- package/server/node_modules/pm2/bin/pm2 +0 -0
- package/server/node_modules/pm2/bin/pm2-dev +0 -0
- package/server/node_modules/pm2/bin/pm2-docker +0 -0
- package/server/node_modules/pm2/bin/pm2-runtime +0 -0
- package/server/node_modules/pm2/lib/templates/init-scripts/openrc.tpl +0 -0
- package/server/node_modules/pm2/lib/tools/xdg-open +0 -0
- package/server/node_modules/pm2/node_modules/mkdirp/bin/cmd.js +0 -0
- package/server/node_modules/pm2/pm2 +0 -0
- package/server/node_modules/pm2-deploy/deploy +0 -0
- package/server/node_modules/require-in-the-middle/node_modules/resolve/bin/resolve +0 -0
- package/server/node_modules/rimraf/bin.js +0 -0
- package/server/node_modules/segment/repl +0 -0
- package/server/node_modules/semver/bin/semver.js +0 -0
- package/server/node_modules/send/node_modules/mime/cli.js +0 -0
- package/server/node_modules/send/node_modules/mime/src/build.js +0 -0
- package/server/node_modules/sha.js/bin.js +0 -0
- package/server/node_modules/systeminformation/lib/cli.js +0 -0
- package/server/node_modules/terser/bin/terser +0 -0
- package/server/node_modules/terser/bin/uglifyjs +0 -0
- package/server/node_modules/tree-kill/cli.js +0 -0
- package/server/node_modules/tree-kill/index.js +0 -0
- package/server/node_modules/typeorm/cli.js +0 -0
- package/server/node_modules/typeorm/node_modules/mkdirp/bin/cmd.js +0 -0
- package/server/node_modules/typeorm/node_modules/uuid/dist/bin/uuid +0 -0
- package/server/node_modules/typeorm/node_modules/wrap-ansi/index.js +0 -0
- package/server/node_modules/ua-parser-js/script/cli.js +0 -0
- package/server/node_modules/ua-parser-js/src/ua-parser.js +0 -0
- package/server/node_modules/upath/LICENSE +0 -0
- package/server/node_modules/uri-js/LICENSE +0 -0
- package/server/node_modules/uri-js/README.md +0 -0
- package/server/node_modules/uri-js/dist/es5/uri.all.d.ts +0 -0
- package/server/node_modules/uri-js/dist/es5/uri.all.js +0 -0
- package/server/node_modules/uri-js/dist/es5/uri.all.js.map +0 -0
- package/server/node_modules/uri-js/dist/es5/uri.all.min.d.ts +0 -0
- package/server/node_modules/uri-js/dist/es5/uri.all.min.js +0 -0
- package/server/node_modules/uri-js/dist/es5/uri.all.min.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/index.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/index.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/index.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/regexps-iri.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/regexps-iri.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/regexps-iri.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/regexps-uri.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/regexps-uri.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/regexps-uri.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/http.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/http.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/http.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/https.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/https.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/https.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/mailto.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/mailto.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/urn.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/urn.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/urn.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/ws.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/ws.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/ws.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/wss.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/wss.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/schemes/wss.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/uri.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/uri.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/uri.js.map +0 -0
- package/server/node_modules/uri-js/dist/esnext/util.d.ts +0 -0
- package/server/node_modules/uri-js/dist/esnext/util.js +0 -0
- package/server/node_modules/uri-js/dist/esnext/util.js.map +0 -0
- package/server/node_modules/uri-js/package.json +0 -0
- package/server/node_modules/uri-js/yarn.lock +0 -0
- package/server/node_modules/uuid/dist/bin/uuid +0 -0
- package/server/node_modules/webpack/node_modules/acorn/bin/acorn +0 -0
- package/server/node_modules/webpack/node_modules/ajv/scripts/info +0 -0
- package/server/node_modules/webpack/node_modules/ajv/scripts/prepare-tests +0 -0
- package/server/node_modules/webpack/node_modules/ajv/scripts/publish-built-version +0 -0
- package/server/node_modules/webpack/node_modules/ajv/scripts/travis-gh-pages +0 -0
- package/server/node_modules/which/bin/node-which +0 -0
- package/server/node_modules/win-release/node_modules/semver/bin/semver +0 -0
- package/server/node_modules/wrap-ansi/index.js +0 -0
- package/templates/nginx.dev.conf +57 -0
- package/templates/nginx.prod.conf +75 -0
- package/ui/banner.js +432 -13
- package/ui/interactive.js +248 -52
- package/ui/theme.js +250 -10
package/ui/interactive.js
CHANGED
|
@@ -1,55 +1,231 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
1
3
|
const inquirer = require('inquirer');
|
|
4
|
+
const ora = require('ora');
|
|
2
5
|
const open = require('open');
|
|
3
6
|
const { printBanner } = require('./banner');
|
|
4
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
brand,
|
|
9
|
+
icon,
|
|
10
|
+
label,
|
|
11
|
+
ok,
|
|
12
|
+
fail,
|
|
13
|
+
sectionHeader,
|
|
14
|
+
statusPill,
|
|
15
|
+
padRight,
|
|
16
|
+
} = require('./theme');
|
|
5
17
|
const { ensureOriginalCwd } = require('../lib/root');
|
|
18
|
+
const { describeProject, hasClient } = require('../lib/project-type');
|
|
6
19
|
const { ensureProjectEnvironment } = require('../lib/bootstrap');
|
|
7
20
|
const { runDev } = require('../lib/dev');
|
|
8
21
|
const { runApiDev } = require('../lib/api-dev');
|
|
9
22
|
const { runLifecycleCommand } = require('../lib/lifecycle');
|
|
10
23
|
const { runDockerCommand } = require('../lib/docker');
|
|
24
|
+
const { runNginxCommand } = require('../lib/nginx');
|
|
11
25
|
const { printUnifiedStatus } = require('../lib/status');
|
|
12
26
|
const { runDoctor } = require('../lib/doctor');
|
|
13
27
|
const { runBuild, TARGETS } = require('../lib/build');
|
|
14
28
|
const { runNodeScript } = require('../lib/spawn');
|
|
15
29
|
const { getClientBin } = require('../lib/paths');
|
|
16
|
-
const { loadClientSiteUrl } = require('../lib/http');
|
|
30
|
+
const { loadClientSiteUrl, loadServerSiteUrl, isHttpResponding } = require('../lib/http');
|
|
31
|
+
const { isDockerRunning } = require('../lib/docker');
|
|
17
32
|
const { t } = require('../lib/i18n');
|
|
18
33
|
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
function menuSection(title) {
|
|
35
|
+
return new inquirer.Separator(sectionHeader(title));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function formatChoice(key, text, hint) {
|
|
39
|
+
const keyCol = key ? brand.primary(padRight(key, 2)) : ' ';
|
|
40
|
+
const hintPart = hint ? brand.dim(` ${hint}`) : '';
|
|
41
|
+
return `${keyCol} ${text}${hintPart}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function assignShortcuts(items) {
|
|
45
|
+
let n = 0;
|
|
46
|
+
return items.map((item) => {
|
|
47
|
+
if (item instanceof inquirer.Separator || item.type === 'separator') {
|
|
48
|
+
return item;
|
|
49
|
+
}
|
|
50
|
+
n += 1;
|
|
51
|
+
const key = n <= 9 ? String(n) : '';
|
|
52
|
+
return {
|
|
53
|
+
...item,
|
|
54
|
+
name: formatChoice(key, item._label || item.name, item._hint),
|
|
55
|
+
short: item.value,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function choice(labelKey, value, hintKey) {
|
|
61
|
+
return {
|
|
62
|
+
_label: t(labelKey),
|
|
63
|
+
_hint: hintKey ? t(hintKey) : '',
|
|
64
|
+
value,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getMenuActions(project) {
|
|
69
|
+
const standalone = project.type === 'standalone';
|
|
70
|
+
const monorepo = project.type === 'monorepo';
|
|
71
|
+
const showClient = hasClient(project.root);
|
|
72
|
+
|
|
73
|
+
const items = [
|
|
74
|
+
menuSection(t('menu.section.run')),
|
|
75
|
+
choice('menu.dev', 'dev', 'menu.hint.dev'),
|
|
76
|
+
choice('menu.init', 'init', 'menu.hint.init'),
|
|
77
|
+
choice('menu.status', 'status', 'menu.hint.status'),
|
|
78
|
+
choice('menu.doctor', 'doctor', 'menu.hint.doctor'),
|
|
79
|
+
menuSection(t('menu.section.lifecycle')),
|
|
80
|
+
choice('menu.devApi', 'dev:api', 'menu.hint.devApi'),
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
if (showClient) {
|
|
84
|
+
items.push(choice('menu.devClient', 'dev:client', 'menu.hint.devClient'));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
items.push(
|
|
88
|
+
choice('menu.serverStart', 'server:start', 'menu.hint.serverStart'),
|
|
89
|
+
choice('menu.serverStop', 'server:stop', 'menu.hint.serverStop'),
|
|
90
|
+
choice('menu.serverRestart', 'server:restart', 'menu.hint.serverRestart'),
|
|
91
|
+
menuSection(t('menu.section.build')),
|
|
92
|
+
choice('menu.build', 'build', 'menu.hint.build')
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
if (monorepo) {
|
|
96
|
+
items.push(
|
|
97
|
+
choice('menu.dockerStart', 'docker:start', 'menu.hint.dockerStart'),
|
|
98
|
+
choice('menu.dockerUp', 'docker:up', 'menu.hint.dockerUp'),
|
|
99
|
+
choice('menu.dockerStop', 'docker:stop', 'menu.hint.dockerStop')
|
|
100
|
+
);
|
|
101
|
+
} else if (standalone) {
|
|
102
|
+
items.push(
|
|
103
|
+
choice('menu.dockerUp', 'docker:up', 'menu.hint.dockerUp'),
|
|
104
|
+
choice('menu.dockerStop', 'docker:stop', 'menu.hint.dockerStop')
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
items.push(
|
|
109
|
+
menuSection(t('menu.section.tools')),
|
|
110
|
+
choice('menu.nginxUp', 'nginx:up', 'menu.hint.nginxUp'),
|
|
111
|
+
choice('menu.nginxOpen', 'nginx:open', 'menu.hint.nginxOpen'),
|
|
112
|
+
choice('menu.nginxReload', 'nginx:reload', 'menu.hint.nginxReload'),
|
|
113
|
+
choice('menu.openAdmin', 'open:admin', 'menu.hint.openAdmin')
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
if (monorepo) {
|
|
117
|
+
items.push(choice('menu.publish', 'publish', 'menu.hint.publish'));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
items.push(
|
|
36
121
|
new inquirer.Separator(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
122
|
+
choice('menu.exit', 'exit', 'menu.hint.exit')
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
return assignShortcuts(items);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function parseEnvFile(projectRoot) {
|
|
129
|
+
const envPath = path.join(projectRoot, '.env');
|
|
130
|
+
const env = {};
|
|
131
|
+
try {
|
|
132
|
+
if (!fs.existsSync(envPath)) return env;
|
|
133
|
+
for (const line of fs.readFileSync(envPath, 'utf8').split('\n')) {
|
|
134
|
+
const m = line.match(/^([A-Z_]+)=(.*)$/);
|
|
135
|
+
if (m) env[m[1]] = m[2].trim().replace(/^['"]|['"]$/g, '');
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
// ignore
|
|
139
|
+
}
|
|
140
|
+
return env;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function probeDatabase(projectRoot) {
|
|
144
|
+
try {
|
|
145
|
+
const mysql = require('mysql2/promise');
|
|
146
|
+
const env = parseEnvFile(projectRoot);
|
|
147
|
+
const conn = await mysql.createConnection({
|
|
148
|
+
host: env.DB_HOST || '127.0.0.1',
|
|
149
|
+
port: Number(env.DB_PORT || 3306),
|
|
150
|
+
user: env.DB_USER || 'reactpress',
|
|
151
|
+
password: env.DB_PASSWD || env.DB_PASSWORD || 'reactpress',
|
|
152
|
+
database: env.DB_DATABASE || 'reactpress',
|
|
153
|
+
connectTimeout: 2000,
|
|
154
|
+
});
|
|
155
|
+
await conn.ping();
|
|
156
|
+
await conn.end();
|
|
157
|
+
return true;
|
|
158
|
+
} catch {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
async function fetchContextStatus(projectRoot) {
|
|
164
|
+
const apiUrl = loadServerSiteUrl(projectRoot);
|
|
165
|
+
const [apiOk, dockerOk, dbOk] = await Promise.all([
|
|
166
|
+
isHttpResponding(apiUrl, 1500),
|
|
167
|
+
Promise.resolve(isDockerRunning()),
|
|
168
|
+
probeDatabase(projectRoot),
|
|
169
|
+
]);
|
|
170
|
+
return { apiOk, dbOk, dockerOk };
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function printStatusPanel(status) {
|
|
174
|
+
const on = { on: t('menu.statusOn'), off: t('menu.statusOff') };
|
|
175
|
+
const db = {
|
|
176
|
+
on: t('menu.statusReady'),
|
|
177
|
+
off: t('menu.statusNotReady'),
|
|
178
|
+
pending: t('menu.statusChecking'),
|
|
179
|
+
};
|
|
180
|
+
const docker = { on: t('menu.statusYes'), off: t('menu.statusNo') };
|
|
181
|
+
|
|
182
|
+
console.log(sectionHeader(t('menu.statusHeader')));
|
|
183
|
+
const rows = [
|
|
184
|
+
[t('menu.statusLabelApi'), statusPill(status.apiOk, on)],
|
|
185
|
+
[t('menu.statusLabelDb'), statusPill(status.dbOk, db)],
|
|
186
|
+
[t('menu.statusLabelDocker'), statusPill(status.dockerOk, docker)],
|
|
40
187
|
];
|
|
188
|
+
for (const [name, pill] of rows) {
|
|
189
|
+
console.log(` ${brand.muted(padRight(name, 10))} ${pill}`);
|
|
190
|
+
}
|
|
191
|
+
console.log('');
|
|
41
192
|
}
|
|
42
193
|
|
|
43
|
-
async function
|
|
194
|
+
async function printContextStatus(projectRoot) {
|
|
195
|
+
const spinner = ora({
|
|
196
|
+
text: brand.dim(t('menu.statusChecking')),
|
|
197
|
+
color: 'magenta',
|
|
198
|
+
spinner: 'dots',
|
|
199
|
+
}).start();
|
|
200
|
+
const status = await fetchContextStatus(projectRoot);
|
|
201
|
+
spinner.stop();
|
|
202
|
+
printStatusPanel(status);
|
|
203
|
+
return status;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async function withSpinner(text, fn) {
|
|
207
|
+
const spinner = ora({ text, color: 'magenta', spinner: 'dots' }).start();
|
|
208
|
+
try {
|
|
209
|
+
const result = await fn();
|
|
210
|
+
spinner.succeed();
|
|
211
|
+
return result;
|
|
212
|
+
} catch (err) {
|
|
213
|
+
spinner.fail();
|
|
214
|
+
throw err;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function runMenuAction(action, projectRoot, project) {
|
|
44
219
|
switch (action) {
|
|
45
220
|
case 'dev':
|
|
46
221
|
console.log(label(t('menu.startingDev')));
|
|
47
222
|
await runDev(projectRoot);
|
|
48
223
|
return false;
|
|
49
224
|
case 'init': {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
225
|
+
const result = await withSpinner(t('menu.initProject'), () =>
|
|
226
|
+
ensureProjectEnvironment(projectRoot)
|
|
227
|
+
);
|
|
228
|
+
console.log(ok(result.message || t('menu.done')));
|
|
53
229
|
return true;
|
|
54
230
|
}
|
|
55
231
|
case 'status':
|
|
@@ -67,15 +243,21 @@ async function runMenuAction(action, projectRoot) {
|
|
|
67
243
|
await runNodeScript(getClientBin(), [], { cwd: projectRoot });
|
|
68
244
|
return false;
|
|
69
245
|
case 'server:start': {
|
|
70
|
-
const code = await
|
|
246
|
+
const code = await withSpinner(t('menu.startingApi'), () =>
|
|
247
|
+
runLifecycleCommand('start', projectRoot)
|
|
248
|
+
);
|
|
71
249
|
if (code !== 0) process.exit(code);
|
|
72
250
|
return true;
|
|
73
251
|
}
|
|
74
252
|
case 'server:stop':
|
|
75
|
-
await
|
|
253
|
+
await withSpinner(t('menu.stoppingApi'), async () => {
|
|
254
|
+
await runLifecycleCommand('stop', projectRoot);
|
|
255
|
+
});
|
|
76
256
|
return true;
|
|
77
257
|
case 'server:restart': {
|
|
78
|
-
const code = await
|
|
258
|
+
const code = await withSpinner(t('menu.restartingApi'), () =>
|
|
259
|
+
runLifecycleCommand('restart', projectRoot)
|
|
260
|
+
);
|
|
79
261
|
if (code !== 0) process.exit(code);
|
|
80
262
|
return true;
|
|
81
263
|
}
|
|
@@ -92,6 +274,7 @@ async function runMenuAction(action, projectRoot) {
|
|
|
92
274
|
type: 'list',
|
|
93
275
|
name: 'target',
|
|
94
276
|
message: t('menu.buildTarget'),
|
|
277
|
+
pageSize: 12,
|
|
95
278
|
choices: buildChoices,
|
|
96
279
|
},
|
|
97
280
|
]);
|
|
@@ -102,10 +285,23 @@ async function runMenuAction(action, projectRoot) {
|
|
|
102
285
|
await runDockerCommand('start', projectRoot);
|
|
103
286
|
return false;
|
|
104
287
|
case 'docker:up':
|
|
105
|
-
await runDockerCommand('up', projectRoot);
|
|
288
|
+
await withSpinner(t('docker.starting'), () => runDockerCommand('up', projectRoot));
|
|
106
289
|
return true;
|
|
107
290
|
case 'docker:stop':
|
|
108
|
-
await
|
|
291
|
+
await withSpinner(t('docker.stopping'), async () => {
|
|
292
|
+
await runDockerCommand('down', projectRoot);
|
|
293
|
+
});
|
|
294
|
+
return true;
|
|
295
|
+
case 'nginx:up':
|
|
296
|
+
await withSpinner(t('cli.nginx.up'), async () => {
|
|
297
|
+
await runNginxCommand('up', projectRoot);
|
|
298
|
+
});
|
|
299
|
+
return true;
|
|
300
|
+
case 'nginx:open':
|
|
301
|
+
await runNginxCommand('open', projectRoot);
|
|
302
|
+
return true;
|
|
303
|
+
case 'nginx:reload':
|
|
304
|
+
await runNginxCommand('reload', projectRoot);
|
|
109
305
|
return true;
|
|
110
306
|
case 'open:admin': {
|
|
111
307
|
const url = loadClientSiteUrl(projectRoot);
|
|
@@ -121,7 +317,6 @@ async function runMenuAction(action, projectRoot) {
|
|
|
121
317
|
return true;
|
|
122
318
|
}
|
|
123
319
|
case 'exit':
|
|
124
|
-
console.log(brand.muted(t('menu.goodbye')));
|
|
125
320
|
return false;
|
|
126
321
|
default:
|
|
127
322
|
return true;
|
|
@@ -130,7 +325,12 @@ async function runMenuAction(action, projectRoot) {
|
|
|
130
325
|
|
|
131
326
|
async function runInteractiveLoop() {
|
|
132
327
|
const projectRoot = ensureOriginalCwd();
|
|
133
|
-
|
|
328
|
+
const project = describeProject(projectRoot);
|
|
329
|
+
|
|
330
|
+
printBanner({ projectRoot, project });
|
|
331
|
+
await printContextStatus(projectRoot);
|
|
332
|
+
console.log(` ${brand.dim(t('menu.shortcuts'))}`);
|
|
333
|
+
console.log('');
|
|
134
334
|
|
|
135
335
|
let loop = true;
|
|
136
336
|
while (loop) {
|
|
@@ -138,9 +338,10 @@ async function runInteractiveLoop() {
|
|
|
138
338
|
{
|
|
139
339
|
type: 'list',
|
|
140
340
|
name: 'action',
|
|
141
|
-
message: t('menu.
|
|
142
|
-
pageSize:
|
|
143
|
-
|
|
341
|
+
message: `${brand.primary(t('menu.actionPrefix'))} ${brand.dim('›')}`,
|
|
342
|
+
pageSize: 20,
|
|
343
|
+
loop: false,
|
|
344
|
+
choices: getMenuActions(project),
|
|
144
345
|
},
|
|
145
346
|
]);
|
|
146
347
|
|
|
@@ -150,24 +351,15 @@ async function runInteractiveLoop() {
|
|
|
150
351
|
}
|
|
151
352
|
|
|
152
353
|
try {
|
|
153
|
-
const stay = await runMenuAction(action, projectRoot);
|
|
154
|
-
if (!stay)
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
354
|
+
const stay = await runMenuAction(action, projectRoot, project);
|
|
355
|
+
if (!stay) break;
|
|
157
356
|
|
|
158
|
-
if (action !== 'status') {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
type: 'confirm',
|
|
162
|
-
name: 'again',
|
|
163
|
-
message: t('menu.back'),
|
|
164
|
-
default: true,
|
|
165
|
-
},
|
|
166
|
-
]);
|
|
167
|
-
loop = again;
|
|
357
|
+
if (action !== 'status' && action !== 'doctor') {
|
|
358
|
+
console.log('');
|
|
359
|
+
await printContextStatus(projectRoot);
|
|
168
360
|
}
|
|
169
361
|
} catch (err) {
|
|
170
|
-
console.error(
|
|
362
|
+
console.error(fail(err.message || err));
|
|
171
363
|
const { retry } = await inquirer.prompt([
|
|
172
364
|
{
|
|
173
365
|
type: 'confirm',
|
|
@@ -177,8 +369,12 @@ async function runInteractiveLoop() {
|
|
|
177
369
|
},
|
|
178
370
|
]);
|
|
179
371
|
loop = retry;
|
|
372
|
+
if (loop) {
|
|
373
|
+
console.log('');
|
|
374
|
+
await printContextStatus(projectRoot);
|
|
375
|
+
}
|
|
180
376
|
}
|
|
181
377
|
}
|
|
182
378
|
}
|
|
183
379
|
|
|
184
|
-
module.exports = { runInteractiveLoop, runMenuAction };
|
|
380
|
+
module.exports = { runInteractiveLoop, runMenuAction, getMenuActions };
|
package/ui/theme.js
CHANGED
|
@@ -1,25 +1,265 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* ReactPress CLI visual identity — a single source of truth so banners,
|
|
5
|
+
* menus, status, doctor, build output all share the same colours and glyphs.
|
|
6
|
+
*/
|
|
7
|
+
const palette = {
|
|
8
|
+
primary: '#7C5CFF',
|
|
9
|
+
accent: '#22D3EE',
|
|
10
|
+
pink: '#F472B6',
|
|
11
|
+
green: '#22C55E',
|
|
12
|
+
amber: '#F59E0B',
|
|
13
|
+
red: '#EF4444',
|
|
14
|
+
gray: '#6B7280',
|
|
15
|
+
dim: '#9CA3AF',
|
|
16
|
+
};
|
|
17
|
+
|
|
3
18
|
const brand = {
|
|
4
|
-
primary: chalk.hex(
|
|
5
|
-
accent: chalk.hex(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
primary: chalk.hex(palette.primary),
|
|
20
|
+
accent: chalk.hex(palette.accent),
|
|
21
|
+
pink: chalk.hex(palette.pink),
|
|
22
|
+
success: chalk.hex(palette.green),
|
|
23
|
+
warn: chalk.hex(palette.amber),
|
|
24
|
+
error: chalk.hex(palette.red),
|
|
25
|
+
muted: chalk.hex(palette.gray),
|
|
26
|
+
dim: chalk.hex(palette.dim),
|
|
10
27
|
bold: chalk.bold,
|
|
11
28
|
};
|
|
12
29
|
|
|
30
|
+
const icon = {
|
|
31
|
+
ok: brand.success('✓'),
|
|
32
|
+
fail: brand.error('✗'),
|
|
33
|
+
warn: brand.warn('⚠'),
|
|
34
|
+
info: brand.accent('ℹ'),
|
|
35
|
+
arrow: brand.primary('›'),
|
|
36
|
+
pointer: brand.primary('▸'),
|
|
37
|
+
bullet: brand.muted('·'),
|
|
38
|
+
dotOn: brand.success('●'),
|
|
39
|
+
dotOff: brand.muted('○'),
|
|
40
|
+
dotPending: brand.warn('◐'),
|
|
41
|
+
dotInfo: brand.accent('●'),
|
|
42
|
+
spark: brand.primary('✱'),
|
|
43
|
+
link: brand.muted('↗'),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Whether a Unicode code point should occupy two terminal cells.
|
|
48
|
+
*
|
|
49
|
+
* Covers the common "East Asian Wide / Full-width" ranges that show up in
|
|
50
|
+
* Chinese / Japanese / Korean text plus full-width punctuation. We
|
|
51
|
+
* deliberately do not pull in a heavy dependency like `string-width` to keep
|
|
52
|
+
* the CLI's startup cheap.
|
|
53
|
+
*/
|
|
54
|
+
function isWideCodePoint(cp) {
|
|
55
|
+
return (
|
|
56
|
+
(cp >= 0x1100 && cp <= 0x115f) ||
|
|
57
|
+
(cp >= 0x2e80 && cp <= 0x303e) ||
|
|
58
|
+
(cp >= 0x3041 && cp <= 0x33ff) ||
|
|
59
|
+
(cp >= 0x3400 && cp <= 0x4dbf) ||
|
|
60
|
+
(cp >= 0x4e00 && cp <= 0x9fff) ||
|
|
61
|
+
(cp >= 0xa000 && cp <= 0xa4cf) ||
|
|
62
|
+
(cp >= 0xac00 && cp <= 0xd7a3) ||
|
|
63
|
+
(cp >= 0xf900 && cp <= 0xfaff) ||
|
|
64
|
+
(cp >= 0xfe30 && cp <= 0xfe4f) ||
|
|
65
|
+
(cp >= 0xff00 && cp <= 0xff60) ||
|
|
66
|
+
(cp >= 0xffe0 && cp <= 0xffe6) ||
|
|
67
|
+
(cp >= 0x1f300 && cp <= 0x1f64f) ||
|
|
68
|
+
(cp >= 0x1f900 && cp <= 0x1f9ff) ||
|
|
69
|
+
(cp >= 0x20000 && cp <= 0x2fffd) ||
|
|
70
|
+
(cp >= 0x30000 && cp <= 0x3fffd)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Visible terminal-cell width of a string, after stripping ANSI colour codes
|
|
76
|
+
* and accounting for East Asian wide characters (which occupy 2 cells).
|
|
77
|
+
*/
|
|
78
|
+
function visibleLength(text) {
|
|
79
|
+
const stripped = String(text)
|
|
80
|
+
.replace(/\u001b\[[0-9;]*m/g, '')
|
|
81
|
+
.replace(/\u001b\]8;[^\u0007\u001b]*(?:\u0007|\u001b\\)/g, '');
|
|
82
|
+
let width = 0;
|
|
83
|
+
for (const ch of stripped) {
|
|
84
|
+
const cp = ch.codePointAt(0);
|
|
85
|
+
if (cp === undefined) continue;
|
|
86
|
+
if (cp < 0x20 || (cp >= 0x7f && cp < 0xa0)) continue;
|
|
87
|
+
width += isWideCodePoint(cp) ? 2 : 1;
|
|
88
|
+
}
|
|
89
|
+
return width;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function padRight(text, width) {
|
|
93
|
+
const len = visibleLength(text);
|
|
94
|
+
if (len >= width) return text;
|
|
95
|
+
return text + ' '.repeat(width - len);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function padLeft(text, width) {
|
|
99
|
+
const len = visibleLength(text);
|
|
100
|
+
if (len >= width) return text;
|
|
101
|
+
return ' '.repeat(width - len) + text;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function terminalWidth(fallback = 80) {
|
|
105
|
+
const cols = Number(process.stdout.columns) || fallback;
|
|
106
|
+
return Math.max(48, Math.min(120, cols));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function divider(width = 44, char = '─', colorize = brand.muted) {
|
|
110
|
+
return colorize(char.repeat(width));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Cyberpunk-flavoured progress-bar style decoration.
|
|
115
|
+
* `filled` segments use the primary colour, the trailing track stays muted.
|
|
116
|
+
*/
|
|
117
|
+
function pulseBar(width = 24, filled = Math.ceil(width * 0.7)) {
|
|
118
|
+
const f = Math.max(0, Math.min(width, filled));
|
|
119
|
+
const head = brand.primary('▰'.repeat(f));
|
|
120
|
+
const tail = brand.muted('▱'.repeat(Math.max(0, width - f)));
|
|
121
|
+
return `${head}${tail}`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Three-light status indicator used in the top-right of the banner.
|
|
126
|
+
* Mimics the running-light cluster you'd see on a server rack.
|
|
127
|
+
*/
|
|
128
|
+
function statusLights(state = 'online') {
|
|
129
|
+
if (state === 'offline') {
|
|
130
|
+
return `${brand.muted('●')} ${brand.muted('●')} ${brand.muted('●')}`;
|
|
131
|
+
}
|
|
132
|
+
if (state === 'pending') {
|
|
133
|
+
return `${brand.warn('●')} ${brand.warn('●')} ${brand.muted('○')}`;
|
|
134
|
+
}
|
|
135
|
+
return `${brand.success('●')} ${brand.warn('●')} ${brand.muted('○')}`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function hex2rgb(h) {
|
|
139
|
+
const s = h.replace('#', '');
|
|
140
|
+
return {
|
|
141
|
+
r: parseInt(s.substring(0, 2), 16),
|
|
142
|
+
g: parseInt(s.substring(2, 4), 16),
|
|
143
|
+
b: parseInt(s.substring(4, 6), 16),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function rgb2hex(r, g, b) {
|
|
148
|
+
const pad = (n) => n.toString(16).padStart(2, '0');
|
|
149
|
+
return `#${pad(r)}${pad(g)}${pad(b)}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function mixHex(a, b, t) {
|
|
153
|
+
const pa = hex2rgb(a);
|
|
154
|
+
const pb = hex2rgb(b);
|
|
155
|
+
const r = Math.round(pa.r + (pb.r - pa.r) * t);
|
|
156
|
+
const g = Math.round(pa.g + (pb.g - pa.g) * t);
|
|
157
|
+
const bl = Math.round(pa.b + (pb.b - pa.b) * t);
|
|
158
|
+
return rgb2hex(r, g, bl);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Paint a string with a left→right linear gradient across `colors` (hex).
|
|
163
|
+
* Falls back to plain text when stdout does not support truecolor.
|
|
164
|
+
*/
|
|
165
|
+
function gradientText(text, colors = [palette.primary, palette.accent], { bold = false } = {}) {
|
|
166
|
+
if (!text) return '';
|
|
167
|
+
const supports = chalk.supportsColor && chalk.supportsColor.has16m;
|
|
168
|
+
if (!supports || colors.length < 2) {
|
|
169
|
+
const c = chalk.hex(colors[0] || palette.primary);
|
|
170
|
+
return bold ? c.bold(text) : c(text);
|
|
171
|
+
}
|
|
172
|
+
const chars = [...String(text)];
|
|
173
|
+
const n = Math.max(chars.length - 1, 1);
|
|
174
|
+
return chars
|
|
175
|
+
.map((ch, i) => {
|
|
176
|
+
const ratio = i / n;
|
|
177
|
+
const idx = ratio * (colors.length - 1);
|
|
178
|
+
const lo = Math.floor(idx);
|
|
179
|
+
const hi = Math.min(colors.length - 1, lo + 1);
|
|
180
|
+
const local = idx - lo;
|
|
181
|
+
const c = chalk.hex(mixHex(colors[lo], colors[hi], local));
|
|
182
|
+
return bold ? c.bold(ch) : c(ch);
|
|
183
|
+
})
|
|
184
|
+
.join('');
|
|
185
|
+
}
|
|
186
|
+
|
|
13
187
|
function label(text) {
|
|
14
|
-
return brand.primary(
|
|
188
|
+
return `${icon.arrow} ${brand.primary(text)}`;
|
|
15
189
|
}
|
|
16
190
|
|
|
17
191
|
function ok(text) {
|
|
18
|
-
return brand.success(
|
|
192
|
+
return `${icon.ok} ${brand.success(text)}`;
|
|
19
193
|
}
|
|
20
194
|
|
|
21
195
|
function fail(text) {
|
|
22
|
-
return brand.error(
|
|
196
|
+
return `${icon.fail} ${brand.error(text)}`;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function warn(text) {
|
|
200
|
+
return `${icon.warn} ${brand.warn(text)}`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function info(text) {
|
|
204
|
+
return `${icon.info} ${brand.accent(text)}`;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function chip(text, color = brand.primary) {
|
|
208
|
+
return color(`[ ${text} ]`);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function kv(key, value, { keyWidth = 10, valueColor = (s) => s } = {}) {
|
|
212
|
+
return `${brand.muted(padRight(key, keyWidth))} ${valueColor(value)}`;
|
|
23
213
|
}
|
|
24
214
|
|
|
25
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Render a 3-state status pill, e.g. `● online` / `○ offline` / `◐ pending`.
|
|
217
|
+
*
|
|
218
|
+
* @param {boolean | 'pending'} state
|
|
219
|
+
* @param {{ on?: string, off?: string, pending?: string }} labels
|
|
220
|
+
*/
|
|
221
|
+
function statusPill(state, labels = {}) {
|
|
222
|
+
if (state === 'pending') {
|
|
223
|
+
return `${icon.dotPending} ${brand.warn(labels.pending || 'pending')}`;
|
|
224
|
+
}
|
|
225
|
+
if (state === true) {
|
|
226
|
+
return `${icon.dotOn} ${brand.success(labels.on || 'online')}`;
|
|
227
|
+
}
|
|
228
|
+
return `${icon.dotOff} ${brand.dim(labels.off || 'offline')}`;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Render a single-line section header: ` ── Title ────────────`.
|
|
233
|
+
*/
|
|
234
|
+
function sectionHeader(title, { width } = {}) {
|
|
235
|
+
const w = width ?? terminalWidth();
|
|
236
|
+
const prefix = brand.muted('── ');
|
|
237
|
+
const t = brand.bold(brand.primary(title));
|
|
238
|
+
const usedLen = visibleLength(prefix) + visibleLength(t) + 2;
|
|
239
|
+
const fillLen = Math.max(3, w - usedLen - 2);
|
|
240
|
+
const fill = brand.muted('─'.repeat(fillLen));
|
|
241
|
+
return ` ${prefix}${t} ${fill}`;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
module.exports = {
|
|
245
|
+
palette,
|
|
246
|
+
brand,
|
|
247
|
+
icon,
|
|
248
|
+
label,
|
|
249
|
+
ok,
|
|
250
|
+
fail,
|
|
251
|
+
warn,
|
|
252
|
+
info,
|
|
253
|
+
chip,
|
|
254
|
+
kv,
|
|
255
|
+
statusPill,
|
|
256
|
+
sectionHeader,
|
|
257
|
+
visibleLength,
|
|
258
|
+
padRight,
|
|
259
|
+
padLeft,
|
|
260
|
+
terminalWidth,
|
|
261
|
+
divider,
|
|
262
|
+
gradientText,
|
|
263
|
+
pulseBar,
|
|
264
|
+
statusLights,
|
|
265
|
+
};
|