refactor(10.2-01): nest framework packages under modules

- Move remaining beach packages and embedded admin assets\n- Rewrite framework, example, build, and gate paths
This commit is contained in:
Jakub Zych
2026-09-28 02:21:02 +02:00
parent ac1f6d14f4
commit 5e50b166ef
277 changed files with 303 additions and 303 deletions

View File

@@ -0,0 +1,50 @@
package backpack
import (
"go/parser"
"go/token"
"os"
"strconv"
"strings"
"testing"
"git.golem15.com/golem15/summercms/modules/compass"
)
func TestEventBusesAreAppScoped(t *testing.T) {
a := New(&compass.Config{})
b := New(&compass.Config{})
if a.Events == nil || b.Events == nil {
t.Fatal("App must own an event bus")
}
if a.Events == b.Events {
t.Fatal("apps must not share a bus")
}
}
func TestDoesNotImportParty(t *testing.T) {
entries, err := os.ReadDir(".")
if err != nil {
t.Fatal(err)
}
fset := token.NewFileSet()
for _, entry := range entries {
name := entry.Name()
if entry.IsDir() || !strings.HasSuffix(name, ".go") || strings.HasSuffix(name, "_test.go") {
continue
}
file, err := parser.ParseFile(fset, name, nil, parser.ImportsOnly)
if err != nil {
t.Fatal(err)
}
for _, spec := range file.Imports {
path, err := strconv.Unquote(spec.Path.Value)
if err != nil {
t.Fatal(err)
}
if path == "git.golem15.com/golem15/summercms/modules/party" {
t.Fatalf("%s imports party", name)
}
}
}
}