taro-bluetooth-print 2.15.1 → 2.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +57 -123
  2. package/README.md +1 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.15.2] - 2026-07-07
4
+
5
+ ### Changed
6
+
7
+ - ** Discussions 入口改造** — 因 GitHub Discussions 页面当前为空,正式文档中讨论入口改为 docs 内页面:`https://agions.github.io/taro-bluetooth-print/guide/discussions`
8
+ - README.md: `💬 讨论` 链接改为 docs 页面
9
+ - docs/roadmap.md: GitHub Discussions 链接改为 docs 页面
10
+ - 新增 docs/guide/discussions.md:整合社区渠道说明、Issue 报告规范、PR 规范、行为准则
11
+
12
+ ---
13
+
3
14
  ## [2.15.1] - 2026-07-07
4
15
 
5
16
  ### Fixed
@@ -16,6 +27,45 @@
16
27
 
17
28
  ---
18
29
 
30
+ ## [2.15.0] - 2026-07-07
31
+
32
+ ### Added
33
+
34
+ - **Professional Documentation Redesign** — Complete visual overhaul of docs site with custom brand identity
35
+ - 6 new SVG logo variants (primary, mark, dark, wordmark, OG cover, hero banner)
36
+ - Reimagined docs landing page with hero banner, feature cards, and compatibility matrix
37
+ - Full Mermaid architecture diagrams (6-layer system, connection sequence, print flow)
38
+ - **Online Documentation Link** — `homepage` and `documentation` fields added to `package.json`
39
+ - Live docs: https://agions.github.io/taro-bluetooth-print/
40
+
41
+ ### Changed
42
+
43
+ - **README.md** — Hero section with brand badges, 4 why-choose cards, architecture mermaid diagram, 8×7 platform compatibility matrix, error handling pattern guide, and plugin ecosystem section (360 → 443 lines)
44
+ - **docs/index.md** — VitePress hero with `hero-banner.svg`, 6 feature cards, full protocol×platform matrix, 6 highlight cards with hover effects (154 → 305 lines)
45
+ - **docs/guide/architecture.md** — Added mermaid `flowchart TD` (6-layer architecture), `sequenceDiagram` (connection flow + print flow), detailed layer responsibility table
46
+ - **docs/.vitepress/config.ts** — Updated SEO meta tags, OG image (`og-cover.svg`), brand theme color (`#6366f1`)
47
+ - **Brand Identity** — Unified design language: indigo → cyan gradient (`#4338ca` → `#6366f1` → `#0891b2`), rounded-receipt motif, Bluetooth waveform arcs, 7×7 QR matrix
48
+
49
+ ### Assets
50
+
51
+ | File | Size | Purpose |
52
+ |:---|:---|:---|
53
+ | `docs/public/logo.svg` | 240×240 | Primary logo (gradient plate + receipt + BT arcs) |
54
+ | `docs/public/logo-mark.svg` | 64×64 | Compact icon-only variant |
55
+ | `docs/public/logo-dark.svg` | 240×240 | Dark background variant |
56
+ | `docs/public/wordmark.svg` | 560×96 | Horizontal logo with tagline |
57
+ | `docs/public/og-cover.svg` | 1200×630 | Social sharing card |
58
+ | `docs/public/hero-banner.svg` | 1600×400 | Docs landing page hero |
59
+ | `docs/public/favicon.svg` | 32×32 | Browser tab favicon (redesigned) |
60
+
61
+ ### Documentation
62
+
63
+ - All SVG assets are inline-path (0 external dependencies)
64
+ - Docs build time: 19.3s, 0 errors
65
+ - Mermaid diagrams render correctly in VitePress
66
+
67
+ ---
68
+
19
69
  ## [2.14.0] - 2026-07-07
20
70
 
21
71
  ### Changed
@@ -65,126 +115,10 @@
65
115
 
66
116
  7 个 conventional commits 落地 (`be2fbdc..06f5ede`):
67
117
 
68
- 1. `refactor(core): simplify BluetoothPrinter & CommandBuilder`
69
- 2. `refactor(services): dedup ConnectionManager + PrintJobManager`
70
- 3. `refactor(adapters): deduplicate mini-program adapters and BaseAdapter imports`
71
- 4. `refactor: enforce PascalCase file naming for class-bearing modules`
72
- 5. `refactor: remove @ts-expect-error and dead code`
73
- 6. `refactor(errors): deduplicate error-code mapping tables`
74
- 7. `chore: update import paths after PascalCase file renames`
75
-
76
- ---
77
-
78
- ## [2.13.0] - 2026-05-27
79
-
80
- ### Changed
81
-
82
- - **架构精简**: 移除过度工程的 DI 容器系统(Container、Tokens、ServiceProvider、di-factory),约 1,048 行冗余代码
83
- - **事件系统统一**: 移除冗余的 EventBus,统一使用类型安全的 EventEmitter
84
- - **插件系统统一**: 移除冗余的 core/plugin PluginManager,保留 plugins/PluginManager
85
- - **代码重复消除**: 重复率从 0.57% 降至 0%(8 个克隆 → 0 个)
86
- - TemplateRenderer 提取 `buildTableSeparatorLine` 和 `renderFillLines` 辅助方法
87
- - CpclDriver/ZplDriver 提取 `barcode-helpers.ts` mixin 模式
88
- - BaseAdapter 统一重导出共享依赖,消除 ReactNativeAdapter 重复导入
89
- - PreviewRenderer 合并 handleESC/handleGS 为 `handleControlSequence`
90
- - gbk-lite.ts 数据去重(582 → 106 条目,减少 81.8%)
91
- - **类型安全提升**: 类型断言从 124 处降至 73 处
92
- - EventEmitter 内部存储改用映射类型,消除 10+ 类型断言
93
- - 消除所有 `as` 类型转换中的不必要断言
94
- - **错误处理改进**: 修复 6 处空 catch 块,所有异常均记录日志
95
- - CloudPrintManager、QRCodeDiscoveryService、PrinterStatus、PrintScheduler
96
- - **魔法数字提取**: 8 个硬编码数字提取为命名常量
97
- - `DEFAULT_HEARTBEAT_INTERVAL`、`DEFAULT_RECONNECT_INTERVAL`、`DEFAULT_CONNECTION_TIMEOUT`
98
- - `DEFAULT_RETRY_BASE_DELAY`、`DEFAULT_RETRY_MAX_DELAY`、`MAX_TIMEOUT_MS`
99
- - **工厂模式简化**: 移除 `PrinterFactory` 对象包装,保留 `createBluetoothPrinter` 和 `createWebBluetoothPrinter` 函数
100
-
101
- ### Removed
102
-
103
- - 删除 `src/core/di/` 目录(Container.ts、Tokens.ts、index.ts)
104
- - 删除 `src/core/event/` 目录(EventBus.ts、index.ts)
105
- - 删除 `src/core/plugin/` 目录(PluginManager.ts、index.ts)
106
- - 删除 `src/providers/` 目录(ServiceProvider.ts、index.ts)
107
- - 删除 `src/factory/di-factory.ts`
108
- - 删除 5 个对应的测试文件
109
- - 删除根目录多余报告文档(ARCHITECTURE_ANALYSIS.md、CODE_DUPLICATION_REPORT.md、RELEASE_v2.9.6.md)
110
-
111
- ### Added
112
-
113
- - 新增 `src/drivers/barcode-helpers.ts` — 条码便捷方法 mixin
114
- - BaseAdapter 新增共享依赖重导出
115
-
116
- ### Testing
117
-
118
- - 1,102 tests passed, 38 skipped, 0 regressions
119
- - type-check: 0 errors
120
- - build: 通过
121
- - 代码重复率: 0%(jscpd 检测)
122
-
123
- ### Performance
124
-
125
- - 源代码: 25,828 行 → 24,687 行(-1,141 行,-4.4%)
126
- - 源文件: 96 个 → 84 个(-12 个)
127
- - 构建产物: 631 KB(gzip 231 KB)
128
-
129
- ---
130
-
131
- ## [2.12.0] - 2026-05-25
132
-
133
- ### Changed
134
-
135
- - **代码质量优化**: 全面消除 ESLint 错误和警告
136
- - **测试覆盖率提升**: 从 64% 提升至 80.87%
137
- - **Bug 修复**: sendAudioData 无限循环(catch 块缺少 break)
138
-
139
- ### Testing
140
-
141
- - 434 tests passed
142
- - coverage: 80.87%
143
-
144
- ---
145
-
146
- ## [2.11.0] - 2026-05-04
147
-
148
- ### Changed
149
-
150
- - **错误体系统一**: 将 14 处 `throw new Error()` 迁移为 `BluetoothPrintError` + `ErrorCode`,覆盖 ReactNativeAdapter、DeviceManager、PrinterConfigManager、PrinterFactory、PreviewRenderer、PrintQueue、CloudPrintManager、PrintJobManager、PrintScheduler、image.ts
151
- - **DiscoveryService.ts**: 移除顶部 3 条 eslint-disable 规则,清理注释代码
152
- - **TemplateRenderer.ts**: `itemData: any` → `Record<string, unknown>`,移除 3 处行内 eslint-disable
153
- - **outputLimiter.ts**: batchProcess 错误处理规范化(instanceof Error 守卫 + message 输出)
154
- - **魔数提取**: ChunkWriteStrategy 提取 7 个常量(CHUNK_SIZE_STEP、DELAY_BACKOFF_FACTOR 等),PrintHistory 提取 DEFAULT_MAX_ENTRIES,TemplateRenderer/TemplateEngine 提取 DEFAULT_PAPER_WIDTH
155
-
156
- ### Added
157
-
158
- - 新增 ErrorCode: `QUEUE_FULL`、`QUEUE_JOB_NOT_FOUND`、`PREVIEW_FAILED`
159
-
160
- ### Testing
161
-
162
- - 985 tests passed, 38 skipped, 0 regressions
163
- - type-check: 0 errors
164
- - lint: 0 errors
165
-
166
- ---
167
-
168
- All notable changes to this project will be documented in this file.
169
-
170
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
171
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
172
-
173
- ---
174
-
175
- ## [2.10.2] - 2026-05-02
176
-
177
- ### Fixed
178
-
179
- - **代码质量优化 — 消除所有 ESLint 错误** (#37 → 0)
180
- - 移除 3 个文件顶部 `eslint-disable`(共 18 条规则绕过)
181
- - 修复所有非空断言 (`!`) — `Uint8Array[i]!`、`parts[x]!`、`job.nextRunTime!` 等
182
- - 修复所有 `any` 类型绕过 — `as string` 改为 `typeof` 运行时检查
183
- - JSON.parse 结果改用 `as Record<string, unknown>` + 类型守卫访问
184
- - 异步方法 `void` → `await`,消除 `require-await` 错误
185
- - `Record<string, any>` → `Record<string, unknown>`
186
- - 消除 `no-base-to-string`:`String(value)` → `JSON.stringify(value)`
187
- - 消除 `no-unused-vars`:废弃变量改为 `void timeout`
188
- - **零 ESLint 警告/错误、零非空断言、零行内 eslint-disable 残留**
189
-
190
- ---
118
+ - `2fc1f2d` refactor(core): simplify BluetoothPrinter & CommandBuilder
119
+ - `27fdd6a` refactor(services): dedup ConnectionManager + PrintJobManager
120
+ - `c6adaf6` refactor(adapters): deduplicate mini-program adapters and BaseAdapter imports
121
+ - `2bf28f6` refactor: enforce PascalCase file naming for class-bearing modules
122
+ - `6dfe1c5` refactor: remove @ts-expect-error and dead code
123
+ - `8e9193d` refactor(errors): deduplicate error-code mapping tables
124
+ - `06f5ede` chore: update import paths after PascalCase file renames
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  [![stars](https://img.shields.io/github/stars/agions/taro-bluetooth-print?style=flat-square&label=⭐+Stars)](https://github.com/agions/taro-bluetooth-print)
16
16
  [![CI](https://img.shields.io/github/actions/workflow/status/agions/taro-bluetooth-print/ci.yml?style=flat-square&label=CI)](https://github.com/agions/taro-bluetooth-print/actions)
17
17
 
18
- [🚀 快速开始](#-快速开始) · [📖 完整文档](https://agions.github.io/taro-bluetooth-print/) · [🧩 在线示例](https://github.com/Agions/taro-bluetooth-print/tree/main/examples) · [💬 讨论](https://github.com/Agions/taro-bluetooth-print/discussions)
18
+ [🚀 快速开始](#-快速开始) · [📖 完整文档](https://agions.github.io/taro-bluetooth-print/) · [🧩 在线示例](https://github.com/Agions/taro-bluetooth-print/tree/main/examples) · [💬 讨论](https://agions.github.io/taro-bluetooth-print/guide/discussions)
19
19
 
20
20
  </div>
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taro-bluetooth-print",
3
- "version": "2.15.1",
3
+ "version": "2.15.2",
4
4
  "description": "Taro 蓝牙打印库 v2.6 - 轻量级、高性能、跨平台支持微信、支付宝、百度、字节跳动小程序及H5 Web Bluetooth",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",