feat: MVP — move files, rewrite imports, atomically
- core: gitignore-aware index (ignore crate), forward/reverse import graph,
relative-specifier math, pure-data move plans
- apply: rewrite-first + rename-last with fsync, temp+rename, full rollback
(incl. stale-plan detection before any write); unified diff for dry-run
- cli: mv + check commands, human output, --json envelope with stable error
codes (SOURCE_NOT_FOUND, TARGET_EXISTS, ...) and hints; exit codes 0/1/2
- parser/core split into submodules to keep files <=250 lines
- tests: 37 unit + 10 e2e + 2 doctests; fixtures tests/typescript/{basic,normal,complex}
- docs: SKILL.md synced (no --force in Phase 1), EXAMPLES.md
- plan: AI/agent support done; Phase 1.5 = Java niche
This commit is contained in:
parent
9d8f1e0bba
commit
55670030c3
37 changed files with 1851 additions and 139 deletions
|
|
@ -17,10 +17,12 @@ JavaScript; Java/Python/Go on the roadmap. Single binary, no LSP needed.
|
|||
### mv — move a file and rewrite its importers
|
||||
|
||||
```
|
||||
jmove mv <source> <target> [--root DIR] [--dry-run] [--json] [--force]
|
||||
jmove mv <source> <target> [--root DIR] [--dry-run] [--json]
|
||||
```
|
||||
|
||||
Always run `--dry-run` first and confirm the change set looks right.
|
||||
Moving onto an existing path fails with `TARGET_EXISTS` — choose another
|
||||
target (Phase 1 has no overwrite mode).
|
||||
|
||||
### check — find broken imports
|
||||
|
||||
|
|
@ -54,6 +56,5 @@ and a `hint` describing the next action. On success, `mv` reports
|
|||
## Rules of use
|
||||
|
||||
- Never run `mv` without a prior `--dry-run` in the same session.
|
||||
- Never pass `--force` unless the user explicitly authorized overwriting.
|
||||
- After every successful `mv`, run `check`; treat exit code `2` as
|
||||
a failed refactor.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue