@optiprune/cli 1.2.9 → 1.2.15

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/config.md CHANGED
@@ -1,108 +1,142 @@
1
- # OptiPrune Configuration Example
2
-
3
- Here is an example of an `optiprune.config.ts` based on the type definitions from the `@optiprune/core` package. This file allows you to customize analyzer behavior, engine parameters, and rule severity levels.
4
-
5
- ```typescript
6
- import { defineConfig } from '@optiprune/core';
7
-
8
- /**
9
- * OptiPrune Configuration File
10
- *
11
- * This file is automatically detected by the CLI when placed
12
- * in the root directory of your project.
13
- */
14
- export default defineConfig({
15
- // --- Base Options ---
16
-
17
- // The root directory of the project (default: current working directory)
18
- rootDir: '.',
19
-
20
- // Entry points for analysis. Define the files here from which
21
- // code reachability will be checked.
22
- entry: [
23
- 'src/main.ts',
24
- 'src/api/server.ts'
25
- ],
26
-
27
- // File extensions to scan
28
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
29
-
30
- // Glob patterns for files or directories that should be ignored
31
- ignore: [
32
- '**/node_modules/**',
33
- '**/dist/**',
34
- '**/build/**',
35
- '**/coverage/**',
36
- '**/*.test.ts',
37
- '**/*.spec.ts',
38
- '**/test/fixtures/**'
39
- ],
40
-
41
- // --- Analysis Behavior ---
42
-
43
- // Symbols considered "externally consumed" (e.g., public APIs).
44
- // These will not be flagged as unused, even if no internal import exists.
45
- externalContracts: [
46
- 'handleRequest',
47
- 'PluginInterface'
48
- ],
49
-
50
- // Whether unused exports (functions, classes, types) should be reported
51
- reportUnusedExports: true,
52
-
53
- // Whether conventional entry points (like index.ts, main.ts)
54
- // should automatically be included in the analysis.
55
- includeConventionalEntries: true,
56
-
57
- // Failure threshold for the process (exit code 1).
58
- // Possible values: "high" | "medium" | "low" | "info" | "none"
59
- failOn: 'high',
60
-
61
- // --- Engine Layer (Advanced) ---
62
-
63
- layers: {
64
- // Timeout for the Z3 SMT solver in milliseconds
65
- smtTimeoutMs: 5000,
66
-
67
- // Memory limit for the WASM-based QuickJS sandbox in MB
68
- isolateMemoryLimitMb: 128,
69
-
70
- // Enables concolic execution to mathematically prove code path reachability
71
- // (prevents false positives).
72
- enableConcolicProof: true,
73
-
74
- // Skips specific analysis layers (recommended for debugging only)
75
- skip3: false, // Symbol Propagation
76
- skip4: false // Concolic Execution
77
- },
78
-
79
- // --- Rule Configuration ---
80
-
81
- // Override severity levels for specific findings.
82
- // Possible values: "error" | "warning" | "off"
83
- rules: {
84
- 'unused-dependency': 'warning',
85
- 'unused-dev-dependency': 'info',
86
- 'missing-dependency': 'error',
87
- 'unreachable-file': 'error',
88
- 'unused-export': 'warning',
89
- 'unused-member': 'info',
90
- 'constant-condition': 'off',
91
- 'unresolved-import': 'error'
92
- },
93
-
94
- // --- Output ---
95
-
96
- // Detailed log output for debugging
97
- verbose: false,
98
-
99
- // Output results in JSON format
100
- json: false
101
- });
1
+ # OptiPrune Configuration Guide (`config.md`)
2
+
3
+ OptiPrune uses a structured configuration file to define entry points, rule behavior, ignore patterns, and core analysis engine mechanics.
4
+
5
+ ---
6
+
7
+ ## Quick Start
8
+
9
+ Create an `optiprune.json` or `optiprune.jsonc` file in the root directory of your project:
10
+
11
+ ```
12
+ {
13
+ "$schema": "https://raw.githubusercontent.com/optiprune/core/refs/heads/main/schema.json",
14
+ "rootDir": "src",
15
+ "entry": ["src/index.ts", "src/cli.ts"],
16
+ "ignore": ["**/*.test.ts", "**/dist/**"],
17
+ "externalContracts": ["PluginAdapter", "AnalyzerPlugin"],
18
+ "failOn": "high",
19
+ "rules": {
20
+ "unused-variable": "warning",
21
+ "dead-code": "error"
22
+ }
23
+ }
24
+ ```
25
+
26
+ ---
27
+
28
+ ## How OptiPrune Loads Configuration
29
+
30
+ When OptiPrune initializes, it checks the workspace root in the following order of precedence:
31
+
32
+ optiprune.json (Highest Priority )
33
+
34
+ optiprune.jsonc (Allows comments //, /* */, and trailing commas)
35
+
36
+ package.json (Falls back to reading an "optiprune" key)
37
+
38
+ ---
39
+
40
+ ## Configuration Reference
41
+
42
+ **1. File & Workspace Discovery**rootDir (string, default: ".")
43
+
44
+ Specifies the base directory for source files relative to the project workspace root.
45
+
46
+ entry (string[], default: [])
47
+
48
+ Defines root entry files. Any code reachable from these files (and their dependency trees) is marked as used and protected from unused-code reports.
49
+
50
+ extensions (string[], default: [".ts", ".tsx", ".js", ".jsx"])
51
+
52
+ File extensions that OptiPrune will parse and analyze.
53
+
54
+ ignore (string[], default: [])
55
+
56
+ Glob patterns or directory paths to skip entirely during analysis (e.g., test fixtures, output directories).
57
+
58
+ **2. Export & Contract Safeguards**externalContracts (string[], default: [])
59
+
60
+ List of public API symbol or interface names. Marks these exports as globally used across all execution layers, preventing OptiPrune from flagging them as dead code when building public libraries or plugins.
61
+
62
+ reportUnusedExports (boolean, default: true)
63
+
64
+ When set to true, OptiPrune reports exported functions, types, or variables that have no internal or external references.
65
+
66
+ includeConventionalEntries (boolean, default: true)
67
+
68
+ Automatically treats framework conventions (e.g., index.ts, main.ts, App.tsx) as entry points without needing manual listing in entry.
69
+
70
+ **3. CLI & Execution Controls**failOn ("high" | "medium" | "low" | "info" | "none", default: "high")
71
+
72
+ Determines the minimum issue severity level required to exit the process with a non-zero exit code in CI/CD pipelines.
73
+
74
+ verbose (boolean, default: false)
75
+
76
+ Prints step-by-step diagnostic information to stdout.
77
+
78
+ json (boolean, default: false)
79
+
80
+ Formats output directly as raw JSON for external tool ingestion.
81
+
82
+ **4. Automated Fixes (fix)**
83
+
84
+ Configures the automatic removal of dead code. Can be a boolean or an object for granular control.
85
+
86
+ ```
87
+ {
88
+ "fix": {
89
+ "confidence": "medium+",
90
+ "rules": ["exports", "files", "dependencies"],
91
+ "dryRun": false
92
+ }
93
+ }
102
94
  ```
103
95
 
104
- ## Usage
96
+ - **confidence**: Minimum confidence to apply a fix (`high`, `medium+`, `low+`, `all`).
97
+
98
+ - **rules**: Specific rules or categories (`exports`, `files`, `dependencies`) to fix.
99
+
100
+ - **dryRun**: If true, logs what would be fixed without modifying files.
101
+
102
+ **5. Rule Overrides (rules)**Fine-tune or disable specific inspection rules:
103
+
104
+ ```json
105
+ "rules": {
106
+ "rule-name": "error" | "warning" | "off"
107
+ }
108
+ ```
109
+
110
+ - `"error"`: Causes finding to trigger build errors or exit failures.
111
+
112
+ - `"warning"`: Emits warnings without halting execution (unless configured by failOn).
113
+
114
+ - `"off"`: Disables rule checking entirely.
115
+
116
+ **6. Engine & Solver Tuning (layers)**Configure isolated runtimes, SMT solvers, and symbolic execution passes:
117
+
118
+ | Option | Type | Default | Purpose |
119
+ | --- | --- | --- | --- |
120
+ | smtTimeoutMs | number | 10000 | SMT solver execution cap (in milliseconds) per proof path. |
121
+ | isolateMemoryLimitMb | number | 128 | Memory ceiling (in MB) allocated to V8 worker isolates. |
122
+ | enableConcolicProof | boolean | false | Enables concolic analysis to prove dead execution paths. |
123
+ | skip3 | boolean | false | Bypasses Analysis Layer 3. |
124
+ | skip4 | boolean | false | Bypasses Analysis Layer 4. |
125
+
126
+ ---
127
+
128
+ ## Alternative: package.json Configuration
129
+
130
+ If you do not want an additional configuration file in your root folder, add an "optiprune" field inside package.json:
105
131
 
106
- 1. Ensure `@optiprune/core` is installed in your project.
107
- 2. Create the `optiprune.config.ts` file in your root directory.
108
- 3. Run `optiprune` from your terminal. The analyzer will load the configuration automatically.
132
+ ```json
133
+ {
134
+ "name": "my-library",
135
+ "version": "1.0.0",
136
+ "optiprune": {
137
+ "entry": ["src/index.ts"],
138
+ "externalContracts": ["MyPublicApi"],
139
+ "failOn": "medium"
140
+ }
141
+ }
142
+ ```
package/dist/cli.js CHANGED
@@ -27,43 +27,6 @@ function getCoreVersion(rootDir) {
27
27
  catch (e) { }
28
28
  return "2.1.5";
29
29
  }
30
- /**
31
- * Custom Terminal Formatter that includes the new dependency findings.
32
- */
33
- function formatTerminalExtended(report) {
34
- const output = formatTerminal(report);
35
- const unusedDevDeps = report.findings.filter((f) => f.rule === "unused-dev-dependency");
36
- const missingDeps = report.findings.filter((f) => f.rule === "missing-dependency");
37
- if (unusedDevDeps.length === 0 && missingDeps.length === 0) {
38
- return output;
39
- }
40
- const lines = [];
41
- lines.push("");
42
- lines.push(bold("── Dependency Audit ─────────────────────────────────────────────"));
43
- if (unusedDevDeps.length > 0) {
44
- lines.push("");
45
- lines.push(bold(` Unused devDependencies (${unusedDevDeps.length})`));
46
- lines.push(dim(" These packages are listed in devDependencies but never imported in source code."));
47
- lines.push("");
48
- for (const f of unusedDevDeps) {
49
- const evidence = f.evidence;
50
- const pkg = evidence?.package || "unknown package";
51
- lines.push(` ${yellow("▲")} ${bold(pkg)}${dim(" (package.json)")}`);
52
- }
53
- }
54
- if (missingDeps.length > 0) {
55
- lines.push("");
56
- lines.push(bold(` Used in code but missing from package.json (${missingDeps.length})`));
57
- lines.push(dim(" These packages are imported in source files but not declared as any dependency."));
58
- lines.push("");
59
- for (const f of missingDeps) {
60
- const evidence = f.evidence;
61
- const pkg = evidence?.package || "unknown package";
62
- lines.push(` ${red("✖")} ${bold(pkg)}`);
63
- }
64
- }
65
- return output + "\n" + lines.join("\n");
66
- }
67
30
  program
68
31
  .name("optiprune")
69
32
  .description("Finds dead code in TypeScript/JavaScript projects.")
@@ -84,28 +47,56 @@ program
84
47
  .option("--skip-4", "Skip Layer 4 (Concolic Execution Proofs)")
85
48
  .option("-v, --verbose", "Show verbose output and internal graph state")
86
49
  .option("--fix", "Automatically remove unused exports, dependencies, and unreachable files")
50
+ .option("--fix-confidence <level>", "Minimum confidence level to fix (high, medium+, low+, all)", "high")
51
+ .option("--fix-rules <rules...>", "Specific rules to fix (exports, files, dependencies, or specific rule names)")
52
+ .option("--dry-run", "Log what would be fixed without changing files")
87
53
  .option("--cache-from <path>", "Path to a JSON file to import cache from before analysis")
88
54
  .option("--cache-to <path>", "Path to export the resulting cache to after analysis")
89
- .action(async (options) => {
55
+ .action(async (options, command) => {
90
56
  try {
91
- const rootDir = options.rootDir ?? process.cwd();
92
- // We cast to any here because the locally resolved @optiprune/core/types might
93
- // be out of sync with the actual HeadLess API implementation during development.
57
+ // Commander materializes defaults in `options`. Forwarding those values
58
+ // would make them override optiprune.json/jsonc/package.json settings.
59
+ // Only an option explicitly supplied on the command line wins over config.
60
+ const isCliOverride = (name) => command.getOptionValueSource(name) === "cli";
61
+ // Build FixConfig if --fix or other fix-related flags are used
62
+ let fixOption = undefined;
63
+ if (isCliOverride("fix") || isCliOverride("fixConfidence") || isCliOverride("fixRules") || isCliOverride("dryRun")) {
64
+ // Explicitly check if --fix was provided. If it's boolean true or not provided but other fix flags are,
65
+ // we enable fixing with the granular config.
66
+ const fixEnabled = isCliOverride("fix") ? !!options.fix : true;
67
+ if (fixEnabled) {
68
+ fixOption = {
69
+ confidence: options.fixConfidence,
70
+ rules: options.fixRules,
71
+ dryRun: !!options.dryRun
72
+ };
73
+ }
74
+ else {
75
+ fixOption = false;
76
+ }
77
+ }
78
+ // The core resolves defaults and file configuration. The CLI deliberately
79
+ // provides only explicit user overrides so the documented precedence is:
80
+ // CLI flag > config file > core default.
94
81
  const analyzerOptions = {
95
- rootDir: rootDir,
96
- entry: options.entry ?? [],
97
- extensions: options.extensions ?? [".ts", ".tsx", ".js", ".jsx"],
98
- ignore: options.ignore ?? [],
99
- reportUnusedExports: options.reportUnusedExports,
100
- includeConventionalEntries: options.conventionalEntries,
101
- failOn: options.failOn ?? "high",
102
- json: options.json || options.sarif,
103
- skip3: options.skip3,
104
- skip4: options.skip4,
105
- verbose: options.verbose,
106
- fix: options.fix,
107
- cacheFrom: options.cacheFrom,
108
- cacheTo: options.cacheTo,
82
+ ...(isCliOverride("rootDir") && { rootDir: options.rootDir }),
83
+ ...(isCliOverride("entry") && { entry: options.entry }),
84
+ ...(isCliOverride("extensions") && { extensions: options.extensions }),
85
+ ...(isCliOverride("ignore") && { ignore: options.ignore }),
86
+ ...(isCliOverride("reportUnusedExports") && {
87
+ reportUnusedExports: options.reportUnusedExports,
88
+ }),
89
+ ...(isCliOverride("conventionalEntries") && {
90
+ includeConventionalEntries: options.conventionalEntries,
91
+ }),
92
+ ...(isCliOverride("failOn") && { failOn: options.failOn }),
93
+ ...(isCliOverride("json") && { json: options.json }),
94
+ ...(isCliOverride("skip3") && { skip3: options.skip3 }),
95
+ ...(isCliOverride("skip4") && { skip4: options.skip4 }),
96
+ ...(isCliOverride("verbose") && { verbose: options.verbose }),
97
+ ...(fixOption !== undefined && { fix: fixOption }),
98
+ ...(isCliOverride("cacheFrom") && { cacheFrom: options.cacheFrom }),
99
+ ...(isCliOverride("cacheTo") && { cacheTo: options.cacheTo }),
109
100
  };
110
101
  const report = await analyze(analyzerOptions);
111
102
  if (options.sarif) {
@@ -115,7 +106,7 @@ program
115
106
  console.log(JSON.stringify(report, (k, v) => typeof v === 'bigint' ? v.toString() : v, 2));
116
107
  }
117
108
  else {
118
- console.log(formatTerminalExtended(report));
109
+ console.log(formatTerminal(report));
119
110
  }
120
111
  if (shouldFail(report, options.failOn))
121
112
  process.exit(1);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,2EAA2E;AAC3E,2DAA2D;AAC3D,aAAa;AACb,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChF,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIxE,0BAA0B;AAC1B,MAAM,IAAI,GAAI,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;AAClD,MAAM,MAAM,GAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,S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UAAU,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optiprune/cli",
3
- "version": "1.2.9",
3
+ "version": "1.2.15",
4
4
  "description": "CLI for resilient static dead-code analyzer for TypeScript and JavaScript workspaces.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -68,12 +68,8 @@
68
68
  ".": "./dist/cli.js",
69
69
  "./package.json": "./package.json"
70
70
  },
71
- "exports": {
72
- ".": "./dist/cli.js",
73
- "./package.json": "./package.json"
74
- },
75
71
  "dependencies": {
76
- "@optiprune/core": "^1.8.28",
72
+ "@optiprune/core": "^1.11.8",
77
73
  "commander": "^15.0.0",
78
74
  "pathe": "2.0.3"
79
75
  },
@@ -85,9 +81,6 @@
85
81
  "build": "tsc -p tsconfig.json",
86
82
  "prepublishOnly": "npm run build"
87
83
  },
88
- "engines": {
89
- "node": "^22.18.0 || >=24.11.0"
90
- },
91
84
  "license": "MIT",
92
85
  "author": "DreamLongYT"
93
86
  }