prodex 1.0.4 โ 1.0.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/README.md +19 -80
- package/dist/README.md +19 -80
- package/dist/package.json +1 -1
- package/dist/src/cli/init.js +7 -0
- package/dist/src/cli/picker.js +19 -6
- package/dist/src/constants/config-loader.js +2 -4
- package/dist/src/core/combine.js +1 -5
- package/dist/src/core/helpers.js +16 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
## ๐ง Recent Fixes & Updates โ v1.0.
|
|
8
|
+
## ๐ง Recent Fixes & Updates โ v1.0.6
|
|
9
|
+
- โญ **Priority Files Support** โ priority files will now appear **first** on the entry selection list.
|
|
9
10
|
|
|
10
11
|
- ๐ช **Windows path resolution fixed** โ now uses proper `file://` URLs for full ESM compatibility.
|
|
11
12
|
- ๐งพ **Improved output naming** โ automatic, context-aware filenames (e.g. `prodex-[entries]-combined.txt`).
|
|
@@ -27,64 +28,6 @@
|
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
30
|
-
## ๐ฆ Installation
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npm install -g prodex
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
or locally:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install --save-dev prodex
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## ๐งฐ Usage
|
|
45
|
-
|
|
46
|
-
Run from your project root:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
prodex
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
or:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx prodex
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Youโll be guided through an interactive CLI:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
๐งฉ Prodex โ Project Indexer
|
|
62
|
-
๐งฉ Active Config:
|
|
63
|
-
โข Output Directory: ./prodex/
|
|
64
|
-
โข Scan Depth: 2
|
|
65
|
-
โข Base Dirs: app, routes, resources/js
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
After selecting entries:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
โ
prodex-[entries]-combined.txt written (12 file(s)).
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## ๐ Output Example
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
## ==== path: app/Services/Shots/ComputeService.php ====
|
|
80
|
-
## #region app/Services/Shots/ComputeService.php
|
|
81
|
-
<?php
|
|
82
|
-
// your code here...
|
|
83
|
-
## #endregion
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
31
|
## โ๏ธ Configuration
|
|
89
32
|
|
|
90
33
|
Optional `.prodex.json` (in project root):
|
|
@@ -107,36 +50,31 @@ Optional `.prodex.json` (in project root):
|
|
|
107
50
|
"importExcludes": [
|
|
108
51
|
"node_modules",
|
|
109
52
|
"@shadcn/"
|
|
110
|
-
]
|
|
53
|
+
],
|
|
54
|
+
"priorityFiles": [
|
|
55
|
+
"routes/web.php",
|
|
56
|
+
"routes/api.php",
|
|
57
|
+
"index",
|
|
58
|
+
"main",
|
|
59
|
+
"app"
|
|
60
|
+
]
|
|
111
61
|
}
|
|
112
62
|
```
|
|
113
63
|
|
|
114
|
-
|
|
64
|
+
```
|
|
115
65
|
|
|
116
|
-
## โก CLI Flags (UNTESTED)
|
|
117
66
|
|
|
118
|
-
| Flag | Description |
|
|
119
|
-
|------|-------------|
|
|
120
|
-
| `--limit <n>` | Override max dependency count |
|
|
121
|
-
| `--output <dir>` | Custom output directory |
|
|
122
|
-
| `--depth <n>` | Set scan depth |
|
|
123
|
-
| `--no-chain` | Disable dependency chain following |
|
|
124
|
-
| `--debug` | Enable verbose logging |
|
|
125
67
|
|
|
126
|
-
Example:
|
|
127
|
-
```bash
|
|
128
|
-
prodex --depth 3 --output ./dump --limit 500
|
|
129
68
|
```
|
|
130
69
|
|
|
131
|
-
---
|
|
132
70
|
|
|
133
|
-
## ๐งฉ Workflow Overview
|
|
134
71
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
72
|
+
Files are matched using `.includes()` (case-insensitive), so `"index"` will match `src/index.js`, `app/index.tsx`, etc.
|
|
73
|
+
Recommended entries appear at the top of the picker under a **โญ Recommended entries** section.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
140
78
|
|
|
141
79
|
---
|
|
142
80
|
|
|
@@ -188,4 +126,5 @@ Issues and contributions welcome:
|
|
|
188
126
|
|
|
189
127
|
---
|
|
190
128
|
|
|
191
|
-
**Prodex** โ *
|
|
129
|
+
**Prodex** โ *Codebase, decoded*
|
|
130
|
+
|
package/dist/README.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
## ๐ง Recent Fixes & Updates โ v1.0.
|
|
8
|
+
## ๐ง Recent Fixes & Updates โ v1.0.6
|
|
9
|
+
- โญ **Priority Files Support** โ priority files will now appear **first** on the entry selection list.
|
|
9
10
|
|
|
10
11
|
- ๐ช **Windows path resolution fixed** โ now uses proper `file://` URLs for full ESM compatibility.
|
|
11
12
|
- ๐งพ **Improved output naming** โ automatic, context-aware filenames (e.g. `prodex-[entries]-combined.txt`).
|
|
@@ -27,64 +28,6 @@
|
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
30
|
-
## ๐ฆ Installation
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npm install -g prodex
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
or locally:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install --save-dev prodex
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## ๐งฐ Usage
|
|
45
|
-
|
|
46
|
-
Run from your project root:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
prodex
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
or:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx prodex
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Youโll be guided through an interactive CLI:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
๐งฉ Prodex โ Project Indexer
|
|
62
|
-
๐งฉ Active Config:
|
|
63
|
-
โข Output Directory: ./prodex/
|
|
64
|
-
โข Scan Depth: 2
|
|
65
|
-
โข Base Dirs: app, routes, resources/js
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
After selecting entries:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
โ
prodex-[entries]-combined.txt written (12 file(s)).
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## ๐ Output Example
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
## ==== path: app/Services/Shots/ComputeService.php ====
|
|
80
|
-
## #region app/Services/Shots/ComputeService.php
|
|
81
|
-
<?php
|
|
82
|
-
// your code here...
|
|
83
|
-
## #endregion
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
31
|
## โ๏ธ Configuration
|
|
89
32
|
|
|
90
33
|
Optional `.prodex.json` (in project root):
|
|
@@ -107,36 +50,31 @@ Optional `.prodex.json` (in project root):
|
|
|
107
50
|
"importExcludes": [
|
|
108
51
|
"node_modules",
|
|
109
52
|
"@shadcn/"
|
|
110
|
-
]
|
|
53
|
+
],
|
|
54
|
+
"priorityFiles": [
|
|
55
|
+
"routes/web.php",
|
|
56
|
+
"routes/api.php",
|
|
57
|
+
"index",
|
|
58
|
+
"main",
|
|
59
|
+
"app"
|
|
60
|
+
]
|
|
111
61
|
}
|
|
112
62
|
```
|
|
113
63
|
|
|
114
|
-
|
|
64
|
+
```
|
|
115
65
|
|
|
116
|
-
## โก CLI Flags (UNTESTED)
|
|
117
66
|
|
|
118
|
-
| Flag | Description |
|
|
119
|
-
|------|-------------|
|
|
120
|
-
| `--limit <n>` | Override max dependency count |
|
|
121
|
-
| `--output <dir>` | Custom output directory |
|
|
122
|
-
| `--depth <n>` | Set scan depth |
|
|
123
|
-
| `--no-chain` | Disable dependency chain following |
|
|
124
|
-
| `--debug` | Enable verbose logging |
|
|
125
67
|
|
|
126
|
-
Example:
|
|
127
|
-
```bash
|
|
128
|
-
prodex --depth 3 --output ./dump --limit 500
|
|
129
68
|
```
|
|
130
69
|
|
|
131
|
-
---
|
|
132
70
|
|
|
133
|
-
## ๐งฉ Workflow Overview
|
|
134
71
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
72
|
+
Files are matched using `.includes()` (case-insensitive), so `"index"` will match `src/index.js`, `app/index.tsx`, etc.
|
|
73
|
+
Recommended entries appear at the top of the picker under a **โญ Recommended entries** section.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
140
78
|
|
|
141
79
|
---
|
|
142
80
|
|
|
@@ -188,4 +126,5 @@ Issues and contributions welcome:
|
|
|
188
126
|
|
|
189
127
|
---
|
|
190
128
|
|
|
191
|
-
**Prodex** โ *
|
|
129
|
+
**Prodex** โ *Codebase, decoded*
|
|
130
|
+
|
package/dist/package.json
CHANGED
package/dist/src/cli/init.js
CHANGED
|
@@ -26,6 +26,13 @@ export async function initProdex() {
|
|
|
26
26
|
"@hooks": "resources/js/hooks",
|
|
27
27
|
"@data": "resources/js/data"
|
|
28
28
|
},
|
|
29
|
+
"priorityFiles": [
|
|
30
|
+
"routes/web.php",
|
|
31
|
+
"routes/api.php",
|
|
32
|
+
"index",
|
|
33
|
+
"main",
|
|
34
|
+
"app"
|
|
35
|
+
],
|
|
29
36
|
"entryExcludes": [
|
|
30
37
|
"resources/js/components/ui/",
|
|
31
38
|
"app/DTOs/"
|
package/dist/src/cli/picker.js
CHANGED
|
@@ -2,9 +2,9 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import inquirer from "inquirer";
|
|
4
4
|
import { ROOT } from "../constants/config.js";
|
|
5
|
-
import { walk, rel } from "../core/helpers.js";
|
|
5
|
+
import { walk, rel, sortWithPriority } from "../core/helpers.js";
|
|
6
6
|
|
|
7
|
-
export async function pickEntries(baseDirs, depth = 2) {
|
|
7
|
+
export async function pickEntries(baseDirs, depth = 2, cfg = {}) {
|
|
8
8
|
let selected = [];
|
|
9
9
|
while (true) {
|
|
10
10
|
const files = [];
|
|
@@ -14,10 +14,23 @@ export async function pickEntries(baseDirs, depth = 2) {
|
|
|
14
14
|
for (const f of walk(full, 0, depth)) files.push(f);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const sorted = sortWithPriority(files, cfg.priorityFiles);
|
|
18
|
+
|
|
19
|
+
const prioritized = sorted.filter(f =>
|
|
20
|
+
cfg.priorityFiles?.some(p =>
|
|
21
|
+
rel(f).replaceAll("\\", "/").toLowerCase().includes(p.toLowerCase())
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const choices = sorted.map(f => ({
|
|
26
|
+
name: prioritized.includes(f) ? `โญ ${rel(f)}` : rel(f),
|
|
27
|
+
value: f
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
if (prioritized.length) {
|
|
31
|
+
choices.unshift(new inquirer.Separator("โญ Recommended entries"));
|
|
32
|
+
choices.splice(prioritized.length + 1, 0, new inquirer.Separator("โ Other files"));
|
|
33
|
+
}
|
|
21
34
|
|
|
22
35
|
const { picks } = await inquirer.prompt([
|
|
23
36
|
{
|
|
@@ -2,7 +2,6 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import {
|
|
4
4
|
ROOT,
|
|
5
|
-
|
|
6
5
|
CODE_EXTS,
|
|
7
6
|
ENTRY_EXCLUDES,
|
|
8
7
|
IMPORT_EXCLUDES,
|
|
@@ -28,12 +27,10 @@ export function loadProdexConfig() {
|
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
// Resolve output directory (always a folder now)
|
|
32
30
|
const outputDir = userConfig.output
|
|
33
31
|
? path.resolve(ROOT, userConfig.output)
|
|
34
32
|
: path.join(ROOT, "prodex");
|
|
35
33
|
|
|
36
|
-
// Ensure directory exists
|
|
37
34
|
try {
|
|
38
35
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
39
36
|
} catch (e) {
|
|
@@ -48,7 +45,8 @@ export function loadProdexConfig() {
|
|
|
48
45
|
importExcludes: [...IMPORT_EXCLUDES, ...(userConfig.importExcludes || [])],
|
|
49
46
|
baseDirs: [...new Set([...(userConfig.baseDirs || []), ...BASE_DIRS])],
|
|
50
47
|
aliasOverrides: userConfig.aliasOverrides || {},
|
|
51
|
-
limit: userConfig.limit || 200
|
|
48
|
+
limit: userConfig.limit || 200,
|
|
49
|
+
priorityFiles: userConfig.priorityFiles || []
|
|
52
50
|
};
|
|
53
51
|
|
|
54
52
|
console.log("?? Active Config:");
|
package/dist/src/core/combine.js
CHANGED
|
@@ -20,7 +20,7 @@ export async function runCombine() {
|
|
|
20
20
|
const cfg = loadProdexConfig();
|
|
21
21
|
const { baseDirs, scanDepth } = cfg;
|
|
22
22
|
|
|
23
|
-
const entries = await pickEntries(baseDirs, scanDepth);
|
|
23
|
+
const entries = await pickEntries(baseDirs, scanDepth, cfg);
|
|
24
24
|
if (!entries.length) {
|
|
25
25
|
console.log("โ No entries selected.");
|
|
26
26
|
return;
|
|
@@ -41,7 +41,6 @@ export async function runCombine() {
|
|
|
41
41
|
proceed = true;
|
|
42
42
|
|
|
43
43
|
if (!yesToAll) {
|
|
44
|
-
// clone static prompts with dynamic defaults
|
|
45
44
|
const combinePrompts = PROMPTS.combine.map(p => ({
|
|
46
45
|
...p,
|
|
47
46
|
default:
|
|
@@ -64,7 +63,6 @@ export async function runCombine() {
|
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
// ensure output directory exists
|
|
68
66
|
try {
|
|
69
67
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
70
68
|
} catch {
|
|
@@ -104,8 +102,6 @@ const regionEnd = "##endregion";
|
|
|
104
102
|
function render(p) {
|
|
105
103
|
const ext = path.extname(p);
|
|
106
104
|
let s = read(p);
|
|
107
|
-
// s = stripComments(s, ext);
|
|
108
|
-
s = normalizeIndent(s);
|
|
109
105
|
return `${header(p)}\n${regionStart(p)}\n${s}\n${regionEnd}\n\n`;
|
|
110
106
|
}
|
|
111
107
|
|
package/dist/src/core/helpers.js
CHANGED
|
@@ -23,14 +23,12 @@ export function normalizeIndent(s) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function stripComments(code, ext) {
|
|
26
|
-
// Fast path for PHP or non-JS files โ simple regex is fine
|
|
27
26
|
if (ext === ".php") {
|
|
28
27
|
return code
|
|
29
|
-
.replace(/\/\*[\s\S]*?\*\//g, "")
|
|
30
|
-
.replace(/^\s*#.*$/gm, "");
|
|
28
|
+
.replace(/\/\*[\s\S]*?\*\//g, "")
|
|
29
|
+
.replace(/^\s*#.*$/gm, "");
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
// Robust JS/TS-safe parser โ avoids stripping inside strings
|
|
34
32
|
let out = "";
|
|
35
33
|
let inStr = false;
|
|
36
34
|
let strChar = "";
|
|
@@ -93,7 +91,6 @@ export function stripComments(code, ext) {
|
|
|
93
91
|
return out;
|
|
94
92
|
}
|
|
95
93
|
|
|
96
|
-
|
|
97
94
|
export function isEntryExcluded(p) {
|
|
98
95
|
const r = rel(p);
|
|
99
96
|
return ENTRY_EXCLUDES.some(ex => r.startsWith(ex) || r.includes(ex));
|
|
@@ -114,3 +111,17 @@ export function* walk(dir, depth = 0, maxDepth = 2) {
|
|
|
114
111
|
}
|
|
115
112
|
}
|
|
116
113
|
}
|
|
114
|
+
|
|
115
|
+
export function sortWithPriority(files, priorityList = []) {
|
|
116
|
+
if (!priorityList.length) return files;
|
|
117
|
+
const prioritized = [];
|
|
118
|
+
const normal = [];
|
|
119
|
+
|
|
120
|
+
for (const f of files) {
|
|
121
|
+
const normalized = f.replaceAll("\\", "/").toLowerCase();
|
|
122
|
+
if (priorityList.some(p => normalized.includes(p.toLowerCase()))) prioritized.push(f);
|
|
123
|
+
else normal.push(f);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return [...new Set([...prioritized, ...normal])];
|
|
127
|
+
}
|