https://github.com/danvk/ts-mover
Utility for moving and renaming files in a TypeScript project
https://github.com/danvk/ts-mover
Last synced: 5 months ago
JSON representation
Utility for moving and renaming files in a TypeScript project
- Host: GitHub
- URL: https://github.com/danvk/ts-mover
- Owner: danvk
- License: apache-2.0
- Created: 2021-02-20T21:24:06.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-22T15:50:28.000Z (over 5 years ago)
- Last Synced: 2025-07-23T04:44:16.148Z (about 1 year ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ts-mover
Utility for moving and renaming files in a TypeScript project.
See [this Stack Overflow question][1] for background and motivation.
To get going, create a file containing the path to your tsconfig.json followed by a list of moves you'd like to do:
$ cat moves.txt
/path/to/project/tsconfig.json
src/oldname.ts --> src/newname.ts
src/file.ts --> src/newmodule/file.ts
src/file2.ts --> src/newmodule/
Then run `ts-mover` on this file:
npx ts-mover moves.txt
And you're good to go! Moves are only committed to disk once they all succeed.
## Development
$ yarn
$ yarn tsc
To test:
$ yarn tsc
$ node dist/index.js moves.sample.txt
Initializing project tsconfig.json
Project source files:
src/index.ts
Moving src/index.ts --> src/mover.ts
(Be patient, the first move takes the longest.)
elapsed: 455 ms
Saving changes to disk...
$ git status
deleted: src/index.ts
Untracked files:
(use "git add ..." to include in what will be committed)
src/mover.ts
[1]: https://stackoverflow.com/questions/65970569/reorganize-large-typescript-project-from-the-command-line