Documentation
¶
Overview ¶
`nucleus generate module <name>` — the package-per-feature slice generator (ADR-022 §4). Where `generate resource` spreads a feature across the layer packages (models/controllers/services/repositories/ modules), this emits ONE self-contained package under internal/<name>/ that carries everything the feature needs: model+storage, controller, mountable module with its own Policies and CSRF exemption, embedded migrations applied through rt.ApplyModuleMigrations, and an embedded page template. Mounting it is the whole integration — no rbac_policy.csv or nucleus.yml edits, no manual migrate step.
Route-table printing and `--with-policy` seeding for the generators (GF-04). The audit measured the first POST against a freshly generated resource as a 403→404→419 ladder: the default-deny authorizer masks the 404 of a guessed path, the generator never said which routes it mounted, and the scaffold's CSRF exemptions do not cover the new API. This file closes the three gaps: the generator prints the exact route table it wired, and --with-policy seeds the anonymous RBAC rows plus the CSRF exemption the way `generate module` already carries them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is injected at build time in releases via ldflags:
go build -ldflags "-X github.com/jcsvwinston/nucleus/internal/cli.Version=v1.13.0" ./cmd/nucleus
It is deliberately NOT the whole answer. `go install pkg@vX.Y.Z` — the path the README documents and the one every consumer actually uses — passes no ldflags, so this stayed at its placeholder and `nucleus version` answered "dev" for a binary installed at an exact version (QCD-CLI-6). The binary knew: `go version -m` reads the module version out of its own build info. The command just never asked.
In a CLI-first product `version` is the primary evidence of WHICH CLI produced an artifact, so "dev" made a release and a hand-compiled binary indistinguishable. cliVersion falls back to build info, the way the quark CLI in this same suite already did.
Functions ¶
func ContractAliasCommandNames ¶
func ContractAliasCommandNames() []string
ContractAliasCommandNames returns the sorted list of CLI alias names (e.g. "runserver", "makemigrations"). Mirrors ContractPrimaryCommandNames for callers that need to recognise both primary commands and their Django-style aliases — the website CLI overview parity test in contracts/ being one such caller.
func ContractPrimaryCommandNames ¶
func ContractPrimaryCommandNames() []string
ContractPrimaryCommandNames returns the sorted list of primary CLI command names that are considered part of the root command surface contract.
Types ¶
This section is empty.
Source Files
¶
- add.go
- aliases.go
- apikey.go
- cachecommands.go
- changepassword.go
- common.go
- completion.go
- configcommands.go
- contenttypecommands.go
- contracts_scaffold.go
- createuser.go
- dev.go
- dev_procgroup_linux.go
- dev_procgroup_unix.go
- diffsettings.go
- doctor.go
- doctor_auth.go
- doctor_image.go
- doctor_security.go
- external.go
- fixturecommands.go
- generate.go
- generatemodule.go
- generatepolicy.go
- health.go
- i18ncommands.go
- inspectdb.go
- mailproviders.go
- migrate.go
- migrationmaintenance.go
- mountedit.go
- new.go
- ogrinspect.go
- openapi.go
- orbit_guard.go
- outboxcommands.go
- outputstyle.go
- plugincommands.go
- root.go
- routes.go
- routes_procgroup_unix.go
- seed.go
- sendtestemail.go
- serve.go
- shell.go
- sqlcommands.go
- sqlutil.go
- startapp.go
- staticcommands.go
- testcmd.go
- testserver.go
- usage.go
- wizard.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package scaffold renders the `nucleus new` starter project from a tree of embedded template files instead of inline Go string literals.
|
Package scaffold renders the `nucleus new` starter project from a tree of embedded template files instead of inline Go string literals. |