prodex 1.3.0 → 1.4.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.
Files changed (114) hide show
  1. package/README.md +234 -234
  2. package/dist/cli/cli-input.js +21 -26
  3. package/dist/cli/cli-input.js.map +1 -0
  4. package/dist/cli/flags.js +1 -0
  5. package/dist/cli/flags.js.map +1 -0
  6. package/dist/cli/init.js +5 -5
  7. package/dist/cli/init.js.map +1 -0
  8. package/dist/cli/picker.js +9 -7
  9. package/dist/cli/picker.js.map +1 -0
  10. package/dist/cli/summary.js +16 -9
  11. package/dist/cli/summary.js.map +1 -0
  12. package/dist/constants/cache-keys.js +12 -0
  13. package/dist/constants/cache-keys.js.map +1 -0
  14. package/dist/constants/config-loader.js +2 -2
  15. package/dist/constants/config-loader.js.map +1 -0
  16. package/dist/constants/config.js +7 -5
  17. package/dist/constants/config.js.map +1 -0
  18. package/dist/constants/default-config.js +1 -0
  19. package/dist/constants/default-config.js.map +1 -0
  20. package/dist/constants/flags.js +74 -0
  21. package/dist/constants/flags.js.map +1 -0
  22. package/dist/constants/index.js +21 -0
  23. package/dist/constants/index.js.map +1 -0
  24. package/dist/constants/render-constants.js +1 -4
  25. package/dist/constants/render-constants.js.map +1 -0
  26. package/dist/core/cache.js +54 -0
  27. package/dist/core/cache.js.map +1 -0
  28. package/dist/core/combine.js +32 -13
  29. package/dist/core/combine.js.map +1 -0
  30. package/dist/core/config-manager.js +104 -0
  31. package/dist/core/config-manager.js.map +1 -0
  32. package/dist/core/dependency.js +40 -19
  33. package/dist/core/dependency.js.map +1 -0
  34. package/dist/core/file-utils.js +1 -41
  35. package/dist/core/file-utils.js.map +1 -0
  36. package/dist/core/helpers.js +43 -38
  37. package/dist/core/helpers.js.map +1 -0
  38. package/dist/core/managers/cache.js +54 -0
  39. package/dist/core/managers/cache.js.map +1 -0
  40. package/dist/core/managers/config-manager.js +104 -0
  41. package/dist/core/managers/config-manager.js.map +1 -0
  42. package/dist/core/managers/config.js +104 -0
  43. package/dist/core/managers/config.js.map +1 -0
  44. package/dist/core/output.js +1 -0
  45. package/dist/core/output.js.map +1 -0
  46. package/dist/core/parsers/extract-imports.js +2 -7
  47. package/dist/core/parsers/extract-imports.js.map +1 -0
  48. package/dist/core/renderers.js +10 -8
  49. package/dist/core/renderers.js.map +1 -0
  50. package/dist/debug.js +14 -0
  51. package/dist/debug.js.map +1 -0
  52. package/dist/index.js +43 -13
  53. package/dist/index.js.map +1 -0
  54. package/dist/lib/logger.js +38 -9
  55. package/dist/lib/logger.js.map +1 -0
  56. package/dist/lib/polyfills.js +1 -10
  57. package/dist/lib/polyfills.js.map +1 -0
  58. package/dist/lib/prompt.js +1 -0
  59. package/dist/lib/prompt.js.map +1 -0
  60. package/dist/lib/questions.js +1 -0
  61. package/dist/lib/questions.js.map +1 -0
  62. package/dist/lib/utils.js +1 -13
  63. package/dist/lib/utils.js.map +1 -0
  64. package/dist/resolvers/js/alias-loader.js +1 -0
  65. package/dist/resolvers/js/alias-loader.js.map +1 -0
  66. package/dist/resolvers/js/extract-imports.js +46 -0
  67. package/dist/resolvers/js/extract-imports.js.map +1 -0
  68. package/dist/resolvers/js/js-resolver.js +93 -116
  69. package/dist/resolvers/js/js-resolver.js.map +1 -0
  70. package/dist/resolvers/js/resolve-alias.js +58 -0
  71. package/dist/resolvers/js/resolve-alias.js.map +1 -0
  72. package/dist/resolvers/php/bindings.js +21 -9
  73. package/dist/resolvers/php/bindings.js.map +1 -0
  74. package/dist/resolvers/php/extract-imports.js +50 -0
  75. package/dist/resolvers/php/extract-imports.js.map +1 -0
  76. package/dist/resolvers/php/patterns.js +37 -4
  77. package/dist/resolvers/php/patterns.js.map +1 -0
  78. package/dist/resolvers/php/php-resolver.js +99 -59
  79. package/dist/resolvers/php/php-resolver.js.map +1 -0
  80. package/dist/resolvers/php/psr4.js +19 -5
  81. package/dist/resolvers/php/psr4.js.map +1 -0
  82. package/dist/resolvers/shared/excludes.js +1 -0
  83. package/dist/resolvers/shared/excludes.js.map +1 -0
  84. package/dist/resolvers/shared/file-cache.js +1 -29
  85. package/dist/resolvers/shared/file-cache.js.map +1 -0
  86. package/dist/resolvers/shared/resolve-alias.js +62 -0
  87. package/dist/resolvers/shared/resolve-alias.js.map +1 -0
  88. package/dist/resolvers/shared/stats.js +3 -3
  89. package/dist/resolvers/shared/stats.js.map +1 -0
  90. package/dist/shared/collections.js +34 -0
  91. package/dist/shared/collections.js.map +1 -0
  92. package/dist/shared/index.js +20 -0
  93. package/dist/shared/index.js.map +1 -0
  94. package/dist/shared/io.js +52 -0
  95. package/dist/shared/io.js.map +1 -0
  96. package/dist/shared/patterns.js +30 -0
  97. package/dist/shared/patterns.js.map +1 -0
  98. package/dist/shared/stats.js +32 -0
  99. package/dist/shared/stats.js.map +1 -0
  100. package/dist/store.js +16 -0
  101. package/dist/store.js.map +1 -0
  102. package/dist/types/cli.types.js +1 -0
  103. package/dist/types/cli.types.js.map +1 -0
  104. package/dist/types/config.types.js +1 -0
  105. package/dist/types/config.types.js.map +1 -0
  106. package/dist/types/core.types.js +1 -0
  107. package/dist/types/core.types.js.map +1 -0
  108. package/dist/types/index.js +1 -0
  109. package/dist/types/index.js.map +1 -0
  110. package/dist/types/resolver.types.js +1 -0
  111. package/dist/types/resolver.types.js.map +1 -0
  112. package/dist/types/utils.types.js +1 -0
  113. package/dist/types/utils.types.js.map +1 -0
  114. package/package.json +5 -4
package/README.md CHANGED
@@ -1,234 +1,234 @@
1
- # 🧩 Prodex v1.2.0
2
-
3
- > **Build the maze, I'll write a map.**
4
-
5
- ---
6
-
7
- ## 🧠 What’s New — v1.2.0
8
-
9
- - 🆕 **Full CLI support with integrated [Sade](https://github.com/lukeed/sade).**
10
- Prodex now runs entirely from the terminal — no `prodex.json` required.
11
- Supports short flags and native glob patterns for flexible targeting.
12
-
13
- ```bash
14
- prodex -f "**/web.php,**/app.tsx" -i "**/*.d.ts" -x "node_modules/**"
15
- ```
16
-
17
- ```bash
18
- prodex --files "**/web.php,**/app.tsx" --include **/*types.ts --exclude "@shadcn/**"
19
- ```
20
-
21
- - 🧾 **Markdown mode added and now default.**
22
- Output is fully fenced and linkable — jump between the index and any code block.
23
- Text mode remains available using `--txt` or `-t`.
24
-
25
- - 🗂 **Output naming improved.**
26
- Output files are now versioned by default.
27
- Custom names are supported using `--name` or `-n`.
28
- Naming conventions have been updated for cleaner, consistent results.
29
-
30
- ---
31
-
32
- ## ⚙️ Usage
33
-
34
- Prodex v1.2.0 runs entirely from the command line.
35
- Interactive mode is currently unstable — use CLI flags instead.
36
-
37
- ### Installation
38
-
39
- ```bash
40
- npm install -g prodex
41
- ```
42
-
43
- Or run without installing:
44
-
45
- ```bash
46
- npx prodex
47
- ```
48
-
49
- ---
50
-
51
- ### Basic Run
52
-
53
- ```bash
54
- prodex -f "**/web.php,**/app.tsx"
55
- ```
56
-
57
- ### With Includes, exclude, and Custom Name
58
-
59
- ```bash
60
- prodex -f "**/web.php,**/app.tsx" -i "**/*.d.ts" -x "node_modules/**" -n "combined-output"
61
- ```
62
-
63
- ### Flag Reference
64
-
65
- | Flag | Short | Description |
66
- | ----------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
67
- | `--files` | `-f` | Entry files — starting points for dependency resolution. Accepts multiple names or globs. |
68
- | `--include` | `-i` | Adds extra files or patterns to include (e.g. `.d.ts`, interface, or type files). These files are **not dependency-resolved** — they’re appended as-is. |
69
- | `--exclude` | `-x` | Patterns or folders to skip during the scan. |
70
- | `--name` | `-n` | Custom output filename (without extension). Versioning still applies automatically. |
71
-
72
- > Globs are powered by [Fast-Glob](https://github.com/mrmlnc/fast-glob).
73
- > Use **comma-separated values** for multiple entries.
74
- > Wrap globs in quotes when they include special characters like `|` or `&`.
75
-
76
- ---
77
-
78
- ## 🧭 Plans
79
-
80
- - **Alias Resolution Improvements**
81
- Planned overhaul of alias handling to support deeper nested paths, wildcard matching, and auto-mapped imports across mixed stacks.
82
-
83
- - **Language Support**
84
- Currently supports **JavaScript**, **React**, and **Laravel + React** stacks.
85
- May work with other frameworks but remains untested.
86
- Broader multi-language support is planned for future versions.
87
-
88
- - **Combined Output**
89
- All code from multiple entries is merged into a single output file.
90
- There’s currently **no limit** on output size, but it’s advised to avoid combining _too many large entries_ in a single run.
91
- Future versions will include **smart naming** and **automatic splitting** for oversized outputs.
92
-
93
- - **Performance Optimizations**
94
- Planned improvements to resolver speed and dependency traversal for faster processing on large projects.
95
-
96
- ---
97
-
98
- ## 🧩 Features
99
-
100
- | Status | Feature | Description |
101
- | :----: | --------------------------- | ---------------------------------------------------------------------------------------------- |
102
- | ✅ | **Cross-language indexing** | Resolves imports across JS, TS, React, and PHP (Laravel) projects. |
103
- | ✅ | **Markdown output** | Generates clean `.md` files with anchors, back-to-top links, and fenced code blocks. |
104
- | ✅ | **Text output** | Optional `.txt` mode using `--txt` or `-t`. |
105
- | ✅ | **Glob support** | Works with flexible glob patterns powered by [Fast-Glob](https://github.com/mrmlnc/fast-glob). |
106
- | ✅ | **Custom output names** | Define your own output prefix using `--name` or `-n`. |
107
- | ⚠️ | **Interactive picker (UI)** | Still unstable — not recommended for production use. |
108
- | ⚠️ | **Alias resolution** | Basic alias mapping supported; advanced cases in progress. |
109
- | 🚧 | **Smart file splitting** | Planned for large combined outputs. |
110
- | 🚧 | **PSR-4 deep scan** | Planned to improve PHP dependency resolution. |
111
- | 🚧 | **Speed optimization** | Further resolver and I/O improvements under development. |
112
-
113
- ---
114
-
115
- ## 🧱 Use Cases
116
-
117
- Prodex can technically combine your entire codebase into one file —
118
- but it’s **best used in parts**, focusing on specific sections or features.
119
- Each run produces a clean, self-contained map showing all related files and dependencies.
120
-
121
- ### 🧩 Common Scenarios
122
-
123
- - **🤖 Project Awareness for AI Assistants**
124
- Generate compact `.md` summaries of key parts of your project.
125
- These can be shared with AI tools (like ChatGPT, Claude, or Copilot) to give them structured context about your codebase — without exposing unnecessary files.
126
-
127
- - **📦 Feature or Module Mapping**
128
- Combine everything connected to a specific feature (e.g., `Checkout`, `Dashboard`, or `Payments`).
129
- Prodex gathers all linked imports, helpers, and files into one readable document.
130
-
131
- - **🔍 Dependency Insight**
132
- Trace how a particular entry file connects through your stack — whether it’s `app.tsx` on the frontend or `routes/web.php` on the backend.
133
- Great for debugging, refactoring, or understanding cross-stack dependencies.
134
-
135
- - **📖 Documentation Bundles**
136
- Create readable Markdown maps per module or domain instead of one large export.
137
- Each output acts as a focused, navigable view of your code relationships.
138
-
139
- - **🧠 Team Handoffs**
140
- Share isolated code scopes (like `Auth`, `Payments`, or `User Management`) with full dependency context.
141
- Makes onboarding and code reviews significantly faster.
142
-
143
- ---
144
-
145
- ## 🧩 Recommended Workflow
146
-
147
- Prodex works best when used to **map and export projects in logical parts** rather than all at once.
148
- Each run focuses on one or more entry points, and Prodex automatically **loads all imports recursively** for those files —
149
- then appends any files matched by the `--include` flag.
150
-
151
- ### 🧠 Suggested Pattern
152
-
153
- 1. **Pick a meaningful entry file**
154
- Example:
155
-
156
- - Frontend: `resources/js/**/dashboard.tsx`
157
- - Backend: `routes/**/(web|api).php`
158
- - Shared logic: `app/Services/**/PaymentService.php`
159
-
160
- 2. **Run Prodex with includes for type or interface files**
161
-
162
- ```bash
163
- prodex -f "**/dashboard.tsx" -i "**/*.d.ts,**/*.interface.ts"
164
- ```
165
-
166
- 3. **Export separate maps for each major area**
167
-
168
- ```bash
169
- prodex -f "**/dashboard.tsx" -n "dashboard-map"
170
- prodex -f "**/(web|api).php" -n "backend-map"
171
- ```
172
-
173
- 4. **Use them together**
174
- Store each output in `/prodex/`
175
- These maps can be shared with teammates or loaded into AI tools for structured, code-aware assistance.
176
-
177
- > ⚡ Each run recursively resolves every import, applies includes, and outputs one complete dependency map for that section.
178
-
179
- ---
180
-
181
- ## ⚙️ Optional — `prodex.json`
182
-
183
- `prodex.json` is **fully optional** in v1.2.0.
184
- You can run Prodex entirely from the command line, but the config file can be useful for saved defaults.
185
-
186
- ### 🪄 Quick Setup
187
-
188
- You can generate a ready-to-use config file with:
189
-
190
- ```bash
191
- prodex init
192
- ```
193
-
194
- This creates a `prodex.json` file in your project root with sensible defaults — including base directories, globs, and priority files.
195
-
196
- ### 🧩 Running with a Config File
197
-
198
- If you’ve defined your entry files in the config under `entry.files`,
199
- you can run Prodex directly without specifying `--files`:
200
-
201
- ```bash
202
- prodex -c
203
- ```
204
-
205
- The `-c` (or `--ci`) flag skips interactive mode and uses the config values automatically.
206
- Specifying `-f` ( or `--files`) from the CLI also disables the picker by default.
207
-
208
- You can permanently disable the picker in the config by setting:
209
-
210
- ```json
211
- "entry": {
212
- "ui": {
213
- "enablePicker": false
214
- }
215
- }
216
- ```
217
-
218
- ---
219
-
220
- ## 📜 License
221
-
222
- **MIT License**
223
- © 2025 [emxhive](https://github.com/emxhive)
224
-
225
- ---
226
-
227
- ## ⚠️ Note from the Author
228
-
229
- Prodex is still a **work in progress**.
230
- Some parts of the experience may be rough, especially around interactive mode and advanced resolvers.
231
- Updates are released **multiple times per week — sometimes daily** — to keep improving stability and support.
232
-
233
- Please stay up to date for the best experience.
234
- Thank you for testing Prodex early. ❤️
1
+ # 🧩 Prodex v1.2.0
2
+
3
+ > **Build the maze, I'll write a map.**
4
+
5
+ ---
6
+
7
+ ## 🧠 What’s New — v1.2.0
8
+
9
+ - 🆕 **Full CLI support with integrated [Sade](https://github.com/lukeed/sade).**
10
+ Prodex now runs entirely from the terminal — no `prodex.json` required.
11
+ Supports short flags and native glob patterns for flexible targeting.
12
+
13
+ ```bash
14
+ prodex -f "**/web.php,**/app.tsx" -i "**/*.d.ts" -x "node_modules/**"
15
+ ```
16
+
17
+ ```bash
18
+ prodex --files "**/web.php,**/app.tsx" --include **/*types.ts --exclude "@shadcn/**"
19
+ ```
20
+
21
+ - 🧾 **Markdown mode added and now default.**
22
+ Output is fully fenced and linkable — jump between the index and any code block.
23
+ Text mode remains available using `--txt` or `-t`.
24
+
25
+ - 🗂 **Output naming improved.**
26
+ Output files are now versioned by default.
27
+ Custom names are supported using `--name` or `-n`.
28
+ Naming conventions have been updated for cleaner, consistent results.
29
+
30
+ ---
31
+
32
+ ## ⚙️ Usage
33
+
34
+ Prodex v1.2.0 runs entirely from the command line.
35
+ Interactive mode is currently unstable — use CLI flags instead.
36
+
37
+ ### Installation
38
+
39
+ ```bash
40
+ npm install -g prodex
41
+ ```
42
+
43
+ Or run without installing:
44
+
45
+ ```bash
46
+ npx prodex
47
+ ```
48
+
49
+ ---
50
+
51
+ ### Basic Run
52
+
53
+ ```bash
54
+ prodex -f "**/web.php,**/app.tsx"
55
+ ```
56
+
57
+ ### With Includes, exclude, and Custom Name
58
+
59
+ ```bash
60
+ prodex -f "**/web.php,**/app.tsx" -i "**/*.d.ts" -x "node_modules/**" -n "combined-output"
61
+ ```
62
+
63
+ ### Flag Reference
64
+
65
+ | Flag | Short | Description |
66
+ | ----------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
67
+ | `--files` | `-f` | Entry files — starting points for dependency resolution. Accepts multiple names or globs. |
68
+ | `--include` | `-i` | Adds extra files or patterns to include (e.g. `.d.ts`, interface, or type files). These files are **not dependency-resolved** — they’re appended as-is. |
69
+ | `--exclude` | `-x` | Patterns or folders to skip during the scan. |
70
+ | `--name` | `-n` | Custom output filename (without extension). Versioning still applies automatically. |
71
+
72
+ > Globs are powered by [Fast-Glob](https://github.com/mrmlnc/fast-glob).
73
+ > Use **comma-separated values** for multiple entries.
74
+ > Wrap globs in quotes when they include special characters like `|` or `&`.
75
+
76
+ ---
77
+
78
+ ## 🧭 Plans
79
+
80
+ - **Alias Resolution Improvements**
81
+ Planned overhaul of alias handling to support deeper nested paths, wildcard matching, and auto-mapped imports across mixed stacks.
82
+
83
+ - **Language Support**
84
+ Currently supports **JavaScript**, **React**, and **Laravel + React** stacks.
85
+ May work with other frameworks but remains untested.
86
+ Broader multi-language support is planned for future versions.
87
+
88
+ - **Combined Output**
89
+ All code from multiple entries is merged into a single output file.
90
+ There’s currently **no limit** on output size, but it’s advised to avoid combining _too many large entries_ in a single run.
91
+ Future versions will include **smart naming** and **automatic splitting** for oversized outputs.
92
+
93
+ - **Performance Optimizations**
94
+ Planned improvements to resolver speed and dependency traversal for faster processing on large projects.
95
+
96
+ ---
97
+
98
+ ## 🧩 Features
99
+
100
+ | Status | Feature | Description |
101
+ | :----: | --------------------------- | ---------------------------------------------------------------------------------------------- |
102
+ | ✅ | **Cross-language indexing** | Resolves imports across JS, TS, React, and PHP (Laravel) projects. |
103
+ | ✅ | **Markdown output** | Generates clean `.md` files with anchors, back-to-top links, and fenced code blocks. |
104
+ | ✅ | **Text output** | Optional `.txt` mode using `--txt` or `-t`. |
105
+ | ✅ | **Glob support** | Works with flexible glob patterns powered by [Fast-Glob](https://github.com/mrmlnc/fast-glob). |
106
+ | ✅ | **Custom output names** | Define your own output prefix using `--name` or `-n`. |
107
+ | ⚠️ | **Interactive picker (UI)** | Still unstable — not recommended for production use. |
108
+ | ⚠️ | **Alias resolution** | Basic alias mapping supported; advanced cases in progress. |
109
+ | 🚧 | **Smart file splitting** | Planned for large combined outputs. |
110
+ | 🚧 | **PSR-4 deep scan** | Planned to improve PHP dependency resolution. |
111
+ | 🚧 | **Speed optimization** | Further resolver and I/O improvements under development. |
112
+
113
+ ---
114
+
115
+ ## 🧱 Use Cases
116
+
117
+ Prodex can technically combine your entire codebase into one file —
118
+ but it’s **best used in parts**, focusing on specific sections or features.
119
+ Each run produces a clean, self-contained map showing all related files and dependencies.
120
+
121
+ ### 🧩 Common Scenarios
122
+
123
+ - **🤖 Project Awareness for AI Assistants**
124
+ Generate compact `.md` summaries of key parts of your project.
125
+ These can be shared with AI tools (like ChatGPT, Claude, or Copilot) to give them structured context about your codebase — without exposing unnecessary files.
126
+
127
+ - **📦 Feature or Module Mapping**
128
+ Combine everything connected to a specific feature (e.g., `Checkout`, `Dashboard`, or `Payments`).
129
+ Prodex gathers all linked imports, helpers, and files into one readable document.
130
+
131
+ - **🔍 Dependency Insight**
132
+ Trace how a particular entry file connects through your stack — whether it’s `app.tsx` on the frontend or `routes/web.php` on the backend.
133
+ Great for debugging, refactoring, or understanding cross-stack dependencies.
134
+
135
+ - **📖 Documentation Bundles**
136
+ Create readable Markdown maps per module or domain instead of one large export.
137
+ Each output acts as a focused, navigable view of your code relationships.
138
+
139
+ - **🧠 Team Handoffs**
140
+ Share isolated code scopes (like `Auth`, `Payments`, or `User Management`) with full dependency context.
141
+ Makes onboarding and code reviews significantly faster.
142
+
143
+ ---
144
+
145
+ ## 🧩 Recommended Workflow
146
+
147
+ Prodex works best when used to **map and export projects in logical parts** rather than all at once.
148
+ Each run focuses on one or more entry points, and Prodex automatically **loads all imports recursively** for those files —
149
+ then appends any files matched by the `--include` flag.
150
+
151
+ ### 🧠 Suggested Pattern
152
+
153
+ 1. **Pick a meaningful entry file**
154
+ Example:
155
+
156
+ - Frontend: `resources/js/**/dashboard.tsx`
157
+ - Backend: `routes/**/(web|api).php`
158
+ - Shared logic: `app/Services/**/PaymentService.php`
159
+
160
+ 2. **Run Prodex with includes for type or interface files**
161
+
162
+ ```bash
163
+ prodex -f "**/dashboard.tsx" -i "**/*.d.ts,**/*.interface.ts"
164
+ ```
165
+
166
+ 3. **Export separate maps for each major area**
167
+
168
+ ```bash
169
+ prodex -f "**/dashboard.tsx" -n "dashboard-map"
170
+ prodex -f "**/(web|api).php" -n "backend-map"
171
+ ```
172
+
173
+ 4. **Use them together**
174
+ Store each output in `/prodex/`
175
+ These maps can be shared with teammates or loaded into AI tools for structured, code-aware assistance.
176
+
177
+ > ⚡ Each run recursively resolves every import, applies includes, and outputs one complete dependency map for that section.
178
+
179
+ ---
180
+
181
+ ## ⚙️ Optional — `prodex.json`
182
+
183
+ `prodex.json` is **fully optional** in v1.2.0.
184
+ You can run Prodex entirely from the command line, but the config file can be useful for saved defaults.
185
+
186
+ ### 🪄 Quick Setup
187
+
188
+ You can generate a ready-to-use config file with:
189
+
190
+ ```bash
191
+ prodex init
192
+ ```
193
+
194
+ This creates a `prodex.json` file in your project root with sensible defaults — including base directories, globs, and priority files.
195
+
196
+ ### 🧩 Running with a Config File
197
+
198
+ If you’ve defined your entry files in the config under `entry.files`,
199
+ you can run Prodex directly without specifying `--files`:
200
+
201
+ ```bash
202
+ prodex -c
203
+ ```
204
+
205
+ The `-c` (or `--ci`) flag skips interactive mode and uses the config values automatically.
206
+ Specifying `-f` ( or `--files`) from the CLI also disables the picker by default.
207
+
208
+ You can permanently disable the picker in the config by setting:
209
+
210
+ ```json
211
+ "entry": {
212
+ "ui": {
213
+ "enablePicker": false
214
+ }
215
+ }
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 📜 License
221
+
222
+ **MIT License**
223
+ © 2025 [emxhive](https://github.com/emxhive)
224
+
225
+ ---
226
+
227
+ ## ⚠️ Note from the Author
228
+
229
+ Prodex is still a **work in progress**.
230
+ Some parts of the experience may be rough, especially around interactive mode and advanced resolvers.
231
+ Updates are released **multiple times per week — sometimes daily** — to keep improving stability and support.
232
+
233
+ Please stay up to date for the best experience.
234
+ Thank you for testing Prodex early. ❤️
@@ -5,24 +5,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.parseCliInput = parseCliInput;
7
7
  const sade_1 = __importDefault(require("sade"));
8
- const flags_1 = require("./flags");
9
- const logger_1 = require("../lib/logger");
10
8
  const path_1 = __importDefault(require("path"));
11
9
  const package_json_1 = __importDefault(require("../../package.json"));
12
10
  const fs_1 = __importDefault(require("fs"));
11
+ const flags_1 = require("../constants/flags");
13
12
  /**
14
- * Unified CLI parser powered by Sade.
15
- * Returns { root, entries (from --files), flags, warnings, errors }.
13
+ * Unified CLI parser powered by Sade and FLAG_MAP.
14
+ * Returns { root, flags, warnings, errors }.
16
15
  */
17
16
  function parseCliInput(argv = process.argv) {
18
17
  if (argv.includes("-v") || argv.includes("--version")) {
19
- logger_1.logger.log(`prodex v${package_json_1.default.version}`);
18
+ console.log(`prodex v${package_json_1.default.version}`);
20
19
  process.exit(0);
21
20
  }
22
21
  const program = (0, sade_1.default)("prodex [root]");
23
22
  registerFlags(program);
24
23
  let parsed = { rootArg: "", root: undefined, flags: {} };
25
- // Define action
26
24
  program.action((root, opts) => {
27
25
  const cwd = process.cwd();
28
26
  parsed = {
@@ -34,31 +32,22 @@ function parseCliInput(argv = process.argv) {
34
32
  program.parse(argv);
35
33
  const warnings = [];
36
34
  const errors = [];
37
- // Post-parse casting + normalization
38
35
  parsed.flags = normalizeFlags(parsed.flags, warnings, errors);
39
36
  validateArgs(parsed, warnings, errors);
40
- return {
41
- ...parsed,
42
- warnings,
43
- errors,
44
- };
37
+ return { ...parsed, warnings, errors };
45
38
  }
46
39
  function registerFlags(program) {
47
- for (const [key, meta] of Object.entries(flags_1.PRODEX_FLAGS)) {
40
+ for (const [key, meta] of Object.entries(flags_1.FLAG_MAP)) {
48
41
  const short = meta.short ? `-${meta.short}, ` : "";
49
42
  const long = `--${key}`;
50
43
  const desc = meta.description;
51
- let defaultVal;
52
- if (meta.type === "boolean")
53
- defaultVal = false;
54
- if (defaultVal !== undefined)
55
- program.option(`${short}${long}`, desc, defaultVal);
56
- else
57
- program.option(`${short}${long}`, desc);
44
+ const defaultVal = meta.type === "boolean" ? false : undefined;
45
+ program.option(`${short}${long}`, desc, defaultVal);
58
46
  }
59
47
  }
48
+ /** Convert flag values to correct types based on FLAG_MAP metadata. */
60
49
  function normalizeFlags(flags, warnings, errors) {
61
- for (const [key, meta] of Object.entries(flags_1.PRODEX_FLAGS)) {
50
+ for (const [key, meta] of Object.entries(flags_1.FLAG_MAP)) {
62
51
  const raw = flags[key];
63
52
  if (raw === undefined)
64
53
  continue;
@@ -72,19 +61,23 @@ function normalizeFlags(flags, warnings, errors) {
72
61
  break;
73
62
  }
74
63
  case "list": {
75
- const arr = String(raw)
64
+ flags[key] = String(raw)
76
65
  .split(",")
77
66
  .map((v) => v.trim())
78
67
  .filter(Boolean);
79
- flags[key] = arr;
80
68
  break;
81
69
  }
70
+ default: {
71
+ if (meta.type === "string")
72
+ flags[key] = String(raw);
73
+ }
82
74
  }
83
75
  }
84
76
  return flags;
85
77
  }
78
+ /** Validate path argument and report unrecognized flags. */
86
79
  function validateArgs(parsed, warnings, errors) {
87
- const { rootArg, flags: { _: unknown }, } = parsed;
80
+ const { rootArg } = parsed;
88
81
  if (rootArg) {
89
82
  if (!fs_1.default.existsSync(parsed.root)) {
90
83
  errors.push(`Invalid path argument: "${rootArg}" does not exist.`);
@@ -93,14 +86,16 @@ function validateArgs(parsed, warnings, errors) {
93
86
  errors.push(`Path argument "${rootArg}" is not a directory.`);
94
87
  }
95
88
  }
89
+ const unknown = parsed.flags?._ || [];
96
90
  if (unknown.length) {
97
91
  warnings.push(`Unrecognized arguments detected [${unknown.join(", ")}]- They were ignored.`);
98
92
  }
99
93
  if (warnings.length)
100
- logger_1.logger.warn("Warnings:", warnings);
94
+ console.warn("Warnings:", warnings);
101
95
  if (errors.length) {
102
96
  for (const err of errors)
103
- logger_1.logger.error(err);
97
+ console.error(err);
104
98
  process.exit(1);
105
99
  }
106
100
  }
101
+ //# sourceMappingURL=cli-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-input.js","sourceRoot":"","sources":["../../src/cli/cli-input.ts"],"names":[],"mappings":";;;;;AAWA,sCA6BC;AAxCD,gDAAwB;AACxB,gDAAwB;AACxB,sEAAqC;AACrC,4CAAoB;AACpB,8CAA8C;AAG9C;;;GAGG;AACH,SAAgB,aAAa,CAAC,OAAiB,OAAO,CAAC,IAAI;IAC1D,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,WAAW,sBAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,cAAI,EAAC,eAAe,CAAC,CAAC;IACtC,aAAa,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QACF,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,4DAA4D;AAC5D,SAAS,YAAY,CAAC,MAAmB,EAAE,QAAkB,EAAE,MAAgB;IAC9E,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAE3B,IAAI,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,2BAA2B,OAAO,mBAAmB,CAAC,CAAC;QACpE,CAAC;aAAM,IAAI,CAAC,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YACpD,MAAM,CAAC,IAAI,CAAC,kBAAkB,OAAO,uBAAuB,CAAC,CAAC;QAC/D,CAAC;IACF,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACtC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,oCAAoC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,KAAK,MAAM,GAAG,IAAI,MAAM;YAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["import sade from \"sade\";\nimport path from \"path\";\nimport pkg from \"../../package.json\";\nimport fs from \"fs\";\nimport { FLAG_MAP } from \"../constants/flags\";\nimport type { ParsedInput } from \"../types\";\n\n/**\n * Unified CLI parser powered by Sade and FLAG_MAP.\n * Returns { root, flags, warnings, errors }.\n */\nexport function parseCliInput(argv: string[] = process.argv) {\n\tif (argv.includes(\"-v\") || argv.includes(\"--version\")) {\n\t\tconsole.log(`prodex v${pkg.version}`);\n\t\tprocess.exit(0);\n\t}\n\n\tconst program = sade(\"prodex [root]\");\n\tregisterFlags(program);\n\n\tlet parsed: ParsedInput = { rootArg: \"\", root: undefined, flags: {} };\n\n\tprogram.action((root: string | undefined, opts: Record<string, any>) => {\n\t\tconst cwd = process.cwd();\n\t\tparsed = {\n\t\t\trootArg: root,\n\t\t\troot: root ? path.resolve(cwd, root) : cwd,\n\t\t\tflags: { ...opts },\n\t\t};\n\t});\n\n\tprogram.parse(argv);\n\n\tconst warnings: string[] = [];\n\tconst errors: string[] = [];\n\n\tparsed.flags = normalizeFlags(parsed.flags, warnings, errors);\n\tvalidateArgs(parsed, warnings, errors);\n\n\treturn { ...parsed, warnings, errors };\n}\n\nfunction registerFlags(program: ReturnType<typeof sade>) {\n\tfor (const [key, meta] of Object.entries(FLAG_MAP)) {\n\t\tconst short = meta.short ? `-${meta.short}, ` : \"\";\n\t\tconst long = `--${key}`;\n\t\tconst desc = meta.description;\n\t\tconst defaultVal = meta.type === \"boolean\" ? false : undefined;\n\t\tprogram.option(`${short}${long}`, desc, defaultVal);\n\t}\n}\n\n/** Convert flag values to correct types based on FLAG_MAP metadata. */\nfunction normalizeFlags(flags: Record<string, any>, warnings: string[], errors: string[]) {\n\tfor (const [key, meta] of Object.entries(FLAG_MAP)) {\n\t\tconst raw = flags[key];\n\t\tif (raw === undefined) continue;\n\n\t\tswitch (meta.type) {\n\t\t\tcase \"number\": {\n\t\t\t\tconst num = Number(raw);\n\t\t\t\tif (Number.isNaN(num)) errors.push(`Flag --${key} expected a number but got \"${raw}\"`);\n\t\t\t\telse flags[key] = num;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"list\": {\n\t\t\t\tflags[key] = String(raw)\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((v) => v.trim())\n\t\t\t\t\t.filter(Boolean);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tif (meta.type === \"string\") flags[key] = String(raw);\n\t\t\t}\n\t\t}\n\t}\n\treturn flags;\n}\n\n/** Validate path argument and report unrecognized flags. */\nfunction validateArgs(parsed: ParsedInput, warnings: string[], errors: string[]) {\n\tconst { rootArg } = parsed;\n\n\tif (rootArg) {\n\t\tif (!fs.existsSync(parsed.root)) {\n\t\t\terrors.push(`Invalid path argument: \"${rootArg}\" does not exist.`);\n\t\t} else if (!fs.statSync(parsed.root).isDirectory()) {\n\t\t\terrors.push(`Path argument \"${rootArg}\" is not a directory.`);\n\t\t}\n\t}\n\n\tconst unknown = parsed.flags?._ || [];\n\tif (unknown.length) {\n\t\twarnings.push(`Unrecognized arguments detected [${unknown.join(\", \")}]- They were ignored.`);\n\t}\n\n\tif (warnings.length) console.warn(\"Warnings:\", warnings);\n\tif (errors.length) {\n\t\tfor (const err of errors) console.error(err);\n\t\tprocess.exit(1);\n\t}\n}\n"]}
package/dist/cli/flags.js CHANGED
@@ -40,3 +40,4 @@ Usage: prodex [-fcdv]
40
40
  [--limit=<int>|-l=<int>]
41
41
  [--help|-h]
42
42
  `;
43
+ //# sourceMappingURL=flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/cli/flags.ts"],"names":[],"mappings":";;;AAMA,IAAY,OAUX;AAVD,WAAY,OAAO;IAClB,sBAAW,CAAA;IACX,oBAAS,CAAA;IACT,0BAAe,CAAA;IACf,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,0BAAe,CAAA;IACf,0BAAe,CAAA;IACf,wBAAa,CAAA;IACb,0BAAe,CAAA;AAChB,CAAC,EAVW,OAAO,uBAAP,OAAO,QAUlB;AAOY,QAAA,YAAY,GAA0B;IAClD,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EA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AAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAc,CAAC;IACjD,OAAO,GAAG,CAAC;AACZ,CAAC,EAAE,EAA6B,CAAC,CAAC;AAGrB,QAAA,SAAS,GAAG;;;;;;;;;CASxB,CAAC","sourcesContent":["/**\n * 🧩 Prodex Flag Definitions (v3)\n * Metadata used by the CLI parser for validation, casting, and help output.\n */\nexport type FlagType = \"boolean\" | \"string\" | \"number\" | \"list\";\n\nexport enum FlagKey {\n\tTxt = \"txt\",\n\tCi = \"ci\",\n\tDebug = \"debug\",\n\tName = \"name\",\n\tLimit = \"limit\",\n\tInc = \"include\",\n\tExc = \"exclude\",\n\tHelp = \"help\",\n\tFiles = \"files\",\n}\n\ntype Spec = {\n\tshort?: string;\n\ttype: FlagType;\n\tdescription: string;\n};\nexport const PRODEX_FLAGS: Record<FlagKey, Spec> = {\n\t[FlagKey.Files]: { short: \"f\", type: \"list\", description: \"Comma-separated entry files.\" },\n\t[FlagKey.Txt]: { short: \"t\", type: \"boolean\", description: \"Output as .txt instead of .md.\" },\n\t[FlagKey.Ci]: { short: \"c\", type: \"boolean\", description: \"Headless/no-UI mode.\" },\n\t[FlagKey.Debug]: { short: \"d\", type: \"boolean\", description: \"Enable debug logs.\" },\n\t[FlagKey.Name]: { short: \"n\", type: \"string\", description: \"Custom output filename.\" },\n\t[FlagKey.Limit]: { short: \"l\", type: \"number\", description: \"Override traversal limit.\" },\n\t[FlagKey.Inc]: { type: \"list\", short: \"i\", description: \"Comma-separated include globs.\" },\n\t[FlagKey.Exc]: { type: \"list\", short: \"x\", description: \"Comma-separated exclude globs.\" },\n\t[FlagKey.Help]: { short: \"h\", type: \"boolean\", description: \"Show CLI help and exit.\" },\n};\n\n/** Reverse lookup for short aliases. */\nexport const FLAG_SHORT_MAP: Record<string, FlagKey> = Object.entries(PRODEX_FLAGS).reduce((acc, [key, meta]) => {\n\tif (meta.short) acc[meta.short] = key as FlagKey;\n\treturn acc;\n}, {} as Record<string, FlagKey>);\n\n\nexport const CLI_USAGE = `\nUsage: prodex [-fcdv]\n [--files=<globs>|-f=<globs>]\n [--include=<globs>|-i=<globs>]\n [--exclude=<globs>|-x=<globs>]\n [--txt|-t] [--ci|-c] [--debug|-d] [--version|-v]\n [--name=<string>|-n=<string>]\n [--limit=<int>|-l=<int>]\n [--help|-h]\n`;\n"]}
package/dist/cli/init.js CHANGED
@@ -7,15 +7,15 @@ exports.initProdex = initProdex;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const default_config_1 = require("../constants/default-config");
10
- const logger_1 = require("../lib/logger");
11
10
  async function initProdex() {
12
- logger_1.logger.log("🪄 Prodex Init — Configuration Wizard (v2)");
11
+ console.log("🪄 Prodex Init — Configuration Wizard (v3");
13
12
  const dest = path_1.default.join(process.cwd(), "prodex.json");
14
13
  if (fs_1.default.existsSync(dest)) {
15
- logger_1.logger.error("prodex.json already exists. Delete or modify it manually.\n");
14
+ console.error("prodex.json already exists. Delete or modify it manually.\n");
16
15
  return;
17
16
  }
18
17
  fs_1.default.writeFileSync(dest, JSON.stringify(default_config_1.DEFAULT_PRODEX_CONFIG, null, 2) + "\n", "utf8");
19
- logger_1.logger.log(`✅ Created ${dest}`);
20
- logger_1.logger.log("💡 Globs supported everywhere (include, exclude, priority).");
18
+ console.log(`✅ Created ${dest}`);
19
+ console.log("💡 Globs supported everywhere (include, exclude, priority).");
21
20
  }
21
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";;;;;AAIA,gCAaC;AAjBD,4CAAoB;AACpB,gDAAwB;AACxB,gEAAoE;AAE7D,KAAK,UAAU,UAAU;IAC/B,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IAEzD,MAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC,CAAC;IAErD,IAAI,YAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAC7E,OAAO;IACR,CAAC;IAED,YAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,sCAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport { DEFAULT_PRODEX_CONFIG } from \"../constants/default-config\";\n\nexport async function initProdex() {\n\tconsole.log(\"🪄 Prodex Init — Configuration Wizard (v3\");\n\n\tconst dest = path.join(process.cwd(), \"prodex.json\");\n\n\tif (fs.existsSync(dest)) {\n\t\tconsole.error(\"prodex.json already exists. Delete or modify it manually.\\n\");\n\t\treturn;\n\t}\n\n\tfs.writeFileSync(dest, JSON.stringify(DEFAULT_PRODEX_CONFIG, null, 2) + \"\\n\", \"utf8\");\n\tconsole.log(`✅ Created ${dest}`);\n\tconsole.log(\"💡 Globs supported everywhere (include, exclude, priority).\");\n}\n"]}