-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 1.67 KB
/
Copy pathMakefile
File metadata and controls
48 lines (35 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# managed-by: golden-path v1
APP_NAME := delivery-promise-components
PKG_MGR ?= yarn
VTEX_SETUP ?= vtex setup
VTEX_LINK ?= vtex link
.DEFAULT_GOAL := help
SHELL := /usr/bin/env bash
.SHELLFLAGS := -o pipefail -c
.PHONY: help dev build test coverage lint format-check check link run clean
help: ## Show available targets
@awk 'BEGIN {FS=":.*##"; printf "Targets:\n"} /^[a-zA-Z_-]+:.*##/ {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
dev: ## Install dependencies and prepare VTEX IO tooling
@command -v node >/dev/null 2>&1 || { echo "node is required"; exit 1; }
@command -v vtex >/dev/null 2>&1 || { echo "vtex CLI is required — run: npm i -g vtex"; exit 1; }
$(PKG_MGR) install --frozen-lockfile
cd react && $(PKG_MGR) install --frozen-lockfile
$(VTEX_SETUP)
build: ## Validate app build inputs without publishing
@echo "VTEX IO builds run on the platform via vtex link/publish."
@echo "Run 'make check' for local validations before linking."
test: ## Run test suite (react builder)
cd react && $(PKG_MGR) test
coverage: ## Run tests with coverage
cd react && $(PKG_MGR) test --coverage
lint: ## Run linter without auto-fix
$(PKG_MGR) lint
format-check: ## Check formatting without rewriting files
npx prettier --check "**/*.{ts,tsx,js,jsx,json}"
check: lint test ## Run all quality checks (pre-PR gate)
link: ## Link app in the active VTEX development workspace
@echo "This targets the active VTEX account/workspace. Confirm with 'vtex whoami' before running."
$(VTEX_LINK)
run: link ## Alias for the VTEX IO platform development loop
clean: ## Remove local dependencies and coverage artifacts
rm -rf node_modules react/node_modules coverage react/coverage