ui5-typescript-conversion
БесплатноБез исполняемых скриптовНе проверенA skill for converting UI5 (SAPUI5/OpenUI5) projects to TypeScript.
от cline★ 48 звёзд на GitHubОб этом скилле
UI5 TypeScript Conversion Guidelines
This document outlines how a UI5 (SAPUI5/OpenUI5) project can be converted to TypeScript. It consists of the following parts:
- Important general rules
- How the setup of the project needs to be changed
- Converting the code itself
- Converting tests (reference to separate file)
General Conversion Rules
Preserve ALL comments
You MUST preserve existing JSDoc, documentation and comments - never remove JSDoc or comments during the conversion.
Example input:
/**
* My cool controller, it does things.
*/
return Controller.extend("com.myorg.myapp.controller.BaseController", {
/**
* Convenience method for accessing the component of the controller's view.
* @returns {sap.ui.core.Component} The component of the controller's view
*/
getOwnerComponent: function () {
// comment
return Controller.prototype.getOwnerComponent.call(this);
},
...
});
Wrong output:
export default class BaseController extends Controller {
public getOwnerComponent(): UIComponent {
return super.getOwnerComponent() as UIComponent;
}
}
Correct output:
/**
* My cool controller, it does things.
* @namespace com.myorg.myapp.controller
*/
export default class BaseController extends Controller {
/**
* Convenience method for accessing the component of the controller's view.
* @returns {sap.ui.core.Component} The component of the controller's view
*/
public getOwnerComponent(): UIComponent {
// comment
return super.getOwnerComponent() as UIComponent;
}
}
Be diligent
Carefully respect all guidelines in this document (and adapt appropriately where required). Before each conversion step, consider all relevant details from this document.
Go step-by-step
You should convert the project step by step, starting with the TypeScript project setup and then the most central files on which other files depend, so those other files can use the typed version of those central files once they are converted as well. "allowJs": true in the tsconfig.json's compilerOptions may be useful to run semi-converted projects if needed.
Avoid any type
Do not take shortcuts, but try to find the proper type or create an interface instead of any.
BAD:
(this.getOwnerComponent() as any).getContentDensityClass();
GOOD:
(this.getOwnerComponent() as AppComponent).getContentDensityClass()
Avoid unknown casts
Import and use actual UI5 control types instead (either the base class sap/ui/core/Control or more specific classes if needed to access the respective property). Inspect the XMLView to find out which control type you actually get when calling this.byId(...) in a controller!
Don't forget using the specific event types like e.g. Route$PatternMatchedEvent for routing events.
Casting Example
BAD:
(this.byId("form") as unknown as {setVisible: (v: boolean) => void}).setVisible(false);
GOOD:
import SimpleForm from "sap/ui/layout/form/SimpleForm";
(this.byId("form") as SimpleForm).setVisible(false);
Create shared type definitions
Many type definitions you create are useful in different files. Create those in a central location like a file in src/types/.
Project Setup Conversion
1. package.json
You must add the following dev dependencies in the package.json file (very important) if they are not already present:
{{dependencies}}
However, if a dependency is already present in package.json, do not increase the major version number of it. Do not remove existing dependencies, you must only add new configuration. Install the dependencies early to verify the types are found.
IMPORTANT: In addition, you MUST also add the @sapui5/types (or @openui5/types) package in a version matching the UI5 project as dev dependency. Framework type and version can be found in ui5.yaml or using the get_project_info MCP tool.
In addition, if (and ONLY if) dependencies or their versions changed, ensure (or tell the user) to execute npm install / yarn install (whatever is used in the project) to get the changed dependencies in the project.
The typescript-eslint dependency is only relevant when the project already has an eslint setup (details are below).
Also add the "ts-typecheck": "tsc --noEmit" script to package.json, so you and the developer can easily check for TypeScript errors.
2. tsconfig.json
Add a tsconfig.json file. Use the following sample as reference, but adapt to the needs of the current project, e.g. adapt the paths map:
{
"compilerOptions": {
"target": "es2023",
"module": "es2022",
"moduleResolution": "node",
"skipLibCheck": true,
"allowJs": true,
"strict": true,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"outDir": "./dist",
"rootDir": "./webapp",
"types": ["@sapui5/types", "@types/jquery", "@types/qunit"]
Установить ui5-typescript-conversion в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ui5-typescript-conversion?
A skill for converting UI5 (SAPUI5/OpenUI5) projects to TypeScript.
Как установить скилл ui5-typescript-conversion?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ui5-typescript-conversion запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic