-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (51 loc) · 1.67 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
66
67
.PHONY: test test-release perf clean build build-release
TSC_OPTS = --assumeChangesOnlyAffectDirectDependencies --verbose --listEmittedFiles
log = @echo $$(tput smso)$(1)$$(tput rmso)
newtype_source_files = $(shell find src -name '*.nt')
newtype_to_typescript = $(shell find src -name '*.nt')
all: build
clean:
yarn run tsc --build --clean
rm -rf dist
newtype:
@# FIXME make this repeatable outside of my local computer
racket -l dts/main src/types.nt | prettier --parser typescript > src/types.d.ts
build: newtype
yarn tsc --build $(TSC_OPTS)
prepack: build-release test-release
build-release:
$(call log,# build-release / tsc ...)
yarn run tsc --build tsconfig-release.json ${TSC_OPTS}
$(call log,# build-release ✅)
rm dist/*/*.tsbuildinfo
test-release: \
build-release \
test-release-package-check \
test-release-cjs \
test-release-ts
$(call log,# test-release ✅)
test-release-package-check:
$(call log,# test-release / Package exports ...)
package-check
test-release-cjs:
$(call log,# test-release / CommonJS ...)
yarn workspace test-pack-commonjs install
yarn workspace test-pack-commonjs test
$(call log,# test-release / CommonJS ✅)
# FIXME: node esm support is weird
test-release-esm:
$(call log,# test-release / ESM)
yarn workspace test-pack-esm install
yarn workspace test-pack-esm test
$(call log,# test-release / ESM ✅)
test-release-ts:
$(call log,# test-release / Typescript ...)
yarn workspace test-pack-ts install
yarn workspace test-pack-ts build
yarn workspace test-pack-ts test
$(call log,# test-release / Typescript ✅)
perf: build
for file in build/perf/*.js; do node $$file; done
test:
yarn tsc --project tsconfig.json
yarn jest