Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .env

This file was deleted.

25 changes: 0 additions & 25 deletions .env.development

This file was deleted.

22 changes: 0 additions & 22 deletions .env.test

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
run: npm run test
- name: Build
run: npm run build
- name: Build (CI)
run: npm run build:ci
- name: i18n_extract
run: npm run i18n_extract
- name: Coverage
Expand Down
22 changes: 10 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
.DS_Store
.eslintcache
.idea
node_modules
npm-debug.log
coverage
module.config.js

dist/
src/i18n/transifex_input.json
temp/babel-plugin-react-intl
packages/
/.turbo
/turbo.json
/*.tgz

### pyenv ###
.python-version
### i18n ###
src/i18n/transifex_input.json
src/i18n/messages.ts
src/i18n/messages/

### Emacs ###
### Editors ###
.DS_Store
*~
/temp
/.vscode

webpack.dev-tutor.config.js
11 changes: 0 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
.eslintignore
.eslintrc.json
.gitignore
.travis.yml
docker-compose.yml
Dockerfile
Makefile
npm-debug.log

coverage
node_modules
public
35 changes: 0 additions & 35 deletions .stylelintrc.json

This file was deleted.

70 changes: 44 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
intl_imports = ./node_modules/.bin/intl-imports.js
transifex_utils = ./node_modules/.bin/transifex-utils.js
TURBO = TURBO_TELEMETRY_DISABLED=1 turbo --dangerously-disable-package-manager-check
i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json

# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-formatjs

precommit:
npm run lint
Expand All @@ -13,32 +8,55 @@ precommit:
requirements:
npm ci

i18n.extract:
# Pulling display strings from .jsx files into .json files...
rm -rf $(transifex_temp)
npm run-script i18n_extract
# 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

i18n.concat:
# Gathering JSON messages into one file...
$(transifex_utils) $(transifex_temp) $(transifex_input)
clean-packages: turbo.json
$(TURBO) run clean; rm -f turbo.json

extract_translations: | requirements i18n.extract i18n.concat
dev-packages: build-packages turbo.json
$(TURBO) run watch:build dev:site; rm -f turbo.json

dev-site: bin-link
npm run dev

extract_translations: | requirements
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:
mkdir src/i18n/messages
cd src/i18n/messages \
&& atlas pull $(ATLAS_OPTIONS) \
translations/frontend-platform/src/i18n/messages:frontend-platform \
translations/paragon/src/i18n/messages:paragon \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
translations/frontend-template-application/src/i18n/messages:frontend-template-application

$(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-template-application

pull_translations: | requirements
npm run translations:pull -- --atlas-options="$(ATLAS_OPTIONS)"

clean:
rm -rf dist

build:
tsc --project tsconfig.build.json
find src -type f \( -name '*.scss' -o -path '*/assets/*' \) -exec sh -c '\
for f in "$$@"; do \
d="dist/$${f#src/}"; \
mkdir -p "$$(dirname "$$d")"; \
cp "$$f" "$$d"; \
done' sh {} +
tsc-alias -p tsconfig.build.json

build-ci:
SITE_CONFIG_PATH=site.config.ci.tsx openedx build
Loading
Loading