ui5-app-cli
v0.5.0
Published
CLI to scaffold, configure and build SAPUI5 TypeScript applications
Readme
ui5-app-cli
CLI to scaffold, configure, develop and build SAPUI5 TypeScript applications. Targets turn one code base into installations for several SAP systems. Every command works on any conventionally laid out UI5 project — app.config.json declares only where a project deviates. New applications come from templates that are data, not code: any template shipping a template.config.json works, with ui5-ts-starter as the default.
Quick start
ui5-app create my-app # scaffold from the template, interactively
cd my-app
ui5-app start qa # dev server against the qa target, no file changes
ui5-app build --all # one deployable ZIP per SAP systemRun ui5-app --help, or ui5-app <command> --help, for every flag.
Commands
| Command | Purpose |
| ------------------------ | ------------------------------------------------------ |
| create [directory] | Scaffold a new application from the template |
| init | Configure an existing template checkout in place |
| start <target> | Start the dev server against a target, no file changes |
| use [target] | Point local development at a target's SAP system |
| build [target] | Build one SAP system target into artifacts/ |
| build --all | Build every configured target |
| package | Stamp the build version and zip the UI5 output |
| versions check | Verify that every declared UI5 version agrees |
| versions set --ui5 <v> | Update a whole version family at once |
Every command accepts --cwd <path> and acts on that project root, so the CLI can run from anywhere.
create resolves its template through giget: --template gh:Bechtle-AG/ui5-ts-starter (the default), any other giget source, or a path to a local template checkout. A private template repository needs a token in GIGET_AUTH.
Working with targets
Targets in app.config.json describe the SAP systems an application is installed in, overriding any field of the base configuration. Day to day, two commands work with them:
ui5-app start qa # serve against qa — nothing changes on disk, systems run in parallel
ui5-app use qa # rewrite the working tree to qa, reversiblyDeveloping against SAP systems explains the pair: shortcuts, parallel servers, what the proxy override inherits, why client decides authentication, and the limits where start hands over to use.
Documentation
- Developing against SAP systems —
startandusein detail - Application configuration — the
app.config.jsonreference - The template contract — making a template work with this CLI
Installation
pnpm add -D ui5-app-cliNode.js 22.13 or newer. The package ships prebuilt — no build scripts to allow, no token, no registry configuration.
Development
pnpm install
pnpm run dev # rebuild on change
pnpm run check # build, lint, typecheck, tests, package inspectionThe ui5-app bin runs dist/, not the sources, so a change needs a rebuild; prepare covers a fresh clone. playground/ is a minimal runnable project for exercising the CLI by hand — shortcuts, restarts, the stale-configuration notice, a live proxy — and references the package as workspace:*, so it always runs the current build.
Every command's logic is also exported for programmatic use, which is what the tests build on:
import { applyConfiguration, loadProjectConfiguration, resolveLayout } from 'ui5-app-cli'
const { config, rawConfig } = await loadProjectConfiguration({ cwd: rootDir })
await applyConfiguration(rootDir, config, { layout: resolveLayout(rawConfig.project) })Releasing
pnpm run release bumps the version, writes CHANGELOG.md from the commit messages, commits and tags — all local. Review it, then git push --follow-tags.
Two things worth knowing. changelogen downgrades the bump below 1.0, so features land as a patch; pass -r <version> for an explicit one. And prepublishOnly runs build, typecheck, tests and check:package, so no publish can skip the gates.
