Améliorer la structure et configuration du projet avec Next.js 15, tests modernes et outils de qualité#78
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ng setup, and strict configurations Co-authored-by: vidaluca77-cloud <226796821+vidaluca77-cloud@users.noreply.github.com>
…s, fix configurations, and update documentation Co-authored-by: vidaluca77-cloud <226796821+vidaluca77-cloud@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the LaVidaLuca-App project infrastructure by implementing modern development best practices for a Next.js/React/TypeScript application.
- Updates Next.js from 14.0.4 to 15.4.7 and React to 19.1.1
- Implements strict TypeScript configuration with path mapping
- Adds comprehensive ESLint + Prettier integration with automatic code formatting
Reviewed Changes
Copilot reviewed 35 out of 42 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated dependencies to latest versions and added development scripts |
| src/types/index.ts | Added TypeScript types for application domain models |
| src/styles/globals.css | Created comprehensive CSS utility classes and component styles |
| src/lib/utils.ts | Implemented utility functions and activity matching algorithm |
| src/lib/logger.ts | Added structured logging utility with development/production modes |
| src/hooks/index.ts | Created custom React hooks for application state management |
| src/components/ui/ | Added reusable UI components (Button, Card, Badge) with tests |
| src/components/layout/ | Implemented layout components for page structure |
| src/app/ | Updated Next.js App Router pages with consistent formatting |
| .eslintrc.json | Configured ESLint with Next.js and Prettier integration |
| .prettierrc.js | Added Prettier configuration for consistent code formatting |
| jest.setup.js | Enhanced Jest configuration with Testing Library support |
| monitoring files | Applied consistent formatting to monitoring utilities |
| README.md | Updated documentation with new project structure and scripts |
Comments suppressed due to low confidence (2)
src/app/page.tsx:1
- This function duplicates logic found in src/lib/utils.ts. The same matching algorithm exists in both files, which could lead to inconsistencies. Consider using the utility function from src/lib/utils.ts instead.
'use client';
src/app/page.tsx:910
- The formatDuration function is duplicated across multiple components (SuggestionsPage, ActivityCatalog). This should be moved to src/lib/utils.ts and imported where needed to maintain consistency.
const formatDuration = (minutes: number) => {
const hours = Math.floor(minutes / 60);
const mins = minutes % 60;
if (hours > 0) {
return `${hours}h${mins > 0 ? mins.toString().padStart(2, '0') : ''}`;
}
return `${mins}min`;
};
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "Vérifier la présence de l'encadrant", | ||
| "S'assurer d'avoir tous les matériels nécessaires", | ||
| 'Prendre connaissance des consignes de sécurité', | ||
| ]; |
There was a problem hiding this comment.
The function contains duplicate logic that also exists in SuggestionsPage component. Consider extracting this into a shared utility to avoid code duplication and ensure consistency.
| return 'Non défini'; | ||
| } | ||
| }; | ||
|
|
There was a problem hiding this comment.
The getSafetyColor and getSafetyText functions are duplicated across multiple components. These utility functions should be centralized in src/lib/utils.ts to avoid code duplication.
Cette PR modernise complètement l'infrastructure de développement du projet LaVidaLuca-App en implémentant les meilleures pratiques modernes pour un projet Next.js/React/TypeScript.
🚀 Améliorations principales
Mise à jour des dépendances
Structure de dossiers reorganisée
Nouvelle architecture modulaire dans
/src:Configuration robuste des outils
TypeScript strict mode activé avec:
@/*verssrc/*)ESLint + Prettier intégrés:
Jest + Testing Library modernisés:
🧪 Tests et qualité
Nouveaux scripts disponibles:
npm run quality- Vérification complète (types, lint, format, tests)npm run test:ui- Tests des composants uniquementnpm run format/npm run lint:fix- Corrections automatiquesnpm run test:coverage- Tests avec couvertureTests de composants UI créés:
🛠 Composants UI de base
Nouveaux composants réutilisables:
📚 Documentation mise à jour
Le README.md a été complètement restructuré avec:
🔧 Corrections techniques
Cette modernisation établit une base solide pour le développement futur avec toutes les meilleures pratiques actuelles en place.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
o1.ingest.sentry.ionode /home/REDACTED/work/LaVidaLuca-App/LaVidaLuca-App/node_modules/.bin/next build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.