Skip to content

Commit 1bbac69

Browse files
arbrandesclaude
andcommitted
feat!: convert to frontend-base application
Follows the frontend-base migration how-to to turn this template into a library that plugs into the Open edX frontend shell, rather than a standalone webpack-bundled MFE. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ba3ee05 commit 1bbac69

57 files changed

Lines changed: 6451 additions & 7936 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 0 additions & 24 deletions
This file was deleted.

.env.development

Lines changed: 0 additions & 25 deletions
This file was deleted.

.env.test

Lines changed: 0 additions & 22 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
run: npm run test
2828
- name: Build
2929
run: npm run build
30+
- name: Build (CI)
31+
run: npm run build:ci
3032
- name: i18n_extract
3133
run: npm run i18n_extract
3234
- name: Coverage

.gitignore

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
.DS_Store
2-
.eslintcache
3-
.idea
41
node_modules
52
npm-debug.log
63
coverage
7-
module.config.js
8-
94
dist/
10-
src/i18n/transifex_input.json
11-
temp/babel-plugin-react-intl
5+
packages/
6+
/.turbo
7+
/turbo.json
8+
/*.tgz
129

13-
### pyenv ###
14-
.python-version
10+
### i18n ###
11+
src/i18n/transifex_input.json
12+
src/i18n/messages.ts
13+
src/i18n/messages/
1514

16-
### Emacs ###
15+
### Editors ###
16+
.DS_Store
1717
*~
1818
/temp
1919
/.vscode
20-
21-
webpack.dev-tutor.config.js

.npmignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
.eslintignore
2-
.eslintrc.json
3-
.gitignore
4-
.travis.yml
5-
docker-compose.yml
6-
Dockerfile
7-
Makefile
8-
npm-debug.log
9-
10-
coverage
111
node_modules
12-
public

.stylelintrc.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

Makefile

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
intl_imports = ./node_modules/.bin/intl-imports.js
2-
transifex_utils = ./node_modules/.bin/transifex-utils.js
1+
TURBO = TURBO_TELEMETRY_DISABLED=1 turbo --dangerously-disable-package-manager-check
32
i18n = ./src/i18n
4-
transifex_input = $(i18n)/transifex_input.json
5-
6-
# This directory must match .babelrc .
7-
transifex_temp = ./temp/babel-plugin-formatjs
83

94
precommit:
105
npm run lint
@@ -13,32 +8,55 @@ precommit:
138
requirements:
149
npm ci
1510

16-
i18n.extract:
17-
# Pulling display strings from .jsx files into .json files...
18-
rm -rf $(transifex_temp)
19-
npm run-script i18n_extract
11+
# turbo.site.json is the standalone turbo config for this package. It is
12+
# renamed to avoid conflicts with turbo v2's workspace validation, which
13+
# rejects root task syntax (//#) and requires "extends" in package-level
14+
# turbo.json files, such as when running in a site repository. The targets
15+
# below copy it into place before running turbo and clean up after.
16+
turbo.json: turbo.site.json
17+
cp $< $@
18+
19+
# NPM doesn't bin-link workspace packages during install, so it must be done manually.
20+
bin-link:
21+
[ -f packages/frontend-base/package.json ] && npm rebuild --ignore-scripts @openedx/frontend-base || true
22+
23+
build-packages: turbo.json
24+
$(TURBO) run build; rm -f turbo.json
25+
$(MAKE) bin-link
2026

21-
i18n.concat:
22-
# Gathering JSON messages into one file...
23-
$(transifex_utils) $(transifex_temp) $(transifex_input)
27+
clean-packages: turbo.json
28+
$(TURBO) run clean; rm -f turbo.json
2429

25-
extract_translations: | requirements i18n.extract i18n.concat
30+
dev-packages: build-packages turbo.json
31+
$(TURBO) run watch:build dev:site; rm -f turbo.json
32+
33+
dev-site: bin-link
34+
npm run dev
35+
36+
extract_translations: | requirements
37+
npm run i18n_extract
2638

2739
# Despite the name, we actually need this target to detect changes in the incoming translated message files as well.
2840
detect_changed_source_translations:
2941
# Checking for changed translations...
3042
git diff --exit-code $(i18n)
3143

3244
# Pulls translations using atlas.
33-
pull_translations:
34-
mkdir src/i18n/messages
35-
cd src/i18n/messages \
36-
&& atlas pull $(ATLAS_OPTIONS) \
37-
translations/frontend-platform/src/i18n/messages:frontend-platform \
38-
translations/paragon/src/i18n/messages:paragon \
39-
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
40-
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
41-
translations/frontend-template-application/src/i18n/messages:frontend-template-application
42-
43-
$(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-template-application
44-
45+
pull_translations: | requirements
46+
npm run translations:pull -- --atlas-options="$(ATLAS_OPTIONS)"
47+
48+
clean:
49+
rm -rf dist
50+
51+
build:
52+
tsc --project tsconfig.build.json
53+
find src -type f \( -name '*.scss' -o -path '*/assets/*' \) -exec sh -c '\
54+
for f in "$$@"; do \
55+
d="dist/$${f#src/}"; \
56+
mkdir -p "$$(dirname "$$d")"; \
57+
cp "$$f" "$$d"; \
58+
done' sh {} +
59+
tsc-alias -p tsconfig.build.json
60+
61+
build-ci:
62+
SITE_CONFIG_PATH=site.config.ci.tsx openedx build

0 commit comments

Comments
 (0)