This repository had no CI and no dependabot, while the settings page under webview2/settings/ime-settings is a Vite and TypeScript project that the Windows release workflow builds. Until now pnpm build only ever ran while cutting a release, so a break here surfaced at the worst possible moment. pnpm-workspace.yaml declared only onlyBuiltDependencies. pnpm 10 honours that key, which is why releases worked, but pnpm 11 reads allowBuilds instead: it refuses to run esbuild's postinstall, exits 1, and rewrites the file with a "set this to true or false" placeholder. So pnpm install --frozen-lockfile fails outright for anyone on a current pnpm. Declaring allowBuilds alongside the existing key satisfies both, verified against 10.34.5 and 11.25.0. packageManager pins the pnpm version so a local checkout and CI agree through corepack. dependabot now covers npm as well as actions. The template used across the other repositories only declares github-actions and gitsubmodule, so the settings page dependencies were unwatched: they sit one to two majors behind, with typescript at 5.9 against 7.0 and vite at 7.2 against 8.2. Those bumps are left to dependabot rather than done here. The README described only the symlink debug trick, through one developer's absolute paths, and never mentioned that the settings page has to be built at all.
Metasequoia IME UI HTML
水杉输入法 Windows 端的界面资源。Server 加载这里的页面来渲染候选窗、悬浮工具栏、托盘菜单和设置窗口。
配套仓库:MSIME-Windows(TSF 前端)、MSIME-Server(后端与窗口宿主)。
目录
| 路径 | 内容 |
|---|---|
webview2/candwnd/ |
候选窗,含 skins/ 下的皮肤 |
webview2/ftb/ |
悬浮工具栏 |
webview2/menu/ |
托盘菜单 |
webview2/settings/ime-settings/ |
设置页,唯一需要构建的部分,Vite + TypeScript |
webview2/default-themes/、webview2/other-themes/ |
主题 |
sciter/ |
旧 Sciter 渲染后端的资源,当前默认后端是 WebView2 |
除设置页外都是直接分发的静态资源,改完即生效。
构建设置页
设置页是发布安装包的必要输入之一,pnpm build 的产物 dist/ 会被打包脚本收集。
cd webview2/settings/ime-settings
corepack enable
pnpm install --frozen-lockfile
pnpm build
pnpm 版本由 package.json 的 packageManager 字段固定,corepack enable 之后不用自己装。开发时用 pnpm dev 起本地服务。
本地调试
把本仓链接到 Server 的数据目录,改页面就不用重新打包:
$target = Join-Path $env:LOCALAPPDATA 'metasequoiaime\html'
if (Test-Path -LiteralPath $target) {
Remove-Item -LiteralPath $target -Recurse -Force
}
New-Item -ItemType SymbolicLink -Path $target -Target (Resolve-Path .).Path
必须用绝对路径,Resolve-Path 就是用来把当前目录转成绝对路径的。设置页走这条路时链接的仍是仓库目录,页面读的是 webview2/settings/ime-settings/dist/,所以改完设置页要重新 pnpm build。
与 C++ 侧的边界
窗口归 Server,页面归本仓。HWND、尺寸、位置、DPI、Z-order 和 WebView2 controller 的生命周期都在 MSIME-Server/src/window/ 与 src/webview2/;页面结构、样式和浏览器端交互在这里。
C++ → 页面主要经 WebView2 导航和脚本执行,页面 → C++ 经 window.chrome.webview.postMessage(...)。改消息 type、JSON 字段、页面导出的 JS 函数或 DOM 标识时,必须同步检查 Server 的消息解析与拼接代码,两边没有编译期约束。
候选内容和输入状态的权威在 Server 和引擎,页面只负责展示与发出用户动作;不要在页面侧复制候选选择、翻页、输入模式或配置持久化的状态机。
完整的跨仓约定见 MSIME-Windows 的 AGENTS.md。