From ed4a335b652c9bbbaa3211675db435a80f97e358 Mon Sep 17 00:00:00 2001 From: Graham Barber Date: Sat, 17 Aug 2024 06:03:51 +0000 Subject: [PATCH] change Tailwind config to TS, auto migrate models --- main.go | 5 ++++- config/tailwind.config.js | 32 -------------------------------- config/tailwind.config.ts | 33 +++++++++++++++++++++++++++++++++ 3 file(s) changed, 37 insertion(s)(+), 33 deletion(s)(-) diff --git a/main.go b/main.go --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main //go:generate templ generate -//go:generate deno run --allow-all npm:tailwindcss -i config/main.css -o static/styles.css -c config/tailwind.config.js --minify +//go:generate deno run --allow-all npm:tailwindcss -i config/main.css -o static/styles.css -c config/tailwind.config.ts --minify import ( "os" @@ -12,6 +12,7 @@ "strconv" "github.com/puregarlic/space/handlers" + "github.com/puregarlic/space/models" "github.com/puregarlic/space/storage" "github.com/go-chi/chi/v5" @@ -27,6 +28,8 @@ func main() { port, profileURL := validateRuntimeConfiguration() defer storage.CleanupAuthCache() + + storage.GORM().AutoMigrate(&models.Post{}) r := chi.NewRouter() diff --git a/config/tailwind.config.js b/config/tailwind.config.js deleted file mode 100644 --- a/config/tailwind.config.js +++ /dev/null @@ -1,32 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - "./html/**/*.templ", - ], - theme: { - extend: { - fontFamily: { - sans: "Recursive, sans-serif", - mono: "Recursive, monospace", - }, - colors: { - base: "#191724", - surface: "#1f1d2e", - overlay: "#26233a", - muted: "#6e6a86", - subtle: "#908caa", - text: "#e0def4", - love: "#eb6f92", - gold: "#f6c177", - rose: "#ebbcba", - pine: "#31748f", - foam: "#9ccfd8", - iris: "#c4a7e7", - highlightLow: "#21202e", - highlightMed: "#403d52", - highlightHigh: "#524f67", - }, - }, - }, - plugins: [], -}; diff --git a/config/tailwind.config.ts b/config/tailwind.config.ts new file mode 100644 --- /dev/null +++ b/config/tailwind.config.ts @@ -0,0 +1,33 @@ +import { Config } from "npm:tailwindcss"; + +export default { + content: [ + "./html/**/*.templ", + ], + theme: { + extend: { + fontFamily: { + sans: "Recursive, sans-serif", + mono: "Recursive, monospace", + }, + colors: { + base: "#191724", + surface: "#1f1d2e", + overlay: "#26233a", + muted: "#6e6a86", + subtle: "#908caa", + text: "#e0def4", + love: "#eb6f92", + gold: "#f6c177", + rose: "#ebbcba", + pine: "#31748f", + foam: "#9ccfd8", + iris: "#c4a7e7", + highlightLow: "#21202e", + highlightMed: "#403d52", + highlightHigh: "#524f67", + }, + }, + }, + plugins: [], +} as Config; -- tangled.sh