@ui5/mcp-server 0.1.3 → 0.1.4

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +25 -20
  3. package/lib/registerTools.js +4 -0
  4. package/lib/registerTools.js.map +1 -1
  5. package/lib/resources/documentation/getDocumentation.d.ts +1 -1
  6. package/lib/resources/documentation/getDocumentation.js +2 -2
  7. package/lib/resources/documentation/getDocumentation.js.map +1 -1
  8. package/lib/tools/create_integration_card/create_integration_card.d.ts +8 -0
  9. package/lib/tools/create_integration_card/create_integration_card.js +74 -0
  10. package/lib/tools/create_integration_card/create_integration_card.js.map +1 -0
  11. package/lib/tools/create_integration_card/index.d.ts +3 -0
  12. package/lib/tools/create_integration_card/index.js +42 -0
  13. package/lib/tools/create_integration_card/index.js.map +1 -0
  14. package/lib/tools/create_integration_card/schema.d.ts +8 -0
  15. package/lib/tools/create_integration_card/schema.js +20 -0
  16. package/lib/tools/create_integration_card/schema.js.map +1 -0
  17. package/lib/tools/get_integration_cards_guidelines/guidelines.d.ts +1 -0
  18. package/lib/tools/get_integration_cards_guidelines/guidelines.js +6 -0
  19. package/lib/tools/get_integration_cards_guidelines/guidelines.js.map +1 -0
  20. package/lib/tools/get_integration_cards_guidelines/index.d.ts +3 -0
  21. package/lib/tools/get_integration_cards_guidelines/index.js +31 -0
  22. package/lib/tools/get_integration_cards_guidelines/index.js.map +1 -0
  23. package/lib/tools/run_ui5_linter/resultContext.js +1 -1
  24. package/lib/tools/run_ui5_linter/resultContext.js.map +1 -1
  25. package/lib/utils/ui5Manifest.d.ts +1 -0
  26. package/lib/utils/ui5Manifest.js +14 -0
  27. package/lib/utils/ui5Manifest.js.map +1 -0
  28. package/npm-shrinkwrap.json +356 -287
  29. package/package.json +15 -14
  30. package/resources/docs/1.136.11/22f50c0f0b104bf3ba84620880793d3f.md +131 -0
  31. package/resources/docs/1.136.11/738ed025b36e484fa99046d0f80552fd.md +173 -0
  32. package/resources/docs/{1.136.7 → 1.136.11}/index.json +14 -0
  33. package/resources/guidelines.md +6 -0
  34. package/resources/integration_cards_guidelines.md +1679 -0
  35. package/resources/template-card/package.json +12 -0
  36. package/resources/template-card/src/analytical.ejs +157 -0
  37. package/resources/template-card/src/calendar.ejs +90 -0
  38. package/resources/template-card/src/dt/Configuration.js +43 -0
  39. package/resources/template-card/src/i18n/i18n.properties +2 -0
  40. package/resources/template-card/src/list.ejs +27 -0
  41. package/resources/template-card/src/manifest.json +38 -0
  42. package/resources/template-card/src/object.ejs +44 -0
  43. package/resources/template-card/src/table.ejs +36 -0
  44. package/resources/template-card/src/timeline.ejs +42 -0
  45. package/resources/template-card/test/App.js +50 -0
  46. package/resources/template-card/test/index.css +57 -0
  47. package/resources/template-card/test/index.html +45 -0
  48. /package/resources/docs/{1.136.7 → 1.136.11}/00737d6c1b864dc3ab72ef56611491c4.md +0 -0
  49. /package/resources/docs/{1.136.7 → 1.136.11}/0187ea5e2eff4166b0453b9dcc8fc64f.md +0 -0
  50. /package/resources/docs/{1.136.7 → 1.136.11}/032be2cb2e1d4115af20862673bedcdb.md +0 -0
  51. /package/resources/docs/{1.136.7 → 1.136.11}/28fcd55b04654977b63dacbee0552712.md +0 -0
  52. /package/resources/docs/{1.136.7 → 1.136.11}/676b636446c94eada183b1218a824717.md +0 -0
  53. /package/resources/docs/{1.136.7 → 1.136.11}/a87ca843bcee469f82a9072927a7dcdb.md +0 -0
  54. /package/resources/docs/{1.136.7 → 1.136.11}/b0fb4de7364f4bcbb053a99aa645affe.md +0 -0
  55. /package/resources/docs/{1.136.7 → 1.136.11}/fe1a6dba940e479fb7c3bc753f92b28c.md +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ui5/mcp-server",
3
- "version": "0.1.3",
4
- "description": "A MCP server for UI5",
3
+ "version": "0.1.4",
4
+ "description": "MCP server for UI5 application development",
5
5
  "author": {
6
6
  "name": "SAP SE",
7
7
  "email": "openui5@sap.com",
@@ -25,6 +25,7 @@
25
25
  "bin": {
26
26
  "ui5mcp": "bin/ui5mcp.js"
27
27
  },
28
+ "mcpName": "io.github.UI5/mcp-server",
28
29
  "type": "module",
29
30
  "scripts": {
30
31
  "start": "tsx src/cli.ts",
@@ -74,15 +75,15 @@
74
75
  }
75
76
  },
76
77
  "dependencies": {
77
- "@modelcontextprotocol/sdk": "^1.20.0",
78
- "@ui5/linter": "^1.20.2",
78
+ "@modelcontextprotocol/sdk": "^1.20.2",
79
+ "@ui5/linter": "^1.20.5",
79
80
  "@ui5/logger": "^4.0.2",
80
- "@ui5/project": "^4.0.6",
81
+ "@ui5/project": "^4.0.8",
81
82
  "async-mutex": "^0.5.0",
82
83
  "ejs": "^3.1.10",
83
84
  "execa": "^9.6.0",
84
- "fast-xml-parser": "^5.3.0",
85
- "globby": "^14.1.0",
85
+ "fast-xml-parser": "^5.3.2",
86
+ "globby": "^16.0.0",
86
87
  "lockfile": "^1.0.4",
87
88
  "make-fetch-happen": "^14.0.3",
88
89
  "semver": "^7.7.3",
@@ -91,31 +92,31 @@
91
92
  "devDependencies": {
92
93
  "@commitlint/cli": "^20.1.0",
93
94
  "@commitlint/config-conventional": "^20.0.0",
94
- "@eslint/js": "^9.36.0",
95
+ "@eslint/js": "^9.39.1",
95
96
  "@istanbuljs/esm-loader-hook": "^0.3.0",
96
97
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
97
- "@modelcontextprotocol/inspector": "^0.17.1",
98
- "@stylistic/eslint-plugin": "^5.4.0",
98
+ "@modelcontextprotocol/inspector": "^0.17.2",
99
+ "@stylistic/eslint-plugin": "^5.6.0",
99
100
  "@types/ejs": "^3.1.5",
100
101
  "@types/make-fetch-happen": "^10.0.4",
101
102
  "@types/node": "20.16.15",
102
103
  "@types/semver": "^7.7.1",
103
- "@types/sinon": "^17.0.4",
104
+ "@types/sinon": "^21.0.0",
104
105
  "@types/yauzl-promise": "^4.0.1",
105
106
  "@ui5-language-assistant/semantic-model-types": "^3.3.1",
106
107
  "ava": "^6.3.0",
107
108
  "depcheck": "^1.4.7",
108
- "eslint": "^9.37.0",
109
+ "eslint": "^9.39.1",
109
110
  "eslint-plugin-ava": "^15.0.1",
110
111
  "esmock": "^2.7.3",
111
112
  "husky": "^9.1.7",
112
113
  "licensee": "^11.1.1",
113
114
  "nyc": "^17.1.0",
114
- "rimraf": "^6.0.1",
115
+ "rimraf": "^6.1.0",
115
116
  "sinon": "^21.0.0",
116
117
  "tsx": "^4.20.6",
117
118
  "typescript": "^5.9.3",
118
- "typescript-eslint": "^8.46.1",
119
+ "typescript-eslint": "^8.47.0",
119
120
  "yauzl-promise": "^4.0.0"
120
121
  }
121
122
  }
@@ -0,0 +1,131 @@
1
+ # Concept and Basic Setup
2
+
3
+ To apply the test starter concept to your SAPUI5 project, you need to create a test suite and a generic test page that allows for the running of one or multiple test modules.
4
+
5
+ > ### Note:
6
+ > For SAPUI5 applications, the test suite and the generic test page are typically placed in the `webapp/test` folder. The code samples in the next sections use `<NAMESPACE>` as a placeholder for your SAPUI5 project namespace. Please replace this placeholder with your SAPUI5 project namespace defined in the `sap.app/id` property in the `manifest.json` file by replacing the '.' with '/', for example `my.ui5app` becomes `my/ui5app`. However, for the `<NAMESPACE-WITH-DOTS>` in `data-sap-ui-resource-roots`, use the exact value of `sap.app/id` \(separated by dots\).
7
+
8
+ ## The UI5 Test Suite
9
+
10
+ A test suite configures the environment for the tests. It consists of a `*.qunit.html` page often named `testsuite.qunit.html` and a corresponding `*.qunit.js` module.
11
+
12
+ The default naming convention for the test suite is `testsuite.qunit.html` and `testsuite.qunit.js`.
13
+
14
+ There can be multiple test suites in a project. When adding more test suites, the naming must follow the pattern `testsuite.<name>.qunit.html` / `testsuite.<name>.qunit.js`.
15
+
16
+ ### The UI5 Test Suite Page
17
+
18
+ The test suite page uses the `sap/ui/test/starter/createSuite.js` script to initialize the test suite in a way which is compliant to the content security policy, based on the externalized test configuration provided in the test suite module.
19
+
20
+ Unlike with the UI5 bootstrap, this script only accepts a limited set of configuration options:
21
+
22
+ - The `data-sap-ui-testsuite` attribute specifies the test suite module.
23
+
24
+ - The`data-sap-ui-resource-roots` attribute registers the project-specific namespaces, allowing the test suite modules to load from the correct locations. Note that, unlike module names, this configuration requires namespaces to be separated by dots.
25
+
26
+ ```
27
+
28
+ <!DOCTYPE html>
29
+ <html>
30
+ <head>
31
+ <meta charset="utf-8">
32
+ <title>QUnit test suite for NAMESPACE</title>
33
+ <script
34
+ src="../resources/sap/ui/test/starter/createSuite.js"
35
+ data-sap-ui-testsuite="test-resources/<NAMESPACE>/testsuite.qunit"
36
+ data-sap-ui-resource-roots='{
37
+ "test-resources.<NAMESPACE-WITH-DOTS>": "./"
38
+ }'
39
+ ></script>
40
+ </head>
41
+ <body>
42
+ </body>
43
+ </html>
44
+
45
+ ```
46
+
47
+ ### The UI5 Test Suite Module
48
+
49
+ The test suite module represents the configuration file for the UI5 test suite. The module must return a configuration object in the following basic structure:
50
+
51
+ - The `name` property represents the name of the test suite and is displayed in the test suite overview page as title.
52
+
53
+ - The `defaults` object contains the default [Configuration Options](configuration-options-738ed02.md) for tests.
54
+
55
+ - The `tests` object contains the definition and configuration for the individual test modules. Configuration of the individual test modules can override the default configuration. For more information on how to add a defined test module to an existing test suite, see [Creating a QUnit Test](creating-a-qunit-test-7080029.md).
56
+
57
+ ```
58
+ sap.ui.define(() => {
59
+ "use strict";
60
+
61
+ return {
62
+ name: "QUnit test suite for NAMESPACE",
63
+ defaults: {},
64
+ tests: {}
65
+ };
66
+ });
67
+ ```
68
+
69
+
70
+ Here is an example of a test suite module that provides default configuration for third-party modules QUnit and `sinon`. We recommend setting the version manually to prevent test failures when SAPUI5 upgrades a third-party module to a new major version with breaking changes. By default, the latest available versions are used.
71
+
72
+ It also provides [Configuration of the SAPUI5 Runtime](configuration-of-the-sapui5-runtime-91f08de.md) at `ui5` to set the theme to `sap_horizon`. The `loader.paths` configuration is used to map the project-specific namespace to the correct location. Unlike the `data-sap-ui-resource-roots` configuration in the test suite page which only registers the`test-resources` namespace, this configuration maps the productive namespace to the parent folder \(assuming the test suite is placed within `webapp/fitest`\). The generic test `page` mentioned in the next section uses query parameters to run individual tests. The placeholders `{suite}` and `{name}` are replaced with the suite and test names, respectively.
73
+
74
+ ```
75
+
76
+ sap.ui.define(function () {
77
+ "use strict";
78
+
79
+ return {
80
+ name: "QUnit test suite for NAMESPACE",
81
+ defaults: {
82
+ page: "ui5://test-resources/<NAMESPACE>/Test.qunit.html?testsuite={suite}&test={name}",
83
+ qunit: {
84
+ version: 2,
85
+ },
86
+ sinon: {
87
+ version: 4,
88
+ },
89
+ ui5: {
90
+ theme: "sap_horizon",
91
+ },
92
+ loader: {
93
+ paths: {
94
+ "<NAMESPACE>": "../",
95
+ },
96
+ },
97
+ },
98
+ tests: {},
99
+ };
100
+ });
101
+ ```
102
+
103
+ The `tests` object is empty for now. For more information on how to add a defined test module to an existing test suite, see [Adding a QUnit Test Module to a Test Suite](creating-a-qunit-test-7080029.md#loio708002929ea548fd9433954a9275eb5f__section_hp4_xhn_vcc).
104
+
105
+ ## The Generic Test Page
106
+
107
+ The generic test page is used to run individual tests. Typically, this file is named `Test.qunit.html`.
108
+
109
+ It includes the `sap/ui/test/starter/runTest.js` script which is responsible for loading the test suite configuration and starting the test. In the test suite module, the page is configured as `page`. It receives test suite and test name through query parameters to run a test.
110
+
111
+ Unlike the UI5 bootstrap, the generic test page only accepts the `data-sap-ui-resource-roots` configuration where project-specific namespaces should be registered. All other UI5 configuration must be provided in the test suite module as described above \(`ui5` property\).
112
+
113
+ ```
114
+
115
+ <!DOCTYPE html>
116
+ <html>
117
+ <head>
118
+ <meta charset="utf-8">
119
+ <script
120
+ src="../resources/sap/ui/test/starter/runTest.js"
121
+ data-sap-ui-resource-roots='{
122
+ "test-resources.<NAMESPACE-WITH-DOTS>": "./"
123
+ }'
124
+ ></script>
125
+ </head>
126
+ <body class="sapUiBody">
127
+ <div id="qunit"></div>
128
+ <div id="qunit-fixture"></div>
129
+ </body>
130
+ </html>
131
+ ```
@@ -0,0 +1,173 @@
1
+ # Configuration Options
2
+
3
+ The UI5 test suite module contains the configuration for the UI5 test suite.
4
+
5
+ ## **Available Options and Default Values**
6
+
7
+ The following options are available on the `defaults` and the individual test configuration objects:
8
+
9
+ > ### Note:
10
+ > The values used in the following code are the default values and are used as a fallback for options that are not defined in the configuration file - neither in the `defaults` object, nor in an individual test configuration object.
11
+
12
+ ```
13
+
14
+ {
15
+ /*
16
+ * ID(s) of the module(s) to load.
17
+ *
18
+ * Can either be a single string or an array of strings.
19
+ * Each string might start with a leading "./"
20
+ * when the test module is located in the same folder
21
+ * as the testsuite configuration.
22
+ * You can use the following placeholder:
23
+ * {name} - name of the current test module
24
+ */
25
+ module: "./{name}.qunit",
26
+
27
+
28
+ /*
29
+ * URL of the test page to start for this test.
30
+ *
31
+ * By default, all tests use the generic starter page which reads the suite
32
+ * configuration, finds the tests and starts the configured test components
33
+ * before it requires and executes the configured test module(s).
34
+ *
35
+ * The URL must be relative to the application root and can use the following
36
+ * placeholders, enclosed in curly braces:
37
+ * {suite} - name of the testsuite (configuration)
38
+ * {name} - name of the current test module
39
+ */
40
+ page: "resources/sap/ui/test/starter/Test.qunit.html?testsuite={suite}&test={name}",
41
+
42
+
43
+ /*
44
+ * Title of the test.
45
+ * The URL must be relative to the application root and can use the following
46
+ * placeholders, enclosed in curly braces:
47
+ * {suite} - name of the testsuite (configuration)
48
+ * {name} - name of the current test module
49
+ */
50
+ title: "QUnit tests '{name}' of suite '{suite}'",
51
+
52
+
53
+ /*
54
+ * QUnit configuration.
55
+ *
56
+ * Either can be a null or false or an object with the properties documented below.
57
+ * The values null and false are equivalent to the object { version: null }
58
+ */
59
+ qunit: {
60
+ /*
61
+ * Version of QUnit that should be loaded.
62
+ * If set to a null, QUnit won't be loaded.
63
+ * If set to "edge", the newest available version of QUnit will be used.
64
+ * If set to a number, the corresponding version of QUnit will be used if supported.
65
+ * Currently supported versions are 1 and 2, an error will be thrown for unsupported versions.
66
+ */
67
+ version: "edge",
68
+
69
+ /*
70
+ * Most statically configurable options from QUnit.config can be configured,
71
+ * e.g. reorder, blocking etc.
72
+ * Note that 'autostart' is an exception. To avoid timing issues with asynchronous test
73
+ * loading, 'autostart' will always be set to false. Only after all tests have been loaded,
74
+ * QUnit.start() will be called, either by the generic test starter or by the test module itself,
75
+ * see the general test option 'autostart' below.
76
+ */
77
+ // reorder: true // only serves as an example, not part of the internal defaults of the starter
78
+ },
79
+
80
+ /*
81
+ * Sinon.JS configuration.
82
+ *
83
+ * Either can be a null or false or an object with the properties documented below.
84
+ * The values null and false are equivalent to the object { version: null }
85
+ */
86
+ sinon: {
87
+
88
+ /*
89
+ * Version of Sinon.JS that should be loaded.
90
+ * If set to null, Sinon won't be loaded.
91
+ * If set to "edge", the newest available version of Sinon will be used.
92
+ * If set to a number, the corresponding version of Sinon will be used if supported.
93
+ * Currently supported are versions 1 and 4, an error will be thrown for unsupported versions.
94
+ */
95
+ version: "edge",
96
+
97
+ /*
98
+ * Whether one of the sinon-qunit bridges will be loaded.
99
+ * When set to true, the sap/ui/thirdparty/sinon-qunit bridge will be loaded for Sinon 1
100
+ * and the sap/ui/qunit/sinon-qunit-bridge will be loaded for newer versions of Sinon.
101
+ *
102
+ * The bridge will only be loaded after both, QUnit and Sinon.JS have been loaded.
103
+ * If either QUnit or Sinon.JS are not loaded, no bridge will be loaded.
104
+ *
105
+ * If Sinon.JS is not loaded, but QUnit, the bridge will not be loaded, but a shim
106
+ * with dependencies will be configured. This allows tests to load Sinon.JS/the bridge on
107
+ * their own without taking care of the bridge dependencies.
108
+ */
109
+ qunitBridge: true,
110
+
111
+
112
+ /*
113
+ * Any other statically configurable Sinon option can be specified as well.
114
+ * Note that they only play a role when a sandbox is used.
115
+ */
116
+ useFakeTimers: false,
117
+ useFakeServer: false
118
+ },
119
+
120
+
121
+ /*
122
+ * Code coverage options.
123
+ * The qunit-coverage module will always be loaded after QUnit has been loaded to enable the coverage
124
+ * option. When the 'coverage' parameter is set in the URL (e.g. because the coverage checkbox has been
125
+ * clicked), then blanket will be loaded before qunit-coverage to avoid synchronous loading of it.
126
+ */
127
+ coverage: {
128
+ only: null,
129
+ never: null,
130
+ branchTracking: false
131
+ },
132
+
133
+ /*
134
+ * UI5 runtime configuration options.
135
+ *
136
+ * All properties will be copied to window["sap-ui-config"].
137
+ * If window["sap-ui-config"] doesn't support it or if the value is of a type
138
+ * not supported for window["sap-ui-config"], executing the UI5 Core might fail.
139
+ *
140
+ * Only exception for now: the libs property can be an array of library names,
141
+ * not only a comma separated string.
142
+ *
143
+ * To ease test development, the following defaults are defined by the test starter:
144
+ */
145
+ ui5: {
146
+ noConflict: true,
147
+ libs: [],
148
+ theme: "default"
149
+ },
150
+
151
+ /*
152
+ * UI5 Loader configuration.
153
+ *
154
+ * The provided configuration will be passed to `sap.ui.loader.config` and can be used to
155
+ * configure paths, shims, and other loader configuration.
156
+ */
157
+ loader: {},
158
+
159
+ /*
160
+ * Whether the test starter should call QUnit.start() after all prerequisites have been fulfilled
161
+ * (e.g. QUnit, Sinon, a bridge, have been loaded, coverage tooling has been loaded and configured,
162
+ * the Core has been booted, the test modules have been loaded and executed).
163
+ */
164
+ autostart: true,
165
+
166
+
167
+ /*
168
+ * Whether the test starter should skip a test file. Such tests will remain in the overview list,
169
+ * but won't be executed in the test suite.
170
+ */
171
+ skip: false
172
+ };
173
+ ```
@@ -54,5 +54,19 @@
54
54
  "uri": "https://ui5.sap.com/1.136.7/topic/032be2cb2e1d4115af20862673bedcdb",
55
55
  "title": "Test Starter",
56
56
  "filePath": "032be2cb2e1d4115af20862673bedcdb.md"
57
+ },
58
+ {
59
+ "shortIdentifier": "22f50c0",
60
+ "identifier": "22f50c0f0b104bf3ba84620880793d3f",
61
+ "uri": "https://ui5.sap.com/1.136.7/topic/22f50c0f0b104bf3ba84620880793d3f",
62
+ "title": "Concept and Basic Setup",
63
+ "filePath": "22f50c0f0b104bf3ba84620880793d3f.md"
64
+ },
65
+ {
66
+ "shortIdentifier": "738ed02",
67
+ "identifier": "738ed025b36e484fa99046d0f80552fd",
68
+ "uri": "https://ui5.sap.com/1.136.7/topic/738ed025b36e484fa99046d0f80552fd",
69
+ "title": "Configuration Options",
70
+ "filePath": "738ed025b36e484fa99046d0f80552fd.md"
57
71
  }
58
72
  ]
@@ -102,3 +102,9 @@ When creating a new UI5 project within a CAP project, a specific set of rules ap
102
102
  - **NEVER** configure a `ui5-middleware-simpleproxy` in the `ui5.yaml` file to connect to the local CAP service.
103
103
  - **Why:** The `cds watch` command ensures the UI and the service are served from the same origin (`http://localhost:4004`), making a proxy unnecessary.
104
104
  - **Accessing the App:** Check the CAP launch page (typically `http://localhost:4004`) for a list of available services and links to the UI5 applications.
105
+
106
+ ## 4. Rules to create a Form
107
+
108
+ - **Never** use sap.ui.layout.form.SimpleForm unless requested explicitly
109
+ - **Always** use a sap.ui.layout.form.Form. Use sap.ui.layout.form.ColumnLayout as layout for the Form.
110
+ - **Always** use 2 columns as default for M-size, 3 columns as default for L-size, 4 columns as default for XL-size if not requested differently.