# tools 网页工程化拆分 Spec ## Why `tools/` 目录下 4 个核心文件(`app.js` 2371 行、`ble_ota.js` 1658 行、`can.js` 1526 行、`style.css` 2146 行)体积过大,单文件承载多重职责,难以维护和导航。`index.html` 还内联了 ~250 行胶水脚本。需要按职责拆分为小文件工程,提升可维护性。 ## What Changes - 将 `style.css` 拆分为 5 个按职责划分的 CSS 文件(base / layout / components / can / responsive) - 将 `app.js` 拆分为 8 个 ES Module(ota/session、progress、stages、file-handle、upload-esp32、upload-gd32、spi、console-mode)+ 公共模块 - 将 `ble_ota.js` 拆分为 8 个 ES Module(ble/constants、state、stages、gatt、file、transfer、verify、session) - 将 `can.js` 拆分为 5 个 ES Module(can/dbc、messages、signals、send、feedback) - 抽取 `index.html` 内联 `