rename everything

This commit is contained in:
maddalax 2024-09-13 19:05:55 -05:00
parent 09daf70ffb
commit 6efd64f24e
36 changed files with 55 additions and 55 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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": {

View file

@ -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",

View file

@ -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,

View file

@ -1,4 +1,4 @@
module github.com/maddalax/mhtml/framework
module github.com/maddalax/htmgo/framework
go 1.23.0

View file

@ -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) {
}

View file

@ -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")

View file

@ -1,3 +1,3 @@
module github.com/maddalax/mhtml/framework/tooling/astgen
module github.com/maddalax/htmgo/framework/tooling/astgen
go 1.23.0

View file

@ -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)

View file

@ -1,3 +1,3 @@
module github.com/maddalax/mhtml/framework/tooling/copyassets
module github.com/maddalax/htmgo/framework/tooling/copyassets
go 1.23.0

View file

@ -1,3 +1,3 @@
module github.com/maddalax/mhtml/framework/tooling/downloadtemplate
module github.com/maddalax/htmgo/framework/tooling/downloadtemplate
go 1.23.0

View file

@ -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()

View file

@ -13,7 +13,7 @@ import (
func main() {
// Example HTML input
htmlData := `
<body><nav class="flex gap-4 items-center p-4 text-slate-600 "><a href="/" class="cursor-pointer hover:text-blue-400 ">Home</a><a class="cursor-pointer hover:text-blue-400 " href="/news">News</a><a href="/patients" class="cursor-pointer hover:text-blue-400 ">Patients</a></nav><div id="active-modal"></div><div class="flex flex-col gap-2 bg-white h-full "><div class="flex flex-col p-4 w-full "><div><div class="flex justify-between items-center "><p class="text-lg font-bold ">Manage Patients</p><button hx-target="#active-modal" type="button" id="add-patient" class="flex gap-1 items-center border p-4 rounded cursor-hover bg-blue-700 text-white rounded p-2 h-12 " hx-get="mhtml/partials/patient.AddPatientSheet">Add Patient</button></div><div hx-get="mhtml/partials/patient.List" hx-trigger="load, patient-added from:body" class=""><div class="mt-8" id="patient-list"><div class="flex flex-col gap-2 rounded p-4 bg-red-100 "><p>Name: Sydne</p><p>Reason for visit: arm hurts</p></div></div></div></div></div></div><div hx-get="/livereload" hx-trigger="every 200ms" class=""></div></body>
<body><nav class="flex gap-4 items-center p-4 text-slate-600 "><a href="/" class="cursor-pointer hover:text-blue-400 ">Home</a><a class="cursor-pointer hover:text-blue-400 " href="/news">News</a><a href="/patients" class="cursor-pointer hover:text-blue-400 ">Patients</a></nav><div id="active-modal"></div><div class="flex flex-col gap-2 bg-white h-full "><div class="flex flex-col p-4 w-full "><div><div class="flex justify-between items-center "><p class="text-lg font-bold ">Manage Patients</p><button hx-target="#active-modal" type="button" id="add-patient" class="flex gap-1 items-center border p-4 rounded cursor-hover bg-blue-700 text-white rounded p-2 h-12 " hx-get="htmgo/partials/patient.AddPatientSheet">Add Patient</button></div><div hx-get="htmgo/partials/patient.List" hx-trigger="load, patient-added from:body" class=""><div class="mt-8" id="patient-list"><div class="flex flex-col gap-2 rounded p-4 bg-red-100 "><p>Name: Sydne</p><p>Reason for visit: arm hurts</p></div></div></div></div></div></div><div hx-get="/livereload" hx-trigger="every 200ms" class=""></div></body>
`
// Parse the HTML

View file

@ -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}}'

View file

@ -1,3 +1,3 @@
module github.com/maddalax/mhtml/framework/tooling/mhtml
module github.com/maddalax/htmgo/framework/tooling/htmgo
go 1.23.0

View file

@ -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

View file

@ -1 +1 @@
go run github.com/maddalax/mhtml/framework/tooling/mhtml@latest -task template
go run github.com/maddalax/htmgo/framework/tooling/htmgo@latest -task template

View file

@ -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
)

View file

@ -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,
})

View file

@ -2,7 +2,7 @@ package news
import (
"fmt"
"github.com/maddalax/mhtml/framework/util/httpjson"
"github.com/maddalax/htmgo/framework/util/httpjson"
"sync"
)

View file

@ -2,7 +2,7 @@ package news
import (
"fmt"
"github.com/maddalax/mhtml/framework/h"
"github.com/maddalax/htmgo/framework/h"
"starter-template/database"
"time"
)

View file

@ -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(),

View file

@ -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 {

View file

@ -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())),
),
),
))

View file

@ -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 {

View file

@ -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"
)

View file

@ -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"
)

View file

@ -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 {

View file

@ -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"

View file

@ -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

View file

@ -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"
)

View file

@ -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"
)

View file

@ -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"

View file

@ -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 {