Skip to content

feat(enterprise): wire Pro extension points for custom fields and frontend#96

Merged
singret merged 3 commits into
mainfrom
ope-109-enterprise-hooks
May 24, 2026
Merged

feat(enterprise): wire Pro extension points for custom fields and frontend#96
singret merged 3 commits into
mainfrom
ope-109-enterprise-hooks

Conversation

@singret
Copy link
Copy Markdown
Contributor

@singret singret commented May 24, 2026

Summary

  • Moves `enterprise` package from `internal/` → public so `regen-pro` can import it across module boundaries (Go `internal/` restriction)
  • Adds `CustomFieldsHandler` hook — OSS no-op returns `402 Payment Required` on all `/api/v1/custom-fields` routes
  • Adds `UIProvider` hook — OSS no-op returns the OSS `ui.FS()`; Pro binary injects its own embedded frontend
  • Adds `SetEnterpriseHooks()` to the commands package for Pro binary injection before `Execute()`

Why

Custom fields and future Pro-only pages must not ship in the OSS build. This PR wires the extension points so `regen-pro` can register real handlers and serve its own frontend without any Pro code in the OSS repo.

Test plan

  • `go build ./...` passes
  • `GET /api/v1/custom-fields` returns `402` in OSS binary
  • Existing frontend serve behaviour unchanged
  • CI passes

singret added 3 commits May 24, 2026 09:11
…ion point

Adds CustomFieldsHandler to enterprise.Hooks so the Pro binary can
register custom field routes without shipping code in the OSS build.
OSS no-op returns 402 on all /api/v1/custom-fields routes.

SetEnterpriseHooks() lets regen-pro inject the full Hooks struct before
calling Execute(), keeping the OSS binary unchanged for users who don't
have a Pro licence.
The regen-pro binary imports the enterprise interfaces to inject Pro
implementations. Go's internal/ restriction prevents cross-module
imports, so the package must live at backend/enterprise/ instead of
backend/internal/enterprise/.

All import paths updated; no-op stubs and interfaces unchanged.
Adds a UIProvider interface to enterprise.Hooks so the Pro binary can
serve its own embedded frontend (with Pro-only pages and components)
instead of the OSS build.

The OSS no-op delegates to ui.FS() — behaviour is unchanged for the
OSS binary. routes.go now calls hooks.UI.FS() instead of ui.FS() directly.
@singret singret changed the title feat(enterprise): add CustomFields hook and SetEnterpriseHooks injection point feat(enterprise): wire Pro extension points for custom fields and frontend May 24, 2026
@singret singret merged commit 68d7f95 into main May 24, 2026
4 checks passed
@singret singret deleted the ope-109-enterprise-hooks branch May 24, 2026 10:08
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