image-convert-cli 1.1.3 → 1.1.5
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 +2 -2
- package/dist/index.js +33 -2
- package/package.json +5 -1
- package/src/cli.ts +3 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Demo
|
|
8
8
|
|
|
9
|
-
https://github.com/user-attachments/assets/f3df2efc-5db7-4201-9092-1aa309880380
|
|
9
|
+
[](https://github.com/user-attachments/assets/f3df2efc-5db7-4201-9092-1aa309880380)
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
@@ -45,7 +45,7 @@ bun install -g image-convert-cli
|
|
|
45
45
|
### From Source
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
git clone
|
|
48
|
+
git clone https://github.com/lukenguyen-me/image-convert-cli
|
|
49
49
|
cd image-convert-cli
|
|
50
50
|
npm install # or pnpm/yarn/bun install
|
|
51
51
|
npm link # or equivalent for your package manager
|
package/dist/index.js
CHANGED
|
@@ -8635,6 +8635,37 @@ Conversion settings:`);
|
|
|
8635
8635
|
});
|
|
8636
8636
|
}
|
|
8637
8637
|
}
|
|
8638
|
+
// package.json
|
|
8639
|
+
var package_default = {
|
|
8640
|
+
name: "image-convert-cli",
|
|
8641
|
+
version: "1.1.5",
|
|
8642
|
+
type: "module",
|
|
8643
|
+
bin: {
|
|
8644
|
+
imgc: "./dist/index.js"
|
|
8645
|
+
},
|
|
8646
|
+
scripts: {
|
|
8647
|
+
start: "bun bin/index.ts",
|
|
8648
|
+
test: "bun test",
|
|
8649
|
+
prepare: "husky install",
|
|
8650
|
+
build: "bun build ./bin/index.ts --outdir ./dist --target bun",
|
|
8651
|
+
publish: "bun run build && bun publish --access public --ignore-scripts"
|
|
8652
|
+
},
|
|
8653
|
+
publishConfig: {
|
|
8654
|
+
access: "public"
|
|
8655
|
+
},
|
|
8656
|
+
dependencies: {
|
|
8657
|
+
"@inquirer/prompts": "^8.2.0",
|
|
8658
|
+
sharp: "^0.34.5"
|
|
8659
|
+
},
|
|
8660
|
+
devDependencies: {
|
|
8661
|
+
"@types/bun": "^1.3.8",
|
|
8662
|
+
husky: "^9.1.7"
|
|
8663
|
+
},
|
|
8664
|
+
repository: {
|
|
8665
|
+
type: "git",
|
|
8666
|
+
url: "https://github.com/lukenguyen-me/image-convert-cli.git"
|
|
8667
|
+
}
|
|
8668
|
+
};
|
|
8638
8669
|
|
|
8639
8670
|
// src/cli.ts
|
|
8640
8671
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/image-convert-cli/latest";
|
|
@@ -8682,7 +8713,7 @@ async function handleUpdate(fetchVersion, currentVersion, autoUpdate, promptServ
|
|
|
8682
8713
|
const data = await response.json();
|
|
8683
8714
|
return data.version;
|
|
8684
8715
|
});
|
|
8685
|
-
const version = currentVersion || process.env.npm_package_version ||
|
|
8716
|
+
const version = currentVersion || process.env.npm_package_version || package_default.version;
|
|
8686
8717
|
try {
|
|
8687
8718
|
const latestVersion = await fetcher();
|
|
8688
8719
|
if (latestVersion === version) {
|
|
@@ -8711,7 +8742,7 @@ async function runCli(options, promptService) {
|
|
|
8711
8742
|
return;
|
|
8712
8743
|
}
|
|
8713
8744
|
if (options.version) {
|
|
8714
|
-
const version = process.env.npm_package_version ||
|
|
8745
|
+
const version = process.env.npm_package_version || package_default.version;
|
|
8715
8746
|
console.log(`image-convert-cli v${version}`);
|
|
8716
8747
|
return;
|
|
8717
8748
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-convert-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"imgc": "./dist/index.js"
|
|
@@ -22,5 +22,9 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/bun": "^1.3.8",
|
|
24
24
|
"husky": "^9.1.7"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/lukenguyen-me/image-convert-cli.git"
|
|
25
29
|
}
|
|
26
30
|
}
|
package/src/cli.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { IPromptService, InteractivePromptService } from "./prompts";
|
|
|
5
5
|
import { convertImage, displayConversionResult, convertBatch, displayBatchResult } from "./converter";
|
|
6
6
|
import { getDefaultDestinationPath, isDirectory, getImageFilesFromDirectory } from "./utils/path";
|
|
7
7
|
import type { BatchConversionSettings } from "./types";
|
|
8
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
8
9
|
|
|
9
10
|
const NPM_REGISTRY_URL = "https://registry.npmjs.org/image-convert-cli/latest";
|
|
10
11
|
|
|
@@ -68,7 +69,7 @@ export async function handleUpdate(
|
|
|
68
69
|
return data.version;
|
|
69
70
|
});
|
|
70
71
|
|
|
71
|
-
const version = currentVersion || process.env.npm_package_version ||
|
|
72
|
+
const version = currentVersion || process.env.npm_package_version || packageJson.version;
|
|
72
73
|
|
|
73
74
|
try {
|
|
74
75
|
const latestVersion = await fetcher();
|
|
@@ -106,7 +107,7 @@ export async function runCli(
|
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
if (options.version) {
|
|
109
|
-
const version = process.env.npm_package_version ||
|
|
110
|
+
const version = process.env.npm_package_version || packageJson.version;
|
|
110
111
|
console.log(`image-convert-cli v${version}`);
|
|
111
112
|
return;
|
|
112
113
|
}
|