@@ -7,37 +7,104 @@ help: ## Display this help message
77 awk ' BEGIN {FS = ":.*?## "}; \
88 {printf " \033[36m%-20s\033[0m %s\n" , $$ 1, $$ 2}'
99
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
52+
1053.PHONY : install
1154install : # # Install npm dependencies
1255 npm install
1356
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+
1465.PHONY : prettify
1566prettify : # # Format HTML, SCSS, TypeScript, and JavaScript files with Prettier
1667 npx prettier --write ' src/**/*.{ts,js,html,scss,css,json}'
1768
18- .PHONY : check-prettify
19- check-prettify : # # Check if files are formatted with Prettier
20- 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
2178
2279.PHONY : start
2380start : # # Start the development server
24- npm start
81+ npm install && ng serve --configuration local --open
2582
26- .PHONY : build
27- build : # # Build the frontend for production
28- 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
29103
30104.PHONY : test
31105test : # # Run Cypress tests
32- npm run tests
106+ npx cypress open --config baseUrl=http://localhost:4200
33107
34108.PHONY : test-headless
35109test-headless : # # Run Cypress tests in headless mode
36- npm run tests:headless
37-
38- .PHONY : clean
39- clean : # # Clean build artifacts and node_modules
40- rm -rf dist node_modules
41-
42- .PHONY : rebuild
43- rebuild : clean install build # # Clean, reinstall dependencies, and rebuild
110+ npx cypress run --headless --config baseUrl=http://localhost:4200
0 commit comments