2022-10-13 23:49:35 -06:00
.ONESHELL : # Applies to every targets in the file! .ONESHELL instructs make to invoke a single instance of the shell and provide it with the entire recipe, regardless of how many lines it contains.
.SHELLFLAGS = -ec
########################################################################################################################
# General
########################################################################################################################
.PHONY : test
2023-05-12 15:34:27 -06:00
test : test -backend test -frontend
2022-10-13 23:49:35 -06:00
2023-07-08 08:43:30 -06:00
.PHONY : serve -frontend -storybook
serve-frontend-storybook :
cd frontend && ng run fastenhealth:storybook
2023-05-10 20:34:57 -06:00
.PHONY : serve -frontend
2023-07-08 08:43:30 -06:00
serve-frontend : dep -frontend
2023-05-12 07:12:09 -06:00
cd frontend && yarn dist -- -c sandbox
2023-05-10 20:34:57 -06:00
.PHONY : serve -frontend -prod
2023-07-08 08:43:30 -06:00
serve-frontend-prod : dep -frontend
2023-05-12 07:12:09 -06:00
cd frontend && yarn dist -- -c prod
2023-05-10 20:34:57 -06:00
.PHONY : serve -backend
2024-01-24 20:01:33 -07:00
serve-backend : dep -backend
2023-05-10 20:34:57 -06:00
go run backend/cmd/fasten/fasten.go start --config ./config.dev.yaml --debug
2024-01-16 22:13:52 -07:00
.PHONY : migrate
2024-01-24 20:01:33 -07:00
migrate : dep -backend
2024-01-16 22:13:52 -07:00
go run backend/cmd/fasten/fasten.go migrate --config ./config.dev.yaml --debug
2022-10-13 23:49:35 -06:00
########################################################################################################################
# Backend
########################################################################################################################
2023-05-12 15:34:27 -06:00
.PHONY : clean -backend
clean-backend :
2022-10-13 23:49:35 -06:00
go clean
2023-05-12 15:34:27 -06:00
.PHONY : dep -backend
dep-backend :
2024-01-24 20:01:33 -07:00
go mod tidy && go mod vendor
2022-10-13 23:49:35 -06:00
2024-01-16 22:13:52 -07:00
2023-05-12 15:34:27 -06:00
.PHONY : test -backend
test-backend : dep -backend
2022-10-13 23:49:35 -06:00
go vet ./...
go test -v ./...
2023-05-12 15:34:27 -06:00
.PHONY : test -backend -coverage
test-backend-coverage : dep -backend
2022-10-13 23:49:35 -06:00
go test -coverprofile= backend-coverage.txt -covermode= atomic -v ./...
2024-01-16 22:13:52 -07:00
.PHONY : generate -backend
generate-backend :
go generate ./...
tygo generate
2022-10-13 23:49:35 -06:00
########################################################################################################################
# Frontend
########################################################################################################################
2023-05-12 15:34:27 -06:00
.PHONY : dep -frontend
dep-frontend :
2023-09-10 12:47:38 -06:00
cd frontend && yarn install --frozen-lockfile --network-timeout 1000000
2022-10-13 23:49:35 -06:00
2023-05-12 15:34:27 -06:00
.PHONY : build -frontend -sandbox
build-frontend-sandbox : dep -frontend
2023-08-27 14:56:17 -06:00
cd frontend && yarn build -- -c sandbox
2023-01-26 04:08:13 -07:00
2023-05-12 15:34:27 -06:00
.PHONY : build -frontend -prod
build-frontend-prod : dep -frontend
2023-08-27 14:56:17 -06:00
cd frontend && yarn build -- -c prod
2023-08-29 17:36:06 -06:00
.PHONY : build -frontend -desktop -sandbox
build-frontend-desktop-sandbox : dep -frontend
2023-08-28 17:23:29 -06:00
cd frontend && yarn build -- -c desktop_sandbox
2023-08-27 14:56:17 -06:00
2023-08-29 17:15:56 -06:00
.PHONY : build -frontend -desktop -prod
build-frontend-desktop-prod : dep -frontend
cd frontend && yarn build -- -c desktop_prod
2024-01-16 22:13:52 -07:00
.PHONY : build -frontend -offline -sandbox
build-frontend-offline-sandbox : dep -frontend
cd frontend && yarn build -- -c offline_sandbox
2023-01-26 04:08:13 -07:00
2023-05-12 15:34:27 -06:00
.PHONY : test -frontend
2022-10-13 23:49:35 -06:00
# reduce logging, disable angular-cli analytics for ci environment
2023-05-12 15:34:27 -06:00
test-frontend : dep -frontend
2022-10-14 10:04:24 -06:00
cd frontend && npx ng test --watch= false
2022-10-14 09:51:34 -06:00
2023-05-12 15:34:27 -06:00
.PHONY : test -frontend -coverage
2022-10-14 09:51:34 -06:00
# reduce logging, disable angular-cli analytics for ci environment
2023-05-12 15:34:27 -06:00
test-frontend-coverage : dep -frontend
2022-10-14 10:04:24 -06:00
cd frontend && npx ng test --watch= false --code-coverage
2022-10-14 10:09:16 -06:00
2023-05-12 15:34:27 -06:00
.PHONY : test -frontend -coverage -ci
2022-10-14 10:09:16 -06:00
# reduce logging, disable angular-cli analytics for ci environment
2023-05-12 15:34:27 -06:00
test-frontend-coverage-ci : dep -frontend
2022-10-14 10:19:51 -06:00
cd frontend && npx ng test --watch= false --code-coverage --browsers= ChromeHeadlessCI
2023-09-05 21:30:21 -06:00
.PHONY : test -frontend -storybook
test-frontend-storybook :
cd frontend && ng run fastenhealth:storybook