@sap-ux/adp-tooling 0.18.49 → 0.18.51

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.
@@ -82,7 +82,7 @@ export declare function loadAppVariant(rootProject: ReaderCollection): Promise<D
82
82
  * @param yamlPath Relative or absolute path to the ui5.yaml file
83
83
  * @returns The `AdpPreviewConfig` object if found, otherwise throws an error.
84
84
  */
85
- export declare function getAdpConfig(basePath: string, yamlPath: string): Promise<AdpPreviewConfig>;
85
+ export declare function getAdpConfig<T = AdpPreviewConfig>(basePath: string, yamlPath: string): Promise<T>;
86
86
  /**
87
87
  * Get all files in the webapp folder.
88
88
  *
@@ -4,7 +4,7 @@ import type { AppParamsExtended, MtaYaml } from '../../types';
4
4
  import { AppRouterType } from '../../types';
5
5
  interface AdjustMtaYamlParams {
6
6
  projectPath: string;
7
- moduleName: string;
7
+ adpProjectName: string;
8
8
  appRouterType: AppRouterType;
9
9
  businessSolutionName: string;
10
10
  businessService: string;
@@ -46,6 +46,6 @@ export declare function getAppParamsFromUI5Yaml(projectPath: string): AppParamsE
46
46
  * @param {ToolsLogger} logger - The logger.
47
47
  * @returns {Promise<void>} The promise.
48
48
  */
49
- export declare function adjustMtaYaml({ projectPath, moduleName, appRouterType, businessSolutionName, businessService }: AdjustMtaYamlParams, memFs: Editor, templatePathOverwrite?: string, logger?: ToolsLogger): Promise<void>;
49
+ export declare function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, businessSolutionName, businessService }: AdjustMtaYamlParams, memFs: Editor, templatePathOverwrite?: string, logger?: ToolsLogger): Promise<void>;
50
50
  export {};
51
51
  //# sourceMappingURL=yaml.d.ts.map
@@ -229,11 +229,11 @@ function adjustMtaYamlManagedApprouter(yamlContent, projectName, businessSolutio
229
229
  * Adjusts the MTA YAML for a UI deployer.
230
230
  *
231
231
  * @param {MtaYaml} yamlContent - The YAML content.
232
- * @param {string} projectName - The project name.
233
- * @param {string} moduleName - The module name.
232
+ * @param {string} mtaProjectName - The MTA project name.
233
+ * @param {string} adpProjectName - The ADP project name.
234
234
  */
235
- function adjustMtaYamlUDeployer(yamlContent, projectName, moduleName) {
236
- const uiDeployerName = `${projectName}_ui_deployer`;
235
+ function adjustMtaYamlUDeployer(yamlContent, mtaProjectName, adpProjectName) {
236
+ const uiDeployerName = `${mtaProjectName}_ui_deployer`;
237
237
  let uiDeployer = yamlContent.modules?.find((module) => module.name === uiDeployerName);
238
238
  if (uiDeployer == null) {
239
239
  uiDeployer = {
@@ -248,7 +248,7 @@ function adjustMtaYamlUDeployer(yamlContent, projectName, moduleName) {
248
248
  };
249
249
  yamlContent.modules?.push(uiDeployer);
250
250
  }
251
- const htmlRepoHostName = `${projectName}_html_repo_host`;
251
+ const htmlRepoHostName = `${mtaProjectName}_html_repo_host`;
252
252
  if (uiDeployer.requires?.every((req) => req.name !== htmlRepoHostName)) {
253
253
  uiDeployer.requires?.push({
254
254
  name: htmlRepoHostName,
@@ -257,10 +257,10 @@ function adjustMtaYamlUDeployer(yamlContent, projectName, moduleName) {
257
257
  }
258
258
  });
259
259
  }
260
- if (uiDeployer['build-parameters']?.requires?.every((require) => require.name !== moduleName)) {
260
+ if (uiDeployer['build-parameters']?.requires?.every((require) => require.name !== adpProjectName)) {
261
261
  uiDeployer['build-parameters']?.requires?.push({
262
- artifacts: [`${moduleName}.zip`],
263
- name: moduleName,
262
+ artifacts: [`${adpProjectName}.zip`],
263
+ name: adpProjectName,
264
264
  'target-path': 'resources/'
265
265
  });
266
266
  }
@@ -269,24 +269,24 @@ function adjustMtaYamlUDeployer(yamlContent, projectName, moduleName) {
269
269
  * Adjusts the MTA YAML for resources.
270
270
  *
271
271
  * @param {MtaYaml} yamlContent - The YAML content.
272
- * @param {string} projectName - The project name.
272
+ * @param {string} mtaProjectName - The project name.
273
273
  * @param {string} timestamp - The timestamp.
274
274
  * @param {boolean} isManagedAppRouter - Whether the approuter is managed.
275
275
  */
276
- function adjustMtaYamlResources(yamlContent, projectName, timestamp, isManagedAppRouter) {
276
+ function adjustMtaYamlResources(yamlContent, mtaProjectName, timestamp, isManagedAppRouter) {
277
277
  const projectNameForXsSecurity = (0, yaml_loader_1.getProjectNameForXsSecurity)(yamlContent, timestamp);
278
278
  const resources = [
279
279
  {
280
- name: `${projectName}_html_repo_host`,
280
+ name: `${mtaProjectName}_html_repo_host`,
281
281
  type: CF_MANAGED_SERVICE,
282
282
  parameters: {
283
283
  service: HTML5_APPS_REPO,
284
284
  'service-plan': 'app-host',
285
- 'service-name': `${projectName}-html5_app_host`
285
+ 'service-name': `${mtaProjectName}-html5_app_host`
286
286
  }
287
287
  },
288
288
  {
289
- name: `${projectName}_uaa`,
289
+ name: `${mtaProjectName}_uaa`,
290
290
  type: CF_MANAGED_SERVICE,
291
291
  parameters: {
292
292
  service: 'xsuaa',
@@ -298,11 +298,11 @@ function adjustMtaYamlResources(yamlContent, projectName, timestamp, isManagedAp
298
298
  ];
299
299
  if (isManagedAppRouter) {
300
300
  resources.push({
301
- name: `${projectName}-destination`,
301
+ name: `${mtaProjectName}-destination`,
302
302
  type: CF_MANAGED_SERVICE,
303
303
  parameters: {
304
304
  service: 'destination',
305
- 'service-name': `${projectName}-destination`,
305
+ 'service-name': `${mtaProjectName}-destination`,
306
306
  'service-plan': 'lite',
307
307
  config: {
308
308
  HTML5Runtime_enabled: true,
@@ -313,14 +313,14 @@ function adjustMtaYamlResources(yamlContent, projectName, timestamp, isManagedAp
313
313
  }
314
314
  else {
315
315
  resources.push({
316
- name: `portal_resources_${projectName}`,
316
+ name: `portal_resources_${mtaProjectName}`,
317
317
  type: CF_MANAGED_SERVICE,
318
318
  parameters: {
319
319
  service: 'portal',
320
320
  'service-plan': 'standard'
321
321
  }
322
322
  }, {
323
- name: `${projectName}_html_repo_runtime`,
323
+ name: `${mtaProjectName}_html_repo_runtime`,
324
324
  type: CF_MANAGED_SERVICE,
325
325
  parameters: {
326
326
  service: HTML5_APPS_REPO,
@@ -338,15 +338,15 @@ function adjustMtaYamlResources(yamlContent, projectName, timestamp, isManagedAp
338
338
  * Adjusts the MTA YAML for the own module.
339
339
  *
340
340
  * @param {MtaYaml} yamlContent - The YAML content.
341
- * @param {string} moduleName - The module name.
341
+ * @param {string} adpProjectName - The ADP project name.
342
342
  */
343
- function adjustMtaYamlOwnModule(yamlContent, moduleName) {
344
- let module = yamlContent.modules?.find((module) => module.name === moduleName);
343
+ function adjustMtaYamlOwnModule(yamlContent, adpProjectName) {
344
+ let module = yamlContent.modules?.find((module) => module.name === adpProjectName);
345
345
  if (module == null) {
346
346
  module = {
347
- name: moduleName,
347
+ name: adpProjectName,
348
348
  type: 'html5',
349
- path: moduleName,
349
+ path: adpProjectName,
350
350
  'build-parameters': {
351
351
  builder: 'custom',
352
352
  commands: ['npm install', 'npm run build'],
@@ -400,7 +400,7 @@ function adjustMtaYamlFlpModule(yamlContent, projectName, businessService) {
400
400
  * @param {ToolsLogger} logger - The logger.
401
401
  * @returns {Promise<void>} The promise.
402
402
  */
403
- async function adjustMtaYaml({ projectPath, moduleName, appRouterType, businessSolutionName, businessService }, memFs, templatePathOverwrite, logger) {
403
+ async function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, businessSolutionName, businessService }, memFs, templatePathOverwrite, logger) {
404
404
  const timestamp = Date.now().toString();
405
405
  const mtaYamlPath = path.join(projectPath, 'mta.yaml');
406
406
  const loadedYamlContent = (0, yaml_loader_1.getYamlContent)(mtaYamlPath);
@@ -415,20 +415,20 @@ async function adjustMtaYaml({ projectPath, moduleName, appRouterType, businessS
415
415
  appRouterType = getRouterType(loadedYamlContent);
416
416
  }
417
417
  const yamlContent = Object.assign(defaultYaml, loadedYamlContent);
418
- const projectName = yamlContent.ID.toLowerCase();
418
+ const mtaProjectName = yamlContent.ID.toLowerCase();
419
419
  const initialServices = yamlContent.resources?.map((resource) => resource.parameters.service ?? '') ?? [];
420
420
  const isStandaloneApprouter = appRouterType === types_1.AppRouterType.STANDALONE;
421
421
  if (isStandaloneApprouter) {
422
- adjustMtaYamlStandaloneApprouter(yamlContent, projectName, businessService);
422
+ adjustMtaYamlStandaloneApprouter(yamlContent, mtaProjectName, businessService);
423
423
  }
424
424
  else {
425
- adjustMtaYamlManagedApprouter(yamlContent, projectName, businessSolutionName, businessService, timestamp);
425
+ adjustMtaYamlManagedApprouter(yamlContent, mtaProjectName, businessSolutionName, businessService, timestamp);
426
426
  }
427
- adjustMtaYamlUDeployer(yamlContent, projectName, moduleName);
428
- adjustMtaYamlResources(yamlContent, projectName, timestamp, !isStandaloneApprouter);
429
- adjustMtaYamlOwnModule(yamlContent, moduleName);
427
+ adjustMtaYamlUDeployer(yamlContent, mtaProjectName, adpProjectName);
428
+ adjustMtaYamlResources(yamlContent, mtaProjectName, timestamp, !isStandaloneApprouter);
429
+ adjustMtaYamlOwnModule(yamlContent, adpProjectName);
430
430
  // should go last since it sorts the modules (workaround, should be removed after fixed in deployment module)
431
- adjustMtaYamlFlpModule(yamlContent, projectName, businessService);
431
+ adjustMtaYamlFlpModule(yamlContent, mtaProjectName, businessService);
432
432
  await (0, api_1.createServices)(yamlContent, initialServices, timestamp, templatePathOverwrite, logger);
433
433
  const updatedYamlContent = js_yaml_1.default.dump(yamlContent);
434
434
  memFs.write(mtaYamlPath, updatedYamlContent);
@@ -99,7 +99,7 @@ class AdpPreview {
99
99
  * @returns {Promise<UI5FlexLayer>} The UI5 flex layer for which editing is enabled.
100
100
  */
101
101
  async init(descriptorVariant) {
102
- if (this.config.cfBuildPath) {
102
+ if ('cfBuildPath' in this.config) {
103
103
  return this.initCfBuildMode(descriptorVariant);
104
104
  }
105
105
  this.descriptorVariantId = descriptorVariant.id;
@@ -130,7 +130,7 @@ class AdpPreview {
130
130
  * The descriptor is refreshed only if the global flag is set to true.
131
131
  */
132
132
  async sync() {
133
- if (this.config.cfBuildPath) {
133
+ if ('cfBuildPath' in this.config) {
134
134
  return;
135
135
  }
136
136
  if (!global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ && this.mergedDescriptor) {
package/dist/types.d.ts CHANGED
@@ -29,17 +29,30 @@ export interface ToolsSupport {
29
29
  * Reduce the options exposed as target configuration.
30
30
  */
31
31
  type AbapTarget = DestinationAbapTarget | Pick<UrlAbapTarget, 'url' | 'client' | 'scp'>;
32
- export interface AdpPreviewConfig {
32
+ /**
33
+ * Configuration for ADP preview using ABAP target connection.
34
+ */
35
+ export interface AdpPreviewConfigWithTarget {
33
36
  target: AbapTarget;
34
37
  /**
35
38
  * If set to true then certification validation errors are ignored.
36
39
  */
37
40
  ignoreCertErrors?: boolean;
41
+ }
42
+ /**
43
+ * Configuration for ADP preview using CF build output path.
44
+ */
45
+ export interface AdpPreviewConfigWithBuildPath {
38
46
  /**
39
47
  * For CF ADP projects: path to build output folder (e.g., 'dist') to serve resources directly.
40
48
  */
41
- cfBuildPath?: string;
49
+ cfBuildPath: string;
50
+ /**
51
+ * If set to true then certification validation errors are ignored.
52
+ */
53
+ ignoreCertErrors?: boolean;
42
54
  }
55
+ export type AdpPreviewConfig = AdpPreviewConfigWithTarget | AdpPreviewConfigWithBuildPath;
43
56
  export interface OnpremApp {
44
57
  /** Application variant id. */
45
58
  id: string;
package/dist/writer/cf.js CHANGED
@@ -22,10 +22,10 @@ async function generateCf(basePath, config, logger, fs) {
22
22
  fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
23
23
  }
24
24
  const fullConfig = setDefaults(config);
25
- const { app, cf, ui5 } = fullConfig;
25
+ const { app, cf, ui5, project } = fullConfig;
26
26
  await (0, cf_1.adjustMtaYaml)({
27
27
  projectPath: basePath,
28
- moduleName: app.id,
28
+ adpProjectName: project.name,
29
29
  appRouterType: cf.approuter,
30
30
  businessSolutionName: cf.businessSolutionName ?? '',
31
31
  businessService: cf.businessService
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.18.49",
12
+ "version": "0.18.51",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@sap-devx/yeoman-ui-types": "1.16.9",
27
- "@sap/cf-tools": "3.2.2",
27
+ "@sap/cf-tools": "3.3.0",
28
28
  "adm-zip": "0.5.10",
29
29
  "axios": "1.12.2",
30
30
  "ejs": "3.1.10",
@@ -36,17 +36,17 @@
36
36
  "prompts": "2.4.2",
37
37
  "sanitize-filename": "1.6.3",
38
38
  "uuid": "10.0.0",
39
- "@sap-ux/axios-extension": "1.25.9",
40
- "@sap-ux/btp-utils": "1.1.6",
39
+ "@sap-ux/axios-extension": "1.25.10",
40
+ "@sap-ux/btp-utils": "1.1.7",
41
41
  "@sap-ux/i18n": "0.3.7",
42
- "@sap-ux/inquirer-common": "0.10.21",
42
+ "@sap-ux/inquirer-common": "0.10.22",
43
43
  "@sap-ux/logger": "0.8.1",
44
- "@sap-ux/nodejs-utils": "0.2.11",
44
+ "@sap-ux/nodejs-utils": "0.2.12",
45
45
  "@sap-ux/odata-service-writer": "0.29.12",
46
46
  "@sap-ux/project-access": "1.34.5",
47
47
  "@sap-ux/project-input-validator": "0.6.49",
48
48
  "@sap-ux/store": "1.5.3",
49
- "@sap-ux/system-access": "0.6.46",
49
+ "@sap-ux/system-access": "0.6.47",
50
50
  "@sap-ux/ui5-config": "0.29.14",
51
51
  "@sap-ux/ui5-info": "0.13.10"
52
52
  },
@@ -66,7 +66,7 @@
66
66
  "dotenv": "16.6.1",
67
67
  "express": "4.22.1",
68
68
  "nock": "13.4.0",
69
- "rimraf": "6.0.1",
69
+ "rimraf": "6.1.2",
70
70
  "supertest": "7.1.4",
71
71
  "@sap-ux/store": "1.5.3"
72
72
  },
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@sap/ui5-builder-webide-extension": "^1.1.9",
21
- "@sap-ux/backend-proxy-middleware-cf": "^0.0.1",
21
+ "@sap-ux/backend-proxy-middleware-cf": "0",
22
22
  "@sapui5/ts-types": "^1.141.2",
23
23
  "@sap/ux-ui5-tooling": "1",
24
24
  "@ui5/cli": "^4.0.33",