Repository navigation
P2: 控制台 console.js / console.css 改为可读源码 - #17
Merged
Merged
Conversation
- 以 Prettier 3.7.4 格式化(.prettierrc.json),JS 语法树与原文件一致,CSS 仅写法差异 - 按原样内嵌,不加压缩步骤:页面约增 17 KB - Node 测试按唯一标记切片,标记缺失时直接失败;CI 检查两文件格式
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
插件控制台的
internal/bridge/ui/console.js、console.css原为长行手写压缩风格(JS 最长一行 1,709 字符,CSS 最长 4,024 字符),难以审阅和维护。本 PR 只改格式,不改行为。改动
.prettierrc.json:单引号、宽 100、LF)。JS 266 → 1,574 行,CSS 16 → 1,854 行。npx prettier@3.7.4 --check,避免回到长行写法;README「开发与验证」说明格式化命令。between()按唯一标记切片:标记缺失或重复时直接失败。原先indexOf返回 -1 会静默截取错误片段。等价性证据
prettier --debug-check通过。[data-theme=dark]→[data-theme='dark']、.45→0.45),含义相同。关于「打包时再压缩」
实测格式化后两文件共增加 16,842 B(控制台页面约 +17 KB,动态库约 +0.1%)。控制台通过 CPA 管理接口在本机或内网提供,且
Cache-Control: no-store。若在四平台构建(含 manylinux 容器)中加入 Node 压缩工具,发布内容会与测试源码不同,构建也要多一个依赖。权衡后未加压缩步骤,按原样内嵌;如仍需压缩可另开 PR。验证
go test ./internal/... ./cmd/...通过。console_preview.py中登录并切换五页,无全局错误;与格式化前的 v0.2.13 构建逐页截图对比(1265×712):设置页 0 像素差异,其余四页差异仅为夹具时间戳和一次登录提示气泡。不涉及版本号,不需要发版。