chore: follow CMS module rename in rule strings + test fixtures
CMS Go module renamed from git.dev.alexdunmow.com/block/ninja to git.dev.alexdunmow.com/block/cms (along with the git remote rename on gitea). All import paths, string-literal rules, test fixtures, and doc references updated; (historical 'ninja-orchestrator' refs preserved). go mod tidy regenerated checksums. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
cd88c808b0
commit
57bca429cc
@ -90,7 +90,7 @@ func TestCheckSafetyFailsStandalonePluginImportsFromBlockNinjaCMS(t *testing.T)
|
|||||||
writeTestFile(t, filepath.Join(pluginRoot, "plugin.mod"), "[plugin]\nname = \"example\"\nversion = \"1.0.0\"\n", 0644)
|
writeTestFile(t, filepath.Join(pluginRoot, "plugin.mod"), "[plugin]\nname = \"example\"\nversion = \"1.0.0\"\n", 0644)
|
||||||
writeTestFile(t, filepath.Join(pluginRoot, "main.go"), `package example
|
writeTestFile(t, filepath.Join(pluginRoot, "main.go"), `package example
|
||||||
|
|
||||||
import "git.dev.alexdunmow.com/block/ninja/internal/helpers"
|
import "git.dev.alexdunmow.com/block/cms/internal/helpers"
|
||||||
|
|
||||||
func Example() string {
|
func Example() string {
|
||||||
return helpers.Slugify("danger")
|
return helpers.Slugify("danger")
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
blockCoreImportPrefix = "git.dev.alexdunmow.com/block/core"
|
blockCoreImportPrefix = "git.dev.alexdunmow.com/block/core"
|
||||||
blockNinjaImportPrefix = "git.dev.alexdunmow.com/block/ninja"
|
blockNinjaImportPrefix = "git.dev.alexdunmow.com/block/cms"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pluginImportViolation struct {
|
type pluginImportViolation struct {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ func TestCheckStandalonePluginImportsFlagsBlockNinjaCMSImports(t *testing.T) {
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"git.dev.alexdunmow.com/block/core/plugin"
|
"git.dev.alexdunmow.com/block/core/plugin"
|
||||||
"git.dev.alexdunmow.com/block/ninja/internal/helpers"
|
"git.dev.alexdunmow.com/block/cms/internal/helpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Example() {
|
func Example() {
|
||||||
@ -25,7 +25,7 @@ func Example() {
|
|||||||
if len(violations) != 1 {
|
if len(violations) != 1 {
|
||||||
t.Fatalf("checkStandalonePluginImports() returned %d violations, want 1: %#v", len(violations), violations)
|
t.Fatalf("checkStandalonePluginImports() returned %d violations, want 1: %#v", len(violations), violations)
|
||||||
}
|
}
|
||||||
if violations[0].importPath != "git.dev.alexdunmow.com/block/ninja/internal/helpers" {
|
if violations[0].importPath != "git.dev.alexdunmow.com/block/cms/internal/helpers" {
|
||||||
t.Fatalf("importPath = %q, want forbidden BlockNinja import", violations[0].importPath)
|
t.Fatalf("importPath = %q, want forbidden BlockNinja import", violations[0].importPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ func TestCheckStandalonePluginImportsFlagsBlockNinjaCMSImportsInTemplFiles(t *te
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"git.dev.alexdunmow.com/block/core/templates/bn"
|
"git.dev.alexdunmow.com/block/core/templates/bn"
|
||||||
"git.dev.alexdunmow.com/block/ninja/internal/templates"
|
"git.dev.alexdunmow.com/block/cms/internal/templates"
|
||||||
)
|
)
|
||||||
|
|
||||||
templ Page() {
|
templ Page() {
|
||||||
@ -67,7 +67,7 @@ templ Page() {
|
|||||||
if len(violations) != 1 {
|
if len(violations) != 1 {
|
||||||
t.Fatalf("checkStandalonePluginImports() returned %d violations, want 1: %#v", len(violations), violations)
|
t.Fatalf("checkStandalonePluginImports() returned %d violations, want 1: %#v", len(violations), violations)
|
||||||
}
|
}
|
||||||
if violations[0].importPath != "git.dev.alexdunmow.com/block/ninja/internal/templates" {
|
if violations[0].importPath != "git.dev.alexdunmow.com/block/cms/internal/templates" {
|
||||||
t.Fatalf("importPath = %q, want forbidden BlockNinja templ import", violations[0].importPath)
|
t.Fatalf("importPath = %q, want forbidden BlockNinja templ import", violations[0].importPath)
|
||||||
}
|
}
|
||||||
if violations[0].line != 5 {
|
if violations[0].line != 5 {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
func TestCheckCMSCoreSDKGoModFlagsLocalBlockCoreReplace(t *testing.T) {
|
func TestCheckCMSCoreSDKGoModFlagsLocalBlockCoreReplace(t *testing.T) {
|
||||||
root := t.TempDir()
|
root := t.TempDir()
|
||||||
writeTestFile(t, filepath.Join(root, "go.mod"), `module git.dev.alexdunmow.com/block/ninja
|
writeTestFile(t, filepath.Join(root, "go.mod"), `module git.dev.alexdunmow.com/block/cms
|
||||||
|
|
||||||
go 1.26.2
|
go 1.26.2
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ replace git.dev.alexdunmow.com/block/core => ../core
|
|||||||
|
|
||||||
func TestCheckCMSCoreSDKGoModAllowsPublishedBlockCoreRequire(t *testing.T) {
|
func TestCheckCMSCoreSDKGoModAllowsPublishedBlockCoreRequire(t *testing.T) {
|
||||||
root := t.TempDir()
|
root := t.TempDir()
|
||||||
writeTestFile(t, filepath.Join(root, "go.mod"), `module git.dev.alexdunmow.com/block/ninja
|
writeTestFile(t, filepath.Join(root, "go.mod"), `module git.dev.alexdunmow.com/block/cms
|
||||||
|
|
||||||
go 1.26.2
|
go 1.26.2
|
||||||
|
|
||||||
|
|||||||
@ -359,7 +359,7 @@ func resolveBlockNinjaRepoRootFromModule(root string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, replace := range file.Replace {
|
for _, replace := range file.Replace {
|
||||||
if replace.Old.Path != "git.dev.alexdunmow.com/block/ninja" {
|
if replace.Old.Path != "git.dev.alexdunmow.com/block/cms" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if replace.New.Version != "" {
|
if replace.New.Version != "" {
|
||||||
|
|||||||
@ -88,7 +88,7 @@ func TestCheckReinventedBackend_TypeAssertionWithHelpersImport_Flagged(t *testin
|
|||||||
dir := t.TempDir()
|
dir := t.TempDir()
|
||||||
writeFile(t, dir, "service.go", `package service
|
writeFile(t, dir, "service.go", `package service
|
||||||
|
|
||||||
import "git.dev.alexdunmow.com/block/ninja/internal/helpers"
|
import "git.dev.alexdunmow.com/block/cms/internal/helpers"
|
||||||
|
|
||||||
func render(m map[string]interface{}) string {
|
func render(m map[string]interface{}) string {
|
||||||
_ = helpers.GetStringOr(m, "key", "")
|
_ = helpers.GetStringOr(m, "key", "")
|
||||||
@ -130,7 +130,7 @@ func TestCheckReinventedBackend_HelpersDirSelf_NotFlagged(t *testing.T) {
|
|||||||
helpersDir := filepath.Join(dir, "internal", "helpers")
|
helpersDir := filepath.Join(dir, "internal", "helpers")
|
||||||
writeTestFile(t, filepath.Join(helpersDir, "map.go"), `package helpers
|
writeTestFile(t, filepath.Join(helpersDir, "map.go"), `package helpers
|
||||||
|
|
||||||
import "git.dev.alexdunmow.com/block/ninja/internal/helpers"
|
import "git.dev.alexdunmow.com/block/cms/internal/helpers"
|
||||||
|
|
||||||
func GetStringOr(m map[string]interface{}, key, def string) string {
|
func GetStringOr(m map[string]interface{}, key, def string) string {
|
||||||
if v, ok := m[key]; ok {
|
if v, ok := m[key]; ok {
|
||||||
@ -182,7 +182,7 @@ func TestCheckReinventedBackend_BoolTypeAssertion_Flagged(t *testing.T) {
|
|||||||
dir := t.TempDir()
|
dir := t.TempDir()
|
||||||
writeFile(t, dir, "service.go", `package service
|
writeFile(t, dir, "service.go", `package service
|
||||||
|
|
||||||
import "git.dev.alexdunmow.com/block/ninja/internal/helpers"
|
import "git.dev.alexdunmow.com/block/cms/internal/helpers"
|
||||||
|
|
||||||
func check(m map[string]interface{}) bool {
|
func check(m map[string]interface{}) bool {
|
||||||
_ = helpers.GetBoolOr(m, "enabled", false)
|
_ = helpers.GetBoolOr(m, "enabled", false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user