openpress-deploy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

open-press Deploy

open-press 部署

open-press deploy owns the public-release gate. Use it only when the user asks to configure, inspect, dry-run, or publish an open-press document.
open-press deploy 负责公开发布的管控环节。仅当用户要求配置、检查、试运行或发布open-press文档时使用该工具。

Responsibilities

职责

  • Inspect deploy config in
    openpress/settings.json
    under the
    "deploy"
    field.
  • Check target adapter, staging source, project name, and confirmation settings.
  • Run deploy preflight and dry runs.
  • Keep secrets out of source files.
  • Require explicit confirmation before publishing.
  • Report the public URL and, when included, the PDF URL after successful deploy.
  • 检查
    openpress/settings.json
    "deploy"
    字段下的部署配置。
  • 核查目标适配器、预发布源、项目名称及确认设置。
  • 执行部署预检查和试运行。
  • 确保敏感信息不进入源文件。
  • 发布前需用户明确确认。
  • 部署成功后报告公共URL,若包含PDF则同时报告PDF URL。

Boundaries

边界

  • openpress
    owns generic CLI usage, non-deploy validation, local review, and the source/generated boundary.
  • openpress-create-pages
    owns page artifact content and visual readiness.
  • openpress-create-slide
    owns slide deck content and visual readiness.
  • This skill owns public target confirmation and deploy execution.
  • openpress
    负责通用CLI使用、非部署验证、本地审核及源文件/生成文件的边界管理。
  • openpress-create-pages
    负责页面产物内容及视觉就绪性。
  • openpress-create-slide
    负责幻灯片内容及视觉就绪性。
  • 本工具负责公共目标确认及部署执行。

Public Deploy Rule

公开发布规则

Never publish without a clear confirmation that names the target project.
Good confirmation shape:
txt
This will publish the current open-press build to Cloudflare Pages project `<projectName>` from `<deploy.source>`.
Do you want me to deploy now?
未得到明确指定目标项目的确认时,绝不能发布。
标准确认话术示例:
txt
This will publish the current open-press build to Cloudflare Pages project `<projectName>` from `<deploy.source>`.
Do you want me to deploy now?

Preflight

预检查

Before real deploy, run the commands that prove the output is ready:
bash
npm run build              # validates + renders dist-react/
Also scan public-facing source for unfinished markers:
bash
rg "\\[TODO:|\\[FIX:|\\[DRAFT:" "press/*/chapters" press/design.md
正式部署前,执行以下命令验证输出内容是否就绪:
bash
npm run build              # validates + renders dist-react/
同时扫描面向公众的源文件,查找未完成标记:
bash
rg "\\[TODO:|\\[FIX:|\\[DRAFT:" "press/*/chapters" press/design.md

PDF Size Limit

PDF大小限制

Cloudflare Pages rejects any single file larger than 25 MB. A multi-press or image-heavy PDF commonly exceeds this limit.
Unless the user explicitly asks to publish the PDF, deploy without it:
bash
npm run openpress:deploy -- --confirm --no-pdf
--no-pdf
skips PDF generation and excludes it from the deploy source entirely.
If the user wants to check the PDF size first:
bash
npm run openpress:pdf
du -sh .deploy/**/*.pdf 2>/dev/null
If the PDF is over 25 MB and the user still wants it publicly hosted, recommend a separate host (Cloudflare R2, S3, etc.). OpenPress does not currently expose an authored external-PDF URL field, so do not invent one in
openpress/settings.json
; report the separate URL in the delivery handoff.
Cloudflare Pages 拒绝任何单个文件超过25 MB的内容。多文档或图片密集型PDF通常会超出此限制。
除非用户明确要求发布PDF,否则部署时不包含PDF:
bash
npm run openpress:deploy -- --confirm --no-pdf
--no-pdf
参数会跳过PDF生成,并将其完全排除在部署源之外。
如果用户希望先检查PDF大小:
bash
npm run openpress:pdf
du -sh .deploy/**/*.pdf 2>/dev/null
若PDF超过25 MB但用户仍希望公开托管,建议使用独立托管服务(如Cloudflare R2、S3等)。OpenPress目前未提供外部PDF URL的配置字段,请勿在
openpress/settings.json
中自行添加;在交付时告知用户独立托管的URL即可。

Deploy Commands

部署命令

Dry run:
bash
npm run openpress:deploy:dry-run -- --no-pdf
Publish after explicit confirmation:
bash
npm run openpress:deploy -- --confirm --no-pdf
Remove
--no-pdf
only when the user explicitly includes the PDF in the confirmed publication target.
试运行:
bash
npm run openpress:deploy:dry-run -- --no-pdf
获得明确确认后发布:
bash
npm run openpress:deploy -- --confirm --no-pdf
仅当用户明确确认发布目标包含PDF时,才移除
--no-pdf
参数。

When To Read References

何时查阅参考文档

  • Read
    references/cloudflare-pages.md
    when creating or repairing Cloudflare Pages config, project setup, Wrangler auth expectations, or UI deploy-button behavior.
  • 当创建或修复Cloudflare Pages配置、项目设置、Wrangler认证要求或UI部署按钮行为时,查阅
    references/cloudflare-pages.md