Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion resources/template-js/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"odataVersion": "4.0"
}
}
}<% } %>
}<% } %>,
"sourceTemplate": {
"id": "@ui5/mcp-server:js",
"version": "<%= mcpServerVersion %>"
}
},

"sap.ui": {
Expand Down
6 changes: 5 additions & 1 deletion resources/template-ts/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"odataVersion": "4.0"
}
}
}<% } %>
}<% } %>,
"sourceTemplate": {
"id": "@ui5/mcp-server:ts",
"version": "<%= mcpServerVersion %>"
}
},

"sap.ui": {
Expand Down
3 changes: 2 additions & 1 deletion src/tools/create_ui5_app/create_ui5_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ODataMetadata from "./ODataMetadata.js";
import {CreateUi5AppParams, CreateUi5AppResult} from "./schema.js";
import {getLogger} from "@ui5/logger";
import {isUi5Framework, Ui5Framework} from "../../utils/ui5Framework.js";
import {dirExists, InvalidInputError} from "../../utils.js";
import {dirExists, InvalidInputError, PKG_VERSION} from "../../utils.js";
import isValidUrl from "./isValidUrl.js";

const log = getLogger("tools:create_ui5_app:create_ui5_app");
Expand Down Expand Up @@ -230,6 +230,7 @@ The minimum version for ${framework} is ${minFwkVersionToUse}.`
qunitCoverageFile: semver.gte(frameworkVersion, "1.113.0") ?
"qunit-coverage-istanbul.js" :
"qunit-coverage.js",
mcpServerVersion: PKG_VERSION,
gte1_98_0: semver.gte(frameworkVersion, "1.98.0"),
gte1_100_0: semver.gte(frameworkVersion, "1.100.0"),
gte1_104_0: semver.gte(frameworkVersion, "1.104.0"),
Expand Down
2 changes: 2 additions & 0 deletions src/tools/create_ui5_app/templateProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export interface TemplateVars {
defaultTheme: string;
/** QUnit coverage file - depends on UI5 version */
qunitCoverageFile: string;
/** Version of the MCP server, for source template metadata */
mcpServerVersion: string;
/** Flags for version-specific features */
gte1_98_0: boolean;
gte1_100_0: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"description": "{{appDescription}}",
"applicationVersion": {
"version": "${version}"
},
"sourceTemplate": {
"id": "@ui5/mcp-server:ts",
"version": "0.0.0-test"
}
},

Expand Down
5 changes: 4 additions & 1 deletion test/lib/tools/create_ui5_app/create_ui5_app.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ test.beforeEach(async (t) => {
};
t.context.loggerMock = loggerMock;

// Mock the @ui5/logger module
// Mock the @ui5/logger module and PKG_VERSION
const {createUi5App} = await esmock("../../../../src/tools/create_ui5_app/create_ui5_app.js", {
"@ui5/logger": {
getLogger: t.context.sinon.stub().returns(loggerMock),
isLogLevelEnabled: t.context.sinon.stub().returns(true),
},
"../../../../src/utils.js": {
PKG_VERSION: "0.0.0-test",
},
});

t.context.createUi5App = createUi5App;
Expand Down
2 changes: 2 additions & 0 deletions test/lib/tools/create_ui5_app/create_ui5_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ test.beforeEach(async (t) => {
},
"../../../../src/utils.js": {
dirExists: t.context.dirExists,
PKG_VERSION: "0.0.0-test",
},
});

Expand Down Expand Up @@ -175,6 +176,7 @@ test("All parameters", async (t) => {
gte1_142_0: false,
lt1_110_0: false,
lt1_124_0: false,
mcpServerVersion: "0.0.0-test",
namespace: "com.test.apiapp",
oDataEntitySet: "Products",
oDataV4Url: "https://localhost/odata/v4/service/",
Expand Down