Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Phase 1 of the Chrome Web Store plan tracked in PR 9. - Remove http://localhost/* and http://127.0.0.1/* from the release manifest; `bun run build:dev` injects them so local http S3 endpoints stay testable. - Ship icons/icon-{16,32,48,128}.png instead of pointing every size at the 1254x1254 logo. - Localize name, description and toolbar tooltip through _locales/en and _locales/zh_CN with default_locale. - Set minimum_chrome_version to 123, the version that ships light-dark(), which the dashboard and popup palettes rely on. - Move the manifest into scripts/manifest.ts and assert permissions, version parity, icon pixel sizes and locale keys from scripts/manifest.test.ts.
Phase 4 of the Chrome Web Store plan tracked in PR 9. - `bun run release:package` clears dist/ and output/release/, rebuilds with --release (no source maps), proves the packaged files are exactly the ones the manifest and its pages reference, scans them for Manifest V3 policy violations, and writes a versioned ZIP with manifest.json at its root. - `bun run release:check` runs the whole quality gate first and refuses to package when it fails, so the uploaded artifact always passed the checks. - scripts/archive.ts is a deterministic ZIP writer and reader built only on Bun and node:zlib: sorted entries, manifest.json first, pinned timestamps, CRC-32 verified on read, so one commit yields identical bytes everywhere. - Each package writes the archive plus a SHA-256 file and a per-file listing, and is cross-checked with the system `unzip -t` and `unzip -Z1`. - Release ZIPs, CRX files and key material are git-ignored.
- .github/workflows/ci.yml runs the quality gate on main pushes and pull requests, and a parallel job packages the extension twice to prove the archive is reproducible. The archive and its checksums are uploaded. - .github/workflows/release.yml runs on version tags: it fails when the tag disagrees with the packaged version, reruns the release gate, re-verifies reproducibility, and opens a draft GitHub Release with the ZIP, its SHA-256 and its file listing attached. A manual run rehearses packaging without touching releases. - `bun run release:verify` packages twice from clean dist/ directories and compares every artifact byte for byte, turning reproducibility into an assertion both workflows reuse. - Actions are pinned to commit SHAs with the matching version in a comment, and the workflows need no repository secrets: the Bun version comes from packageManager and the release uses only GITHUB_TOKEN.
- Record run 35828545712 passing both jobs, and that the Ubuntu runner built an archive whose SHA-256 matches the macOS build byte for byte. - Note that actionlint validates the workflow files but skips action input names for SHA-pinned actions, so those were checked against each action.yml at the pinned commit. - Document that workflow_dispatch needs the file on the default branch, so release.yml becomes available once merged into main.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #9 · Chrome Web Store 发布计划
codex/chrome-web-store-releaseorigin/main(6aecd93)workspace/pr-9-privacy-policy0.1.0(首次商店发布)目标
将 XFlow 以可审核、可复现、隐私披露完整的 Manifest V3 扩展提交到 Chrome Web Store,并建立后续版本可重复执行的发布流程。
本 PR 负责完成代码仓库内的所有发布准备工作,并记录 Developer Dashboard 中需要填写的文案与操作步骤。注册开发者账号、支付注册费、Trader / Non-Trader 身份声明、上传凭据和最终点击发布等账号操作,由仓库所有者执行或在明确授权后执行。
发布原则
manifest.json。eval/new Function;远程响应只作为数据处理。dist/、发布 ZIP、CRX、源码映射和测试凭据不提交到 Git。origin/main。如主分支有新提交,使用独立 merge commit 优先合入并重新验证。当前基线审计
main已同步至754ddec,包含 PR feat: add bilingual popup and dashboard UI #8。0.1.0。bun run check通过:87 tests / 312 assertions,生产构建成功。eval、new Function或远程<script>。dist/约 11 MB,其中大部分为不必上传的 source maps。bun run build:dev注入。关键决策
以下决策必须在进入对应实现阶段前记录结论:
https://*/*可选权限。http://localhost/*与http://127.0.0.1/*。ry4nzeng@gmail.com。 Trader / Non-Trader 状态仍待商店阶段确认。https://ryanzen9.github.io/XFlow/privacy-policy/;中文:https://ryanzen9.github.io/XFlow/privacy-policy/zh-CN/。Pages 先从 PR 分支的docs/发布,合并后切换到main/docs。#0a0a0a圆角底板 + 白色 X,在浅色和深色工具栏都清晰,且符合“没有品牌色”的设计原则。bun run build:dev,只在开发构建中注入这两个来源。数据与权限声明基线
storagealarms当前代码未接入广告、遥测或开发者分析服务;发布前需要通过静态扫描再次确认。
阶段规划
阶段 0:发布决策与范围冻结
目标:在改动 manifest 或 UI 前冻结首次发布范围。
0.1.0。验收:所有决策写入本文档,不存在会改变 manifest 权限或商店文案的开放问题。
阶段 1:生产 Manifest 与权限收敛
目标:生成只包含生产功能所需权限和元数据的商店 manifest。
minimum_chrome_version;界面配色依赖的light-dark()把真实下限提高到 Chrome 123,而不是原估计的toSorted/ Chrome 110。default_locale、_locales/en/messages.json、_locales/zh_CN/messages.json和__MSG_*__字段。验收:Chrome 可加载生产 manifest;权限与当前功能一一对应;中英文名称和描述正确;相关测试通过。
阶段 1 证据:
storage/alarms,固定主机权限只有 X / Twitter 与三个 Provider,可选主机权限只有https://*/*。http://localhost/*与http://127.0.0.1/*只存在于createManifest({ dev: true }),即bun run build:dev;生产构建在写入dist/manifest.json前会用同一组断言校验createManifest()。logo.png的白色 X 与#0a0a0a圆角底板合成,icons/README.md记录生成命令;测试直接解析 PNG IHDR 校验四个尺寸。--pack-extension接受生产dist/(生成 CRX 成功)。Stable Google Chrome 已禁用--load-extension,真实加载与权限提示验证归入阶段 5。bun run check通过:116 tests / 422 assertions,生产构建成功。阶段 2:隐私披露与用户同意
目标:让用户在启用 Provider 或 S3 前清楚理解数据流,并形成可公开托管的隐私政策。
1233278583成功,英文与中文页面均返回 HTTP 200,含署名、邮箱和互链。codex/chrome-web-store-release/docs切换到main/docs。验收:UI、README、隐私政策与代码实际数据流一致;用户可在发送数据前看到说明;没有夸大“加密存储”等当前未实现能力。
阶段 3:商店元数据与视觉素材
目标:准备完整、准确且中英文一致的商店页面内容。
docs/chrome-web-store/,保存可复制到 Dashboard 的中英文文案、权限理由和素材说明。验收:商店所需素材齐全,尺寸和格式正确;列表文案与 Privacy practices、隐私政策及实际功能一致。
阶段 4:可复现发布打包
目标:通过 Bun 命令从干净提交生成唯一、可验证的上传 ZIP。
bun run release:check:运行完整检查并验证版本、manifest、权限、文件引用和禁用模式。bun run release:package:清理旧产物、生产构建、排除.map,生成版本化 ZIP。manifest.json,不能包含dist/外层目录。.env、日志、浏览器 trace、真实凭据、node_modules或.DS_Store。.gitignore,不提交构建产物。验收:在干净 checkout 中只使用 Bun 即可生成相同结构的 ZIP;解压校验与静态安全扫描通过。
阶段 4 证据:
scripts/archive.ts(仅依赖 Bun 与node:zlib的 ZIP 读写)、scripts/release.ts(策略、校验与打包)、scripts/release-check.ts、scripts/release-package.ts与对应测试。bun run build -- --release关闭 source map;打包前清空dist/与output/release/,因此包内不会残留旧产物或.map。manifest.json固定在 ZIP 首个条目。eval(、new Function(、importScripts(、sourceMappingURL、远程页面资源、localhost 来源。合法内容(JSON Schema 的http://json-schema.org/...、SVG 命名空间、url.hostname === "localhost"比较)不会误报。output/release/xflow-0.1.0.zip:18 个条目、1,119,543 字节(含 source map 时为约 11 MB),SHA-256fbed55c01a20fc358104afedaf564b493b662de3619ef548b426ceaab053307d;连续两次运行字节完全一致。unzip -t、unzip -Z1清单比对、shasum -a 256 -c均通过;解压后的目录可被 Chrome--pack-extension接受。bun run release:check在质量门禁失败时会拒绝打包(已用一次真实的 lint 失败验证拦截行为)。bun run release:verify:连续打包两次并逐字节比较output/release/下全部三个产物,把可复现性变成可执行断言。.github/workflows/ci.yml(main推送与 PR 跑质量门禁,并行任务证明归档可复现)与.github/workflows/release.yml(v*标签校验版本、重跑发布门禁与可复现验证,再创建草稿 Release)。所有 Action 固定到提交 SHA。35828545712,本 PR 的pull_request事件):Quality gate 与 Release package 两个任务均通过,产出xflow-0.1.0.zip与xflow-release-checksums两个 artifact。fbed55c0…3307d,1,119,543 字节);下载该 artifact 得到的字节与本地 ZIP 一致,且同样被 Chrome--pack-extension接受。actionlint 1.7.12对两个工作流报告 0 个问题;由于 Action 固定到 SHA,actionlint 会跳过输入名校验,因此各输入名是逐一比对各 Action 在该提交上的action.yml确认的。release.yml的标签校验步骤已在本地双向验证(v0.1.0通过、v0.2.0报错退出),发布说明生成步骤也已提取执行确认。workflow_dispatch要求工作流文件位于默认分支,因此release.yml的手动触发与标签触发在合并到main后生效。阶段 5:真实 Chrome 与安全 QA
目标:验证审核员收到的精确 ZIP,而不是开发目录。
bun run check并保存测试证据摘要。验收:精确发布包在稳定版 Chrome 中通过核心路径;所有已知限制进入发布说明或获得修复。
阶段 6:Developer Dashboard 配置与测试提交
目标:完成账号和商店条目配置,先以可控方式送审。
验收:Dashboard 所有必填项完成,ZIP 上传无错误,提交进入 Pending review;不自动公开发布。
阶段 7:审核反馈闭环
目标:对 Chrome Web Store 的审核问题形成可追踪的修复循环。
origin/main,必要时独立 merge commit。验收:状态变为 Staged / Approved,且没有未处理的政策或功能问题。
阶段 8:正式发布与发布后验证
目标:在明确批准后公开发布,并建立后续维护基线。
v0.1.0Git Tag 与 GitHub Release,附发布说明和 ZIP SHA-256;不附带任何凭据。推送v0.1.0标签后release.yml会自动生成草稿 Release,公开发布仍需人工确认。验收:商店页面可访问,商店版本安装与运行正常,仓库文档和 Release 与线上版本一致。
Chrome Web Store 字段草案
单一用途
权限理由
storage:在本机保存过滤设置、策略、界面偏好、Activity、Provider Key 和可选 S3 配置。alarms:仅在用户启用 S3 后,每 15 分钟检查一次配置与 Activity 同步。x.com/twitter.com:读取用户当前看到的帖子文本并在原页面渲染可揭示遮罩。Remote code
选择 No。所有可执行代码均包含在扩展包内。Provider 返回判断结果数据;S3 返回用户自己的配置数据。自定义 Hover CSS 仅允许固定选择器、属性和值,并在应用前进行解析、allowlist 校验和作用域隔离;不下载或执行远程 JavaScript。
交付物
0.1.0发布 ZIP 与 SHA-256。实时进度
storage/alarms与三个 Provider;图标、本地化、权限断言与版本检查已落地release:check/release:package/release:verify产出可复现 ZIP、SHA-256 与文件清单;CI 与标签发布已自动化变更日志
origin/main@754ddec创建发布分支与独立 worktree,建立首次发布规划。workspace/pr-9-privacy-policy合入最新origin/main@2c04e3b;完成中英文隐私政策文稿、Dashboard 披露与 README 入口。bun run check通过:89 tests / 327 assertions,生产构建成功。发布者邮箱、托管与 S3 首版范围待确认。origin/main@5683177(PR feat: refine activity insights and log management #10 / feat: 策略 Hit Rate 快捷切换与 Hover 样式预设 #11),更新“清理日志”相关隐私说明。已确认发布者 Ryan Zeng、ry4nzeng@gmail.com、GitHub Pages 和保留 S3。bun run check通过:100 tests / 390 assertions,生产构建成功。origin/main@6aecd93,保留上游界面文案修改与本分支隐私披露。codex/chrome-web-store-release/docs启用 GitHub Pages(强制 HTTPS);构建1233278583成功。英文https://ryanzen9.github.io/XFlow/privacy-policy/与中文https://ryanzen9.github.io/XFlow/privacy-policy/zh-CN/均验证 HTTP 200,正文含 Ryan Zeng 和ry4nzeng@gmail.com。https://*/*可选主机权限;新增icons/icon-{16,32,48,128}.png(白 X +#0a0a0a圆角底板);启用_locales/en与_locales/zh_CN本地化;minimum_chrome_version依据light-dark()定为123;新增scripts/manifest.ts、scripts/manifest.test.ts与bun run build:dev。bun run check通过:116 tests / 422 assertions,Chrome--pack-extension接受dist/。scripts/archive.ts(Bun +node:zlib的确定性 ZIP 读写)、scripts/release.ts、release:check/release:package、build --release(无 source map)与.gitignore发布产物规则。产物output/release/xflow-0.1.0.zip:18 个条目、1,119,543 字节、SHA-256fbed55c0…3307d,两次独立运行字节一致;unzip -t/unzip -Z1/shasum -c与 Chrome--pack-extension均通过。bun run check通过:156 tests / 483 assertions。.github/workflows/ci.yml(main推送与 PR:质量门禁 + 独立的可复现打包任务)与.github/workflows/release.yml(v*标签:校验标签与版本一致、重跑发布门禁与可复现验证、上传 ZIP 并创建草稿 Release)、bun run release:verify(连续打包两次并逐字节比较)。所有 Action 固定到提交 SHA(checkout v7.0.1、setup-bun v2.2.0、upload-artifact v7.0.1、action-gh-release v3.0.3),工作流不需要任何仓库密钥。