Skip to content

feat: add addon management functionality#3

Merged
juancadev-io merged 3 commits intomainfrom
feat/add-addon-management-functionality
Mar 7, 2026
Merged

feat: add addon management functionality#3
juancadev-io merged 3 commits intomainfrom
feat/add-addon-management-functionality

Conversation

@juancadev-io
Copy link
Contributor

This pull request introduces a new keel add command for installing addons into Keel projects, along with comprehensive tests for its behavior. It also significantly improves the module and repository generation logic, particularly for projects using the GORM addon, by ensuring proper wiring of dependencies and updating registration in main.go. The changes enhance dependency injection, module registration, and test coverage for addon installation and code generation.

New addon installation command:

  • Added cmd/add/add.go implementing the keel add command, which installs addons by alias or repo, validates project structure, prompts for community addons, and wires dependencies.
  • Introduced cmd/add/add_test.go with extensive tests covering official and community addon installation, abort flows, error handling, and invalid project detection.

Module and repository generation improvements:

  • Updated repository generation to detect GORM addon presence and generate appropriate files; warns and generates stubs if GORM is not installed, with clear instructions to install the adapter. [1] [2] [3]
  • Enhanced module registry regeneration to track database-backed repositories, wire services/controllers with their dependencies, and set a UsesDatabase flag for module registration. [1] [2]

Main.go wiring enhancements:

  • Modified ensureModuleRegisteredInMain in cmd/generate/wire.go to detect if a module requires a database, and update main.go to import and bootstrap the database and wire modules with db as needed.

Test coverage for GORM integration:

  • Added tests to verify that modules and repositories generated with GORM are correctly wired in both module files and main.go, including database import, bootstrap, and module registration with db. [1] [2]

Dependency wiring and registration logic:

  • Refined registration functions to propagate repository and service dependencies through module, service, and controller layers, ensuring accurate dependency injection and module wiring. [1] [2]

These changes collectively improve the Keel CLI's extensibility, reliability, and developer experience for both addon installation and code generation workflows.

@juancadev-io juancadev-io merged commit d87f64a into main Mar 7, 2026
2 checks passed
@github-actions github-actions bot mentioned this pull request Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant