Repository navigation
Releases
mp-headless-runtime v1.1.0 — Visual Snapshot Approval CLI, First-Party GitHub Action & Sticky PR Summary
Highlights / 核心升级 (v1.1.0)
1. Official First-Party Composite GitHub Action (uses: Wangjian-damon/mp-headless-runtime@v1)
5-line GitHub Actions integration with zero DevTools login, automatic Chromium setup, Report 3.0 artifact upload, GITHUB_STEP_SUMMARY, and sticky PR quality gate comments:
- uses: Wangjian-damon/mp-headless-runtime@v1
with:
artifact: dist/weapp # Taro: dist/weapp | UniApp: dist/build/mp-weixin | Native: .
test-dir: mp-tests # or contract: tests/contract.json
ux-audit: 'true'
min-route-coverage: '60'
min-ux-score: '80'
comment-pr: 'true'2. Playwright-Style Visual Snapshot Approval CLI (--update-snapshots & snapshots approve)
--update-snapshots [all|changed|missing|none](and-ushorthand forchanged) across bothexpect(page|locator).toMatchScreenshot()and contractvisualDiffsteps —-uupdates only mutated baselines with zero git churn on unchanged PNGs.npx mp-headless-runtime snapshots --run <runDir>: builds a self-contained offline interactive diff workbench (snapshots-review.htmlwith 3-Up Trio, Curtain Slider, Blink Toggle, and Diff Heatmap) without touchingseal.json.npx mp-headless-runtime snapshots approve --run <runDir> [--id ID1,ID2 | --all] [--dry-run]: promotes approved PNGs to tracked baselines with before/after SHA-256 audit output.
3. Zero-Plaintext Sticky PR Comment Summary Card (pr-comment)
npx mp-headless-runtime pr-comment --run <runDir> [--post --pr N --repo OWNER/REPO]: renders a redacted GFM quality gate card (KPI table, Quality Threshold badges, Failed Cases, Visual Snapshot Diffs + approve commands, AI Suggested Coverage Gaps) and updates existing comments in place via an embedded sticky HTML marker (GET→PATCH/POST).
Install / 安装与升级
- Zero-install CLI:
npx mp-headless-runtime@1.1.0 init - MCP Server (Cursor / Claude Code / Codex):
npx -y mp-headless-runtime@1.1.0 mcp - GitHub Action:
uses: Wangjian-damon/mp-headless-runtime@v1(pinned tov1.1.0) - Air-Gapped Offline Enterprise Bundles: Attached below (
mp-headless-runtime-offline-v1.1.0.zip,.tar.gz, andSHA256SUMS-v1.1.0.txt, zero-network install verified).
v1.0.1 — Zero-Install npx Default Bin, Official MCP Registry OIDC & Zero-404 Live Demo
Patch Highlights (v1.0.1)
Live post-release review fixes making zero-install onboarding and Official MCP Registry distribution work cleanly out of the box:
- Default
npx mp-headless-runtimeBin (package.json): Added"mp-headless-runtime": "src/cli.mjs"topackage.json#binsonpx mp-headless-runtime initandnpx -y mp-headless-runtime mcpwork in any empty directory on npm 10+ with zero prior installation. - Official MCP Registry Live Validation & Automated OIDC Publishing (
server.json,.github/workflows/publish-mcp-registry.yml): Tightenedserver.json#descriptionto 95 chars (<= 100registry limit, verified viamcp-publisher validate server.json) and automatedmcp-publisher login github-oidc && mcp-publisher publish. - Zero-404 Live Demo (
scripts/build-pages-demo.mjs): Added inline SVG favicon so https://wangjian-damon.github.io/mp-headless-runtime/ loads with 0 console errors.
Install & Verify
npx mp-headless-runtime init
# Or MCP server for Cursor / Claude Code / Codex:
npx -y mp-headless-runtime mcp- npm Package: https://www.npmjs.com/package/mp-headless-runtime/v/1.0.1
- SLSA Provenance (Sigstore): https://search.sigstore.dev/?logIndex=4243119001
- Live Interactive Demo: https://wangjian-damon.github.io/mp-headless-runtime/
v1.0.0 — First Stable Release: 3-Stack OSS Verified, Live Report 3.0 Demo, Runnable Examples & Official MCP Registry
First Stable Release (v1.0.0 SemVer Guarantee)
Playwright-grade headless E2E runtime, 4-device UX matrix, interactive Report 3.0 observability, tamper-evident quality gate, and 13-tool AI MCP Server for compiled WeChat Mini Programs (Native WeChat, Taro 3/4, UniApp Vue 2/3) — running read-only on Linux / macOS / Windows CI without WeChat DevTools login.
Live Interactive Demo (Zero Install)
- Demo Hub: https://wangjian-damon.github.io/mp-headless-runtime/
- Interactive Report 3.0 (Route Coverage, SVG Page Flow Graph, 3-Lane Waterfall, Trace Tap Dot, UX Overlay, V8 CPU Hotspots): https://wangjian-damon.github.io/mp-headless-runtime/report-3.0.html
- 4-Device Responsive, Dark & 22px Care Large-Font Matrix: https://wangjian-damon.github.io/mp-headless-runtime/matrix-report.html
Verified End-to-End Across 5 Landmark Open-Source Mini Programs (PASS_BROWSER_VISUAL, Read-Only)
| Project | Stack | Verified Highlights |
|---|---|---|
EastWorld/wechat-app-mall (21.9k★) |
Native WeChat | 97 routes, @vant/weapp, bare require('config.js'), iphone-15-pro capsule navHeight=99 |
wechat-miniprogram/miniprogram-demo (7.2k★) |
Native WeChat | 356 routes, 11 subPackages, accordion expansion & tab switching |
Tencent/tdesign-miniprogram-starter-retail |
Native WeChat | 29 routes, custom-tab-bar, virtual miniprogram_npm → node_modules without DevTools "Build npm" |
taroify/taroify (1.1k★) |
Taro 4.2.1 + React 18 | 74 routes, 6 subPackages, 3,230 compiled files, cross-subPackage nav & dynamic Tabs switching |
feige996/unibest (2.3k★) |
UniApp Vue 3 + Vite 5 | Pinia + UnoCSS + Vue custom TabBar (tabBar.custom: true), 100% route coverage, 0 wx.* gaps |
What's New in v1.0.0
- UniApp
tabBar.custom: trueVirtual No-Op Overlay (src/core/shims/wxml-overlay.mjs): Allows UniApp apps hiding WeChat's native TabBar (without a physicalcustom-tab-bar/index.js) to boot cleanly while keeping.mp-simulated-tabbarsuppressed and artifact SHA-256 unchanged. - Minified Vite UniApp Detection (
src/core/init.mjs): Accurately classifies minifieddist/build/mp-weixinbuilds asUniAppduringnpx mp-headless init. - Official MCP Registry & Latest MCP Protocol (
server.json,package.json#mcpName,src/mcp/server.mjs): Shipsserver.json(io.github.Wangjian-damon/mp-headless-runtime) and supports MCP protocol negotiation up to2025-11-25&2025-06-18. - Runnable 3-Stack Examples (
examples/): Copy-pasteable Native WeChat, Taro.spec.ts, and UniApp Vue 3.spec.tsstarter templates. - SemVer 2.0.0 Stability Contract: Public exports (
mp-headless-runtime,mp-headless-runtime/test,mp-headless-runtime/mcp),types/*.d.ts, CLI commands, contractschemaVersion: 2,seal.jsonattestation format, and all 13 MCP tool names are stable across1.x.
Quick Start (Node 22 LTS / 24 LTS Recommended)
npm install -D mp-headless-runtime@1.0.0
# 30-second onboarding:
npx mp-headless init
# MCP Server for Cursor / Claude Code / Codex:
npx -y mp-headless-runtime mcp- npm Package: https://www.npmjs.com/package/mp-headless-runtime/v/1.0.0
- SLSA Provenance (Sigstore): https://search.sigstore.dev/?logIndex=4242836348
- 3-OS CI Matrix (Ubuntu / macOS / Windows): 92/92 tests PASS
Air-Gapped Offline Enterprise Bundles (SHA256SUMS-v1.0.0.txt)
dcf4a35877081bc219522ec81e0812f4af6cbe4052c2af91a18d2f7f55cd87c3 mp-headless-runtime-offline-v1.0.0.zip
1548530050a37ab752c804a1a2bb52908d1ada3ef6cc612dcdaf5ee090b6c3bf mp-headless-runtime-offline-v1.0.0.tar.gz
v0.21.0 — Real-World OSS Mini Program Compatibility: Zero-DevTools Virtual miniprogram_npm, Bare/Root-Relative Require, custom-tab-bar & Capsule Geometry
Highlights
Field-tested end-to-end (inspect, init, multi-page browser-visual + --ux-audit, and Report 3.0 HTML with zero artifact mutation artifactBefore.sha256 === artifactAfter.sha256) against 3 landmark open-source WeChat Mini Programs:
EastWorld/wechat-app-mall(21.9k★, 97 routes, 5 subpackages,@vant/weapp+apifm-wxapi, barerequire('config.js'), custom navbar)wechat-miniprogram/miniprogram-demo(7.2k★, 356 routes, 11 subpackages, Tencent official showcase)Tencent/tdesign-miniprogram-starter-retail(29 routes, 5 subpackages,custom-tab-bar,tdesign-miniprogram— running directly fromnode_moduleswithout WeChat DevTools "构建 npm"!)
Added & Fixed
- Zero-DevTools Virtual
miniprogram_npmOverlay (src/core/shims/module-overlay.mjs,wxml-overlay.mjs,wxss-projector.mjs):- Read-only in-memory
createVirtualNpmResolver()maps missingminiprogram_npm/<pkg>/...(and<subpkg>/miniprogram_npm/<pkg>/...) tonode_modules/<pkg>/<pkg.miniprogram || pkg.main || .>for both scoped (@scope/pkg) and unscoped packages. - Native WeChat Mini Programs can now run directly on Linux CI after
npm ciwithout ever opening WeChat DevTools to click "构建 npm", while strictly keeping the artifact directory untouched.
- Read-only in-memory
- WeChat Bare Local & Root-Relative JS Specifier Normalization (
src/core/shims/module-overlay.mjs,wxml-overlay.mjs):- Normalizes verified WeChat bare local (
require('config.js'),require('utils/auth')) and root-relative (require('/utils/auth'),import cfg from '/config.js',require.async('/...')) specifiers to canonical./or../in memory — preserving singletonmoduleCacheidentity and never shadowingminiprogram_npmpackages.
- Normalizes verified WeChat bare local (
custom-tab-barVisual Projection & Chrome Fidelity (wxss-projector.mjs,browser-visual.mjs):- Suppresses synthetic
.mp-simulated-tabbarwhenapp.jsondeclarestabBar.custom === trueand automatically projectscustom-tab-bar/index.wxsstogether with its transitiveusingComponentsstyles.
- Suppresses synthetic
- Notch/Tablet Capsule Geometry & Built-In
wx.*Runtime APIs (runtime-wx-shims.mjs,sdk.mjs):- Populates
systemInfo.statusBarHeight,fontSizeSetting, andtheme, and dynamically alignswx.getMenuButtonBoundingClientRect()withstatusBarHeight&windowWidth(iphone-15-pro:statusBarHeight: 59,menuButton.top: 63,navHeight: 99). - Adds built-in shims for
wx.getExtConfigSync,wx.getExtConfig,wx.getAccountInfoSync,wx.getNetworkType,wx.onNetworkStatusChange/off,wx.getUserInfo,wx.createInnerAudioContext, TabBar APIs (setTabBar*,showTabBar*,hideTabBar*,removeTabBarBadge), and Share Menu APIs (showShareMenu,hideShareMenu,updateShareMenu). - Forwards
device,viewport,deviceScaleFactor,colorScheme,fontScale, andplaywrightTracefromcreateSuite().run()when using string'browser-visual'or'hybrid'providers.
- Populates
Install & Verification
npm install -D mp-headless-runtime@0.21.0
# Or 30-second zero-config onboarding:
npx mp-headless init- npm Package: https://www.npmjs.com/package/mp-headless-runtime/v/0.21.0
- SLSA Provenance (Sigstore): https://search.sigstore.dev/?logIndex=4226422640
- 3-OS CI Matrix (Ubuntu / macOS / Windows): 88/88 tests PASS
Offline Air-Gap Bundles (SHA256SUMS-v0.21.0.txt)
7c635e22c71949569daae09d4155259507d26a560012f2d4d9ebfbb53a0a493f mp-headless-runtime-offline-v0.21.0.zip
5878613ef249a93e6086ddeaf9f5b30691d711ad2dd02ec19708b4b0ce0e9e8d mp-headless-runtime-offline-v0.21.0.tar.gz
mp-headless-runtime v0.20.0
🚀 mp-headless-runtime v0.20.0 — Report 3.0 质量门禁阈值、AI 覆盖率自补闭环与火焰图热点加速
✨ 核心升级 (Highlights)
- 🛡️ Report 3.0 可卡点 CI 质量门禁阈值:在
mp-test.config.mjs、CLI(run/test/gate/merge-reports/policy)、SDKevaluateGate()及 MCPmp_verify_gate全链路支持 4 项可选硬门禁:minRouteCoverage(--min-route-coverage N):路由覆盖率低于N%阻断放行;minUxScore(--min-ux-score N):UX 平均分低于N阻断(未开启 UX 审计时诚实报UX_AUDIT_REQUIRED_FOR_THRESHOLD);maxUxErrors(--max-ux-errors N):UX 严重问题超过上限阻断;failOnPerfWarnings(--fail-on-perf-warnings):检出redundant-setdata/duplicate-network-request/serial-request-waterfall/ 超大或高频setData即阻断;- 门禁明细自动输出到
gate.json、pr-summary.md与ai-summary.json。
- 🤖 AI 覆盖率自补闭环与 MCP 性能分项输出:
ai-summary.json与mp_verify_gate自动返回按分包归类的suggestedCoverageTests[]、qualityThresholds、gateReasons与定向nextActions,让 Cursor / Claude Code / Codex 看到覆盖率缺口后直接补齐用例;mp_ux_audit新增结构化perfAudit分项(redundantSetDataCount、duplicateRequestCount、serialWaterfallCount、issues[])。
- ⚡ 火焰图驱动的热路径性能加速(实测活跃 JS CPU -12.4%):
- 针对自家
--cpu-profile抓出的真实热点,为redaction.mjs敏感键判定增加 4096 项有界缓存、预编译正则与数学无损快路径,为observability.mjs路由 WXML 绑定解析增加按 Run 生命周期的WeakMap缓存(全量脱敏语义 100% 零回归,9 用例 Taro 套件活跃 CPU 由2524ms降至2211ms,Ubuntu 三端 CI 由3m17s提速至2m49s)。
- 针对自家
📦 安装 / 离线包下载
npm install -D mp-headless-runtime@0.20.0
npx mp-headless init- npm(带 SLSA Provenance 认证):https://www.npmjs.com/package/mp-headless-runtime/v/0.20.0
- 内网纯离线包:见下方 Assets 中的
mp-headless-runtime-offline-v0.20.0.zip/.tar.gz与SHA256SUMS-v0.20.0.txt。
mp-headless-runtime v0.19.0
🚀 mp-headless-runtime v0.19.0 — Report 3.0 专业可视化与 MiniTest 级性能体检
✨ 核心亮点 (Highlights)
- 🧭 页面路由覆盖率(Route Coverage):自动比对
app.json主包与分包声明路由 vs 实际执行路由,同步输出到report.html、ai-summary.json与pr-summary.md(支持多 Shard 分片合并)。 - 🗺️ 内联 SVG 页面交互流转图(Page Flow Graph):零外部依赖实时聚合跨页跳转链路、触发动作(
tap/switchTab/back)、访问次数与均耗时。 - ⏱️ Steps +
wx.request+setData三泳道毫秒瀑布图:为 Mock 与透传请求统一记录真实耗时,并精确统计单 KeysetData字节数,同屏对齐渲染三泳道时间轴。 - 🔍 对标微信 MiniTest 的 3 项性能审计规则:新增
redundant-setdata(精准跳过 Taro/UniApp 框架内部键)、duplicate-network-request、serial-request-waterfall。 - 🔥 按需 V8 CPU 热点剖析(
--cpu-profile):基于 Node 内置node:inspector/promises,默认关闭零开销;开启后导出标准 Chrome DevTools / Speedscope.cpuprofile火焰图并在报告内渲染热点函数条形图。
📦 安装 / 离线包下载
npm install -D mp-headless-runtime@0.19.0
npx mp-headless init- npm(带 Sigstore Provenance 认证):https://www.npmjs.com/package/mp-headless-runtime/v/0.19.0
- 内网无外网离线包:见下方 Assets 中的
mp-headless-runtime-offline-v0.19.0.zip/.tar.gz与SHA256SUMS-v0.19.0.txt。