-
-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathMakefile
More file actions
537 lines (432 loc) · 20.6 KB
/
Copy pathMakefile
File metadata and controls
537 lines (432 loc) · 20.6 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
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
#
# Makefile
#
# this is horrible magic, we use it to open a nice welcome message for
# the user in tmux in the shell that they normally use (e.g. bash, zsh)
# https://unix.stackexchange.com/questions/352316/finding-out-the-default-shell-of-a-user-within-a-shell-script
LOGIN_SHELL = $(shell finger $(USER) | grep 'Shell:*' | cut -f3 -d ":")
# Check for the environment variable OWID_SCRIPT_SHELL and fall back to LOGIN_SHELL if not set
SCRIPT_SHELL ?= $(or $(shell echo $$OWID_SCRIPT_SHELL),$(LOGIN_SHELL))
# setting .env variables as Make variables for validate.env targets
# https://lithic.tech/blog/2020-05/makefile-dot-env/
ifneq (,$(wildcard ./.env))
include .env
endif
# .env lines with inline comments (`FOO=bar # baz`) keep the spaces before the
# `#` in the value when included by make — strip the variables we interpolate
# into container names, session names and URLs. The ifdef guards keep absent
# variables undefined so the `?=` defaults on the targets still apply.
ifdef COMPOSE_PROJECT_NAME
COMPOSE_PROJECT_NAME := $(strip $(COMPOSE_PROJECT_NAME))
endif
ifdef TMUX_SESSION_NAME
TMUX_SESSION_NAME := $(strip $(TMUX_SESSION_NAME))
endif
ifdef ADMIN_SERVER_PORT
ADMIN_SERVER_PORT := $(strip $(ADMIN_SERVER_PORT))
endif
ifdef VITE_PORT
VITE_PORT := $(strip $(VITE_PORT))
endif
ifdef WRANGLER_PORT
WRANGLER_PORT := $(strip $(WRANGLER_PORT))
endif
.PHONY: help up up.headless up.worktree setup.worktree require.worktree up.full down down.headless down.worktree refresh refresh.wp refresh.private refresh.full migrate svgtest svgtest.reset svgtest.full svgtest.grapher-views svgtest.mdims svgtest.thumbnails svgtest.md5s bdd bdd.ui check-not-prod
help:
@echo 'Available commands:'
@echo
@echo ' GRAPHER ONLY'
@echo ' make up start dev environment via docker-compose and tmux'
@echo ' make up.headless start dev environment without tmux (AI agents, cloud sandboxes, CI)'
@echo ' make up.worktree start this git worktree'"'"'s dev environment next to your main one'
@echo ' make setup.worktree only write this checkout'"'"'s .env (random free ports, own tmux session)'
@echo ' make down stop any services still running'
@echo ' make down.headless stop services started by make up.headless'
@echo ' make down.worktree stop services started by make up.worktree (leaves MySQL up)'
@echo ' make refresh (while up) download a new grapher snapshot and update MySQL'
@echo ' make refresh.private (while up) download and load the private sidecar dump: admin keys + analytics (needs access)'
@echo ' make refresh.full (while up) run refresh and refresh.private'
@echo ' make migrate (while up) run any outstanding db migrations'
@echo ' make test run full suite (except db tests) of CI checks including unit tests'
@echo ' make dbtest run db test suite that needs a running mysql db'
@echo ' make playwright-browsers install Playwright browsers'
@echo ' make bdd (while up) start BDD test environment'
@echo ' make bdd.ui (while up) start BDD test environment with UI'
@echo ' make svgtest run the SVG tests for graphers'
@echo ' make svgtest.full run the SVG tests for all suites'
@echo ' make local-bake do a full local site bake'
@echo ' make archive create an archived version of our charts'
@echo ' make wikipedia-archive create a Wikipedia archive (strips GTM, rewrites archive URLs)'
@echo
@echo ' GRAPHER + CLOUDFLARE (staff-only)'
@echo ' make up.full start dev environment via docker-compose and tmux'
@echo ' make update.chart-entities update the charts_x_entities join table'
@echo ' make reindex reindex (or initialise) search in Algolia'
@echo ' make bench.search run search benchmarks'
@echo ' make sync-cloudflare-images sync Cloudflare Images with local DB'
up: export DEBUG = 'knex:query'
up: export COMPOSE_PROJECT_NAME ?= owid-grapher
up: export TMUX_SESSION_NAME ?= grapher
up: export ADMIN_SERVER_PORT ?= 3030
up: export VITE_PORT ?= 8090
up: require create-if-missing.env tmp-downloads/owid_metadata.sql.gz node_modules
@make validate.env
@make check-port-3306
@if tmux has-session -t $(TMUX_SESSION_NAME) 2>/dev/null; then \
echo '==> Killing existing tmux session'; \
tmux kill-session -t $(TMUX_SESSION_NAME); \
fi
@echo '==> Starting dev environment'
@mkdir -p logs
tmux new-session -s $(TMUX_SESSION_NAME) \
-n docker 'COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker compose -f docker-compose.grapher.yml up' \; \
set remain-on-exit on \; \
set-option -g default-shell $(SCRIPT_SHELL) \; \
new-window -n admin \
'ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) devTools/docker/wait-for-mysql.sh && ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) VITE_PORT=$(VITE_PORT) yarn startAdminDevServer' \; \
set remain-on-exit on \; \
new-window -n vite 'VITE_PORT=$(VITE_PORT) yarn run startSiteFront' \; \
set remain-on-exit on \; \
new-window -n welcome 'ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) VITE_PORT=$(VITE_PORT) devTools/docker/banner.sh; exec $(LOGIN_SHELL)' \; \
bind R respawn-pane -k \; \
bind X kill-pane \; \
bind Q kill-server \; \
set -g mouse on \
|| make down
up.devcontainer: export TMUX_SESSION_NAME ?= grapher
up.devcontainer: export ADMIN_SERVER_PORT ?= 3030
up.devcontainer: export VITE_PORT ?= 8090
up.devcontainer: create-if-missing.env.devcontainer tmp-downloads/owid_metadata.sql.gz node_modules
@make validate.env
@make check-port-3306
@echo '==> Starting dev environment'
@mkdir -p logs
tmux new-session -s $(TMUX_SESSION_NAME) \
-n admin \
'ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) devTools/docker/wait-for-mysql.sh && ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) VITE_PORT=$(VITE_PORT) yarn startAdminDevServer' \; \
set remain-on-exit on \; \
new-window -n vite 'VITE_PORT=$(VITE_PORT) yarn run startSiteFront' \; \
set remain-on-exit on \; \
new-window -n welcome 'ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) VITE_PORT=$(VITE_PORT) devTools/docker/banner.sh; exec $(LOGIN_SHELL)' \; \
bind R respawn-pane -k \; \
bind X kill-pane \; \
bind Q kill-server
# Headless variant of `make up` for environments without a terminal to attach
# tmux to (AI agents, cloud sandboxes, CI) — see the script for details.
up.headless: require.headless create-if-missing.env node_modules
@make validate.env
@./devTools/docker/up-headless.sh
down.headless:
@./devTools/docker/down-headless.sh
require.headless:
@echo '==> Checking your environment has the necessary commands...'
@which docker >/dev/null 2>&1 || (echo "ERROR: docker compose is required."; exit 1)
@which yarn >/dev/null 2>&1 || (echo "ERROR: yarn is required."; exit 1)
# `setup.worktree` writes the .env this reads, so don't export ports here: make
# includes .env when it parses this file, i.e. before that .env exists on a
# freshly created worktree. up-worktree.sh sources it once it is there.
up.worktree: require.worktree setup.worktree node_modules
@make validate.env
@./devTools/docker/up-worktree.sh
setup.worktree:
@./devTools/docker/setup-worktree-env.sh
down.worktree: TMUX_SESSION_NAME ?= grapher-$(notdir $(CURDIR))
down.worktree:
@echo '==> Killing the $(TMUX_SESSION_NAME) tmux session'
@tmux kill-session -t $(TMUX_SESSION_NAME) 2>/dev/null || echo ' (no such session, nothing to stop)'
@echo '==> Leaving MySQL up, your other checkouts share it (stop it with `make down`)'
require.worktree: require.headless
@which tmux >/dev/null 2>&1 || (echo "ERROR: tmux is required."; exit 1)
up.full: export DEBUG = 'knex:query'
up.full: export COMPOSE_PROJECT_NAME ?= owid-grapher
up.full: export TMUX_SESSION_NAME ?= grapher
up.full: export ADMIN_SERVER_PORT ?= 3030
up.full: export VITE_PORT ?= 8090
up.full: export WRANGLER_PORT ?= 8788
up.full: require create-if-missing.env.full tmp-downloads/owid_metadata.sql.gz node_modules
@make validate.env.full
@make check-port-3306
@if tmux has-session -t $(TMUX_SESSION_NAME) 2>/dev/null; then \
echo '==> Killing existing tmux session'; \
tmux kill-session -t $(TMUX_SESSION_NAME); \
fi
@echo '==> Starting dev environment'
tmux new-session -s $(TMUX_SESSION_NAME) \
-n docker 'COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker compose -f docker-compose.grapher.yml up' \; \
set remain-on-exit on \; \
set-option -g default-shell $(SCRIPT_SHELL) \; \
new-window -n admin \
'ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) devTools/docker/wait-for-mysql.sh && ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) VITE_PORT=$(VITE_PORT) yarn startAdminDevServer' \; \
set remain-on-exit on \; \
new-window -n vite 'VITE_PORT=$(VITE_PORT) yarn run startSiteFront' \; \
set remain-on-exit on \; \
new-window -n functions 'WRANGLER_PORT=$(WRANGLER_PORT) yarn startLocalCloudflareFunctions' \; \
set remain-on-exit on \; \
new-window -n bespoke 'yarn startBespokeDevServer' \; \
set remain-on-exit on \; \
new-window -n welcome 'ADMIN_SERVER_PORT=$(ADMIN_SERVER_PORT) VITE_PORT=$(VITE_PORT) WRANGLER_PORT=$(WRANGLER_PORT) devTools/docker/banner.sh --full; exec $(LOGIN_SHELL)' \; \
bind R respawn-pane -k \; \
bind X kill-pane \; \
bind Q kill-server \; \
set -g mouse on \
|| make down
migrate: node_modules
@echo '==> Running DB migrations'
yarn runDbMigrations
refresh:
@make check-not-prod
@echo '==> Downloading chart data'
./devTools/docker/download-grapher-metadata-mysql.sh
@echo '==> Updating grapher database'
DATA_FOLDER=tmp-downloads ./devTools/docker/refresh-grapher-data.sh
@echo '!!! If you use ETL, wipe indicators from your R2 staging with `rclone delete r2:owid-api-staging/[yourname]/ ' \
'--fast-list --transfers 32 --checkers 32 --verbose`'
refresh.atomic:
@make check-not-prod
@echo '==> Downloading chart data'
./devTools/docker/download-grapher-metadata-mysql.sh
@echo '==> Downloading private sidecar dump'
./devTools/docker/download-grapher-private-mysql.sh
@echo '==> Updating grapher database (atomic swap)'
DATA_FOLDER=tmp-downloads ./devTools/docker/atomic-grapher-data.sh
@echo '!!! If you use ETL, wipe indicators from your R2 staging with `rclone delete r2:owid-api-staging/[yourname]/ ' \
'--fast-list --transfers 32 --checkers 32 --verbose`'
refresh.private:
@make check-not-prod
@echo '==> Downloading private sidecar dump'
./devTools/docker/download-grapher-private-mysql.sh
@echo '==> Refreshing private tables'
DATA_FOLDER=tmp-downloads ./devTools/docker/refresh-private-data.sh
sync-images:
@echo 'Task has been deprecated.'
bake-images:
@echo 'Task has been deprecated.'
# Only needed to run once to seed the prod DB with initially
sync-cloudflare-images: node_modules
@echo '==> Syncing images table with Cloudflare Images'
@yarn syncCloudflareImages
refresh.full: refresh refresh.private
@echo '==> Full refresh completed'
down: export COMPOSE_PROJECT_NAME ?= owid-grapher
down:
@echo '==> Stopping services'
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker compose -f docker-compose.grapher.yml down
require:
@echo '==> Checking your local environment has the necessary commands...'
@which docker >/dev/null 2>&1 || (echo "ERROR: docker compose is required."; exit 1)
@which yarn >/dev/null 2>&1 || (echo "ERROR: yarn is required."; exit 1)
@which tmux >/dev/null 2>&1 || (echo "ERROR: tmux is required."; exit 1)
@which finger >/dev/null 2>&1 || (echo "ERROR: finger is required."; exit 1)
guard-%:
@if [ -z "${${*}}" ]; then echo 'ERROR: .env variable $* not set' && exit 1; fi
create-if-missing.env:
@if test ! -f .env; then \
echo 'Copying .env.example-grapher --> .env'; \
cp .env.example-grapher .env; \
fi
create-if-missing.env.devcontainer:
@if test ! -f .env; then \
echo 'Copying .env.devcontainer --> .env'; \
cp .env.devcontainer .env; \
fi
validate.env:
@echo '==> Validating your .env file for make up'
@grep '=' .env.example-grapher | grep -v optional | sed 's/=.*//' | while read variable; \
do make guard-$$variable 2>/dev/null || exit 1; \
done
@echo '.env file valid for make up'
create-if-missing.env.full:
@if test ! -f .env; then \
echo 'Copying .env.example-full --> .env'; \
cp .env.example-full .env; \
fi
validate.env.full:
@echo '==> Validating your .env file for make up.full'
@grep '=' .env.example-full | grep -v optional | sed 's/=.*//' | while read variable; \
do make guard-$$variable 2>/dev/null || exit 1; \
done
@echo '.env file valid for make up.full'
check-port-3306:
@echo "==> Checking port"
@if [ "${GRAPHER_DB_PORT}" = "3306" ]; then \
echo "Your database port is set to 3306.\
\nThis will likely conflict with any pre-existing MySQL instances you have running.\
\nWe recommend using a different port (like 3307)";\
fi
check-not-prod:
@if grep -q "ENV=production" .env; then \
echo "ERROR: Cannot run this command in production environment."; \
exit 1; \
fi
@if [ "${GRAPHER_DB_HOST}" = "prod-db.owid.io" ]; then \
echo "ERROR: GRAPHER_DB_HOST is set to prod-db.owid.io. Refusing to run against the production database."; \
exit 1; \
fi
tmp-downloads/owid_metadata.sql.gz:
@echo '==> Downloading metadata'
./devTools/docker/download-grapher-metadata-mysql.sh
test: node_modules
@echo '==> Linting'
yarn testLint
@echo '==> Checking formatting'
yarn testFormatAll
@echo '==> Checking Raycast snippets'
yarn checkRaycastSnippets
@echo '==> Running tests'
yarn run test
dbtest: node_modules
@echo '==> Running db test script'
./db/tests/run-db-tests.sh
playwright-browsers:
@echo '==> Installing Playwright browsers'
yarn playwright install --with-deps --no-shell
bdd: export TMUX_SESSION_NAME ?= bdd
bdd: node_modules playwright-browsers
@if tmux has-session -t $(TMUX_SESSION_NAME) 2>/dev/null; then \
echo '==> Killing existing tmux session'; \
tmux kill-session -t $(TMUX_SESSION_NAME); \
fi
@echo '==> Starting BDD test environment'
@yarn bddgen
tmux new-session -s $(TMUX_SESSION_NAME) \
-n watcher 'yarn chokidar "features/**" "site/**/*.{ts,tsx}" -c "yarn bddgen"' \; \
set remain-on-exit on \; \
set-option -g default-shell $(SCRIPT_SHELL) \; \
new-window -n playwright 'PWTEST_WATCH=1 yarn playwright test' \; \
set remain-on-exit on \; \
new-window -n welcome 'devTools/docker/banner-bdd.sh; exec $(LOGIN_SHELL)' \; \
bind R respawn-pane -k \; \
bind X kill-pane \; \
bind K kill-session \; \
set -g mouse on
bdd.ui: export TMUX_SESSION_NAME ?= bdd-ui
bdd.ui: node_modules playwright-browsers
@if tmux has-session -t $(TMUX_SESSION_NAME) 2>/dev/null; then \
echo '==> Killing existing tmux session'; \
tmux kill-session -t $(TMUX_SESSION_NAME); \
fi
@echo '==> Starting BDD test environment with UI'
@yarn bddgen
tmux new-session -s $(TMUX_SESSION_NAME) \
-n watcher 'yarn chokidar "features/**" "site/**/*.{ts,tsx}" -c "yarn bddgen"' \; \
set remain-on-exit on \; \
set-option -g default-shell $(SCRIPT_SHELL) \; \
new-window -n playwright 'yarn playwright test --ui --ui-host=0.0.0.0' \; \
set remain-on-exit on \; \
new-window -n welcome 'devTools/docker/banner-bdd.sh; exec $(LOGIN_SHELL)' \; \
bind R respawn-pane -k \; \
bind X kill-pane \; \
bind K kill-session \; \
set -g mouse on
lint: node_modules
@echo '==> Linting'
yarn testLint
check-formatting: node_modules
@echo '==> Checking formatting'
yarn testFormatAll
format: node_modules
@echo '==> Fixing formatting'
yarn fixFormatAll
unittest: node_modules
@echo '==> Running tests'
yarn run test
../owid-grapher-svgs:
cd .. && git clone git@github.com:owid/owid-grapher-svgs
svgtest.reset: ../owid-grapher-svgs
@echo '==> Resetting owid-grapher-svgs repo to a clean state'
cd ../owid-grapher-svgs && git fetch && git checkout -f master && git reset --hard origin/master && git clean -fdx
svgtest: svgtest.reset node_modules
@echo '==> Running the SVG tests for graphers'
@# generate a full new set of svgs and compare them against the references
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/graphers/differences 2>/dev/null)" ]; then \
echo '==> No differences (graphers)'; \
fi
svgtest.full: svgtest.reset node_modules
@echo '==> Running all SVG test suites'
@# run test suite for stand-alone graphers
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/graphers/differences 2>/dev/null)" ]; then \
echo '==> No differences (graphers)'; \
fi
@# run test suite for grapher views
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts grapher-views || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/grapher-views/differences 2>/dev/null)" ]; then \
echo '==> No differences (grapher-views)'; \
fi
@# run test suite for mdims
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts mdims || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/mdims/differences 2>/dev/null)" ]; then \
echo '==> No differences (mdims)'; \
fi
@# run test suite for thumbnails
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts thumbnails || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/thumbnails/differences 2>/dev/null)" ]; then \
echo '==> No differences (thumbnails)'; \
fi
svgtest.grapher-views: svgtest.reset node_modules
@echo '==> Running the SVG tests for grapher-views'
@# run test suite for grapher-views
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts grapher-views || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/grapher-views/differences 2>/dev/null)" ]; then \
echo '==> No differences (grapher-views)'; \
fi
svgtest.mdims: svgtest.reset node_modules
@echo '==> Running the SVG tests for mdims'
@# run test suite for mdims
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts mdims || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/mdims/differences 2>/dev/null)" ]; then \
echo '==> No differences (mdims)'; \
fi
svgtest.thumbnails: svgtest.reset node_modules
@echo '==> Running the SVG tests for thumbnails'
@# run test suite for thumbnails
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/verify-graphs.ts thumbnails || [ $$? -eq 2 ]
@if [ -z "$$(ls -A ../owid-grapher-svgs/thumbnails/differences 2>/dev/null)" ]; then \
echo '==> No differences (thumbnails)'; \
fi
svgtest.md5s: ../owid-grapher-svgs node_modules
@echo '==> Recomputing reference md5s in ../owid-grapher-svgs'
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/update-reference-md5s.ts graphers
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/update-reference-md5s.ts grapher-views
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/update-reference-md5s.ts mdims
yarn tsx --tsconfig tsconfig.tsx.json devTools/svgTester/update-reference-md5s.ts thumbnails
node_modules: package.json yarn.lock yarn.config.cjs
@echo '==> Installing packages'
yarn install
touch -m $@
update.chart-entities: node_modules
@echo '==> Updating chart entities table'
yarn tsx --tsconfig tsconfig.tsx.json baker/updateChartEntities.js --all
reindex: node_modules
@echo '==> Reindexing search in Algolia'
@echo '--- Running configureAlgolia...'
yarn tsx --tsconfig tsconfig.tsx.json baker/algolia/configureAlgolia.js
@echo '--- Running indexPagesToAlgolia...'
yarn tsx --tsconfig tsconfig.tsx.json baker/algolia/indexPagesToAlgolia.js
@echo '--- Running indexPagesChronologicalToAlgolia...'
yarn tsx --tsconfig tsconfig.tsx.json baker/algolia/indexPagesChronologicalToAlgolia.js
@echo '--- Running indexExplorerViewsMdimViewsAndChartsToAlgolia...'
yarn tsx --tsconfig tsconfig.tsx.json baker/algolia/indexExplorerViewsMdimViewsAndChartsToAlgolia.js
index-scheduled: node_modules
@echo '==> Indexing scheduled (newly-live) gdocs into the pages-chronological Algolia index'
yarn tsx --tsconfig tsconfig.tsx.json baker/algolia/indexScheduledPagesChronologicalToAlgolia.js
delete-algolia-index: node_modules
@echo '==> Deleting Algolia index'
yarn tsx --tsconfig tsconfig.tsx.json baker/algolia/deleteAlgoliaIndex.js
bench.search: node_modules
@echo '==> Running search benchmarks'
@yarn tsx --tsconfig tsconfig.tsx.json site/search/evaluateSearch.js
local-bake: node_modules
@echo '==> Baking site'
yarn buildVite
yarn buildLocalBake
archive: node_modules
@echo '==> Creating archived page versions'
PRIMARY_ENV_FILE=.env.archive yarn buildViteArchive
PRIMARY_ENV_FILE=.env.archive yarn tsx --tsconfig tsconfig.tsx.json ./baker/archival/archiveChangedPages.ts --latestDir
wikipedia-archive: archive
@echo '==> Creating Wikipedia archive (stripping analytics, rewriting archive URLs)'
PRIMARY_ENV_FILE=.env.archive yarn tsx --tsconfig tsconfig.tsx.json ./baker/archival/createWikipediaArchive.ts
clean:
rm -rf node_modules