-
Notifications
You must be signed in to change notification settings - Fork 171
/
Makefile
30 lines (21 loc) · 973 Bytes
/
Makefile
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
YARN ?= $(shell which yarn)
PKG ?= $(if $(YARN),$(YARN),$(shell which npm))
.PHONY: help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: package.json ## Install dependencies
@$(PKG) install
watch: ## continuously compile ES6 files to JS
@yarn vite build --watch
test: ## Launch unit tests
@NODE_ENV=test NODE_OPTIONS="$$NODE_OPTIONS --experimental-vm-modules" ./node_modules/.bin/jest
watch-test: ## Launch unit tests and watch for changes
@NODE_ENV=test NODE_OPTIONS="$$NODE_OPTIONS --experimental-vm-modules" ./node_modules/.bin/jest --watch
format: ## Format the source code
@./node_modules/.bin/eslint --fix ./src
run: ## Launch server with example data
@node ./bin/json-graphql-server.cjs example/data.js
build: ## Build production release
@yarn vite build
@yarn vite build -c ./vite.config.node.js
@yarn vite build -c ./vite.config.umd.js