Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/m
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list code.gitea.io/gitea/models/migrations/...)

FRONTEND_SOURCES := $(shell find web_src/js web_src/css -type f)
FRONTEND_CONFIGS := vite.config.ts tailwind.config.ts
FRONTEND_CONFIGS := vite.config.ts web_src/css/tailwind.css
FRONTEND_DEST := public/assets/.vite/manifest.json
FRONTEND_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts public/assets/.vite

Expand Down
2 changes: 1 addition & 1 deletion models/avatars/avatar.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const (
// DefaultAvatarClass is the default class of a rendered avatar
DefaultAvatarClass = "ui avatar tw-align-middle"
DefaultAvatarClass = "ui avatar tw:align-middle"
// DefaultAvatarPixelSize is the default size in pixels of a rendered avatar
DefaultAvatarPixelSize = 28
)
Expand Down
14 changes: 7 additions & 7 deletions models/issues/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,20 @@ func (r *Review) HTMLTypeColorClass() string {
switch r.Type {
case ReviewTypeApprove:
if !r.Official {
return "tw-text-text-light"
return "tw:text-text-light"
}
if r.Stale {
return "tw-text-yellow"
return "tw:text-yellow"
}
return "tw-text-green"
return "tw:text-green"
case ReviewTypeComment:
return "tw-text-text-light"
return "tw:text-text-light"
case ReviewTypeReject:
return "tw-text-red"
return "tw:text-red"
case ReviewTypeRequest:
return "tw-text-yellow"
return "tw:text-yellow"
}
return "tw-text-text-light"
return "tw:text-text-light"
}

// TooltipContent returns the locale string describing the review type
Expand Down
30 changes: 22 additions & 8 deletions modules/public/vitedev.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,30 +136,44 @@ func IsViteDevMode() bool {
return isDev
}

func viteDevSourceURLByCandidates(candidates ...string) string {
for _, candidate := range candidates {
srcPath := filepath.Join(setting.StaticRootPath, filepath.FromSlash(candidate))
if _, err := os.Stat(srcPath); err == nil {
return setting.AppSubURL + "/" + filepath.ToSlash(candidate)
}
}
return ""
}

func viteDevSourceURL(name string) string {
if !IsViteDevMode() {
return ""
}
if strings.HasPrefix(name, "css/theme-") {
// Only redirect built-in themes to Vite source; custom themes are served from custom/public/assets/css/
themeFile := strings.TrimPrefix(name, "css/")
srcPath := filepath.Join(setting.StaticRootPath, "web_src/css/themes", themeFile)
if _, err := os.Stat(srcPath); err == nil {
return setting.AppSubURL + "/web_src/css/themes/" + themeFile
}
return ""
return viteDevSourceURLByCandidates("web_src/css/themes/" + themeFile)
}
if strings.HasPrefix(name, "css/") {
return setting.AppSubURL + "/web_src/" + name
file := strings.TrimPrefix(name, "css/")
return viteDevSourceURLByCandidates(
"web_src/css/"+file,
"web_src/css/standalone/"+file,
)
}
if name == "js/eventsource.sharedworker.js" {
return setting.AppSubURL + "/web_src/js/features/eventsource.sharedworker.ts"
}
if name == "js/iife.js" {
return setting.AppSubURL + "/web_src/js/__vite_iife.js"
}
if name == "js/index.js" {
return setting.AppSubURL + "/web_src/js/index.ts"
if strings.HasPrefix(name, "js/") {
file := strings.TrimSuffix(strings.TrimPrefix(name, "js/"), ".js") + ".ts"
return viteDevSourceURLByCandidates(
"web_src/js/"+file,
"web_src/js/standalone/"+file,
)
}
return ""
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@primer/octicons": "19.23.1",
"@resvg/resvg-wasm": "2.6.2",
"@silverwind/vue3-calendar-heatmap": "2.1.1",
"@tailwindcss/vite": "4.2.2",
"@vitejs/plugin-vue": "6.0.5",
"ansi_up": "6.0.6",
"asciinema-player": "3.15.1",
Expand Down Expand Up @@ -46,7 +47,7 @@
"rollup-plugin-license": "3.7.0",
"sortablejs": "1.15.7",
"swagger-ui-dist": "5.32.1",
"tailwindcss": "3.4.19",
"tailwindcss": "4.2.2",
"throttle-debounce": "5.0.2",
"tippy.js": "6.3.7",
"toastify-js": "1.12.0",
Expand Down
Loading
Loading