From da664849fcb12b5c0d1cc6866b0702c945cd976e Mon Sep 17 00:00:00 2001 From: Peter Muessig Date: Wed, 11 Nov 2026 22:08:09 +0100 Subject: [PATCH] fix(showcase): align CDN framework for native HTML demo --- .changeset/old-jobs-scream.md | 2 ++ packages/jsx-runtime-showcase/package.json | 5 +++-- .../scripts/check-framework-version.mjs | 19 +++++++++++++++++++ packages/jsx-runtime-showcase/ui5-dist.yaml | 3 ++- .../jsx-runtime-showcase/webapp/index.html | 4 ++-- 5 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 .changeset/old-jobs-scream.md create mode 100644 packages/jsx-runtime-showcase/scripts/check-framework-version.mjs diff --git a/.changeset/old-jobs-scream.md b/.changeset/old-jobs-scream.md new file mode 100644 index 0000000..a845151 --- /dev/null +++ b/.changeset/old-jobs-scream.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/jsx-runtime-showcase/package.json b/packages/jsx-runtime-showcase/package.json index bd17d29..b4e3604 100644 --- a/packages/jsx-runtime-showcase/package.json +++ b/packages/jsx-runtime-showcase/package.json @@ -15,13 +15,14 @@ }, "scripts": { "clean": "rimraf dist coverage report .nyc_output webapp/api", - "build": "pnpm --filter @ui5-community/jsx-runtime build:api && ui5 build --clean-dest", + "build": "pnpm check:framework && pnpm --filter @ui5-community/jsx-runtime build:api && ui5 build --clean-dest", + "check:framework": "node scripts/check-framework-version.mjs", "dev": "ui5 serve --port 8080 -o index-local.html", "start": "ui5 serve --port 8080 -o index.html --config ui5-dist.yaml", "ts-typecheck": "tsc --noEmit", "lint": "eslint webapp", "test-runner": "ui5-test-runner --url http://localhost:8080/test/testsuite.qunit.html --start dev --start-timeout 60000", - "test": "npm run ts-typecheck && npm run lint && npm run test-runner" + "test": "npm run check:framework && npm run ts-typecheck && npm run lint && npm run test-runner" }, "dependencies": { "@ui5-community/jsx-runtime": "workspace:^", diff --git a/packages/jsx-runtime-showcase/scripts/check-framework-version.mjs b/packages/jsx-runtime-showcase/scripts/check-framework-version.mjs new file mode 100644 index 0000000..f146d83 --- /dev/null +++ b/packages/jsx-runtime-showcase/scripts/check-framework-version.mjs @@ -0,0 +1,19 @@ +#!/usr/bin/env node +/** Keep the CDN bootstrap and dist preview on the framework used to build. */ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; + +const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), "utf8"); +const frameworkVersion = (yaml) => yaml.match(/^framework:\s*\n\s+name: OpenUI5\s*\n\s+version: "([\d.]+)"/m)?.[1]; +const devConfig = read("ui5.yaml"); +const distConfig = read("ui5-dist.yaml"); +const version = frameworkVersion(devConfig); +const cdnVersion = read("webapp/index.html").match(/src="https:\/\/sdk\.openui5\.org\/([\d.]+)\/resources\/sap-ui-core\.js"/)?.[1]; + +assert.ok(version, "Cannot find framework.version in ui5.yaml"); +assert.equal(frameworkVersion(distConfig), version, "ui5-dist.yaml must match ui5.yaml framework.version"); +assert.equal(cdnVersion, version, "index.html CDN bootstrap must match ui5.yaml framework.version"); +for (const [name, config] of [["ui5.yaml", devConfig], ["ui5-dist.yaml", distConfig]]) { + assert.match(config, /^\s+- name: sap\.html\s*$/m, `${name} must include sap.html for the native HTML demo`); +} +console.log(`Showcase framework versions match: OpenUI5 ${version}`); diff --git a/packages/jsx-runtime-showcase/ui5-dist.yaml b/packages/jsx-runtime-showcase/ui5-dist.yaml index d9a7f7a..738ba8d 100644 --- a/packages/jsx-runtime-showcase/ui5-dist.yaml +++ b/packages/jsx-runtime-showcase/ui5-dist.yaml @@ -8,10 +8,11 @@ resources: webapp: dist framework: name: OpenUI5 - version: "1.148.2" + version: "1.154.0" libraries: - name: sap.m - name: sap.f + - name: sap.html - name: sap.tnt - name: sap.ui.core - name: sap.ui.layout diff --git a/packages/jsx-runtime-showcase/webapp/index.html b/packages/jsx-runtime-showcase/webapp/index.html index ce89b5c..edf962e 100644 --- a/packages/jsx-runtime-showcase/webapp/index.html +++ b/packages/jsx-runtime-showcase/webapp/index.html @@ -161,7 +161,7 @@ `pnpm dev` opens that one. Keep the CDN version in sync with the `framework.version` in - `ui5.yaml` / `ui5-dist.yaml` (currently OpenUI5 1.148.2). + `ui5.yaml` / `ui5-dist.yaml` (currently OpenUI5 1.154.0). UI5 boots inline. The application Component mounts eagerly via `webapp/index.ts` (called through `data-sap-ui-oninit`), and the @@ -174,7 +174,7 @@ -->