diff --git a/Makefile b/Makefile index 2121e69dd..bc4e72640 100644 --- a/Makefile +++ b/Makefile @@ -316,8 +316,6 @@ gen-pkl: nebula-build: @echo "(nebula) Building nebula" cd pkg/nebula && bun install && bun run build - @echo "(nebula) Copying assets to hway" - cp -r pkg/nebula/assets/js pkg/nebula/assets/css cmd/hway/build motr-build: gen-templ gen-pkl @echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault" diff --git a/pkg/nebula/global/styles/layout.templ b/pkg/nebula/global/styles/layout.templ index 4804d8589..a60c2d2e7 100644 --- a/pkg/nebula/global/styles/layout.templ +++ b/pkg/nebula/global/styles/layout.templ @@ -1,9 +1,6 @@ package styles -import ( - cdn "github.com/onsonr/sonr/pkg/nebula/assets" - "strings" -) +import "strings" type Icon interface { Render() templ.Component @@ -33,9 +30,9 @@ templ Layout(title string, remote bool) {
- @cdn.Styles() - @cdn.Htmx() - @cdn.Alpine() + @Styles() + @Htmx() + @Alpine() @@ -57,9 +54,9 @@ templ LayoutNoBody(title string, remote bool) { - @cdn.Styles() - @cdn.Htmx() - @cdn.Alpine() + @Styles() + @Htmx() + @Alpine() diff --git a/pkg/nebula/global/styles/layout_templ.go b/pkg/nebula/global/styles/layout_templ.go index 881fa9130..ca5b3c3fc 100644 --- a/pkg/nebula/global/styles/layout_templ.go +++ b/pkg/nebula/global/styles/layout_templ.go @@ -8,10 +8,7 @@ package styles import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import ( - cdn "github.com/onsonr/sonr/pkg/nebula/assets" - "strings" -) +import "strings" type Icon interface { Render() templ.Component @@ -149,15 +146,15 @@ func Layout(title string, remote bool) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = cdn.Styles().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = cdn.Htmx().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = cdn.Alpine().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -168,7 +165,7 @@ func Layout(title string, remote bool) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 42, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 39, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -215,15 +212,15 @@ func LayoutNoBody(title string, remote bool) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = cdn.Styles().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = cdn.Htmx().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = cdn.Alpine().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -234,7 +231,7 @@ func LayoutNoBody(title string, remote bool) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 66, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 63, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -284,7 +281,7 @@ func OpenModal(title, description string) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 114, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 111, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -297,7 +294,7 @@ func OpenModal(title, description string) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(description) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 120, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/layout.templ`, Line: 117, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/assets/scripts.templ b/pkg/nebula/global/styles/scripts.templ similarity index 97% rename from pkg/nebula/assets/scripts.templ rename to pkg/nebula/global/styles/scripts.templ index ba20c1c9b..9cc29c2c1 100644 --- a/pkg/nebula/assets/scripts.templ +++ b/pkg/nebula/global/styles/scripts.templ @@ -1,4 +1,4 @@ -package cdn +package styles const ( PublicOrigin = "https://cdn.sonr.id" diff --git a/pkg/nebula/assets/scripts_templ.go b/pkg/nebula/global/styles/scripts_templ.go similarity index 96% rename from pkg/nebula/assets/scripts_templ.go rename to pkg/nebula/global/styles/scripts_templ.go index e814c58f4..49acdd3b3 100644 --- a/pkg/nebula/assets/scripts_templ.go +++ b/pkg/nebula/global/styles/scripts_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package cdn +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -47,7 +47,7 @@ func Styles() templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/css/styles.css") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/assets/scripts.templ`, Line: 15, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/scripts.templ`, Line: 15, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -89,7 +89,7 @@ func Alpine() templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/alpine.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/assets/scripts.templ`, Line: 19, Col: 53} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/scripts.templ`, Line: 19, Col: 53} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -131,7 +131,7 @@ func Dexie() templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/dexie.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/assets/scripts.templ`, Line: 23, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/scripts.templ`, Line: 23, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -173,7 +173,7 @@ func Htmx() templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("https://cdn.sonr.id/js/htmx.min.js") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/assets/scripts.templ`, Line: 27, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/global/styles/scripts.templ`, Line: 27, Col: 51} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil {