-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (48 loc) · 1.78 KB
/
Makefile
File metadata and controls
61 lines (48 loc) · 1.78 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
TURBO = TURBO_TELEMETRY_DISABLED=1 turbo --dangerously-disable-package-manager-check
intl_imports = ./node_modules/.bin/intl-imports.js
i18n = ./src/i18n
precommit:
npm run lint
npm audit
requirements:
npm ci
# turbo.site.json is the standalone turbo config for this package. It is
# renamed to avoid conflicts with turbo v2's workspace validation, which
# rejects root task syntax (//#) and requires "extends" in package-level
# turbo.json files, such as when running in a site repository. The targets
# below copy it into place before running turbo and clean up after.
turbo.json: turbo.site.json
cp $< $@
# NPM doesn't bin-link workspace packages during install, so it must be done manually.
bin-link:
[ -f packages/frontend-base/package.json ] && npm rebuild --ignore-scripts @openedx/frontend-base || true
build-packages: turbo.json
$(TURBO) run build; rm -f turbo.json
$(MAKE) bin-link
clean-packages: turbo.json
$(TURBO) run clean; rm -f turbo.json
dev-packages: turbo.json
$(TURBO) run watch:build dev:site; rm -f turbo.json
dev-site: bin-link
npm run dev
extract_translations: | requirements
# Pulling display strings from source files into src/i18n/transifex_input.json...
npm run i18n_extract
# Despite the name, we actually need this target to detect changes in the incoming translated message files as well.
detect_changed_source_translations:
# Checking for changed translations...
git diff --exit-code $(i18n)
# Pulls translations using atlas.
pull_translations: | requirements
npm run translations:pull
clean:
rm -rf dist
build:
tsc --project tsconfig.build.json
tsc-alias -p tsconfig.build.json
find src -type f -name '*.scss' -exec sh -c '\
for f in "$$@"; do \
d="dist/$${f#src/}"; \
mkdir -p "$$(dirname "$$d")"; \
cp "$$f" "$$d"; \
done' sh {} +