Commit 5e5a61df by Sathish A

Updated Dockerfile to copy package.json files for backend, modified build script…

Updated Dockerfile to copy package.json files for backend, modified build script in frontend package.json to prevent emitting, adjusted TypeScript configuration to allow unused locals and parameters, and refactored App and WheelCanvas components for improved functionality and code clarity.
parent de4b36d7
Pipeline #61316 failed with stages
in 2 minutes 19 seconds
......@@ -20,6 +20,7 @@ WORKDIR /app/backend
COPY --from=deps /app/backend/node_modules ./node_modules
COPY --from=prisma /app/backend/node_modules/.prisma ./node_modules/.prisma
COPY package*.json ./
COPY tsconfig.json ./
COPY src ./src
COPY prisma ./prisma
......
......@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "tsc --noEmit && vite build",
"preview": "vite preview",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
......@@ -20,6 +20,7 @@
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/canvas-confetti": "^1.6.4",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
......
......@@ -3,7 +3,7 @@ import WheelCanvas from './components/Wheel/WheelCanvas'
import EntryManager from './components/EntryManager/EntryManager'
import CustomizationModal from './components/Customization/CustomizationModal'
import { useWheelStore } from './store/wheelStore'
import { wheelApi, entryApi, resultApi } from './services/api'
import { wheelApi } from './services/api'
import { Settings, Trophy } from 'lucide-react'
import './App.css'
......@@ -41,7 +41,9 @@ function App() {
if (latestWheel && latestWheel.id) {
wheelId = latestWheel.id
setWheelId(wheelId)
if (wheelId) {
localStorage.setItem('spin-the-wheel_currentWheelId', wheelId)
}
} else {
// No wheels exist, start with empty state
loadEntries([])
......
import { useEffect, useRef, useState, useCallback } from 'react'
import { useEffect, useRef, useCallback } from 'react'
import { useWheelStore } from '../../store/wheelStore'
import { WheelPhysics, getSecureRandomEntry, getSegmentIndexFromAngle } from '../../utils/wheelPhysics'
import { WheelPhysics, getSegmentIndexFromAngle } from '../../utils/wheelPhysics'
import { spinApi, wheelApi, resultApi, entryApi } from '../../services/api'
import confetti from 'canvas-confetti'
import './WheelCanvas.css'
......@@ -435,7 +435,7 @@ export default function WheelCanvas() {
// Use ref first (from current spin), then fallback to store
const wheelId = currentWheelIdRef.current || currentWheelId
if (wheelId) {
autoSaveResult(finalWinner, wheelId).catch(err => {
autoSaveResult(finalWinner, wheelId).catch(() => {
// Silently handle result save error
})
} else {
......
......@@ -12,8 +12,8 @@
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment