Skip to content

Commit 0aa6796

Browse files
arbrandesclaude
andcommitted
docs: document build:ci in migration howto
Adds the build:ci npm script, the build-ci Makefile target, and a corresponding CI workflow step to the MFE migration guide, so newly migrated apps get webpack-build smoke coverage out of the box. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0ab5729 commit 0aa6796

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

docs/how_tos/migrate-frontend-app.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ With the exception of any custom scripts, replace the `scripts` section of your
139139
```json
140140
"scripts": {
141141
"build": "make build",
142+
"build:ci": "make build-ci",
142143
"clean": "make clean",
143144
"dev": "PORT=YOUR_PORT PUBLIC_PATH=/YOUR_APP_NAME openedx dev",
144145
"i18n_extract": "openedx formatjs extract",
@@ -183,10 +184,22 @@ build:
183184
cp "$$f" "$$d"; \
184185
done' sh {} +
185186
tsc-alias -p tsconfig.build.json
187+
188+
build-ci:
189+
SITE_CONFIG_PATH=site.config.dev.tsx openedx build
186190
```
187191

188192
Note that the `find` command copies all files under `assets/` directories regardless of type, so you don't need to enumerate asset extensions. Also note that `tsc-alias` runs after the copy step so that it can resolve `@src` aliases pointing to asset files. If it ran before, it wouldn't find them and would omit them from the relative path conversion.
189193

194+
The `build-ci` target is separate from `build` because apps are distributed build-less: `build` compiles only the library `dist/` via `tsc`, which doesn't verify that the app can actually be webpack-bundled as a deployable site. `build:ci` runs `openedx build` against `site.config.dev.tsx` (which imports the real app) so webpack traverses the actual app graph, catching errors such as broken imports in lazy-loaded routes that neither `tsc` nor Jest would surface. Reusing `site.config.dev.tsx` is important because `site.config.test.tsx` typically registers an inline app stub for Jest's sake and therefore never pulls the real app into the webpack graph. The dev config's URLs and `environment` value are inert at build time, since nothing executes the produced bundle.
195+
196+
Add a corresponding step to your GitHub Actions workflow after the existing build step, so CI fails on any breakage that would only surface at webpack bundle time:
197+
198+
```yaml
199+
- name: Build (CI)
200+
run: npm run build:ci
201+
```
202+
190203
Other package.json edits
191204
------------------------
192205

0 commit comments

Comments
 (0)