Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
coverage
*.local
*.tsbuildinfo
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions react-app/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
7 changes: 7 additions & 0 deletions react-app/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
coverage
node_modules
playwright-report
test-results
public
package-lock.json
6 changes: 6 additions & 0 deletions react-app/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": true,
"printWidth": 120
}
21 changes: 21 additions & 0 deletions react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# React HN (migration target)

React rewrite of the Angular app at the repo root. The Angular app stays untouched until cutover.

Stack: Vite, React 19, TypeScript (strict), React Router, TanStack Query, Sass, ESLint + Prettier, Vitest + React Testing Library, Playwright.

Requires Node 20 (`>=20.19`, see `.nvmrc`).

```bash
cd react-app
npm ci
npm run dev # dev server on http://localhost:5173
npm run lint # eslint + prettier --check
npm run typecheck
npm test # vitest
npm run build # output in react-app/dist
npm run preview
npm run e2e # playwright (no specs yet)
```

`public/` holds the icons, images, `favicon.ico` and `manifest.json` copied from `src/` of the Angular app.
Empty file added react-app/e2e/.gitkeep
Empty file.
26 changes: 26 additions & 0 deletions react-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import prettier from 'eslint-config-prettier';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist', 'coverage', 'playwright-report', 'test-results'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended, prettier],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
}
);
19 changes: 19 additions & 0 deletions react-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#b92b27" />
<meta name="description" content="A Hacker News client built with React" />
<title>React HN</title>
<link rel="manifest" href="/manifest.json" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="/assets/icons/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/assets/icons/favicon-16x16.png" sizes="16x16" />
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-touch-icon.png" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading