Typeflows FS

TypeflowsFS is Typeflows’ file system abstraction layer that models your entire repository structure as code objects. Instead of manually creating files and directories, you work with TypeflowsFS components that know how to create themselves on disk.

Repository Structure as Code

TypeflowsFS represents files and directories as code objects that understand how to materialise themselves, changing file system management from imperative commands to declarative descriptions of what should exist.

Components model the hierarchical structure of file systems through composable, recursive design - each component knows what it represents and how to create itself when needed.

The TypeflowsFS Components

TypeflowsFSEntry

The foundation of the TypeflowsFS system. This interface represents anything that can be written to disk - files, directories, or complex composite structures. Every TypeflowsFS component implements this interface, ensuring consistent behaviour across the system.

TypeflowsFile

The core file abstraction in TypeflowsFS. A TypeflowsFile combines a filename with content and knows how to render that content and write it to the appropriate location, creating any necessary parent directories automatically.

TypeflowsDir

A named container that holds other TypeflowsFSEntry objects, including other TypeflowsDir instances. This recursive structure enables building complete directory hierarchies - directories within directories, each containing their own files and subdirectories, forming the tree structures that define repository layouts.

TypeflowsResources

The static asset component of TypeflowsFS. Unlike TypeflowsFile and TypeflowsDir which are programmatically defined, TypeflowsResources enables distributing pre-existing files like templates, binaries, and documentation alongside your configuration code.

Typeflows

The complete repository abstraction that extends TypeflowsDir to represent entire repository structures. Typeflows provides standard fields for common repository files like README, LICENSE, .gitignore, and version files, creating a foundation for consistent repository layouts. It can be extended for platform-specific repositories (GitHub, GitLab) and supports composition with various configuration extensions.

Why TypeflowsFS Matters

Hierarchical Composition

TypeflowsFS components naturally compose into tree structures that mirror how you think about repository organisation. Directories contain files and other directories, which contain their own files and directories, creating the nested hierarchies that define project structures.

Seamless Integration

Because all TypeflowsFS components implement the same interface, they combine effortlessly. You can build complex project structures from simple components, mixing programmatically generated files with static resources through a unified API.

Testability

TypeflowsFS enables verifying file structure logic without touching the actual file system. Test that your project structure contains the expected files and directories before generating anything, catching structural errors at development time.

Reusability

Common file structures become reusable TypeflowsFS components. Standard project layouts, boilerplate files, and complex directory hierarchies can be packaged and shared across projects, eliminating repetitive setup work.

Extensions and Platform Support

TypeflowsFS supports extensions that add platform-specific capabilities and configurations. Extensions can provide specialised components for tools like CircleCI, Docker, Kubernetes, or cloud platforms, while maintaining the same composable, hierarchical approach.

This extension system enables TypeflowsFS to adapt to any technology stack or platform without compromising the core abstraction model. Platform-specific knowledge is encapsulated in extensions while preserving the unified interface for composition and reuse.

The TypeflowsFS Advantage

TypeflowsFS makes file system management a reliable, automated process rather than manual file creation. It enables treating entire repository structures as composable, testable software components within a unified abstraction layer.

The result is that creating complex file structures becomes as reliable and maintainable as any other software development task. Instead of maintaining files, you maintain the TypeflowsFS code that creates them.