From 42789ffd0fef3f6f7256e5325fb7b92a699103e4 Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Tue, 7 Jul 2026 11:39:22 +0800 Subject: [PATCH] refactor: migrate plugin SDK imports from block/core to block/pluginsdk Rewrite import prefix git.dev.alexdunmow.com/block/core/{plugin,blocks, templates,abi} to git.dev.alexdunmow.com/block/pluginsdk/* across the CLI's plugin build/verify logic (internal/bnp), plugin commands (cmd/ninja/cmd), and the wasm build fixtures (testdata/fixture, testdata/capfixture). go.mod adds pluginsdk@v0.1.0; core is retained only for cmd/ninja/cmd/theme.go (ParseModFull), which is left untouched as in-flight work. Co-Authored-By: Claude Fable 5 --- cmd/ninja/cmd/plugin.go | 2 +- cmd/ninja/cmd/plugin_build_test.go | 4 ++-- cmd/ninja/cmd/plugin_gallery.go | 2 +- cmd/ninja/cmd/plugin_gallery_test.go | 2 +- cmd/ninja/cmd/plugin_tags.go | 2 +- cmd/ninja/cmd/plugin_test.go | 2 +- cmd/ninja/cmd/testdata/capfixture/main.go | 2 +- cmd/ninja/cmd/testdata/capfixture/registration.go | 8 ++++---- cmd/ninja/cmd/testdata/fixture/main.go | 2 +- cmd/ninja/cmd/testdata/fixture/registration.go | 6 +++--- go.mod | 7 ++++--- go.sum | 10 ++++++---- internal/bnp/build.go | 4 ++-- internal/bnp/codeless.go | 4 ++-- internal/bnp/codeless_test.go | 2 +- internal/bnp/manifest.go | 2 +- internal/bnp/mixed_test.go | 2 +- internal/bnp/verify.go | 2 +- 18 files changed, 34 insertions(+), 31 deletions(-) diff --git a/cmd/ninja/cmd/plugin.go b/cmd/ninja/cmd/plugin.go index f12843e..2b670d0 100644 --- a/cmd/ninja/cmd/plugin.go +++ b/cmd/ninja/cmd/plugin.go @@ -15,7 +15,7 @@ import ( "connectrpc.com/connect" "github.com/spf13/cobra" - core "git.dev.alexdunmow.com/block/core/plugin" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" "git.dev.alexdunmow.com/block/cli/internal/bnp" "git.dev.alexdunmow.com/block/cli/internal/creds" diff --git a/cmd/ninja/cmd/plugin_build_test.go b/cmd/ninja/cmd/plugin_build_test.go index a2cd70e..2477938 100644 --- a/cmd/ninja/cmd/plugin_build_test.go +++ b/cmd/ninja/cmd/plugin_build_test.go @@ -9,14 +9,14 @@ import ( "strings" "testing" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" "git.dev.alexdunmow.com/block/cli/internal/bnp" "github.com/klauspost/compress/zstd" "google.golang.org/protobuf/proto" ) // fixtureDir resolves a guest-plugin fixture under this package's testdata/. -// The fixtures compile against the cli module's pinned block/core@v0.18.x +// The fixtures compile against the cli module's pinned block/pluginsdk // (guest SDK), which is exactly what `ninja plugin build` drives in the wild. func fixtureDir(t *testing.T, name string) string { t.Helper() diff --git a/cmd/ninja/cmd/plugin_gallery.go b/cmd/ninja/cmd/plugin_gallery.go index 3d609ca..6de41a4 100644 --- a/cmd/ninja/cmd/plugin_gallery.go +++ b/cmd/ninja/cmd/plugin_gallery.go @@ -10,7 +10,7 @@ import ( "connectrpc.com/connect" "github.com/spf13/cobra" - core "git.dev.alexdunmow.com/block/core/plugin" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" v1 "git.dev.alexdunmow.com/block/cli/internal/api/orchestrator/v1" "git.dev.alexdunmow.com/block/cli/internal/creds" diff --git a/cmd/ninja/cmd/plugin_gallery_test.go b/cmd/ninja/cmd/plugin_gallery_test.go index f731518..6af01a4 100644 --- a/cmd/ninja/cmd/plugin_gallery_test.go +++ b/cmd/ninja/cmd/plugin_gallery_test.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" - core "git.dev.alexdunmow.com/block/core/plugin" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" "git.dev.alexdunmow.com/block/cli/internal/creds" ) diff --git a/cmd/ninja/cmd/plugin_tags.go b/cmd/ninja/cmd/plugin_tags.go index 009d020..74a8144 100644 --- a/cmd/ninja/cmd/plugin_tags.go +++ b/cmd/ninja/cmd/plugin_tags.go @@ -11,7 +11,7 @@ import ( "connectrpc.com/connect" "github.com/spf13/cobra" - core "git.dev.alexdunmow.com/block/core/plugin" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" "git.dev.alexdunmow.com/block/cli/internal/creds" "git.dev.alexdunmow.com/block/cli/internal/orchclient" v1 "git.dev.alexdunmow.com/block/cli/internal/api/orchestrator/v1" diff --git a/cmd/ninja/cmd/plugin_test.go b/cmd/ninja/cmd/plugin_test.go index e4d8425..8bad976 100644 --- a/cmd/ninja/cmd/plugin_test.go +++ b/cmd/ninja/cmd/plugin_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - core "git.dev.alexdunmow.com/block/core/plugin" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" ) func TestCheckRepoHasHEAD_NoCommitsReturnsFriendlyError(t *testing.T) { diff --git a/cmd/ninja/cmd/testdata/capfixture/main.go b/cmd/ninja/cmd/testdata/capfixture/main.go index c1cf042..c52f821 100644 --- a/cmd/ninja/cmd/testdata/capfixture/main.go +++ b/cmd/ninja/cmd/testdata/capfixture/main.go @@ -2,7 +2,7 @@ package main -import "git.dev.alexdunmow.com/block/core/plugin/wasmguest" +import "git.dev.alexdunmow.com/block/pluginsdk/plugin/wasmguest" func init() { wasmguest.Serve(Registration) } func main() {} // never called — reactor mode diff --git a/cmd/ninja/cmd/testdata/capfixture/registration.go b/cmd/ninja/cmd/testdata/capfixture/registration.go index d680db3..4e05521 100644 --- a/cmd/ninja/cmd/testdata/capfixture/registration.go +++ b/cmd/ninja/cmd/testdata/capfixture/registration.go @@ -10,11 +10,11 @@ import ( "fmt" // Registers the "bnwasm" database/sql driver (its init runs sql.Register). - _ "git.dev.alexdunmow.com/block/core/plugin/wasmguest/bnwasm" + _ "git.dev.alexdunmow.com/block/pluginsdk/plugin/wasmguest/bnwasm" - "git.dev.alexdunmow.com/block/core/blocks" - "git.dev.alexdunmow.com/block/core/plugin" - "git.dev.alexdunmow.com/block/core/templates" + "git.dev.alexdunmow.com/block/pluginsdk/blocks" + "git.dev.alexdunmow.com/block/pluginsdk/plugin" + "git.dev.alexdunmow.com/block/pluginsdk/templates" ) var Registration = plugin.PluginRegistration{ diff --git a/cmd/ninja/cmd/testdata/fixture/main.go b/cmd/ninja/cmd/testdata/fixture/main.go index c1cf042..c52f821 100644 --- a/cmd/ninja/cmd/testdata/fixture/main.go +++ b/cmd/ninja/cmd/testdata/fixture/main.go @@ -2,7 +2,7 @@ package main -import "git.dev.alexdunmow.com/block/core/plugin/wasmguest" +import "git.dev.alexdunmow.com/block/pluginsdk/plugin/wasmguest" func init() { wasmguest.Serve(Registration) } func main() {} // never called — reactor mode diff --git a/cmd/ninja/cmd/testdata/fixture/registration.go b/cmd/ninja/cmd/testdata/fixture/registration.go index a4561d8..6339c31 100644 --- a/cmd/ninja/cmd/testdata/fixture/registration.go +++ b/cmd/ninja/cmd/testdata/fixture/registration.go @@ -9,9 +9,9 @@ import ( "io" "strings" - "git.dev.alexdunmow.com/block/core/blocks" - "git.dev.alexdunmow.com/block/core/plugin" - "git.dev.alexdunmow.com/block/core/templates" + "git.dev.alexdunmow.com/block/pluginsdk/blocks" + "git.dev.alexdunmow.com/block/pluginsdk/plugin" + "git.dev.alexdunmow.com/block/pluginsdk/templates" ) // capReport is populated by the Load hook from capability calls, then diff --git a/go.mod b/go.mod index a34deb0..8de8cbe 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,8 @@ go 1.26.4 require ( connectrpc.com/connect v1.20.0 git.dev.alexdunmow.com/block/core v0.18.2 + git.dev.alexdunmow.com/block/pluginsdk v0.1.0 + github.com/chromedp/cdproto v0.0.0-20260321001828-e3e3800016bc github.com/chromedp/chromedp v0.15.1 github.com/klauspost/compress v1.18.6 github.com/spf13/cobra v1.10.2 @@ -15,7 +17,6 @@ require ( require ( github.com/BurntSushi/toml v1.6.0 // indirect - github.com/chromedp/cdproto v0.0.0-20260321001828-e3e3800016bc // indirect github.com/chromedp/sysutil v1.1.0 // indirect github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 // indirect github.com/gobwas/httphead v0.1.0 // indirect @@ -25,10 +26,10 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.9.2 // indirect + github.com/jackc/pgx/v5 v5.10.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/spf13/pflag v1.0.9 // indirect - golang.org/x/mod v0.34.0 // indirect + golang.org/x/mod v0.37.0 // indirect golang.org/x/sys v0.44.0 // indirect golang.org/x/text v0.36.0 // indirect ) diff --git a/go.sum b/go.sum index 261e5c6..7a58158 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ connectrpc.com/connect v1.20.0 h1:6TNDAB+WeNd2uolWNlYczB5E0KNNaVMNUEx8JEUsPmQ= connectrpc.com/connect v1.20.0/go.mod h1:A2ygJrukXwWy32vkCAAHNVguZrqZ+jeZ9rGRnGR4dN4= git.dev.alexdunmow.com/block/core v0.18.2 h1:+3OfZ424yoc1k1CucXYARk8TBkh8Z693HRkhf5Ci2wU= git.dev.alexdunmow.com/block/core v0.18.2/go.mod h1:GGuUu826AoJepC/hKLGJ7BX3PQaDss9ueCT0se6Ao2w= +git.dev.alexdunmow.com/block/pluginsdk v0.1.0 h1:Dgbt8Q5b+1o3HdftQ7yhV2byWI5q3exiN9oXhwz2MjM= +git.dev.alexdunmow.com/block/pluginsdk v0.1.0/go.mod h1:uz6oRurbuHdTcUxg47ymVgBqRARKlpXp1JIziXevzms= github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/chromedp/cdproto v0.0.0-20260321001828-e3e3800016bc h1:wkN/LMi5vc60pBRWx6qpbk/aEvq3/ZVNpnMvsw8PVVU= @@ -33,8 +35,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw= -github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= +github.com/jackc/pgx/v5 v5.10.0 h1:VhSvgU2jSli8o3AqIEOTJr7rZwAEUVo4E4XhR94Zfr0= +github.com/jackc/pgx/v5 v5.10.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= @@ -64,8 +66,8 @@ github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD github.com/tetratelabs/wazero v1.12.0 h1:DuWcpNu/FzgEXgGBDp8J1Spc+CWOvvtvVyjKlaZopYU= github.com/tetratelabs/wazero v1.12.0/go.mod h1:LvKtzl2RqO4gyF27BiXU+nKAjcV8f38U+kP/q2vgxh0= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/internal/bnp/build.go b/internal/bnp/build.go index 0970207..5edaced 100644 --- a/internal/bnp/build.go +++ b/internal/bnp/build.go @@ -11,8 +11,8 @@ import ( "sort" "strconv" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" - core "git.dev.alexdunmow.com/block/core/plugin" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" "google.golang.org/protobuf/proto" ) diff --git a/internal/bnp/codeless.go b/internal/bnp/codeless.go index e715f16..9c1131d 100644 --- a/internal/bnp/codeless.go +++ b/internal/bnp/codeless.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" - core "git.dev.alexdunmow.com/block/core/plugin" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" + core "git.dev.alexdunmow.com/block/pluginsdk/plugin" "google.golang.org/protobuf/proto" "gopkg.in/yaml.v3" ) diff --git a/internal/bnp/codeless_test.go b/internal/bnp/codeless_test.go index 9b1dbe7..9c111a4 100644 --- a/internal/bnp/codeless_test.go +++ b/internal/bnp/codeless_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" ) // writeFixture lays out a minimal codeless plugin repo. diff --git a/internal/bnp/manifest.go b/internal/bnp/manifest.go index 306ca86..fb34d63 100644 --- a/internal/bnp/manifest.go +++ b/internal/bnp/manifest.go @@ -15,7 +15,7 @@ import ( "fmt" "os" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" "github.com/tetratelabs/wazero" "github.com/tetratelabs/wazero/api" "github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1" diff --git a/internal/bnp/mixed_test.go b/internal/bnp/mixed_test.go index b881d14..ceddfc6 100644 --- a/internal/bnp/mixed_test.go +++ b/internal/bnp/mixed_test.go @@ -3,7 +3,7 @@ package bnp import ( "testing" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" ) // TestApplyManifestYAMLSupplementsWithoutWiping proves the WO-WZ-021 mixed-form diff --git a/internal/bnp/verify.go b/internal/bnp/verify.go index 8bfc38f..1e78750 100644 --- a/internal/bnp/verify.go +++ b/internal/bnp/verify.go @@ -12,7 +12,7 @@ import ( "slices" "strings" - abiv1 "git.dev.alexdunmow.com/block/core/abi/v1" + abiv1 "git.dev.alexdunmow.com/block/pluginsdk/abi/v1" "github.com/klauspost/compress/zstd" "google.golang.org/protobuf/proto" )