feat: warn about non-import references to moved files
The import graph only rewrites import/export-from/require. Files are also named from markdown links, package.json fields, jest.mock strings and tsconfig file lists, and a move that dangles those must not pass silently. mv now scans text formats plus source strings for the moved paths, module names and old specifier forms (word-boundary matched, lockfiles/hidden dirs skipped) and reports each occurrence once per line on stderr and as non_import_refs[] in --json (dry-run included). References are never edited; exit codes are unchanged. Also moves normalize_scope into Index (its only consumer) and the Change/ChangedFile JSON structs into output where they are built, to stay inside the 250-line-per-file budget.
This commit is contained in:
parent
b1af375763
commit
1ddf79b508
21 changed files with 557 additions and 81 deletions
|
|
@ -60,6 +60,9 @@ jmove mv src/foo.ts src/bar/foo.ts --no-git
|
|||
# Move a whole directory: every file relocates, every importer follows
|
||||
jmove mv src/utils src/helpers
|
||||
|
||||
# Moves also warn (never edit) about references the import graph cannot
|
||||
# see: markdown links, package.json fields, jest.mock strings
|
||||
|
||||
# Java: jmove updates `package`, all `import`s and moves the file
|
||||
jmove mv src/com/example/utils/Parser.java src/com/example/core/Parser.java
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue