Skip to content

Commit 80dcc31

Browse files
committed
Makefile: define one build/start target per configuration
1 parent c4c557c commit 80dcc31

File tree

2 files changed

+77
-28
lines changed

2 files changed

+77
-28
lines changed

frontend/Makefile

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,40 @@ help: ## Display this help message
99

1010
.PHONY: build
1111
build: ## Build the frontend
12-
ng build
12+
npx ng build
1313

14-
.PHONY: build-dev
15-
build-dev: ## Build the frontend for development
16-
ng build --configuration development
14+
.PHONY: build-development
15+
build-development: ## Build the frontend with development configuration
16+
npx ng build --configuration development
17+
18+
.PHONY: build-fuzzing
19+
build-fuzzing: ## Build the frontend with fuzzing configuration
20+
npx ng build --configuration fuzzing
21+
22+
.PHONY: build-local
23+
build-local: ## Build the frontend with local configuration
24+
npx ng build --configuration local
1725

1826
.PHONY: build-prod
1927
build-prod: ## Build the frontend for production
20-
ng build --configuration production
28+
npx ng build --configuration production
2129

2230
.PHONY: build-prod-sentry
2331
build-prod-sentry: ## Build the frontend for production with Sentry sourcemaps
24-
ng build --configuration production && $(MAKE) sentry-sourcemaps
32+
npx ng build --configuration production
33+
$(MAKE) sentry-sourcemaps
34+
35+
.PHONY: build-producer
36+
build-producer: ## Build the frontend with producer configuration
37+
npx ng build --configuration producer
38+
39+
.PHONY: build-production
40+
build-production: ## Build the frontend with production configuration
41+
npx ng build --configuration production
42+
43+
.PHONY: build-webnodelocal
44+
build-webnodelocal: ## Build the frontend with webnodelocal configuration
45+
npx ng build --configuration webnodelocal
2546

2647
.PHONY: check-prettify
2748
check-prettify: ## Check if files are formatted with Prettier
@@ -38,21 +59,24 @@ copy-env: ## Copy webnode.js to env.js
3859

3960
.PHONY: deploy
4061
deploy: ## Deploy the application
41-
$(MAKE) prebuild && $(MAKE) build-prod-sentry && $(MAKE) copy-env && \
42-
firebase deploy
62+
$(MAKE) prebuild
63+
$(MAKE) build-prod-sentry
64+
$(MAKE) copy-env
65+
firebase deploy
4366

4467
.PHONY: deploy-leaderboard
4568
deploy-leaderboard: ## Deploy the leaderboard application
46-
$(MAKE) prebuild && $(MAKE) build-prod-sentry && \
47-
cp dist/frontend/browser/assets/environments/leaderboard.js \
48-
dist/frontend/browser/assets/environments/env.js && \
49-
firebase deploy
69+
$(MAKE) prebuild
70+
$(MAKE) build-prod-sentry
71+
cp dist/frontend/browser/assets/environments/leaderboard.js \
72+
dist/frontend/browser/assets/environments/env.js
73+
firebase deploy
5074

5175
.PHONY: docker
5276
docker: ## Build and push Docker image
53-
$(MAKE) build-prod-sentry && \
54-
docker buildx build --platform linux/amd64 -t openmina/frontend:latest . && \
55-
docker push openmina/frontend:latest
77+
$(MAKE) build-prod-sentry
78+
docker buildx build --platform linux/amd64 -t openmina/frontend:latest .
79+
docker push openmina/frontend:latest
5680

5781
.PHONY: install
5882
install: ## Install npm dependencies
@@ -76,34 +100,49 @@ rebuild: clean install build ## Clean, reinstall dependencies, and rebuild
76100
.PHONY: sentry-sourcemaps
77101
sentry-sourcemaps: ## Upload sourcemaps to Sentry
78102
sentry-cli sourcemaps inject --org openmina-uv --project openmina \
79-
./dist/frontend/browser && \
80-
sentry-cli sourcemaps upload --org openmina-uv --project openmina \
103+
./dist/frontend/browser
104+
sentry-cli sourcemaps upload --org openmina-uv --project openmina \
81105
./dist/frontend/browser
82106

83107
.PHONY: start
84108
start: ## Start the development server
85-
npm install && ng serve --configuration local --open
109+
npm install
110+
npx ng serve --configuration local --open
86111

87112
.PHONY: start-bundle
88113
start-bundle: ## Serve the built bundle
89114
serve dist/frontend/browser -s -l 4200
90115

91-
.PHONY: start-dev
92-
start-dev: ## Start the development server (dev configuration)
93-
ng serve --configuration development
94-
95116
.PHONY: start-dev-mobile
96117
start-dev-mobile: ## Start the development server for mobile (accessible on network)
97-
ng serve --configuration development --host 0.0.0.0
118+
npx ng serve --configuration development --host 0.0.0.0
119+
120+
.PHONY: start-development
121+
start-development: ## Start the development server with development configuration
122+
npx ng serve --configuration development
98123

99124
.PHONY: start-fuzzing
100125
start-fuzzing: ## Start the fuzzing build and serve
101-
$(MAKE) install-deps && ng build --configuration fuzzing && \
102-
$(MAKE) start-bundle
126+
$(MAKE) install-deps
127+
npx ng build --configuration fuzzing
128+
$(MAKE) start-bundle
129+
130+
.PHONY: start-local
131+
start-local: ## Start the development server with local configuration
132+
npx ng serve --configuration local
133+
134+
.PHONY: start-production
135+
start-production: ## Start the development server with production configuration
136+
npx ng serve --configuration production
103137

104138
.PHONY: start-webnode
105139
start-webnode: ## Start the webnode development server
106-
npm install && ng serve --configuration webnodelocal --open
140+
npm install
141+
npx ng serve --configuration webnodelocal --open
142+
143+
.PHONY: start-webnodelocal
144+
start-webnodelocal: ## Start the development server with webnodelocal configuration
145+
npx ng serve --configuration webnodelocal
107146

108147
.PHONY: test
109148
test: ## Run Cypress tests

frontend/package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
"version": "1.0.184",
44
"scripts": {
55
"build": "make build",
6-
"build:dev": "make build-dev",
6+
"build:dev": "make build-development",
7+
"build:development": "make build-development",
8+
"build:fuzzing": "make build-fuzzing",
9+
"build:local": "make build-local",
710
"build:prod": "make build-prod",
811
"build:prod:sentry": "make build-prod-sentry",
12+
"build:producer": "make build-producer",
13+
"build:production": "make build-production",
14+
"build:webnodelocal": "make build-webnodelocal",
915
"check-prettify": "make check-prettify",
1016
"copy-env": "make copy-env",
1117
"deploy": "make deploy",
@@ -17,10 +23,14 @@
1723
"sentry:sourcemaps": "make sentry-sourcemaps",
1824
"start": "make start",
1925
"start:bundle": "make start-bundle",
20-
"start:dev": "make start-dev",
26+
"start:dev": "make start-development",
2127
"start:dev:mobile": "make start-dev-mobile",
28+
"start:development": "make start-development",
2229
"start:fuzzing": "make start-fuzzing",
30+
"start:local": "make start-local",
31+
"start:production": "make start-production",
2332
"start:webnode": "make start-webnode",
33+
"start:webnodelocal": "make start-webnodelocal",
2434
"tests": "make test",
2535
"tests:headless": "make test-headless"
2636
},

0 commit comments

Comments
 (0)