Skip to content

Commit 52e8384

Browse files
authored
refactor/vite (#706)
refactor from create react app to vite
1 parent 8e9fc14 commit 52e8384

File tree

131 files changed

+8591
-18803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+8591
-18803
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,35 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- name: checkout
13-
uses: actions/checkout@v3
12+
- name: checkout
13+
uses: actions/checkout@v3
1414

15-
- name: Use Node.js 20.x
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: 20.x
19-
20-
- name: Cache node modules
21-
id: cache-npm
22-
uses: actions/cache@v3
23-
with:
24-
path: ~/.npm
25-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: |
27-
${{ runner.os }}-build-${{ env.cache-name }}-
28-
${{ runner.os }}-build-
29-
${{ runner.os }}-
15+
- name: Use Node.js 24.x
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 24.x
3019

31-
- name: Build & deploy
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
REACT_APP_NAME: ${{ secrets.REACT_APP_VERSION }}
35-
SENTRY_ENVIRONMENT: ${{ secrets.SENTRY_ENVIRONMENT}}
36-
REACT_APP_VERSION: ${{ secrets.REACT_APP_VERSION }}
37-
REACT_APP_MAP_API_KEY: ${{ secrets.REACT_APP_MAP_API_KEY }}
38-
REACT_APP_GOOGLE_ANALYTICS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_API_KEY}}
39-
run: |
40-
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
41-
npm i
42-
npm run build
43-
npx gh-pages --branch gh-pages --dist build -u "github-actions-bot <[email protected]>"
20+
- name: Cache node modules
21+
id: cache-npm
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-build-${{ env.cache-name }}-
28+
${{ runner.os }}-build-
29+
${{ runner.os }}-
30+
31+
- name: Build & deploy
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
REACT_APP_NAME: ${{ secrets.REACT_APP_VERSION }}
35+
SENTRY_ENVIRONMENT: ${{ secrets.SENTRY_ENVIRONMENT}}
36+
REACT_APP_VERSION: ${{ secrets.REACT_APP_VERSION }}
37+
REACT_APP_MAP_API_KEY: ${{ secrets.REACT_APP_MAP_API_KEY }}
38+
REACT_APP_GOOGLE_ANALYTICS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_API_KEY}}
39+
run: |
40+
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
41+
npm i
42+
npm run build
43+
npx gh-pages --branch gh-pages --dist build -u "github-actions-bot <[email protected]>"

.github/workflows/sonarcloud.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ "main" ]
66
pull_request:
7-
types: [opened, synchronize, reopened]
7+
types: [ opened, synchronize, reopened ]
88

99
jobs:
1010
sonarcloud:
@@ -30,17 +30,17 @@ jobs:
3030
${{ runner.os }}-
3131
3232
# Run tests with coverage
33-
- name: Use Node.js 18.x
33+
- name: Use Node.js 20.x
3434
uses: actions/setup-node@v3
3535
with:
36-
node-version: 18.x
36+
node-version: 20.x
3737

3838
- name: run tests with coverage
3939
run: |
4040
npm ci
41-
npm run test -- --coverage . --watchAll=false
41+
npm run test-coverage
4242
43-
# Send report to sonar
43+
# Send report to sonar
4444
- name: SonarCloud Scan
4545
uses: SonarSource/sonarcloud-github-action@master
4646
env:

.github/workflows/tests.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [20.x]
15+
node-version: [ 22.x ]
1616

1717
steps:
18-
- uses: actions/checkout@v3
19-
- name: Cache node modules
20-
id: cache-npm
21-
uses: actions/cache@v3
22-
with:
23-
path: ~/.npm
24-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25-
restore-keys: |
26-
${{ runner.os }}-build-${{ env.cache-name }}-
27-
${{ runner.os }}-build-
28-
${{ runner.os }}-
18+
- uses: actions/checkout@v3
19+
- name: Cache node modules
20+
id: cache-npm
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
2929
30-
- name: Use Node.js ${{ matrix.node-version }}
31-
uses: actions/setup-node@v3
32-
with:
33-
node-version: ${{ matrix.node-version }}
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.node-version }}
3434

35-
- name: Tests
36-
run: |
37-
npm ci
38-
npm run test
35+
- name: Tests
36+
run: |
37+
npm ci
38+
npm run test

.github/workflows/webpack.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [19.x, 20.x, 22.x]
15+
node-version: [ 20.x, 22.x, 24.x ]
1616

1717
steps:
18-
- uses: actions/checkout@v3
19-
- name: Cache node modules
20-
id: cache-npm
21-
uses: actions/cache@v3
22-
with:
23-
path: ~/.npm
24-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25-
restore-keys: |
26-
${{ runner.os }}-build-${{ env.cache-name }}-
27-
${{ runner.os }}-build-
28-
${{ runner.os }}-
29-
30-
- name: Use Node.js ${{ matrix.node-version }}
31-
uses: actions/setup-node@v3
32-
with:
33-
node-version: ${{ matrix.node-version }}
18+
- uses: actions/checkout@v3
19+
- name: Cache node modules
20+
id: cache-npm
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
3429
35-
- name: Build
36-
run: |
37-
npm ci
38-
npm run build
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- name: Build
36+
run: |
37+
npm ci
38+
npm run build

README.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@ The project follows a standard React application structure:
3434
- `2024/`: Components specific to the 2024 conference edition
3535
- `2023/`: Components specific to the 2023 conference edition
3636

37+
## Path Aliases
38+
39+
This project uses path aliases to simplify imports. Instead of using relative
40+
paths like `../../components/Button`, you can use aliases like
41+
`@components/Button`.
42+
43+
Available aliases:
44+
45+
- `@components/*` - Components from `src/components/`
46+
- `@constants/*` - Constants from `src/constants/`
47+
- `@services/*` - Services from `src/services/`
48+
- `@hooks/*` - Hooks from `src/hooks/`
49+
- `@assets/*` - Assets from `src/assets/`
50+
- `@styles/*` - Styles from `src/styles/`
51+
- `@views/*` - Views from `src/views/`
52+
- `@utils/*` - Utilities from `src/utils/`
53+
- `@data/*` - Data from `src/data/`
54+
- `@types/*` - Types from `src/types/`
55+
56+
For more details, see the [Path Aliases Documentation](docs/path-aliases.md).
57+
3758
## Development Workflow
3859

3960
### Getting Started
@@ -50,21 +71,23 @@ The project follows a standard React application structure:
5071
- `npm run test-coverage`: Run tests with coverage reporting
5172
- `npm run build`: Build for production
5273
- `npm run deploy`: Deploy to GitHub Pages
53-
- `npm run eject`: Eject from Create React App (not recommended)
74+
- `npm run lint`: Run ESLint to check for code quality issues
75+
- `npm run lint:fix`: Run ESLint and automatically fix fixable issues
5476

5577
## Contribution Guidelines
5678

5779
When contributing to this project, please:
5880

5981
1. Follow the existing code style and patterns
60-
2. Write tests for new features
61-
3. Ensure all tests pass before submitting pull requests
62-
4. Keep the UI consistent with the existing design
63-
5. Document any new components or significant changes
82+
2. Run ESLint (`npm run lint`) to ensure code quality and fix any issues
83+
3. Write tests for new features
84+
4. Ensure all tests pass before submitting pull requests
85+
5. Keep the UI consistent with the existing design
86+
6. Document any new components or significant changes
6487

6588
## Contact
6689

6790
For questions or issues related to the DevBcn website, please open an issue in
6891
this repository.
6992

70-
Visit the live site at [https://www.devbcn.com](https://www.devbcn.com)
93+
Visit the live site at [https://www.devbcn.com](https://www.devbcn.com)

0 commit comments

Comments
 (0)