Skip to content

[codex] 优化社区前端渲染与 standalone 部署 - #22

Merged
ronger-x merged 2 commits into
masterfrom
codex/community-frontend-deploy
Jun 8, 2026
Merged

[codex] 优化社区前端渲染与 standalone 部署#22
ronger-x merged 2 commits into
masterfrom
codex/community-frontend-deploy

Conversation

@ronger-x

@ronger-x ronger-x commented Jun 7, 2026

Copy link
Copy Markdown
Member

变更说明

  • 为社区站点和 standalone 发布模板启用 @comark/nuxt,补齐 Markdown/代码块渲染能力。
  • 扩展 MDC highlight 语言列表,覆盖 TSX/JSX、HTML、SCSS、Markdown、Dockerfile、Nginx、Python、Go、Rust、Kotlin、C/C++ 等常见内容。
  • 优化 deploy-community-standalone.ps1 的远端 better-sqlite3 处理:先在 node:22-slim 中验证产物自带 native binding,能加载就跳过修复;确需修复时读取产物实际版本,并给 apt fallback 增加阿里 Debian 镜像和 timeout。

背景

本次社区前端 standalone-root 部署时,远端 node:22-slim 内的 better-sqlite3 修复步骤会因网络/apt 安装卡住而中断。实际上传产物中的 better-sqlite3@12.8.0 已可在目标运行镜像内加载,所以脚本改为先验证再修复,降低部署风险。

规范链接

  • 规范链接: frontend/layers/community/README.md#独立部署不需要官网

验证

  • pnpm --filter @mortise/site typecheck
  • PowerShell parser 校验 scripts/deploy-community-standalone.ps1
  • git diff --check 目标文件无空白错误
  • 已在 root@47.100.218.231 完成社区前端部署验证:mortise-site / mortise-app 均 running 且 restartCount=0https://rymcu.com//topics/collections 均返回 200

@ronger-x
ronger-x marked this pull request as ready for review June 8, 2026 00:10
Copilot AI review requested due to automatic review settings June 8, 2026 00:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本 PR 聚焦于社区前端(@mortise/site)与 standalone 模板的 Markdown/代码块渲染能力补齐,并改进 standalone 部署脚本在远端处理 better-sqlite3 原生依赖时的稳定性,降低因 apt 网络问题导致的部署中断风险。

Changes:

  • 为社区站点与 standalone 模板启用 @comark/nuxt 模块,并扩展 MDC highlight 语言列表。
  • 优化 deploy-community-standalone.ps1:远端先验证 better-sqlite3 native binding 是否可用;失败时再走 apt fallback(含镜像与 timeout)。
  • 更新 frontend/pnpm-lock.yaml@mortise/site 依赖以引入 @comark/nuxt 及其相关依赖。

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/deploy-community-standalone.ps1 调整远端 better-sqlite3 修复流程(先验证、后 fallback)以提升部署可靠性。
frontend/templates/standalone/nuxt.config.ts standalone 模板启用 @comark/nuxt 并扩展代码高亮语言。
frontend/apps/site/nuxt.config.ts 社区站点启用 @comark/nuxt 并扩展代码高亮语言。
frontend/apps/site/package.json 为社区站点新增 @comark/nuxt 依赖声明。
frontend/pnpm-lock.yaml 锁文件更新以纳入 @comark/nuxt 及相关依赖解析结果。
Files not reviewed (1)
  • frontend/pnpm-lock.yaml: Language not supported

Comment on lines +234 to +238
'npm install "better-sqlite3@${version}" --omit=dev >/dev/null',
'node -e "require(''better-sqlite3'')"',
'rm -rf /work/node_modules/better-sqlite3',
'cp -a /tmp/sqlitefix/node_modules/better-sqlite3 /work/node_modules/',
'SQLITEFIX',
extends: layers,

modules: ['@nuxt/eslint', '@nuxt/ui', '@pinia/nuxt', '@nuxt/content', '@nuxt/image'],
modules: ['@nuxt/eslint', '@nuxt/ui', '@pinia/nuxt', '@nuxt/content', '@nuxt/image', '@comark/nuxt'],
@ronger-x
ronger-x merged commit 70ac0ca into master Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants