forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
226 lines (164 loc) · 5.51 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
220
221
222
223
224
225
226
FLOW_COMMIT = 92bbb5e9dacb8185aa73ea343954d0434b42c40b
TEST262_COMMIT = dc1dc28aa46d9457e47550b34e6f25a8b80de826
TYPESCRIPT_COMMIT = ce85d647ef88183c019588bcf398320ce29b625a
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
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-ci
check-compat-data-ci: check-compat-data
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-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 BABEL_COVERAGE=true $(MAKE) bootstrap
BABEL_ENV=test BABEL_COVERAGE=true $(YARN) jest --maxWorkers=100% --ci --coverage
bootstrap-flow:
rm -rf build/flow
mkdir -p build
git clone --filter=blob:none --sparse --single-branch --shallow-since=2021-05-01 https://github.com/facebook/flow.git build/flow
cd build/flow && git sparse-checkout set "src/parser/test/flow"
cd build/flow && git checkout -q $(FLOW_COMMIT)
test-flow:
$(NODE) scripts/parser-tests/flow
test-flow-update-allowlist:
$(NODE) scripts/parser-tests/flow --update-allowlist
bootstrap-typescript:
rm -rf ./build/typescript
mkdir -p ./build
git clone --filter=blob:none --sparse --single-branch --shallow-since=2022-04-01 https://github.com/microsoft/TypeScript.git ./build/typescript
cd build/typescript && git sparse-checkout set "tests"
cd build/typescript && git checkout -q $(TYPESCRIPT_COMMIT)
test-typescript:
$(NODE) scripts/parser-tests/typescript
test-typescript-update-allowlist:
$(NODE) scripts/parser-tests/typescript --update-allowlist
bootstrap-test262:
rm -rf build/test262
mkdir -p build
git clone --filter=blob:none --sparse --single-branch --shallow-since=2021-05-01 https://github.com/tc39/test262.git build/test262
cd build/test262 && git sparse-checkout set "test"
cd build/test262 && git checkout -q $(TEST262_COMMIT)
test-test262:
$(NODE) scripts/parser-tests/test262
test-test262-update-allowlist:
$(NODE) scripts/parser-tests/test262 --update-allowlist
new-version-checklist:
# @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# @echo "!!!!!! !!!!!!"
# @echo "!!!!!! Write any message that should !!!!!!"
# @echo "!!!!!! block the release here !!!!!!"
# @echo "!!!!!! !!!!!!"
# @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# @exit 1
new-version:
$(MAKE) new-version-checklist
git pull --rebase
$(YARN) release-tool version -f @babel/standalone
# 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
$(YARN) release-tool publish
$(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