ai generated solutions to our ai generated problems

This commit is contained in:
Heidi
2026-06-20 01:17:36 +01:00
parent 0955528df0
commit 6f846f3d26
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ const analyticsConsentVersion = 3
const themePreferenceKey = 'tssbot.theme'
const themePreferenceCookie = 'tssbot_theme'
const liveRefreshMs = 15000
const siteVersion = '1.0.1'
const siteVersion = import.meta.env.VITE_SITE_VERSION || '1.0.0'
const turnstileSiteKey = import.meta.env.VITE_TURNSTILE_SITE_KEY || ''
const siteGateEnabled = String(import.meta.env.VITE_SITE_GATE || 'false').toLowerCase() === 'true'
+17
View File
@@ -1,10 +1,24 @@
import path from 'node:path'
import { execSync } from 'node:child_process'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
const MAX_TEAM_NAME_LENGTH = 80
function siteVersion() {
try {
const count = execSync('git rev-list --count HEAD', {
cwd: __dirname,
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'ignore'],
}).trim()
return `1.0.${Number(count) || 0}`
} catch {
return '1.0.0'
}
}
function isAllowedApiUrl(req) {
const url = new URL(req.url, 'http://localhost')
const params = url.searchParams
@@ -175,6 +189,9 @@ export default defineConfig(({ mode }) => {
root: path.resolve(__dirname, 'frontend'),
publicDir: path.resolve(__dirname, 'frontend/public'),
plugins: [comingSoonDev(comingSoon), apiGuard(), react(), tailwindcss()],
define: {
'import.meta.env.VITE_SITE_VERSION': JSON.stringify(siteVersion()),
},
build: {
outDir: path.resolve(__dirname, 'dist'),
emptyOutDir: true,