diff --git a/Makefile b/Makefile index 05a0f6378..acb6da371 100644 --- a/Makefile +++ b/Makefile @@ -311,9 +311,9 @@ gen-pkl: ### motr, hway & nebula ### ############################################################################### -.PHONY: build-motr build-hway build-nebula +.PHONY: motr-build hway-build nebula-build nebula-copy -hway-build: gen-templ +hway-build: nebula-build nebula-copy gen-templ @echo "(motr) Building Highway gateway" GOOS=js GOARCH=wasm go build -o ./cmd/hway/build/app.wasm ./cmd/hway/server.go @@ -329,6 +329,10 @@ nebula-build: @echo "(nebula) Building nebula" cd pkg/nebula && bun install && bun run build +nebula-copy: + @echo "(nebula) Copying assets to hway" + cp -r pkg/nebula/assets/js pkg/nebula/assets/css cmd/hway/build + ############################################################################### ### help ### diff --git a/cmd/hway/server.go b/cmd/hway/server.go index 4271c43a8..fbba40d65 100644 --- a/cmd/hway/server.go +++ b/cmd/hway/server.go @@ -12,7 +12,6 @@ import ( func main() { s := echo.New() s.Use(ctx.UseSession) - s.GET("/", routes.Home) s.GET("/login", routes.LoginStart) s.GET("/register", routes.RegisterStart) diff --git a/devbox.json b/devbox.json index 2cd6486a0..60d8509e4 100644 --- a/devbox.json +++ b/devbox.json @@ -31,47 +31,18 @@ }, "shell": { "scripts": { - "build:docker": [ - "make local-image" - ], - "build:hway": [ - "make build-nebula", - "make build-hway" - ], - "build:nebula": [ - "make build-nebula" - ], - "build:motr": [ - "make build-motr" - ], - "build:sonrd": [ - "make build-motr", - "make build" - ], - "build": [ - "make build-motr", - "make build", - "make build-hway" - ], - "gen:proto": [ - "rm -rf ./pkg/nebula/node_modules", - "make proto-gen" - ], - "gen:pkl": [ - "make gen-pkl" - ], - "gen:templ": [ - "make gen-templ" - ], - "start": [ - "process-compose up -f ./deploy/process-compose.yaml" - ], - "stop": [ - "process-compose down -f ./deploy/process-compose.yaml" - ], - "start:testnet": [ - "make sh-testnet" - ] + "build:docker": ["make local-image"], + "build:hway": ["make build-nebula", "make build-hway"], + "build:nebula": ["make build-nebula"], + "build:motr": ["make build-motr"], + "build:sonrd": ["make build-motr", "make build"], + "build": ["make build-motr", "make build", "make build-hway"], + "gen:proto": ["rm -rf ./pkg/nebula/node_modules", "make proto-gen"], + "gen:pkl": ["make gen-pkl"], + "gen:templ": ["make gen-templ"], + "start": ["process-compose up -f ./deploy/process-compose.yaml"], + "stop": ["process-compose down -f ./deploy/process-compose.yaml"], + "start:testnet": ["make sh-testnet"] } } } diff --git a/pkg/nebula/assets/scripts.templ b/pkg/nebula/assets/scripts.templ index fe752708d..7ca023dd7 100644 --- a/pkg/nebula/assets/scripts.templ +++ b/pkg/nebula/assets/scripts.templ @@ -12,25 +12,17 @@ var ( ) templ Styles() { - @stylesHandle.Once() { - - } + } templ Alpine() { - @alpineHandle.Once() { - - } + } templ Dexie() { - @dexieHandle.Once() { - - } + } templ Htmx() { - @htmxHandle.Once() { - - } + } diff --git a/pkg/nebula/assets/scripts_templ.go b/pkg/nebula/assets/scripts_templ.go index 711840dcd..07ceda408 100644 --- a/pkg/nebula/assets/scripts_templ.go +++ b/pkg/nebula/assets/scripts_templ.go @@ -40,38 +40,20 @@ func Styles() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -95,43 +77,25 @@ func Alpine() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -155,43 +119,25 @@ func Dexie() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -215,43 +161,25 @@ func Htmx() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var10 := templ.GetChildren(ctx) - if templ_7745c5c3_Var10 == nil { - templ_7745c5c3_Var10 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/global/styles/layout.templ b/pkg/nebula/global/styles/layout.templ index e44575504..81603968f 100644 --- a/pkg/nebula/global/styles/layout.templ +++ b/pkg/nebula/global/styles/layout.templ @@ -33,8 +33,6 @@ templ Layout(title string, remote bool) {
- @cdn.Alpine() - @cdn.Htmx() @cdn.Styles() @@ -49,6 +47,8 @@ templ Layout(title string, remote bool) {