How s-yadav/relative-to-alias works
relative-to-alias is a CLI codemod: users specify source files, an alias and its target path; the tool discovers eligible files, rewrites matching imports or requires, and writes changed files back in place. The CLI orchestration and transformation helpers are implemented in src/index.js and src/util.js; the parallel lib/ files are the published runtime entry. The graph follows the source implementation. Major relationships are supported by the excerpts; external library and filesystem interactions are shown where the source makes them explicit.
Main entry points: index.js CLI orchestration · util.js File processing
Components 8
Other components
- CLI user
- CLI orchestration
src/index.js - Source discovery
src/util.js - Glob library
- File filtering
src/util.js - File processing
src/util.js - AST rewriting
src/util.js - Filesystem
Connections 7
- CLI user → CLI orchestration: provides options
README.md - CLI orchestration → Source discovery: builds search pattern
src/index.js - CLI orchestration → Glob library: searches files
src/index.js - CLI orchestration → File filtering: filters candidates
src/index.js - CLI orchestration → File processing: transforms each file
src/index.js - File processing → Filesystem: reads and writes
src/util.js - File processing → AST rewriting: gets transformed code
src/util.js