-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
65 lines (54 loc) · 1.66 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Common development tasks are typically available via npm scripts, e.g.:
# npm --workspaces install
# npm --workspaces test
# npm --workspaces lint
# npm --workspaces lint:fix
#
# This Makefile exists as a convenience, to support older Node.js versions
# (which npm <=7 when workspaces support was added), and to support some less
# common tasks.
.PHONY: all
all:
./utils/run-install.sh
.PHONY: test
test:
./utils/run-test.sh
.PHONY: tav
tav:
npm --workspaces run --if-present tav # requires npm>=7 (aka node>=16)
.PHONY: lint
lint: check-license-headers
./utils/run-lint.sh
.PHONY: fmt
fmt:
npm --workspaces run lint:fix # requires npm>=7 (aka node>=16)
.PHONY: clean
clean:
rm -rf packages/*/node_modules
rm -rf node_modules
rm -rf utils/node_modules
# Build and open the rendered docs for testing.
#
# Requirements:
# - Docker is running
# - "../docs" is an elastic/docs.git clone
# - "../ecs-logging" is an elastic/ecs-logging.git clone
.PHONY: docs-and-open
docs-and-open:
export GIT_HOME=$(shell cd .. && pwd) && \
$$GIT_HOME/docs/build_docs \
--resource $$GIT_HOME/ecs-logging/docs/ --chunk 1 --open \
--doc $$PWD/docs/index.asciidoc
# List licenses of prod deps.
.PHONY: list-licenses
list-licenses:
@for dir in helpers $(shell ls -d packages/*); do \
(cd $$dir && npm ls --prod --parseable | while read subdir; do node -e "console.log(require('$$subdir/package.json').license)"; done) \
done | sort | uniq -c | sort -n
.PHONY: check-license-headers
check-license-headers:
@bash utils/check-license-headers.sh
.PHONY: setup-pre-commit-hook
setup-pre-commit-hook:
@cp utils/pre-commit-hook.sh .git/hooks/pre-commit
@chmod 751 .git/hooks/pre-commit