@kitschpatrol/aphex 0.1.4 → 0.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/dist/aphex-swift CHANGED
Binary file
package/dist/index.js CHANGED
@@ -75,7 +75,9 @@ function scheduleProcessCleanup() {
75
75
  process.on("beforeExit", () => {
76
76
  if (cleanupScheduled) return;
77
77
  cleanupScheduled = true;
78
- endExiftool();
78
+ endExiftool().catch((error) => {
79
+ log.warn(`Failed to end exiftool processes: ${String(error)}`);
80
+ });
79
81
  });
80
82
  process.on("exit", () => {
81
83
  if (exiftoolInstance.pids.length > 0) log.debug(`Exiftool processes still running at exit: ${exiftoolInstance.pids.join(", ")}`);
@@ -83,14 +85,22 @@ function scheduleProcessCleanup() {
83
85
  process.on("SIGINT", () => {
84
86
  (async () => {
85
87
  log.debug("Received SIGINT, cleaning up exiftool...");
86
- await endExiftool();
88
+ try {
89
+ await endExiftool();
90
+ } catch (error) {
91
+ log.warn(`Failed to end exiftool processes: ${String(error)}`);
92
+ }
87
93
  process.exit(130);
88
94
  })();
89
95
  });
90
96
  process.on("SIGTERM", () => {
91
97
  (async () => {
92
98
  log.debug("Received SIGTERM, cleaning up exiftool...");
93
- await endExiftool();
99
+ try {
100
+ await endExiftool();
101
+ } catch (error) {
102
+ log.warn(`Failed to end exiftool processes: ${String(error)}`);
103
+ }
94
104
  process.exit(143);
95
105
  })();
96
106
  });
@@ -812,14 +822,14 @@ function parseUserComment(userComment) {
812
822
  * Set the tags on an image
813
823
  */
814
824
  async function setTags(imagePath, imageTags) {
815
- const { aphexMetadata, creator, credit, description, label, preservedFileName } = imageTags;
825
+ const { aphexMetadata, creator = "", credit = "", description = "", label = "", preservedFileName = "" } = imageTags;
816
826
  const userComment = aphexMetadata ? JSON.stringify(aphexMetadata) : void 0;
817
827
  const tags = {
818
- ..."creator" in imageTags && { "XMP:Creator": creator ?? "" },
819
- ..."description" in imageTags && { "XMP:Description": description ?? "" },
820
- ..."credit" in imageTags && { "XMP:Credit": credit ?? "" },
821
- ..."label" in imageTags && { "XMP:Label": label ?? "" },
822
- ..."preservedFileName" in imageTags && { "XMP:PreservedFileName": preservedFileName ?? "" },
828
+ ..."creator" in imageTags && { "XMP:Creator": creator },
829
+ ..."description" in imageTags && { "XMP:Description": description },
830
+ ..."credit" in imageTags && { "XMP:Credit": credit },
831
+ ..."label" in imageTags && { "XMP:Label": label },
832
+ ..."preservedFileName" in imageTags && { "XMP:PreservedFileName": preservedFileName },
823
833
  ..."aphexMetadata" in imageTags && { "XMP:UserComment": userComment ?? "" }
824
834
  };
825
835
  await getExiftool().write(imagePath, tags, { writeArgs: ["-overwrite_original_in_place"] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/aphex",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Apple Photos Export. TypeScript library and CLI tool to export and process images and albums from your macOS Photos.app library.",
5
5
  "keywords": [
6
6
  "apple",
@@ -41,14 +41,14 @@
41
41
  "dependencies": {
42
42
  "@sindresorhus/is": "^8.1.0",
43
43
  "defu": "^6.1.7",
44
- "execa": "^10.0.1",
45
- "exiftool-vendored": "^38.1.0",
46
- "fast-equals": "^6.0.4",
47
- "fs-extra": "^11.4.0",
44
+ "execa": "^10.1.0",
45
+ "exiftool-vendored": "^39.0.0",
46
+ "fast-equals": "^6.1.0",
47
+ "fs-extra": "^11.4.1",
48
48
  "github-slugger": "^2.0.0",
49
49
  "image-size": "^2.0.4",
50
50
  "importx": "^0.5.2",
51
- "lognow": "^0.8.4",
51
+ "lognow": "^0.8.5",
52
52
  "mrmime": "^2.0.1",
53
53
  "piscina": "^5.3.2",
54
54
  "type-fest": "^5.10.0"
@@ -56,26 +56,27 @@
56
56
  "devDependencies": {
57
57
  "@arethetypeswrong/core": "^0.18.5",
58
58
  "@clack/prompts": "^1.8.1",
59
- "@kitschpatrol/shared-config": "^8.10.0",
59
+ "@kitschpatrol/shared-config": "^8.12.1",
60
60
  "@types/fs-extra": "^11.0.4",
61
- "@types/node": "~24.13.4",
62
- "@vitest/coverage-v8": "^5.0.1",
63
- "brewpub": "^0.3.0",
61
+ "@types/node": "~24.13.6",
62
+ "@vitest/coverage-v8": "^5.0.3",
63
+ "brewpub": "^0.5.0",
64
64
  "bumpp": "^12.3.0",
65
65
  "globby": "^16.2.4",
66
66
  "markdown-table": "^3.0.4",
67
- "mdat-plugin-cli-help": "^3.2.0",
67
+ "mdat-plugin-cli-help": "^3.4.1",
68
68
  "open": "^11.0.4",
69
- "pretty-bytes": "^7.1.3",
69
+ "pretty-bytes": "^7.2.0",
70
70
  "pretty-ms": "^9.3.1",
71
- "publint": "^0.3.24",
71
+ "publint": "^0.3.25",
72
+ "skills": "^1.7.0",
72
73
  "tsdown": "^0.23.0",
73
74
  "tsx": "^4.23.15",
74
75
  "typescript": "~6.0.3",
75
- "vitest": "^5.0.1"
76
+ "vitest": "^5.0.3"
76
77
  },
77
78
  "engines": {
78
- "node": ">=24.16.0"
79
+ "node": "^24.16.0 || >=26.3.0"
79
80
  },
80
81
  "os": [
81
82
  "darwin"
package/readme.md CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  [![NPM Package @kitschpatrol/aphex](https://img.shields.io/npm/v/@kitschpatrol/aphex.svg)](https://www.npmjs.com/package/@kitschpatrol/aphex)
12
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)
13
+ [![Homebrew](https://img.shields.io/badge/Homebrew-kitschpatrol%2Ftap%2Faphex-FBB040?logo=homebrew&logoColor=white)](https://github.com/kitschpatrol/homebrew-tap/blob/HEAD/Formula/aphex.rb)
13
14
 
14
15
  <!-- /badges -->
15
16
 
@@ -47,12 +48,35 @@ The name "Aphex" is a concatenation of **A**pple **PH**otos **EX**port.
47
48
 
48
49
  ## Getting started
49
50
 
51
+ <!-- dependencies -->
52
+
50
53
  ### Dependencies
51
54
 
52
- Requires an Apple Silicon (`arm64`) Mac with Photos.app installed and [Node 22.18.0](https://nodejs.org/en/download/) or newer. No Intel (`x86_64`) build of the bundled native binary is provided.
55
+ - [Node.js](https://nodejs.org/) 24.16.0 or newer (specifically `^24.16.0 || >=26.3.0`)
56
+ - Supported operating systems: macOS
57
+
58
+ <!-- /dependencies -->
59
+
60
+ Requires an Apple Silicon (`arm64`) Mac with Photos.app installed. No Intel (`x86_64`) build of the bundled native binary is provided.
61
+
62
+ ### Installation
63
+
64
+ Pick the option that matches how you plan to use it.
65
+
66
+ #### Library installation
67
+
68
+ Add it to your project to import the TypeScript API. This also puts the `aphex` CLI on your project's path:
69
+
70
+ ```sh
71
+ npm install @kitschpatrol/aphex
72
+ ```
53
73
 
54
74
  Full image processing functionality also requires a number of command-line tools available via [Homebrew](https://brew.sh):
55
75
 
76
+ ```sh
77
+ brew install libavif mozjpeg imagemagick webp dssim ffmpeg guetzli oxipng
78
+ ```
79
+
56
80
  | Tool | Used for |
57
81
  | ------------- | ------------------------------------------------------------------------- |
58
82
  | `libavif` | AVIF encoding |
@@ -64,28 +88,28 @@ Full image processing functionality also requires a number of command-line tools
64
88
  | `ffmpeg` | Media probing used by some conversion paths |
65
89
  | `dssim` | Perceptual similarity metrics (only needed if `logSimilarity` is enabled) |
66
90
 
67
- If you skip image processing (`processOptions: 'disabled'`) you can omit the Homebrew dependencies.
91
+ If you skip image processing (`processOptions: 'disabled'`) you can omit these.
68
92
 
69
- ### Installation
93
+ #### CLI installation
94
+
95
+ Note that the Aphex CLI does _not_ expose all the functionality from the TypeScript library. It's a native bridge focused on querying your library for images and metadata, and also certain fast-path export strategies.
70
96
 
71
- The easiest way to install the CLI tool is via Homebrew:
97
+ Run it once without installing:
72
98
 
73
99
  ```sh
74
- brew install kitschpatrol/tap/aphex
100
+ npx @kitschpatrol/aphex
75
101
  ```
76
102
 
77
- If you're working in a Node project or prefer to install through npm, you will need some additional dependencies for the image processing functionality exposed through the library API.
78
-
79
- These are easiest to install via Homebrew:
103
+ Or install it globally with Homebrew:
80
104
 
81
105
  ```sh
82
- brew install libavif mozjpeg imagemagick webp dssim ffmpeg guetzli oxipng
106
+ brew install kitschpatrol/tap/aphex
83
107
  ```
84
108
 
85
- Then, in your node project:
109
+ Or install it globally with npm:
86
110
 
87
111
  ```sh
88
- npm install @kitschpatrol/aphex
112
+ npm install --global @kitschpatrol/aphex
89
113
  ```
90
114
 
91
115
  ### Permissions
@@ -207,7 +231,7 @@ setLogger(console)
207
231
 
208
232
  ##### Exporting a photo by filename
209
233
 
210
- Let's assume you have an album named "Trip" in your Photos.app library containing a photo with the filename "IMG\_1922.jpeg":
234
+ Let's assume you have an album named "Trip" in your Photos.app library containing a photo with the filename "IMG_1922.jpeg":
211
235
 
212
236
  ```ts
213
237
  const result = await exportPhoto('Trip/IMG_1922.jpeg', '~/Desktop')