Skip to content

Releases

mp-headless-runtime v1.1.0 — Visual Snapshot Approval CLI, First-Party GitHub Action & Sticky PR Summary

Choose a tag to compare

@github-actions github-actions released this 04 Dec 05:40

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 -u shorthand for changed) across both expect(page|locator).toMatchScreenshot() and contract visualDiff steps — -u updates 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.html with 3-Up Trio, Curtain Slider, Blink Toggle, and Diff Heatmap) without touching seal.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 to v1.1.0)
  • Air-Gapped Offline Enterprise Bundles: Attached below (mp-headless-runtime-offline-v1.1.0.zip, .tar.gz, and SHA256SUMS-v1.1.0.txt, zero-network install verified).

v1.0.1 — Zero-Install npx Default Bin, Official MCP Registry OIDC & Zero-404 Live Demo

Choose a tag to compare

@github-actions github-actions released this 04 Dec 03:38

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-runtime Bin (package.json): Added "mp-headless-runtime": "src/cli.mjs" to package.json#bin so npx mp-headless-runtime init and npx -y mp-headless-runtime mcp work 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): Tightened server.json#description to 95 chars (<= 100 registry limit, verified via mcp-publisher validate server.json) and automated mcp-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

v1.0.0 — First Stable Release: 3-Stack OSS Verified, Live Report 3.0 Demo, Runnable Examples & Official MCP Registry

Choose a tag to compare

@github-actions github-actions released this 04 Dec 03:20

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)

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: true Virtual No-Op Overlay (src/core/shims/wxml-overlay.mjs): Allows UniApp apps hiding WeChat's native TabBar (without a physical custom-tab-bar/index.js) to boot cleanly while keeping .mp-simulated-tabbar suppressed and artifact SHA-256 unchanged.
  • Minified Vite UniApp Detection (src/core/init.mjs): Accurately classifies minified dist/build/mp-weixin builds as UniApp during npx mp-headless init.
  • Official MCP Registry & Latest MCP Protocol (server.json, package.json#mcpName, src/mcp/server.mjs): Ships server.json (io.github.Wangjian-damon/mp-headless-runtime) and supports MCP protocol negotiation up to 2025-11-25 & 2025-06-18.
  • Runnable 3-Stack Examples (examples/): Copy-pasteable Native WeChat, Taro .spec.ts, and UniApp Vue 3 .spec.ts starter 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, contract schemaVersion: 2, seal.json attestation format, and all 13 MCP tool names are stable across 1.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

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

Choose a tag to compare

@github-actions github-actions released this 03 Dec 07:49

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, bare require('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 from node_modules without WeChat DevTools "构建 npm"!)

Added & Fixed

  • Zero-DevTools Virtual miniprogram_npm Overlay (src/core/shims/module-overlay.mjs, wxml-overlay.mjs, wxss-projector.mjs):
    • Read-only in-memory createVirtualNpmResolver() maps missing miniprogram_npm/<pkg>/... (and <subpkg>/miniprogram_npm/<pkg>/...) to node_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 ci without ever opening WeChat DevTools to click "构建 npm", while strictly keeping the artifact directory untouched.
  • 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 singleton moduleCache identity and never shadowing miniprogram_npm packages.
  • custom-tab-bar Visual Projection & Chrome Fidelity (wxss-projector.mjs, browser-visual.mjs):
    • Suppresses synthetic .mp-simulated-tabbar when app.json declares tabBar.custom === true and automatically projects custom-tab-bar/index.wxss together with its transitive usingComponents styles.
  • Notch/Tablet Capsule Geometry & Built-In wx.* Runtime APIs (runtime-wx-shims.mjs, sdk.mjs):
    • Populates systemInfo.statusBarHeight, fontSizeSetting, and theme, and dynamically aligns wx.getMenuButtonBoundingClientRect() with statusBarHeight & 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, and playwrightTrace from createSuite().run() when using string 'browser-visual' or 'hybrid' providers.

Install & Verification

npm install -D mp-headless-runtime@0.21.0
# Or 30-second zero-config onboarding:
npx mp-headless init

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

Choose a tag to compare

@github-actions github-actions released this 03 Dec 07:01

🚀 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)、SDK evaluateGate() 及 MCP mp_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

mp-headless-runtime v0.19.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 05:48

🚀 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 与透传请求统一记录真实耗时,并精确统计单 Key setData 字节数,同屏对齐渲染三泳道时间轴。
  • 🔍 对标微信 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