fix: embed final editor version when packaging plugin (#30)#31
Merged
Conversation
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
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.
fbd10a3 to
24a3394
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #30
Problem
The
wp-exelearningplugin v4.0.0 was published with the embedded editor reportingv0.0.0-alpha, even though the plugin identifies itself as4.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(exelearningrepo) → editor =v4.0.0✅ (this bundle was fine)The problem was only in the
wp-exelearningpackaging, not in theexelearningrepo bundle.Root cause
exelearning/scripts/build-static-bundle.tsresolves the version only from--version=/VERSION/APP_VERSION, and otherwise falls back tov${packageJson.version}=0.0.0-alpha. It does not derive the version from the git tag.The
build-editortarget in theMakefileranbun run build:staticwithout passing any of those variables, so it always produced0.0.0-alpha. In addition,release.ymlbuilt the editor frommaininstead of the matching tag.Changes
Makefile(build-editor): resolvesAPP_VERSION(order:APP_VERSION→VERSION→EXELEARNING_EDITOR_REFenv/.env→ exact git tag of the editor checkout → empty for local dev) and passes it tobuild:static..github/workflows/release.yml: on thereleaseevent, builds the editor from the matching editor tag (vX.Y.Z) instead ofmain..github/workflows/check-editor-releases.yml: passesAPP_VERSIONexplicitly.Verification
Local build without variables (dev) still works with its alpha/nightly fallback.
Acceptance criteria
0.0.0-alphain final releases.