Skip to content

Commit

Permalink
Merge pull request #9 from plone/rename-makefile-targets
Browse files Browse the repository at this point in the history
Rename Makefile targets following cookiecutter-volto#14
  • Loading branch information
ericof authored May 15, 2024
2 parents 8ec6a44 + 2beb5c2 commit 54bdfbe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/frontend_addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ jobs:
with:
working-directory: frontend_addon/volto-addon
run: |
make start-test-acceptance-server-ci &
make start-test-acceptance-frontend &
make ci-acceptance-backend-start &
make acceptance-frontend-prod-start &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
Expand All @@ -165,4 +165,4 @@ jobs:
- name: Run acceptance tests
working-directory: frontend_addon/volto-addon
run: |
make test-acceptance-headless
make ci-acceptance-test
56 changes: 36 additions & 20 deletions frontend_addon/{{ cookiecutter.__folder_name }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,24 @@ DOCKER_IMAGE_ACCEPTANCE=plone/server-acceptance:${PLONE_VERSION}
ADDON_NAME='{{ cookiecutter.npm_package_name }}'

.PHONY: help
help: ## Show this help
help: ## Show this help
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"

# Dev Helpers

.PHONY: install
install: ## Install task, checks if missdev (mrs-developer) is present and runs it
install: ## Installs the add-on in a development environment
pnpm dlx mrs-developer missdev --no-config --fetch-https
pnpm i

.PHONY: start
start: ## Starts Volto, allowing reloading of the add-on during development
pnpm start

.PHONY: build
build: ## Build a production bundle for distribution of the project with the add-on
pnpm build

.PHONY: i18n
i18n: ## Sync i18n
pnpm --filter $(ADDON_NAME) i18n
Expand All @@ -47,57 +55,65 @@ format: ## Format codebase
pnpm stylelint:fix

.PHONY: lint
lint: ## Lint Codebase
lint: ## Lint, or catch and remove problems, in code base
pnpm lint
pnpm prettier
pnpm stylelint

.PHONY: release
release: ## Release the add-on on npmjs.org
pnpm release

.PHONY: release-dry-run
release-dry-run: ## Dry-run the release of the add-on on npmjs.org
pnpm release

.PHONY: test
test: ## Run unit tests
pnpm test

.PHONY: test-ci
test-ci: ## Run unit tests in CI
ci-test: ## Run unit tests in CI
CI=1 RAZZLE_JEST_CONFIG=$(CURRENT_DIR)/jest-addon.config.js pnpm --filter @plone/volto test -- --passWithNoTests

.PHONY: start-backend-docker
start-backend-docker: ## Starts a Docker-based backend for developing
.PHONY: backend-docker-start
backend-docker-start: ## Starts a Docker-based backend for development
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
docker run -it --rm --name=backend -p 8080:8080 -e SITE=Plone $(DOCKER_IMAGE)

## Storybook
.PHONY: storybook-start
storybook-start: ## Storybook: Start server on port 6006
storybook-start: ## Start Storybook server on port 6006
@echo "$(GREEN)==> Start Storybook$(RESET)"
pnpm run storybook

.PHONY: storybook-build
storybook-build: ## Storybook: Build
storybook-build: ## Build Storybook
@echo "$(GREEN)==> Build Storybook$(RESET)"
mkdir -p $(CURRENT_DIR)/.storybook-build
pnpm run build-storybook -o $(CURRENT_DIR)/.storybook-build

## Acceptance
.PHONY: start-test-acceptance-frontend-dev
start-test-acceptance-frontend-dev: ## Start acceptance frontend in dev mode
.PHONY: acceptance-frontend-dev-start
acceptance-frontend-dev-start: ## Start acceptance frontend in development mode
RAZZLE_API_PATH=http://127.0.0.1:55001/plone pnpm start

.PHONY: start-test-acceptance-frontend
start-test-acceptance-frontend: ## Start acceptance frontend in prod mode
.PHONY: acceptance-frontend-prod-start
acceptance-frontend-prod-start: ## Start acceptance frontend in production mode
RAZZLE_API_PATH=http://127.0.0.1:55001/plone pnpm build && pnpm start:prod

.PHONY: start-test-acceptance-server
start-test-acceptance-server: ## Start acceptance server
.PHONY: acceptance-backend-start
acceptance-backend-start: ## Start backend acceptance server
docker run -it --rm -p 55001:55001 $(DOCKER_IMAGE_ACCEPTANCE)

.PHONY: start-test-acceptance-server-ci
start-test-acceptance-server-ci: ## Start acceptance server in CI mode (no terminal attached)
.PHONY: ci-acceptance-backend-start
ci-acceptance-backend-start: ## Start backend acceptance server in headless mode for CI
docker run -i --rm -p 55001:55001 $(DOCKER_IMAGE_ACCEPTANCE)

.PHONY: test-acceptance
test-acceptance: ## Start Cypress in interactive mode
.PHONY: acceptance-test
acceptance-test: ## Start Cypress in interactive mode
pnpm --filter @plone/volto exec cypress open --config-file $(CURRENT_DIR)/cypress.config.js --config specPattern=$(CURRENT_DIR)'/cypress/tests/**/*.{js,jsx,ts,tsx}'

.PHONY: test-acceptance-headless
test-acceptance-headless: ## Run cypress tests in headless mode for CI
.PHONY: ci-acceptance-test
ci-acceptance-test: ## Run cypress tests in headless mode for CI
pnpm --filter @plone/volto exec cypress run --config-file $(CURRENT_DIR)/cypress.config.js --config specPattern=$(CURRENT_DIR)'/cypress/tests/**/*.{js,jsx,ts,tsx}'

0 comments on commit 54bdfbe

Please sign in to comment.