docs(scripts): explain build and icon generation boundaries

This commit is contained in:
2026-11-12 16:59:23 +08:00
parent 22638dd4ac
commit 0ea53f177f
4 changed files with 8 additions and 0 deletions
+2
View File
@@ -5,6 +5,7 @@
// App-only extension for the pinned @xyflow/react 12.12.1 ESM renderer. This
// transforms compiler input; shared node_modules and the headless SDK are untouched.
// 读取安装包版本,固定12.12.1;库升级必须人工审查目标实现,不能凭相同函数名继续替换。
// require 在 loader 模块求值时读取一次版本,不在每个输入转换时重新扫描安装目录。
const version = require('@xyflow/react/package.json').version;
/** webpack/Turbopack loader接收源码并返回改写后的源码;任何版本或锚点不符立即失败,防止悄悄失去保留能力。 */
module.exports = function retainVisibility(source) {
@@ -20,6 +21,7 @@ module.exports = function retainVisibility(source) {
}
// 节点追加未hidden且显式保留的ID并Set去重;边以保留标记或原可见判断二选一,维持原生索引。
// 最后一处改为空数组不订阅完整选择集合,减少无选择监听时的不必要全图selector工作。
// 返回新字符串,不写磁盘;锚点检查只确认当前四段文本的形状,不证明升级后所有语义仍等价。
return source
.replace(nodes, `Array.from(new Set([
...${nodes},