@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.
@@ -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
- return __awaiter(this, void 0, void 0, function* () {
73
- const content = this.constructContent(data);
74
- const change = (0, change_utils_1.getChange)(data.projectData, data.timestamp, content, "appdescr_ui5_addNewModel" /* ChangeType.ADD_NEW_MODEL */);
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;
@@ -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
- return __awaiter(this, void 0, void 0, function* () {
32
- if (!fs) {
33
- fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
34
- }
35
- const writer = writer_factory_1.WriterFactory.createWriter(type, fs, projectPath);
36
- yield writer.write(data);
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
@@ -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: Object.assign({}, config.app),
30
- target: Object.assign({}, config.target),
31
- ui5: Object.assign({}, config.ui5),
32
- deploy: config.deploy ? Object.assign({}, config.deploy) : undefined,
33
- options: Object.assign({}, config.options),
34
- flp: config.flp ? Object.assign({}, config.flp) : undefined,
35
- customConfig: config.customConfig ? Object.assign({}, config.customConfig) : undefined
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
- (_a = (_f = configWithDefaults.app).title) !== null && _a !== void 0 ? _a : (_f.title = `Adaptation of ${config.app.reference}`);
38
- (_b = (_g = configWithDefaults.app).layer) !== null && _b !== void 0 ? _b : (_g.layer = 'CUSTOMER_BASE');
39
- (_c = configWithDefaults.package) !== null && _c !== void 0 ? _c : (configWithDefaults.package = config.package ? Object.assign({}, config.package) : {});
40
- (_d = (_h = configWithDefaults.package).name) !== null && _d !== void 0 ? _d : (_h.name = config.app.id.toLowerCase().replace(/\./g, '-'));
41
- (_e = (_j = configWithDefaults.package).description) !== null && _e !== void 0 ? _e : (_j.description = configWithDefaults.app.title);
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
- var _a;
58
- return __awaiter(this, void 0, void 0, function* () {
59
- if (!fs) {
60
- fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
61
- }
62
- const fullConfig = setDefaults(config);
63
- if (((_a = fullConfig.customConfig) === null || _a === void 0 ? void 0 : _a.adp.environment) === 'C' && fullConfig.flp) {
64
- (0, options_1.enhanceManifestChangeContentWithFlpConfig)(fullConfig.flp, fullConfig.app.id, fullConfig.app.content);
65
- }
66
- (0, project_utils_1.writeTemplateToFolder)((0, path_1.join)(tmplPath, '**/*.*'), (0, path_1.join)(basePath), fullConfig, fs);
67
- yield (0, project_utils_1.writeUI5DeployYaml)(basePath, fullConfig, fs);
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
- return __awaiter(this, void 0, void 0, function* () {
83
- if (!fs) {
84
- fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
85
- }
86
- const fullConfig = setDefaults(config);
87
- // Copy the specified files to target project
88
- fs.copyTpl((0, path_1.join)(tmplPath, '**/ui5.yaml'), (0, path_1.join)(basePath), fullConfig, undefined, {
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
@@ -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 ((_a = config.options) === null || _a === void 0 ? void 0 : _a.fioriTools) {
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 === null || config === void 0 ? void 0 : config.adp) {
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
- var _a;
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
- var _a, _b, _c, _d;
74
- const backendConfig = Object.assign({}, config.target);
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: (_b = config === null || config === void 0 ? void 0 : config.ui5) === null || _b === void 0 ? void 0 : _b.frameworkUrl,
93
- version: (_d = (_c = config === null || config === void 0 ? void 0 : config.ui5) === null || _c === void 0 ? void 0 : _c.minVersion) !== null && _d !== void 0 ? _d : '' //default to latest if version is not set
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: Object.assign(Object.assign({}, config.target), { path: '/sap' }),
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: (_a = config.target) === null || _a === void 0 ? void 0 : _a.destination,
164
- appName: (_b = config === null || config === void 0 ? void 0 : config.app) === null || _b === void 0 ? void 0 : _b.bspName,
165
- languages: (_d = (_c = config === null || config === void 0 ? void 0 : config.app) === null || _c === void 0 ? void 0 : _c.languages) === null || _d === void 0 ? void 0 : _d.map((language) => {
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: (_a = flpConfiguration.additionalParameters) !== null && _a !== void 0 ? _a : {}
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
- var _a, _b;
47
- return __awaiter(this, void 0, void 0, function* () {
48
- try {
49
- const ui5ConfigPath = (0, path_1.join)(projectPath, 'ui5.yaml');
50
- const baseUi5ConfigContent = fs.read(ui5ConfigPath);
51
- const ui5Config = yield ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
52
- (0, options_1.enhanceUI5Yaml)(ui5Config, data);
53
- (0, options_1.enhanceUI5YamlWithCustomConfig)(ui5Config, data === null || data === void 0 ? void 0 : data.customConfig);
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
- return __awaiter(this, void 0, void 0, function* () {
75
- try {
76
- if ((0, options_1.hasDeployConfig)(data)) {
77
- const ui5ConfigPath = (0, path_1.join)(projectPath, 'ui5.yaml');
78
- const baseUi5ConfigContent = fs.read(ui5ConfigPath);
79
- const ui5DeployConfig = yield ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
80
- (0, options_1.enhanceUI5DeployYaml)(ui5DeployConfig, data);
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.11.13",
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.14.4",
35
- "@sap-ux/btp-utils": "0.14.4",
36
- "@sap-ux/inquirer-common": "0.3.1",
37
- "@sap-ux/logger": "0.5.1",
38
- "@sap-ux/project-access": "1.22.4",
39
- "@sap-ux/system-access": "0.4.7",
40
- "@sap-ux/ui5-config": "0.22.10"
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.6.0"
56
+ "@sap-ux/store": "0.7.0"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=18.x"