| β Previous: Step 2 β Create & enhance a JS app | Back to Overview | Next: Step 4 β Modernize a legacy app β |
In this step you convert the JavaScript app from Step 2 to TypeScript using the
dedicated UI5 TypeScript conversion skill, which applies the official conversion guidelines
(project setup, tsconfig, types packages, ES modules, typed event handlers). You then fix any
remaining type errors together with Claude Code and verify the result compiles, runs, and lints
clean.
π Each step works best in its own Claude Code session so the context stays focused. Follow the steps below before running the conversion skill.
If you completed Step 2, copy your finished app into a new folder: copy the project folder and
paste it with a new name (e.g. products-ts) next to the original.
If you did not complete Step 2, download the ready-made sample app instead:
apps folder.apps/products-ts.apps/products-ts and run:
npm install
Then install the TypeScript conversion plugin:
claude plugin install ui5-typescript-conversion@claude-plugins-official
Then open a terminal in the copied or extracted projectβs root directory (the directory containing package.json and ui5.yaml) and launch a new Claude Code session with the conflicting MCP tool disabled:
claude --disallowedTools "mcp__plugin_ui5_ui5-mcp-server__get_typescript_conversion_guidelines"
π
products-tsis a new folder, so Claude Code asks you to trust it on launch (see Step 1 β section 1.4); confirm to proceed.
π The conversion skill owns the full setup (dependencies,
tsconfig.json,ui5.yamltranspile config, ES-module conversion). The UI5 MCP server also exposes a TypeScript-conversion guideline tool β disabling it prevents overlap so the skill drives the conversion end-to-end.
π‘ Starting a new session keeps the TypeScript conversion context clean and avoids carry-over tool state from Step 2.
π‘ Task: Point Claude Code at the Step 2 app and run:
/ui5-typescript-conversionApprove the steps as it works. Watch it:
- add
typescript,@openui5/types(matching the projectβs OpenUI5 version), and theui5-tooling-transpiletooling as dev dependencies;- add a
tsconfig.json(with thepathsmap for the app namespace) and ats-typecheckscript;- update
ui5.yamlwith the transpile task and middleware.
π The conversion is interactive. Claude Code may pause to show you a plan and ask for approval before proceeding, and may ask follow-up questions during conversion, for example whether to update existing unit tests to match a changed type signature. Read each prompt and confirm or adjust as needed.
Claude Code converts the app modules from the proprietary OpenUI5 class syntax to standard ES classes and ES imports:
Controller.extend("...", { ... }) β export default class β¦ extends Controller { β¦ } with a
@namespace JSDoc comment.sap.ui.define([...], function(...) {...}) β import statements + export default.import { ListBase$SelectionChangeEvent } from "sap/m/ListBase";
onSelectionChange(event: ListBase$SelectionChangeEvent): void {
// event.getParameter(...) is now typed
}
π‘ Task: Skim one converted controller. Confirm it imports real OpenUI5 types (no
sap.m.Buttonglobal references, noany/unknowncasts) and that all JSDoc comments were preserved.
π‘ Task: Ask Claude Code:
Run the type check and fix any remaining type errors.npx tsc --noEmitCommon cases: casting the result of
this.byId(...)/getModel(...)to the specific control or model type, and adding private member declarations to classes.
npx tsc --noEmit passes with no errors.You converted a OpenUI5 application to TypeScript with the conversion skill and verified it end-to-end. In Step 4 you switch from building to modernizing β taking a deliberately legacy app and bringing it up to current best practices with the modernization workflow.
Previous: Step 2: Create & Enhance a New OpenUI5 Application in JavaScript