Refactor Dockerfile and Vite configuration to remove VITE_APP_VERSION and streamline build process

- Removed VITE_APP_VERSION from Dockerfile and GitHub workflows.
- Simplified Vite configuration by eliminating the Git version retrieval function and global constant for app version.
- Updated ColorPicker and other components to enhance accessibility with aria-labels.
- Introduced unique identifiers for buttons in the AppEditorModal for better React key management.
- Improved error handling in the Login component to provide user-friendly messages without exposing sensitive data.
This commit is contained in:
PEDZEO
2026-01-19 07:39:09 +03:00
parent 5409317501
commit 638f1d5456
21 changed files with 401 additions and 245 deletions

View File

@@ -1,26 +1,9 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { execSync } from 'child_process'
// Get version from Git tag or fallback to 'dev'
function getGitVersion(): string {
try {
// Try to get version from git tag
return execSync('git describe --tags --always', { encoding: 'utf-8' }).trim()
} catch {
return 'dev'
}
}
const appVersion = process.env.VITE_APP_VERSION || getGitVersion()
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
// Define global constants
define: {
__APP_VERSION__: JSON.stringify(appVersion),
},
// Base path - use '/' for standalone Docker deployment
// Change to '/cabinet/' if serving from a sub-path
base: '/',