`src/index.ts` contains roughly 180 lines of `--fix` execution logic that has no reason to live in the entry point:
- `FixExecutionResult` type (line 497)
- `applyFixesIfRequested()` (line 378) — orchestrates spinner, runs install commands per target, returns a result object
- `buildFixCommandParts()` (line 451) — builds the install command array for a given package manager
- `runInstallCommand()` (line 467) — spawns the child process and resolves on exit
- `commandLabelForPackageManager()` (line 490) — maps package manager to display label
- `countBySeverity()` (line 506) — counts findings by severity label
- `printFixModeSummary()` (line 521) — prints the applied/skipped summary after `--fix` completes
Work to do:
- Create `src/utils/fix-runner.ts`
- Move all the above and export what `src/index.ts` needs
- Update `src/index.ts` to import from `./utils/fix-runner.js`
- Run `npm test && npm run build` to confirm nothing broke
No behaviour changes — pure extraction.
`src/index.ts` contains roughly 180 lines of `--fix` execution logic that has no reason to live in the entry point:
Work to do:
No behaviour changes — pure extraction.