change-image-suffix 2.1.0 → 2.1.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.1.2](https://github.com/GuoSirius/change-image-suffix/compare/v2.1.1...v2.1.2) (2026-05-21)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add stdio inherit to release.js git commands for visible output ([7644eba](https://github.com/GuoSirius/change-image-suffix/commit/7644ebab76a090fd199cf1429edc0ccfa4a25323))
11
+
12
+ ### [2.1.1](https://github.com/GuoSirius/change-image-suffix/compare/v2.1.0...v2.1.1) (2026-05-21)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * unify format constants, remove dead code, sync docs with source ([c1e7700](https://github.com/GuoSirius/change-image-suffix/commit/c1e7700ee5f5a0142c98f5a1e95bc6453317a4a9))
18
+
5
19
  ## [2.1.0](https://github.com/GuoSirius/change-image-suffix/compare/v2.0.2...v2.1.0) (2026-05-21)
6
20
 
7
21
 
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  - 🔄 支持递归搜索子目录
9
9
  - 📏 支持递归深度限制
10
10
  - 🎯 支持指定源文件后缀(png, jpg, gif 等)
11
- - 🎨 支持多种目标格式(webp, jpg, png, avif, gif
11
+ - 🎨 支持多种目标格式(webp, jpg, png, avif, tiff
12
12
  - 📤 输出到 `output/` 子目录
13
13
  - 🔢 同名不同后缀文件自动编号(`_01`, `_02`)
14
14
  - 🖱️ Windows 右键菜单集成
@@ -91,7 +91,7 @@ cis uninstall-menu
91
91
  | `-p, --path <dir>` | 指定工作目录 | 当前目录 |
92
92
  | `-r, --recursive` | 递归搜索子目录 | 否 |
93
93
  | `-d, --depth <n>` | 递归深度限制 | 无限制 |
94
- | `-e, --extensions` | 指定源后缀,逗号分隔 | png,jpg,jpeg,gif,bmp,tiff,webp |
94
+ | `-e, --extensions` | 指定源后缀,逗号分隔 | png,jpg,jpeg,gif,bmp,tiff,tif,webp,avif |
95
95
  | `-t, --to <format>` | 目标格式 | webp |
96
96
  | `-f, --file <file>` | 指定单个文件转换 | - |
97
97
  | `-h, --help` | 显示帮助 | - |
@@ -279,14 +279,21 @@ npm run release:major # 重大变更
279
279
  ## 项目结构
280
280
 
281
281
  ```
282
+ ├── .claude/ # Claude Code 项目记忆与设置
283
+ │ ├── MEMORY.md
284
+ │ ├── memory/
285
+ │ └── settings.local.json
282
286
  ├── .github/workflows/ # GitHub Actions 工作流
283
287
  │ └── release.yml # 自动发布工作流
284
288
  ├── .husky/ # Git 钩子
285
289
  │ └── commit-msg # 提交信息校验钩子
286
290
  ├── scripts/ # 脚本目录
287
- └── release.js # 一键发布脚本
291
+ ├── release.js # 一键发布脚本
292
+ │ ├── postinstall.js # npm postinstall 钩子(自动注册右键菜单)
293
+ │ └── preuninstall.js # npm preuninstall 钩子(自动清理右键菜单)
288
294
  ├── src/ # 源代码
289
295
  │ └── index.ts # 主入口
296
+ ├── CLAUDE.md # 项目上下文文档
290
297
  ├── .commitlintrc.json # commitlint 配置
291
298
  ├── CHANGELOG.md # 变更日志
292
299
  └── package.json # 项目配置
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ const sharp_1 = __importDefault(require("sharp"));
45
45
  // 支持的输入/输出格式
46
46
  const SUPPORTED_INPUT_EXTENSIONS = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'tif', 'webp', 'avif'];
47
47
  const SUPPORTED_OUTPUT_FORMATS = ['webp', 'jpg', 'jpeg', 'png', 'avif', 'tiff', 'tif'];
48
- const DEFAULT_EXTENSIONS = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'];
48
+ const DEFAULT_EXTENSIONS = [...SUPPORTED_INPUT_EXTENSIONS];
49
49
  const DEFAULT_TARGET_FORMAT = 'webp';
50
50
  // ─────────────────────────────────────────
51
51
  // 右键菜单管理(仅 Windows)
@@ -56,17 +56,6 @@ function requireWindows() {
56
56
  process.exit(1);
57
57
  }
58
58
  }
59
- /**
60
- * 写注册表 key(调用 reg.exe,无需管理员权限写 HKCU)
61
- */
62
- function regAdd(key, name, value, type = 'REG_SZ') {
63
- const cmd = `reg add "${key}" /v "${name}" /t ${type} /d "${value}" /f`;
64
- (0, child_process_1.execSync)(cmd, { stdio: 'ignore' });
65
- }
66
- function regAddDefault(key, value) {
67
- const cmd = `reg add "${key}" /ve /d "${value}" /f`;
68
- (0, child_process_1.execSync)(cmd, { stdio: 'ignore' });
69
- }
70
59
  function regDelete(key) {
71
60
  try {
72
61
  (0, child_process_1.execSync)(`reg delete "${key}" /f`, { stdio: 'ignore' });
@@ -166,10 +155,8 @@ endlocal
166
155
  { verb: 'avif', label: '📺 AVIF' },
167
156
  { verb: 'tiff', label: '📋 TIFF' },
168
157
  ];
169
- // ── 使用 ExtendedSubCommandsKey 方式(PowerShell 7 同款)──
170
- // 主菜单项配置(每个菜单类型有独立的子菜单路径)
171
- // 注意:文件右键和目录右键都使用 bat + PowerShell 获取选中文件
172
- // 这样混合选择时也能处理所有选中项
158
+ // ── 使用 ExtendedSubCommandsKey 方式 ──
159
+ // 文件右键和目录右键均使用 bat 脚本,混合选择时自动分类文件和目录
173
160
  const menuBases = [
174
161
  { base: 'HKCU\\Software\\Classes\\Directory\\Background\\shell\\cis', subMenu: 'Directory\\ContextMenus\\cis', arg: '-p "%V"' },
175
162
  { base: 'HKCU\\Software\\Classes\\Directory\\shell\\cis', subMenu: 'Directory\\ContextMenus\\cis_dir', useBat: true },
@@ -399,7 +386,7 @@ function printHelp() {
399
386
  -r, --recursive 递归搜索子目录
400
387
  -d, --depth <n> 递归深度限制(需要 -r 选项)
401
388
  -e, --extensions <ext> 指定源后缀,逗号分隔(不含点号)
402
- -t, --to <format> 目标格式: webp, jpg, png, avif, tiff(默认: webp)
389
+ -t, --to <format> 目标格式: webp, jpg/jpeg, png, avif, tiff/tif(默认: webp)
403
390
  -h, --help 显示帮助信息
404
391
  -v, --version 显示版本信息
405
392
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "change-image-suffix",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "批量转换图片格式的CLI工具,支持递归搜索、深度限制、指定后缀、Windows右键菜单等功能",
5
5
  "main": "dist/index.js",
6
6
  "files": [