* build: switch from travis to Github actions. Subsequent commits will clean up some of the 'npm-dist' code that we're no longer using. * build: remove npm distribution from repository Once upon a time, we published the components of the profile MFE to NPM because we believed we might want to embed them in frontend-app-learner-portal. We abandoned that idea about two years ago, but never cleaned up the experiment of publishing the MFE to npm. This commit does that. The prior commit on this branch disabled it by cutting over from travis to github actions - this commit just finishes the job. * fix: cleaning up a bad URL for order history. * docs: cleaning up a documentation URL in openedx.yml * fix: removing download of Roboto font None of our other MFEs do this; it was left over from an early design decision. It also doesn't appear to be having any effect, as I think this font is included via Paragon, if at all. It may also be that it's a secondary font choice after something else already available. Regardless, removing these two lines had no effect on the look and feel of the MFE, and reduces bundle size. * fix: using updated logo instead of pre-rebrand edX logo. This now uses the FAVICON_URL environment variable like all our other MFEs.
62 lines
2.1 KiB
Makefile
Executable File
62 lines
2.1 KiB
Makefile
Executable File
transifex_resource = frontend-app-profile
|
|
transifex_langs = "ar,fr,es_419,zh_CN"
|
|
|
|
transifex_utils = ./node_modules/.bin/transifex-utils.js
|
|
i18n = ./src/i18n
|
|
transifex_input = $(i18n)/transifex_input.json
|
|
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/translation/en/strings/
|
|
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/source/
|
|
|
|
# This directory must match .babelrc .
|
|
transifex_temp = ./temp/babel-plugin-react-intl
|
|
|
|
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
|
|
|
|
# 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)
|
|
|
|
# Pushes translations to Transifex. You must run make extract_translations first.
|
|
push_translations:
|
|
# Pushing strings to Transifex...
|
|
tx push -s
|
|
# Fetching hashes from Transifex...
|
|
./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1)
|
|
# Writing out comments to file...
|
|
$(transifex_utils) $(transifex_temp) --comments
|
|
# Pushing comments to Transifex...
|
|
./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2)
|
|
|
|
# Pulls translations from Transifex.
|
|
pull_translations:
|
|
tx pull -f --mode reviewed --language=$(transifex_langs)
|
|
|
|
# This target is used by Travis.
|
|
validate-no-uncommitted-package-lock-changes:
|
|
# Checking for package-lock.json changes...
|
|
git diff --exit-code package-lock.json
|