Exporting

Exporting is where Typeflows generates the actual files your tools expect from your configuration code. This is the final step in the Typeflows cycle, where abstract configuration objects become concrete files that systems can use.

How Exporting Works

The key concept of exporting is controlled generation: your configuration code describes what should exist, and the export process creates it. This is different from traditional configuration management where you manually create and maintain files.

When you export, Typeflows executes your configuration code to build a complete representation of your desired file structure, then materialises that structure on disk. The result is that your files match exactly what your code describes - no more, no less.

Controlled Generation

Typeflows adopts a controlled overwriting strategy where generated files completely replace any existing files. This helps ensure that the files on disk exactly match your configuration code, preventing configuration drift.

This approach means generated files are “owned” by the Typeflows export process. Manual edits to these files will be lost when export runs again. This behaviour is intentional - it maintains the single source of truth principle where your configuration code is authoritative.

This maintains consistency: what you see on disk matches what your configuration code produces.

Automatic Documentation

A unique aspect of Typeflows exporting is that it can automatically generate documentation and visual representations of your configurations alongside the actual configuration files. This creates living documentation that stays in sync with your configurations.

This documentation helps teams understand complex configurations and see relationships that aren’t obvious from individual files. Because it’s generated automatically, it stays current and consistent with the actual configuration.

Beyond File Generation

Exporting enables capabilities that traditional configuration management cannot provide:

  • Validation before generation: Configurations are verified for correctness before any files are created
  • Atomic updates: Either all files are updated successfully, or none are changed
  • Change tracking: Clear visibility into what changed and why
  • Reproducible results: The same configuration code produces identical files

By treating file generation as a controlled, automated process, Typeflows helps ensure that your configuration files remain correct, consistent, and up-to-date with your intentions. This reduces the drift, errors, and maintenance burden that characterise traditional configuration management approaches.