How to run from `sumeru_custom_addons`
Goal: keep sumeru/ free of local addon churn while still importing sumeru as a library.
Summary
The sibling directory sumeru_custom_addons/ is a small Go module with:
- Its own
go.modandreplace sumeru => ../sumeru - A generated
addonimports/zimports.go(packageaddonimports) listing blank imports for addons undersumeru_custom_addons/addons/ - Its own
sumeru.conf(often withsumeru_homepointing at the core checkout)
Canonical sample addon: addons/my_module. Makefile targets: setup | generate | new MODULE=x | run | build | install | update.
Steps
- Copy
sumeru.conf.example→sumeru.confand set database +addons_path(typically../sumeru/addons,../sumeru_addons, and./addonsfor core + standard + custom modules).
- From
sumeru_custom_addons/:
```bash
make setup
make new MODULE=my_module
make install MODULES=my_module
make run
```
| Target | Effect |
| ------ | ------ |
| make setup | Wire go.mod replaces, generate imports, create sumeru.conf if missing |
| make generate | Refresh addonimports/zimports.go, each custom addon’s zmodels.go / zrefs.go, and overwrite that addon’s init.go to models-only |
| make new MODULE=x | Scaffold with sumeru-bp into addons/, then generate |
| make install MODULES=x | -i then exit |
- After adding a model struct, run
make generateagain. Do not hand-edit generated files.
See also
sumeru_custom_addons/README.md(authoritative detail)- Creating an addon
- Scaffold a new addon
- Tooling