From 6efd64f24e296c6397999b71c889eff74c1f99da Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 13 Sep 2024 19:05:55 -0500 Subject: [PATCH] rename everything --- framework-ui/go.mod | 4 ++-- framework-ui/ui/button.go | 2 +- framework-ui/ui/input.go | 2 +- framework/assets/js/package-lock.json | 4 ++-- framework/assets/js/package.json | 4 ++-- framework/assets/js/tsup.config.ts | 2 +- framework/go.mod | 2 +- framework/pages/generated.go | 2 +- framework/tooling/astgen/entry.go | 4 ++-- framework/tooling/astgen/go.mod | 2 +- framework/tooling/copyassets/bundle.go | 2 +- framework/tooling/copyassets/go.mod | 2 +- framework/tooling/downloadtemplate/go.mod | 2 +- framework/tooling/downloadtemplate/main.go | 2 +- framework/tooling/htmltogo/entry.go | 2 +- framework/tooling/mhtml/Taskfile.yml | 6 +++--- framework/tooling/mhtml/go.mod | 2 +- justfile | 8 ++++---- setup.md | 2 +- starter-template/go.mod | 4 ++-- starter-template/main.go | 6 +++--- starter-template/news/posts.go | 2 +- starter-template/news/views.go | 2 +- starter-template/pages/base/root.go | 4 ++-- starter-template/pages/generated.go | 2 +- starter-template/pages/index.go | 8 ++++---- starter-template/pages/news.$id.go | 2 +- starter-template/pages/news.index.go | 2 +- starter-template/pages/patients.index.go | 2 +- starter-template/partials/button.go | 4 ++-- starter-template/partials/load/generated.go | 2 +- starter-template/partials/nav.go | 2 +- starter-template/partials/news.go | 4 ++-- starter-template/partials/patient/create.go | 2 +- starter-template/partials/patient/patient.go | 4 ++-- starter-template/partials/sheet/sheet.go | 2 +- 36 files changed, 55 insertions(+), 55 deletions(-) diff --git a/framework-ui/go.mod b/framework-ui/go.mod index de9f812..4b43013 100644 --- a/framework-ui/go.mod +++ b/framework-ui/go.mod @@ -1,8 +1,8 @@ -module github.com/maddalax/mhtml/framework-ui +module github.com/maddalax/htmgo/framework-ui go 1.23.0 -require github.com/maddalax/mhtml/framework v0.0.0-20240913172653-23dd1db77843 +require github.com/maddalax/htmgo/framework v0.0.0-20240913172653-23dd1db77843 require ( github.com/andybalholm/brotli v1.0.5 // indirect diff --git a/framework-ui/ui/button.go b/framework-ui/ui/button.go index ddb360c..e76f21f 100644 --- a/framework-ui/ui/button.go +++ b/framework-ui/ui/button.go @@ -1,6 +1,6 @@ package ui -import "github.com/maddalax/mhtml/framework/h" +import "github.com/maddalax/htmgo/framework/h" type ButtonProps struct { Id string diff --git a/framework-ui/ui/input.go b/framework-ui/ui/input.go index af38051..bd4ae9c 100644 --- a/framework-ui/ui/input.go +++ b/framework-ui/ui/input.go @@ -1,6 +1,6 @@ package ui -import "github.com/maddalax/mhtml/framework/h" +import "github.com/maddalax/htmgo/framework/h" type InputProps struct { Id string diff --git a/framework/assets/js/package-lock.json b/framework/assets/js/package-lock.json index 80d97ab..5de662b 100644 --- a/framework/assets/js/package-lock.json +++ b/framework/assets/js/package-lock.json @@ -1,11 +1,11 @@ { - "name": "mhtml-js", + "name": "htmgo-js", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "mhtml-js", + "name": "htmgo-js", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/framework/assets/js/package.json b/framework/assets/js/package.json index 0f245b6..7e969c4 100644 --- a/framework/assets/js/package.json +++ b/framework/assets/js/package.json @@ -1,7 +1,7 @@ { - "name": "mhtml-js", + "name": "htmgo-js", "version": "1.0.0", - "main": "mhtml.js", + "main": "htmgo.js", "scripts": { "watch": "tsup --watch --config ./tsup.config.ts --sourcemap inline", "build": "tsup --minify --config ./tsup.config.ts", diff --git a/framework/assets/js/tsup.config.ts b/framework/assets/js/tsup.config.ts index 9e61005..fde86fa 100644 --- a/framework/assets/js/tsup.config.ts +++ b/framework/assets/js/tsup.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ format: ["esm"], - entry: ["mhtml.ts"], + entry: ["htmgo.ts"], outDir: "./../dist", dts: false, shims: true, diff --git a/framework/go.mod b/framework/go.mod index c655ad0..d5c9c51 100644 --- a/framework/go.mod +++ b/framework/go.mod @@ -1,4 +1,4 @@ -module github.com/maddalax/mhtml/framework +module github.com/maddalax/htmgo/framework go 1.23.0 diff --git a/framework/pages/generated.go b/framework/pages/generated.go index 593ce43..ad8c21e 100644 --- a/framework/pages/generated.go +++ b/framework/pages/generated.go @@ -2,7 +2,7 @@ package pages import "github.com/gofiber/fiber/v2" -import "github.com/maddalax/mhtml/framework/h" +import "github.com/maddalax/htmgo/framework/h" func RegisterPages(f *fiber.App) { } diff --git a/framework/tooling/astgen/entry.go b/framework/tooling/astgen/entry.go index 5924572..3a5eacb 100644 --- a/framework/tooling/astgen/entry.go +++ b/framework/tooling/astgen/entry.go @@ -246,7 +246,7 @@ func writePartialsFile() { builder := NewCodeBuilder(nil) builder.AppendLine(`// Package partials THIS FILE IS GENERATED. DO NOT EDIT.`) builder.AppendLine("package load") - builder.AddImport("github.com/maddalax/mhtml/framework/h") + builder.AddImport("github.com/maddalax/htmgo/framework/h") builder.AddImport("github.com/gofiber/fiber/v2") moduleName := GetModuleName() @@ -288,7 +288,7 @@ func writePagesFile() { builder.AppendLine(`// Package pages THIS FILE IS GENERATED. DO NOT EDIT.`) builder.AppendLine("package pages") builder.AddImport("github.com/gofiber/fiber/v2") - builder.AddImport("github.com/maddalax/mhtml/framework/h") + builder.AddImport("github.com/maddalax/htmgo/framework/h") pages, _ := findPublicFuncsReturningHPage("pages") diff --git a/framework/tooling/astgen/go.mod b/framework/tooling/astgen/go.mod index b126c04..00800eb 100644 --- a/framework/tooling/astgen/go.mod +++ b/framework/tooling/astgen/go.mod @@ -1,3 +1,3 @@ -module github.com/maddalax/mhtml/framework/tooling/astgen +module github.com/maddalax/htmgo/framework/tooling/astgen go 1.23.0 \ No newline at end of file diff --git a/framework/tooling/copyassets/bundle.go b/framework/tooling/copyassets/bundle.go index 6f158e1..52e47ea 100644 --- a/framework/tooling/copyassets/bundle.go +++ b/framework/tooling/copyassets/bundle.go @@ -84,7 +84,7 @@ func copyDir(srcDir, dstDir string) error { } func main() { - modulePath := "github.com/maddalax/mhtml/framework" + modulePath := "github.com/maddalax/htmgo/framework" version, err := getModuleVersion(modulePath) if err != nil { log.Fatalf("Error: %v", err) diff --git a/framework/tooling/copyassets/go.mod b/framework/tooling/copyassets/go.mod index 7025e25..7d87fd8 100644 --- a/framework/tooling/copyassets/go.mod +++ b/framework/tooling/copyassets/go.mod @@ -1,3 +1,3 @@ -module github.com/maddalax/mhtml/framework/tooling/copyassets +module github.com/maddalax/htmgo/framework/tooling/copyassets go 1.23.0 \ No newline at end of file diff --git a/framework/tooling/downloadtemplate/go.mod b/framework/tooling/downloadtemplate/go.mod index 3f0d513..3d626c1 100644 --- a/framework/tooling/downloadtemplate/go.mod +++ b/framework/tooling/downloadtemplate/go.mod @@ -1,3 +1,3 @@ -module github.com/maddalax/mhtml/framework/tooling/downloadtemplate +module github.com/maddalax/htmgo/framework/tooling/downloadtemplate go 1.23.0 \ No newline at end of file diff --git a/framework/tooling/downloadtemplate/main.go b/framework/tooling/downloadtemplate/main.go index 19b54ba..556779f 100644 --- a/framework/tooling/downloadtemplate/main.go +++ b/framework/tooling/downloadtemplate/main.go @@ -57,7 +57,7 @@ func main() { excludeDir := "starter-template" - install := exec.Command("git", "clone", "https://github.com/maddalax/mhtml", "--depth=1", *outPath) + install := exec.Command("git", "clone", "https://github.com/maddalax/htmgo", "--depth=1", *outPath) install.Stdout = os.Stdout install.Stderr = os.Stderr err := install.Run() diff --git a/framework/tooling/htmltogo/entry.go b/framework/tooling/htmltogo/entry.go index 8285055..9406939 100644 --- a/framework/tooling/htmltogo/entry.go +++ b/framework/tooling/htmltogo/entry.go @@ -13,7 +13,7 @@ import ( func main() { // Example HTML input htmlData := ` -

Manage Patients

Name: Sydne

Reason for visit: arm hurts

+

Manage Patients

Name: Sydne

Reason for visit: arm hurts

` // Parse the HTML diff --git a/framework/tooling/mhtml/Taskfile.yml b/framework/tooling/mhtml/Taskfile.yml index e843bb4..abf5fef 100644 --- a/framework/tooling/mhtml/Taskfile.yml +++ b/framework/tooling/mhtml/Taskfile.yml @@ -8,7 +8,7 @@ tasks: dir: '{{.USER_WORKING_DIR}}' desc: Generate template from source code cmds: - - go run github.com/maddalax/mhtml/framework/tooling/downloadtemplate@latest -out my-app + - go run github.com/maddalax/htmgo/framework/tooling/downloadtemplate@latest -out my-app - echo "Template generated successfully to ./my-app" setup: @@ -42,7 +42,7 @@ tasks: dir: '{{.USER_WORKING_DIR}}' desc: Copy framework assets cmds: - - go run github.com/maddalax/mhtml/framework/tooling/copyassets@latest + - go run github.com/maddalax/htmgo/framework/tooling/copyassets@latest ast: dir: '{{.USER_WORKING_DIR}}' @@ -50,7 +50,7 @@ tasks: generates: - '**/generated.go' cmds: - - go run github.com/maddalax/mhtml/framework/tooling/astgen@latest + - go run github.com/maddalax/htmgo/framework/tooling/astgen@latest ast-watch: dir: '{{.USER_WORKING_DIR}}' diff --git a/framework/tooling/mhtml/go.mod b/framework/tooling/mhtml/go.mod index 020d87c..f376e8a 100644 --- a/framework/tooling/mhtml/go.mod +++ b/framework/tooling/mhtml/go.mod @@ -1,3 +1,3 @@ -module github.com/maddalax/mhtml/framework/tooling/mhtml +module github.com/maddalax/htmgo/framework/tooling/htmgo go 1.23.0 \ No newline at end of file diff --git a/justfile b/justfile index 7bfeddf..cc359b4 100644 --- a/justfile +++ b/justfile @@ -6,19 +6,19 @@ bundle: rm -rf assets/dist mkdir -p dist/assets/dist just run-gen - GOOS=linux GOARCH=amd64 go build -o dist/mhtml . + GOOS=linux GOARCH=amd64 go build -o dist/htmgo . cd assets/js && npm run build just build-css cp -r assets/dist/* dist/assets/dist - tar -czvf mhtml-release.tar.gz ./dist + tar -czvf htmgo-release.tar.gz ./dist rm -rf dist mkdir -p dist - mv mhtml-release.tar.gz dist + mv htmgo-release.tar.gz dist release-version := '1.0.0' release: just bundle - gh release create {{release-version}} dist/mhtml-release.tar.gz --title "Release {{release-version}}" --prerelease --notes "new release" + gh release create {{release-version}} dist/htmgo-release.tar.gz --title "Release {{release-version}}" --prerelease --notes "new release" run-gen: go run ./tooling/astgen diff --git a/setup.md b/setup.md index ec71371..37eb738 100644 --- a/setup.md +++ b/setup.md @@ -1 +1 @@ -go run github.com/maddalax/mhtml/framework/tooling/mhtml@latest -task template \ No newline at end of file +go run github.com/maddalax/htmgo/framework/tooling/htmgo@latest -task template \ No newline at end of file diff --git a/starter-template/go.mod b/starter-template/go.mod index e2e6ccf..3eed0b6 100644 --- a/starter-template/go.mod +++ b/starter-template/go.mod @@ -5,8 +5,8 @@ go 1.23.0 require ( github.com/gofiber/fiber/v2 v2.52.5 github.com/google/uuid v1.6.0 - github.com/maddalax/mhtml/framework v0.0.0-20240913185752-4130d7fab5eb - github.com/maddalax/mhtml/framework-ui v0.0.0-20240913172832-ad335247426d + github.com/maddalax/htmgo/framework v0.0.0-20240913185752-4130d7fab5eb + github.com/maddalax/htmgo/framework-ui v0.0.0-20240913172832-ad335247426d github.com/redis/go-redis/v9 v9.6.1 ) diff --git a/starter-template/main.go b/starter-template/main.go index 143383a..b0e8038 100644 --- a/starter-template/main.go +++ b/starter-template/main.go @@ -3,7 +3,7 @@ package main import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "log" "starter-template/pages" "starter-template/partials/load" @@ -16,12 +16,12 @@ func main() { f.Static("/public", "./assets/dist") f.Use(func(ctx *fiber.Ctx) error { - if ctx.Cookies("mhtml-session") != "" { + if ctx.Cookies("htmgo-session") != "" { return ctx.Next() } id := ctx.IP() + uuid.NewString() ctx.Cookie(&fiber.Cookie{ - Name: "mhtml-session", + Name: "htmgo-session", Value: id, SessionOnly: true, }) diff --git a/starter-template/news/posts.go b/starter-template/news/posts.go index 73a1988..977406f 100644 --- a/starter-template/news/posts.go +++ b/starter-template/news/posts.go @@ -2,7 +2,7 @@ package news import ( "fmt" - "github.com/maddalax/mhtml/framework/util/httpjson" + "github.com/maddalax/htmgo/framework/util/httpjson" "sync" ) diff --git a/starter-template/news/views.go b/starter-template/news/views.go index f948b56..67c99e8 100644 --- a/starter-template/news/views.go +++ b/starter-template/news/views.go @@ -2,7 +2,7 @@ package news import ( "fmt" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "starter-template/database" "time" ) diff --git a/starter-template/pages/base/root.go b/starter-template/pages/base/root.go index 031efeb..8000eb9 100644 --- a/starter-template/pages/base/root.go +++ b/starter-template/pages/base/root.go @@ -1,7 +1,7 @@ package base import ( - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "starter-template/partials" "starter-template/partials/sheet" ) @@ -11,7 +11,7 @@ func RootPage(children ...h.Renderable) h.Renderable { h.HxExtension("path-deps, response-targets, mutation-error"), h.Head( h.Link("/public/main.css", "stylesheet"), - h.Script("/public/mhtml.js"), + h.Script("/public/htmgo.js"), ), h.Body( partials.NavBar(), diff --git a/starter-template/pages/generated.go b/starter-template/pages/generated.go index 54def40..5fa743a 100644 --- a/starter-template/pages/generated.go +++ b/starter-template/pages/generated.go @@ -2,7 +2,7 @@ package pages import "github.com/gofiber/fiber/v2" -import "github.com/maddalax/mhtml/framework/h" +import "github.com/maddalax/htmgo/framework/h" func RegisterPages(f *fiber.App) { f.Get("/", func(ctx *fiber.Ctx) error { diff --git a/starter-template/pages/index.go b/starter-template/pages/index.go index b6e7ccc..56d01e1 100644 --- a/starter-template/pages/index.go +++ b/starter-template/pages/index.go @@ -3,7 +3,7 @@ package pages import ( "fmt" "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "os" "time" ) @@ -13,7 +13,7 @@ func IndexPage(c *fiber.Ctx) *h.Page { h.Class("bg-background flex flex-col items-center"), h.Head( h.Link("/public/main.css", "stylesheet"), - h.Script("/public/mhtml.js"), + h.Script("/public/htmgo.js"), h.Script("/public/scripts/shiki.js"), ), h.Body( @@ -23,7 +23,7 @@ func IndexPage(c *fiber.Ctx) *h.Page { h.Class("flex justify-between items-center w-full p-6"), h.Div( h.Class("text-white text-xl font-bold"), - h.Text("MHTML"), + h.Text("htmgo"), ), h.Div( h.Class("flex gap-4"), @@ -59,7 +59,7 @@ func IndexPage(c *fiber.Ctx) *h.Page { // Footer Section h.Div( h.Class("flex justify-center items-center py-6"), - h.Text(fmt.Sprintf("© %d MHTML", time.Now().Year())), + h.Text(fmt.Sprintf("© %d htmgo", time.Now().Year())), ), ), )) diff --git a/starter-template/pages/news.$id.go b/starter-template/pages/news.$id.go index e9691dc..c63bebb 100644 --- a/starter-template/pages/news.$id.go +++ b/starter-template/pages/news.$id.go @@ -3,7 +3,7 @@ package pages import ( "fmt" "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" ) func Test(ctx *fiber.Ctx) *h.Page { diff --git a/starter-template/pages/news.index.go b/starter-template/pages/news.index.go index 7b83dbc..dd30ad5 100644 --- a/starter-template/pages/news.index.go +++ b/starter-template/pages/news.index.go @@ -2,7 +2,7 @@ package pages import ( "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "starter-template/pages/base" "starter-template/partials" ) diff --git a/starter-template/pages/patients.index.go b/starter-template/pages/patients.index.go index 6fca96a..52b404c 100644 --- a/starter-template/pages/patients.index.go +++ b/starter-template/pages/patients.index.go @@ -2,7 +2,7 @@ package pages import ( "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "starter-template/pages/base" "starter-template/partials/patient" ) diff --git a/starter-template/partials/button.go b/starter-template/partials/button.go index 1e53252..badd66b 100644 --- a/starter-template/partials/button.go +++ b/starter-template/partials/button.go @@ -1,8 +1,8 @@ package partials import ( - "github.com/maddalax/mhtml/framework-ui/ui" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework-ui/ui" + "github.com/maddalax/htmgo/framework/h" ) func OpenSheetButton(open bool, children ...h.Renderable) h.Renderable { diff --git a/starter-template/partials/load/generated.go b/starter-template/partials/load/generated.go index 90eccd8..eb982c4 100644 --- a/starter-template/partials/load/generated.go +++ b/starter-template/partials/load/generated.go @@ -1,7 +1,7 @@ // Package partials THIS FILE IS GENERATED. DO NOT EDIT. package load -import "github.com/maddalax/mhtml/framework/h" +import "github.com/maddalax/htmgo/framework/h" import "github.com/gofiber/fiber/v2" import "starter-template/partials" import "starter-template/partials/patient" diff --git a/starter-template/partials/nav.go b/starter-template/partials/nav.go index 6dffde6..cab76c1 100644 --- a/starter-template/partials/nav.go +++ b/starter-template/partials/nav.go @@ -1,6 +1,6 @@ package partials -import "github.com/maddalax/mhtml/framework/h" +import "github.com/maddalax/htmgo/framework/h" type Link struct { Name string diff --git a/starter-template/partials/news.go b/starter-template/partials/news.go index 6f545c0..de2e767 100644 --- a/starter-template/partials/news.go +++ b/starter-template/partials/news.go @@ -3,8 +3,8 @@ package partials import ( "fmt" "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework-ui/ui" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework-ui/ui" + "github.com/maddalax/htmgo/framework/h" "starter-template/news" ) diff --git a/starter-template/partials/patient/create.go b/starter-template/partials/patient/create.go index f69b1f8..18f206b 100644 --- a/starter-template/partials/patient/create.go +++ b/starter-template/partials/patient/create.go @@ -2,7 +2,7 @@ package patient import ( "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" "starter-template/features/patient" "starter-template/partials/sheet" ) diff --git a/starter-template/partials/patient/patient.go b/starter-template/partials/patient/patient.go index 6be13c7..dde50fb 100644 --- a/starter-template/partials/patient/patient.go +++ b/starter-template/partials/patient/patient.go @@ -2,8 +2,8 @@ package patient import ( "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework-ui/ui" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework-ui/ui" + "github.com/maddalax/htmgo/framework/h" "starter-template/features/patient" "starter-template/partials/sheet" "strings" diff --git a/starter-template/partials/sheet/sheet.go b/starter-template/partials/sheet/sheet.go index 1a27b3e..3ccc85b 100644 --- a/starter-template/partials/sheet/sheet.go +++ b/starter-template/partials/sheet/sheet.go @@ -3,7 +3,7 @@ package sheet import ( "fmt" "github.com/gofiber/fiber/v2" - "github.com/maddalax/mhtml/framework/h" + "github.com/maddalax/htmgo/framework/h" ) type Props struct {