57 lines
1.8 KiB
Makefile
57 lines
1.8 KiB
Makefile
npm-install-%: ## install specified % npm package
|
|
npm ci $* --save-dev
|
|
git add package.json
|
|
|
|
intl_imports = ./node_modules/.bin/intl-imports.js
|
|
transifex_utils = ./node_modules/.bin/transifex-utils.js
|
|
i18n = ./src/i18n
|
|
transifex_input = $(i18n)/transifex_input.json
|
|
|
|
# This directory must match .babelrc .
|
|
transifex_temp = ./temp/babel-plugin-formatjs
|
|
|
|
NPM_TESTS=build i18n_extract lint test is-es5
|
|
|
|
.PHONY: test
|
|
test: $(addprefix test.npm.,$(NPM_TESTS)) ## validate ci suite
|
|
|
|
.PHONY: test.npm.*
|
|
test.npm.%: validate-no-uncommitted-package-lock-changes
|
|
test -d node_modules || $(MAKE) requirements
|
|
npm run $(*)
|
|
|
|
.PHONY: requirements
|
|
requirements: ## install ci requirements
|
|
npm ci
|
|
|
|
i18n.extract:
|
|
# Pulling display strings from .jsx files into .json files...
|
|
rm -rf $(transifex_temp)
|
|
npm run-script i18n_extract
|
|
|
|
i18n.concat:
|
|
# Gathering JSON messages into one file...
|
|
$(transifex_utils) $(transifex_temp) $(transifex_input)
|
|
|
|
extract_translations: | requirements i18n.extract i18n.concat
|
|
|
|
|
|
# Experimental: OEP-58 Pulls translations using atlas
|
|
pull_translations:
|
|
rm -rf src/i18n/messages
|
|
mkdir src/i18n/messages
|
|
cd src/i18n/messages \
|
|
&& atlas pull $(ATLAS_OPTIONS) \
|
|
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
|
|
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
|
|
translations/frontend-platform/src/i18n/messages:frontend-platform \
|
|
translations/paragon/src/i18n/messages:paragon \
|
|
translations/frontend-app-gradebook/src/i18n/messages:frontend-app-gradebook
|
|
|
|
$(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-app-gradebook
|
|
|
|
# This target is used by CI.
|
|
validate-no-uncommitted-package-lock-changes:
|
|
# Checking for package-lock.json changes...
|
|
git diff --exit-code package-lock.json
|