ai generated solutions to our ai generated problems
This commit is contained in:
@@ -47,7 +47,7 @@ const analyticsConsentVersion = 3
|
|||||||
const themePreferenceKey = 'tssbot.theme'
|
const themePreferenceKey = 'tssbot.theme'
|
||||||
const themePreferenceCookie = 'tssbot_theme'
|
const themePreferenceCookie = 'tssbot_theme'
|
||||||
const liveRefreshMs = 15000
|
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 turnstileSiteKey = import.meta.env.VITE_TURNSTILE_SITE_KEY || ''
|
||||||
const siteGateEnabled = String(import.meta.env.VITE_SITE_GATE || 'false').toLowerCase() === 'true'
|
const siteGateEnabled = String(import.meta.env.VITE_SITE_GATE || 'false').toLowerCase() === 'true'
|
||||||
|
|||||||
@@ -1,10 +1,24 @@
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
import { execSync } from 'node:child_process'
|
||||||
import { defineConfig, loadEnv } from 'vite'
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
|
|
||||||
const MAX_TEAM_NAME_LENGTH = 80
|
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) {
|
function isAllowedApiUrl(req) {
|
||||||
const url = new URL(req.url, 'http://localhost')
|
const url = new URL(req.url, 'http://localhost')
|
||||||
const params = url.searchParams
|
const params = url.searchParams
|
||||||
@@ -175,6 +189,9 @@ export default defineConfig(({ mode }) => {
|
|||||||
root: path.resolve(__dirname, 'frontend'),
|
root: path.resolve(__dirname, 'frontend'),
|
||||||
publicDir: path.resolve(__dirname, 'frontend/public'),
|
publicDir: path.resolve(__dirname, 'frontend/public'),
|
||||||
plugins: [comingSoonDev(comingSoon), apiGuard(), react(), tailwindcss()],
|
plugins: [comingSoonDev(comingSoon), apiGuard(), react(), tailwindcss()],
|
||||||
|
define: {
|
||||||
|
'import.meta.env.VITE_SITE_VERSION': JSON.stringify(siteVersion()),
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: path.resolve(__dirname, 'dist'),
|
outDir: path.resolve(__dirname, 'dist'),
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user