From afbaa08de1290d105e1a02c233e2b7c99d13c3be Mon Sep 17 00:00:00 2001 From: erseco Date: Tue, 9 Jun 2026 21:59:41 +0100 Subject: [PATCH] feat(playground): overlay the editor at boot instead of baking it in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The playground preview zip no longer bundles the ~73MB eXeLearning editor. Instead the blueprint installs the lean app and overlays the upstream editor release at boot via the new `unzip` step (mirroring the Moodle/WP playgrounds), keeping the preview zip small and the editor a shared upstream artifact. - blueprint.json: add an `unzip` step that extracts the upstream editor into the installed app's js/editor/ (strips the 'static/' wrapper), pinned to .editor-version. - playground-preview.yml: drop the `make download-editor` step so package-zip ships without js/editor/; report the overlaid editor version from .editor-version. - auto-release.yml: keep the blueprint's editor URL in sync with .editor-version on each bump (sed, committed with the marker). Production (release.yml / auto-release.yml) still bakes the editor into the appstore tarball — EditorController serves it disk-only with no runtime download. --- .github/workflows/auto-release.yml | 10 +++++++- .github/workflows/playground-preview.yml | 32 ++++++++++-------------- blueprint.json | 6 +++++ 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 43d3a7f..a7b47db 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -158,8 +158,16 @@ jobs: run: | set -euo pipefail echo "${TAG}" > .editor-version + # Keep the playground blueprint's editor overlay URL in sync with the + # bundled editor version (blueprint.json's `unzip` step pulls the + # upstream editor release; production still bakes it from this marker). + sed -i -E \ + -e "s#(release=)v[0-9][0-9A-Za-z.-]*#\1${TAG}#g" \ + -e "s#(releases/download/)v[0-9][0-9A-Za-z.-]*#\1${TAG}#g" \ + -e "s#(exelearning-static-)v[0-9][0-9A-Za-z.-]*(\.zip)#\1${TAG}\2#g" \ + blueprint.json git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add .editor-version + git add .editor-version blueprint.json git commit -m "chore: bump bundled eXeLearning editor to ${TAG}" git push diff --git a/.github/workflows/playground-preview.yml b/.github/workflows/playground-preview.yml index ef5f352..fd33b95 100644 --- a/.github/workflows/playground-preview.yml +++ b/.github/workflows/playground-preview.yml @@ -1,9 +1,11 @@ name: Playground preview -# Builds the app — plus the prebuilt eXeLearning static editor, *downloaded* -# from the editor's latest release rather than compiled here — into a ZIP the -# Nextcloud Playground installs in the browser via the blueprint `installApp` -# step. +# Builds the app (WITHOUT the editor) into a ZIP the Nextcloud Playground +# installs in the browser via the blueprint `installApp` step. The eXeLearning +# static editor is NOT baked into this zip — the blueprint overlays it at boot +# with an `unzip` step that pulls the shared upstream editor release (the same +# artifact the Moodle/WP playgrounds use), keeping this preview zip lean. +# Production releases (release.yml / auto-release.yml) still bake the editor in. # # - push to main -> refresh the rolling `playground` prerelease asset # (exelearning.zip) that blueprint.json points at, so the @@ -65,25 +67,17 @@ jobs: echo "version=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" fi - # Resolve the latest *stable* eXeLearning editor tag once, so the - # download and the version reported in the PR comment stay in sync. + # The editor is overlaid by the blueprint at boot (not baked into this + # zip), pinned to .editor-version and kept in sync with the upstream tag by + # auto-release.yml. Read it here so the PR comment reports the version the + # preview actually loads. - name: Resolve eXeLearning editor version id: editor - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - REF=$(gh api repos/exelearning/exelearning/releases/latest --jq '.tag_name') + REF=$(tr -d '[:space:]' < .editor-version) echo "ref=$REF" >> "$GITHUB_OUTPUT" - echo "eXeLearning editor: $REF" - - # Pulls the prebuilt static editor from that release (e.g. - # exelearning-static-vX.Y.Z.zip) into js/editor/ — no bun build. - # `make package-zip` then bundles it. `clean` keeps js/editor/. - - name: Download the eXeLearning static editor - env: - EXELEARNING_EDITOR_REF: ${{ steps.editor.outputs.ref }} - run: make download-editor + echo "eXeLearning editor (overlaid at boot): $REF" - name: Build the playground ZIP run: | @@ -149,7 +143,7 @@ jobs: 'Two sample `.elpx` are seeded under `exelearning-samples/` in Files — ' + 'click one to open the viewer.', '', - `Bundled eXeLearning editor: \`${editor}\` (latest stable release).`, + `eXeLearning editor: \`${editor}\` (overlaid at boot from the upstream release).`, ].join('\n'); const { owner, repo } = context.repo; const issue_number = context.payload.pull_request.number; diff --git a/blueprint.json b/blueprint.json index ea29809..dcb49bb 100644 --- a/blueprint.json +++ b/blueprint.json @@ -24,6 +24,12 @@ "appId": "exelearning", "url": "https://zip-proxy.erseco.workers.dev/?repo=exelearning/nextcloud-exelearning&release=playground&asset=exelearning.zip" }, + { + "step": "unzip", + "comment": "Overlay the eXeLearning static editor from the upstream release instead of baking it into the app zip (the playground build ships without js/editor/). Same shared artifact the Moodle/WP playgrounds use, fetched through the github-proxy (CORS) and extracted into the installed app's js/editor/. The asset wraps everything in a 'static/' folder, which the unzip step strips. Pinned to .editor-version for deterministic previews; auto-release.yml keeps this URL in sync. Production (release.yml/auto-release.yml) still bakes the editor in.", + "url": "https://github-proxy.exelearning.dev/?repo=exelearning/exelearning&release=v4.0.1&asset=exelearning-static-v4.0.1.zip", + "destination": "apps/exelearning/js/editor" + }, { "step": "writeFile", "path": "config/mimetypemapping.json",