Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/old-jobs-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 3 additions & 2 deletions packages/jsx-runtime-showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:^",
Expand Down
19 changes: 19 additions & 0 deletions packages/jsx-runtime-showcase/scripts/check-framework-version.mjs
Original file line number Diff line number Diff line change
@@ -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}`);
3 changes: 2 additions & 1 deletion packages/jsx-runtime-showcase/ui5-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/jsx-runtime-showcase/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -174,7 +174,7 @@
-->
<script
id="sap-ui-bootstrap"
src="https://sdk.openui5.org/1.148.2/resources/sap-ui-core.js"
src="https://sdk.openui5.org/1.154.0/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-async="true"
data-sap-ui-libs="sap.m,sap.f,sap.tnt,sap.ui.core,sap.ui.layout,ui5.community.jsx.runtime"
Expand Down
Loading