@semba-ryuichiro/webpify 1.0.4 → 1.0.7
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 +33 -11
- package/dist/cli/argument-parser/index.js +10 -10
- package/dist/index.js +0 -0
- package/package.json +41 -35
package/README.md
CHANGED
|
@@ -2,8 +2,24 @@
|
|
|
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
|
+
webpify は画像ファイル(PNG/JPEG/GIF)を WebP 形式に変換する CLI ツールです。
|
|
10
|
+
|
|
11
|
+
## 目次
|
|
12
|
+
|
|
13
|
+
- [機能](#機能)
|
|
14
|
+
- [インストール](#インストール)
|
|
15
|
+
- [使い方](#使い方)
|
|
16
|
+
- [基本](#基本)
|
|
17
|
+
- [オプション](#オプション)
|
|
18
|
+
- [例](#例)
|
|
19
|
+
- [要件](#要件)
|
|
20
|
+
- [ライセンス](#ライセンス)
|
|
21
|
+
- [ドキュメント](#ドキュメント)
|
|
22
|
+
- [関連](#関連)
|
|
7
23
|
|
|
8
24
|
## 機能
|
|
9
25
|
|
|
@@ -37,16 +53,16 @@ webpify ./images -r
|
|
|
37
53
|
|
|
38
54
|
### オプション
|
|
39
55
|
|
|
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`
|
|
56
|
+
| オプション | 説明 | デフォルト |
|
|
57
|
+
| -------------------- | ------------- | ----- |
|
|
58
|
+
| `-o, --output <dir>` | 出力先ディレクトリ | 入力と同じ |
|
|
59
|
+
| `-q, --quality <n>` | 品質(1-100) | 100 |
|
|
60
|
+
| `-r, --recursive` | 再帰的に処理 | false |
|
|
61
|
+
| `-f, --force` | 既存ファイルを上書き | false |
|
|
62
|
+
| `--list` | WebP ファイル一覧表示 | - |
|
|
63
|
+
| `--quiet` | 統計情報を非表示 | false |
|
|
64
|
+
| `-v, --version` | バージョン表示 | - |
|
|
65
|
+
| `-h, --help` | ヘルプ表示 | - |
|
|
50
66
|
|
|
51
67
|
### 例
|
|
52
68
|
|
|
@@ -69,6 +85,12 @@ webpify ./images -r -f --quiet
|
|
|
69
85
|
|
|
70
86
|
[MIT](LICENSE)
|
|
71
87
|
|
|
88
|
+
## ドキュメント
|
|
89
|
+
|
|
90
|
+
- [クイックスタート](docs/getting-started.md) - インストールから最初の変換まで
|
|
91
|
+
- [コマンドリファレンス](docs/cli-reference.md) - すべてのオプションの詳細説明
|
|
92
|
+
- [ユースケース集](docs/use-cases.md) - 実践的な使用例とシナリオ
|
|
93
|
+
|
|
72
94
|
## 関連
|
|
73
95
|
|
|
74
96
|
- [コントリビューションガイド](CONTRIBUTING.md)
|
|
@@ -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/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -7,39 +7,39 @@
|
|
|
7
7
|
"url": "https://github.com/semba-yui/webpify/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"commander": "
|
|
11
|
-
"sharp": "
|
|
10
|
+
"commander": "catalog:",
|
|
11
|
+
"sharp": "catalog:"
|
|
12
12
|
},
|
|
13
13
|
"description": "CLI tool to convert images to WebP format",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@biomejs/biome": "
|
|
16
|
-
"@commitlint/cli": "
|
|
17
|
-
"@commitlint/config-conventional": "
|
|
18
|
-
"@fast-check/vitest": "
|
|
19
|
-
"@secretlint/secretlint-rule-preset-recommend": "
|
|
20
|
-
"@stryker-mutator/core": "
|
|
21
|
-
"@stryker-mutator/typescript-checker": "
|
|
22
|
-
"@stryker-mutator/vitest-runner": "
|
|
23
|
-
"@types/node": "
|
|
24
|
-
"@vitest/coverage-v8": "
|
|
25
|
-
"dependency-cruiser": "
|
|
26
|
-
"fast-check": "
|
|
27
|
-
"lefthook": "
|
|
28
|
-
"remark": "
|
|
29
|
-
"remark-cli": "
|
|
30
|
-
"remark-frontmatter": "
|
|
31
|
-
"remark-gfm": "
|
|
32
|
-
"remark-lint": "
|
|
33
|
-
"remark-preset-lint-consistent": "
|
|
34
|
-
"remark-preset-lint-recommended": "
|
|
35
|
-
"remark-toc": "
|
|
36
|
-
"secretlint": "
|
|
37
|
-
"ts-node": "
|
|
38
|
-
"typedoc": "
|
|
39
|
-
"typedoc-plugin-merge-modules": "
|
|
40
|
-
"typedoc-theme-hierarchy": "
|
|
41
|
-
"typescript": "
|
|
42
|
-
"vitest": "
|
|
15
|
+
"@biomejs/biome": "catalog:",
|
|
16
|
+
"@commitlint/cli": "catalog:",
|
|
17
|
+
"@commitlint/config-conventional": "catalog:",
|
|
18
|
+
"@fast-check/vitest": "catalog:",
|
|
19
|
+
"@secretlint/secretlint-rule-preset-recommend": "catalog:",
|
|
20
|
+
"@stryker-mutator/core": "catalog:",
|
|
21
|
+
"@stryker-mutator/typescript-checker": "catalog:",
|
|
22
|
+
"@stryker-mutator/vitest-runner": "catalog:",
|
|
23
|
+
"@types/node": "catalog:",
|
|
24
|
+
"@vitest/coverage-v8": "catalog:",
|
|
25
|
+
"dependency-cruiser": "catalog:",
|
|
26
|
+
"fast-check": "catalog:",
|
|
27
|
+
"lefthook": "catalog:",
|
|
28
|
+
"remark": "catalog:",
|
|
29
|
+
"remark-cli": "catalog:",
|
|
30
|
+
"remark-frontmatter": "catalog:",
|
|
31
|
+
"remark-gfm": "catalog:",
|
|
32
|
+
"remark-lint": "catalog:",
|
|
33
|
+
"remark-preset-lint-consistent": "catalog:",
|
|
34
|
+
"remark-preset-lint-recommended": "catalog:",
|
|
35
|
+
"remark-toc": "catalog:",
|
|
36
|
+
"secretlint": "catalog:",
|
|
37
|
+
"ts-node": "catalog:",
|
|
38
|
+
"typedoc": "catalog:",
|
|
39
|
+
"typedoc-plugin-merge-modules": "catalog:",
|
|
40
|
+
"typedoc-theme-hierarchy": "catalog:",
|
|
41
|
+
"typescript": "catalog:",
|
|
42
|
+
"vitest": "catalog:"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=22.0.0"
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"license": "MIT",
|
|
71
71
|
"main": "./dist/index.js",
|
|
72
72
|
"name": "@semba-ryuichiro/webpify",
|
|
73
|
+
"packageManager": "pnpm@10.26.2",
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public",
|
|
75
76
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -78,9 +79,6 @@
|
|
|
78
79
|
"type": "git",
|
|
79
80
|
"url": "git+https://github.com/semba-yui/webpify.git"
|
|
80
81
|
},
|
|
81
|
-
"type": "module",
|
|
82
|
-
"types": "./dist/index.d.ts",
|
|
83
|
-
"version": "1.0.4",
|
|
84
82
|
"scripts": {
|
|
85
83
|
"build": "tsc",
|
|
86
84
|
"deps": "dependency-cruiser src --config .dependency-cruiser.cjs",
|
|
@@ -88,15 +86,23 @@
|
|
|
88
86
|
"dev": "tsc --watch",
|
|
89
87
|
"docs:gen": "typedoc",
|
|
90
88
|
"lint": "biome check .",
|
|
89
|
+
"lint:actions": "actionlint",
|
|
91
90
|
"lint:fix": "biome check --write .",
|
|
91
|
+
"lint:gha": "ghalint run",
|
|
92
92
|
"lint:md": "remark . --quiet",
|
|
93
93
|
"lint:md:fix": "remark . --quiet --output",
|
|
94
94
|
"lint:secret": "secretlint \"**/*\"",
|
|
95
|
+
"lint:yaml": "yamllint .",
|
|
96
|
+
"lint:zizmor": "zizmor .github/workflows/",
|
|
97
|
+
"prepublishOnly": "pnpm run lint && pnpm run test && pnpm run build",
|
|
95
98
|
"test": "vitest run",
|
|
96
99
|
"test:coverage": "vitest run --coverage",
|
|
97
100
|
"test:mutation": "stryker run",
|
|
98
101
|
"test:mutation:dry": "stryker run --dryRunOnly",
|
|
99
102
|
"test:watch": "vitest",
|
|
100
103
|
"typecheck": "tsc --noEmit"
|
|
101
|
-
}
|
|
102
|
-
|
|
104
|
+
},
|
|
105
|
+
"type": "module",
|
|
106
|
+
"types": "./dist/index.d.ts",
|
|
107
|
+
"version": "1.0.7"
|
|
108
|
+
}
|