-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (75 loc) · 2.41 KB
/
Makefile
File metadata and controls
96 lines (75 loc) · 2.41 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.PHONY: build build-ts test types
BUILD_DIR = ./dist
TS_BUILD_DIR = ./.build
MIN_JS := dist/angular-ts.umd.min.js
GZ_JS := $(MIN_JS).gz
setup:
@rm -r ./node_modules/
@npm i
@npx playwright install
build:
@if [ -d "$(BUILD_DIR)" ]; then \
echo "Removing $(BUILD_DIR)..."; \
rm -r "$(BUILD_DIR)"; \
fi
@if [ -d "$(TS_BUILD_DIR)" ]; then \
echo "Removing $(TS_BUILD_DIR)..."; \
rm -r "$(TS_BUILD_DIR)"; \
fi
@npm i
@npm run build
build-ts:
@if [ -d "$(TS_BUILD_DIR)" ]; then \
echo "Removing $(TS_BUILD_DIR)..."; \
rm -r "$(TS_BUILD_DIR)"; \
fi
@./node_modules/.bin/tsc --project tsconfig.build.json
size:
@npm run build >/dev/null
@echo "Minified build output: $$(stat -c %s dist/angular-ts.umd.min.js) ~ $$(stat -c %s dist/angular-ts.umd.min.js | numfmt --to=iec)"
@echo "Expected gzip: $$(gzip -c dist/angular-ts.umd.min.js | wc -c) ~ $$(gzip -c dist/angular-ts.umd.min.js | wc -c | numfmt --to=iec)"
@git checkout -q $(BUILD_DIR)
@git checkout -q ./docs
@echo "Current build output: $$(stat -c %s dist/angular-ts.umd.min.js) ~ $$(stat -c %s dist/angular-ts.umd.min.js | numfmt --to=iec)"
@echo "Current gzip: $$(gzip -c dist/angular-ts.umd.min.js | wc -c) ~ $$(gzip -c dist/angular-ts.umd.min.js | wc -c | numfmt --to=iec)"
$(GZ_JS): $(MIN_JS)
@gzip -9 -c $< > $@
gzip: $(GZ_JS)
@echo "Created gzipped file: $(GZ_JS)"
size-html:
@printf 'Bundle size: <b>%s</b> Gzip size: <b>%s</b>' \
"$(shell stat -c %s dist/angular-ts.umd.min.js | numfmt --to=iec)" \
"$(shell gzip -c dist/angular-ts.umd.min.js | wc -c | numfmt --to=iec)" \
> docs/layouts/shortcodes/size-report.html
version:
@node utils/version.cjs
pretty:
@npx prettier ./ --write --cache --log-level=silent
lint:
@npx eslint ./src --fix
check:
@echo "Typechecking Js"
./node_modules/.bin/tsc
types:
@echo "Generating *.d.ts"
@npm run types
TYPEDOC_DIR = docs/static/typedoc
doc:
@rm -rf $(TYPEDOC_DIR)
@node_modules/.bin/typedoc
@npx prettier ./typedoc --write
@mv typedoc $(TYPEDOC_DIR)
serve:
@node_modules/.bin/vite --config utils/vite.config.js & \
node --watch ./utils/express.js & \
wait
prepare-release: build test check types doc pretty gzip version size-html
PLAYWRIGHT_TEST := npx playwright test
test:
@echo $(INFO) "Playwright test JS"
@$(PLAYWRIGHT_TEST)
test-ui:
@echo $(INFO) "Playwright test JS with ui"
@$(PLAYWRIGHT_TEST) --ui
hugo:
hugo server --source=docs --disableFastRender