@kitschpatrol/aphex 0.1.5 → 0.1.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/dist/aphex-swift +0 -0
- package/dist/index.d.ts +0 -28
- package/dist/index.js +26 -51
- package/package.json +18 -16
package/dist/aphex-swift
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ExifTool } from "exiftool-vendored";
|
|
2
2
|
import { ILogBasic, ILogLayer } from "lognow";
|
|
3
3
|
import { OmitDeep, PartialDeep, Simplify } from "type-fest";
|
|
4
|
-
//#region src/aphex-swift/cli-bridge.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Start an interactive session with aphex-swift. Commands will be sent to this
|
|
7
6
|
* persistent process instead of spawning new ones.
|
|
@@ -61,12 +60,8 @@ declare function aphexPhotoInfo(identifiers: string | string[], caseSensitive?:
|
|
|
61
60
|
* @throws {Error} If the command fails
|
|
62
61
|
*/
|
|
63
62
|
declare function aphexAlbumInfo(identifiers: string | string[], caseSensitive?: boolean): Promise<AlbumInfo[]>;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/utilities/image/mime.d.ts
|
|
66
63
|
export declare const IMAGE_MIME_TYPES: readonly ["arw", "avif", "bmp", "cr2", "cr3", "crw", "tga", "dng", "gif", "heic", "heif", "jpeg", "nef", "pef", "png", "psd", "svg+xml", "tiff", "webp"];
|
|
67
64
|
type ImageMimeType = (typeof IMAGE_MIME_TYPES)[number];
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/pipeline/engines/applescript-gui.d.ts
|
|
70
65
|
/**
|
|
71
66
|
* Mirrors the export UI in Note that note that some options are contingent on
|
|
72
67
|
* others.
|
|
@@ -120,8 +115,6 @@ type ExportViaAppleScriptGuiOptions = {
|
|
|
120
115
|
*/
|
|
121
116
|
tiffBitDepth: 8 | 16;
|
|
122
117
|
};
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/pipeline/image-export.d.ts
|
|
125
118
|
type ExportEngine = 'applescript' | 'file-system' | 'photos-gui' | 'swift-photokit';
|
|
126
119
|
type ExportEngineOptions = ExportEngine | Partial<Record<ImageMimeType, ExportEngine>>;
|
|
127
120
|
type ExportApplePhotoOptions = {
|
|
@@ -148,8 +141,6 @@ type ExportApplePhotoResult = {
|
|
|
148
141
|
photoInfo: PhotoInfo;
|
|
149
142
|
};
|
|
150
143
|
type FileNameOptions = 'fileName' | 'title' | 'uuid';
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/utilities/image/tags.d.ts
|
|
153
144
|
declare const VALID_LABELS: readonly ["animation", "diagram", "illustration", "image", "photo", "render", "screenshot", "video"];
|
|
154
145
|
type Label = (typeof VALID_LABELS)[number];
|
|
155
146
|
type ValidateTagsResult = {
|
|
@@ -175,8 +166,6 @@ type ImageTags = {
|
|
|
175
166
|
label?: Label | undefined;
|
|
176
167
|
preservedFileName?: string | undefined;
|
|
177
168
|
};
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region src/pipeline/image-metadata.d.ts
|
|
180
169
|
type ManageMetadataOptions = {
|
|
181
170
|
syncToEdited: boolean;
|
|
182
171
|
syncToTarget: boolean;
|
|
@@ -190,16 +179,12 @@ type ManageMetadataResult = {
|
|
|
190
179
|
tagsToTarget: Array<keyof ImageTags> | undefined;
|
|
191
180
|
validationResult: undefined | ValidateTagsResult;
|
|
192
181
|
};
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region src/utilities/image/color.d.ts
|
|
195
182
|
declare const validColorProfiles: readonly ["Adobe RGB (1998)", "Apple Wide Color Sharing Profile", "Display P3", "None", "ProPhoto RGB", "sRGB IEC61966-2.1", "Unsupported"];
|
|
196
183
|
type ColorProfile = (typeof validColorProfiles)[number];
|
|
197
184
|
/**
|
|
198
185
|
* Normalize the color profile of an image
|
|
199
186
|
*/
|
|
200
187
|
declare function normalizeColorProfile(imagePath: string, preserveColorProfiles?: ColorProfile[], defaultColorProfile?: ColorProfile): Promise<'assigned' | 'converted' | 'no-action'>;
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/utilities/image/convert.d.ts
|
|
203
188
|
type LosslessFormat = 'avif' | 'none' | 'png' | 'webp';
|
|
204
189
|
type NearLosslessFormat = 'none' | 'webp';
|
|
205
190
|
type LossyFormat = 'avif' | 'jpeg' | 'none' | 'webp';
|
|
@@ -269,8 +254,6 @@ declare function compressImage(sourceImagePath: string, destinationDirectory: st
|
|
|
269
254
|
compression: 'lossless' | 'lossy' | 'near-lossless' | 'none';
|
|
270
255
|
path: string;
|
|
271
256
|
}>;
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/utilities/image/image.d.ts
|
|
274
257
|
type ImageInfo = {
|
|
275
258
|
alpha: boolean;
|
|
276
259
|
colorProfile: string;
|
|
@@ -283,8 +266,6 @@ type ImageInfo = {
|
|
|
283
266
|
sizeBytes: number;
|
|
284
267
|
tags: ImageTags;
|
|
285
268
|
};
|
|
286
|
-
//#endregion
|
|
287
|
-
//#region src/pipeline/image-process.d.ts
|
|
288
269
|
type ProcessImageOptions = CompressImageOptions & {
|
|
289
270
|
/** Fallback color profile applied when source profile is not in preserve list */
|
|
290
271
|
defaultColorProfile: ColorProfile;
|
|
@@ -328,8 +309,6 @@ type ProcessImageResult = {
|
|
|
328
309
|
* Run in parallel through a worker for album processing
|
|
329
310
|
*/
|
|
330
311
|
export declare function processImage(sourceImagePath: string, destinationDirectory: string, options: ProcessImageOptions): Promise<ProcessImageResult>;
|
|
331
|
-
//#endregion
|
|
332
|
-
//#region src/pipeline/image-sync.d.ts
|
|
333
312
|
type DiffStrategy = 'exif-tags' | 'export-options' | 'file-name' | 'force-update' | 'metadata-options' | 'photo-info' | 'process-options';
|
|
334
313
|
type SyncOptions = {
|
|
335
314
|
deleteOthers: boolean;
|
|
@@ -346,8 +325,6 @@ type SyncResult = {
|
|
|
346
325
|
}>;
|
|
347
326
|
toDelete: string[];
|
|
348
327
|
};
|
|
349
|
-
//#endregion
|
|
350
|
-
//#region src/utilities/exiftool.d.ts
|
|
351
328
|
/**
|
|
352
329
|
* End the exiftool process gracefully
|
|
353
330
|
*
|
|
@@ -355,8 +332,6 @@ type SyncResult = {
|
|
|
355
332
|
* processes. It's safe to call multiple times.
|
|
356
333
|
*/
|
|
357
334
|
export declare function endExiftool(): Promise<void>;
|
|
358
|
-
//#endregion
|
|
359
|
-
//#region src/utilities/log.d.ts
|
|
360
335
|
/**
|
|
361
336
|
* Set the logger instance for the module. Export this for library consumers to
|
|
362
337
|
* inject their own logger.
|
|
@@ -365,8 +340,6 @@ export declare function endExiftool(): Promise<void>;
|
|
|
365
340
|
* Stream-like log target
|
|
366
341
|
*/
|
|
367
342
|
export declare function setLogger(logger?: ILogBasic | ILogLayer<unknown>): void;
|
|
368
|
-
//#endregion
|
|
369
|
-
//#region src/index.d.ts
|
|
370
343
|
/**
|
|
371
344
|
* Helper for deep merging ExportOptions object against library defaults.
|
|
372
345
|
* Exported for unplugin-aphex.
|
|
@@ -401,5 +374,4 @@ export declare function exportPhoto(identifier: PhotoInfo | string, destinationD
|
|
|
401
374
|
* Export photos
|
|
402
375
|
*/
|
|
403
376
|
export declare function exportPhotos(identifiers: Array<AlbumInfo | PhotoInfo | string>, destinationDirectory: string, options?: PartialDeep<ExportOptions>): Promise<ExportResult[]>;
|
|
404
|
-
//#endregion
|
|
405
377
|
export { type ImageMimeType, aphexAlbumInfo as getAlbumInfo, aphexPhotoInfo as getPhotoInfo };
|
package/dist/index.js
CHANGED
|
@@ -13,8 +13,7 @@ import { imageSizeFromFile } from "image-size/fromFile";
|
|
|
13
13
|
import { lookup, mimes } from "mrmime";
|
|
14
14
|
import { Piscina } from "piscina";
|
|
15
15
|
import { deepEqual } from "fast-equals";
|
|
16
|
-
|
|
17
|
-
//#region src/utilities/log.ts
|
|
16
|
+
// src/utilities/log.ts
|
|
18
17
|
/**
|
|
19
18
|
* The default logger instance for the library.
|
|
20
19
|
*/
|
|
@@ -29,8 +28,7 @@ let log = createLogger("@kitschpatrol/aphex");
|
|
|
29
28
|
function setLogger(logger) {
|
|
30
29
|
log = injectionHelper(logger);
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
//#region src/utilities/exiftool.ts
|
|
31
|
+
// src/utilities/exiftool.ts
|
|
34
32
|
/**
|
|
35
33
|
* Centralized exiftool instance management
|
|
36
34
|
*
|
|
@@ -105,8 +103,7 @@ function scheduleProcessCleanup() {
|
|
|
105
103
|
})();
|
|
106
104
|
});
|
|
107
105
|
}
|
|
108
|
-
|
|
109
|
-
//#region src/utilities/file.ts
|
|
106
|
+
// src/utilities/file.ts
|
|
110
107
|
/**
|
|
111
108
|
* Removes the file extension from a file path
|
|
112
109
|
*/
|
|
@@ -165,8 +162,7 @@ async function getTempDirectory(...labels) {
|
|
|
165
162
|
const prefix = labels.length > 0 ? `com.kitschpatrol.aphex.${labels.map((l) => l.toLowerCase()).join(".")}.` : "com.kitschpatrol.aphex.";
|
|
166
163
|
return fse.mkdtemp(path.join(os.tmpdir(), prefix));
|
|
167
164
|
}
|
|
168
|
-
|
|
169
|
-
//#region src/utilities/general.ts
|
|
165
|
+
// src/utilities/general.ts
|
|
170
166
|
const UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iv;
|
|
171
167
|
/**
|
|
172
168
|
* Sips makes a mess of the temp folder and does not respect TMPDIR, so we need
|
|
@@ -202,8 +198,7 @@ function ensureArray(value) {
|
|
|
202
198
|
function assertSingleElement(array) {
|
|
203
199
|
if (array.length !== 1) throw new Error(`Expected array of length 1, got ${array.length}`);
|
|
204
200
|
}
|
|
205
|
-
|
|
206
|
-
//#region src/utilities/paths.ts
|
|
201
|
+
// src/utilities/paths.ts
|
|
207
202
|
/**
|
|
208
203
|
* Import.meta.dirname for Node >= 20.19.0
|
|
209
204
|
*
|
|
@@ -235,8 +230,7 @@ function getPackageBinPath(meta) {
|
|
|
235
230
|
const dirname = getDirname(meta);
|
|
236
231
|
return path.basename(dirname) === "dist" ? path.join(dirname) : path.join("dist");
|
|
237
232
|
}
|
|
238
|
-
|
|
239
|
-
//#region src/aphex-swift/cli-bridge.ts
|
|
233
|
+
// src/aphex-swift/cli-bridge.ts
|
|
240
234
|
const SHELL_SPECIAL_CHARS_REGEX = /[\s'"\\]/v;
|
|
241
235
|
let interactiveProcess;
|
|
242
236
|
let currentRequest;
|
|
@@ -488,8 +482,7 @@ function dateReviver$1(key, value) {
|
|
|
488
482
|
].includes(key)) return value.length > 0 ? new Date(value) : void 0;
|
|
489
483
|
return value;
|
|
490
484
|
}
|
|
491
|
-
|
|
492
|
-
//#region src/aphex-swift/identifiers.ts
|
|
485
|
+
// src/aphex-swift/identifiers.ts
|
|
493
486
|
/**
|
|
494
487
|
* Takes a mix of photos, albums, strings, all resolved to a single array of
|
|
495
488
|
* PhotoInfo objects
|
|
@@ -518,8 +511,7 @@ async function resolvePhotoIdentifier(identifier) {
|
|
|
518
511
|
if (aphexPhotoInfoResult.length > 1) throw new Error(`Multiple photo assets found for identifier "${identifier} — is it an album?"`);
|
|
519
512
|
return photoInfo;
|
|
520
513
|
}
|
|
521
|
-
|
|
522
|
-
//#region src/utilities/defaults.ts
|
|
514
|
+
// src/utilities/defaults.ts
|
|
523
515
|
const mergeDefaultsInternal = createDefu((object, key, value) => {
|
|
524
516
|
if (Array.isArray(object[key]) && Array.isArray(value)) {
|
|
525
517
|
const merged = [.../* @__PURE__ */ new Set([...object[key], ...value])];
|
|
@@ -532,11 +524,9 @@ const mergeDefaultsInternal = createDefu((object, key, value) => {
|
|
|
532
524
|
* Merge, treating arrays like sets
|
|
533
525
|
*/
|
|
534
526
|
function mergeDefaults(options, defaults) {
|
|
535
|
-
|
|
536
|
-
return mergeDefaultsInternal(options, defaults);
|
|
527
|
+
return options === void 0 ? defaults : mergeDefaultsInternal(options, defaults);
|
|
537
528
|
}
|
|
538
|
-
|
|
539
|
-
//#region src/utilities/image/mime.ts
|
|
529
|
+
// src/utilities/image/mime.ts
|
|
540
530
|
mimes.arw = "image/arw";
|
|
541
531
|
mimes.cr2 = "image/cr2";
|
|
542
532
|
mimes.cr3 = "image/cr3";
|
|
@@ -586,8 +576,7 @@ function lookupImageMimeType(imagePath, validate = false) {
|
|
|
586
576
|
if (shouldValidate && matchedMimeTypes === void 0) throw new Error(`Invalid image MIME type: ${mime} for ${imagePath}`);
|
|
587
577
|
return matchedMimeTypes;
|
|
588
578
|
}
|
|
589
|
-
|
|
590
|
-
//#region src/utilities/image/color.ts
|
|
579
|
+
// src/utilities/image/color.ts
|
|
591
580
|
const SIPS_PROFILE_REGEX = /profile: (.+)/v;
|
|
592
581
|
/**
|
|
593
582
|
* Get the color profile of an image
|
|
@@ -706,8 +695,7 @@ async function normalizeColorProfile(imagePath, preserveColorProfiles = [
|
|
|
706
695
|
await convertColorProfile(imagePath, defaultColorProfile);
|
|
707
696
|
return "converted";
|
|
708
697
|
}
|
|
709
|
-
|
|
710
|
-
//#region src/utilities/image/tags.ts
|
|
698
|
+
// src/utilities/image/tags.ts
|
|
711
699
|
const VALID_LABELS = [
|
|
712
700
|
"animation",
|
|
713
701
|
"diagram",
|
|
@@ -859,8 +847,7 @@ async function cloneTags(sourceImagePath, destinationImagePath, includeKeys, for
|
|
|
859
847
|
if (Object.keys(tagsToAssign).length > 0) await setTags(destinationImagePath, tagsToAssign);
|
|
860
848
|
return Object.keys(tagsToAssign);
|
|
861
849
|
}
|
|
862
|
-
|
|
863
|
-
//#region src/utilities/image/image.ts
|
|
850
|
+
// src/utilities/image/image.ts
|
|
864
851
|
/**
|
|
865
852
|
* Get all available information about an image
|
|
866
853
|
*/
|
|
@@ -918,8 +905,7 @@ async function hasAlpha(imagePath) {
|
|
|
918
905
|
throw new Error(`Error checking file: ${String(error)}`, { cause: error });
|
|
919
906
|
}
|
|
920
907
|
}
|
|
921
|
-
|
|
922
|
-
//#region src/pipeline/engines/applescript.ts
|
|
908
|
+
// src/pipeline/engines/applescript.ts
|
|
923
909
|
const UUID_SUFFIX_PHOTO = "/L0/001";
|
|
924
910
|
function escapeForAppleScript(text) {
|
|
925
911
|
return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
@@ -959,8 +945,7 @@ async function exportViaAppleScript(photoUuid, forceOriginal = false) {
|
|
|
959
945
|
throw new Error(`Failed to export photo via AppleScript: ${errorMessage}`, { cause: error });
|
|
960
946
|
}
|
|
961
947
|
}
|
|
962
|
-
|
|
963
|
-
//#region src/pipeline/engines/applescript-gui.ts
|
|
948
|
+
// src/pipeline/engines/applescript-gui.ts
|
|
964
949
|
/** Apple's defaults, but these are overridden by Aphex by default */
|
|
965
950
|
const defaultExportViaAppleScriptGuiOptions = {
|
|
966
951
|
colorProfile: "Most Compatible",
|
|
@@ -1007,8 +992,7 @@ async function exportViaAppleScriptGui(uuid, options) {
|
|
|
1007
992
|
if (typeof results[0] !== "string") throw new TypeError(`Unexpected export results for album "${uuid}": ${JSON.stringify(results)}`);
|
|
1008
993
|
return results;
|
|
1009
994
|
}
|
|
1010
|
-
|
|
1011
|
-
//#region src/pipeline/engines/file-system.ts
|
|
995
|
+
// src/pipeline/engines/file-system.ts
|
|
1012
996
|
/**
|
|
1013
997
|
* Export a photo via direct file system copy of the original or edited file to
|
|
1014
998
|
* a temporary directory Clean up and move the file as needed afterwards
|
|
@@ -1027,8 +1011,7 @@ async function exportViaFileSystem(photoUuid, forceOriginal = false) {
|
|
|
1027
1011
|
await fse.copy(edited.filePath, destinationPath, { overwrite: true });
|
|
1028
1012
|
return destinationPath;
|
|
1029
1013
|
}
|
|
1030
|
-
|
|
1031
|
-
//#region src/pipeline/engines/swift-photokit.ts
|
|
1014
|
+
// src/pipeline/engines/swift-photokit.ts
|
|
1032
1015
|
/**
|
|
1033
1016
|
* Export a photo via aphex-swift command line tool using PhotoKit
|
|
1034
1017
|
*/
|
|
@@ -1037,8 +1020,7 @@ async function exportViaSwiftPhotoKit(photoUuid) {
|
|
|
1037
1020
|
if (result === void 0) throw new Error(`Export via PhotoKit returned no files for photo "${photoUuid}"`);
|
|
1038
1021
|
return result;
|
|
1039
1022
|
}
|
|
1040
|
-
|
|
1041
|
-
//#region src/pipeline/image-export.ts
|
|
1023
|
+
// src/pipeline/image-export.ts
|
|
1042
1024
|
const defaultExportApplePhotoOptions = {
|
|
1043
1025
|
appleScriptGuiOptions: {
|
|
1044
1026
|
colorProfile: "sRGB",
|
|
@@ -1177,8 +1159,7 @@ async function getEngineForPhoto(photoInfo, options) {
|
|
|
1177
1159
|
* the album, deleting any images that are no longer in the album Optionally
|
|
1178
1160
|
* audit the album for duplicate titles Does NOT further process the images
|
|
1179
1161
|
*/
|
|
1180
|
-
|
|
1181
|
-
//#region src/pipeline/image-metadata.ts
|
|
1162
|
+
// src/pipeline/image-metadata.ts
|
|
1182
1163
|
const defaultManageMetadataOptions = {
|
|
1183
1164
|
syncToEdited: true,
|
|
1184
1165
|
syncToTarget: true,
|
|
@@ -1227,8 +1208,7 @@ async function manageMetadata(identifier, targetFilePath, options, exportOptions
|
|
|
1227
1208
|
validationResult
|
|
1228
1209
|
};
|
|
1229
1210
|
}
|
|
1230
|
-
|
|
1231
|
-
//#region src/utilities/image/convert.ts
|
|
1211
|
+
// src/utilities/image/convert.ts
|
|
1232
1212
|
/**
|
|
1233
1213
|
* Optimize a PNG image
|
|
1234
1214
|
*/
|
|
@@ -1366,11 +1346,11 @@ async function convertToPng(sourceImagePath, destinationDirectory, force = false
|
|
|
1366
1346
|
"--setProperty",
|
|
1367
1347
|
"format",
|
|
1368
1348
|
"png",
|
|
1369
|
-
...restoreColorProfile
|
|
1349
|
+
...restoreColorProfile === void 0 || restoreColorProfile === "None" ? [] : [
|
|
1370
1350
|
"--setProperty",
|
|
1371
1351
|
"profile",
|
|
1372
1352
|
getPathToColorProfile(restoreColorProfile)
|
|
1373
|
-
]
|
|
1353
|
+
],
|
|
1374
1354
|
sourceImagePath,
|
|
1375
1355
|
"--out",
|
|
1376
1356
|
destinationImagePath
|
|
@@ -1516,8 +1496,7 @@ async function compressImage(sourceImagePath, destinationDirectory, options) {
|
|
|
1516
1496
|
path: destinationImagePath
|
|
1517
1497
|
};
|
|
1518
1498
|
}
|
|
1519
|
-
|
|
1520
|
-
//#region src/utilities/image/compare.ts
|
|
1499
|
+
// src/utilities/image/compare.ts
|
|
1521
1500
|
const SSIM_REGEX = /All:\s*([\d.]+)/v;
|
|
1522
1501
|
const PSNR_REGEX = /average:\s*([\d.]+)/v;
|
|
1523
1502
|
/**
|
|
@@ -1630,8 +1609,7 @@ async function calculatePSNRInternal(image1, image2) {
|
|
|
1630
1609
|
const psnrValue = PSNR_REGEX.exec(result.stderr)?.[1];
|
|
1631
1610
|
return psnrValue === void 0 ? 0 : Number(psnrValue);
|
|
1632
1611
|
}
|
|
1633
|
-
|
|
1634
|
-
//#region src/pipeline/image-process.ts
|
|
1612
|
+
// src/pipeline/image-process.ts
|
|
1635
1613
|
const defaultProcessImageOptions = {
|
|
1636
1614
|
defaultColorProfile: "sRGB IEC61966-2.1",
|
|
1637
1615
|
forceCompression: false,
|
|
@@ -1769,8 +1747,7 @@ function isProcessImageResultReport(object) {
|
|
|
1769
1747
|
if (object.similarity !== void 0) return typeof object.similarity.dssim === "number" && typeof object.similarity.psnr === "number" && typeof object.similarity.ssim === "number";
|
|
1770
1748
|
return true;
|
|
1771
1749
|
}
|
|
1772
|
-
|
|
1773
|
-
//#region src/pipeline/image-sync.ts
|
|
1750
|
+
// src/pipeline/image-sync.ts
|
|
1774
1751
|
async function getDestinationFiles(destinationDirectory) {
|
|
1775
1752
|
const files = (await fse.readdir(destinationDirectory, { withFileTypes: true })).filter((entry) => entry.isFile());
|
|
1776
1753
|
return Promise.all(files.map(async (file) => {
|
|
@@ -1866,8 +1843,7 @@ async function isDifferent(diffStrategies, sourcePhotoInfo, sourcePhotoFileBaseN
|
|
|
1866
1843
|
for (const diffStrategy of diffStrategies) if (await strategyFindsDifference(diffStrategy)) return diffStrategy;
|
|
1867
1844
|
return false;
|
|
1868
1845
|
}
|
|
1869
|
-
|
|
1870
|
-
//#region src/index.ts
|
|
1846
|
+
// src/index.ts
|
|
1871
1847
|
/**
|
|
1872
1848
|
* Helper for deep merging ExportOptions object against library defaults.
|
|
1873
1849
|
* Exported for unplugin-aphex.
|
|
@@ -2003,5 +1979,4 @@ function cleanProcessResults(result) {
|
|
|
2003
1979
|
output: strippedOutput
|
|
2004
1980
|
};
|
|
2005
1981
|
}
|
|
2006
|
-
//#endregion
|
|
2007
1982
|
export { IMAGE_MIME_TYPES, defaultExportOptions, defaultSyncOptions, endExiftool, exportPhoto, exportPhotos, aphexAlbumInfo as getAlbumInfo, aphexPhotoInfo as getPhotoInfo, interactiveSessionStart, interactiveSessionStop, mergeDefaultExportOptions, processImage, setLogger };
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/aphex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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",
|
|
7
7
|
"apple-photos",
|
|
8
8
|
"photokit",
|
|
9
9
|
"photos",
|
|
10
|
-
"npm-package"
|
|
10
|
+
"npm-package",
|
|
11
|
+
"cli",
|
|
12
|
+
"homebrew-formula"
|
|
11
13
|
],
|
|
12
14
|
"homepage": "https://github.com/kitschpatrol/aphex",
|
|
13
15
|
"bugs": "https://github.com/kitschpatrol/aphex/issues",
|
|
@@ -36,19 +38,19 @@
|
|
|
36
38
|
"aphex": "./dist/aphex-swift"
|
|
37
39
|
},
|
|
38
40
|
"files": [
|
|
39
|
-
"dist
|
|
41
|
+
"dist"
|
|
40
42
|
],
|
|
41
43
|
"dependencies": {
|
|
42
44
|
"@sindresorhus/is": "^8.1.0",
|
|
43
45
|
"defu": "^6.1.7",
|
|
44
|
-
"execa": "^10.1
|
|
45
|
-
"exiftool-vendored": "^39.
|
|
46
|
-
"fast-equals": "^6.1
|
|
46
|
+
"execa": "^10.2.1",
|
|
47
|
+
"exiftool-vendored": "^39.1.0",
|
|
48
|
+
"fast-equals": "^6.2.1",
|
|
47
49
|
"fs-extra": "^11.4.1",
|
|
48
50
|
"github-slugger": "^2.0.0",
|
|
49
51
|
"image-size": "^2.0.4",
|
|
50
52
|
"importx": "^0.5.2",
|
|
51
|
-
"lognow": "^0.8.
|
|
53
|
+
"lognow": "^0.8.7",
|
|
52
54
|
"mrmime": "^2.0.1",
|
|
53
55
|
"piscina": "^5.3.2",
|
|
54
56
|
"type-fest": "^5.10.0"
|
|
@@ -56,10 +58,10 @@
|
|
|
56
58
|
"devDependencies": {
|
|
57
59
|
"@arethetypeswrong/core": "^0.18.5",
|
|
58
60
|
"@clack/prompts": "^1.8.1",
|
|
59
|
-
"@kitschpatrol/shared-config": "^8.
|
|
61
|
+
"@kitschpatrol/shared-config": "^8.14.0",
|
|
60
62
|
"@types/fs-extra": "^11.0.4",
|
|
61
63
|
"@types/node": "~24.13.6",
|
|
62
|
-
"@vitest/coverage-v8": "^5.0.
|
|
64
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
63
65
|
"brewpub": "^0.5.0",
|
|
64
66
|
"bumpp": "^12.3.0",
|
|
65
67
|
"globby": "^16.2.4",
|
|
@@ -67,13 +69,13 @@
|
|
|
67
69
|
"mdat-plugin-cli-help": "^3.4.1",
|
|
68
70
|
"open": "^11.0.4",
|
|
69
71
|
"pretty-bytes": "^7.2.0",
|
|
70
|
-
"pretty-ms": "^
|
|
72
|
+
"pretty-ms": "^10.0.0",
|
|
71
73
|
"publint": "^0.3.25",
|
|
72
|
-
"
|
|
73
|
-
"tsdown": "^0.23.
|
|
74
|
+
"shx": "^0.4.0",
|
|
75
|
+
"tsdown": "^0.23.4",
|
|
74
76
|
"tsx": "^4.23.15",
|
|
75
77
|
"typescript": "~6.0.3",
|
|
76
|
-
"vitest": "^5.0.
|
|
78
|
+
"vitest": "^5.0.5"
|
|
77
79
|
},
|
|
78
80
|
"engines": {
|
|
79
81
|
"node": "^24.16.0 || >=26.3.0"
|
|
@@ -92,9 +94,9 @@
|
|
|
92
94
|
"build:1-lib": "tsdown",
|
|
93
95
|
"build:2-native": "cd native/aphex-swift && ./build.sh",
|
|
94
96
|
"build:3-publint": "publint",
|
|
95
|
-
"clean-deep": "
|
|
96
|
-
"fix": "ksc fix && mdat ./native/aphex-swift/readme.md",
|
|
97
|
-
"lint": "ksc lint",
|
|
97
|
+
"clean-deep": "shx rm -f pnpm-lock.yaml && git clean -fdX",
|
|
98
|
+
"fix": "pnpm build && ksc fix && mdat ./native/aphex-swift/readme.md",
|
|
99
|
+
"lint": "pnpm build && ksc lint && mdat check ./native/aphex-swift/readme.md",
|
|
98
100
|
"release": "bumpp --commit 'Release: %s' && pnpm build && pnpm publish --otp $(op item get npm --otp) && brewpub --tap kitschpatrol/tap",
|
|
99
101
|
"test": "vitest run",
|
|
100
102
|
"test:coverage": "vitest run --coverage"
|