prodex 2.0.0 → 2.0.1
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 +10 -8
- package/dist/app/execute-run.js +1 -0
- package/dist/cli/flag-specs.js +2 -1
- package/dist/cli/help.js +2 -2
- package/dist/cli/report-command.js +35 -14
- package/dist/types/app.types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,11 +45,11 @@ They are one of Prodex's most useful workflow features: instead of rebuilding th
|
|
|
45
45
|
```bash
|
|
46
46
|
prodex run --profile dashboard
|
|
47
47
|
prodex run --profile auth,billing
|
|
48
|
-
prodex run --all
|
|
48
|
+
prodex run --all
|
|
49
49
|
prodex profiles
|
|
50
50
|
```
|
|
51
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.
|
|
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 with `--all` when you need a broader pass.
|
|
53
53
|
|
|
54
54
|
Example:
|
|
55
55
|
|
|
@@ -106,7 +106,9 @@ Versioned filenames are enabled by default so repeated runs do not overwrite ear
|
|
|
106
106
|
|
|
107
107
|
Prodex's broader identity is controlled context extraction, not a single-framework tool.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
Include-only extraction is language-agnostic: any source or text file matched by `--include` or a profile `include` rule can be added to a trace.
|
|
110
|
+
|
|
111
|
+
Dependency tracing is resolver-based. Today Prodex traces JavaScript, TypeScript, TSX, declaration files, and PHP entrypoints. 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
112
|
|
|
111
113
|
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
114
|
|
|
@@ -135,7 +137,7 @@ prodex run [root] --entry src/index.ts
|
|
|
135
137
|
prodex run [root] --entry routes/web.php --include "**/*.d.ts"
|
|
136
138
|
prodex run [root] --profile dashboard
|
|
137
139
|
prodex run [root] --profile dashboard,api
|
|
138
|
-
prodex run [root] --all
|
|
140
|
+
prodex run [root] --all
|
|
139
141
|
prodex profiles [root]
|
|
140
142
|
prodex migrate [root]
|
|
141
143
|
```
|
|
@@ -150,12 +152,11 @@ prodex migrate [root]
|
|
|
150
152
|
| `--include` | `-i` | list | Extra file or glob to add without dependency tracing. Repeatable and comma-aware. |
|
|
151
153
|
| `--exclude` | `-x` | list | File or glob to skip during traversal. Repeatable and comma-aware. |
|
|
152
154
|
| `--profile` | `-p` | list | Named profile to run. Comma-aware and repeatable. |
|
|
153
|
-
| `--all
|
|
155
|
+
| `--all` | `-a` | boolean | Run every configured profile. `--all-profiles` remains available as an explicit alias. |
|
|
154
156
|
| `--name` | `-n` | string | Output basename for this run. |
|
|
155
157
|
| `--format` | `-F` | `md`/`txt` | Output format. Markdown is the default. |
|
|
156
158
|
| `--max-depth` | | number | Maximum dependency traversal depth. |
|
|
157
159
|
| `--max-files` | | number | Maximum traced file count. |
|
|
158
|
-
| `--debug` | `-d` | boolean | Emit debug logs during traversal. |
|
|
159
160
|
|
|
160
161
|
Global metadata flags:
|
|
161
162
|
|
|
@@ -229,8 +230,9 @@ prodex migrate --write
|
|
|
229
230
|
|
|
230
231
|
## Requirements
|
|
231
232
|
|
|
232
|
-
- Node.js
|
|
233
|
-
- A project with
|
|
233
|
+
- Node.js 22+
|
|
234
|
+
- A project with JS, TS, TSX, declaration-file, or PHP entrypoints for dependency tracing
|
|
235
|
+
- Any file type can be added through include-only extraction
|
|
234
236
|
- Optional `prodex.json` for saved defaults and profiles
|
|
235
237
|
|
|
236
238
|
## License
|
package/dist/app/execute-run.js
CHANGED
package/dist/cli/flag-specs.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.FLAGS = [
|
|
|
7
7
|
{ long: "include", short: "i", type: "list" },
|
|
8
8
|
{ long: "exclude", short: "x", type: "list" },
|
|
9
9
|
{ long: "profile", short: "p", type: "list" },
|
|
10
|
-
{ long: "allProfiles", type: "boolean" },
|
|
10
|
+
{ long: "allProfiles", short: "a", type: "boolean" },
|
|
11
11
|
{ long: "name", short: "n", type: "string" },
|
|
12
12
|
{ long: "format", short: "F", type: "string" },
|
|
13
13
|
{ long: "maxDepth", type: "number" },
|
|
@@ -19,6 +19,7 @@ exports.FLAGS = [
|
|
|
19
19
|
{ long: "version", short: "v", type: "boolean" },
|
|
20
20
|
];
|
|
21
21
|
exports.FLAG_ALIASES = {
|
|
22
|
+
all: "allProfiles",
|
|
22
23
|
"all-profiles": "allProfiles",
|
|
23
24
|
"max-depth": "maxDepth",
|
|
24
25
|
"max-files": "maxFiles",
|
package/dist/cli/help.js
CHANGED
|
@@ -42,12 +42,12 @@ function renderRunHelp() {
|
|
|
42
42
|
" -i, --include <glob> Extra file/glob to append. Repeatable and comma-aware.",
|
|
43
43
|
" -x, --exclude <glob> File/glob to skip. Repeatable and comma-aware.",
|
|
44
44
|
" -p, --profile <name> Run a named profile. Repeatable.",
|
|
45
|
-
" --all
|
|
45
|
+
" -a, --all Run every configured profile.",
|
|
46
|
+
" --all-profiles Alias for --all.",
|
|
46
47
|
" -n, --name <name> Output basename for this run.",
|
|
47
48
|
" -F, --format <md|txt> Output format.",
|
|
48
49
|
" --max-depth <number> Maximum dependency traversal depth.",
|
|
49
50
|
" --max-files <number> Maximum traced file count.",
|
|
50
|
-
" -d, --debug Enable debug logs.",
|
|
51
51
|
" -h, --help Show run help.",
|
|
52
52
|
].join("\n");
|
|
53
53
|
}
|
|
@@ -17,20 +17,34 @@ function reportCommandResult(result) {
|
|
|
17
17
|
reportProfiles(result.profiles);
|
|
18
18
|
if (result.migration)
|
|
19
19
|
reportMigration(result.migration);
|
|
20
|
-
|
|
21
|
-
reportRun(run);
|
|
20
|
+
reportRuns(result.runs);
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function reportRuns(runs) {
|
|
23
|
+
for (const run of runs) {
|
|
24
|
+
reportRunWarningsAndErrors(run);
|
|
25
|
+
}
|
|
26
|
+
const successfulRuns = runs.filter((run) => run.outputPath);
|
|
27
|
+
if (!successfulRuns.length)
|
|
28
|
+
return;
|
|
29
|
+
const rows = successfulRuns.map((run) => ({
|
|
30
|
+
label: formatRunLabel(run),
|
|
31
|
+
mode: run.mode,
|
|
32
|
+
files: String(run.files.length),
|
|
33
|
+
output: formatPath(run.outputPath, run.root),
|
|
34
|
+
}));
|
|
35
|
+
const labelWidth = maxWidth(rows.map((row) => row.label));
|
|
36
|
+
const modeWidth = maxWidth(rows.map((row) => row.mode));
|
|
37
|
+
const filesWidth = maxWidth(rows.map((row) => row.files));
|
|
38
|
+
for (const row of rows) {
|
|
39
|
+
console.log(`✓ ${row.label.padEnd(labelWidth)} ${row.mode.padEnd(modeWidth)} ${row.files.padStart(filesWidth)} ${row.output}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function reportRunWarningsAndErrors(run) {
|
|
24
43
|
const label = run.profile ? ` [${run.profile}]` : "";
|
|
25
44
|
for (const warning of run.warnings)
|
|
26
45
|
console.warn(`Warning${label}: ${warning}`);
|
|
27
46
|
for (const error of run.errors)
|
|
28
47
|
console.error(`Error${label}: ${error}`);
|
|
29
|
-
if (!run.outputPath)
|
|
30
|
-
return;
|
|
31
|
-
console.log(`Created${label}: ${formatPath(run.outputPath, run.root)}`);
|
|
32
|
-
console.log(`Mode${label}: ${formatMode(run)}`);
|
|
33
|
-
console.log(`Files${label}: ${run.files.length} total`);
|
|
34
48
|
}
|
|
35
49
|
function reportMigration(migration) {
|
|
36
50
|
if (migration.errors.length)
|
|
@@ -64,6 +78,17 @@ function reportProfiles(profiles) {
|
|
|
64
78
|
for (const profile of profiles)
|
|
65
79
|
console.log(` ${profile}`);
|
|
66
80
|
}
|
|
81
|
+
function formatRunLabel(run) {
|
|
82
|
+
if (run.profile)
|
|
83
|
+
return run.profile;
|
|
84
|
+
if (run.outputName)
|
|
85
|
+
return run.outputName;
|
|
86
|
+
if (!run.outputPath)
|
|
87
|
+
return "run";
|
|
88
|
+
const ext = path_1.default.extname(run.outputPath);
|
|
89
|
+
const base = path_1.default.basename(run.outputPath, ext);
|
|
90
|
+
return base.replace(/-trace(?:_\d{6}-\d{4})?$/, "") || "run";
|
|
91
|
+
}
|
|
67
92
|
function formatPath(filePath, root) {
|
|
68
93
|
const absolute = path_1.default.resolve(filePath);
|
|
69
94
|
const relative = path_1.default.relative(root, absolute);
|
|
@@ -71,10 +96,6 @@ function formatPath(filePath, root) {
|
|
|
71
96
|
return (0, path_2.normalizePath)(relative);
|
|
72
97
|
return (0, path_2.normalizePath)(absolute);
|
|
73
98
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
return `include-only (${run.includes.length} include patterns)`;
|
|
77
|
-
if (run.mode === "mixed")
|
|
78
|
-
return `trace + includes (${run.entries.length} entries, ${run.includes.length} include patterns)`;
|
|
79
|
-
return `trace (${run.entries.length} entries)`;
|
|
99
|
+
function maxWidth(values) {
|
|
100
|
+
return values.reduce((max, value) => Math.max(max, value.length), 0);
|
|
80
101
|
}
|