From b073b2cdb2a1a0004ff4d92a47c46b8edf046e8e Mon Sep 17 00:00:00 2001 From: Shane C Date: Tue, 23 Apr 2024 19:12:54 -0400 Subject: [PATCH] ensure all files are built the first time before running the webserver --- bun.lockb | Bin 90566 -> 103147 bytes cmd/run.go | 60 +++---------------- package.json | 2 + {public => src/assets}/Poppins-Regular.ttf | Bin {public => src/assets}/download.png | Bin src/styles/app.css | 2 +- src/views/components/navbar.html | 2 +- utils/server.go | 66 +++++++++++++++++++++ utils/vite_dev.go | 32 +++++++++- vite.config.ts | 8 ++- 10 files changed, 116 insertions(+), 56 deletions(-) rename {public => src/assets}/Poppins-Regular.ttf (100%) rename {public => src/assets}/download.png (100%) create mode 100644 utils/server.go diff --git a/bun.lockb b/bun.lockb index cc89233ed7089cf2e40986ee34bedc05e2e30ed7..100e759f25ef5c65bc379557e6cf0cb71b59da54 100755 GIT binary patch delta 22337 zcmeHvcT`l#)ArnvQ3gSRC=7@KCJZ1!f`9`UFkk{v1mg%Oqa+CmrokN6fVO(YET%P! zu6fP6=A2d()9S8)HRo0Qp1MKM)i<2;p6{>UJv_I%s=BMIyQ}+#q3>^pRF7Ab&vmPx z?P1R*2#8*MaRM$j(l0HLGUnLqe<(LUq-O$Qdp>ROC2B6hI zD@pw83JQe={8iBEpj$v|fih4>&`e1l0a_EhJE$|LC1?%M7v)8I36#ojmH0eRs%Ipq zy+UEgNli)5h)qvd3_&kY1D3&86VPN`a*94qp@>iKo2gHXQ)tm@E65vwRtB{JwFXs5 z^5+&Je-o7Sr$8zH4oRL5S{3{>i5~)Lqv)>4(MgI9pj6Ob%HRS@2COB%#9TD+7?ko| z0Y%5=90Vmt)=B!g58aU@d*ER(hX*wU4MHcQA9AjMr#OgB z(CLv>c-e{NX#5825*2ar@u{xygA!dNxds#!OQsbzMcWFSu8uODel!BYjgwEjZIkM3gJ6-)GnL{CX{ zBPccSaAR@aH}FRPQ_CDtTo{wg*fd>wyu!>^tT0udro$4ZNE#~GR}@1|`LNt1>-%L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*tvFB{e`FuH zH~8w~-&Cy~9v!;t3^Hi5{OH;jdnS+MhrR_TTL+C8G}P_+jeG8diWZ%jwd@L>{InxJ zpPKv;o7n7riNl#U!I_`a^NHhazlo`hh>B7pMBGp8mbby)q795}3jN-94(1uYT{h?+ z%hmtFlPhiBU)XeE-G4^g)Kp>=4&Gv%!Yq67!hR!lOG26t^B`E?dg1%p-Km=`k$A&6rm-E;iedJt}w0 zZxh%y7gKft{%1vOc0vC5+@ccUF&1^+8N=Ed)%<+N7%`w5^5*8T#$xgqma^r<6z1*y EA2=S45dZ)H diff --git a/cmd/run.go b/cmd/run.go index 578a669..43cf50e 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -4,21 +4,13 @@ Copyright © 2024 Shane C. package cmd import ( - "fmt" "git.shadowhosting.xyz/shadow/utils" - "github.com/goccy/go-json" "github.com/gofiber/fiber/v2" - "github.com/gofiber/fiber/v2/middleware/earlydata" - "github.com/gofiber/fiber/v2/middleware/etag" - "github.com/gofiber/fiber/v2/middleware/healthcheck" - "github.com/gofiber/fiber/v2/middleware/helmet" - "github.com/gofiber/fiber/v2/middleware/idempotency" - "github.com/gofiber/fiber/v2/middleware/limiter" - "github.com/gofiber/template/html/v2" "github.com/spf13/cobra" "github.com/spf13/viper" - "log" - "time" + "golang.org/x/sys/unix" + "os" + "os/signal" ) // runCmd represents the run command @@ -28,50 +20,16 @@ var runCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { if viper.GetBool("dev") && !fiber.IsChild() { - go utils.RunViteServer() + utils.RunViteServer() + sc := make(chan os.Signal, 1) + signal.Notify(sc, unix.SIGINT, unix.SIGTERM, os.Interrupt) + <-sc } - engine := html.New("./dist", ".html") - - if viper.GetBool("dev") { - engine.Reload(true) + if !viper.GetBool("dev") { + utils.Webserver() } - engine.AddFunc("viteAsset", utils.ViteAsset) - - app := fiber.New(fiber.Config{ - AppName: "shadow", - EnableIPValidation: true, - Views: engine, - ViewsLayout: "index", - Prefork: true, - JSONEncoder: json.Marshal, - JSONDecoder: json.Unmarshal, - }) - - app.Use(earlydata.New()) - app.Use(healthcheck.New()) - app.Use(helmet.New()) - app.Use(etag.New()) - app.Use(idempotency.New()) - app.Use(limiter.New(limiter.Config{ - Max: 175, - Expiration: 1 * time.Minute, - KeyGenerator: func(c *fiber.Ctx) string { - return c.Get("x-forwarded-for") - }, - LimiterMiddleware: limiter.SlidingWindow{}, - })) - - app.Static("/assets", "./dist/assets") - app.Static("/", "./public") - - app.Get("/", func(ctx *fiber.Ctx) error { - return ctx.Render("views/index", fiber.Map{}) - }) - - log.Fatal(app.Listen(fmt.Sprintf("%s:%d", viper.GetString("server.host"), viper.GetInt32("server.port")))) - }, } diff --git a/package.json b/package.json index c30fb7e..8d67554 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "typescript": "^5.0.0" }, "dependencies": { + "sharp": "^0.33.3", + "vite-plugin-image-optimizer": "^1.1.7", "vitest": "^1.5.0" } } \ No newline at end of file diff --git a/public/Poppins-Regular.ttf b/src/assets/Poppins-Regular.ttf similarity index 100% rename from public/Poppins-Regular.ttf rename to src/assets/Poppins-Regular.ttf diff --git a/public/download.png b/src/assets/download.png similarity index 100% rename from public/download.png rename to src/assets/download.png diff --git a/src/styles/app.css b/src/styles/app.css index 3ea7ca1..9c97a68 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -5,7 +5,7 @@ @layer base { @font-face { font-family: 'Poppins'; - src: url('/Poppins-Regular.ttf') + src: url('../assets/Poppins-Regular.ttf') } html { font-family: 'Poppins'; diff --git a/src/views/components/navbar.html b/src/views/components/navbar.html index b6229a9..320125b 100644 --- a/src/views/components/navbar.html +++ b/src/views/components/navbar.html @@ -27,7 +27,7 @@ diff --git a/utils/server.go b/utils/server.go new file mode 100644 index 0000000..45bd252 --- /dev/null +++ b/utils/server.go @@ -0,0 +1,66 @@ +package utils + +import ( + "fmt" + "github.com/goccy/go-json" + "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/earlydata" + "github.com/gofiber/fiber/v2/middleware/etag" + "github.com/gofiber/fiber/v2/middleware/healthcheck" + "github.com/gofiber/fiber/v2/middleware/helmet" + "github.com/gofiber/fiber/v2/middleware/idempotency" + "github.com/gofiber/fiber/v2/middleware/limiter" + "github.com/gofiber/template/html/v2" + "github.com/spf13/viper" + "log" + "time" +) + +func Webserver() { + + engine := html.New("./dist", ".html") + + if viper.GetBool("dev") { + engine.Reload(true) + } + + engine.AddFunc("viteAsset", ViteAsset) + + webConfig := fiber.Config{ + AppName: "shadow", + EnableIPValidation: true, + Views: engine, + ViewsLayout: "index", + JSONEncoder: json.Marshal, + JSONDecoder: json.Unmarshal, + } + + if !viper.GetBool("dev") { + webConfig.Prefork = true + } + + app := fiber.New(webConfig) + + app.Use(earlydata.New()) + app.Use(healthcheck.New()) + app.Use(helmet.New()) + app.Use(etag.New()) + app.Use(idempotency.New()) + app.Use(limiter.New(limiter.Config{ + Max: 175, + Expiration: 1 * time.Minute, + KeyGenerator: func(c *fiber.Ctx) string { + return c.Get("x-forwarded-for") + }, + LimiterMiddleware: limiter.SlidingWindow{}, + })) + + app.Static("/assets", "./dist/assets") + + app.Get("/", func(ctx *fiber.Ctx) error { + return ctx.Render("views/index", fiber.Map{}) + }) + + log.Fatal(app.Listen(fmt.Sprintf("%s:%d", viper.GetString("server.host"), viper.GetInt32("server.port")))) + +} diff --git a/utils/vite_dev.go b/utils/vite_dev.go index 16f1aab..4c7d1a9 100644 --- a/utils/vite_dev.go +++ b/utils/vite_dev.go @@ -8,6 +8,7 @@ import ( "log" "os" "os/exec" + "strings" "sync" ) @@ -81,9 +82,31 @@ import ( // //} +var blueRGB = [3]int{71, 202, 255} +var purpleRGB = [3]int{189, 52, 254} + func RunViteServer() { if viper.GetBool("dev") { + firstBuilt := false + + var niceText strings.Builder + str := "Vite Dev" + steps := len(str) - 1 + + // Why do this? Idk. I like having separation between things on the console. + for i := 0; i < len(str); i++ { + char := str[i] + + r := (blueRGB[0]*(steps-i) + purpleRGB[0]*i) / steps + g := (blueRGB[1]*(steps-i) + purpleRGB[1]*i) / steps + b := (blueRGB[2]*(steps-i) + purpleRGB[2]*i) / steps + + if _, err := niceText.WriteString(fmt.Sprintf("\033[1m\033[38;2;%d;%d;%dm%c\033[0m", r, g, b, char)); err != nil { + log.Fatalln(err) + } + } + go func() { cmd := exec.Command("bun", "run", "dev") @@ -123,7 +146,14 @@ func RunViteServer() { output := scanner.Text() - fmt.Println("VITE (Bun) | " + output) + if strings.Contains(output, "built in") && !firstBuilt { + + firstBuilt = true + go Webserver() + + } + + fmt.Println(niceText.String() + " \033[1m\033[38;5;244m|\033[22m " + output + "\033[0m") } diff --git a/vite.config.ts b/vite.config.ts index e09f16b..95d622c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,15 +1,19 @@ import { defineConfig } from 'vitest/config'; import path from "path"; import { glob } from "glob"; +import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'; + export default defineConfig({ - plugins: [], + plugins: [ + ViteImageOptimizer(), + ], root: "src", build: { manifest: true, outDir: path.join(__dirname, "dist"), rollupOptions: { - input: glob.sync([path.resolve(__dirname, "src", "**/*.html"),path.resolve(__dirname, "src", "**/*.js"), path.resolve(__dirname, "src", "**/*.css")]), + input: glob.sync([path.resolve(__dirname, "src/assets", "**/*.*"), path.resolve(__dirname, "src", "**/*.html"),path.resolve(__dirname, "src", "**/*.js"), path.resolve(__dirname, "src", "**/*.css")]), }, emptyOutDir: true, },