gbu-accessibility-package 3.0.0 → 3.1.3
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 +139 -0
- package/README-vi.md +720 -0
- package/README.md +394 -119
- package/cli.js +6 -6
- package/demo/no-backup-test.html +12 -0
- package/demo/no-backup-test.html.backup +12 -0
- package/lib/fixer.js +1 -1
- package/package.json +19 -5
package/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ const args = process.argv.slice(2);
|
|
|
14
14
|
const options = {
|
|
15
15
|
directory: '.',
|
|
16
16
|
language: 'ja',
|
|
17
|
-
backupFiles:
|
|
17
|
+
backupFiles: false, // Default to false for faster processing
|
|
18
18
|
dryRun: false,
|
|
19
19
|
help: false,
|
|
20
20
|
cleanupOnly: false,
|
|
@@ -103,8 +103,8 @@ Usage: node cli.js [options] [directory]
|
|
|
103
103
|
Options:
|
|
104
104
|
-d, --directory <path> Target directory (default: current directory)
|
|
105
105
|
-l, --language <lang> Language for lang attribute (default: ja)
|
|
106
|
-
--backup Create backup files
|
|
107
|
-
--no-backup Don't create backup files
|
|
106
|
+
--backup Create backup files
|
|
107
|
+
--no-backup Don't create backup files (default)
|
|
108
108
|
--dry-run Preview changes without applying
|
|
109
109
|
--comprehensive, --all Run comprehensive fixes (same as default)
|
|
110
110
|
--cleanup-only Only cleanup duplicate role attributes
|
|
@@ -119,7 +119,7 @@ Options:
|
|
|
119
119
|
-h, --help Show this help message
|
|
120
120
|
|
|
121
121
|
Examples:
|
|
122
|
-
node cli.js # Comprehensive fixes (default
|
|
122
|
+
node cli.js # Comprehensive fixes (no backup by default)
|
|
123
123
|
node cli.js --comprehensive # Comprehensive fixes (same as default)
|
|
124
124
|
node cli.js --alt-only # Fix alt attributes + cleanup
|
|
125
125
|
node cli.js --forms-only # Fix form labels + cleanup
|
|
@@ -130,7 +130,7 @@ Examples:
|
|
|
130
130
|
node cli.js --cleanup-only # Only cleanup duplicate roles
|
|
131
131
|
node cli.js ./src # Fix src directory (comprehensive)
|
|
132
132
|
node cli.js -l en --dry-run ./dist # Preview comprehensive fixes in English
|
|
133
|
-
node cli.js --
|
|
133
|
+
node cli.js --backup ./public # Comprehensive fixes with backups
|
|
134
134
|
|
|
135
135
|
Features:
|
|
136
136
|
✅ Alt attributes for images
|
|
@@ -153,7 +153,7 @@ function showCompletionMessage(options, mode = 'fixes') {
|
|
|
153
153
|
console.log(chalk.gray(' 📁 Backup files created with .backup extension'));
|
|
154
154
|
console.log(chalk.gray(' 💡 Use --no-backup to disable backups in future runs'));
|
|
155
155
|
} else {
|
|
156
|
-
console.log(chalk.
|
|
156
|
+
console.log(chalk.blue(' ⚡ No backup files created (default behavior for faster processing)'));
|
|
157
157
|
console.log(chalk.gray(' 💡 Use --backup to enable backups for safety'));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>No Backup Test</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<h1>No Backup Test</h1>
|
|
9
|
+
<img src="test.jpg" alt="Test image" role="img" aria-label="Test image">
|
|
10
|
+
<a href="/home" role="link">Home</a>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
package/lib/fixer.js
CHANGED
|
@@ -10,7 +10,7 @@ const chalk = require('chalk');
|
|
|
10
10
|
class AccessibilityFixer {
|
|
11
11
|
constructor(config = {}) {
|
|
12
12
|
this.config = {
|
|
13
|
-
backupFiles: config.backupFiles
|
|
13
|
+
backupFiles: config.backupFiles === true,
|
|
14
14
|
language: config.language || 'ja',
|
|
15
15
|
dryRun: config.dryRun || false,
|
|
16
16
|
...config
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gbu-accessibility-package",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.1.3",
|
|
4
|
+
"description": "Comprehensive accessibility fixes for HTML files. Smart context-aware alt text generation, form labels, button names, link names, landmarks, heading analysis, and WCAG-compliant role attributes. Covers major axe DevTools issues with individual fix modes.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"gbu-a11y": "./cli.js",
|
|
@@ -36,11 +36,22 @@
|
|
|
36
36
|
"role-attributes",
|
|
37
37
|
"lang-attributes",
|
|
38
38
|
"wcag",
|
|
39
|
-
"
|
|
39
|
+
"axe",
|
|
40
|
+
"form-labels",
|
|
41
|
+
"button-names",
|
|
42
|
+
"link-names",
|
|
43
|
+
"landmarks",
|
|
44
|
+
"heading-analysis",
|
|
45
|
+
"aria-label",
|
|
40
46
|
"context-aware",
|
|
41
47
|
"smart-alt-text",
|
|
42
48
|
"accessibility-fixer",
|
|
43
|
-
"html-accessibility"
|
|
49
|
+
"html-accessibility",
|
|
50
|
+
"gbu",
|
|
51
|
+
"comprehensive",
|
|
52
|
+
"individual-fixes",
|
|
53
|
+
"backup-safe",
|
|
54
|
+
"dry-run"
|
|
44
55
|
],
|
|
45
56
|
"author": "GBU Team",
|
|
46
57
|
"license": "MIT",
|
|
@@ -59,8 +70,11 @@
|
|
|
59
70
|
"example.js",
|
|
60
71
|
"demo/",
|
|
61
72
|
"README.md",
|
|
73
|
+
"README-vi.md",
|
|
74
|
+
"CHANGELOG.md",
|
|
62
75
|
"QUICK_START.md",
|
|
63
|
-
"PACKAGE_SUMMARY.md"
|
|
76
|
+
"PACKAGE_SUMMARY.md",
|
|
77
|
+
"LICENSE"
|
|
64
78
|
],
|
|
65
79
|
"dependencies": {
|
|
66
80
|
"chalk": "^4.1.2"
|