Add scoring reports for the newz repo milestones M1 through M6, with verification notes and remediation steps for each. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
6.4 KiB
6.4 KiB
M3: Setup Frontend - Score Report
Repository scored: ../newz (/home/daniel/Gitea/daniel/newz), frontend/ working tree
Rubric: milestone/m3-setup-frontend-scoring.md
Model: qwen3.5-9b
Total Score: 24 / 49 (Overall level 1 - partial)
The level-2 requirement that the project "builds successfully" is not met. npm run build fails at the tsc step, so the build script does not pass.
Verification Performed
Run in a temporary copy of frontend/ (node 26.11.1, node_modules copied from the working tree):
| Check | Result |
|---|---|
npm run build (tsc && vite build) |
Fails. tsc reports 4 TS6133 errors: unused render, ArticleCard and Header imports in src/tests/*.test.tsx. |
npx vite build (alone) |
Succeeds. Output in dist/. |
npx vitest run |
2 of 2 test files pass, but each test is expect(1).toBe(1). |
npm run lint |
Fails. ESLint cannot find eslint-plugin-react, which .eslintrc.cjs requires. Lint does not run. |
npx playwright test --list |
0 tests found. playwright.config.ts sets testDir: './e2e', but the specs live in playwright/e2e/. |
| Playwright browsers | Not installed (~/.cache/ms-playwright missing). E2E tests were not run. |
docker build |
Not run. The Dockerfile has an invalid line, described below. |
Scoring by Criterion
| Criterion | Score | Max | Notes |
|---|---|---|---|
| Project Setup | 2 | 2 | All required folders present: public/, src/, assets/, components/, pages/, types/, api/, tests/. |
| TypeScript & Dependencies | 3 | 5 | Interfaces for Article, Author, Category, and ApiResponse<T> exist. react-router-dom ^6.20.0 and lucide-react are installed. The components do not use the shared types from src/types/; ArticleCard and Home define their own inline types. The build fails with TypeScript errors, so the level-4 requirement is not met. |
| UI Components | 4 | 5 | Header, Layout, ArticleCard, AuthorAvatar, CategoryBadge all exist and render. The Search icon from the acceptance criteria is missing. Header links are icon-only with no accessible name, so role-based queries like getByRole('link', { name: /home/i }) cannot match. |
| React Router Configuration | 5 | 5 | BrowserRouter in App.tsx, routes for /, /articles, /categories, pages imported from src/pages/, and <Link> used for navigation. |
| Page Components | 3 | 3 | Home, ArticlePage, CategoriesPage exist under pages/ and are mapped in App.tsx. |
| API Integration | 2 | 2 | src/api/client.ts has a base URL, a fetch wrapper with error handling, and typed endpoint functions. Nothing in the app calls it yet. |
| Unit Testing | 1 | 4 | Vitest is configured and both test files run. Neither test checks anything (expect(1).toBe(1)), and the comments say routing context is tested via E2E, which never runs. |
| E2E Testing | 1 | 6 | Playwright is installed and two spec files exist, but testDir is wrong, so zero tests are discovered. Browsers are not installed. |
| Docker Configuration | 1 | 3 | Multi-stage Dockerfile (Node build, Nginx serve) and a root docker-compose.yml with a frontend service on port 3000:80 and depends_on: backend. But the Dockerfile contains COPY package-lock.json* . 2>/dev/null || true, which is not valid Dockerfile syntax, so the build should fail. The compose file also mounts ./data onto /usr/share/nginx/html, which hides the built files. |
| Code Quality | 0 | 2 | ESLint does not run, so the "linting passes" requirement is not met. |
| Documentation | 2 | 3 | frontend/README.md (253 lines) covers setup, scripts, Lucide icons, routing, Docker, and known limitations. It has no per-component prop documentation, so it does not reach level 3. |
| Total | 24 | 49 |
Bonus
None awarded.
- +1 ESLint: not awarded, because the ESLint config is not runnable.
- +2 TypeScript strict mode with react-router types: not awarded.
strict: trueis set, but the build fails undertsc. - +3 Compose orchestrating both services, SPA fallback, and E2E routing tests: partially met. The compose file orchestrates both services and
nginx.confhastry_files ... /index.html. The E2E routing tests do not run.
Critical Requirements Checklist (from rubric)
lucide-reactinstalledreact-router-dominstalledBrowserRouterconfigured inApp.tsx<Link>used for navigation
Other Issues Found
npm run buildfails because unused imports insrc/tests/*.test.tsxtripnoUnusedLocals.- ESLint cannot run.
eslint-plugin-reactis required by.eslintrc.cjsbut is not indevDependencies. - Playwright discovers no tests.
playwright.config.tssaystestDir: './e2e'; the specs are inplaywright/e2e/. - Invalid Dockerfile line.
COPY package-lock.json* . 2>/dev/null || trueis not valid Docker syntax. UseCOPY package.json package-lock.json* ./. - Compose volume shadows the build output.
./data:/usr/share/nginx/htmlin the rootdocker-compose.ymlreplaces the builtdistwith the hostdata/folder. Remove that volume. - Tailwind is not set up.
globals.cssuses@tailwinddirectives, buttailwindcssis not installed, and there is notailwind.configor PostCSS config. The directives pass through unprocessed. - Favicon and logo references.
public/index.htmllinks/vite.svg, which does not exist.src/assets/logo.svgis not used. - Test placeholders. The unit tests assert nothing and do not exercise the components.
- Git state.
frontend/, rootdocker-compose.yml, andmilestones/m3-setup-frontend-prompt.mdare untracked.backend/and the M1 files are also uncommitted.
Path to a Higher Score
- Remove the unused imports in the test files so
npm run buildpasses. - Add
eslint-plugin-reacttodevDependencies, and make the lint script pass. - Fix
playwright.config.tstestDirto./playwright/e2e, install browsers withnpx playwright install, and run the E2E suite. - Replace the placeholder unit tests with real tests for Header (icons and links) and ArticleCard, wrapped in
MemoryRouter. - Fix the Dockerfile
COPYline, remove the./datavolume from the root compose file, and rundocker compose build frontend. - Add the
Searchicon, use the shared types fromsrc/types/in components, and give icon-only links anaria-label. - Add
tailwindcss,postcssandautoprefixerwith config files, or remove the@tailwinddirectives.