@ui5/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +201 -0
- package/LICENSES/Apache-2.0.txt +73 -0
- package/README.md +131 -0
- package/bin/ui5mcp.js +2 -0
- package/lib/Context.d.ts +28 -0
- package/lib/Context.js +71 -0
- package/lib/Context.js.map +1 -0
- package/lib/api.d.ts +3 -0
- package/lib/api.js +3 -0
- package/lib/api.js.map +1 -0
- package/lib/cli.d.ts +1 -0
- package/lib/cli.js +12 -0
- package/lib/cli.js.map +1 -0
- package/lib/registerTools.d.ts +133 -0
- package/lib/registerTools.js +59 -0
- package/lib/registerTools.js.map +1 -0
- package/lib/resources/documentation/getDocumentation.d.ts +18 -0
- package/lib/resources/documentation/getDocumentation.js +70 -0
- package/lib/resources/documentation/getDocumentation.js.map +1 -0
- package/lib/server.d.ts +10 -0
- package/lib/server.js +113 -0
- package/lib/server.js.map +1 -0
- package/lib/tools/create_ui5_app/ODataMetadata.d.ts +55 -0
- package/lib/tools/create_ui5_app/ODataMetadata.js +99 -0
- package/lib/tools/create_ui5_app/ODataMetadata.js.map +1 -0
- package/lib/tools/create_ui5_app/createSuccessMessage.d.ts +13 -0
- package/lib/tools/create_ui5_app/createSuccessMessage.js +45 -0
- package/lib/tools/create_ui5_app/createSuccessMessage.js.map +1 -0
- package/lib/tools/create_ui5_app/create_ui5_app.d.ts +8 -0
- package/lib/tools/create_ui5_app/create_ui5_app.js +273 -0
- package/lib/tools/create_ui5_app/create_ui5_app.js.map +1 -0
- package/lib/tools/create_ui5_app/index.d.ts +3 -0
- package/lib/tools/create_ui5_app/index.js +58 -0
- package/lib/tools/create_ui5_app/index.js.map +1 -0
- package/lib/tools/create_ui5_app/isValidUrl.d.ts +16 -0
- package/lib/tools/create_ui5_app/isValidUrl.js +59 -0
- package/lib/tools/create_ui5_app/isValidUrl.js.map +1 -0
- package/lib/tools/create_ui5_app/schema.d.ts +135 -0
- package/lib/tools/create_ui5_app/schema.js +67 -0
- package/lib/tools/create_ui5_app/schema.js.map +1 -0
- package/lib/tools/create_ui5_app/templateProcessor.d.ts +67 -0
- package/lib/tools/create_ui5_app/templateProcessor.js +59 -0
- package/lib/tools/create_ui5_app/templateProcessor.js.map +1 -0
- package/lib/tools/create_ui5_app/ui5Version.d.ts +2 -0
- package/lib/tools/create_ui5_app/ui5Version.js +6 -0
- package/lib/tools/create_ui5_app/ui5Version.js.map +1 -0
- package/lib/tools/get_api_reference/createUriForSymbol.d.ts +2 -0
- package/lib/tools/get_api_reference/createUriForSymbol.js +49 -0
- package/lib/tools/get_api_reference/createUriForSymbol.js.map +1 -0
- package/lib/tools/get_api_reference/getApiReference.d.ts +10 -0
- package/lib/tools/get_api_reference/getApiReference.js +51 -0
- package/lib/tools/get_api_reference/getApiReference.js.map +1 -0
- package/lib/tools/get_api_reference/index.d.ts +3 -0
- package/lib/tools/get_api_reference/index.js +38 -0
- package/lib/tools/get_api_reference/index.js.map +1 -0
- package/lib/tools/get_api_reference/lib/ApiReferenceProvider.d.ts +85 -0
- package/lib/tools/get_api_reference/lib/ApiReferenceProvider.js +452 -0
- package/lib/tools/get_api_reference/lib/ApiReferenceProvider.js.map +1 -0
- package/lib/tools/get_api_reference/lib/apiReferenceResources.d.ts +18 -0
- package/lib/tools/get_api_reference/lib/apiReferenceResources.js +138 -0
- package/lib/tools/get_api_reference/lib/apiReferenceResources.js.map +1 -0
- package/lib/tools/get_api_reference/lib/formatSymbol.d.ts +24 -0
- package/lib/tools/get_api_reference/lib/formatSymbol.js +109 -0
- package/lib/tools/get_api_reference/lib/formatSymbol.js.map +1 -0
- package/lib/tools/get_api_reference/schema.d.ts +16 -0
- package/lib/tools/get_api_reference/schema.js +12 -0
- package/lib/tools/get_api_reference/schema.js.map +1 -0
- package/lib/tools/get_guidelines/guidelines.d.ts +1 -0
- package/lib/tools/get_guidelines/guidelines.js +6 -0
- package/lib/tools/get_guidelines/guidelines.js.map +1 -0
- package/lib/tools/get_guidelines/index.d.ts +3 -0
- package/lib/tools/get_guidelines/index.js +30 -0
- package/lib/tools/get_guidelines/index.js.map +1 -0
- package/lib/tools/get_project_info/getProjectInfo.d.ts +2 -0
- package/lib/tools/get_project_info/getProjectInfo.js +205 -0
- package/lib/tools/get_project_info/getProjectInfo.js.map +1 -0
- package/lib/tools/get_project_info/index.d.ts +3 -0
- package/lib/tools/get_project_info/index.js +28 -0
- package/lib/tools/get_project_info/index.js.map +1 -0
- package/lib/tools/get_project_info/schema.d.ts +87 -0
- package/lib/tools/get_project_info/schema.js +28 -0
- package/lib/tools/get_project_info/schema.js.map +1 -0
- package/lib/tools/get_version_info/getVersionInfo.d.ts +8 -0
- package/lib/tools/get_version_info/getVersionInfo.js +41 -0
- package/lib/tools/get_version_info/getVersionInfo.js.map +1 -0
- package/lib/tools/get_version_info/index.d.ts +9 -0
- package/lib/tools/get_version_info/index.js +33 -0
- package/lib/tools/get_version_info/index.js.map +1 -0
- package/lib/tools/get_version_info/schema.d.ts +66 -0
- package/lib/tools/get_version_info/schema.js +16 -0
- package/lib/tools/get_version_info/schema.js.map +1 -0
- package/lib/tools/get_version_info/types.d.ts +5 -0
- package/lib/tools/get_version_info/types.js +2 -0
- package/lib/tools/get_version_info/types.js.map +1 -0
- package/lib/tools/run_ui5_linter/index.d.ts +3 -0
- package/lib/tools/run_ui5_linter/index.js +86 -0
- package/lib/tools/run_ui5_linter/index.js.map +1 -0
- package/lib/tools/run_ui5_linter/migrationGuides.d.ts +6 -0
- package/lib/tools/run_ui5_linter/migrationGuides.js +88 -0
- package/lib/tools/run_ui5_linter/migrationGuides.js.map +1 -0
- package/lib/tools/run_ui5_linter/resultContext.d.ts +3 -0
- package/lib/tools/run_ui5_linter/resultContext.js +236 -0
- package/lib/tools/run_ui5_linter/resultContext.js.map +1 -0
- package/lib/tools/run_ui5_linter/runUi5Linter.d.ts +2 -0
- package/lib/tools/run_ui5_linter/runUi5Linter.js +72 -0
- package/lib/tools/run_ui5_linter/runUi5Linter.js.map +1 -0
- package/lib/tools/run_ui5_linter/schema.d.ts +340 -0
- package/lib/tools/run_ui5_linter/schema.js +55 -0
- package/lib/tools/run_ui5_linter/schema.js.map +1 -0
- package/lib/utils/cdnHelper.d.ts +9 -0
- package/lib/utils/cdnHelper.js +50 -0
- package/lib/utils/cdnHelper.js.map +1 -0
- package/lib/utils/dataStorageHelper.d.ts +2 -0
- package/lib/utils/dataStorageHelper.js +65 -0
- package/lib/utils/dataStorageHelper.js.map +1 -0
- package/lib/utils/ui5Framework.d.ts +4 -0
- package/lib/utils/ui5Framework.js +6 -0
- package/lib/utils/ui5Framework.js.map +1 -0
- package/lib/utils.d.ts +10 -0
- package/lib/utils.js +87 -0
- package/lib/utils.js.map +1 -0
- package/npm-shrinkwrap.json +7880 -0
- package/package.json +121 -0
- package/resources/docs/1.136.7/00737d6c1b864dc3ab72ef56611491c4.md +155 -0
- package/resources/docs/1.136.7/0187ea5e2eff4166b0453b9dcc8fc64f.md +164 -0
- package/resources/docs/1.136.7/032be2cb2e1d4115af20862673bedcdb.md +12 -0
- package/resources/docs/1.136.7/28fcd55b04654977b63dacbee0552712.md +317 -0
- package/resources/docs/1.136.7/676b636446c94eada183b1218a824717.md +135 -0
- package/resources/docs/1.136.7/a87ca843bcee469f82a9072927a7dcdb.md +355 -0
- package/resources/docs/1.136.7/b0fb4de7364f4bcbb053a99aa645affe.md +126 -0
- package/resources/docs/1.136.7/fe1a6dba940e479fb7c3bc753f92b28c.md +670 -0
- package/resources/docs/1.136.7/index.json +58 -0
- package/resources/guidelines.md +104 -0
- package/resources/migrationGuides/deprecated-controller-factory.md +116 -0
- package/resources/migrationGuides/deprecated-getLibraryResourceBundle.md +62 -0
- package/resources/migrationGuides/deprecated-jquery-sap-require.md +141 -0
- package/resources/migrationGuides/deprecated-messagePage.md +162 -0
- package/resources/migrationGuides/deprecated-table-table-property.md +154 -0
- package/resources/template-js/LICENSE +201 -0
- package/resources/template-js/README.md +87 -0
- package/resources/template-js/_.editorconfig +22 -0
- package/resources/template-js/_.gitignore +17 -0
- package/resources/template-js/eslint.config.js +68 -0
- package/resources/template-js/karma-ci-cov.conf.js +20 -0
- package/resources/template-js/karma-ci.conf.js +9 -0
- package/resources/template-js/karma.conf.js +9 -0
- package/resources/template-js/package.json +34 -0
- package/resources/template-js/ui5-dist.yaml +18 -0
- package/resources/template-js/ui5.yaml +24 -0
- package/resources/template-js/webapp/Component.js +41 -0
- package/resources/template-js/webapp/controller/App.controller.js +10 -0
- package/resources/template-js/webapp/controller/BaseController.js +67 -0
- package/resources/template-js/webapp/controller/Main.controller.js +14 -0
- package/resources/template-js/webapp/i18n/i18n.properties +3 -0
- package/resources/template-js/webapp/i18n/i18n_en.properties +3 -0
- package/resources/template-js/webapp/index-cdn.html +34 -0
- package/resources/template-js/webapp/index.html +34 -0
- package/resources/template-js/webapp/manifest.json +103 -0
- package/resources/template-js/webapp/model/formatter.js +9 -0
- package/resources/template-js/webapp/model/models.js +11 -0
- package/resources/template-js/webapp/test/Test.qunit.html +16 -0
- package/resources/template-js/webapp/test/integration/HelloJourney.js +85 -0
- package/resources/template-js/webapp/test/integration/opaTests.qunit.js +1 -0
- package/resources/template-js/webapp/test/integration/pages/Main.js +112 -0
- package/resources/template-js/webapp/test/testsuite.qunit.html +18 -0
- package/resources/template-js/webapp/test/testsuite.qunit.js +37 -0
- package/resources/template-js/webapp/test/unit/controller/Main.qunit.js +11 -0
- package/resources/template-js/webapp/test/unit/unitTests.qunit.js +1 -0
- package/resources/template-js/webapp/test-lt1_124/integration/HelloJourney.js +85 -0
- package/resources/template-js/webapp/test-lt1_124/integration/opaTests.qunit.html +31 -0
- package/resources/template-js/webapp/test-lt1_124/integration/opaTests.qunit.js +11 -0
- package/resources/template-js/webapp/test-lt1_124/integration/pages/Main.js +112 -0
- package/resources/template-js/webapp/test-lt1_124/testsuite.qunit.html +13 -0
- package/resources/template-js/webapp/test-lt1_124/testsuite.qunit.js +9 -0
- package/resources/template-js/webapp/test-lt1_124/unit/controller/Main.qunit.js +11 -0
- package/resources/template-js/webapp/test-lt1_124/unit/unitTests.qunit.html +30 -0
- package/resources/template-js/webapp/test-lt1_124/unit/unitTests.qunit.js +12 -0
- package/resources/template-js/webapp/view/App.view.xml +9 -0
- package/resources/template-js/webapp/view/Main.view.xml +90 -0
- package/resources/template-ts/LICENSE +201 -0
- package/resources/template-ts/README.md +101 -0
- package/resources/template-ts/_.editorconfig +23 -0
- package/resources/template-ts/_.gitignore +18 -0
- package/resources/template-ts/_.nycrc.json +7 -0
- package/resources/template-ts/_tsconfig.json +21 -0
- package/resources/template-ts/eslint.config.mjs +27 -0
- package/resources/template-ts/package.json +40 -0
- package/resources/template-ts/ui5-coverage.yaml +40 -0
- package/resources/template-ts/ui5-dist.yaml +18 -0
- package/resources/template-ts/ui5.yaml +27 -0
- package/resources/template-ts/webapp/Component.ts +49 -0
- package/resources/template-ts/webapp/controller/App.controller.ts +11 -0
- package/resources/template-ts/webapp/controller/BaseController.ts +83 -0
- package/resources/template-ts/webapp/controller/Main.controller.ts +19 -0
- package/resources/template-ts/webapp/i18n/i18n.properties +3 -0
- package/resources/template-ts/webapp/i18n/i18n_en.properties +3 -0
- package/resources/template-ts/webapp/index-cdn.html +35 -0
- package/resources/template-ts/webapp/index.html +35 -0
- package/resources/template-ts/webapp/manifest.json +105 -0
- package/resources/template-ts/webapp/model/formatter.ts +5 -0
- package/resources/template-ts/webapp/model/models.ts +15 -0
- package/resources/template-ts/webapp/test/Test.qunit.html +16 -0
- package/resources/template-ts/webapp/test/integration/HelloJourney.ts +84 -0
- package/resources/template-ts/webapp/test/integration/opaTests.qunit.ts +2 -0
- package/resources/template-ts/webapp/test/integration/pages/MainPage.ts +112 -0
- package/resources/template-ts/webapp/test/testsuite.qunit.html +18 -0
- package/resources/template-ts/webapp/test/testsuite.qunit.ts +33 -0
- package/resources/template-ts/webapp/test/unit/controller/Main.qunit.ts +8 -0
- package/resources/template-ts/webapp/test/unit/unitTests.qunit.ts +2 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/HelloJourney.ts +86 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/opaTests.qunit.html +34 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/opaTests.qunit.ts +8 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/pages/MainPage.ts +112 -0
- package/resources/template-ts/webapp/test-lt1_124/testsuite.qunit.html +13 -0
- package/resources/template-ts/webapp/test-lt1_124/testsuite.qunit.ts +9 -0
- package/resources/template-ts/webapp/test-lt1_124/unit/controller/Main.qunit.ts +8 -0
- package/resources/template-ts/webapp/test-lt1_124/unit/unitTests.qunit.html +37 -0
- package/resources/template-ts/webapp/test-lt1_124/unit/unitTests.qunit.ts +8 -0
- package/resources/template-ts/webapp/view/App.view.xml +9 -0
- package/resources/template-ts/webapp/view/Main.view.xml +90 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# UI5 Application <%= namespace %>
|
|
2
|
+
|
|
3
|
+
Insert the purpose of this project and some interesting info here...
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
This app uses a TypeScript setup for developing UI5 applications. The central entry point for all information about using TypeScript with UI5 is at [https://ui5.github.io/typescript](https://ui5.github.io/typescript).
|
|
8
|
+
|
|
9
|
+
See [`SAP-samples/ui5-typescript-helloworld`](https://github.com/SAP-samples/ui5-typescript-helloworld) for a similar sample app including documentation how all the bits and pieces fit together.
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
Either [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) for dependency management.
|
|
14
|
+
|
|
15
|
+
## Preparation
|
|
16
|
+
|
|
17
|
+
Use `npm` (or `yarn`) to install the dependencies:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
(To use yarn, just do `yarn` instead.)
|
|
24
|
+
|
|
25
|
+
## Run the App
|
|
26
|
+
|
|
27
|
+
Execute the following command to run the app locally for development in watch mode (the browser reloads the app automatically when there are changes in the source code):
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm start
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
As shown in the terminal after executing this command, the app is then running on http://localhost:8080/index.html. A browser window with this URL should automatically open.
|
|
34
|
+
|
|
35
|
+
(When using yarn, do `yarn start` instead.)
|
|
36
|
+
|
|
37
|
+
## Debug the App
|
|
38
|
+
|
|
39
|
+
In the browser, you can directly debug the original TypeScript code, which is supplied via sourcemaps (need to be enabled in the browser's developer console if it does not work straight away). If the browser doesn't automatically jump to the TypeScript code when setting breakpoints, use e.g. `Ctrl`/`Cmd` + `P` in Chrome to open the `*.ts` file you want to debug.
|
|
40
|
+
|
|
41
|
+
## Build the App
|
|
42
|
+
|
|
43
|
+
### Unoptimized (but quick)
|
|
44
|
+
|
|
45
|
+
Execute the following command to build the project and get an app that can be deployed:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npm run build
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The result is placed into the `dist` folder. To start the generated package, just run
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npm run start:dist
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Note that `index.html` still loads the UI5 framework from the relative URL `resources/...`, which does not physically exist, but is only provided dynamically by the UI5 tooling. So for an actual deployment you should change this URL to either [the CDN](https://sdk.openui5.org/#/topic/2d3eb2f322ea4a82983c1c62a33ec4ae) or your local deployment of UI5.
|
|
58
|
+
|
|
59
|
+
(When using yarn, do `yarn build` and `yarn start:dist` instead.)
|
|
60
|
+
|
|
61
|
+
### Optimized
|
|
62
|
+
|
|
63
|
+
For an optimized self-contained build (takes longer because the UI5 resources are built, too), do:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
npm run build:opt
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
To start the generated package, again just run:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npm run start:dist
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
In this case, all UI5 framework resources are also available within the `dist` folder, so the folder can be deployed as-is to any static web server, without changing the bootstrap URL.
|
|
76
|
+
|
|
77
|
+
With the self-contained build, the bootstrap URL in `index.html` has already been modified to load the newly created `sap-ui-custom.js` for bootstrapping, which contains all app resources as well as all needed UI5 JavaScript resources. Most UI5 resources inside the `dist` folder are for this reason actually **not** needed to run the app. Only the non-JS-files, like translation texts and CSS files, are used and must also be deployed. (Only when for some reason JS files are missing from the optimized self-contained bundle, they are also loaded separately.)
|
|
78
|
+
|
|
79
|
+
(When using yarn, do `yarn build:opt` and `yarn start:dist` instead.)
|
|
80
|
+
|
|
81
|
+
## Check the Code
|
|
82
|
+
|
|
83
|
+
Do the following to run a TypeScript check:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
npm run ts-typecheck
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This checks the application code for any type errors (but will also complain in case of fundamental syntax issues which break the parsing).
|
|
90
|
+
|
|
91
|
+
To lint the TypeScript code, do:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
npm run lint
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
(Again, when using yarn, do `yarn ts-typecheck` and `yarn lint` instead.)
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSE) file.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# EditorConfig helps developers define and maintain consistent
|
|
2
|
+
# coding styles between different editors and IDEs
|
|
3
|
+
# editorconfig.org
|
|
4
|
+
|
|
5
|
+
root = true
|
|
6
|
+
|
|
7
|
+
[*]
|
|
8
|
+
# We recommend you to keep these unchanged
|
|
9
|
+
end_of_line = lf
|
|
10
|
+
charset = utf-8
|
|
11
|
+
trim_trailing_whitespace = true
|
|
12
|
+
insert_final_newline = true
|
|
13
|
+
|
|
14
|
+
# Change these settings to your own preference
|
|
15
|
+
indent_style = tab
|
|
16
|
+
indent_size = 2
|
|
17
|
+
|
|
18
|
+
[*.{yaml,yml}]
|
|
19
|
+
indent_style = space
|
|
20
|
+
|
|
21
|
+
[*.md]
|
|
22
|
+
indent_style = unset
|
|
23
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2023",
|
|
4
|
+
"module": "es2022",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"strictNullChecks": false,
|
|
10
|
+
"strictPropertyInitialization": false,
|
|
11
|
+
"rootDir": "./webapp",
|
|
12
|
+
"types": ["<%= tstypes %>", "@types/qunit"<% if (!gte1_100_0) { %>, "@types/jquery"<% } %>],
|
|
13
|
+
"paths": {
|
|
14
|
+
"<%= appURI %>/*": ["./webapp/*"],
|
|
15
|
+
"unit/*": ["./webapp/test/unit/*"],
|
|
16
|
+
"integration/*": ["./webapp/test/integration/*"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"exclude": ["./webapp/test/e2e/**/*"],
|
|
20
|
+
"include": ["./webapp/**/*"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import {fileURLToPath} from "node:url";
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
eslint.configs.recommended,
|
|
9
|
+
...tseslint.configs.recommended,
|
|
10
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
globals: {
|
|
14
|
+
...globals.browser,
|
|
15
|
+
sap: "readonly"
|
|
16
|
+
},
|
|
17
|
+
ecmaVersion: 2023,
|
|
18
|
+
parserOptions: {
|
|
19
|
+
project: true,
|
|
20
|
+
tsconfigRootDir: path.dirname(fileURLToPath(import.meta.url))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
ignores: ["eslint.config.mjs", "webapp/test/e2e/**"]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= namespace %>",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "UI5 Application: <%= namespace %>",
|
|
5
|
+
"author": "<%= author %>",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"clean": "rimraf dist coverage",
|
|
9
|
+
"build": "ui5 build --clean-dest",
|
|
10
|
+
"build:opt": "ui5 build self-contained --clean-dest --all",
|
|
11
|
+
"start": "ui5 serve --port 8080 -o index.html",
|
|
12
|
+
"start-cdn": "ui5 serve --port 8080 -o index-cdn.html",
|
|
13
|
+
"start-coverage": "ui5 serve --port 8080 --config ui5-coverage.yaml",
|
|
14
|
+
"start:dist": "npm start -- --config ui5-dist.yaml",
|
|
15
|
+
"start:dist-cdn": "npm run start-cdn -- --config ui5-dist.yaml",
|
|
16
|
+
"ts-typecheck": "tsc --noEmit",
|
|
17
|
+
"lint": "eslint webapp",
|
|
18
|
+
"ui5lint": "ui5lint",
|
|
19
|
+
"test-runner": "ui5-test-runner --url http://localhost:8080/test/testsuite.qunit.html",
|
|
20
|
+
"test-runner-coverage": "ui5-test-runner --url http://localhost:8080/test/testsuite.qunit.html --coverage -ccb 50 -ccf 40 -ccl 50 -ccs 50",
|
|
21
|
+
"test-ui5": "ui5-test-runner --start start-coverage --url http://localhost:8080/test/testsuite.qunit.html --coverage -ccb 50 -ccf 40 -ccl 50 -ccs 50",
|
|
22
|
+
"test": "npm run lint && npm run test-ui5"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"<%= tstypes %>": "<%= tstypesVersion %>",
|
|
26
|
+
"<% if (!gte1_100_0) { %>@types/jquery": "3.5.13",
|
|
27
|
+
"@types/qunit": "2.5.4",
|
|
28
|
+
"<% } %>@ui5/cli": "^4.0.23",
|
|
29
|
+
"@ui5/linter": "^1.19.0",
|
|
30
|
+
"babel-plugin-istanbul": "^7.0.0",
|
|
31
|
+
"eslint": "^9.34.0",
|
|
32
|
+
"typescript-eslint": "^8.41.0",
|
|
33
|
+
"globals": "^16.3.0",
|
|
34
|
+
"rimraf": "^6.0.1",
|
|
35
|
+
"typescript": "^5.9.2",
|
|
36
|
+
"ui5-middleware-livereload": "^3.1.2",
|
|
37
|
+
"ui5-test-runner": "^5.9.1",
|
|
38
|
+
"ui5-tooling-transpile": "^3.9.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
specVersion: "4.0"
|
|
2
|
+
metadata:
|
|
3
|
+
name: <%= appId %>
|
|
4
|
+
type: application
|
|
5
|
+
framework:
|
|
6
|
+
name: <%= framework %>
|
|
7
|
+
version: "<%= frameworkVersion %>"
|
|
8
|
+
libraries:
|
|
9
|
+
- name: sap.m<%if (oDataEntitySet) { %>
|
|
10
|
+
- name: sap.f
|
|
11
|
+
- name: sap.ui.layout
|
|
12
|
+
- name: sap.ui.table<% } %>
|
|
13
|
+
- name: sap.ui.core
|
|
14
|
+
- name: themelib_<%= defaultTheme %>
|
|
15
|
+
builder:
|
|
16
|
+
resources:
|
|
17
|
+
excludes:
|
|
18
|
+
- "test/e2e/**"
|
|
19
|
+
customTasks:
|
|
20
|
+
- name: ui5-tooling-transpile-task
|
|
21
|
+
afterTask: replaceVersion
|
|
22
|
+
server:
|
|
23
|
+
customMiddleware:
|
|
24
|
+
- name: ui5-tooling-transpile-middleware
|
|
25
|
+
afterMiddleware: compression
|
|
26
|
+
configuration:
|
|
27
|
+
debug: true
|
|
28
|
+
babelConfig:
|
|
29
|
+
sourceMaps: true
|
|
30
|
+
ignore:
|
|
31
|
+
- "**/*.d.ts"
|
|
32
|
+
presets:
|
|
33
|
+
- - "@babel/preset-env"
|
|
34
|
+
- targets: defaults
|
|
35
|
+
- - transform-ui5
|
|
36
|
+
- "@babel/preset-typescript"
|
|
37
|
+
plugins:
|
|
38
|
+
- istanbul
|
|
39
|
+
- name: ui5-middleware-livereload
|
|
40
|
+
afterMiddleware: compression
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
specVersion: "4.0"
|
|
2
|
+
metadata:
|
|
3
|
+
name: <%= appId %>
|
|
4
|
+
type: application
|
|
5
|
+
resources:
|
|
6
|
+
configuration:
|
|
7
|
+
paths:
|
|
8
|
+
webapp: dist
|
|
9
|
+
framework:
|
|
10
|
+
name: <%= framework %>
|
|
11
|
+
version: "<%= frameworkVersion %>"
|
|
12
|
+
libraries:
|
|
13
|
+
- name: sap.m<%if (oDataEntitySet) { %>
|
|
14
|
+
- name: sap.f
|
|
15
|
+
- name: sap.ui.layout
|
|
16
|
+
- name: sap.ui.table<% } %>
|
|
17
|
+
- name: sap.ui.core
|
|
18
|
+
- name: themelib_<%= defaultTheme %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
specVersion: "4.0"
|
|
2
|
+
metadata:
|
|
3
|
+
name: <%= appId %>
|
|
4
|
+
type: application
|
|
5
|
+
framework:
|
|
6
|
+
name: <%= framework %>
|
|
7
|
+
version: "<%= frameworkVersion %>"
|
|
8
|
+
libraries:
|
|
9
|
+
- name: sap.m<%if (oDataEntitySet) { %>
|
|
10
|
+
- name: sap.f
|
|
11
|
+
- name: sap.ui.layout
|
|
12
|
+
- name: sap.ui.table<% } %>
|
|
13
|
+
- name: sap.ui.core
|
|
14
|
+
- name: themelib_<%= defaultTheme %>
|
|
15
|
+
builder:
|
|
16
|
+
resources:
|
|
17
|
+
excludes:
|
|
18
|
+
- "test/e2e/**"
|
|
19
|
+
customTasks:
|
|
20
|
+
- name: ui5-tooling-transpile-task
|
|
21
|
+
afterTask: replaceVersion
|
|
22
|
+
server:
|
|
23
|
+
customMiddleware:
|
|
24
|
+
- name: ui5-tooling-transpile-middleware
|
|
25
|
+
afterMiddleware: compression
|
|
26
|
+
- name: ui5-middleware-livereload
|
|
27
|
+
afterMiddleware: compression
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import UIComponent from "sap/ui/core/UIComponent";
|
|
2
|
+
import models from "./model/models";<% if (gte1_115_0) { %>
|
|
3
|
+
import Device from "sap/ui/Device";<% } else { %>
|
|
4
|
+
import * as Device from "sap/ui/Device"; // for UI5 >= 1.115.0 use: import Device from "sap/ui/Device";<% } %>
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @namespace <%= appId %>
|
|
8
|
+
*/
|
|
9
|
+
export default class Component extends UIComponent {
|
|
10
|
+
public static metadata = {
|
|
11
|
+
manifest: "json",
|
|
12
|
+
interfaces: ["sap.ui.core.IAsyncContentCreation"]
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
private contentDensityClass: string;
|
|
16
|
+
|
|
17
|
+
public init(): void {
|
|
18
|
+
// call the base component's init function
|
|
19
|
+
super.init();
|
|
20
|
+
|
|
21
|
+
// create the device model
|
|
22
|
+
this.setModel(models.createDeviceModel(), "device");
|
|
23
|
+
|
|
24
|
+
// create the views based on the url/hash
|
|
25
|
+
this.getRouter().initialize();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This method can be called to determine whether the sapUiSizeCompact or sapUiSizeCozy
|
|
30
|
+
* design mode class should be set, which influences the size appearance of some controls.
|
|
31
|
+
* @public
|
|
32
|
+
* @returns css class, either 'sapUiSizeCompact' or 'sapUiSizeCozy' - or an empty string if no css class should be set
|
|
33
|
+
*/
|
|
34
|
+
public getContentDensityClass(): string {
|
|
35
|
+
if (this.contentDensityClass === undefined) {
|
|
36
|
+
// check whether FLP has already set the content density class; do nothing in this case
|
|
37
|
+
if (document.body.classList.contains("sapUiSizeCozy") || document.body.classList.contains("sapUiSizeCompact")) {
|
|
38
|
+
this.contentDensityClass = "";
|
|
39
|
+
} else if (!Device.support.touch) {
|
|
40
|
+
// apply "compact" mode if touch is not supported
|
|
41
|
+
this.contentDensityClass = "sapUiSizeCompact";
|
|
42
|
+
} else {
|
|
43
|
+
// "cozy" in case of touch support; default for most sap.m controls, but needed for desktop-first controls like sap.ui.table.Table
|
|
44
|
+
this.contentDensityClass = "sapUiSizeCozy";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return this.contentDensityClass;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseController from "./BaseController";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @namespace <%= appId %>.controller
|
|
5
|
+
*/
|
|
6
|
+
export default class App extends BaseController {
|
|
7
|
+
public onInit(): void {
|
|
8
|
+
// apply content density mode to root view
|
|
9
|
+
this.getView().addStyleClass(this.getOwnerComponent().getContentDensityClass());
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Controller from "sap/ui/core/mvc/Controller";
|
|
2
|
+
import UIComponent from "sap/ui/core/UIComponent";
|
|
3
|
+
import AppComponent from "../Component";
|
|
4
|
+
import Model from "sap/ui/model/Model";
|
|
5
|
+
import ResourceModel from "sap/ui/model/resource/ResourceModel";
|
|
6
|
+
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
7
|
+
import Router from "sap/ui/core/routing/Router";
|
|
8
|
+
import History from "sap/ui/core/routing/History";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @namespace <%= appId %>.controller
|
|
12
|
+
*/
|
|
13
|
+
export default abstract class BaseController extends Controller {
|
|
14
|
+
/**
|
|
15
|
+
* Convenience method for accessing the component of the controller's view.
|
|
16
|
+
* @returns The component of the controller's view
|
|
17
|
+
*/
|
|
18
|
+
public getOwnerComponent(): AppComponent {
|
|
19
|
+
return super.getOwnerComponent() as AppComponent;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Convenience method to get the components' router instance.
|
|
24
|
+
* @returns The router instance
|
|
25
|
+
*/
|
|
26
|
+
public getRouter(): Router {
|
|
27
|
+
return UIComponent.getRouterFor(this);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Convenience method for getting the i18n resource bundle of the component.
|
|
32
|
+
* @returns {Promise<sap.base.i18n.ResourceBundle>} The i18n resource bundle of the component
|
|
33
|
+
*/
|
|
34
|
+
public getResourceBundle(): Promise<ResourceBundle> {
|
|
35
|
+
const oModel = this.getOwnerComponent().getModel("i18n") as ResourceModel;
|
|
36
|
+
return oModel.getResourceBundle() as Promise<ResourceBundle>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Convenience method for getting the view model by name in every controller of the application.
|
|
41
|
+
* @param [sName] The model name
|
|
42
|
+
* @returns The model instance
|
|
43
|
+
*/
|
|
44
|
+
public getModel(sName?: string): Model {
|
|
45
|
+
return this.getView().getModel(sName);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Convenience method for setting the view model in every controller of the application.
|
|
50
|
+
* @param oModel The model instance
|
|
51
|
+
* @param [sName] The model name
|
|
52
|
+
* @returns The current base controller instance
|
|
53
|
+
*/
|
|
54
|
+
public setModel(oModel: Model, sName?: string): BaseController {
|
|
55
|
+
this.getView().setModel(oModel, sName);
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Convenience method for triggering the navigation to a specific target.
|
|
61
|
+
* @public
|
|
62
|
+
* @param sName Target name
|
|
63
|
+
* @param [oParameters] Navigation parameters
|
|
64
|
+
* @param [bReplace] Defines if the hash should be replaced (no browser history entry) or set (browser history entry)
|
|
65
|
+
*/
|
|
66
|
+
public navTo(sName: string, oParameters?: object, bReplace?: boolean): void {
|
|
67
|
+
this.getRouter().navTo(sName, oParameters, undefined, bReplace);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Convenience event handler for navigating back.
|
|
72
|
+
* It there is a history entry we go one step back in the browser history
|
|
73
|
+
* If not, it will replace the current entry of the browser history with the main route.
|
|
74
|
+
*/
|
|
75
|
+
public onNavBack(): void {
|
|
76
|
+
const sPreviousHash = History.getInstance().getPreviousHash();
|
|
77
|
+
if (sPreviousHash !== undefined) {
|
|
78
|
+
window.history.go(-1);
|
|
79
|
+
} else {
|
|
80
|
+
this.getRouter().navTo("main", {}, undefined, true);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BaseController from "./BaseController";<% if (oDataEntitySet) { %><% if (gte1_115_0) { %>
|
|
2
|
+
import {Table$RowSelectionChangeEvent} from "sap/ui/table/Table";<% } else { %>
|
|
3
|
+
import Event from "sap/ui/base/Event";
|
|
4
|
+
import Context from "sap/ui/model/Context";<% } %><% } else { %>
|
|
5
|
+
import MessageBox from "sap/m/MessageBox";<% } %>
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @namespace <%= appId %>.controller
|
|
9
|
+
*/
|
|
10
|
+
export default class Main extends BaseController {<% if (!oDataEntitySet) { %>
|
|
11
|
+
public sayHello(): void {
|
|
12
|
+
MessageBox.show("Hello World!");
|
|
13
|
+
}<% } else { %>
|
|
14
|
+
|
|
15
|
+
onRowSelectionChange(oEvent: <% if (gte1_115_0) { %>Table$RowSelectionChangeEvent<% } else { %>Event<% } %>): void {
|
|
16
|
+
const selectedContext = oEvent.getParameter("rowContext")<% if (!gte1_115_0) { %> as Context<% } %>;
|
|
17
|
+
this.byId("detailForm").setBindingContext(selectedContext);
|
|
18
|
+
}<% } %>
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate" />
|
|
5
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
|
6
|
+
<meta http-equiv="expires" content="0" />
|
|
7
|
+
|
|
8
|
+
<meta charset="utf-8" />
|
|
9
|
+
|
|
10
|
+
<title>UI5 Application: <%= namespace %></title>
|
|
11
|
+
|
|
12
|
+
<script
|
|
13
|
+
id="sap-ui-bootstrap"
|
|
14
|
+
src="https://<%= cdnDomain %>/<%= frameworkVersion %>/resources/sap-ui-core.js"<% if (gte1_120_0) { %>
|
|
15
|
+
data-sap-ui-resource-roots='{
|
|
16
|
+
"<%= appId %>": "./"
|
|
17
|
+
}'
|
|
18
|
+
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
|
|
19
|
+
data-sap-ui-compat-version="edge"
|
|
20
|
+
data-sap-ui-frame-options="trusted"<% } else { %>
|
|
21
|
+
data-sap-ui-theme="<%= defaultTheme %>"
|
|
22
|
+
data-sap-ui-resourceroots='{
|
|
23
|
+
"<%= appId %>": "./"
|
|
24
|
+
}'
|
|
25
|
+
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
|
|
26
|
+
data-sap-ui-compatVersion="edge"
|
|
27
|
+
data-sap-ui-frameOptions="trusted"<% } %>
|
|
28
|
+
data-sap-ui-async="true"
|
|
29
|
+
></script>
|
|
30
|
+
</head>
|
|
31
|
+
|
|
32
|
+
<body class="sapUiBody">
|
|
33
|
+
<div data-sap-ui-component data-name="<%= appId %>"></div>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate" />
|
|
5
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
|
6
|
+
<meta http-equiv="expires" content="0" />
|
|
7
|
+
|
|
8
|
+
<meta charset="utf-8" />
|
|
9
|
+
|
|
10
|
+
<title>UI5 Application: <%= namespace %></title>
|
|
11
|
+
|
|
12
|
+
<script
|
|
13
|
+
id="sap-ui-bootstrap"
|
|
14
|
+
src="resources/sap-ui-core.js"<% if (gte1_120_0) { %>
|
|
15
|
+
data-sap-ui-resource-roots='{
|
|
16
|
+
"<%= appId %>": "./"
|
|
17
|
+
}'
|
|
18
|
+
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
|
|
19
|
+
data-sap-ui-compat-version="edge"
|
|
20
|
+
data-sap-ui-frame-options="trusted"<% } else { %>
|
|
21
|
+
data-sap-ui-theme="<%= defaultTheme %>"
|
|
22
|
+
data-sap-ui-resourceroots='{
|
|
23
|
+
"<%= appId %>": "./"
|
|
24
|
+
}'
|
|
25
|
+
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
|
|
26
|
+
data-sap-ui-compatVersion="edge"
|
|
27
|
+
data-sap-ui-frameOptions="trusted"<% } %>
|
|
28
|
+
data-sap-ui-async="true"
|
|
29
|
+
></script>
|
|
30
|
+
</head>
|
|
31
|
+
|
|
32
|
+
<body class="sapUiBody">
|
|
33
|
+
<div data-sap-ui-component data-name="<%= appId %>"></div>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|