Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to
- Add Offer rules to ProductRelationSerializer
- Add cron task to sync offering rules
- Language tab for offering rule
- Add make rules to make front dev easier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Add make rules to make front dev easier
- Add make rules to improve experience of frontend developments


### Changed

Expand Down
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,33 @@ help:
@echo "Please use 'make $(BOLD)target$(RESET)' where $(BOLD)target$(RESET) is one of:"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(GREEN)%-30s$(RESET) %s\n", $$1, $$2}'
.PHONY: help

lint-front: ## run all front-end "linters"
lint-front: \
lint-front-eslint \
lint-front-prettier
.PHONY: lint-front

lint-front-prettier: ## run prettier over js/jsx/json/ts/tsx files -- beware! overwrites files
@$(ADMIN_YARN) prettier-write
.PHONY: lint-front-prettier

lint-front-eslint: ## lint TypeScript sources
@$(ADMIN_YARN) lint
.PHONY: lint-front-eslint

test-front: ## run front-end tests, or specific test like `make test-front js/components/CourseRunEnrollment`
@args="$(filter-out $@,$(MAKECMDGOALS))" && \
$(ADMIN_YARN) test $${args:-${1}}
.PHONY: test-front

test-e2e-front: ## run front-end tests, or specific test like `make test-e2e-front js/components/CourseRunEnrollment`
npx playwright install --with-deps chromium
NEXT_PUBLIC_API_SOURCE=test $(ADMIN_YARN) build
@args="$(filter-out $@,$(MAKECMDGOALS))" && \
$(ADMIN_YARN) test:e2e $${args:-${1}}
.PHONY: test-front

install-front: ## install front-end dependencies
@$(ADMIN_YARN) install
.PHONY: install-front
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add an extra empty line at the end of the file