Skip to content

Adapter architecture

ThemeAdapter is the common path and application contract. Every adapter implements getConfigPaths() and getFileExtension(), advertises canGenerate()/canApply(), and derives a shared generated sourcePath() from those methods.

ThemeGenerator extends that base for formatters that emit theme files. Its generation side writes adapter-owned sources; the base application side reads the same source path, finds destination paths, applies files, and runs the hooks below.

Hook or methodResponsibility
shouldApply()Environment gate before live changes.
sourcePath()Canonical generated source location.
generateExtraFiles()Apply-time pointers or extra artifacts.
postApplyHook()Best-effort reload/restart side effects.

The shared writer creates parent paths and uses atomic write/copy helpers for ordinary managed files. Application skips when environment gating returns false, while orchestration isolates adapter failures so later targets can continue.