@sap-ux/adp-tooling 0.11.13 → 0.12.1
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/base/abap.js +21 -33
- package/dist/base/change-utils.js +3 -5
- package/dist/base/prompt.js +137 -154
- package/dist/i18n.js +13 -24
- package/dist/preview/adp-preview.js +58 -62
- package/dist/preview/change-handler.js +2 -2
- package/dist/preview/routes-handler.js +151 -159
- package/dist/writer/changes/writer-factory.js +8 -8
- package/dist/writer/changes/writers/annotations-writer.js +8 -17
- package/dist/writer/changes/writers/component-usages-writer.js +13 -22
- package/dist/writer/changes/writers/data-source-writer.js +16 -26
- package/dist/writer/changes/writers/inbound-writer.js +20 -26
- package/dist/writer/changes/writers/new-model-writer.js +6 -15
- package/dist/writer/editors.js +7 -18
- package/dist/writer/index.js +50 -66
- package/dist/writer/options.js +15 -17
- package/dist/writer/project-utils.js +26 -40
- package/package.json +9 -9
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.NewModelWriter = void 0;
|
|
13
4
|
const project_access_1 = require("@sap-ux/project-access");
|
|
@@ -16,6 +7,8 @@ const change_utils_1 = require("../../../base/change-utils");
|
|
|
16
7
|
* Handles the creation and writing of new sapui5 model data changes for a project.
|
|
17
8
|
*/
|
|
18
9
|
class NewModelWriter {
|
|
10
|
+
fs;
|
|
11
|
+
projectPath;
|
|
19
12
|
/**
|
|
20
13
|
* @param {Editor} fs - The filesystem editor instance.
|
|
21
14
|
* @param {string} projectPath - The root path of the project.
|
|
@@ -68,12 +61,10 @@ class NewModelWriter {
|
|
|
68
61
|
* @param {NewModelData} data - The new model data containing all the necessary information to construct and write the change.
|
|
69
62
|
* @returns {Promise<void>} A promise that resolves when the change writing process is completed.
|
|
70
63
|
*/
|
|
71
|
-
write(data) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(0, change_utils_1.writeChangeToFolder)(this.projectPath, change, `id_${data.timestamp}_addNewModel.change`, this.fs, project_access_1.DirName.Manifest);
|
|
76
|
-
});
|
|
64
|
+
async write(data) {
|
|
65
|
+
const content = this.constructContent(data);
|
|
66
|
+
const change = (0, change_utils_1.getChange)(data.projectData, data.timestamp, content, "appdescr_ui5_addNewModel" /* ChangeType.ADD_NEW_MODEL */);
|
|
67
|
+
(0, change_utils_1.writeChangeToFolder)(this.projectPath, change, `id_${data.timestamp}_addNewModel.change`, this.fs, project_access_1.DirName.Manifest);
|
|
77
68
|
}
|
|
78
69
|
}
|
|
79
70
|
exports.NewModelWriter = NewModelWriter;
|
package/dist/writer/editors.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.generateChange = void 0;
|
|
13
4
|
const mem_fs_1 = require("mem-fs");
|
|
@@ -27,15 +18,13 @@ const writer_factory_1 = require("./changes/writer-factory");
|
|
|
27
18
|
* @returns {Promise<Editor>} A promise that resolves to the mem-fs editor instance used for making changes, allowing for further operations or committing changes to disk.
|
|
28
19
|
* @template T - A type parameter extending `ChangeType`, ensuring the function handles a defined set of generator types.
|
|
29
20
|
*/
|
|
30
|
-
function generateChange(projectPath, type, data, fs = null) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return fs;
|
|
38
|
-
});
|
|
21
|
+
async function generateChange(projectPath, type, data, fs = null) {
|
|
22
|
+
if (!fs) {
|
|
23
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
24
|
+
}
|
|
25
|
+
const writer = writer_factory_1.WriterFactory.createWriter(type, fs, projectPath);
|
|
26
|
+
await writer.write(data);
|
|
27
|
+
return fs;
|
|
39
28
|
}
|
|
40
29
|
exports.generateChange = generateChange;
|
|
41
30
|
//# sourceMappingURL=editors.js.map
|
package/dist/writer/index.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.migrate = exports.generate = void 0;
|
|
13
4
|
const path_1 = require("path");
|
|
@@ -23,22 +14,20 @@ const tmplPath = (0, path_1.join)(__dirname, '../../templates/project');
|
|
|
23
14
|
* @returns enhanced configuration with default values
|
|
24
15
|
*/
|
|
25
16
|
function setDefaults(config) {
|
|
26
|
-
var _a, _b, _c, _d, _e;
|
|
27
|
-
var _f, _g, _h, _j;
|
|
28
17
|
const configWithDefaults = {
|
|
29
|
-
app:
|
|
30
|
-
target:
|
|
31
|
-
ui5:
|
|
32
|
-
deploy: config.deploy ?
|
|
33
|
-
options:
|
|
34
|
-
flp: config.flp ?
|
|
35
|
-
customConfig: config.customConfig ?
|
|
18
|
+
app: { ...config.app },
|
|
19
|
+
target: { ...config.target },
|
|
20
|
+
ui5: { ...config.ui5 },
|
|
21
|
+
deploy: config.deploy ? { ...config.deploy } : undefined,
|
|
22
|
+
options: { ...config.options },
|
|
23
|
+
flp: config.flp ? { ...config.flp } : undefined,
|
|
24
|
+
customConfig: config.customConfig ? { ...config.customConfig } : undefined
|
|
36
25
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
configWithDefaults.app.title ??= `Adaptation of ${config.app.reference}`;
|
|
27
|
+
configWithDefaults.app.layer ??= 'CUSTOMER_BASE';
|
|
28
|
+
configWithDefaults.package ??= config.package ? { ...config.package } : {};
|
|
29
|
+
configWithDefaults.package.name ??= config.app.id.toLowerCase().replace(/\./g, '-');
|
|
30
|
+
configWithDefaults.package.description ??= configWithDefaults.app.title;
|
|
42
31
|
if (configWithDefaults.flp && !configWithDefaults.flp.inboundId) {
|
|
43
32
|
configWithDefaults.flp.addInboundId = true;
|
|
44
33
|
configWithDefaults.flp.inboundId = `${configWithDefaults.app.id}.InboundID`;
|
|
@@ -53,21 +42,18 @@ function setDefaults(config) {
|
|
|
53
42
|
* @param fs - the memfs editor instance
|
|
54
43
|
* @returns the updated memfs editor instance
|
|
55
44
|
*/
|
|
56
|
-
function generate(basePath, config, fs) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
yield (0, project_utils_1.writeUI5Yaml)(basePath, fullConfig, fs);
|
|
69
|
-
return fs;
|
|
70
|
-
});
|
|
45
|
+
async function generate(basePath, config, fs) {
|
|
46
|
+
if (!fs) {
|
|
47
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
48
|
+
}
|
|
49
|
+
const fullConfig = setDefaults(config);
|
|
50
|
+
if (fullConfig.customConfig?.adp.environment === 'C' && fullConfig.flp) {
|
|
51
|
+
(0, options_1.enhanceManifestChangeContentWithFlpConfig)(fullConfig.flp, fullConfig.app.id, fullConfig.app.content);
|
|
52
|
+
}
|
|
53
|
+
(0, project_utils_1.writeTemplateToFolder)((0, path_1.join)(tmplPath, '**/*.*'), (0, path_1.join)(basePath), fullConfig, fs);
|
|
54
|
+
await (0, project_utils_1.writeUI5DeployYaml)(basePath, fullConfig, fs);
|
|
55
|
+
await (0, project_utils_1.writeUI5Yaml)(basePath, fullConfig, fs);
|
|
56
|
+
return fs;
|
|
71
57
|
}
|
|
72
58
|
exports.generate = generate;
|
|
73
59
|
/**
|
|
@@ -78,35 +64,33 @@ exports.generate = generate;
|
|
|
78
64
|
* @param fs - the memfs editor instance
|
|
79
65
|
* @returns the updated memfs editor instance
|
|
80
66
|
*/
|
|
81
|
-
function migrate(basePath, config, fs) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
globOptions: { dot: true }
|
|
90
|
-
});
|
|
91
|
-
fs.copyTpl((0, path_1.join)(tmplPath, '**/package.json'), (0, path_1.join)(basePath), fullConfig, undefined, {
|
|
92
|
-
globOptions: { dot: true }
|
|
93
|
-
});
|
|
94
|
-
fs.copyTpl((0, path_1.join)(tmplPath, '**/gitignore.tmpl'), (0, path_1.join)(basePath), fullConfig, undefined, {
|
|
95
|
-
globOptions: { dot: true },
|
|
96
|
-
processDestinationPath: (filePath) => filePath.replace(/gitignore.tmpl/g, '.gitignore')
|
|
97
|
-
});
|
|
98
|
-
// delete .che folder
|
|
99
|
-
if (fs.exists((0, path_1.join)(basePath, '.che/project.json'))) {
|
|
100
|
-
fs.delete((0, path_1.join)(basePath, '.che/*'));
|
|
101
|
-
}
|
|
102
|
-
// delete neo-app.json
|
|
103
|
-
if (fs.exists((0, path_1.join)(basePath, 'neo-app.json'))) {
|
|
104
|
-
fs.delete((0, path_1.join)(basePath, 'neo-app.json'));
|
|
105
|
-
}
|
|
106
|
-
yield (0, project_utils_1.writeUI5Yaml)(basePath, fullConfig, fs);
|
|
107
|
-
yield (0, project_utils_1.writeUI5DeployYaml)(basePath, fullConfig, fs);
|
|
108
|
-
return fs;
|
|
67
|
+
async function migrate(basePath, config, fs) {
|
|
68
|
+
if (!fs) {
|
|
69
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
70
|
+
}
|
|
71
|
+
const fullConfig = setDefaults(config);
|
|
72
|
+
// Copy the specified files to target project
|
|
73
|
+
fs.copyTpl((0, path_1.join)(tmplPath, '**/ui5.yaml'), (0, path_1.join)(basePath), fullConfig, undefined, {
|
|
74
|
+
globOptions: { dot: true }
|
|
109
75
|
});
|
|
76
|
+
fs.copyTpl((0, path_1.join)(tmplPath, '**/package.json'), (0, path_1.join)(basePath), fullConfig, undefined, {
|
|
77
|
+
globOptions: { dot: true }
|
|
78
|
+
});
|
|
79
|
+
fs.copyTpl((0, path_1.join)(tmplPath, '**/gitignore.tmpl'), (0, path_1.join)(basePath), fullConfig, undefined, {
|
|
80
|
+
globOptions: { dot: true },
|
|
81
|
+
processDestinationPath: (filePath) => filePath.replace(/gitignore.tmpl/g, '.gitignore')
|
|
82
|
+
});
|
|
83
|
+
// delete .che folder
|
|
84
|
+
if (fs.exists((0, path_1.join)(basePath, '.che/project.json'))) {
|
|
85
|
+
fs.delete((0, path_1.join)(basePath, '.che/*'));
|
|
86
|
+
}
|
|
87
|
+
// delete neo-app.json
|
|
88
|
+
if (fs.exists((0, path_1.join)(basePath, 'neo-app.json'))) {
|
|
89
|
+
fs.delete((0, path_1.join)(basePath, 'neo-app.json'));
|
|
90
|
+
}
|
|
91
|
+
await (0, project_utils_1.writeUI5Yaml)(basePath, fullConfig, fs);
|
|
92
|
+
await (0, project_utils_1.writeUI5DeployYaml)(basePath, fullConfig, fs);
|
|
93
|
+
return fs;
|
|
110
94
|
}
|
|
111
95
|
exports.migrate = migrate;
|
|
112
96
|
//# sourceMappingURL=index.js.map
|
package/dist/writer/options.js
CHANGED
|
@@ -8,9 +8,8 @@ exports.enhanceManifestChangeContentWithFlpConfig = exports.enhanceUI5DeployYaml
|
|
|
8
8
|
* @param config full project configuration
|
|
9
9
|
*/
|
|
10
10
|
function enhanceUI5Yaml(ui5Config, config) {
|
|
11
|
-
var _a;
|
|
12
11
|
ui5Config.setConfiguration({ propertiesFileSourceEncoding: 'UTF-8' });
|
|
13
|
-
if (
|
|
12
|
+
if (config.options?.fioriTools) {
|
|
14
13
|
addFioriToolsMiddlwares(ui5Config, config);
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
@@ -36,7 +35,7 @@ exports.enhanceUI5YamlWithCustomTask = enhanceUI5YamlWithCustomTask;
|
|
|
36
35
|
* @param config full project configuration
|
|
37
36
|
*/
|
|
38
37
|
function enhanceUI5YamlWithCustomConfig(ui5Config, config) {
|
|
39
|
-
if (config
|
|
38
|
+
if (config?.adp) {
|
|
40
39
|
const { safeMode } = config.adp;
|
|
41
40
|
ui5Config.addCustomConfiguration('adp', { safeMode });
|
|
42
41
|
}
|
|
@@ -59,8 +58,7 @@ exports.hasDeployConfig = hasDeployConfig;
|
|
|
59
58
|
* @param config full project configuration
|
|
60
59
|
*/
|
|
61
60
|
function enhanceUI5DeployYaml(ui5Config, config) {
|
|
62
|
-
|
|
63
|
-
ui5Config.addAbapDeployTask(config.target, config.deploy, ((_a = config.options) === null || _a === void 0 ? void 0 : _a.fioriTools) === true);
|
|
61
|
+
ui5Config.addAbapDeployTask(config.target, config.deploy, config.options?.fioriTools === true);
|
|
64
62
|
}
|
|
65
63
|
exports.enhanceUI5DeployYaml = enhanceUI5DeployYaml;
|
|
66
64
|
/**
|
|
@@ -70,9 +68,8 @@ exports.enhanceUI5DeployYaml = enhanceUI5DeployYaml;
|
|
|
70
68
|
* @param config full project configuration
|
|
71
69
|
*/
|
|
72
70
|
function addFioriToolsMiddlwares(ui5Config, config) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(_a = backendConfig.url) !== null && _a !== void 0 ? _a : (backendConfig.url = 'https://REQUIRED_FOR_VSCODE.example');
|
|
71
|
+
const backendConfig = { ...config.target };
|
|
72
|
+
backendConfig.url ??= 'https://REQUIRED_FOR_VSCODE.example';
|
|
76
73
|
backendConfig.path = '/sap';
|
|
77
74
|
ui5Config.addFioriToolsAppReloadMiddleware();
|
|
78
75
|
ui5Config.addCustomMiddleware([
|
|
@@ -89,8 +86,8 @@ function addFioriToolsMiddlwares(ui5Config, config) {
|
|
|
89
86
|
]);
|
|
90
87
|
ui5Config.addFioriToolsProxydMiddleware({
|
|
91
88
|
ui5: {
|
|
92
|
-
url:
|
|
93
|
-
version:
|
|
89
|
+
url: config?.ui5?.frameworkUrl,
|
|
90
|
+
version: config?.ui5?.minVersion ?? '' //default to latest if version is not set
|
|
94
91
|
},
|
|
95
92
|
backend: [backendConfig]
|
|
96
93
|
});
|
|
@@ -138,7 +135,10 @@ function addOpenSourceMiddlewares(ui5Config, config) {
|
|
|
138
135
|
name: 'backend-proxy-middleware',
|
|
139
136
|
afterMiddleware: 'preview-middleware',
|
|
140
137
|
configuration: {
|
|
141
|
-
backend:
|
|
138
|
+
backend: {
|
|
139
|
+
...config.target,
|
|
140
|
+
path: '/sap'
|
|
141
|
+
},
|
|
142
142
|
options: {
|
|
143
143
|
secure: true
|
|
144
144
|
}
|
|
@@ -153,16 +153,15 @@ function addOpenSourceMiddlewares(ui5Config, config) {
|
|
|
153
153
|
* @returns list of required tasks.
|
|
154
154
|
*/
|
|
155
155
|
function getAdpCloudCustomTasks(config) {
|
|
156
|
-
var _a, _b, _c, _d;
|
|
157
156
|
return [
|
|
158
157
|
{
|
|
159
158
|
name: 'app-variant-bundler-build',
|
|
160
159
|
beforeTask: 'escapeNonAsciiCharacters',
|
|
161
160
|
configuration: {
|
|
162
161
|
type: 'abap',
|
|
163
|
-
destination:
|
|
164
|
-
appName:
|
|
165
|
-
languages:
|
|
162
|
+
destination: config.target?.destination,
|
|
163
|
+
appName: config?.app?.bspName,
|
|
164
|
+
languages: config?.app?.languages?.map((language) => {
|
|
166
165
|
return {
|
|
167
166
|
sap: language.sap,
|
|
168
167
|
i18n: language.i18n
|
|
@@ -221,7 +220,6 @@ function getInboundChangeContentWithExistingInboundId(flpConfiguration, appId) {
|
|
|
221
220
|
* @returns Inbound change content.
|
|
222
221
|
*/
|
|
223
222
|
function getInboundChangeContentWithNewInboundID(flpConfiguration, appId) {
|
|
224
|
-
var _a;
|
|
225
223
|
const content = {
|
|
226
224
|
inbound: {
|
|
227
225
|
[flpConfiguration.inboundId]: {
|
|
@@ -230,7 +228,7 @@ function getInboundChangeContentWithNewInboundID(flpConfiguration, appId) {
|
|
|
230
228
|
title: `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.title}}`,
|
|
231
229
|
signature: {
|
|
232
230
|
additionalParameters: 'allowed',
|
|
233
|
-
parameters:
|
|
231
|
+
parameters: flpConfiguration.additionalParameters ?? {}
|
|
234
232
|
}
|
|
235
233
|
}
|
|
236
234
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.writeUI5DeployYaml = exports.writeUI5Yaml = exports.writeTemplateToFolder = void 0;
|
|
13
4
|
const path_1 = require("path");
|
|
@@ -42,24 +33,21 @@ exports.writeTemplateToFolder = writeTemplateToFolder;
|
|
|
42
33
|
* @param {Editor} fs - The `mem-fs-editor` instance used for file operations.
|
|
43
34
|
* @returns {void}
|
|
44
35
|
*/
|
|
45
|
-
function writeUI5Yaml(projectPath, data, fs) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(0, options_1.
|
|
54
|
-
if (((_b = (_a = data.customConfig) === null || _a === void 0 ? void 0 : _a.adp) === null || _b === void 0 ? void 0 : _b.environment) === 'C') {
|
|
55
|
-
(0, options_1.enhanceUI5YamlWithCustomTask)(ui5Config, data);
|
|
56
|
-
}
|
|
57
|
-
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
throw new Error(`Could not write ui5.yaml file. Reason: ${e.message}`);
|
|
36
|
+
async function writeUI5Yaml(projectPath, data, fs) {
|
|
37
|
+
try {
|
|
38
|
+
const ui5ConfigPath = (0, path_1.join)(projectPath, 'ui5.yaml');
|
|
39
|
+
const baseUi5ConfigContent = fs.read(ui5ConfigPath);
|
|
40
|
+
const ui5Config = await ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
|
|
41
|
+
(0, options_1.enhanceUI5Yaml)(ui5Config, data);
|
|
42
|
+
(0, options_1.enhanceUI5YamlWithCustomConfig)(ui5Config, data?.customConfig);
|
|
43
|
+
if (data.customConfig?.adp?.environment === 'C') {
|
|
44
|
+
(0, options_1.enhanceUI5YamlWithCustomTask)(ui5Config, data);
|
|
61
45
|
}
|
|
62
|
-
|
|
46
|
+
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
throw new Error(`Could not write ui5.yaml file. Reason: ${e.message}`);
|
|
50
|
+
}
|
|
63
51
|
}
|
|
64
52
|
exports.writeUI5Yaml = writeUI5Yaml;
|
|
65
53
|
/**
|
|
@@ -70,21 +58,19 @@ exports.writeUI5Yaml = writeUI5Yaml;
|
|
|
70
58
|
* @param {Editor} fs - The `mem-fs-editor` instance used for file operations.
|
|
71
59
|
* @returns {void}
|
|
72
60
|
*/
|
|
73
|
-
function writeUI5DeployYaml(projectPath, data, fs) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
fs.write((0, path_1.join)(projectPath, 'ui5-deploy.yaml'), ui5DeployConfig.toString());
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
throw new Error(`Could not write ui5-deploy.yaml file. Reason: ${e.message}`);
|
|
61
|
+
async function writeUI5DeployYaml(projectPath, data, fs) {
|
|
62
|
+
try {
|
|
63
|
+
if ((0, options_1.hasDeployConfig)(data)) {
|
|
64
|
+
const ui5ConfigPath = (0, path_1.join)(projectPath, 'ui5.yaml');
|
|
65
|
+
const baseUi5ConfigContent = fs.read(ui5ConfigPath);
|
|
66
|
+
const ui5DeployConfig = await ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
|
|
67
|
+
(0, options_1.enhanceUI5DeployYaml)(ui5DeployConfig, data);
|
|
68
|
+
fs.write((0, path_1.join)(projectPath, 'ui5-deploy.yaml'), ui5DeployConfig.toString());
|
|
86
69
|
}
|
|
87
|
-
}
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
throw new Error(`Could not write ui5-deploy.yaml file. Reason: ${e.message}`);
|
|
73
|
+
}
|
|
88
74
|
}
|
|
89
75
|
exports.writeUI5DeployYaml = writeUI5DeployYaml;
|
|
90
76
|
//# sourceMappingURL=project-utils.js.map
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.12.1",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"mem-fs-editor": "9.4.0",
|
|
32
32
|
"prompts": "2.4.2",
|
|
33
33
|
"sanitize-filename": "1.6.3",
|
|
34
|
-
"@sap-ux/axios-extension": "1.
|
|
35
|
-
"@sap-ux/btp-utils": "0.
|
|
36
|
-
"@sap-ux/inquirer-common": "0.
|
|
37
|
-
"@sap-ux/logger": "0.
|
|
38
|
-
"@sap-ux/project-access": "1.
|
|
39
|
-
"@sap-ux/system-access": "0.
|
|
40
|
-
"@sap-ux/ui5-config": "0.
|
|
34
|
+
"@sap-ux/axios-extension": "1.15.1",
|
|
35
|
+
"@sap-ux/btp-utils": "0.15.0",
|
|
36
|
+
"@sap-ux/inquirer-common": "0.4.0",
|
|
37
|
+
"@sap-ux/logger": "0.6.0",
|
|
38
|
+
"@sap-ux/project-access": "1.23.0",
|
|
39
|
+
"@sap-ux/system-access": "0.5.1",
|
|
40
|
+
"@sap-ux/ui5-config": "0.23.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/adm-zip": "0.5.5",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"nock": "13.4.0",
|
|
54
54
|
"rimraf": "5.0.5",
|
|
55
55
|
"supertest": "6.3.3",
|
|
56
|
-
"@sap-ux/store": "0.
|
|
56
|
+
"@sap-ux/store": "0.7.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=18.x"
|