structkit 3.1.0__py3-none-any.whl → 3.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. structkit/commands/generate.py +19 -8
  2. structkit/commands/sources.py +7 -3
  3. structkit/contribs/ansible-playbook.yaml +4 -0
  4. structkit/contribs/chef-cookbook.yaml +4 -0
  5. structkit/contribs/ci-cd-pipelines.yaml +4 -0
  6. structkit/contribs/cloudformation-files.yaml +4 -0
  7. structkit/contribs/configs/chglog.yaml +4 -0
  8. structkit/contribs/configs/codeowners.yaml +3 -0
  9. structkit/contribs/configs/devcontainer.yaml +4 -0
  10. structkit/contribs/configs/editor-config.yaml +4 -0
  11. structkit/contribs/configs/eslint.yaml +4 -0
  12. structkit/contribs/configs/jshint.yaml +4 -0
  13. structkit/contribs/configs/kubectl.yaml +4 -0
  14. structkit/contribs/configs/prettier.yaml +4 -0
  15. structkit/contribs/docker-files.yaml +4 -0
  16. structkit/contribs/documentation-template.yaml +4 -0
  17. structkit/contribs/git-hooks.yaml +4 -0
  18. structkit/contribs/github/chatmodes/plan.yaml +4 -0
  19. structkit/contribs/github/instructions/generic.yaml +4 -0
  20. structkit/contribs/github/prompts/generic.yaml +4 -0
  21. structkit/contribs/github/prompts/react-form.yaml +4 -0
  22. structkit/contribs/github/prompts/security-api.yaml +4 -0
  23. structkit/contribs/github/prompts/struct.yaml +4 -0
  24. structkit/contribs/github/templates.yaml +4 -0
  25. structkit/contribs/github/workflows/codeql.yaml +4 -0
  26. structkit/contribs/github/workflows/execute-tf-workflow.yaml +5 -0
  27. structkit/contribs/github/workflows/labeler.yaml +5 -0
  28. structkit/contribs/github/workflows/pre-commit.yaml +4 -0
  29. structkit/contribs/github/workflows/release-drafter.yaml +5 -0
  30. structkit/contribs/github/workflows/run-struct.yaml +4 -0
  31. structkit/contribs/github/workflows/stale.yaml +4 -0
  32. structkit/contribs/helm-chart.yaml +4 -0
  33. structkit/contribs/kubernetes-manifests.yaml +5 -0
  34. structkit/contribs/project/custom-structures.yaml +5 -0
  35. structkit/contribs/project/generic.yaml +6 -0
  36. structkit/contribs/project/go.yaml +4 -0
  37. structkit/contribs/project/java.yaml +5 -0
  38. structkit/contribs/project/n8n.yaml +5 -0
  39. structkit/contribs/project/nodejs.yaml +4 -0
  40. structkit/contribs/project/python.yaml +5 -0
  41. structkit/contribs/project/ruby.yaml +5 -0
  42. structkit/contribs/project/rust.yaml +5 -0
  43. structkit/contribs/prompts/run-struct-trigger.yaml +5 -0
  44. structkit/contribs/terraform/apps/aws-accounts.yaml +5 -0
  45. structkit/contribs/terraform/apps/environments.yaml +5 -0
  46. structkit/contribs/terraform/apps/generic.yaml +5 -0
  47. structkit/contribs/terraform/apps/github-organization.yaml +4 -0
  48. structkit/contribs/terraform/apps/init.yaml +4 -0
  49. structkit/contribs/terraform/modules/generic.yaml +5 -0
  50. structkit/contribs/vagrant-files.yaml +4 -0
  51. structkit/file_item.py +2 -0
  52. structkit/sources.py +225 -9
  53. structkit/struct_refs.py +140 -0
  54. {structkit-3.1.0.dist-info → structkit-3.2.1.dist-info}/METADATA +8 -8
  55. structkit-3.2.1.dist-info/RECORD +85 -0
  56. {structkit-3.1.0.dist-info → structkit-3.2.1.dist-info}/WHEEL +1 -1
  57. structkit-3.1.0.dist-info/RECORD +0 -84
  58. {structkit-3.1.0.dist-info → structkit-3.2.1.dist-info}/entry_points.txt +0 -0
  59. {structkit-3.1.0.dist-info → structkit-3.2.1.dist-info}/licenses/LICENSE +0 -0
  60. {structkit-3.1.0.dist-info → structkit-3.2.1.dist-info}/top_level.txt +0 -0
@@ -6,6 +6,7 @@ from structkit.file_item import FileItem, ContentFetchError
6
6
  from structkit.completers import file_strategy_completer, structures_completer
7
7
  from structkit.template_renderer import TemplateRenderer, TemplateVariableError
8
8
  from structkit.sources import SourceError, resolve_structures_path
9
+ from structkit.struct_refs import SourceContext, resolve_struct_reference
9
10
  from structkit.input_store import InputStoreError
10
11
 
11
12
  import subprocess
@@ -208,7 +209,7 @@ class GenerateCommand(Command):
208
209
  # Actually generate structure
209
210
  try:
210
211
  self._create_structure(args, mappings)
211
- except (GenerateConfigError, TemplateVariableError, ContentFetchError, InputStoreError) as exc:
212
+ except (GenerateConfigError, SourceError, TemplateVariableError, ContentFetchError, InputStoreError) as exc:
212
213
  self.logger.error(f"❗ {exc}")
213
214
  raise SystemExit(1) from None
214
215
 
@@ -217,7 +218,7 @@ class GenerateCommand(Command):
217
218
  self.logger.error("Post-hook failed.")
218
219
  return
219
220
 
220
- def _create_structure(self, args, mappings=None, summary=None, print_summary=True):
221
+ def _create_structure(self, args, mappings=None, summary=None, print_summary=True, source_context=None):
221
222
  if isinstance(args, dict):
222
223
  args = argparse.Namespace(**args)
223
224
 
@@ -225,6 +226,12 @@ class GenerateCommand(Command):
225
226
  self._load_yaml_config(args.structure_definition, args.structures_path)
226
227
  )
227
228
 
229
+ is_top_level_source_context = source_context is None
230
+ source_context = (source_context or SourceContext.from_global()).merge_inline(
231
+ config.get('sources'),
232
+ allow_override=is_top_level_source_context,
233
+ )
234
+
228
235
  # Safely parse template variables
229
236
  template_vars = self._parse_template_vars(args.vars) if getattr(args, 'vars', None) else {}
230
237
  config_structure = config.get('files', config.get('structure', []))
@@ -395,10 +402,12 @@ class GenerateCommand(Command):
395
402
  merged_vars = merged_vars if merged_vars else None
396
403
 
397
404
  if isinstance(content['struct'], str):
405
+ child_structures_path, child_structure_definition = resolve_struct_reference(
406
+ content['struct'], args.structures_path, source_context)
398
407
  self._create_structure({
399
- 'structure_definition': content['struct'],
408
+ 'structure_definition': child_structure_definition,
400
409
  'base_path': folder_path,
401
- 'structures_path': args.structures_path,
410
+ 'structures_path': child_structures_path,
402
411
  'dry_run': args.dry_run,
403
412
  'diff': getattr(args, 'diff', False),
404
413
  'output': getattr(args, 'output', 'file'),
@@ -408,13 +417,15 @@ class GenerateCommand(Command):
408
417
  'global_system_prompt': args.global_system_prompt,
409
418
  'input_store': args.input_store,
410
419
  'non_interactive': args.non_interactive,
411
- }, mappings=mappings, summary=summary, print_summary=False)
420
+ }, mappings=mappings, summary=summary, print_summary=False, source_context=source_context)
412
421
  elif isinstance(content['struct'], list):
413
422
  for struct in content['struct']:
423
+ child_structures_path, child_structure_definition = resolve_struct_reference(
424
+ struct, args.structures_path, source_context)
414
425
  self._create_structure({
415
- 'structure_definition': struct,
426
+ 'structure_definition': child_structure_definition,
416
427
  'base_path': folder_path,
417
- 'structures_path': args.structures_path,
428
+ 'structures_path': child_structures_path,
418
429
  'dry_run': args.dry_run,
419
430
  'diff': getattr(args, 'diff', False),
420
431
  'output': getattr(args, 'output', 'file'),
@@ -424,7 +435,7 @@ class GenerateCommand(Command):
424
435
  'global_system_prompt': args.global_system_prompt,
425
436
  'input_store': args.input_store,
426
437
  'non_interactive': args.non_interactive,
427
- }, mappings=mappings, summary=summary, print_summary=False)
438
+ }, mappings=mappings, summary=summary, print_summary=False, source_context=source_context)
428
439
  else:
429
440
  self.logger.warning(f"Unsupported content in folder: {folder}")
430
441
 
@@ -15,14 +15,18 @@ class SourcesCommand(Command):
15
15
  def __init__(self, parser):
16
16
  super().__init__(parser)
17
17
  parser.description = "Manage named custom structure sources"
18
- parser.add_argument('--config-path', type=str, help='Override sources config path (env: STRUCTKIT_SOURCES_CONFIG)')
18
+ parser.add_argument(
19
+ '--config-path',
20
+ type=str,
21
+ help='Override sources config path (env: STRUCTKIT_SOURCES_CONFIG)',
22
+ )
19
23
  subparsers = parser.add_subparsers(dest='sources_command')
20
24
 
21
25
  subparsers.add_parser('list', help='List configured sources').set_defaults(sources_func=self.list_sources)
22
26
 
23
- add_parser = subparsers.add_parser('add', help='Add or update a local source')
27
+ add_parser = subparsers.add_parser('add', help='Add or update a local, GitHub, or git-backed source')
24
28
  add_parser.add_argument('name')
25
- add_parser.add_argument('path_or_url')
29
+ add_parser.add_argument('path_or_url', help='Local directory, owner/repo, github://owner/repo, or git URL')
26
30
  add_parser.set_defaults(sources_func=self.add_source)
27
31
 
28
32
  remove_parser = subparsers.add_parser('remove', help='Remove a configured source')
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates an Ansible playbook scaffold with main.yml, vars.yml, tasks/main.yml,
3
+ handlers/main.yml, a templates directory, and a README.md.
4
+
1
5
  files:
2
6
  - main.yml:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a Chef cookbook scaffold for configuring NGINX, including a default recipe,
3
+ node attributes, an nginx.conf.erb template, a default index.html, and a README.md.
4
+
1
5
  files:
2
6
  - recipes/default.rb:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates CI/CD pipeline configuration files for multiple platforms: GitLab CI (.gitlab-ci.yml),
3
+ Jenkins (Jenkinsfile), and GitHub Actions (ci.yml and cd.yml) with build, test, and deploy stages.
4
+
1
5
  files:
2
6
  - .gitlab-ci.yml:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates AWS CloudFormation files: a template.yaml defining an S3 bucket resource,
3
+ a parameters.json file, and a deploy.sh script for deploying the stack via the AWS CLI.
4
+
1
5
  files:
2
6
  - template.yaml:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates git-chglog configuration files (.chglog/config.yaml and CHANGELOG.tpl.md)
3
+ for automated changelog generation with GitHub-style commit parsing and Markdown output.
4
+
1
5
  files:
2
6
  - .chglog/config.yaml:
3
7
  content: |
@@ -1,3 +1,6 @@
1
+ description: >
2
+ Creates a CODEOWNERS file assigning all repository files to a configurable GitHub username.
3
+
1
4
  files:
2
5
  - CODEOWNERS: |
3
6
  * @github_username
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a VS Code dev container configuration using Python 3.12 (bullseye) with
3
+ yamlfmt and pre-commit features pre-installed.
4
+
1
5
  files:
2
6
  - .devcontainer/devcontainer.json:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates an .editorconfig file enforcing consistent coding style across editors:
3
+ UTF-8, LF line endings, 2-space indentation, and trailing whitespace trimming.
4
+
1
5
  files:
2
6
  - .editorconfig:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates ESLint configuration files (.eslintrc.json and .eslintignore) for a
3
+ React/ES2021 project with eslint:recommended and react/recommended rules enabled.
4
+
1
5
  files:
2
6
  - .eslintrc.json:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates JSHint configuration files (.jshintrc and .jshintignore) for Node.js/ES6
3
+ JavaScript linting, excluding node_modules and dist directories.
4
+
1
5
  files:
2
6
  - .jshintrc:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a .kuberc kubectl preferences file with a custom alias for creating namespaces
3
+ and a forced --interactive=true flag for kubectl delete commands.
4
+
1
5
  files:
2
6
  - .kuberc:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates Prettier code-formatting configuration files (.prettierrc and .prettierignore)
3
+ with standard style settings: single quotes, ES5 trailing commas, 80-char print width.
4
+
1
5
  files:
2
6
  - .prettierrc:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates Docker configuration files: a Dockerfile (nginx-based), .dockerignore,
3
+ a docker-compose.yml with web and db (MySQL) services, and a .env file.
4
+
1
5
  files:
2
6
  - Dockerfile:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates standard open-source project documentation files: README.md, CONTRIBUTING.md,
3
+ CODE_OF_CONDUCT.md, and LICENSE.md, all templated with a project_name variable.
4
+
1
5
  files:
2
6
  - README.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates executable Git hook shell scripts under .git/hooks/: pre-commit,
3
+ pre-push, and commit-msg, each with a placeholder for custom hook logic.
4
+
1
5
  files:
2
6
  - .git/hooks/pre-commit:
3
7
  permissions: 755
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Copilot chat mode file (plan.chatmode.md) that configures an AI
3
+ planning assistant for generating implementation plans without making any code edits.
4
+
1
5
  files:
2
6
  - ./github/chatmodes/plan.chatmode.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a generic GitHub Copilot instructions file (.github/instructions/generic.instruction.md)
3
+ as a blank starter template for defining AI coding guidelines and context.
4
+
1
5
  files:
2
6
  - .github/instructions/generic.instruction.md:
3
7
  skip_if_exists: true
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a generic GitHub Copilot prompt file (.github/prompts/generic.prompt.md)
3
+ as a blank starter template for defining reusable AI prompts.
4
+
1
5
  files:
2
6
  - .github/prompts/generic.prompt.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Copilot prompt for generating React form components using
3
+ react-hook-form (uncontrolled), yup validation schemas, and TypeScript types.
4
+
1
5
  files:
2
6
  - .github/prompts/react-form.prompt.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Copilot prompt for reviewing REST API security, covering
3
+ authentication, input validation, rate limiting, and security event logging.
4
+
1
5
  files:
2
6
  - .github/prompts/security-api.prompt.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Copilot prompt that configures an AI assistant for generating
3
+ valid .struct.yaml files for the StructKit tool, with schema references and usage examples.
4
+
1
5
  files:
2
6
  - .github/prompts/struct.prompt.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates GitHub PR templates (bug fix, feature request, general PR) under
3
+ .github/PULL_REQUEST_TEMPLATE/ and an issue template under .github/ISSUE_TEMPLATE/.
4
+
1
5
  files:
2
6
  - .github/PULL_REQUEST_TEMPLATE/bug_fix_template.md:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Actions CodeQL analysis workflow (z-codeql.yaml) for JavaScript
3
+ security scanning, triggered on push/PR to default branches and on a weekly schedule.
4
+
1
5
  files:
2
6
  - .github/workflows/z-codeql.yaml:
3
7
  content: | # yaml
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a GitHub Actions workflow for running Terraform plan on PRs and apply on pushes
3
+ to main, scoped to a specific app path under .devops/apps/. Uses variables for app name,
4
+ working directory path, and GitHub token.
5
+
1
6
  files:
2
7
  - .github/workflows/execute-tf-{{@ app_name | slugify @}}.yaml:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a GitHub Actions labeler workflow (labeler.yaml) and a labeler config
3
+ (.github/labeler.yml) that auto-assigns PR labels based on changed file paths
4
+ and branch name patterns (feature, bug, docs, release).
5
+
1
6
  files:
2
7
  - .github/labeler.yml:
3
8
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Actions pre-commit workflow (z-pre-commit.yaml) and a
3
+ .pre-commit-config.yaml with check-yaml, end-of-file-fixer, and trailing-whitespace hooks.
4
+
1
5
  files:
2
6
  - .github/workflows/z-pre-commit.yaml:
3
7
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a release drafter workflow (z-release-drafter.yaml), a major tagging workflow
3
+ (z-major-tagging.yaml), and a release-drafter.yml config with feature/bugfix/patch
4
+ label categories and semantic versioning resolution.
5
+
1
6
  files:
2
7
  - .github/workflows/z-release-drafter.yaml:
3
8
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Actions workflow (run-struct.yaml) that can be manually triggered
3
+ via workflow_dispatch to run struct file generation, plus a starter .struct.yaml file.
4
+
1
5
  files:
2
6
  - .github/workflows/run-struct.yaml:
3
7
  skip_if_exists: true
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a GitHub Actions workflow (stale.yaml) that runs daily on a cron schedule
3
+ to mark inactive issues and pull requests as stale with configurable messages.
4
+
1
5
  files:
2
6
  - .github/workflows/stale.yaml:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a complete Helm chart scaffold including Chart.yaml, values.yaml,
3
+ Deployment/Service/Ingress templates, a helpers partial, and .helmignore.
4
+
1
5
  files:
2
6
  - Chart.yaml:
3
7
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates Kubernetes manifest files for deploying a containerised application:
3
+ Deployment, Service, Ingress, ConfigMap, Secret, and README.md.
4
+ Uses variables for app name, deployment name, and Docker image details.
5
+
1
6
  files:
2
7
  - deployment.yaml:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates the scaffolding for a custom StructKit structures repository: README.md,
3
+ custom-mappings.yaml, a structures/ directory, and common configs via sub-structures
4
+ (devcontainer, editor-config, prettier, run-struct, release-drafter, pre-commit).
5
+
1
6
  files:
2
7
  - README.md:
3
8
  content: |
@@ -1,3 +1,9 @@
1
+ description: >
2
+ Creates a comprehensive generic project scaffold with standard directory structure
3
+ (.config, .build, src, test, doc, tools, dep), common config files (.editorconfig,
4
+ .gitignore, Dockerfile, docker-compose.yml), GitHub community files, and Terraform
5
+ environment apps (prod, stage, qa, dev, init).
6
+
1
7
  files:
2
8
  - .config/REMOVE_ME.md:
3
9
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a Go project scaffold with standard directory layout (cmd, pkg, internal, api, test),
3
+ main.go entry point, .editorconfig, .gitignore, README.md, and Apache 2.0 LICENSE.
4
+
1
5
  files:
2
6
  - .editorconfig:
3
7
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a Java Maven project scaffold with pom.xml, standard Maven directory layout
3
+ (src/main/java, src/test/java), App.java and AppTest.java starters, .editorconfig,
4
+ .gitignore, README.md, and Apache 2.0 LICENSE.
5
+
1
6
  files:
2
7
  - .editorconfig:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a self-hosted n8n workflow automation setup with docker-compose.yaml
3
+ (n8n container + Traefik reverse proxy with automatic HTTPS), .env configuration,
4
+ and a local-files/ directory. Uses variables for domain, subdomain, timezone, and SSL email.
5
+
1
6
  files:
2
7
  - .gitignore:
3
8
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a Node.js project scaffold with package.json, src/index.js and utils.js,
3
+ public/index.html, a test starter, .editorconfig, .gitignore, README.md, and Apache 2.0 LICENSE.
4
+
1
5
  files:
2
6
  - .editorconfig:
3
7
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a Python project scaffold with setup.py, setup.cfg, pyproject.toml,
3
+ Makefile (with venv management), requirements.txt, src and tests directories
4
+ with starter modules, .editorconfig, .gitignore, and Apache 2.0 LICENSE.
5
+
1
6
  files:
2
7
  - .editorconfig:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a Ruby project scaffold with .rubocop.yml, RSpec test structure (spec/),
3
+ lib directory with versioned module and main class, bin/console and bin/setup scripts,
4
+ .editorconfig, .gitignore, README.md, and Apache 2.0 LICENSE.
5
+
1
6
  files:
2
7
  - .editorconfig:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a Rust project scaffold with Cargo.toml, src/main.rs and lib.rs, module files,
3
+ integration tests, benchmarks, .cargo/config for cross-compilation, .editorconfig,
4
+ .gitignore, README.md, and Apache 2.0 LICENSE.
5
+
1
6
  files:
2
7
  - .editorconfig:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates an AI agent prompt file that instructs the assistant to query GitHub for
3
+ repositories matching a given topic in a specified organization, then trigger the
4
+ run-struct workflow on each of them.
5
+
1
6
  files:
2
7
  - run-struct-trigger.md:
3
8
  content: |
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates Terraform app directories for nonprod and prod AWS accounts under
3
+ .devops/apps/accounts/, each using the generic app structure with a remote backend,
4
+ plus execute-tf-workflow GitHub Actions workflows for each account.
5
+
1
6
  folders:
2
7
  - .devops/apps/accounts/nonprod:
3
8
  struct: terraform/apps/generic
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates Terraform app directories for four environments (dev, qa, stage, prod) under
3
+ .devops/apps/environments/, using the generic app structure with a remote backend,
4
+ plus execute-tf-workflow GitHub Actions workflows for each environment.
5
+
1
6
  folders:
2
7
  - .devops/apps/environments/dev:
3
8
  struct: terraform/apps/generic
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a generic Terraform app scaffold with main.tf, variables.tf, outputs.tf,
3
+ providers.tf (with a remote backend on app.terraform.io), and README.md.
4
+ Uses variables for the remote backend organization and workspace names.
5
+
1
6
  files:
2
7
  - main.tf:
3
8
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates Terraform files for managing a GitHub organization: providers.tf with the
3
+ GitHub provider and a remote backend, plus main.tf, variables.tf, outputs.tf, and README.md.
4
+
1
5
  files:
2
6
  - providers.yaml:
3
7
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a Terraform init app directory under .devops/apps/init/ using the generic
3
+ app structure with a remote backend, plus an execute-tf-workflow GitHub Actions workflow.
4
+
1
5
  folders:
2
6
  - .devops/apps/init:
3
7
  struct: terraform/apps/generic
@@ -1,3 +1,8 @@
1
+ description: >
2
+ Creates a generic Terraform module scaffold with main.tf (EC2 instance example),
3
+ variables.tf, outputs.tf, versions.tf (with AWS and Datadog providers auto-versioned),
4
+ and README.md. Uses a module_name variable for documentation templating.
5
+
1
6
  files:
2
7
  - main.tf:
3
8
  content: |
@@ -1,3 +1,7 @@
1
+ description: >
2
+ Creates a Vagrant development environment with a Vagrantfile (Ubuntu bionic64),
3
+ an executable bootstrap.sh provisioning script that installs nginx, and a README.md.
4
+
1
5
  files:
2
6
  - Vagrantfile:
3
7
  content: |
structkit/file_item.py CHANGED
@@ -104,6 +104,8 @@ class FileItem:
104
104
  }
105
105
  if not template_vars:
106
106
  return default_vars
107
+ if not isinstance(template_vars, dict):
108
+ return default_vars
107
109
  return {**default_vars, **template_vars}
108
110
 
109
111
  def apply_template_variables(self, template_vars):