Skip to content

fix: embed final editor version when packaging#75

Open
erseco wants to merge 1 commit into
mainfrom
fix/embed-editor-version
Open

fix: embed final editor version when packaging#75
erseco wants to merge 1 commit into
mainfrom
fix/embed-editor-version

Conversation

@erseco
Copy link
Copy Markdown
Collaborator

@erseco erseco commented May 20, 2026

Same root cause and fix as exelearning/wp-exelearning#30.

Problem

When packaging a release, the embedded eXeLearning editor reports v0.0.0-alpha instead of the final editor version (e.g. v4.0.0). The bundled dist/static/data/bundle.json and dist/static/manifest.json show v0.0.0-alpha.

Root cause

exelearning/scripts/build-static-bundle.ts resolves the version only from --version= / VERSION / APP_VERSION, and otherwise falls back to v${packageJson.version} = 0.0.0-alpha. It does not derive the version from the git tag.

The build-editor target in the Makefile ran bun run build:static without passing any of those variables, so it always produced 0.0.0-alpha. In addition, release.yml built the editor from main instead of the matching tag.

Changes

  • Makefile (build-editor): resolves APP_VERSION (order: APP_VERSIONVERSIONEXELEARNING_EDITOR_REF env/.env → exact git tag of the editor checkout → empty for local dev) and passes it to build:static.
  • .github/workflows/release.yml: on the release event, builds the editor from the matching editor tag (vX.Y.Z) instead of main.
  • .github/workflows/check-editor-releases.yml: passes APP_VERSION explicitly.

Verification

EXELEARNING_EDITOR_REF=v4.0.0 EXELEARNING_EDITOR_REF_TYPE=tag make build-editor
# [Version] Input: v4.0.0 (APP_VERSION env) → Output: v4.0.0
grep '"version"' dist/static/data/bundle.json   # → "version": "v4.0.0"
grep name dist/static/manifest.json             # → "eXeLearning Editor (v4.0.0)"

Local build without variables (dev) still works with its alpha/nightly fallback.


Moodle Playground Preview

The changes in this pull request can be previewed and tested using a Moodle Playground instance.

Preview in Moodle Playground

⚠️ The embedded eXeLearning editor is not included in this preview. You can install it from Modules > eXeLearning SCORM > Configure using the "Download & Install Editor" button. All other module features (ELPX upload, viewer, preview) work normally.

…rning#30)

The static editor build (build-static-bundle.ts) resolves its version from
APP_VERSION/VERSION env vars and otherwise falls back to package.json
(0.0.0-alpha). The Makefile build-editor target ran the build without passing
any version, so packaged releases shipped the editor as v0.0.0-alpha.

- Makefile: resolve APP_VERSION (APP_VERSION -> VERSION ->
  EXELEARNING_EDITOR_REF -> exact git tag) and pass it to build:static.
- release.yml: build the editor from the matching editor tag (vX.Y.Z) instead
  of main, so releases embed the final editor version.
- check-editor-releases.yml: pass APP_VERSION explicitly.

Same root cause and fix as exelearning/wp-exelearning#30.
@erseco erseco self-assigned this May 20, 2026
@erseco erseco requested review from ignaciogros and pabloamayab May 20, 2026 19:25
@erseco erseco added the bug Something isn't working label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant