Skip to main content

Module json_ui_migrate_v1

Module json_ui_migrate_v1 

Source
Expand description

v1 → v2 JSON-UI controller migration codemod.

Reads a Rust controller file using the v1 make_node / JsonUiView::new builder pattern, emits a flat JSON spec under src/views/{module}/{handler}.json, and rewrites the controller body to call JsonUi::render_file(...).

Phase 163 D-09 / D-10 / D-11:

  • AST-based (syn 2), not regex (D-11).
  • Single file per invocation (D-10) — no directory recursion.
  • Idempotent — re-running on already-migrated source emits a warning and exits 0 (D-11).
  • --dry-run prints proposed output without writing (D-11).
  • Cases the codemod cannot translate produce a // TODO: … marker above the handler signature; the handler body is left intact (D-09).

The output spec path is src/views/{module}/{handler}.json, where {module} is the file stem of the controller (e.g. src/controllers/auth.rssrc/views/auth/login_form.json).

Functions§

run
Entry point invoked by the json-ui:migrate-v1 subcommand.