@ponderdev/justfits 0.0.0-stage → 1.3.0

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.
@@ -0,0 +1,9 @@
1
+ /* Just Fits' own styles. Everything else, from the page to the run part, is
2
+ the kit's (kit/kit.css); what is here is only what Just Fits alone has, and
3
+ uses the kit's tokens. */
4
+
5
+ /* The targets are grouped (Discord, email and messaging), and only
6
+ Just Fits has a grouped list: the group names read as headings, not as
7
+ choices. */
8
+ select optgroup { color: var(--muted); font-style: normal; }
9
+ select option { color: var(--text); }
package/src/scan.cjs ADDED
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ /*
4
+ * What a set of paths holds, for the window and the command line alike, so a
5
+ * folder means the same thing in both. The walk is the kit's folder intake
6
+ * (kit/scan.cjs, the same in every tool); what is Just Fits' own is here: the
7
+ * names it takes from inside a folder, and its own results (name-fits.mp4,
8
+ * name-fits 2.jpg), which are passed over so a folder fitted once and then
9
+ * again is not fitted on top of itself, and its results folders ("Holiday
10
+ * (fitted)"), for the same reason. A file named on its own is always taken,
11
+ * and the probe says whether it can be read.
12
+ */
13
+
14
+ const kit = require('./kit/scan.cjs');
15
+
16
+ const EXTENSIONS = new Set(['.mp4', '.mov', '.m4v', '.mkv', '.webm', '.avi', '.jpg', '.jpeg', '.png', '.heic', '.webp', '.gif']);
17
+ const OURS = /-fits( \d+)?$/i;
18
+
19
+ // What it did, for a folder's results folder: "Holiday (fitted)".
20
+ const WORD = 'fitted';
21
+
22
+ const scan = (paths) => kit.scan(paths, { extensions: [...EXTENSIONS], ours: OURS, word: WORD });
23
+
24
+ /*
25
+ * Where each file's result goes, for one run: a folder's results go into a
26
+ * new "Holiday (fitted)" beside it, chosen once per folder per run; a file on
27
+ * its own, or every file when beside is set (Save next to the originals
28
+ * instead), gets its result beside it. Either way a result is named
29
+ * name-fits.mp4 (decided 2026-11-20), so it reads as a result wherever it goes. Returns
30
+ * { outDir, suffix, folder } for the engine; folder is the results folder, or
31
+ * null beside the original.
32
+ */
33
+ function places({ beside = false } = {}) {
34
+ const chosen = new Map();
35
+ return (file) => {
36
+ if (beside || !file.from) return { outDir: undefined, suffix: undefined, folder: null };
37
+ if (!chosen.has(file.from)) chosen.set(file.from, kit.resultsFolder(file.from, WORD));
38
+ const folder = chosen.get(file.from);
39
+ return { outDir: kit.resultDir(file, folder), suffix: undefined, folder };
40
+ };
41
+ }
42
+
43
+ module.exports = { scan, places, EXTENSIONS, WORD };