scripts

command
v0.2.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

migrate_yaml rewrites tuiquery example YAMLs from the legacy data.sources + data.pipelines split into the unified polymorphic shape (one data.sources map, every entry carries a `type:`).

Run:

go run scripts/migrate_yaml.go examples/*.yaml

Per-file transforms:

  • For each entry in `data.pipelines:`:
  • Identify the operator (from / filter / project / derive / sort / union / compose / join / cache). `from:` alone → passthrough.
  • Lift the operator's sub-fields up onto the entry.
  • Add `type: <op>` at the head of the entry.
  • Move the entry into `data.sources:`.
  • For inline `pipe:` stages on any entry:
  • Convert `{filter: {where: X}}` → `{type: filter, where: X}` (same lift + type-prepend).
  • For components: rename `pipeline: X` → `source: X`.
  • Delete the `data.pipelines:` block entirely.

The yaml.v3 Node API preserves comments through edit + round-trip, so the rewritten files keep their headers and inline annotations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL