Skip to content

fix: embed final editor version when packaging plugin (#30)#31

Merged
erseco merged 1 commit into
mainfrom
fix/embed-editor-version
May 20, 2026
Merged

fix: embed final editor version when packaging plugin (#30)#31
erseco merged 1 commit into
mainfrom
fix/embed-editor-version

Conversation

@erseco
Copy link
Copy Markdown
Contributor

@erseco erseco commented May 20, 2026

Closes #30

Problem

The wp-exelearning plugin v4.0.0 was published with the embedded editor reporting v0.0.0-alpha, even though the plugin identifies itself as 4.0.0.

Verified by downloading the artifacts:

  • exelearning-4.0.0.zip (WP plugin) → embedded editor = v0.0.0-alpha
  • exelearning-static-v4.0.0.zip (exelearning repo) → editor = v4.0.0 ✅ (this bundle was fine)

The problem was only in the wp-exelearning packaging, not in the exelearning repo bundle.

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.

Acceptance criteria

  • The packaged plugin no longer includes 0.0.0-alpha in final releases.
  • The embedded editor version matches the release version.
  • The packaging workflow prevents alpha/dev editor versions in final releases.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Test in WordPress Playground

Test the plugin with the code from this branch:

Preview in WordPress Playground

⚠️ The embedded eXeLearning editor is not included in this preview. You can install it from Settings > eXeLearning using the "Download & Install Editor" button. All other plugin features (ELP upload, shortcode, Gutenberg block, preview) work normally.

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 even
though the plugin was v4.0.0.

- 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 for clarity.

Verified: building from tag v4.0.0 now embeds v4.0.0 in bundle.json and
manifest.json.
@erseco erseco force-pushed the fix/embed-editor-version branch from fbd10a3 to 24a3394 Compare May 20, 2026 19:27
@erseco erseco self-assigned this May 20, 2026
@erseco erseco added the bug Something isn't working label May 20, 2026
@erseco erseco merged commit 2d51732 into main May 20, 2026
4 checks passed
@erseco erseco deleted the fix/embed-editor-version branch May 20, 2026 19:32
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.

Use the final embedded editor version when packaging the plugin

1 participant