gbu-accessibility-package 3.12.0 → 3.13.0

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Changed
11
+ - **BREAKING**: Package is now check/report-only and never modifies source files
12
+ - Removed destructive features including backup creation, cleanup mode, meta auto-fix, heading auto-fix, and unused-file deletion
13
+ - Reworked CLI and documentation around `AccessibilityChecker` and dry-run-only behavior
14
+
15
+ ### Added
16
+ - Added `AccessibilityChecker` export for the new public API
17
+ - Kept `AccessibilityFixer` export in compatibility mode, but locked it to check-only behavior
18
+ - Added safer unused-files list preview workflow instead of delete behavior
19
+
20
+ ### Fixed
21
+ - **Unused file reference matching**: `--unused-files` now ignores query strings and hash fragments like `style.css?hash` and `bundle.js#v1`
22
+ - Added coverage to ensure legacy fix/delete code paths can no longer modify project files
23
+
8
24
  ## [3.8.3] - 2025-10-06
9
25
 
10
26
  ### Added
@@ -265,4 +281,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
265
281
 
266
282
  ---
267
283
 
268
- For more details about any release, see the [GitHub Releases](https://github.com/example/gbu-accessibility-tool/releases) page.
284
+ For more details about any release, see the [GitHub Releases](https://github.com/example/gbu-accessibility-tool/releases) page.
package/QUICK_START.md CHANGED
@@ -1,175 +1,32 @@
1
- # 🚀 Quick Start Guide
1
+ # Quick Start
2
2
 
3
- Hướng dẫn nhanh để sử dụng GBU Accessibility Package trong 5 phút.
3
+ GBU Accessibility Package is a check-and-report tool.
4
4
 
5
- ## ⚡ Cài đặt nhanh
5
+ ## Install
6
6
 
7
7
  ```bash
8
- # 1. Cài đặt global (khuyến nghị)
9
8
  npm install -g gbu-accessibility-package
10
-
11
- # 2. Hoặc cài đặt local
12
- npm install gbu-accessibility-package
13
-
14
- # 3. Chạy ngay!
15
- gbu-a11y
16
- ```
17
-
18
- ## 🔄 Cài đặt lại / Cập nhật
19
-
20
- ```bash
21
- # Gỡ cài đặt cũ
22
- npm uninstall -g gbu-accessibility-package
23
-
24
- # Xóa cache
25
- npm cache clean --force
26
-
27
- # Cài đặt phiên bản mới nhất
28
- npm install -g gbu-accessibility-package@latest
29
-
30
- # Kiểm tra version
31
- gbu-a11y --version
32
9
  ```
33
10
 
34
- ## 🎯 Sử dụng cơ bản
35
-
36
- ### Cách 1: CLI (Đơn giản nhất)
11
+ ## Run
37
12
 
38
13
  ```bash
39
- # Fix toàn bộ dự án (current directory)
14
+ # Comprehensive review
40
15
  gbu-a11y
41
16
 
42
- # Fix thư mục cụ thể
17
+ # Specific directory
43
18
  gbu-a11y ./src
44
19
 
45
- # Preview trước khi fix
46
- gbu-a11y --dry-run
47
-
48
- # Fix với ngôn ngữ khác
49
- gbu-a11y -l en ./dist
50
-
51
- # Fix comprehensive (khuyến nghị)
52
- gbu-a11y --comprehensive
53
- ```
54
-
55
- ### Cách 2: Node.js Script
56
-
57
- Tạo file `fix.js`:
58
-
59
- ```javascript
60
- const AccessibilityFixer = require('gbu-accessibility-package');
61
-
62
- const fixer = new AccessibilityFixer({
63
- language: 'ja', // Thay đổi theo dự án
64
- backupFiles: true,
65
- dryRun: false
66
- });
67
-
68
- async function fix() {
69
- // Fix tất cả issues
70
- await fixer.fixAllAccessibilityIssues('.');
71
- console.log('✅ Done!');
72
- }
73
-
74
- fix();
75
- ```
76
-
77
- Chạy: `node fix.js`
78
-
79
- ## 📋 Checklist nhanh
80
-
81
- - [ ] `npm install -g gbu-accessibility-package`
82
- - [ ] Backup code (git commit)
83
- - [ ] Chạy `gbu-a11y --dry-run` để preview
84
- - [ ] Chạy `gbu-a11y --comprehensive` để fix
85
- - [ ] Kiểm tra kết quả
86
- - [ ] Commit changes
87
-
88
- ## 🎨 Kết quả mong đợi
89
-
90
- ### Trước:
91
- ```html
92
- <html>
93
- <body>
94
- <img src="logo.png">
95
- <a href="/about">About</a>
96
- <button onclick="submit()">Submit</button>
97
- </body>
98
- </html>
99
- ```
20
+ # Alt text review only
21
+ gbu-a11y --alt-only ./src
100
22
 
101
- ### Sau:
102
- ```html
103
- <html lang="ja">
104
- <body>
105
- <img src="logo.png" alt="ロゴ" role="img">
106
- <a href="/about" role="link">About</a>
107
- <button onclick="submit()" role="button">Submit</button>
108
- </body>
109
- </html>
23
+ # Excel report
24
+ gbu-a11y --full-report -o reports/accessibility-report.xlsx
110
25
  ```
111
26
 
112
- ## 🔧 Tùy chỉnh nhanh
113
-
114
- ### Thay đổi ngôn ngữ
115
- ```javascript
116
- // Trong config
117
- language: 'en' // 'ja', 'vi', 'zh', etc.
118
- ```
119
-
120
- ### Không tạo backup
121
- ```bash
122
- gbu-a11y --no-backup
123
- ```
124
-
125
- ### Chỉ preview
126
- ```bash
127
- gbu-a11y --dry-run
128
- ```
129
-
130
- ## ❓ Troubleshooting
131
-
132
- **Lỗi "Cannot find module"**
133
- ```bash
134
- # Cài đặt lại
135
- npm uninstall -g gbu-accessibility-package
136
- npm cache clean --force
137
- npm install -g gbu-accessibility-package
138
- ```
139
-
140
- **Lỗi permission (macOS/Linux)**
141
- ```bash
142
- sudo npm install -g gbu-accessibility-package
143
- ```
144
-
145
- **Package không update**
146
- ```bash
147
- # Force update
148
- npm cache clean --force
149
- npm install -g gbu-accessibility-package@latest --force
150
- ```
151
-
152
- **Kiểm tra cài đặt**
153
- ```bash
154
- which gbu-a11y
155
- npm list -g gbu-accessibility-package
156
- gbu-a11y --version
157
- ```
158
-
159
- **Duplicate attributes**
160
- - Tool tự động tránh duplicate
161
- - Nếu có, chạy lại tool sẽ tự clean up
162
-
163
- **Performance chậm**
164
- - Chạy từng thư mục nhỏ
165
- - Exclude node_modules
166
-
167
- ## 📞 Cần trợ giúp?
168
-
169
- 1. Đọc [README.md](./README.md) đầy đủ
170
- 2. Xem [example.js](./example.js)
171
- 3. Chạy `gbu-a11y --help`
27
+ ## Important
172
28
 
173
- ---
29
+ - Source files are never modified
30
+ - `--dry-run` is now implicit
174
31
 
175
- **Chúc bạn coding vui vẻ! 🎉**
32
+ See [README.md](./README.md) and [README-vi.md](./README-vi.md) for full usage.