@macrulez/devtoolz 0.3.3 → 0.4.1

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.
Files changed (85) hide show
  1. package/README.md +79 -3
  2. package/dist/cli.js +3 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/image-batch/backup.d.ts +22 -0
  5. package/dist/commands/image-batch/backup.js +55 -0
  6. package/dist/commands/image-batch/backup.js.map +1 -0
  7. package/dist/commands/image-batch/cache.d.ts +15 -0
  8. package/dist/commands/image-batch/cache.js +38 -0
  9. package/dist/commands/image-batch/cache.js.map +1 -0
  10. package/dist/commands/image-batch/cli.d.ts +15 -0
  11. package/dist/commands/image-batch/cli.js +307 -0
  12. package/dist/commands/image-batch/cli.js.map +1 -0
  13. package/dist/commands/image-batch/codecs.d.ts +38 -0
  14. package/dist/commands/image-batch/codecs.js +366 -0
  15. package/dist/commands/image-batch/codecs.js.map +1 -0
  16. package/dist/commands/image-batch/config.d.ts +120 -0
  17. package/dist/commands/image-batch/config.js +679 -0
  18. package/dist/commands/image-batch/config.js.map +1 -0
  19. package/dist/commands/image-batch/errors.d.ts +5 -0
  20. package/dist/commands/image-batch/errors.js +8 -0
  21. package/dist/commands/image-batch/errors.js.map +1 -0
  22. package/dist/commands/image-batch/geometry.d.ts +26 -0
  23. package/dist/commands/image-batch/geometry.js +90 -0
  24. package/dist/commands/image-batch/geometry.js.map +1 -0
  25. package/dist/commands/image-batch/inputs.d.ts +22 -0
  26. package/dist/commands/image-batch/inputs.js +87 -0
  27. package/dist/commands/image-batch/inputs.js.map +1 -0
  28. package/dist/commands/image-batch/manage-cli.d.ts +2 -0
  29. package/dist/commands/image-batch/manage-cli.js +276 -0
  30. package/dist/commands/image-batch/manage-cli.js.map +1 -0
  31. package/dist/commands/image-batch/manage.d.ts +51 -0
  32. package/dist/commands/image-batch/manage.js +1041 -0
  33. package/dist/commands/image-batch/manage.js.map +1 -0
  34. package/dist/commands/image-batch/overwrite.d.ts +14 -0
  35. package/dist/commands/image-batch/overwrite.js +31 -0
  36. package/dist/commands/image-batch/overwrite.js.map +1 -0
  37. package/dist/commands/image-batch/plan.d.ts +86 -0
  38. package/dist/commands/image-batch/plan.js +396 -0
  39. package/dist/commands/image-batch/plan.js.map +1 -0
  40. package/dist/commands/image-batch/process.d.ts +8 -0
  41. package/dist/commands/image-batch/process.js +97 -0
  42. package/dist/commands/image-batch/process.js.map +1 -0
  43. package/dist/commands/image-batch/report.d.ts +6 -0
  44. package/dist/commands/image-batch/report.js +251 -0
  45. package/dist/commands/image-batch/report.js.map +1 -0
  46. package/dist/commands/image-batch/restore.d.ts +29 -0
  47. package/dist/commands/image-batch/restore.js +125 -0
  48. package/dist/commands/image-batch/restore.js.map +1 -0
  49. package/dist/commands/image-batch/run.d.ts +123 -0
  50. package/dist/commands/image-batch/run.js +649 -0
  51. package/dist/commands/image-batch/run.js.map +1 -0
  52. package/dist/commands/image-batch/sharpen-ask.d.ts +6 -0
  53. package/dist/commands/image-batch/sharpen-ask.js +53 -0
  54. package/dist/commands/image-batch/sharpen-ask.js.map +1 -0
  55. package/dist/commands/image-batch/sharpen-manage.d.ts +26 -0
  56. package/dist/commands/image-batch/sharpen-manage.js +238 -0
  57. package/dist/commands/image-batch/sharpen-manage.js.map +1 -0
  58. package/dist/commands/image-batch/sharpen-presets.d.ts +24 -0
  59. package/dist/commands/image-batch/sharpen-presets.js +145 -0
  60. package/dist/commands/image-batch/sharpen-presets.js.map +1 -0
  61. package/dist/commands/image-batch/sharpen.d.ts +46 -0
  62. package/dist/commands/image-batch/sharpen.js +159 -0
  63. package/dist/commands/image-batch/sharpen.js.map +1 -0
  64. package/dist/commands/image-batch/template.d.ts +45 -0
  65. package/dist/commands/image-batch/template.js +142 -0
  66. package/dist/commands/image-batch/template.js.map +1 -0
  67. package/dist/commands/image-hash/sharp-loader.d.ts +2 -0
  68. package/dist/commands/image-hash/sharp-loader.js +7 -5
  69. package/dist/commands/image-hash/sharp-loader.js.map +1 -1
  70. package/dist/format/bytes.d.ts +2 -0
  71. package/dist/format/bytes.js +17 -0
  72. package/dist/format/bytes.js.map +1 -0
  73. package/dist/index.d.ts +5 -0
  74. package/dist/index.js +3 -0
  75. package/dist/index.js.map +1 -1
  76. package/dist/utils/closest.d.ts +2 -0
  77. package/dist/utils/closest.js +35 -0
  78. package/dist/utils/closest.js.map +1 -0
  79. package/dist/utils/glob.d.ts +4 -0
  80. package/dist/utils/glob.js +86 -0
  81. package/dist/utils/glob.js.map +1 -0
  82. package/dist/utils/tty.d.ts +60 -0
  83. package/dist/utils/tty.js +390 -0
  84. package/dist/utils/tty.js.map +1 -0
  85. package/package.json +1 -1
@@ -0,0 +1,123 @@
1
+ import type { VibesOptions } from '../../format/vibes.js';
2
+ import { type TerminalIO } from '../../utils/tty.js';
3
+ import { type CodecMap, type OutputFormatName, type QualityInput } from './codecs.js';
4
+ import { type BatchConfig, type PlaceholderSettings } from './config.js';
5
+ import type { Fit } from './geometry.js';
6
+ import { type ConflictPrompt, type OverwriteMode } from './overwrite.js';
7
+ import { type Placement, type SharpFn } from './plan.js';
8
+ import type { SharpenLayer } from './sharpen.js';
9
+ export interface BatchOverrides {
10
+ widths?: number[];
11
+ heights?: number[];
12
+ formats?: string[];
13
+ quality?: QualityInput;
14
+ codecs?: CodecMap;
15
+ fit?: Fit;
16
+ name?: string;
17
+ flatten?: boolean | string;
18
+ longEdge?: number[];
19
+ shortEdge?: number[];
20
+ megapixels?: number[];
21
+ percent?: number[];
22
+ matchOrientation?: boolean;
23
+ maxBytes?: number;
24
+ sharpen?: SharpenLayer;
25
+ }
26
+ export interface BatchProgress {
27
+ done: number;
28
+ total: number;
29
+ }
30
+ export interface ReplaceSummary {
31
+ count: number;
32
+ bytes: number;
33
+ backupDir: string | null;
34
+ }
35
+ export interface ImageBatchOptions {
36
+ paths: string[];
37
+ cwd: string;
38
+ out?: string;
39
+ beside?: boolean;
40
+ replace?: boolean;
41
+ backup?: string | false;
42
+ onlyIfSmaller?: boolean;
43
+ config?: BatchConfig;
44
+ configLabel?: string;
45
+ overrides?: BatchOverrides;
46
+ recursive?: boolean;
47
+ extensions?: string[];
48
+ ignoreGlobs?: string[];
49
+ respectGitignore?: boolean;
50
+ include?: string[];
51
+ exclude?: string[];
52
+ flat?: boolean;
53
+ list?: boolean;
54
+ select?: boolean;
55
+ overwrite?: OverwriteMode;
56
+ force?: boolean;
57
+ placeholders?: PlaceholderSettings;
58
+ emit?: string;
59
+ keyPrefix?: string;
60
+ cache?: string | false;
61
+ cacheBase?: string;
62
+ globalDir?: string;
63
+ concurrency?: number;
64
+ maxPixels?: number;
65
+ dryRun?: boolean;
66
+ assumeYes?: boolean;
67
+ sharp?: SharpFn;
68
+ io?: TerminalIO;
69
+ interactive?: boolean;
70
+ prompt?: ConflictPrompt;
71
+ confirm?: (summary: ReplaceSummary) => Promise<boolean>;
72
+ now?: Date;
73
+ style?: VibesOptions;
74
+ onProgress?: (progress: BatchProgress) => void;
75
+ }
76
+ export type JobStatus = 'written' | 'up-to-date' | 'skipped' | 'conflict' | 'would-write' | 'would-overwrite' | 'replaced' | 'kept' | 'already-processed' | 'would-replace' | 'would-keep' | 'error';
77
+ export interface BatchJobResult {
78
+ source: string;
79
+ output: string;
80
+ recipe: string;
81
+ format: OutputFormatName;
82
+ width: number;
83
+ height: number;
84
+ status: JobStatus;
85
+ bytes?: number;
86
+ before?: number;
87
+ message?: string;
88
+ }
89
+ export interface BatchSourceSummary {
90
+ file: string;
91
+ width: number;
92
+ height: number;
93
+ format: string;
94
+ bytes: number;
95
+ }
96
+ export interface ImageBatchReport {
97
+ placement: Placement;
98
+ out: string;
99
+ backupDir?: string;
100
+ backupEnabled: boolean;
101
+ configLabel?: string;
102
+ dryRun: boolean;
103
+ listOnly: boolean;
104
+ sources: BatchSourceSummary[];
105
+ failures: {
106
+ file: string;
107
+ message: string;
108
+ }[];
109
+ unmatched: string[];
110
+ derived: string[];
111
+ vectors: string[];
112
+ results: BatchJobResult[];
113
+ counts: Record<JobStatus, number>;
114
+ deduped: number;
115
+ bytesIn: number;
116
+ bytesOut: number;
117
+ emitPath?: string;
118
+ aborted: boolean;
119
+ cancelled: boolean;
120
+ nothingSelected: boolean;
121
+ exitCode: number;
122
+ }
123
+ export declare function runImageBatch(options: ImageBatchOptions): Promise<ImageBatchReport>;