Fast, safe refactoring tools for large TypeScript monorepos with transparent Vue SFC support.
Note: This tool is optimized for large TypeScript monorepos.
Requires Node.js 18+, pnpm, and Git.
git clone https://github.com/rolfwr/tslor.git
cd tslor
pnpm install
pnpm run bundle
npm linkThis builds the CLI from source and makes the tslor command available globally. To update, pull and rebuild:
cd tslor
git pull
pnpm install
pnpm run bundleTo uninstall:
npm unlink -g tslorTSLOR provides command-line tools for refactoring operations that become slow or unreliable in IDEs when working with large codebases:
- Extract symbols from one module to another with automatic dependency resolution
- Move files and update all imports across the codebase
- Analyze dependencies and find architectural issues like cycles and bottlenecks
- Search and trace symbol usage across projects
All operations work identically with TypeScript and Vue Single File Components through transparent <script> block extraction.
Find architectural bottlenecks:
tslor hot .Extract symbols safely using the propose/apply pattern:
tslor propose-split src/utils.ts src/date-utils.ts formatDate parseDate
tslor diff # preview changes
tslor apply --verify 'npm test' # apply with automatic rollback if tests failMove a file and update all imports:
tslor mv src/old-path.ts src/new-path.tsRun tslor --help for all available commands.
Refactoring: propose-split and split extract symbols with dependency resolution, apply executes proposed changes with optional verification, diff previews changes as unified diffs, mv moves files and updates imports.
Analysis: hot finds bottleneck modules, cycles detects circular dependencies, dependencies lists transitive dependencies, imports finds who imports a module, grep provides fast symbol search.
TSLOR separates concerns through three phases. Static analysis parses TypeScript ASTs without filesystem access, resolves imports, and persists to JSONL with grouped indexing for O(1) lookups. Plan generation queries this indexed data to determine dependencies and creates execution plans with checksums. Transformation executes plans atomically with optional verification and automatic rollback.
The propose/apply pattern lets you review refactoring plans before execution. Checksum validation prevents stale plans from being applied.
pnpm install
pnpm check # build + lint (biome, oxlint, ast-grep)
tsx src/tslor.ts <cmd> # run during development without buildingMIT — see LICENSE for details.