Przeglądaj źródła

feat(static): add static template kind

xcad 1 dzień temu
rodzic
commit
fe62c70ed1
5 zmienionych plików z 41 dodań i 2 usunięć
  1. 1 0
      AGENTS.md
  2. 1 0
      CHANGELOG.md
  3. 5 2
      README.md
  4. 14 0
      cli/modules/static/__init__.py
  5. 20 0
      tests/test_static_module.py

+ 1 - 0
AGENTS.md

@@ -115,6 +115,7 @@ The project is stored in a public GitHub Repository, use issues, and branches fo
 - `helm`
 - `kubernetes`
 - `packer`
+- `static`
 - `swarm`
 - `terraform`
 

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## [Unreleased]
 
 ### Added
+- Static template kind for technology-agnostic file and directory boilerplates (#1786)
 - `template.json` runtime support with required `files/` directories, custom `<< >>` / `<% %>` / `<# #>` delimiters, and legacy-format rejection for `0.2.0` (#1768)
 - Remote generation destinations via `generate --remote` and `--remote-path`, including SSH host discovery and SCP upload flow (#1765)
 - Initial dedicated `swarm` module and validation flow as groundwork for the `compose` / `swarm` split in `0.2.0` (#1766)

+ 5 - 2
README.md

@@ -4,7 +4,7 @@ Create reusable templates and turn them into configurable workloads for homelabs
 
 ## How it works
 
-Create reusable templates for infrastructure expertise like Docker, Kubernetes, Terraform, Ansible, Python, and more. Use the built-in *Jinja2-like* templating syntax with `<< >>` variables, `<% %>` blocks, and `<# #>` comments to keep configuration modular and conditional. Sync with Git in both directions or manage everything locally. Render templates, configure variables through a guided wizard, and wire up secrets. Copy them to remote servers and environments or any local directory.
+Create reusable templates for infrastructure expertise like Docker, Kubernetes, Terraform, Ansible, static files, Python, and more. Use the built-in *Jinja2-like* templating syntax with `<< >>` variables, `<% %>` blocks, and `<# #>` comments to keep configuration modular and conditional. Sync with Git in both directions or manage everything locally. Render templates, configure variables through a guided wizard, and wire up secrets. Copy them to remote servers and environments or any local directory.
 
 ✨ Explore 100+ template presets for homelabs and self-hosted infrastructure: https://github.com/ChristianLempa/boilerplates-library
 
@@ -67,9 +67,12 @@ boilerplates --help
 # Update Repository Library
 boilerplates repo update
 
-# List all available templates for a docker compose
+# List all available templates for a Docker Compose stack
 boilerplates compose list
 
+# List technology-agnostic static file templates
+boilerplates static list
+
 # Show details about a specific template
 boilerplates compose show nginx
 

+ 14 - 0
cli/modules/static/__init__.py

@@ -0,0 +1,14 @@
+"""Static templates module."""
+
+from ...core.module import Module
+from ...core.registry import registry
+
+
+class StaticModule(Module):
+    """Static templates module."""
+
+    name = "static"
+    description = "Manage static file templates"
+
+
+registry.register(StaticModule)

+ 20 - 0
tests/test_static_module.py

@@ -0,0 +1,20 @@
+"""Tests for the static template module."""
+
+from __future__ import annotations
+
+import cli.modules.static  # noqa: F401 - import registers the module
+from cli.core.registry import registry
+from cli.modules.static import StaticModule
+
+
+def test_static_module_metadata() -> None:
+    """The static module should expose the expected CLI metadata."""
+    assert StaticModule.name == "static"
+    assert StaticModule.description == "Manage static file templates"
+
+
+def test_static_module_registers_with_registry() -> None:
+    """Importing the module should make the static kind discoverable."""
+    registered_modules = dict(registry.iter_module_classes())
+
+    assert registered_modules["static"] is StaticModule