@sap-ux/adp-tooling 0.18.78 → 0.18.80

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.
@@ -18,6 +18,7 @@ const node_fs_1 = require("node:fs");
18
18
  const node_path_1 = require("node:path");
19
19
  const axios_extension_1 = require("@sap-ux/axios-extension");
20
20
  const project_access_1 = require("@sap-ux/project-access");
21
+ const ADP_CLOUD_PROJECT_BUILD_TASK_NAME = 'app-variant-bundler-build';
21
22
  /**
22
23
  * Get the app descriptor variant.
23
24
  *
@@ -172,7 +173,8 @@ async function getExistingAdpProjectType(basePath) {
172
173
  }
173
174
  const yamlPath = (0, node_path_1.join)(basePath, project_access_1.FileName.Ui5Yaml);
174
175
  const ui5Config = await readUi5Config(basePath, yamlPath);
175
- return ui5Config.hasBuilderKey() ? axios_extension_1.AdaptationProjectType.CLOUD_READY : axios_extension_1.AdaptationProjectType.ON_PREMISE;
176
+ const cloudProjectBuildTask = ui5Config.findCustomTask(ADP_CLOUD_PROJECT_BUILD_TASK_NAME);
177
+ return cloudProjectBuildTask ? axios_extension_1.AdaptationProjectType.CLOUD_READY : axios_extension_1.AdaptationProjectType.ON_PREMISE;
176
178
  }
177
179
  catch {
178
180
  // Expected: Project may not be an ADP project or configuration files may be missing/invalid
@@ -44,11 +44,12 @@ export declare function getAppParamsFromUI5Yaml(projectPath: string): AppParamsE
44
44
  *
45
45
  * @param {AdjustMtaYamlParams} params - The parameters.
46
46
  * @param {Editor} memFs - The mem-fs editor instance.
47
+ * @param {string} timestamp - The timestamp.
47
48
  * @param {string} [templatePathOverwrite] - The template path overwrite.
48
49
  * @param {ToolsLogger} logger - The logger.
49
50
  * @returns {Promise<void>} The promise.
50
51
  */
51
- export declare function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, businessSolutionName, businessService, serviceKeys }: AdjustMtaYamlParams, memFs: Editor, templatePathOverwrite?: string, logger?: ToolsLogger): Promise<void>;
52
+ export declare function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, businessSolutionName, businessService, serviceKeys }: AdjustMtaYamlParams, memFs: Editor, timestamp: string, templatePathOverwrite?: string, logger?: ToolsLogger): Promise<MtaYaml>;
52
53
  /**
53
54
  * Add fiori-tools-servestatic configuration to ui5.yaml and removes previously added configuration.
54
55
  *
@@ -413,12 +413,12 @@ function adjustMtaYamlFlpModule(yamlContent, projectName, businessService) {
413
413
  *
414
414
  * @param {AdjustMtaYamlParams} params - The parameters.
415
415
  * @param {Editor} memFs - The mem-fs editor instance.
416
+ * @param {string} timestamp - The timestamp.
416
417
  * @param {string} [templatePathOverwrite] - The template path overwrite.
417
418
  * @param {ToolsLogger} logger - The logger.
418
419
  * @returns {Promise<void>} The promise.
419
420
  */
420
- async function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, businessSolutionName, businessService, serviceKeys }, memFs, templatePathOverwrite, logger) {
421
- const timestamp = Date.now().toString();
421
+ async function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, businessSolutionName, businessService, serviceKeys }, memFs, timestamp, templatePathOverwrite, logger) {
422
422
  const mtaYamlPath = path.join(projectPath, 'mta.yaml');
423
423
  const loadedYamlContent = (0, yaml_loader_1.getYamlContent)(mtaYamlPath);
424
424
  const defaultYaml = {
@@ -452,6 +452,7 @@ async function adjustMtaYaml({ projectPath, adpProjectName, appRouterType, busin
452
452
  });
453
453
  memFs.write(mtaYamlPath, updatedYamlContent);
454
454
  logger?.debug(`Adjusted MTA YAML for project ${projectPath}`);
455
+ return yamlContent;
455
456
  }
456
457
  /**
457
458
  * Add fiori-tools-servestatic configuration to ui5.yaml and removes previously added configuration.
@@ -469,10 +470,15 @@ async function addServeStaticMiddleware(basePath, ui5Config, logger) {
469
470
  // Add reusable library paths from ui5AppInfo.json if it exists
470
471
  paths.push(...(0, ui5_app_info_1.getReusableLibraryPaths)(basePath, logger));
471
472
  const variant = await (0, helper_1.getVariant)(basePath);
473
+ const builtVariantId = variant.id.replaceAll('.', '_');
472
474
  paths.push({
473
- path: `/changes/${variant.id.replaceAll('.', '_')}`,
475
+ path: `/changes/${builtVariantId}`,
474
476
  src: './webapp/changes',
475
477
  fallthrough: true
478
+ }, {
479
+ path: `/${builtVariantId}/i18n`,
480
+ src: './webapp/i18n',
481
+ fallthrough: true
476
482
  });
477
483
  ui5Config.addCustomMiddleware([
478
484
  {
package/dist/types.d.ts CHANGED
@@ -987,6 +987,7 @@ export interface CfAdpWriterConfig {
987
987
  name: string;
988
988
  path: string;
989
989
  folder: string;
990
+ xsSecurityAppName?: string;
990
991
  };
991
992
  customConfig?: CustomConfig;
992
993
  ui5: {
package/dist/writer/cf.js CHANGED
@@ -31,21 +31,23 @@ async function generateCf(basePath, config, logger, fs) {
31
31
  if (!fs) {
32
32
  fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
33
33
  }
34
+ const timestamp = Date.now().toString();
34
35
  const fullConfig = setDefaults(config);
35
36
  const { app, cf, ui5, project } = fullConfig;
36
- await (0, cf_1.adjustMtaYaml)({
37
+ const yamlContent = await (0, cf_1.adjustMtaYaml)({
37
38
  projectPath: basePath,
38
39
  adpProjectName: project.name,
39
40
  appRouterType: cf.approuter,
40
41
  businessSolutionName: cf.businessSolutionName ?? '',
41
42
  businessService: cf.businessService,
42
43
  serviceKeys: cf.serviceInfo?.serviceKeys
43
- }, fs, config.options?.templatePathOverwrite, logger);
44
+ }, fs, timestamp, config.options?.templatePathOverwrite, logger);
44
45
  if (fullConfig.app.i18nModels) {
45
46
  (0, i18n_1.writeI18nModels)(basePath, fullConfig.app.i18nModels, fs);
46
47
  }
47
48
  const variant = (0, project_utils_1.getCfVariant)(fullConfig);
48
49
  (0, manifest_1.fillDescriptorContent)(variant.content, app.appType, ui5.version, app.i18nModels);
50
+ fullConfig.project.xsSecurityAppName = (0, cf_1.getProjectNameForXsSecurity)(yamlContent, timestamp);
49
51
  await (0, project_utils_1.writeCfTemplates)(basePath, variant, fullConfig, fs);
50
52
  await (0, project_utils_1.writeCfUI5Yaml)(fullConfig.project.folder, fullConfig, fs);
51
53
  return fs;
@@ -221,7 +221,7 @@ async function writeCfTemplates(basePath, variant, config, fs) {
221
221
  }
222
222
  if (!fs.exists((0, node_path_1.join)(basePath, 'xs-security.json'))) {
223
223
  fs.copyTpl((0, node_path_1.join)(templatePath, 'cf/xs-security.json'), (0, node_path_1.join)(basePath, 'xs-security.json'), {
224
- projectName: project.name
224
+ projectName: project.xsSecurityAppName
225
225
  });
226
226
  }
227
227
  }
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.78",
12
+ "version": "0.18.80",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -39,15 +39,15 @@
39
39
  "@sap-ux/axios-extension": "1.25.18",
40
40
  "@sap-ux/btp-utils": "1.1.9",
41
41
  "@sap-ux/i18n": "0.3.9",
42
- "@sap-ux/inquirer-common": "0.11.16",
42
+ "@sap-ux/inquirer-common": "0.11.17",
43
43
  "@sap-ux/logger": "0.8.1",
44
44
  "@sap-ux/nodejs-utils": "0.2.16",
45
- "@sap-ux/odata-service-writer": "0.29.28",
46
- "@sap-ux/project-access": "1.35.10",
47
- "@sap-ux/project-input-validator": "0.6.64",
45
+ "@sap-ux/odata-service-writer": "0.29.29",
46
+ "@sap-ux/project-access": "1.35.11",
47
+ "@sap-ux/project-input-validator": "0.6.65",
48
48
  "@sap-ux/store": "1.5.8",
49
49
  "@sap-ux/system-access": "0.6.60",
50
- "@sap-ux/ui5-config": "0.29.19",
50
+ "@sap-ux/ui5-config": "0.29.20",
51
51
  "@sap-ux/ui5-info": "0.13.13"
52
52
  },
53
53
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "zip": "cd dist && npx bestzip ../<%= module %>.zip *",
14
14
  "clean": "npx rimraf <%= module %>.zip dist",
15
15
  "build-ui5": "npm explore @ui5/task-adaptation -- npm run rollup",
16
- "build-mta": "rimraf resources mta_archives && mbt build --mtar archive --source ../",
16
+ "build-mta": "rimraf ../resources ../mta_archives && mbt build --mtar archive --source ../",
17
17
  "deploy": "cf deploy ../mta_archives/archive.mtar"
18
18
  },
19
19
  "repository": {