terradart_codegen

pub: terradart_codegen Dart SDK License: Apache-2.0

Maintainer tooling for TerraDart. Parses terraform providers schema -json (plus optional Magic Modules YAML overlays) into a unified provider IR and emits typed Dart factory wrappers for terradart_google and other provider packages.

This package ships the terradart CLI for maintainers and contributors curating committed factories:

  • terradart wrap — regenerate curated factory wrappers from wrapper_overrides/yaml/. Run with --check in CI to verify byte-identical output.
  • terradart wrap-init — scaffold a new wrapper override YAML from schema + MM hints.
  • terradart wrap-promote — propose enum_values and dartTypeOverrides blocks for human review.

End users depend on terradart_google, terradart_google_beta, terradart_appwrite, or terradart_cloudflare directly; they do not run generation locally.

Installation

Activate on the same minor line as your workspace when working on the repo:

dart pub global activate terradart_codegen ^0.28.x

Check pub.flutter-io.cn for the latest patch.

Maintainer quickstart

From packages/terradart_codegen/:

dart run bin/terradart.dart wrap \
  --provider hashicorp/google \
  --source test/fixtures/wrap/source \
  --output ../terradart_google/lib/src

# CI parity check (no writes):
dart run bin/terradart.dart wrap \
  --provider hashicorp/google \
  --source test/fixtures/wrap/source \
  --output ../terradart_google/lib/src \
  --check

The --source directory must contain schema.json and may include mm/<resource>.yaml overlays.

For runtime primitives (Stack, Resource, writeTo), see terradart_core. For project-level documentation, see the terradart repo README and terradart.dev.

Libraries

terradart_codegen
Maintainer tooling for terradart curated factories.