Files
tfm_ainventory/frontend/package.json
Daniel Bedeleanu e715afd814 refactor: consolidate color definitions into single source of truth
- Create frontend/colors.mjs as SSOT for all design colors
- Create scripts/generate-css-vars.mjs to auto-generate CSS variables
- Update tailwind.config.ts to import colors from colors.mjs
- Update frontend/package.json: add 'generate-css-vars' script to build pipeline
- Update start_servers.py: include CSS variable generation before npm build
- All color changes now require only one edit in colors.mjs
- Build process auto-syncs CSS variables and Tailwind colors

Eliminates DRY violation where colors were duplicated in:
  - tailwind.config.ts (Tailwind utility classes)
  - globals.css (CSS custom properties)

Single source of truth approach ensures:
  ✓ No inconsistency between Tailwind and CSS variables
  ✓ One place to update colors for all contexts
  ✓ Automated CSS variable generation on every build

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-25 17:31:25 +03:00

52 lines
1.4 KiB
JSON

{
"name": "inventory-pwa",
"version": "0.2.0",
"private": true,
"scripts": {
"generate-css-vars": "node scripts/generate-css-vars.mjs",
"dev": "npm run generate-css-vars && next dev",
"build": "npm run generate-css-vars && next build",
"start": "next start",
"lint": "next lint",
"test": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"e2e": "playwright test",
"e2e:debug": "playwright test --debug --headed",
"e2e:report": "playwright show-report"
},
"dependencies": {
"axios": "^1.15.0",
"clsx": "^2.1.1",
"dexie": "^4.4.2",
"html5-qrcode": "^2.3.8",
"lucide-react": "^0.446.0",
"next": "^15.0.0",
"next-pwa": "^5.6.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hot-toast": "^2.6.0",
"tailwind-merge": "^2.5.2",
"tesseract.js": "^7.0.0"
},
"devDependencies": {
"@playwright/test": "^1.40.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^4.0.0",
"@vitest/coverage-v8": "^1.6.1",
"@vitest/ui": "^1.0.0",
"eslint": "^9",
"eslint-config-next": "15.0.0",
"jsdom": "^23.0.0",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5",
"vitest": "^1.0.0"
}
}