prodex 1.4.11 → 2.0.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.
- package/LICENSE +20 -20
- package/README.md +238 -234
- package/bin/prodex.js +0 -0
- package/dist/app/execute-run.d.ts +2 -0
- package/dist/app/execute-run.js +73 -0
- package/dist/app/project-context.d.ts +12 -0
- package/dist/app/project-context.js +48 -0
- package/dist/app/run-plans.d.ts +11 -0
- package/dist/app/run-plans.js +61 -0
- package/dist/cache/cache-keys.d.ts +9 -0
- package/dist/cache/cache-manager.d.ts +9 -0
- package/dist/{core/managers/cache.js → cache/cache-manager.js} +5 -18
- package/dist/cli/cli-input.d.ts +2 -0
- package/dist/cli/cli-input.js +138 -124
- package/dist/cli/flag-specs.d.ts +12 -0
- package/dist/cli/flag-specs.js +27 -0
- package/dist/cli/help.d.ts +2 -0
- package/dist/cli/help.js +83 -0
- package/dist/cli/report-command.d.ts +2 -0
- package/dist/cli/report-command.js +80 -0
- package/dist/cli/reporter.d.ts +2 -0
- package/dist/cli/reporter.js +8 -0
- package/dist/commands/init-command.d.ts +1 -0
- package/dist/commands/init-command.js +9 -0
- package/dist/commands/migrate-command.d.ts +7 -0
- package/dist/commands/migrate-command.js +76 -0
- package/dist/commands/profiles-command.d.ts +6 -0
- package/dist/commands/profiles-command.js +16 -0
- package/dist/commands/run-command.d.ts +11 -0
- package/dist/commands/run-command.js +17 -0
- package/dist/config/build-config.d.ts +13 -0
- package/dist/config/build-config.js +127 -0
- package/dist/config/create-default-config.d.ts +9 -0
- package/dist/config/create-default-config.js +25 -0
- package/dist/config/default-config.d.ts +2 -0
- package/dist/config/default-config.js +23 -0
- package/dist/config/json.d.ts +2 -0
- package/dist/config/json.js +10 -0
- package/dist/config/load.d.ts +9 -0
- package/dist/config/load.js +48 -0
- package/dist/config/migration/detect.d.ts +4 -0
- package/dist/config/migration/detect.js +22 -0
- package/dist/config/migration/index.d.ts +4 -0
- package/dist/{shared → config/migration}/index.js +4 -3
- package/dist/config/migration/messages.d.ts +2 -0
- package/dist/config/migration/messages.js +35 -0
- package/dist/config/migration/transform.d.ts +2 -0
- package/dist/config/migration/transform.js +80 -0
- package/dist/config/migration/types.d.ts +16 -0
- package/dist/config/string-list.d.ts +2 -0
- package/dist/config/string-list.js +17 -0
- package/dist/diagnostics/logger.d.ts +3 -0
- package/dist/diagnostics/logger.js +33 -0
- package/dist/filesystem/glob-scan.d.ts +4 -0
- package/dist/filesystem/glob-scan.js +26 -0
- package/dist/filesystem/inspect.d.ts +1 -0
- package/dist/filesystem/inspect.js +15 -0
- package/dist/filesystem/path.d.ts +2 -0
- package/dist/filesystem/path.js +11 -0
- package/dist/filesystem/read-file.d.ts +8 -0
- package/dist/{shared/io.js → filesystem/read-file.js} +0 -25
- package/dist/filesystem/stat-cache.d.ts +1 -0
- package/dist/filesystem/stat-cache.js +22 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +76 -83
- package/dist/output/markdown.d.ts +12 -0
- package/dist/output/markdown.js +150 -0
- package/dist/output/naming.d.ts +2 -0
- package/dist/output/naming.js +30 -0
- package/dist/output/produce-output.d.ts +2 -0
- package/dist/output/produce-output.js +35 -0
- package/dist/output/render-constants.d.ts +21 -0
- package/dist/{constants → output}/render-constants.js +2 -1
- package/dist/output/text.d.ts +2 -0
- package/dist/output/text.js +14 -0
- package/dist/resolvers/js/extract-imports.d.ts +1 -0
- package/dist/resolvers/js/js-resolver.d.ts +2 -0
- package/dist/resolvers/js/js-resolver.js +45 -89
- package/dist/resolvers/js/resolve-alias.d.ts +2 -0
- package/dist/resolvers/js/resolve-alias.js +12 -20
- package/dist/resolvers/php/bindings.d.ts +8 -0
- package/dist/resolvers/php/bindings.js +8 -9
- package/dist/resolvers/php/extract-imports.d.ts +13 -0
- package/dist/resolvers/php/extract-imports.js +1 -1
- package/dist/resolvers/php/php-resolver.d.ts +2 -0
- package/dist/resolvers/php/php-resolver.js +61 -90
- package/dist/resolvers/php/psr4.d.ts +5 -0
- package/dist/resolvers/php/psr4.js +7 -7
- package/dist/resolvers/resolver-constants.d.ts +4 -0
- package/dist/resolvers/resolver-constants.js +7 -0
- package/dist/resolvers/resolver-result.d.ts +5 -0
- package/dist/resolvers/resolver-result.js +18 -0
- package/dist/tracing/exclude.d.ts +6 -0
- package/dist/{shared/patterns.js → tracing/exclude.js} +4 -4
- package/dist/tracing/follow-chain.d.ts +5 -0
- package/dist/tracing/follow-chain.js +63 -0
- package/dist/tracing/include-files.d.ts +2 -0
- package/dist/tracing/include-files.js +36 -0
- package/dist/tracing/resolver-registry.d.ts +5 -0
- package/dist/tracing/resolver-registry.js +20 -0
- package/dist/tracing/trace-run.d.ts +2 -0
- package/dist/tracing/trace-run.js +21 -0
- package/dist/tracing/trace-stats.d.ts +4 -0
- package/dist/tracing/trace-stats.js +16 -0
- package/dist/types/app.types.d.ts +61 -0
- package/dist/types/app.types.js +2 -0
- package/dist/types/cli.types.d.ts +22 -0
- package/dist/types/cli.types.js +0 -10
- package/dist/types/config.types.d.ts +34 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +3 -1
- package/dist/types/output.types.d.ts +6 -0
- package/dist/types/output.types.js +2 -0
- package/dist/types/resolver.types.d.ts +23 -0
- package/dist/types/tracing.types.d.ts +23 -0
- package/dist/types/tracing.types.js +2 -0
- package/dist/types/utils.types.d.ts +10 -0
- package/package.json +35 -12
- package/schema/prodex.schema.json +122 -0
- package/dist/cli/init.js +0 -21
- package/dist/cli/picker.js +0 -83
- package/dist/cli/summary.js +0 -32
- package/dist/constants/config.js +0 -27
- package/dist/constants/default-config.js +0 -43
- package/dist/constants/flags.js +0 -79
- package/dist/constants/index.js +0 -20
- package/dist/core/combine.js +0 -56
- package/dist/core/dependency.js +0 -98
- package/dist/core/helpers.js +0 -85
- package/dist/core/managers/config.js +0 -140
- package/dist/core/output.js +0 -49
- package/dist/core/renderers.js +0 -210
- package/dist/debug.js +0 -15
- package/dist/lib/logger.js +0 -42
- package/dist/lib/polyfills.js +0 -17
- package/dist/lib/prompt.js +0 -34
- package/dist/lib/questions.js +0 -28
- package/dist/lib/utils.js +0 -46
- package/dist/shared/collections.js +0 -33
- package/dist/store.js +0 -15
- /package/dist/{constants → cache}/cache-keys.js +0 -0
- /package/dist/{types/core.types.js → config/migration/types.js} +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Zeki
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Zeki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,234 +1,238 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
##
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
1
|
+
# Prodex
|
|
2
|
+
|
|
3
|
+
Focused code-context extraction for large, multi-file projects.
|
|
4
|
+
|
|
5
|
+
Prodex starts from real project entrypoints, follows supported dependencies, adds explicitly included files, and exports a clean Markdown trace. It helps you isolate the files that matter for a feature, review, debug session, documentation pass, handoff, or AI-assisted workflow without manually collecting every related file.
|
|
6
|
+
|
|
7
|
+
Prodex is intentionally narrow: it creates readable, reproducible context bundles. It is not trying to be a full IDE indexer, static analysis platform, architecture rule engine, or graph visualizer.
|
|
8
|
+
|
|
9
|
+
## Why Prodex
|
|
10
|
+
|
|
11
|
+
Large projects make context gathering expensive. A feature can start in one route or component, then spread through shared utilities, types, controllers, services, bindings, and framework conventions. Copying those files by hand is slow, inconsistent, and easy to get wrong.
|
|
12
|
+
|
|
13
|
+
Prodex gives that workflow a repeatable shape:
|
|
14
|
+
|
|
15
|
+
1. Choose one or more entry files or globs.
|
|
16
|
+
2. Trace the dependencies Prodex can resolve.
|
|
17
|
+
3. Add any extra files you explicitly include.
|
|
18
|
+
4. Exclude noisy paths such as generated output, vendor code, or UI primitives.
|
|
19
|
+
5. Export a Markdown bundle with an index and file sections.
|
|
20
|
+
|
|
21
|
+
The result is a focused project trace you can read, share, review, archive, or hand to another tool.
|
|
22
|
+
|
|
23
|
+
## How It Works
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
prodex run --entry src/index.ts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Prodex resolves the requested entrypoints from your project root, follows supported dependency references, applies include and exclude rules, then writes a versioned Markdown file to `./prodex/` by default.
|
|
30
|
+
|
|
31
|
+
For example:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
prodex run --entry resources/js/pages/Dashboard.tsx --include "routes/**/*.php"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This traces the dashboard entrypoint and adds the matching route files to the exported context.
|
|
38
|
+
|
|
39
|
+
## Profiles
|
|
40
|
+
|
|
41
|
+
Profiles are reusable named context maps stored in `prodex.json`.
|
|
42
|
+
|
|
43
|
+
They are one of Prodex's most useful workflow features: instead of rebuilding the same trace commands every time, teams can save important project areas as named profiles such as `dashboard`, `auth`, `billing`, `api`, `admin`, or `checkout`.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
prodex run --profile dashboard
|
|
47
|
+
prodex run --profile auth,billing
|
|
48
|
+
prodex run --all-profiles
|
|
49
|
+
prodex profiles
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use profiles when a project has recurring review surfaces or ownership areas. A profile can define its own entries, includes, excludes, and optional output name; when no output name is set, the profile key becomes the trace basename. This makes context extraction repeatable across debugging, reviews, documentation, handoffs, and release work. Run one profile, a comma-separated set of profiles, or all profiles when you need a broader pass.
|
|
53
|
+
|
|
54
|
+
Example:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"version": 4,
|
|
59
|
+
"$schema": "https://raw.githubusercontent.com/emxhive/prodex/main/schema/prodex.schema.json",
|
|
60
|
+
"output": {
|
|
61
|
+
"dir": "prodex",
|
|
62
|
+
"format": "md",
|
|
63
|
+
"versioned": true
|
|
64
|
+
},
|
|
65
|
+
"entry": [],
|
|
66
|
+
"include": [],
|
|
67
|
+
"exclude": ["node_modules/**", "vendor/**", "dist/**"],
|
|
68
|
+
"resolve": {
|
|
69
|
+
"aliases": {
|
|
70
|
+
"@": "resources/js"
|
|
71
|
+
},
|
|
72
|
+
"maxDepth": 10,
|
|
73
|
+
"maxFiles": 200
|
|
74
|
+
},
|
|
75
|
+
"profiles": {
|
|
76
|
+
"dashboard": {
|
|
77
|
+
"entry": ["resources/js/pages/Dashboard.tsx"],
|
|
78
|
+
"include": ["routes/**/*.php", "resources/js/types/**/*.d.ts"],
|
|
79
|
+
"exclude": ["resources/js/components/ui/**"]
|
|
80
|
+
},
|
|
81
|
+
"api": {
|
|
82
|
+
"entry": ["routes/api.php"],
|
|
83
|
+
"include": ["app/Http/Requests/**/*.php"],
|
|
84
|
+
"exclude": ["vendor/**"]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Markdown Output
|
|
91
|
+
|
|
92
|
+
Markdown is the primary Prodex output.
|
|
93
|
+
|
|
94
|
+
Each generated trace includes:
|
|
95
|
+
|
|
96
|
+
- A file index
|
|
97
|
+
- A total file count marker
|
|
98
|
+
- Links to each exported file section
|
|
99
|
+
- Line ranges for the generated sections
|
|
100
|
+
- Syntax-highlighted code fences where possible
|
|
101
|
+
- The collected source content in one readable bundle
|
|
102
|
+
|
|
103
|
+
Versioned filenames are enabled by default so repeated runs do not overwrite earlier traces.
|
|
104
|
+
|
|
105
|
+
## Current Support
|
|
106
|
+
|
|
107
|
+
Prodex's broader identity is controlled context extraction, not a single-framework tool.
|
|
108
|
+
|
|
109
|
+
Today it works best with projects that use JavaScript, TypeScript, PHP, React, and Laravel-aware structures. Current tracing support includes JS/TS imports, dynamic imports, CommonJS `require`, re-exports, static PHP include/require statements, PHP namespace imports, PSR-4 resolution, and some Laravel binding awareness.
|
|
110
|
+
|
|
111
|
+
Unsupported or dynamic relationships may need to be added with `--include` or profile `include` rules. That is expected: Prodex favors a focused, readable trace over pretending to understand every runtime edge in a project.
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install -g prodex
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Or run it ad hoc:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npx prodex run --entry src/index.ts
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Create a starter config:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
prodex init
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Common Commands
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
prodex run [root] --entry src/index.ts
|
|
135
|
+
prodex run [root] --entry routes/web.php --include "**/*.d.ts"
|
|
136
|
+
prodex run [root] --profile dashboard
|
|
137
|
+
prodex run [root] --profile dashboard,api
|
|
138
|
+
prodex run [root] --all-profiles
|
|
139
|
+
prodex profiles [root]
|
|
140
|
+
prodex migrate [root]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`prodex run` requires the `run` command. Root-only positional command shortcuts are intentionally not supported.
|
|
144
|
+
|
|
145
|
+
## CLI Reference
|
|
146
|
+
|
|
147
|
+
| Flag | Short | Type | Description |
|
|
148
|
+
| --- | --- | --- | --- |
|
|
149
|
+
| `--entry` | `-e` | list | Entry file or glob to trace. Repeatable and comma-aware. |
|
|
150
|
+
| `--include` | `-i` | list | Extra file or glob to add without dependency tracing. Repeatable and comma-aware. |
|
|
151
|
+
| `--exclude` | `-x` | list | File or glob to skip during traversal. Repeatable and comma-aware. |
|
|
152
|
+
| `--profile` | `-p` | list | Named profile to run. Comma-aware and repeatable. |
|
|
153
|
+
| `--all-profiles` | | boolean | Run every configured profile. |
|
|
154
|
+
| `--name` | `-n` | string | Output basename for this run. |
|
|
155
|
+
| `--format` | `-F` | `md`/`txt` | Output format. Markdown is the default. |
|
|
156
|
+
| `--max-depth` | | number | Maximum dependency traversal depth. |
|
|
157
|
+
| `--max-files` | | number | Maximum traced file count. |
|
|
158
|
+
| `--debug` | `-d` | boolean | Emit debug logs during traversal. |
|
|
159
|
+
|
|
160
|
+
Global metadata flags:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
prodex --version
|
|
164
|
+
prodex run --help
|
|
165
|
+
prodex profiles --help
|
|
166
|
+
prodex migrate --help
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Configuration
|
|
170
|
+
|
|
171
|
+
Prodex reads `prodex.json` from the project root.
|
|
172
|
+
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"version": 4,
|
|
176
|
+
"$schema": "https://raw.githubusercontent.com/emxhive/prodex/main/schema/prodex.schema.json",
|
|
177
|
+
"output": {
|
|
178
|
+
"dir": "prodex",
|
|
179
|
+
"format": "md",
|
|
180
|
+
"versioned": true
|
|
181
|
+
},
|
|
182
|
+
"entry": ["src/index.ts"],
|
|
183
|
+
"include": [],
|
|
184
|
+
"exclude": ["node_modules/**", "vendor/**", "dist/**"],
|
|
185
|
+
"resolve": {
|
|
186
|
+
"aliases": {
|
|
187
|
+
"@": "resources/js"
|
|
188
|
+
},
|
|
189
|
+
"maxDepth": 10,
|
|
190
|
+
"maxFiles": 200
|
|
191
|
+
},
|
|
192
|
+
"profiles": {}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Naming precedence:
|
|
197
|
+
|
|
198
|
+
1. `--name`
|
|
199
|
+
2. `profile.name`
|
|
200
|
+
3. Profile key, when running a named profile
|
|
201
|
+
4. Automatic name from entries
|
|
202
|
+
5. Internal fallback: `combined`
|
|
203
|
+
|
|
204
|
+
CLI flags override config values for a run. Profile arrays replace base arrays for that profile run.
|
|
205
|
+
|
|
206
|
+
## Migrating Configs
|
|
207
|
+
|
|
208
|
+
Prodex requires config version 4. If a project has an older `prodex.json`, `prodex run` and `prodex profiles` fail with migration instructions instead of guessing.
|
|
209
|
+
|
|
210
|
+
Preview a migration:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
prodex migrate
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Check whether migration is needed:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
prodex migrate --check
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Write the migration:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
prodex migrate --write
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`--write` creates a backup before replacing `prodex.json`.
|
|
229
|
+
|
|
230
|
+
## Requirements
|
|
231
|
+
|
|
232
|
+
- Node.js 18+
|
|
233
|
+
- A project with resolvable JS, TS, or PHP entry files
|
|
234
|
+
- Optional `prodex.json` for saved defaults and profiles
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT
|
package/bin/prodex.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeRun = executeRun;
|
|
4
|
+
const cache_manager_1 = require("../cache/cache-manager");
|
|
5
|
+
const glob_scan_1 = require("../filesystem/glob-scan");
|
|
6
|
+
const trace_run_1 = require("../tracing/trace-run");
|
|
7
|
+
const logger_1 = require("../diagnostics/logger");
|
|
8
|
+
async function executeRun(plan) {
|
|
9
|
+
cache_manager_1.CacheManager.clear();
|
|
10
|
+
(0, logger_1.setLoggerOptions)(plan.flags);
|
|
11
|
+
const warnings = [];
|
|
12
|
+
const errors = [];
|
|
13
|
+
const entries = await resolveHeadlessEntries(plan);
|
|
14
|
+
const includes = plan.config.include ?? [];
|
|
15
|
+
const mode = getRunMode(entries.length, includes.length);
|
|
16
|
+
if (!entries.length && !includes.length) {
|
|
17
|
+
return {
|
|
18
|
+
ok: false,
|
|
19
|
+
root: plan.root,
|
|
20
|
+
mode,
|
|
21
|
+
entries,
|
|
22
|
+
includes,
|
|
23
|
+
files: [],
|
|
24
|
+
warnings,
|
|
25
|
+
errors: ["No entry files found and no include patterns were configured."],
|
|
26
|
+
profile: plan.profile,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const result = await (0, trace_run_1.runTrace)({
|
|
30
|
+
cfg: plan.config,
|
|
31
|
+
opts: {
|
|
32
|
+
entries,
|
|
33
|
+
outputName: plan.outputName,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (!result.outputPath) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
root: plan.root,
|
|
40
|
+
mode,
|
|
41
|
+
entries,
|
|
42
|
+
includes,
|
|
43
|
+
files: result.files,
|
|
44
|
+
stats: result.stats,
|
|
45
|
+
warnings,
|
|
46
|
+
errors: ["No files matched the selected entries or include patterns."],
|
|
47
|
+
profile: plan.profile,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
ok: true,
|
|
52
|
+
root: plan.root,
|
|
53
|
+
mode,
|
|
54
|
+
outputPath: result.outputPath,
|
|
55
|
+
entries,
|
|
56
|
+
includes,
|
|
57
|
+
files: result.files,
|
|
58
|
+
stats: result.stats,
|
|
59
|
+
warnings,
|
|
60
|
+
errors,
|
|
61
|
+
profile: plan.profile,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function resolveHeadlessEntries(plan) {
|
|
65
|
+
return (await (0, glob_scan_1.globScan)(plan.config.entry, { cwd: plan.root })).files;
|
|
66
|
+
}
|
|
67
|
+
function getRunMode(entryCount, includePatternCount) {
|
|
68
|
+
if (entryCount && includePatternCount)
|
|
69
|
+
return "mixed";
|
|
70
|
+
if (entryCount)
|
|
71
|
+
return "trace";
|
|
72
|
+
return "include-only";
|
|
73
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProdexConfigFile } from "../types";
|
|
2
|
+
export interface ProjectContext {
|
|
3
|
+
root: string;
|
|
4
|
+
config: ProdexConfigFile;
|
|
5
|
+
configPath: string;
|
|
6
|
+
configExists: boolean;
|
|
7
|
+
warnings: string[];
|
|
8
|
+
errors: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function loadProjectContext(rootArg?: string, cwd?: string): ProjectContext;
|
|
11
|
+
export declare function resolveRoot(rootArg?: string, cwd?: string): string;
|
|
12
|
+
export declare function validateRoot(root: string, rootArg?: string): string[];
|