prodex 1.2.0 → 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,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PICK_ENTRIES_QUESTION = exports.OUTPUT_NAME_QUESTION = void 0;
4
+ /**
5
+ * 🧩 Centralized Inquirer question definitions.
6
+ * Each export is a named, reusable question set.
7
+ */
8
+ /** Ask for the output filename (used in produceOutput). */
9
+ exports.OUTPUT_NAME_QUESTION = [
10
+ {
11
+ type: "input",
12
+ name: "outputBase",
13
+ message: "Output file name (without extension):",
14
+ default: "combined",
15
+ filter: (v) => v.trim().replace(/[<>:\"/\\|?*]+/g, "_") || "combined",
16
+ },
17
+ ];
18
+ const PICK_ENTRIES_QUESTION = (choices, depth) => [
19
+ {
20
+ type: "checkbox",
21
+ name: "picks",
22
+ message: `Select entry files (depth ${depth})`,
23
+ choices,
24
+ loop: false,
25
+ pageSize: 20,
26
+ },
27
+ ];
28
+ exports.PICK_ENTRIES_QUESTION = PICK_ENTRIES_QUESTION;
package/dist/lib/utils.js CHANGED
@@ -4,12 +4,48 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.unique = unique;
5
5
  exports.setDiff = setDiff;
6
6
  exports.toArray = toArray;
7
+ exports.shortTimestamp = shortTimestamp;
8
+ exports.normalizePatterns = normalizePatterns;
9
+ const config_1 = require("../constants/config");
7
10
  function unique(arr) {
8
11
  return [...new Set(arr)];
9
12
  }
10
13
  function setDiff(A, B) {
11
- return new Set([...A].filter(x => !B.has(x)));
14
+ return new Set([...A].filter((x) => !B.has(x)));
12
15
  }
13
16
  function toArray(v) {
14
17
  return Array.isArray(v) ? v : [v];
15
18
  }
19
+ /** Compact YYMMDD-HHmm timestamp for versioned filenames. */
20
+ function shortTimestamp() {
21
+ const d = new Date();
22
+ const yy = String(d.getFullYear()).slice(-2);
23
+ const MM = String(d.getMonth() + 1).padStart(2, "0");
24
+ const dd = String(d.getDate()).padStart(2, "0");
25
+ const hh = String(d.getHours()).padStart(2, "0");
26
+ const mm = String(d.getMinutes()).padStart(2, "0");
27
+ return `${yy}${MM}${dd}-${hh}${mm}`;
28
+ }
29
+ function normalizePatterns(input) {
30
+ if (!input)
31
+ return [];
32
+ let arr;
33
+ if (typeof input === "string") {
34
+ arr = input.split(",").map((s) => s.trim());
35
+ }
36
+ else if (Array.isArray(input)) {
37
+ arr = input.map((s) => (typeof s === "string" ? s.trim() : ""));
38
+ }
39
+ else {
40
+ return [];
41
+ }
42
+ return arr
43
+ .filter((s) => s.length > 0)
44
+ .map((s) => s.replace(/\\/g, "/")) // normalize slashes
45
+ .filter((s) => {
46
+ const valid = config_1.VALID_GLOB_CHARS.test(s);
47
+ if (!valid)
48
+ console.warn(`⚠️ Invalid glob pattern skipped: "${s}"`);
49
+ return valid;
50
+ });
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prodex",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Unified Project Indexer & Dependency Extractor for Laravel + React + Node stacks.",
5
5
  "type": "commonjs",
6
6
  "bin": {