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
-
Start a local server and run the application (http://localhost:8080/index.html)
Testing
- Run ESLint code validation
- Start the UI5 Test Runner and execute the tests
- Run both ESLint and UI5 Test Runner
Building
Option 1: Standard preload build
- Execute the build
- 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) - 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
- 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) - 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)
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
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-dependencies