feat(landing): 睿视 landing 由本仓统一管理——源码子目录化 + 四道门禁移植 + 契约路由
承接 ADR-0014 §4「第二等产品镜像起必须子目录化 + rewrites 前缀映射并回溯睿视」。
上一轮(2026-12-02)只搬了字节,源码落在 public/ 根命名空间;本轮把源码、门禁、
发布职责一并收进本仓,authority 侧退役对应产物。
源码与 URL 契约:
- public/novavis/{index.html,css,js,assets,images/logos} 一棵树自成一体
- index.html 引用保持站点级绝对路径(/css /js /assets /images/logos)不变。
因为同一份字节要服务两个落点:官网镜像 novalon.cn/novavis/,以及独立子域
novavis.p.novalon.cn/(页面在根路径)。改绝对路径会把子域首页变成 /novavis/
- 故用 4 条 prefix rewrite 把根命名空间映射进子目录,而非改写 HTML
四道门禁(从 authority 的四个 python 脚本移植为 Playwright,已并入 test:all):
- e2e/landing/{layout,motion,demo,a11y}.spec.ts + 独立 config(单引擎单 project 串行)
- layout:几何与焦点 / motion:js-grow 渐进生长与 reduced-motion 直达终态
- demo:首屏剧本四步 + 徽标一一对应 + 无 JS 降级四层真实可见性
- a11y:结构与全量对比度(同色无条件阻断)+ axe critical/serious=0
- 实测 13 passed / EXIT=0(1.4m)
补一个映射期暴露的真缺陷:landing 的 main.js 固定 POST /api/v1/contact 且只认
code===200,而本仓只有 /api/contact(formData + 必填 subject),镜像侧转化路径
一直 404。新增 src/app/api/v1/contact/route.ts 按 authority 契约响应(JSON +
{code:200}),而非改前端去适配本仓——改前端等于把适配成本转嫁给子域,且会让
两个落点的成功判据不一致。9 个单测覆盖校验、限流、上游失败不透传 5xx。
文档与配置同步:CLAUDE.md → AGENTS.md(单文档真源)、docs/landing.md、
docs/deployment.md §八、ADR-0014、qa-tracker §32、README 与 quality-gates 脚本表、
Jenkinsfile 落地「♿ 可访问性门禁」阶段的 landing 四道门禁、eslint 忽略
.next-dev-live 构建产物目录(未忽略时 eslint . 会扫出 21195 errors)。
门禁:tsc 0 / eslint 0 / jest app/api/v1 9/9 / test:landing 13 passed。
This commit was merged in pull request #70.
This commit is contained in:
1 parent
f20fc92dc3
commit
99eaa8c66a
38 files changed
+3904
-48
No files matched your search
+25
-5
@@ -115,14 +115,34 @@ const nextConfig = {
|
||||
},
|
||||
async rewrites() {
|
||||
return [
|
||||
// 睿视 NovaVis landing 入口(2026-12-02 从 novavis-authority/landing **原样**迁入
|
||||
// public/novavis/,内容零修改):源站按目录默认文档约定服务(https://novavis.p.novalon.cn/),
|
||||
// Next 的 public 文件层不做目录 → index.html 补全(实测 /novavis/ 308 → /novavis → 404),
|
||||
// 故入口用 rewrite 补齐。资产绝对路径(/css/style.css、/js/main.js、/assets/*、
|
||||
// /images/logos/*)已按同名落 public 根,与源站 URL 语义一致、无需改写。
|
||||
// ========================================================================
|
||||
// 睿视 NovaVis landing(2026-12-03 起由**本仓**统一管理,authority 已退役该目录)
|
||||
//
|
||||
// 物理布局:`public/novavis/{index.html,css,js,assets,images/logos}` 一棵树自成一体。
|
||||
// URL 契约:**保持源站形态不变** —— 页面引用仍是 `/css/style.css`、`/js/main.js`、
|
||||
// `/assets/*`、`/images/logos/*` 这些站点级绝对路径。
|
||||
//
|
||||
// 为什么 URL 不能改:同一份字节要服务两个落点 ——
|
||||
// ① 官网镜像 `novalon.cn/novavis/`(本仓 Next public 层);
|
||||
// ② 独立子域 `novavis.p.novalon.cn/`(nginx `root /var/www/novavis-landing`,
|
||||
// 页面在**根路径**)。改 HTML 为 `/novavis/...` 会把子域首页变成
|
||||
// `novavis.p.novalon.cn/novavis/`,产品站首页带路径不可接受。
|
||||
//
|
||||
// 于是用 4 条 prefix rewrite 把根命名空间映射进子目录(ADR-0014 §4 的
|
||||
// 「子目录化 + rewrites 前缀映射」模式,由此回溯到睿视)。根 `public/{css,js,assets,
|
||||
// images/logos}` 已删除 ⇒ 这四条是这些前缀的**唯一**占用者,无歧义。
|
||||
// 子域发布时把 `public/novavis/{css,js,assets,images}` 平铺到宿主目录根,URL 零变化。
|
||||
//
|
||||
// 入口 `/novavis` 单条:Next 的 public 文件层不做目录 → index.html 补全
|
||||
// (实测 `/novavis/` 308 → `/novavis` → 404),故用 rewrite 补齐。
|
||||
// landing 零内联脚本(唯一 script 为同源 /js/main.js)+ 4 处内联 style 属性,
|
||||
// 生产 CSP(script-src 'self' + style-src 'self' 'unsafe-inline')实测放行。
|
||||
// ========================================================================
|
||||
{ source: '/novavis', destination: '/novavis/index.html' },
|
||||
{ source: '/css/:path*', destination: '/novavis/css/:path*' },
|
||||
{ source: '/js/:path*', destination: '/novavis/js/:path*' },
|
||||
{ source: '/assets/:path*', destination: '/novavis/assets/:path*' },
|
||||
{ source: '/images/logos/:path*', destination: '/novavis/images/logos/:path*' },
|
||||
];
|
||||
},
|
||||
async headers() {
|
||||
|
||||
Reference in new issue
Block a user