Files
OneOS1.2/rules/cloud-publish-url-guide.md

2.5 KiB
Raw Blame History

对象存储发布 URL 规范(全局)

Make 客户端「发布到对象存储」与脚本/Agent 批量发布必须使用同一套公网路径,避免维护两套链接。

配置来源:.axhub/make/axhub.config.jsoncloudPublishing.s3


标准 URL 形态

{baseUrl}/{objectPrefix}/index.html
默认值 示例
baseUrl https://prototype.lnoneos.com
原型页 objectPrefix {prototype-id} lease-business-detail
主题页 objectPrefix themes/{theme-id} themes/claude
入口文件名 固定 index.html 不得改为 /.html 省略或 index.htm

租赁业务明细(范例)

https://prototype.lnoneos.com/lease-business-detail/index.html

禁止的改写

禁止 说明
prototypes/ 前缀 不得发布为 /prototypes/lease-business-detail/index.html
去掉 index.html 不得改为目录根 /lease-business-detail/
baseUrl 域名 axhub.config.jsons3.baseUrl 为准
自造路径别名 pathAliases 中已声明的 id 可例外

pathAliases例外

仅在 axhub.config.jsoncloudPublishing.s3.pathAliases 中显式配置时覆盖默认前缀,例如:

"pathAliases": {
  "oneos-prototype-nav": "oneos-prototype-nav"
}

新增别名须同时更新:

  1. axhub.config.jsonpathAliases
  2. src/prototypes/oneos-prototype-nav/nav-data.tsCLOUD_PUBLISH_PATH_ALIASES
  3. prototype-registry.json 变更说明(如有)

实现对照

场景 路径解析
Make 客户端发布 /{prototype-id}/index.html
scripts/publish-all-to-s3.mjs resolveObjectPrefix() → 同上
导航页 resolvePrototypeHref() 云主机上 /{segment}/index.html
本地开发 /prototypes/{prototype-id}(仅 dev不是发布 URL

Agent / AI 发布检查清单

发布或向用户回报链接前:

  • 使用 axhub.config.json 中的 baseUrl
  • 原型链接以 /index.html 结尾
  • 未擅自添加 prototypes/ 前缀
  • 与 Make 工具弹窗中的 URL 逐字一致
  • 未将 dev 路径(/prototypes/...)当作对象存储链接写入 PRD/导航

关联文件

  • scripts/publish-all-to-s3.mjsresolveObjectPrefixresolvePublicUrl
  • src/prototypes/oneos-prototype-nav/nav-data.ts — 静态站跳转
  • .cursor/rules/cloud-publish-url.mdc — Agent 强制规则