@ui5/sample-app
An OpenUI5 sample app set up with the UI5 CLI: ESLint, UI5 linter and UI5 Test Runner checks, a standard and a self-contained build, and a UI5 workspace for developing against local UI5 libraries.
Shows how a UI5 CLI project is set up from clone to build, not any one feature of the framework. ui5 serve runs the app; npm test runs ESLint and @ui5/linter@ui5/linterSAP's static analysis tool for UI5 projects: it scans JavaScript, TypeScript, XML, JSON and other files for deprecated APIs, global variables and possible CSP violations, and fixes part of them with --fix.sap official, ui5, then starts the ui5-test-runnerui5-test-runnerA standalone command line that runs a UI5 project's QUnit and OPA test pages in parallel browser instances, written for suites too large for one browser, and merges their coverage into one report.independent, ui5 to execute the tests with coverage on, and its package.json lists @ui5/middleware-code-coverage@ui5/middleware-code-coverageUI5 CLI server middleware that instruments a project's JavaScript files with Istanbul as the dev server sends them, and generates the coverage report from the records the OpenUI5 QUnit tests send back.sap official, ui5 among the development dependencies. ui5 build -a makes a standard preload build, and ui5 build self-contained a bundle of the application's runtime dependencies, each served from /dist by a local web server. The README also explains how a ui5-workspace.yaml lets the application be developed beside a local clone of the OpenUI5 repository, which must be UI5 1.65.0 or higher. The package is marked private in its package.json and is not on npm.
Facts
Where it sits
Who is behind it
In the atlas: maintains 8@UI5maintainerAndreas KunzContributes to this
In the atlas: contributes to 19@akudevChristian GrailContributes to this
In the atlas: contributes to 3@cgrailClemens MaierContributes to this
In the atlas: contributes to 2@clemaiYavor IvanovContributes to this
In the atlas: contributes to 17@d3xter666DomiContributes to this
In the atlas: contributes to 3@domianerAndreas EckerContributes to this
In the atlas: contributes to 3@eckerFlorian VogtContributes to this
In the atlas: contributes to 50, wrote 2@flovogtLars KisselContributes to this
In the atlas: contributes to 3@larskisselMatthias OßwaldContributes to this
In the atlas: contributes to 29@matz3Max ReichmannContributes to this
In the atlas: contributes to 10@maxreichmann19 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
- Use as
- A reference
As a sample
- Form
- A reference application
Connections
Serving an app locally and building it for deployment
Catching problems in code, models and configuration by rules
Unit, integration and end-to-end tests for UI5 apps
Download
README
quoted from UI5/sample-app under Apache-2.0, read
sample-app
Live Demo
A deployed version of the sample-app is hosted on GitHub Pages.
Prerequisites
- The UI5 CLI.
- For installation instructions please see: Installation.
Getting started
-
Clone this repository and navigate into it
git clone https://github.com/UI5/sample-app.git cd sample-app -
Install all dependencies
npm install -
Start a local server and run the application (http://localhost:8080/index.html)
ui5 serve -o index.html
Testing
- Run ESLint code validation
npm run lint - Start the UI5 Test Runner and execute the tests
npm run test-runner - Run both ESLint and UI5 Test Runner
npm test
Building
Option 1: Standard preload build
- Execute the build
ui5 build -a - Run the result
- Run a local HTTP server on the build results (
/distdirectory)
(Note: This script is using the local-web-server npm module, but you can use any HTTP server for that)npm run serve-dist - Open the app at http://localhost:8000
- Run a local HTTP server on the build results (
Option 2: Self-contained build
- (Optional) Remove previous build results
rm -rf ./dist - Execute the
self-containedbuild to create a bundle with all of your applications runtime dependenciesui5 build self-contained -a - Run the result
- Run a local HTTP server on the build results (
/distdirectory)
(Note: This script is using the local-web-server npm module, but you can use any HTTP server for that)npm run serve-dist - Open the app at http://localhost:8000
- Run a local HTTP server on the build results (
Working with local dependencies
For local development of your applications' dependencies (like OpenUI5 libraries) you can use UI5 Workspaces. This will allow you to make changes to those dependencies locally and see the impact in your application immediately.
Preparation
The following needs to be done just once per setup.
- Clone the OpenUI5 repository and navigate into it
Note: The UI5 version must be 1.65.0 or higher, you can check that in the root
package.jsonfilegit clone https://github.com/UI5/openui5.git cd openui5 - Install all dependencies (this also links all OpenUI5 libraries between each other)
npm install
Setup UI5 Workspace
Would you like to work on the application project and one or more of its UI5 framework dependencies at the same time? We got you covered!
- Create a new file
ui5-workspace.yamlin the root folder of the project, right next to theui5.yaml - In
ui5-workspace.yaml, add the paths to the local dependencies you'd like to use from your local machine:specVersion: workspace/1.0 metadata: name: default dependencyManagement: resolutions: # local path to OpenUI5. It will resolve all required libraries and transitive dependencies. - path: /local/path/to/openui5 - Start the development server with default dependency resolution
npm run start
You can now make changes in your local OpenUI5 repository and see the impact directly when serving or building your application.
If a dependency that is listed in ui5.yaml is omitted in the resolutions section of ui5-workspace.yaml, the library is resolved in the usual way by downloading it from the registry. For more information about dependency resolutions, check here.
Non-default workspace
The workspace feature always uses the default workspace and always attempts to resolve any dependencies from it. If you'd like to use the workspace for local development but want to resolve the libraries in the usual way by default, you can name the workspace and use that name later, for example like this:
specVersion: workspace/1.0
metadata:
name: local-dependencies # Not "default"
dependencyManagement:
resolutions:
- path: /local/path/to/openui5
# Starts a server with a named workspace
npm run start -- -w local-dependenciesDetails
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:ui5-sample-app- JSON
- /artifacts/ui5-sample-app.json
- MCP
- Connecting an agent