Skip to content

Commit 66ee316

Browse files
authored
Merge pull request #2 from aligneddev/toReact
To react
2 parents 5ac90d0 + 3ca726f commit 66ee316

27 files changed

Lines changed: 2170 additions & 5146 deletions

.specify/memory/constitution.md

Lines changed: 31 additions & 31 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Scaffolded starter structure for a local-first Bike Tracking application.
77
- .NET 10 Aspire AppHost orchestration
88
- .NET 10 Minimal API backend with hello endpoints
99
- F# domain project placeholder
10-
- Aurelia 2 frontend (Vite) with a simple hello screen
10+
- React frontend (Vite) with a simple hello screen
1111
- No business logic implemented yet
1212
- No database schema created yet
1313

@@ -17,7 +17,7 @@ Scaffolded starter structure for a local-first Bike Tracking application.
1717
- src/BikeTracking.Api - Minimal API service
1818
- src/BikeTracking.ServiceDefaults - Shared Aspire defaults/telemetry wiring
1919
- src/BikeTracking.Domain.FSharp - Domain layer starter project (F#)
20-
- src/BikeTracking.Frontend - Aurelia 2 frontend app
20+
- src/BikeTracking.Frontend - React frontend app
2121

2222
## Prerequisites
2323

@@ -41,7 +41,7 @@ dotnet run --project src/BikeTracking.AppHost
4141
```
4242

4343
3. Open Aspire dashboard and launch services:
44-
- `frontend` for the Aurelia hello screen
44+
- `frontend` for the React hello screen
4545
- `api` for the Minimal API
4646

4747
## API starter endpoints

src/BikeTracking.AppHost/AppHost.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
.WithHttpHealthCheck("/health")
66
.WithExternalHttpEndpoints();
77

8-
// AddViteApp was not working with Aurelia
98
var webFrontend = builder
10-
.AddNodeApp("frontend", "../BikeTracking.Frontend", "node_modules/vite/bin/vite.js")
11-
.WithNpm()
12-
.WithRunScript("preview")
13-
.WithHttpEndpoint(port: 5173, env: "PORT")
9+
.AddViteApp("frontend", "../BikeTracking.Frontend")
1410
.WithReference(apiService)
1511
.WaitFor(apiService);
1612

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
19

2-
# You may want to customise this file depending on your Operating System
3-
# and the editor that you use.
4-
#
5-
# We recommend that you use a Global Gitignore for files that are not related
6-
# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)
7-
8-
# OS
9-
#
10-
# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
11-
# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
12-
# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
13-
.DS_STORE
14-
Thumbs.db
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
1514

16-
# Editors
17-
#
18-
# Ref: https://github.com/github/gitignore/blob/master/Global
19-
# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
20-
# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
21-
.idea
22-
.chrome
23-
/*.log
15+
# Editor directories and files
2416
.vscode/*
25-
!.vscode/settings.json
26-
!.vscode/tasks.json
27-
!.vscode/launch.json
2817
!.vscode/extensions.json
29-
30-
# Dependencies
31-
node_modules
32-
33-
# Compiled files
34-
/dist
35-
/.nyc_output
36-
/coverage
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

src/BikeTracking.Frontend/.stylelintrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/BikeTracking.Frontend/.vscode/launch.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/BikeTracking.Frontend/.yarnrc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,73 @@
1-
# bike-tracking-frontend
1+
# React + TypeScript + Vite
22

3-
This project is bootstrapped by [aurelia/new](https://github.com/aurelia/new).
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
44

5-
## Quick start
5+
Currently, two official plugins are available:
66

7-
npm install
8-
npm start
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
99

10+
## React Compiler
1011

11-
## Start dev web server
12+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
1213

13-
npm start
14+
## Expanding the ESLint configuration
1415

15-
## Build the app in production mode
16+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
1617

17-
npm run build
18+
```js
19+
export default defineConfig([
20+
globalIgnores(['dist']),
21+
{
22+
files: ['**/*.{ts,tsx}'],
23+
extends: [
24+
// Other configs...
1825

26+
// Remove tseslint.configs.recommended and replace with this
27+
tseslint.configs.recommendedTypeChecked,
28+
// Alternatively, use this for stricter rules
29+
tseslint.configs.strictTypeChecked,
30+
// Optionally, add this for stylistic rules
31+
tseslint.configs.stylisticTypeChecked,
1932

33+
// Other configs...
34+
],
35+
languageOptions: {
36+
parserOptions: {
37+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
38+
tsconfigRootDir: import.meta.dirname,
39+
},
40+
// other options...
41+
},
42+
},
43+
])
44+
```
45+
46+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47+
48+
```js
49+
// eslint.config.js
50+
import reactX from 'eslint-plugin-react-x'
51+
import reactDom from 'eslint-plugin-react-dom'
52+
53+
export default defineConfig([
54+
globalIgnores(['dist']),
55+
{
56+
files: ['**/*.{ts,tsx}'],
57+
extends: [
58+
// Other configs...
59+
// Enable lint rules for React
60+
reactX.configs['recommended-typescript'],
61+
// Enable lint rules for React DOM
62+
reactDom.configs.recommended,
63+
],
64+
languageOptions: {
65+
parserOptions: {
66+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
67+
tsconfigRootDir: import.meta.dirname,
68+
},
69+
// other options...
70+
},
71+
},
72+
])
73+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs.flat.recommended,
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

src/BikeTracking.Frontend/eslint.config.mjs

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)