33.PHONY : help
44help : # # Display this help message
55 @echo " Frontend Makefile - Available targets:"
6- @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
6+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | \
7+ awk ' BEGIN {FS = ":.*?## "}; \
8+ {printf " \033[36m%-20s\033[0m %s\n" , $$ 1, $$ 2}'
9+
10+ .PHONY : build
11+ build : # # Build the frontend
12+ ng build
13+
14+ .PHONY : build-dev
15+ build-dev : # # Build the frontend for development
16+ ng build --configuration development
17+
18+ .PHONY : build-prod
19+ build-prod : # # Build the frontend for production
20+ ng build --configuration production && $(MAKE ) sentry-sourcemaps
21+
22+ .PHONY : check-prettify
23+ check-prettify : # # Check if files are formatted with Prettier
24+ npx prettier --check ' src/**/*.{ts,js,html,scss,css,json}'
25+
26+ .PHONY : clean
27+ clean : # # Clean build artifacts and node_modules
28+ rm -rf dist node_modules
29+
30+ .PHONY : copy-env
31+ copy-env : # # Copy webnode.js to env.js
32+ cp dist/frontend/browser/assets/environments/webnode.js \
33+ dist/frontend/browser/assets/environments/env.js
34+
35+ .PHONY : deploy
36+ deploy : # # Deploy the application
37+ $(MAKE ) prebuild && $(MAKE ) build-prod && $(MAKE ) copy-env && \
38+ firebase deploy
39+
40+ .PHONY : deploy-leaderboard
41+ deploy-leaderboard : # # Deploy the leaderboard application
42+ $(MAKE ) prebuild && $(MAKE ) build-prod && \
43+ cp dist/frontend/browser/assets/environments/leaderboard.js \
44+ dist/frontend/browser/assets/environments/env.js && \
45+ firebase deploy
46+
47+ .PHONY : docker
48+ docker : # # Build and push Docker image
49+ $(MAKE ) build-prod && \
50+ docker buildx build --platform linux/amd64 -t openmina/frontend:latest . && \
51+ docker push openmina/frontend:latest
752
853.PHONY : install
954install : # # Install npm dependencies
1055 npm install
1156
57+ .PHONY : install-deps
58+ install-deps : # # Install npm dependencies (alias)
59+ npm install
60+
61+ .PHONY : prebuild
62+ prebuild : # # Run prebuild script to update version
63+ node scripts/update-frontend-version.js
64+
1265.PHONY : prettify
1366prettify : # # Format HTML, SCSS, TypeScript, and JavaScript files with Prettier
1467 npx prettier --write ' src/**/*.{ts,js,html,scss,css,json}'
1568
16- .PHONY : check-prettify
17- check-prettify : # # Check if files are formatted with Prettier
18- npx prettier --check ' src/**/*.{ts,js,html,scss,css,json}'
69+ .PHONY : rebuild
70+ rebuild : clean install build # # Clean, reinstall dependencies, and rebuild
71+
72+ .PHONY : sentry-sourcemaps
73+ sentry-sourcemaps : # # Upload sourcemaps to Sentry
74+ sentry-cli sourcemaps inject --org openmina-uv --project openmina \
75+ ./dist/frontend/browser && \
76+ sentry-cli sourcemaps upload --org openmina-uv --project openmina \
77+ ./dist/frontend/browser
1978
2079.PHONY : start
2180start : # # Start the development server
22- npm start
81+ npm install && ng serve --configuration local --open
2382
24- .PHONY : build
25- build : # # Build the frontend for production
26- npm run build:prod
83+ .PHONY : start-bundle
84+ start-bundle : # # Serve the built bundle
85+ serve dist/frontend/browser -s -l 4200
86+
87+ .PHONY : start-dev
88+ start-dev : # # Start the development server (dev configuration)
89+ ng serve --configuration development
90+
91+ .PHONY : start-dev-mobile
92+ start-dev-mobile : # # Start the development server for mobile (accessible on network)
93+ ng serve --configuration development --host 0.0.0.0
94+
95+ .PHONY : start-fuzzing
96+ start-fuzzing : # # Start the fuzzing build and serve
97+ $(MAKE ) install-deps && ng build --configuration fuzzing && \
98+ $(MAKE ) start-bundle
99+
100+ .PHONY : start-webnode
101+ start-webnode : # # Start the webnode development server
102+ npm install && ng serve --configuration webnodelocal --open
27103
28104.PHONY : test
29105test : # # Run Cypress tests
30- npm run tests
106+ npx cypress open --config baseUrl=http://localhost:4200
31107
32108.PHONY : test-headless
33109test-headless : # # Run Cypress tests in headless mode
34- npm run tests:headless
35-
36- .PHONY : clean
37- clean : # # Clean build artifacts and node_modules
38- rm -rf dist node_modules
39-
40- .PHONY : rebuild
41- rebuild : clean install build # # Clean, reinstall dependencies, and rebuild
110+ npx cypress run --headless --config baseUrl=http://localhost:4200
0 commit comments