fix(admin): ship the color picker styles in the naive-ui bundle

工单状态弹窗的取色器糊成一团、像代码而不是颜色预览,根因不在页面代码:
extract-naive-styles.mjs 把取色器样式路径写成了
color-picker/src/styles/indexcode/index.cssr.mjs,该路径不存在,
import 抛 ERR_MODULE_NOT_FOUND 后被 catch 静默计数跳过,于是
build/naive-ui.css 里一条 .n-color-picker 规则都没有——组件没有边框、
没有高度、没有棋盘格色块,但页面不报错。

- 修正 color-picker 与 input-otp 的样式路径(两处都误写成 indexcode)
- catch 改为显式报出路径不存在与模块结构异常,避免同类问题再次无声滑过

提取结果:成功 42 → 44,跳过 22 → 20,CSS 195.0 KB → 197.0 KB。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-26 21:15:21 +08:00
1 parent 44fa34fdff
commit d53d86332a
2 files changed
+12 -4

No files matched your search

+11 -3
View File
@@ -86,13 +86,13 @@ const COMPONENT_STYLES = [
['tree-select/src/styles/index.cssr.mjs'],
['tree/src/styles/index.cssr.mjs'],
['thing/src/styles/index.cssr.mjs'],
['color-picker/src/styles/indexcode/index.cssr.mjs'],
['color-picker/src/styles/index.cssr.mjs'],
['typography/src/styles/index.cssr.mjs'],
['auto-complete/src/styles/index.cssr.mjs'],
['cascader/src/styles/index.cssr.mjs'],
['dynamic-input/src/styles/index.cssr.mjs'],
['dynamic-tags/src/styles/index.cssr.mjs'],
['input-otp/src/styles/indexcode/index.cssr.mjs'],
['input-otp/src/styles/index.cssr.mjs'],
// 过渡动画
['_styles/transitions/fade-in-width-expand.cssr.mjs'],
['_styles/transitions/fade-in-height-expand.cssr.mjs'],
@@ -138,7 +138,15 @@ async function extractStyles() {
}
}
} catch (err) {
// 某些路径可能不存在或结构不同,跳过但不中断
const code = err && err.code
// 路径写错时 import 会直接抛 MODULE_NOT_FOUND。这类错误必须显式报出来:
// 静默跳过的后果是组件样式整体缺失(取色器曾因此没有尺寸和边框,糊成一团),
// 而页面不报错,只能靠肉眼发现。
if (code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND') {
console.error(`[AKSRT] 样式路径不存在,已跳过: ${componentPath}`)
} else {
console.error(`[AKSRT] 样式提取异常,已跳过: ${componentPath}: ${err && err.message}`)
}
failCount++
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"generated_at": "2026-10-26T12:40:28+00:00",
"generated_at": "2026-10-26T13:10:51+00:00",
"errors": [],
"warnings": [
"customPage tools-update section 'tools/update' not in PHP schema (ok if pure operational page)",