Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
module: ["mailkit", "gonsole"]
module: ["mailkit", "gonsole", "pluginkit", "pluginkit/graphwire"]
defaults:
run:
working-directory: ${{ matrix.module }}
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
strategy:
fail-fast: false
matrix:
module: ["mailkit", "gonsole", "gonsole/auth"]
module: ["mailkit", "gonsole", "gonsole/auth", "pluginkit", "pluginkit/graphwire"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
Expand All @@ -117,7 +117,7 @@ jobs:
strategy:
fail-fast: false
matrix:
module: ["mailkit", "gonsole", "gonsole/auth"]
module: ["mailkit", "gonsole", "gonsole/auth", "pluginkit", "pluginkit/graphwire"]
defaults:
run:
working-directory: ${{ matrix.module }}
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ need and ignore the rest.
TypeScript applications, published to npm as `@gopherium/gottext`.
- [`mailkit`](mailkit/) renders mail from template files and sends it
over SMTP.
- [`pluginkit`](pluginkit/) migrates, starts and stops the compiled
plugins of an application, guards their routes, and generates their
wiring.
- [`pluginkit/graphwire`](pluginkit/graphwire/) generates the GraphQL
resolver root of an application from the schemas of its plugins.

## Design

Expand Down
47 changes: 47 additions & 0 deletions pluginkit/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "2"

linters:
default: standard
enable:
- cyclop
- depguard
- gocognit
- lll
- misspell
- revive
- unconvert
- unparam
settings:
cyclop:
max-complexity: 10
gocognit:
min-complexity: 15
lll:
line-length: 120
revive:
rules:
- name: blank-imports
disabled: true
- name: exported
depguard:
rules:
dependency-purity:
list-mode: strict
allow:
- $gostd
- github.com/gopherium/framework/pluginkit
exclusions:
rules:
- path: _test\.go
linters:
- cyclop
- gocognit

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/gopherium/framework
48 changes: 48 additions & 0 deletions pluginkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Changelog

Releases of this module are tagged `pluginkit/vX.Y.Z`. Releases up to
0.5.0 were tagged `vX.Y.Z` in `github.com/gopherium/pluginkit`.

## Unreleased

- The module moved to `github.com/gopherium/framework/pluginkit`.
- The module needs Go 1.27.1.

## 0.5.0 - 2026-08-14

- `wire.Config` gains optional `GoRegistryPath` and `GoRegistryPackage`
fields writing an importable registry whose `All` registers every
plugin, for test code that must compose the full set.

## 0.4.0 - 2026-08-14

- `wire.Config` gains an optional `Roots` list naming the plugin root
directories scanned in order, defaulting to `plugins`. An id present
in more than one root is rejected.

## 0.3.0 - 2026-08-05

- New optional `Seeder` capability, `Seed(ctx) error`, for plugins that can
fill their own schema with development data.
- `Host.Seed` asks every `Seeder` in registration order and stops at the
first failure, with the same panic isolation as the other host calls.
Seeding stays outside `Start`, so booting never writes sample data.

## 0.2.0 - 2026-07-26

- `wire.Config` gains an optional `TSLicense` field for applications whose
generated TypeScript wiring carries a different license than the Go one.
It defaults to `License` when empty.

## 0.1.0 - 2026-07-26

Initial release:

- Lifecycle contract: `Plugin`, `Migrator`, `RouteProvider`,
`PublicPathProvider`.
- `Host`: migrate-before-start, in-order start with reverse-order stop,
rollback on failed start, panic isolation per plugin call.
- `Protect`: exact-match public-path passthrough around caller-supplied
middleware.
- `wire`: plugin manifest loading/validation and Go + TypeScript wiring
generation, parameterized by the consuming application.
3 changes: 3 additions & 0 deletions pluginkit/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/gopherium/framework/pluginkit

go 1.27.1
48 changes: 48 additions & 0 deletions pluginkit/graphwire/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: "2"

linters:
default: standard
enable:
- cyclop
- depguard
- gocognit
- lll
- misspell
- revive
- unconvert
- unparam
settings:
cyclop:
max-complexity: 10
gocognit:
min-complexity: 15
lll:
line-length: 120
revive:
rules:
- name: blank-imports
disabled: true
- name: exported
depguard:
rules:
dependency-purity:
list-mode: strict
allow:
- $gostd
- github.com/gopherium/framework/pluginkit
- github.com/vektah/gqlparser/v2
exclusions:
rules:
- path: _test\.go
linters:
- cyclop
- gocognit

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/gopherium/framework
62 changes: 62 additions & 0 deletions pluginkit/graphwire/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Changelog

All notable changes to the `graphwire` module are documented in this
file. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the module
follows [Semantic Versioning](https://semver.org/). While at v0.x, minor
releases may contain breaking changes.

Releases of this module are tagged `pluginkit/graphwire/vX.Y.Z`.
Releases up to 0.3.0 were tagged `graphwire/vX.Y.Z` in
`github.com/gopherium/pluginkit`. The module lives beside the
stdlib-only `pluginkit` module so its gqlparser dependency never enters
`pluginkit` itself.

## [Unreleased]

### Changed

- The module moved to `github.com/gopherium/framework/pluginkit/graphwire`.
- The module needs Go 1.27.1.

## [0.3.0] - 2026-08-14

### Added

- `Config` gains an optional `Roots` list naming the plugin root
directories scanned in order, defaulting to `plugins`. Each plugin's
SDL is read from the root its manifest came from, and an id present
in more than one root is rejected.

## [0.2.1] - 2026-08-07

### Fixed

- Composite resolver structs embedded two sets sharing an unqualified
type name, such as a core and a plugin `QueryResolvers`, which Go
rejects as a duplicate field. The generator now names each contributed
set through a package local type alias before embedding it, so shared
types compile with any number of contributors.

## [0.2.0] - 2026-08-07

### Added

- `Config.Package` and `Config.SDKImport`, generating into a named
importable package with exported identifiers instead of package main,
plus the `FromPlugins` assembler that locates each graphql plugin's
resolver sets among the registered plugins by type assertion and
composes the root, failing loudly when a flagged plugin is absent.

## [0.1.0] - 2026-08-07

### Added

- `Run` and `Config`, generating an application's graph resolver root
from the plugin manifests and SDL under plugins/. Plugins opt in with
`"graphql": true` in plugin.json and export one `<Type>Resolvers` set
per GraphQL type they define or extend. The generator parses SDL with
gqlparser, derives the resolver bearing types the same way gqlgen does
(root types, argumented fields, and goField forceResolver fields), and
emits one composite struct per shared type plus the ResolverRoot
accessors.
Loading
Loading