optiprune 2.1.7 → 2.2.21
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 +31 -10
- package/config.md +142 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +184 -0
- package/dist/cli.js.map +1 -0
- package/logo.svg +22 -0
- package/package.json +38 -26
- package/bin/runner.js +0 -26
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-

|
|
2
|
+

|
|
3
|
+

|
|
4
4
|
|
|
5
5
|
# 🚀 OptiPrune
|
|
6
6
|
---
|
|
@@ -70,11 +70,11 @@ OptiPrune operates in seven specialized layers to guarantee maximum accuracy:
|
|
|
70
70
|
Install Optiprune as a dev dependency via pnpm, npm, or yarn:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
pnpm add -D optiprune
|
|
73
|
+
pnpm add -D @optiprune/core
|
|
74
74
|
# or
|
|
75
|
-
npm install --save-dev optiprune
|
|
75
|
+
npm install --save-dev @optiprune/core
|
|
76
76
|
# or
|
|
77
|
-
yarn add -D optiprune
|
|
77
|
+
yarn add -D @optiprune/core
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
@@ -83,10 +83,10 @@ yarn add -D optiprune
|
|
|
83
83
|
Run Optiprune from your project root:
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
|
-
npx optiprune
|
|
86
|
+
npx @optiprune/cli
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
### CLI Options
|
|
89
|
+
### CLI Options (@optiprune/cli)
|
|
90
90
|
|
|
91
91
|
| Flag | Description | Default |
|
|
92
92
|
| :--- | :--- | :--- |
|
|
@@ -99,12 +99,33 @@ npx optiprune
|
|
|
99
99
|
| `--sarif` | Output as SARIF | `false` |
|
|
100
100
|
| `--skip-3` | Skip Layer 3 (SMT Constraint Solver) | `false` |
|
|
101
101
|
| `--skip-4` | Skip Layer 4 (Concolic Execution Proofs) | `false` |
|
|
102
|
+
| `--fix <targets...>` | Required fix targets: `files`, `exports`, `dependencies`, `devDependencies`, or `conditions` | none |
|
|
103
|
+
| `--confidence <level>` | Minimum fix confidence: `high`, `medium+`, `low+`, or `all` | `high` |
|
|
104
|
+
| `--force` | Override the configured confidence safety boundary | `false` |
|
|
105
|
+
| `--dry-run` | Report planned fixes without modifying files | `false` |
|
|
106
|
+
|
|
107
|
+
For example, to fix files, exports, dependencies, and development dependencies with low-confidence findings included, run:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx @optiprune/cli analyze --fix files exports dependencies devDependencies --confidence low+
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Use `--force` only when you explicitly accept fixes below the configured safety boundary:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx @optiprune/cli analyze --fix exports --confidence high --force
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`--confidence`, `--force`, and `--dry-run` require at least one `--fix` target. Unsupported or unknown targets are rejected before analysis begins.
|
|
102
120
|
|
|
103
121
|
---
|
|
104
122
|
|
|
105
123
|
## 🤝 Join the Revolution
|
|
106
124
|
OptiPrune isn't just a tool. It's a technical statement. Help us save the world from dirty code.
|
|
107
125
|
|
|
108
|
-
**GitHub:** [DreamLongYT/optiprune](https://github.com/
|
|
126
|
+
**GitHub:** [DreamLongYT/optiprune](https://github.com/optiprune/core)
|
|
109
127
|
**Web:** [opti.drml.int.yt](https://opti.drml.int.yt)
|
|
110
|
-
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
# Config
|
|
131
|
+
To setup OptiPrune, see [config.md](config.md) for more
|
package/config.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
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:
|
|
131
|
+
|
|
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.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "pathe";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
const program = new Command();
|
|
7
|
+
const FIX_TARGETS = new Set(["files", "exports", "dependencies", "devDependencies", "conditions"]);
|
|
8
|
+
// Using @ts-ignore for core imports as CI environments sometimes struggle
|
|
9
|
+
// with subpath exports resolution in strict NodeNext mode.
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
import { analyze, shouldFail, exportCache, importCache } from "@optiprune/core";
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
import { formatTerminal, formatSarif } from "@optiprune/core/reporters";
|
|
14
|
+
/** ANSI colour helpers */
|
|
15
|
+
const bold = (s) => `\x1b[1m${s}\x1b[0m`;
|
|
16
|
+
const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
|
|
17
|
+
const red = (s) => `\x1b[31m${s}\x1b[0m`;
|
|
18
|
+
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
19
|
+
// Helper to find the CLI package version
|
|
20
|
+
function getCliVersion() {
|
|
21
|
+
try {
|
|
22
|
+
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
let dir = currentDir;
|
|
24
|
+
while (dir !== path.dirname(dir)) {
|
|
25
|
+
const pkgPath = path.join(dir, "package.json");
|
|
26
|
+
if (fs.existsSync(pkgPath)) {
|
|
27
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
28
|
+
if (pkg.version)
|
|
29
|
+
return pkg.version;
|
|
30
|
+
}
|
|
31
|
+
dir = path.dirname(dir);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) { }
|
|
35
|
+
return "unknown";
|
|
36
|
+
}
|
|
37
|
+
// Helper to find the core version safely
|
|
38
|
+
function getCoreVersion(rootDir) {
|
|
39
|
+
try {
|
|
40
|
+
// 1. Try local node_modules in the current working directory
|
|
41
|
+
const localCore = path.join(rootDir, "node_modules/@optiprune/core/package.json");
|
|
42
|
+
if (fs.existsSync(localCore)) {
|
|
43
|
+
const content = fs.readFileSync(localCore, "utf-8");
|
|
44
|
+
const pkg = JSON.parse(content);
|
|
45
|
+
if (pkg.version)
|
|
46
|
+
return pkg.version;
|
|
47
|
+
}
|
|
48
|
+
// 2. Try resolving relative to this CLI file if bundled together
|
|
49
|
+
const cliDir = path.dirname(fileURLToPath(import.meta.url));
|
|
50
|
+
const siblingCore = path.join(cliDir, "../core/package.json");
|
|
51
|
+
if (fs.existsSync(siblingCore)) {
|
|
52
|
+
const content = fs.readFileSync(siblingCore, "utf-8");
|
|
53
|
+
const pkg = JSON.parse(content);
|
|
54
|
+
if (pkg.version)
|
|
55
|
+
return pkg.version;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (e) { }
|
|
59
|
+
return "1.11.45";
|
|
60
|
+
}
|
|
61
|
+
const cliVersion = getCliVersion();
|
|
62
|
+
const coreVersion = getCoreVersion(process.cwd());
|
|
63
|
+
program
|
|
64
|
+
.name("optiprune")
|
|
65
|
+
.description("Finds dead code in TypeScript/JavaScript projects.")
|
|
66
|
+
.version(`CLI: ${cliVersion}, Core: ${coreVersion}`, "-V, --version", "output the version number");
|
|
67
|
+
program
|
|
68
|
+
.command("analyze", { isDefault: true })
|
|
69
|
+
.description("Perform full analysis of the project")
|
|
70
|
+
.option("-r, --rootDir <path>", "Root directory of the project", process.cwd())
|
|
71
|
+
.option("-e, --entry <patterns...>", "Entry point patterns (glob or file paths)", [])
|
|
72
|
+
.option("-x, --extensions <exts...>", "File extensions to analyze", [".ts", ".tsx", ".js", ".jsx", ".vue"])
|
|
73
|
+
.option("-i, --ignore <patterns...>", "Ignore patterns (glob)", [])
|
|
74
|
+
.option("--no-report-unused-exports", "Do not report unused exports")
|
|
75
|
+
.option("--no-conventional-entries", "Do not include conventional entry points (e.g., src/index.ts)")
|
|
76
|
+
.option("--include-entry-exports", "Report unused exports declared directly in entry files")
|
|
77
|
+
.option("--cycles", "Print detected dependency cycles")
|
|
78
|
+
.option("--ignore-tests", "Ignore test files such as test.ts, *.test.ts, and __tests__ files")
|
|
79
|
+
.option("--fail-on <confidence>", "Fail on findings with confidence level (high, medium, low, none)", "high")
|
|
80
|
+
.option("--json", "Output results as JSON")
|
|
81
|
+
.option("--sarif", "Output results in SARIF format")
|
|
82
|
+
.option("--skip-3", "Skip Layer 3 (SMT Constraint Solver)")
|
|
83
|
+
.option("--skip-4", "Skip Layer 4 (Concolic Execution Proofs)")
|
|
84
|
+
.option("-v, --verbose", "Show verbose output and internal graph state")
|
|
85
|
+
.option("--fix <rules...>", "Fix selected targets: files, exports, dependencies, devDependencies")
|
|
86
|
+
.option("--confidence <level>", "Minimum confidence to fix (high, medium+, low+)", "high")
|
|
87
|
+
.option("--force", "Allow fixes when the source edit is otherwise considered unsafe")
|
|
88
|
+
.option("--dry-run", "Log what would be fixed without changing files")
|
|
89
|
+
.option("--cache-from <path>", "Path to a JSON file to import cache from before analysis")
|
|
90
|
+
.option("--cache-to <path>", "Path to export the resulting cache to after analysis")
|
|
91
|
+
.action(async (options, command) => {
|
|
92
|
+
try {
|
|
93
|
+
const isCliOverride = (name) => command.getOptionValueSource(name) === "cli";
|
|
94
|
+
let fixOption = undefined;
|
|
95
|
+
const hasFixFlags = isCliOverride("fix") || isCliOverride("confidence") || isCliOverride("force") || isCliOverride("dryRun");
|
|
96
|
+
if (hasFixFlags) {
|
|
97
|
+
if (!isCliOverride("fix")) {
|
|
98
|
+
throw new Error("--confidence, --force, and --dry-run require --fix <target...>");
|
|
99
|
+
}
|
|
100
|
+
const invalidTargets = options.fix.filter((target) => !FIX_TARGETS.has(target));
|
|
101
|
+
if (invalidTargets.length > 0) {
|
|
102
|
+
throw new Error(`Unknown --fix target(s): ${invalidTargets.join(", ")}. Choose files, exports, dependencies, devDependencies, or conditions.`);
|
|
103
|
+
}
|
|
104
|
+
fixOption = {
|
|
105
|
+
confidence: options.confidence,
|
|
106
|
+
rules: options.fix,
|
|
107
|
+
force: !!options.force,
|
|
108
|
+
dryRun: !!options.dryRun,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const analyzerOptions = {
|
|
112
|
+
...(isCliOverride("rootDir") && { rootDir: options.rootDir }),
|
|
113
|
+
...(isCliOverride("entry") && { entry: options.entry }),
|
|
114
|
+
...(isCliOverride("extensions") && { extensions: options.extensions }),
|
|
115
|
+
...(isCliOverride("ignore") && { ignore: options.ignore }),
|
|
116
|
+
...(isCliOverride("reportUnusedExports") && {
|
|
117
|
+
reportUnusedExports: options.reportUnusedExports,
|
|
118
|
+
}),
|
|
119
|
+
...(isCliOverride("conventionalEntries") && {
|
|
120
|
+
includeConventionalEntries: options.conventionalEntries,
|
|
121
|
+
}),
|
|
122
|
+
...(isCliOverride("includeEntryExports") && { includeEntryExports: options.includeEntryExports }),
|
|
123
|
+
...(isCliOverride("cycles") && { cycles: options.cycles }),
|
|
124
|
+
...(isCliOverride("ignoreTests") && { ignoreTests: options.ignoreTests }),
|
|
125
|
+
...(isCliOverride("failOn") && { failOn: options.failOn }),
|
|
126
|
+
...(isCliOverride("json") && { json: options.json }),
|
|
127
|
+
...(isCliOverride("skip3") && { skip3: options.skip3 }),
|
|
128
|
+
...(isCliOverride("skip4") && { skip4: options.skip4 }),
|
|
129
|
+
...(isCliOverride("verbose") && { verbose: options.verbose }),
|
|
130
|
+
...(fixOption !== undefined && { fix: fixOption }),
|
|
131
|
+
...(isCliOverride("cacheFrom") && { cacheFrom: options.cacheFrom }),
|
|
132
|
+
...(isCliOverride("cacheTo") && { cacheTo: options.cacheTo }),
|
|
133
|
+
};
|
|
134
|
+
const report = await analyze(analyzerOptions);
|
|
135
|
+
if (options.sarif) {
|
|
136
|
+
console.log(formatSarif(report));
|
|
137
|
+
}
|
|
138
|
+
else if (options.json) {
|
|
139
|
+
console.log(JSON.stringify(report, (k, v) => typeof v === 'bigint' ? v.toString() : v, 2));
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const terminal = formatTerminal(report, { showCycles: !!options.cycles });
|
|
143
|
+
console.log(terminal);
|
|
144
|
+
}
|
|
145
|
+
if (shouldFail(report, options.failOn))
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.error("An unexpected error occurred during analysis:", error);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
program
|
|
154
|
+
.command("export-cache <targetPath>")
|
|
155
|
+
.description("Export the current analysis cache to a JSON file")
|
|
156
|
+
.option("-r, --rootDir <path>", "Root directory of the project", process.cwd())
|
|
157
|
+
.action(async (targetPath, options) => {
|
|
158
|
+
try {
|
|
159
|
+
const rootDir = options.rootDir ?? process.cwd();
|
|
160
|
+
await exportCache(rootDir, targetPath);
|
|
161
|
+
console.log(`${yellow("✔")} Cache exported to ${bold(targetPath)}`);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.error("Failed to export cache:", error);
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
program
|
|
169
|
+
.command("import-cache <sourcePath>")
|
|
170
|
+
.description("Import an external cache JSON file into the local directory")
|
|
171
|
+
.option("-r, --rootDir <path>", "Root directory of the project", process.cwd())
|
|
172
|
+
.action(async (sourcePath, options) => {
|
|
173
|
+
try {
|
|
174
|
+
const rootDir = options.rootDir ?? process.cwd();
|
|
175
|
+
await importCache(rootDir, sourcePath);
|
|
176
|
+
console.log(`${yellow("✔")} Cache imported from ${bold(sourcePath)}`);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.error("Failed to import cache:", error);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
program.parse(process.argv);
|
|
184
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"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C,sBAAsB,EAAE,+BAA+B,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;KAC9E,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IACpC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACjD,MAAM,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,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/logo.svg
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="width:100%;height:100%">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="opti-grad-1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#6366F1"></stop>
|
|
5
|
+
<stop offset="50%" stop-color="#8B5CF6"></stop>
|
|
6
|
+
<stop offset="100%" stop-color="#D946EF"></stop>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="opti-grad-2" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
9
|
+
<stop offset="0%" stop-color="#06B6D4"></stop>
|
|
10
|
+
<stop offset="100%" stop-color="#3B82F6"></stop>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
<filter id="glow" x="-20%" y="-20%" width="140%" height="140%">
|
|
13
|
+
<feDropShadow dx="0" dy="8" stdDeviation="16" flood-color="#8B5CF6" flood-opacity="0.35"></feDropShadow>
|
|
14
|
+
</filter>
|
|
15
|
+
</defs>
|
|
16
|
+
<g filter="url(#glow)">
|
|
17
|
+
<path d="M 256 64 C 362 64, 448 150, 448 256 C 448 290, 439 322, 423 350 L 340 267 C 352 240, 345 208, 321 184 C 297 160, 265 153, 238 165 L 155 82 C 185 70, 220 64, 256 64 Z" fill="url(#opti-grad-1)"></path>
|
|
18
|
+
<path d="M 256 448 C 150 448, 64 362, 64 256 C 64 222, 73 190, 89 162 L 172 245 C 160 272, 167 304, 191 328 C 215 352, 247 359, 274 347 L 357 430 C 327 442, 292 448, 256 448 Z" fill="url(#opti-grad-1)"></path>
|
|
19
|
+
<polygon points="110,410 410,110 380,80 80,380" fill="url(#opti-grad-2)" opacity="0.9"></polygon>
|
|
20
|
+
</g>
|
|
21
|
+
<circle cx="256" cy="256" r="28" fill="#FFFFFF" opacity="0.95"></circle>
|
|
22
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optiprune",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.2.21",
|
|
4
|
+
"description": "CLI for resilient static dead-code analyzer for TypeScript and JavaScript workspaces.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
|
|
6
|
+
"bin": {
|
|
7
|
+
"optiprune": "./dist/cli.js"
|
|
8
|
+
},
|
|
8
9
|
"homepage": "https://opti.drml.int.yt/",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
12
|
+
"url": "git+https://github.com/optiprune/cli.git"
|
|
12
13
|
},
|
|
13
14
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/optiprune/cli/issues"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"analysis",
|
|
@@ -47,33 +48,44 @@
|
|
|
47
48
|
"pruning",
|
|
48
49
|
"dead",
|
|
49
50
|
"opti",
|
|
50
|
-
"optimization"
|
|
51
|
+
"optimization",
|
|
52
|
+
"resilient",
|
|
53
|
+
"api",
|
|
54
|
+
"optimization",
|
|
55
|
+
"resilient",
|
|
56
|
+
"analyzer",
|
|
57
|
+
"code"
|
|
51
58
|
],
|
|
52
|
-
"bin": {
|
|
53
|
-
"optiprune": "./bin/runner.js"
|
|
54
|
-
},
|
|
55
|
-
"exports": {
|
|
56
|
-
".": {
|
|
57
|
-
"types": "./dist/cli.d.ts",
|
|
58
|
-
"import": "./dist/cli.js"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
59
|
"files": [
|
|
62
|
-
"
|
|
60
|
+
"dist",
|
|
63
61
|
"README.md",
|
|
64
|
-
"LICENSE"
|
|
62
|
+
"LICENSE",
|
|
63
|
+
"config.md",
|
|
64
|
+
"package.json",
|
|
65
|
+
"logo.svg"
|
|
65
66
|
],
|
|
67
|
+
"exports": {
|
|
68
|
+
".": "./dist/cli.js",
|
|
69
|
+
"./package.json": "./package.json"
|
|
70
|
+
},
|
|
66
71
|
"dependencies": {
|
|
67
|
-
"@optiprune/
|
|
72
|
+
"@optiprune/core": "^1.11.45",
|
|
73
|
+
"commander": "^15.0.0",
|
|
68
74
|
"pathe": "2.0.3"
|
|
69
75
|
},
|
|
70
|
-
"
|
|
71
|
-
"node": "^22.
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@types/node": "^22.20.1",
|
|
78
|
+
"typescript": "^5.8.3"
|
|
72
79
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"test": "tests"
|
|
80
|
+
"optionalDependencies": {
|
|
81
|
+
"@yuku-codegen/wasm": "0.8.7",
|
|
82
|
+
"@yuku-parser/wasm": "0.8.7"
|
|
77
83
|
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"build": "tsc -p tsconfig.json",
|
|
86
|
+
"test": "node --test tests/ignore-unknown-import.test.mjs",
|
|
87
|
+
"prepublishOnly": "npm run build"
|
|
88
|
+
},
|
|
89
|
+
"license": "MIT",
|
|
78
90
|
"author": "DreamLongYT"
|
|
79
|
-
}
|
|
91
|
+
}
|
package/bin/runner.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
-
import path from "pathe";
|
|
5
|
-
|
|
6
|
-
const require = createRequire(import.meta.url);
|
|
7
|
-
|
|
8
|
-
let cliPath;
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
// 1. Try standard package resolution
|
|
12
|
-
const pkgPath = require.resolve("@optiprune/cli/package.json");
|
|
13
|
-
cliPath = path.join(path.dirname(pkgPath), "dist/cli.js");
|
|
14
|
-
} catch {
|
|
15
|
-
// 2. Monorepo / global symlink fallback
|
|
16
|
-
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
cliPath = path.resolve(currentDir, "../../cli/dist/cli.js");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Convert absolute Windows path (E:\...) into a valid file:// URL
|
|
21
|
-
const cliUrl = pathToFileURL(cliPath).href;
|
|
22
|
-
|
|
23
|
-
import(cliUrl).catch((err) => {
|
|
24
|
-
console.error("Failed to execute @optiprune/cli:", err);
|
|
25
|
-
process.exit(1);
|
|
26
|
-
});
|