Skip to content

Commit 918244c

Browse files
authored
chore: delete some useless comments (#45)
* chore: delete some useless comments * config: add eslint configuration * refactor: rename specific items for apigreenscore for better understanding * refactor(services): split scoring logic from audit-service into evaluation-service * refactor(services): extract project view logic into project-view-service * refactor(audit): unify stepper components and extract shared animation * refactor(step): replace EroomStepper and ApiGreenScoreStepper with a single generic and auditStepper component. * refactor(style): Extract duplicated fadeIn animation to global CSS.
1 parent 840c5eb commit 918244c

32 files changed

Lines changed: 2715 additions & 761 deletions

.agents/architecture-reviewer.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: architecture-reviewer
3+
description: Challenge l'architecture et propose des améliorations structurelles.
4+
tools: Read, Grep, Glob, Bash
5+
model: opus
6+
---
7+
8+
Tu es un architecte senior qui revoit ce projet Astro. Ton rôle est de *challenger* les choix, pas de valider.
9+
10+
## Checklist
11+
1. Cohérence des patterns avec CLAUDE.md
12+
2. Taille et focus des composants (single responsibility)
13+
3. Séparation des préoccupations (API / logique / présentation)
14+
4. Duplication de logique entre composants
15+
5. Scalabilité des abstractions choisies
16+
17+
## Style de feedback
18+
- Sois critique et constructif
19+
- Propose des alternatives avec leurs trade-offs
20+
- Signale les "code smells" architecturaux

.claude/rules/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export type ScoreRanking = "A" | "B" | "C" | "D" | "E"
101101
102102
### Data
103103
- Static data: `src/data/`
104-
- Questions JSON: `src/data/surveyQuestions.json`
104+
- Questions JSON: `src/data/apigreenscore-survey-questions.json`, `src/data/eroom-data-model-1-1.json`
105105
106106
### Utils
107107
- Scoring logic: `src/utils/scoring.ts`

CLAUDE.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Project-specific guidelines for AI assistants working on this codebase.
3636

3737
## Project Overview
3838

39-
**zats-greenscore** is a hybrid web/desktop application for evaluating eco-design of digital projects. It implements the API Green Score questionnaire.
39+
**zats-greenscore** is a hybrid web/desktop application for evaluating eco-design of digital projects. It supports multiple evaluation frameworks: API Green Score and EROOM.
4040

4141
- **Repository**: https://github.com/zatsit-oss/zats-greenscore
4242
- **License**: MIT
@@ -47,13 +47,15 @@ Project-specific guidelines for AI assistants working on this codebase.
4747
src/
4848
├── components/ # Astro components
4949
│ └── audit/ # Audit questionnaire components
50+
│ └── eroom/ # EROOM-specific components
51+
├── data/ # Static data (apigreenscore-survey-questions.json, eroom-data-model-1-1.json)
5052
├── layouts/ # Page layouts
5153
├── pages/ # File-based routing
5254
│ └── projects/ # Project management pages
55+
├── services/ # Business logic (hexagonal architecture)
5356
├── types/ # TypeScript interfaces
54-
├── utils/ # Utility functions (scoring, toast, ui)
55-
├── data/ # Static data (surveyQuestions.json)
56-
└── styles/ # CSS styles
57+
├── utils/ # Scoring, storage, UI helpers
58+
└── styles/ # Global CSS
5759
5860
src-tauri/
5961
├── src/ # Rust source code
@@ -64,6 +66,8 @@ src-tauri/
6466
├── icons/ # App icons (all platforms)
6567
└── capabilities/ # Tauri permissions
6668
69+
tests/ # Unit tests (Vitest)
70+
e2e/ # E2E tests (Playwright)
6771
public/ # Static assets
6872
```
6973

@@ -102,16 +106,14 @@ interface Project {
102106
description: string
103107
createdAt: string
104108
updatedAt: string
105-
status: "InProgress" | "Completed"
106-
score?: number
107-
ranking?: "A" | "B" | "C" | "D" | "E"
108-
answers?: Record<string, boolean | string | number>
109+
evaluations: Partial<Record<EvaluationType, Evaluation>>
110+
appVersion?: string
109111
}
110112
```
111113

112114
### Storage
113-
- **Web**: LocalStorage (projects, answers)
114-
- **Questions**: Static JSON (`src/data/surveyQuestions.json`)
115+
- **Web**: LocalStorage (projects, evaluations)
116+
- **Questions**: Static JSON (`src/data/apigreenscore-survey-questions.json`, `src/data/eroom-data-model-1-1.json`)
115117

116118
## npm Scripts
117119

@@ -121,4 +123,9 @@ npm run build # Production build
121123
npm run preview # Preview production build
122124
npm run dev:desktop # Desktop dev with hot reload
123125
npm run build:desktop # Build desktop app
126+
npm run lint # ESLint check
127+
npm run lint:fix # ESLint auto-fix
128+
npm run test # Unit tests (watch mode)
129+
npm run test:run # Unit tests (single run)
130+
npm run test:e2e # E2E tests (Playwright)
124131
```

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ npm run preview
101101
| `npm run build:desktop` | Build native desktop app (DMG, EXE, DEB) |
102102
| `npm run test:run` | Run unit tests (Vitest) |
103103
| `npm run test:e2e` | Run e2e tests (Playwright) |
104+
| `npm run lint` | Run ESLint check |
105+
| `npm run lint:fix` | Run ESLint with auto-fix |
104106

105107
## 🚀 Project Structure
106108

e2e/audit-apigreenscore.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test.describe('API Green Score Audit', () => {
1111
await page.fill('#description', 'Test audit flow');
1212
await page.selectOption('#evaluationType', 'apigreenscore');
1313
await page.click('button[type="submit"]');
14-
await expect(page).toHaveURL(/\/audit\?projectId=/);
14+
await expect(page).toHaveURL(/\/audit-apigreenscore\?projectId=/);
1515
await page.waitForLoadState('networkidle');
1616
});
1717

e2e/project-lifecycle.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test.describe('Project Lifecycle', () => {
2222
await page.click('button[type="submit"]');
2323

2424
// Should redirect directly to audit page
25-
await expect(page).toHaveURL(/\/audit\?projectId=/);
25+
await expect(page).toHaveURL(/\/audit-apigreenscore\?projectId=/);
2626
});
2727

2828
test('should create a new EROOM project and redirect to audit', async ({ page }) => {
@@ -44,7 +44,7 @@ test.describe('Project Lifecycle', () => {
4444
await page.fill('#description', 'Visible on dashboard');
4545
await page.selectOption('#evaluationType', 'apigreenscore');
4646
await page.click('button[type="submit"]');
47-
await expect(page).toHaveURL(/\/audit\?projectId=/);
47+
await expect(page).toHaveURL(/\/audit-apigreenscore\?projectId=/);
4848

4949
// Go to dashboard
5050
await page.goto('/');

eslint.config.mjs

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import eslintPluginAstro from "eslint-plugin-astro";
4+
5+
export default tseslint.config(
6+
js.configs.recommended,
7+
...tseslint.configs.recommended,
8+
...eslintPluginAstro.configs.recommended,
9+
{
10+
languageOptions: {
11+
globals: {
12+
console: "readonly",
13+
document: "readonly",
14+
window: "readonly",
15+
localStorage: "readonly",
16+
sessionStorage: "readonly",
17+
setTimeout: "readonly",
18+
clearTimeout: "readonly",
19+
setInterval: "readonly",
20+
clearInterval: "readonly",
21+
requestAnimationFrame: "readonly",
22+
cancelAnimationFrame: "readonly",
23+
fetch: "readonly",
24+
URL: "readonly",
25+
URLSearchParams: "readonly",
26+
HTMLElement: "readonly",
27+
HTMLInputElement: "readonly",
28+
HTMLSelectElement: "readonly",
29+
HTMLTextAreaElement: "readonly",
30+
HTMLAnchorElement: "readonly",
31+
HTMLButtonElement: "readonly",
32+
Element: "readonly",
33+
Event: "readonly",
34+
CustomEvent: "readonly",
35+
NodeListOf: "readonly",
36+
FormData: "readonly",
37+
FileReader: "readonly",
38+
Blob: "readonly",
39+
navigator: "readonly",
40+
location: "readonly",
41+
history: "readonly",
42+
alert: "readonly",
43+
confirm: "readonly",
44+
MutationObserver: "readonly",
45+
IntersectionObserver: "readonly",
46+
ResizeObserver: "readonly",
47+
AbortController: "readonly",
48+
},
49+
},
50+
rules: {
51+
"@typescript-eslint/no-explicit-any": "warn",
52+
"@typescript-eslint/no-unused-vars": [
53+
"warn",
54+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
55+
],
56+
},
57+
},
58+
{
59+
files: ["tests/**/*.ts"],
60+
languageOptions: {
61+
globals: {
62+
describe: "readonly",
63+
it: "readonly",
64+
expect: "readonly",
65+
beforeEach: "readonly",
66+
afterEach: "readonly",
67+
beforeAll: "readonly",
68+
afterAll: "readonly",
69+
vi: "readonly",
70+
},
71+
},
72+
},
73+
{
74+
ignores: [
75+
"dist/",
76+
"node_modules/",
77+
".astro/",
78+
"src-tauri/",
79+
"src/env.d.ts",
80+
"playwright-report/",
81+
"test-results/",
82+
"scripts/",
83+
"public/",
84+
],
85+
}
86+
);

0 commit comments

Comments
 (0)