@sap-ux/cf-deploy-config-writer 0.3.97 → 0.3.99
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/dist/mta-config/index.js
CHANGED
|
@@ -26,10 +26,9 @@ exports.doesCDSBinaryExist = doesCDSBinaryExist;
|
|
|
26
26
|
exports.validateMtaConfig = validateMtaConfig;
|
|
27
27
|
exports.addRoutingConfig = addRoutingConfig;
|
|
28
28
|
exports.generateCAPMTA = generateCAPMTA;
|
|
29
|
-
const node_fs_1 = require("node:fs");
|
|
30
29
|
const node_path_1 = require("node:path");
|
|
31
|
-
const ejs_1 = require("ejs");
|
|
32
30
|
const mta_1 = require("./mta");
|
|
31
|
+
const template_renderer_1 = require("./template-renderer");
|
|
33
32
|
const utils_1 = require("../utils");
|
|
34
33
|
const constants_1 = require("../constants");
|
|
35
34
|
const wait_for_mta_1 = require("./wait-for-mta");
|
|
@@ -88,15 +87,13 @@ function toMtaModuleName(appId) {
|
|
|
88
87
|
*/
|
|
89
88
|
function createMTA(config) {
|
|
90
89
|
const mtaId = `${config.mtaId.slice(0, constants_1.MAX_MTA_ID_LENGTH)}`;
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
config.mtaId = mtaId;
|
|
91
|
+
// Written to disk immediately! Subsequent calls are dependent on it being on the file system i.e mta-lib.
|
|
92
|
+
(0, template_renderer_1.renderTemplateToDisk)(`app/${project_access_1.FileName.MtaYaml}`, (0, node_path_1.join)(config.mtaPath, project_access_1.FileName.MtaYaml), {
|
|
93
93
|
id: mtaId,
|
|
94
94
|
mtaDescription: config.mtaDescription ?? constants_1.MTADescription,
|
|
95
95
|
mtaVersion: config.mtaVersion ?? constants_1.MTAVersion
|
|
96
96
|
});
|
|
97
|
-
config.mtaId = mtaId;
|
|
98
|
-
// Written to disk immediately! Subsequent calls are dependent on it being on the file system i.e mta-lib.
|
|
99
|
-
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(config.mtaPath, project_access_1.FileName.MtaYaml), mtaContents);
|
|
100
97
|
logger_helper_1.default.logger?.debug((0, i18n_1.t)('debug.mtaCreated', { mtaPath: config.mtaPath }));
|
|
101
98
|
}
|
|
102
99
|
/**
|
|
@@ -157,14 +154,12 @@ function validateMtaConfig(config) {
|
|
|
157
154
|
* @deprecated This function is deprecated and will be removed in future releases
|
|
158
155
|
*/
|
|
159
156
|
async function createCAPMTAAppFrontend(config, fs) {
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
// Written to disk immediately! Subsequent calls are dependent on it being on the file system i.e mta-lib.
|
|
158
|
+
(0, template_renderer_1.renderTemplateToDisk)(`frontend/${project_access_1.FileName.MtaYaml}`, (0, node_path_1.join)(config.mtaPath, project_access_1.FileName.MtaYaml), {
|
|
162
159
|
id: `${config.mtaId.slice(0, constants_1.MAX_MTA_ID_LENGTH)}`,
|
|
163
160
|
mtaDescription: config.mtaDescription ?? constants_1.MTADescription,
|
|
164
161
|
mtaVersion: config.mtaVersion ?? constants_1.MTAVersion
|
|
165
162
|
});
|
|
166
|
-
// Written to disk immediately! Subsequent calls are dependent on it being on the file system i.e mta-lib.
|
|
167
|
-
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(config.mtaPath, project_access_1.FileName.MtaYaml), mtaContents);
|
|
168
163
|
// Add missing configurations
|
|
169
164
|
(0, utils_1.addXSSecurityConfig)(config, fs, false);
|
|
170
165
|
logger_helper_1.default.logger?.debug((0, i18n_1.t)('debug.mtaCreated', { mtaPath: config.mtaPath }));
|
package/dist/mta-config/mta.js
CHANGED
|
@@ -6,7 +6,6 @@ exports.useAbapDirectServiceBinding = useAbapDirectServiceBinding;
|
|
|
6
6
|
const node_util_1 = require("node:util");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
|
-
const ejs_1 = require("ejs");
|
|
10
9
|
const mta_lib_1 = require("@sap/mta-lib");
|
|
11
10
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
12
11
|
const yaml_1 = require("@sap-ux/yaml");
|
|
@@ -14,6 +13,7 @@ const project_access_1 = require("@sap-ux/project-access");
|
|
|
14
13
|
const constants_1 = require("../constants");
|
|
15
14
|
const i18n_1 = require("../i18n");
|
|
16
15
|
const types_1 = require("../types");
|
|
16
|
+
const template_renderer_1 = require("./template-renderer");
|
|
17
17
|
/**
|
|
18
18
|
* A class representing interactions with the MTA binary, found at https://sap.github.io/cloud-mta-build-tool/.
|
|
19
19
|
*/
|
|
@@ -791,8 +791,7 @@ class MtaConfig {
|
|
|
791
791
|
destinationServiceName: destinationServiceName,
|
|
792
792
|
mtaVersion: '1.0.0'
|
|
793
793
|
};
|
|
794
|
-
|
|
795
|
-
(0, node_fs_1.writeFileSync)(mtaExtFilePath, (0, ejs_1.render)(mtaExtTemplate, mtaExt));
|
|
794
|
+
(0, template_renderer_1.renderTemplateToDisk)(`app/${project_access_1.FileName.MtaExtYaml}`, mtaExtFilePath, mtaExt);
|
|
796
795
|
this.log?.info((0, i18n_1.t)('info.mtaExtensionCreated', { appMtaId, mtaExtFile: project_access_1.FileName.MtaExtYaml }));
|
|
797
796
|
}
|
|
798
797
|
else {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render an EJS template directly to disk.
|
|
3
|
+
* Intentionally bypasses mem-fs — mta-lib and other consumers require the file to be
|
|
4
|
+
* physically present on the file system before they can read it back.
|
|
5
|
+
*
|
|
6
|
+
* @param templateName Template path relative to the `templates/` folder (e.g. `app/mta.yaml`)
|
|
7
|
+
* @param outputPath Absolute path where the rendered file will be written
|
|
8
|
+
* @param data Template data object passed to EJS
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderTemplateToDisk(templateName: string, outputPath: string, data: Record<string, unknown>): void;
|
|
11
|
+
//# sourceMappingURL=template-renderer.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderTemplateToDisk = renderTemplateToDisk;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const ejs_1 = require("ejs");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
/**
|
|
8
|
+
* Render an EJS template directly to disk.
|
|
9
|
+
* Intentionally bypasses mem-fs — mta-lib and other consumers require the file to be
|
|
10
|
+
* physically present on the file system before they can read it back.
|
|
11
|
+
*
|
|
12
|
+
* @param templateName Template path relative to the `templates/` folder (e.g. `app/mta.yaml`)
|
|
13
|
+
* @param outputPath Absolute path where the rendered file will be written
|
|
14
|
+
* @param data Template data object passed to EJS
|
|
15
|
+
*/
|
|
16
|
+
function renderTemplateToDisk(templateName, outputPath, data) {
|
|
17
|
+
const template = (0, node_fs_1.readFileSync)((0, utils_1.getTemplatePath)(templateName), 'utf-8');
|
|
18
|
+
(0, node_fs_1.writeFileSync)(outputPath, (0, ejs_1.render)(template, data));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=template-renderer.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/cf-deploy-config-writer",
|
|
3
3
|
"description": "Add or amend Cloud Foundry and ABAP deployment configuration for SAP projects",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.99",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"hasbin": "1.2.3",
|
|
32
32
|
"@sap-ux/project-access": "1.35.20",
|
|
33
33
|
"@sap-ux/yaml": "0.17.7",
|
|
34
|
-
"@sap-ux/btp-utils": "1.1.
|
|
34
|
+
"@sap-ux/btp-utils": "1.1.14",
|
|
35
35
|
"@sap-ux/logger": "0.8.5",
|
|
36
36
|
"@sap-ux/ui5-config": "0.30.3",
|
|
37
|
-
"@sap-ux/nodejs-utils": "0.2.
|
|
37
|
+
"@sap-ux/nodejs-utils": "0.2.21"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/ejs": "3.1.5",
|