#!/usr/bin/env node /** * D27: health-report.vue 健康报告页清理 (debt 51 -> 0) * SVG 属性色绑定 data;script 指标色/canvas 色收编 BrandColors */ const fs = require('fs'); const F = 'pages/body-detail/health-report.vue'; let src = fs.readFileSync(F, 'utf8'); let replaced = 0; function repl(from, to) { const cnt = src.split(from).length - 1; if (cnt === 0) { console.warn('NOT FOUND: ' + from.slice(0, 100)); return; } src = src.split(from).join(to); replaced += cnt; } // ---- 1. import ---- if (!src.includes('utils/brand-colors.js')) { const m = src.match(/