@semba-ryuichiro/webpify 1.0.4 → 1.0.6
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/README.md +13 -10
- package/dist/cli/argument-parser/index.js +10 -10
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://nodejs.org/)
|
|
5
|
+
[](https://sonarcloud.io/summary/new_code?id=semba-yui_webpify)
|
|
6
|
+
[](https://deepwiki.com/semba-yui/webpify)
|
|
7
|
+

|
|
5
8
|
|
|
6
9
|
画像ファイル(PNG/JPEG/GIF)を WebP 形式に変換する CLI ツール
|
|
7
10
|
|
|
@@ -37,16 +40,16 @@ webpify ./images -r
|
|
|
37
40
|
|
|
38
41
|
### オプション
|
|
39
42
|
|
|
40
|
-
| オプション
|
|
41
|
-
|
|
42
|
-
| `-o, --output <dir>` | 出力先ディレクトリ
|
|
43
|
-
| `-q, --quality <n>`
|
|
44
|
-
| `-r, --recursive`
|
|
45
|
-
| `-f, --force`
|
|
46
|
-
| `--list`
|
|
47
|
-
| `--quiet`
|
|
48
|
-
| `-v, --version`
|
|
49
|
-
| `-h, --help`
|
|
43
|
+
| オプション | 説明 | デフォルト |
|
|
44
|
+
| -------------------- | ------------- | ----- |
|
|
45
|
+
| `-o, --output <dir>` | 出力先ディレクトリ | 入力と同じ |
|
|
46
|
+
| `-q, --quality <n>` | 品質(1-100) | 100 |
|
|
47
|
+
| `-r, --recursive` | 再帰的に処理 | false |
|
|
48
|
+
| `-f, --force` | 既存ファイルを上書き | false |
|
|
49
|
+
| `--list` | WebP ファイル一覧表示 | - |
|
|
50
|
+
| `--quiet` | 統計情報を非表示 | false |
|
|
51
|
+
| `-v, --version` | バージョン表示 | - |
|
|
52
|
+
| `-h, --help` | ヘルプ表示 | - |
|
|
50
53
|
|
|
51
54
|
### 例
|
|
52
55
|
|
|
@@ -24,7 +24,7 @@ const VERSION = '1.0.0';
|
|
|
24
24
|
function parseQuality(value) {
|
|
25
25
|
const quality = Number.parseInt(value, 10);
|
|
26
26
|
if (Number.isNaN(quality) || quality < MIN_QUALITY || quality > MAX_QUALITY) {
|
|
27
|
-
process.stderr.write(
|
|
27
|
+
process.stderr.write(`エラー: 品質は ${MIN_QUALITY} から ${MAX_QUALITY} の間で指定してください\n`);
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
return quality;
|
|
@@ -37,15 +37,15 @@ export function createArgumentParser() {
|
|
|
37
37
|
const program = new Command();
|
|
38
38
|
program
|
|
39
39
|
.name('webpify')
|
|
40
|
-
.description('
|
|
41
|
-
.version(VERSION, '-v, --version', '
|
|
42
|
-
.argument('[input]', '
|
|
43
|
-
.option('-o, --output <path>', '
|
|
44
|
-
.option('-q, --quality <number>', '
|
|
45
|
-
.option('-r, --recursive', '
|
|
46
|
-
.option('-f, --force', '
|
|
47
|
-
.option('--quiet', '
|
|
48
|
-
.option('--list', '
|
|
40
|
+
.description('画像を WebP 形式に変換する CLI ツール')
|
|
41
|
+
.version(VERSION, '-v, --version', 'バージョン番号を表示')
|
|
42
|
+
.argument('[input]', '入力ファイルまたはディレクトリのパス')
|
|
43
|
+
.option('-o, --output <path>', '出力パス')
|
|
44
|
+
.option('-q, --quality <number>', '品質レベル (1-100)', parseQuality, DEFAULT_QUALITY)
|
|
45
|
+
.option('-r, --recursive', 'ディレクトリを再帰的に処理', false)
|
|
46
|
+
.option('-f, --force', '既存ファイルを上書き', false)
|
|
47
|
+
.option('--quiet', 'サイレントモード(出力なし)', false)
|
|
48
|
+
.option('--list', 'WebP ファイルをサイズ情報付きで一覧表示', false)
|
|
49
49
|
.configureOutput({
|
|
50
50
|
writeErr: (str) => process.stderr.write(str),
|
|
51
51
|
writeOut: (str) => process.stdout.write(str),
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@stryker-mutator/vitest-runner": "9.4.0",
|
|
23
23
|
"@types/node": "25.0.3",
|
|
24
24
|
"@vitest/coverage-v8": "4.0.16",
|
|
25
|
-
"dependency-cruiser": "17.
|
|
25
|
+
"dependency-cruiser": "17.2.0",
|
|
26
26
|
"fast-check": "4.5.3",
|
|
27
27
|
"lefthook": "2.0.13",
|
|
28
28
|
"remark": "15.0.1",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"type": "module",
|
|
82
82
|
"types": "./dist/index.d.ts",
|
|
83
|
-
"version": "1.0.
|
|
83
|
+
"version": "1.0.6",
|
|
84
84
|
"scripts": {
|
|
85
85
|
"build": "tsc",
|
|
86
86
|
"deps": "dependency-cruiser src --config .dependency-cruiser.cjs",
|
|
@@ -88,10 +88,14 @@
|
|
|
88
88
|
"dev": "tsc --watch",
|
|
89
89
|
"docs:gen": "typedoc",
|
|
90
90
|
"lint": "biome check .",
|
|
91
|
+
"lint:actions": "actionlint",
|
|
91
92
|
"lint:fix": "biome check --write .",
|
|
93
|
+
"lint:gha": "ghalint run",
|
|
92
94
|
"lint:md": "remark . --quiet",
|
|
93
95
|
"lint:md:fix": "remark . --quiet --output",
|
|
94
96
|
"lint:secret": "secretlint \"**/*\"",
|
|
97
|
+
"lint:yaml": "yamllint .",
|
|
98
|
+
"lint:zizmor": "zizmor .github/workflows/",
|
|
95
99
|
"test": "vitest run",
|
|
96
100
|
"test:coverage": "vitest run --coverage",
|
|
97
101
|
"test:mutation": "stryker run",
|