forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
219 lines (154 loc) · 4.38 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
FLOW_COMMIT = 105ad30f566f401db9cafcb49cd2831fb29e87c5
TEST262_COMMIT = 1a0b9d23f241abc2f0abf73cc397f3390c7d9960
TYPESCRIPT_COMMIT = d87d0adcd30ac285393bf3bfbbb4d94d50c4f3c9
SOURCES = packages codemods eslint
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
COMMA_SEPARATED_SOURCES = $(subst $(SPACE),$(COMMA),$(SOURCES))
YARN := yarn
NODE := $(YARN) node
MAKEJS := node Makefile.js
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap use-esm use-cjs
build:
$(MAKEJS) build
build-bundle:
$(MAKEJS) build-bundle
build-no-bundle:
$(MAKEJS) build-no-bundle
generate-tsconfig:
$(MAKEJS) generate-tsconfig
generate-type-helpers:
$(MAKEJS) generate-type-helpers
build-flow-typings:
$(MAKEJS) build-flow-typings
# For TypeScript older than 3.7
build-typescript-legacy-typings:
$(MAKEJS) build-typescript-legacy-typings
build-standalone:
$(MAKEJS) build-standalone
build-standalone-ci: build-no-bundle-ci
$(MAKEJS) build-standalone
prepublish-build-standalone:
$(MAKEJS) prepublish-build-standalone
build-dist: build-plugin-transform-runtime-dist
build-plugin-transform-runtime-dist:
$(MAKEJS) build-plugin-transform-runtime-dist
watch:
$(MAKEJS) watch
code-quality: tscheck lint
tscheck:
$(MAKEJS) tscheck
lint-ci: lint check-compat-data
generate-readme:
$(NODE) scripts/generators/readmes.js
lint:
$(MAKEJS) lint
fix: fix-json fix-js
fix-js:
$(MAKEJS) fix-js
fix-json:
$(MAKEJS) fix-json
clean:
$(MAKEJS) clean
test-cov:
$(MAKEJS) test-cov
test: lint test-only
clone-license:
$(MAKEJS) clone-license
prepublish-prepare-dts:
$(MAKEJS) prepublish-prepare-dts
prepublish-build:
$(MAKEJS) prepublish-build
prepublish:
$(MAKEJS) prepublish
bootstrap-only:
$(MAKEJS) bootstrap-only
bootstrap:
$(MAKEJS) bootstrap
use-cjs:
$(MAKEJS) use-cjs
use-esm:
$(MAKEJS) use-esm
clean-lib:
$(MAKEJS) clean-lib
clean-runtime-helpers:
$(MAKEJS) clean-runtime-helpers
clean-all:
$(MAKEJS) clean-all
build-no-bundle-ci: bootstrap-only
$(YARN) gulp build-dev
$(MAKE) build-flow-typings
$(MAKE) build-dist
# Does not work on Windows; use "$(YARN) jest" instead
test-only:
BABEL_ENV=test ./scripts/test.sh
$(MAKE) test-clean
check-compat-data:
cd packages/babel-compat-data; CHECK_COMPAT_DATA=true $(YARN) run build-data
build-compat-data:
cd packages/babel-compat-data; $(YARN) run build-data
update-env-corejs-fixture:
rm -rf packages/babel-preset-env/node_modules/core-js-compat
$(YARN)
$(MAKE) build-bundle
OVERWRITE=true $(YARN) jest packages/babel-preset-env
test-ci: build-standalone-ci
BABEL_ENV=test $(YARN) jest --maxWorkers=100% --ci
$(MAKE) test-clean
test-ci-coverage:
BABEL_ENV=test $(MAKE) bootstrap
BABEL_ENV=test BABEL_COVERAGE=true $(YARN) c8 jest --maxWorkers=100% --ci
rm -rf coverage/tmp
bootstrap-flow:
$(MAKEJS) bootstrap-flow
test-flow:
$(NODE) scripts/parser-tests/flow
test-flow-update-allowlist:
$(NODE) scripts/parser-tests/flow --update-allowlist
bootstrap-typescript:
$(MAKEJS) bootstrap-typescript
test-typescript:
$(NODE) scripts/parser-tests/typescript
test-typescript-update-allowlist:
$(NODE) scripts/parser-tests/typescript --update-allowlist
bootstrap-test262:
$(MAKEJS) bootstrap-test262
test-test262:
$(NODE) scripts/parser-tests/test262
test-test262-update-allowlist:
$(NODE) scripts/parser-tests/test262 --update-allowlist
new-version-checklist:
$(MAKEJS) new-version-checklist
new-version:
$(MAKEJS) new-version
new-babel-8-version:
$(MAKEJS) new-babel-8-version
new-babel-8-version-create-commit:
$(MAKEJS) new-babel-8-version-create-commit
new-babel-8-version-create-commit-ci:
$(MAKEJS) new-babel-8-version-create-commit-ci
# NOTE: Run make new-version first
publish:
@echo "Please confirm you have stopped make watch. (y)es, [N]o:"; \
read CLEAR; \
if [ "_$$CLEAR" != "_y" ]; then \
exit 1; \
fi
$(MAKE) prepublish
ifeq ("$(BABEL_8_BREAKING)", "true")
USE_ESM=true $(YARN) release-tool publish --tag next
else
$(YARN) release-tool publish
endif
$(MAKE) clean
publish-test:
ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE")
echo "You probably don't know what you are doing"
exit 1
endif
$(YARN) release-tool version $(VERSION) --all --yes --tag-version-prefix="version-e2e-test-"
$(MAKE) prepublish-build
node ./scripts/set-module-type.js clean
YARN_NPM_PUBLISH_REGISTRY=http://localhost:4873 $(YARN) release-tool publish --yes --tag-version-prefix="version-e2e-test-"
$(MAKE) clean