@sap/ux-ui5-tooling 1.12.2 → 1.12.3

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/cli/index.js CHANGED
@@ -34246,7 +34246,7 @@ var require_application = __commonJS({
34246
34246
  "../lib/sapux-spec/dist/application.js"(exports2) {
34247
34247
  "use strict";
34248
34248
  Object.defineProperty(exports2, "__esModule", { value: true });
34249
- exports2.AppPomXmlArtifactIdPlaceholder = exports2.AppType = exports2.RootIntent = exports2.PageHeaderType = exports2.OdataVersion = exports2.FioriElementsVersion = void 0;
34249
+ exports2.AppPomXmlArtifactIdPlaceholder = exports2.AppType = exports2.RootIntent = exports2.OdataVersion = exports2.FioriElementsVersion = void 0;
34250
34250
  var FioriElementsVersion3;
34251
34251
  (function(FioriElementsVersion4) {
34252
34252
  FioriElementsVersion4["v2"] = "v2";
@@ -34257,10 +34257,6 @@ var require_application = __commonJS({
34257
34257
  OdataVersion3["v2"] = "v2";
34258
34258
  OdataVersion3["v4"] = "v4";
34259
34259
  })(OdataVersion2 || (exports2.OdataVersion = OdataVersion2 = {}));
34260
- var PageHeaderType;
34261
- (function(PageHeaderType2) {
34262
- PageHeaderType2["Dynamic"] = "Dynamic";
34263
- })(PageHeaderType || (exports2.PageHeaderType = PageHeaderType = {}));
34264
34260
  var RootIntent;
34265
34261
  (function(RootIntent2) {
34266
34262
  RootIntent2["listReportV2"] = "masterDetail-display";
@@ -71735,7 +71731,7 @@ var require_package2 = __commonJS({
71735
71731
  "../lib/telemetry/dist/package.json"(exports2, module2) {
71736
71732
  module2.exports = {
71737
71733
  name: "@sap/ux-telemetry",
71738
- version: "1.12.2",
71734
+ version: "1.12.3",
71739
71735
  description: "SAP Fiori tools telemetry library",
71740
71736
  main: "dist/src/index.js",
71741
71737
  author: "SAP SE",
@@ -71760,10 +71756,10 @@ var require_package2 = __commonJS({
71760
71756
  },
71761
71757
  dependencies: {
71762
71758
  "@sap-ux/store": "0.4.0",
71763
- "@sap/ux-cds": "1.12.2",
71764
- "@sap/ux-common-utils": "1.12.2",
71765
- "@sap/ux-feature-toggle": "1.12.2",
71766
- "@sap/ux-project-access": "1.12.2",
71759
+ "@sap/ux-cds": "1.12.3",
71760
+ "@sap/ux-common-utils": "1.12.3",
71761
+ "@sap/ux-feature-toggle": "1.12.3",
71762
+ "@sap/ux-project-access": "1.12.3",
71767
71763
  applicationinsights: "1.4.1",
71768
71764
  axios: "1.6.1",
71769
71765
  "performance-now": "2.1.0",
@@ -81143,7 +81139,8 @@ var require_i18n2 = __commonJS({
81143
81139
  ERROR_DETAIL_PROJECT_TYPE: "Cannot determine project type for app '{{- appRoot}}' with project root '{{- projectRoot}}'",
81144
81140
  ERROR_UI5_YAML_PARSING: "Cannot parse ui5 config file '{{- filePath}}'. Cause - '{{- parsingError}}'",
81145
81141
  ERROR_UI5_YAML_DYNAMIC_CFG_IMPORT: "Cannot import dynamic config from '{{- filePath}}', defined in - '{{- yamlFile}}'",
81146
- ERROR_UI5_YAML_MISSING: "This project is not configured to use mockserver. To preview the data in the application, add mockserver config from the application info page"
81142
+ ERROR_UI5_YAML_MISSING: "This project is not configured to use mockserver. To preview the data in the application, add mockserver config from the application info page",
81143
+ ERROR_RESOLVING_I18N_BUNDLES: "Error resolving i18n bundles: '{{- error}}'"
81147
81144
  };
81148
81145
  }
81149
81146
  });
@@ -86134,6 +86131,7 @@ var require_constants5 = __commonJS({
86134
86131
  exports2.FileName = void 0;
86135
86132
  exports2.FileName = {
86136
86133
  AdaptationConfig: "config.json",
86134
+ CapJavaApplicationYaml: "application.yaml",
86137
86135
  ExtConfigJson: ".extconfig.json",
86138
86136
  Manifest: "manifest.json",
86139
86137
  ManifestAppDescrVar: "manifest.appdescr_variant",
@@ -86553,7 +86551,7 @@ var require_cap = __commonJS({
86553
86551
  var _a2;
86554
86552
  return __awaiter(this, void 0, void 0, function* () {
86555
86553
  const srv = (_a2 = capCustomPaths === null || capCustomPaths === void 0 ? void 0 : capCustomPaths.srv) !== null && _a2 !== void 0 ? _a2 : (yield getCapCustomPaths(projectRoot)).srv;
86556
- return (0, file_1.fileExists)((0, path_1.join)(projectRoot, srv, "src", "main", "resources", "application.yaml"));
86554
+ return (0, file_1.fileExists)((0, path_1.join)(projectRoot, srv, "src", "main", "resources", constants_1.FileName.CapJavaApplicationYaml));
86557
86555
  });
86558
86556
  }
86559
86557
  exports2.isCapJavaProject = isCapJavaProject;
@@ -86601,15 +86599,26 @@ var require_cap = __commonJS({
86601
86599
  function getCapModelAndServices(projectRoot) {
86602
86600
  var _a2;
86603
86601
  return __awaiter(this, void 0, void 0, function* () {
86604
- const cds = yield loadCdsModuleFromProject(projectRoot);
86605
- const capProjectPaths = yield getCapCustomPaths(projectRoot);
86602
+ let _projectRoot;
86603
+ let _logger;
86604
+ if (typeof projectRoot === "object") {
86605
+ _projectRoot = projectRoot.projectRoot;
86606
+ _logger = projectRoot.logger;
86607
+ } else {
86608
+ _projectRoot = projectRoot;
86609
+ }
86610
+ const cds = yield loadCdsModuleFromProject(_projectRoot);
86611
+ _logger === null || _logger === void 0 ? void 0 : _logger.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.home': ${cds.home}`);
86612
+ _logger === null || _logger === void 0 ? void 0 : _logger.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.version': ${cds.version}`);
86613
+ _logger === null || _logger === void 0 ? void 0 : _logger.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.root': ${cds.root}`);
86614
+ const capProjectPaths = yield getCapCustomPaths(_projectRoot);
86606
86615
  const modelPaths = [
86607
- (0, path_1.join)(projectRoot, capProjectPaths.app),
86608
- (0, path_1.join)(projectRoot, capProjectPaths.srv),
86609
- (0, path_1.join)(projectRoot, capProjectPaths.db)
86616
+ (0, path_1.join)(_projectRoot, capProjectPaths.app),
86617
+ (0, path_1.join)(_projectRoot, capProjectPaths.srv),
86618
+ (0, path_1.join)(_projectRoot, capProjectPaths.db)
86610
86619
  ];
86611
86620
  const model = yield cds.load(modelPaths);
86612
- let services = (_a2 = cds.compile.to.serviceinfo(model, { root: projectRoot })) !== null && _a2 !== void 0 ? _a2 : [];
86621
+ let services = (_a2 = cds.compile.to.serviceinfo(model, { root: _projectRoot })) !== null && _a2 !== void 0 ? _a2 : [];
86613
86622
  if (services.map) {
86614
86623
  services = services.map((value) => {
86615
86624
  return {
@@ -86771,6 +86780,7 @@ var require_cap = __commonJS({
86771
86780
  if (global) {
86772
86781
  global.cds = cds;
86773
86782
  }
86783
+ cds.root = capProjectPath;
86774
86784
  return cds;
86775
86785
  });
86776
86786
  }
@@ -88938,6 +88948,7 @@ var require_middlewares = __commonJS({
88938
88948
  }
88939
88949
  exports2.getAppReloadMiddlewareConfig = getAppReloadMiddlewareConfig;
88940
88950
  function getFioriToolsProxyMiddlewareConfig(backends, ui5) {
88951
+ var _a2, _b;
88941
88952
  const fioriToolsProxy = {
88942
88953
  name: "fiori-tools-proxy",
88943
88954
  afterMiddleware: "compression",
@@ -88953,14 +88964,15 @@ var require_middlewares = __commonJS({
88953
88964
  ];
88954
88965
  if (backends && backends.length > 0) {
88955
88966
  backends.forEach((element) => {
88956
- element.path = element.path || "/";
88967
+ var _a3;
88968
+ element.path = (_a3 = element.path) !== null && _a3 !== void 0 ? _a3 : "/";
88957
88969
  });
88958
88970
  fioriToolsProxy.configuration.backend = backends;
88959
88971
  }
88960
88972
  if (ui5 !== void 0) {
88961
88973
  fioriToolsProxy.configuration["ui5"] = {
88962
- path: ui5.path || ["/resources", "/test-resources"],
88963
- url: ui5.url || "https://ui5.sap.com"
88974
+ path: (_a2 = ui5.path) !== null && _a2 !== void 0 ? _a2 : ["/resources", "/test-resources"],
88975
+ url: (_b = ui5.url) !== null && _b !== void 0 ? _b : "https://ui5.sap.com"
88964
88976
  };
88965
88977
  if (ui5.version) {
88966
88978
  fioriToolsProxy.configuration["ui5"].version = ui5.version;
@@ -88981,7 +88993,7 @@ var require_middlewares = __commonJS({
88981
88993
  mountPath: "/",
88982
88994
  services: [
88983
88995
  {
88984
- urlPath: path4 || "",
88996
+ urlPath: path4 !== null && path4 !== void 0 ? path4 : "",
88985
88997
  metadataPath: "./webapp/localService/metadata.xml",
88986
88998
  mockdataPath: "./webapp/localService/data",
88987
88999
  generateMockData: true
@@ -89100,6 +89112,40 @@ var require_ui5config = __commonJS({
89100
89112
  this.document.setIn({ path: "type", value });
89101
89113
  return this;
89102
89114
  }
89115
+ /**
89116
+ * Add a custom configuration to the yaml.
89117
+ *
89118
+ * @param key key/name of the custom property
89119
+ * @param value the properties value
89120
+ */
89121
+ addCustomConfiguration(key, value) {
89122
+ try {
89123
+ const configNode = this.document.getMap({ path: "customConfiguration" });
89124
+ configNode.setIn([key], value);
89125
+ } catch (_error) {
89126
+ this.document.setIn({
89127
+ path: "customConfiguration",
89128
+ value: {
89129
+ [key]: value
89130
+ }
89131
+ });
89132
+ }
89133
+ }
89134
+ /**
89135
+ * Get a custom configuration from the yaml.
89136
+ *
89137
+ * @param key key/name of the custom property
89138
+ * @returns the value of the property or undefined
89139
+ */
89140
+ getCustomConfiguration(key) {
89141
+ var _a2, _b;
89142
+ try {
89143
+ const node = this.document.getMap({ path: "customConfiguration" }).get(key);
89144
+ return (_b = (_a2 = node === null || node === void 0 ? void 0 : node.toJSON) === null || _a2 === void 0 ? void 0 : _a2.call(node)) !== null && _b !== void 0 ? _b : node === null || node === void 0 ? void 0 : node.toString();
89145
+ } catch (_error) {
89146
+ return void 0;
89147
+ }
89148
+ }
89103
89149
  /**
89104
89150
  * Adds a UI5 Framework entry to the yaml file.
89105
89151
  *
@@ -89230,20 +89276,23 @@ var require_ui5config = __commonJS({
89230
89276
  *
89231
89277
  * @param target system that this app is to be deployed to
89232
89278
  * @param app application configuration for the deployment to ABAP
89233
- * @returns {UI5Config} the UI5Config instance
89279
+ * @param fioriTools if true use the middleware included in the @sap/ux-ui5-tooling module
89280
+ * @returns this UI5Config instance
89234
89281
  * @memberof UI5Config
89235
89282
  */
89236
- addAbapDeployTask(target, app) {
89283
+ addAbapDeployTask(target, app, fioriTools = true) {
89237
89284
  this.document.appendTo({
89238
- path: "builder.resources",
89239
- value: {
89240
- excludes: ["/test/**", "/localService/**"]
89241
- }
89285
+ path: "builder.resources.excludes",
89286
+ value: "/test/**"
89287
+ });
89288
+ this.document.appendTo({
89289
+ path: "builder.resources.excludes",
89290
+ value: "/localService/**"
89242
89291
  });
89243
89292
  this.document.appendTo({
89244
89293
  path: "builder.customTasks",
89245
89294
  value: {
89246
- name: "deploy-to-abap",
89295
+ name: fioriTools ? "deploy-to-abap" : "abap-deploy-task",
89247
89296
  afterTask: "generateCachebusterInfo",
89248
89297
  configuration: { target, app }
89249
89298
  }
@@ -89524,79 +89573,20 @@ var require_ui5_config = __commonJS({
89524
89573
  });
89525
89574
  }
89526
89575
  exports2.getWebappPath = getWebappPath;
89527
- function readUi5Yaml(basePath, fileName) {
89576
+ function readUi5Yaml(projectRoot, fileName) {
89528
89577
  return __awaiter(this, void 0, void 0, function* () {
89529
- const ui5YamlPath = (0, path_1.join)(basePath, fileName);
89578
+ const ui5YamlPath = (0, path_1.join)(projectRoot, fileName);
89530
89579
  if (yield (0, file_1.fileExists)(ui5YamlPath)) {
89531
89580
  const yamlString = yield (0, file_1.readFile)(ui5YamlPath);
89532
89581
  return yield ui5_config_1.UI5Config.newInstance(yamlString);
89533
89582
  }
89534
- throw Error(`File '${fileName}' not found in project '${basePath}'`);
89583
+ throw Error(`File '${fileName}' not found in project '${projectRoot}'`);
89535
89584
  });
89536
89585
  }
89537
89586
  exports2.readUi5Yaml = readUi5Yaml;
89538
89587
  }
89539
89588
  });
89540
89589
 
89541
- // ../../node_modules/@sap-ux/project-access/dist/project/info.js
89542
- var require_info = __commonJS({
89543
- "../../node_modules/@sap-ux/project-access/dist/project/info.js"(exports2) {
89544
- "use strict";
89545
- var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
89546
- function adopt(value) {
89547
- return value instanceof P ? value : new P(function(resolve2) {
89548
- resolve2(value);
89549
- });
89550
- }
89551
- return new (P || (P = Promise))(function(resolve2, reject2) {
89552
- function fulfilled(value) {
89553
- try {
89554
- step(generator.next(value));
89555
- } catch (e) {
89556
- reject2(e);
89557
- }
89558
- }
89559
- function rejected(value) {
89560
- try {
89561
- step(generator["throw"](value));
89562
- } catch (e) {
89563
- reject2(e);
89564
- }
89565
- }
89566
- function step(result2) {
89567
- result2.done ? resolve2(result2.value) : adopt(result2.value).then(fulfilled, rejected);
89568
- }
89569
- step((generator = generator.apply(thisArg, _arguments || [])).next());
89570
- });
89571
- };
89572
- Object.defineProperty(exports2, "__esModule", { value: true });
89573
- exports2.getAppProgrammingLanguage = void 0;
89574
- var path_1 = require("path");
89575
- var constants_1 = require_constants5();
89576
- var file_1 = require_file4();
89577
- var ui5_config_1 = require_ui5_config();
89578
- function getAppProgrammingLanguage(appRoot, memFs) {
89579
- return __awaiter(this, void 0, void 0, function* () {
89580
- const ignoreFolders = ["node_modules", ".git"];
89581
- let appLanguage = "";
89582
- try {
89583
- const webappPath = yield (0, ui5_config_1.getWebappPath)(appRoot, memFs);
89584
- if (yield (0, file_1.fileExists)(webappPath, memFs)) {
89585
- if ((yield (0, file_1.fileExists)((0, path_1.join)(appRoot, constants_1.FileName.Tsconfig), memFs)) && (yield (0, file_1.findFilesByExtension)(".ts", webappPath, ignoreFolders, memFs)).length > 0) {
89586
- appLanguage = "TypeScript";
89587
- } else if ((yield (0, file_1.findFilesByExtension)(".js", webappPath, ignoreFolders, memFs)).length > 0) {
89588
- appLanguage = "JavaScript";
89589
- }
89590
- }
89591
- } catch (_a2) {
89592
- }
89593
- return appLanguage;
89594
- });
89595
- }
89596
- exports2.getAppProgrammingLanguage = getAppProgrammingLanguage;
89597
- }
89598
- });
89599
-
89600
89590
  // ../../node_modules/@sap-ux/project-access/dist/project/search.js
89601
89591
  var require_search = __commonJS({
89602
89592
  "../../node_modules/@sap-ux/project-access/dist/project/search.js"(exports2) {
@@ -89732,23 +89722,32 @@ var require_search = __commonJS({
89732
89722
  projectRoot: appRoot
89733
89723
  };
89734
89724
  }
89735
- try {
89736
- const { root } = (0, path_1.parse)(appRoot);
89737
- let projectRoot = (0, path_1.dirname)(appRoot);
89738
- while (projectRoot !== root) {
89739
- if (yield (0, cap_1.getCapProjectType)(projectRoot)) {
89740
- if ((0, path_1.join)(projectRoot, "app") !== appRoot) {
89741
- return {
89742
- appRoot,
89743
- projectRoot
89744
- };
89745
- }
89725
+ const projectRoot = yield findCapProjectRoot(appRoot);
89726
+ if (projectRoot) {
89727
+ return {
89728
+ appRoot,
89729
+ projectRoot
89730
+ };
89731
+ }
89732
+ } catch (_a2) {
89733
+ }
89734
+ return null;
89735
+ });
89736
+ }
89737
+ function findCapProjectRoot(path4) {
89738
+ return __awaiter(this, void 0, void 0, function* () {
89739
+ try {
89740
+ const { root } = (0, path_1.parse)(path4);
89741
+ let projectRoot = (0, path_1.dirname)(path4);
89742
+ while (projectRoot !== root) {
89743
+ if (yield (0, cap_1.getCapProjectType)(projectRoot)) {
89744
+ if ((0, path_1.join)(projectRoot, "app") !== path4) {
89745
+ return projectRoot;
89746
89746
  }
89747
- projectRoot = (0, path_1.dirname)(projectRoot);
89748
89747
  }
89749
- } catch (_a2) {
89748
+ projectRoot = (0, path_1.dirname)(projectRoot);
89750
89749
  }
89751
- } catch (_b) {
89750
+ } catch (_a2) {
89752
89751
  }
89753
89752
  return null;
89754
89753
  });
@@ -89896,8 +89895,8 @@ var require_search = __commonJS({
89896
89895
  function findCapProjects(options3) {
89897
89896
  return __awaiter(this, void 0, void 0, function* () {
89898
89897
  const result2 = /* @__PURE__ */ new Set();
89899
- const excludeFolders2 = ["node_modules", "dist", "src", "webapp", "MDKModule", "gen"];
89900
- const fileNames = [constants_1.FileName.Pom, constants_1.FileName.Package];
89898
+ const excludeFolders2 = ["node_modules", "dist", "webapp", "MDKModule", "gen"];
89899
+ const fileNames = [constants_1.FileName.Pom, constants_1.FileName.Package, constants_1.FileName.CapJavaApplicationYaml];
89901
89900
  const wsRoots = wsFoldersToRootPaths(options3.wsFolders);
89902
89901
  for (const root of wsRoots) {
89903
89902
  const filesToCheck = yield (0, file_1.findBy)({
@@ -89905,7 +89904,14 @@ var require_search = __commonJS({
89905
89904
  root,
89906
89905
  excludeFolders: excludeFolders2
89907
89906
  });
89908
- const foldersToCheck = Array.from(new Set(filesToCheck.map((file) => (0, path_1.dirname)(file))));
89907
+ const appYamlsToCheck = Array.from(new Set(filesToCheck.filter((file) => (0, path_1.basename)(file) === constants_1.FileName.CapJavaApplicationYaml).map((file) => (0, path_1.dirname)(file))));
89908
+ const foldersToCheck = Array.from(new Set(filesToCheck.filter((file) => (0, path_1.basename)(file) !== constants_1.FileName.CapJavaApplicationYaml).map((file) => (0, path_1.dirname)(file))));
89909
+ for (const appYamlToCheck of appYamlsToCheck) {
89910
+ const capRoot = yield findCapProjectRoot(appYamlToCheck);
89911
+ if (capRoot) {
89912
+ result2.add(capRoot);
89913
+ }
89914
+ }
89909
89915
  for (const folderToCheck of foldersToCheck) {
89910
89916
  if ((yield (0, cap_1.getCapProjectType)(folderToCheck)) !== void 0) {
89911
89917
  result2.add(folderToCheck);
@@ -89919,6 +89925,118 @@ var require_search = __commonJS({
89919
89925
  }
89920
89926
  });
89921
89927
 
89928
+ // ../../node_modules/@sap-ux/project-access/dist/project/info.js
89929
+ var require_info = __commonJS({
89930
+ "../../node_modules/@sap-ux/project-access/dist/project/info.js"(exports2) {
89931
+ "use strict";
89932
+ var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
89933
+ function adopt(value) {
89934
+ return value instanceof P ? value : new P(function(resolve2) {
89935
+ resolve2(value);
89936
+ });
89937
+ }
89938
+ return new (P || (P = Promise))(function(resolve2, reject2) {
89939
+ function fulfilled(value) {
89940
+ try {
89941
+ step(generator.next(value));
89942
+ } catch (e) {
89943
+ reject2(e);
89944
+ }
89945
+ }
89946
+ function rejected(value) {
89947
+ try {
89948
+ step(generator["throw"](value));
89949
+ } catch (e) {
89950
+ reject2(e);
89951
+ }
89952
+ }
89953
+ function step(result2) {
89954
+ result2.done ? resolve2(result2.value) : adopt(result2.value).then(fulfilled, rejected);
89955
+ }
89956
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
89957
+ });
89958
+ };
89959
+ Object.defineProperty(exports2, "__esModule", { value: true });
89960
+ exports2.getProjectType = exports2.getAppType = exports2.getAppProgrammingLanguage = void 0;
89961
+ var path_1 = require("path");
89962
+ var constants_1 = require_constants5();
89963
+ var file_1 = require_file4();
89964
+ var cap_1 = require_cap();
89965
+ var ui5_config_1 = require_ui5_config();
89966
+ var search_1 = require_search();
89967
+ function getAppProgrammingLanguage(appRoot, memFs) {
89968
+ return __awaiter(this, void 0, void 0, function* () {
89969
+ const ignoreFolders = ["node_modules", ".git"];
89970
+ let appLanguage = "";
89971
+ try {
89972
+ const webappPath = yield (0, ui5_config_1.getWebappPath)(appRoot, memFs);
89973
+ if (yield (0, file_1.fileExists)(webappPath, memFs)) {
89974
+ if ((yield (0, file_1.fileExists)((0, path_1.join)(appRoot, constants_1.FileName.Tsconfig), memFs)) && (yield (0, file_1.findFilesByExtension)(".ts", webappPath, ignoreFolders, memFs)).length > 0) {
89975
+ appLanguage = "TypeScript";
89976
+ } else if ((yield (0, file_1.findFilesByExtension)(".js", webappPath, ignoreFolders, memFs)).length > 0) {
89977
+ appLanguage = "JavaScript";
89978
+ }
89979
+ }
89980
+ } catch (_a2) {
89981
+ }
89982
+ return appLanguage;
89983
+ });
89984
+ }
89985
+ exports2.getAppProgrammingLanguage = getAppProgrammingLanguage;
89986
+ function getAppType(appRoot) {
89987
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
89988
+ return __awaiter(this, void 0, void 0, function* () {
89989
+ let appType;
89990
+ try {
89991
+ const artifacts = yield (0, search_1.findFioriArtifacts)({
89992
+ wsFolders: [appRoot],
89993
+ artifacts: ["adaptations", "applications", "extensions", "libraries"]
89994
+ });
89995
+ if (((_b = (_a2 = artifacts.applications) === null || _a2 === void 0 ? void 0 : _a2.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = artifacts.adaptations) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) + ((_f = (_e = artifacts.extensions) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) + ((_h = (_g = artifacts.libraries) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) === 1) {
89996
+ if (((_j = artifacts.applications) === null || _j === void 0 ? void 0 : _j.length) === 1) {
89997
+ appType = yield getApplicationType(artifacts.applications[0]);
89998
+ } else if (((_k = artifacts.adaptations) === null || _k === void 0 ? void 0 : _k.length) === 1) {
89999
+ appType = "Fiori Adaptation";
90000
+ } else if (((_l = artifacts.extensions) === null || _l === void 0 ? void 0 : _l.length) === 1) {
90001
+ appType = "SAPUI5 Extension";
90002
+ } else if (((_m = artifacts.libraries) === null || _m === void 0 ? void 0 : _m.length) === 1) {
90003
+ appType = "Fiori Reuse";
90004
+ }
90005
+ }
90006
+ } catch (_o) {
90007
+ }
90008
+ return appType;
90009
+ });
90010
+ }
90011
+ exports2.getAppType = getAppType;
90012
+ function getApplicationType(application) {
90013
+ return __awaiter(this, void 0, void 0, function* () {
90014
+ let appType;
90015
+ const rootPackageJsonPath = (0, path_1.join)(application.projectRoot, constants_1.FileName.Package);
90016
+ const packageJson = (yield (0, file_1.fileExists)(rootPackageJsonPath)) ? yield (0, file_1.readJSON)(rootPackageJsonPath) : null;
90017
+ if (application.projectRoot === application.appRoot) {
90018
+ appType = (packageJson === null || packageJson === void 0 ? void 0 : packageJson.sapux) ? "SAP Fiori elements" : "SAPUI5 freestyle";
90019
+ } else if (packageJson) {
90020
+ appType = Array.isArray(packageJson.sapux) && packageJson.sapux.find((relAppPath) => (0, path_1.join)(application.projectRoot, ...relAppPath.split(/[/\\]/)) === application.appRoot) ? "SAP Fiori elements" : "SAPUI5 freestyle";
90021
+ } else {
90022
+ appType = "SAPUI5 freestyle";
90023
+ }
90024
+ return appType;
90025
+ });
90026
+ }
90027
+ function getProjectType(projectRoot) {
90028
+ return __awaiter(this, void 0, void 0, function* () {
90029
+ const capType = yield (0, cap_1.getCapProjectType)(projectRoot);
90030
+ if (capType === void 0) {
90031
+ return "EDMXBackend";
90032
+ }
90033
+ return capType;
90034
+ });
90035
+ }
90036
+ exports2.getProjectType = getProjectType;
90037
+ }
90038
+ });
90039
+
89922
90040
  // ../../node_modules/@sap-ux/project-access/dist/project/mta.js
89923
90041
  var require_mta = __commonJS({
89924
90042
  "../../node_modules/@sap-ux/project-access/dist/project/mta.js"(exports2) {
@@ -89978,7 +90096,7 @@ var require_project2 = __commonJS({
89978
90096
  "../../node_modules/@sap-ux/project-access/dist/project/index.js"(exports2) {
89979
90097
  "use strict";
89980
90098
  Object.defineProperty(exports2, "__esModule", { value: true });
89981
- exports2.getMtaPath = exports2.readUi5Yaml = exports2.getWebappPath = exports2.getAppRootFromWebappPath = exports2.findProjectRoot = exports2.findFioriArtifacts = exports2.findCapProjects = exports2.findAllApps = exports2.loadModuleFromProject = exports2.getAppProgrammingLanguage = exports2.getNodeModulesPath = exports2.readCapServiceMetadataEdmx = exports2.getCapEnvironment = exports2.isCapNodeJsProject = exports2.isCapJavaProject = exports2.getCdsServices = exports2.getCdsRoots = exports2.getCdsFiles = exports2.getCapProjectType = exports2.getCapModelAndServices = exports2.getCapCustomPaths = void 0;
90099
+ exports2.getMtaPath = exports2.readUi5Yaml = exports2.getWebappPath = exports2.getAppRootFromWebappPath = exports2.findProjectRoot = exports2.findFioriArtifacts = exports2.findCapProjects = exports2.findAllApps = exports2.loadModuleFromProject = exports2.getProjectType = exports2.getAppType = exports2.getAppProgrammingLanguage = exports2.getNodeModulesPath = exports2.readCapServiceMetadataEdmx = exports2.getCapEnvironment = exports2.isCapNodeJsProject = exports2.isCapJavaProject = exports2.getCdsServices = exports2.getCdsRoots = exports2.getCdsFiles = exports2.getCapProjectType = exports2.getCapModelAndServices = exports2.getCapCustomPaths = void 0;
89982
90100
  var cap_1 = require_cap();
89983
90101
  Object.defineProperty(exports2, "getCapCustomPaths", { enumerable: true, get: function() {
89984
90102
  return cap_1.getCapCustomPaths;
@@ -90018,6 +90136,12 @@ var require_project2 = __commonJS({
90018
90136
  Object.defineProperty(exports2, "getAppProgrammingLanguage", { enumerable: true, get: function() {
90019
90137
  return info_1.getAppProgrammingLanguage;
90020
90138
  } });
90139
+ Object.defineProperty(exports2, "getAppType", { enumerable: true, get: function() {
90140
+ return info_1.getAppType;
90141
+ } });
90142
+ Object.defineProperty(exports2, "getProjectType", { enumerable: true, get: function() {
90143
+ return info_1.getProjectType;
90144
+ } });
90021
90145
  var module_loader_1 = require_module_loader();
90022
90146
  Object.defineProperty(exports2, "loadModuleFromProject", { enumerable: true, get: function() {
90023
90147
  return module_loader_1.loadModuleFromProject;
@@ -90159,7 +90283,7 @@ var require_dist13 = __commonJS({
90159
90283
  __createBinding(exports3, m, p);
90160
90284
  };
90161
90285
  Object.defineProperty(exports2, "__esModule", { value: true });
90162
- exports2.getFilePaths = exports2.readUi5Yaml = exports2.readCapServiceMetadataEdmx = exports2.loadModuleFromProject = exports2.isCapNodeJsProject = exports2.isCapJavaProject = exports2.getWebappPath = exports2.getNodeModulesPath = exports2.getMtaPath = exports2.getCdsServices = exports2.getCdsRoots = exports2.getCdsFiles = exports2.getCapProjectType = exports2.getCapModelAndServices = exports2.getCapEnvironment = exports2.getCapCustomPaths = exports2.getAppProgrammingLanguage = exports2.getAppRootFromWebappPath = exports2.findProjectRoot = exports2.findFioriArtifacts = exports2.findCapProjects = exports2.findAllApps = exports2.FileName = void 0;
90286
+ exports2.getFilePaths = exports2.readUi5Yaml = exports2.readCapServiceMetadataEdmx = exports2.loadModuleFromProject = exports2.isCapNodeJsProject = exports2.isCapJavaProject = exports2.getWebappPath = exports2.getProjectType = exports2.getNodeModulesPath = exports2.getMtaPath = exports2.getCdsServices = exports2.getCdsRoots = exports2.getCdsFiles = exports2.getCapProjectType = exports2.getCapModelAndServices = exports2.getCapEnvironment = exports2.getCapCustomPaths = exports2.getAppType = exports2.getAppProgrammingLanguage = exports2.getAppRootFromWebappPath = exports2.findProjectRoot = exports2.findFioriArtifacts = exports2.findCapProjects = exports2.findAllApps = exports2.FileName = void 0;
90163
90287
  var constants_1 = require_constants5();
90164
90288
  Object.defineProperty(exports2, "FileName", { enumerable: true, get: function() {
90165
90289
  return constants_1.FileName;
@@ -90183,6 +90307,9 @@ var require_dist13 = __commonJS({
90183
90307
  Object.defineProperty(exports2, "getAppProgrammingLanguage", { enumerable: true, get: function() {
90184
90308
  return project_1.getAppProgrammingLanguage;
90185
90309
  } });
90310
+ Object.defineProperty(exports2, "getAppType", { enumerable: true, get: function() {
90311
+ return project_1.getAppType;
90312
+ } });
90186
90313
  Object.defineProperty(exports2, "getCapCustomPaths", { enumerable: true, get: function() {
90187
90314
  return project_1.getCapCustomPaths;
90188
90315
  } });
@@ -90210,6 +90337,9 @@ var require_dist13 = __commonJS({
90210
90337
  Object.defineProperty(exports2, "getNodeModulesPath", { enumerable: true, get: function() {
90211
90338
  return project_1.getNodeModulesPath;
90212
90339
  } });
90340
+ Object.defineProperty(exports2, "getProjectType", { enumerable: true, get: function() {
90341
+ return project_1.getProjectType;
90342
+ } });
90213
90343
  Object.defineProperty(exports2, "getWebappPath", { enumerable: true, get: function() {
90214
90344
  return project_1.getWebappPath;
90215
90345
  } });
@@ -90528,32 +90658,41 @@ var require_utils10 = __commonJS({
90528
90658
  if (await (0, capProject_1.isCapProject)(appRoot, appPckJson)) {
90529
90659
  return null;
90530
90660
  }
90531
- if (((0, fs_1.existsSync)((0, path_1.join)(appRoot, project_spec_1.FileName.Ui5LocalYaml)) || (0, fs_1.existsSync)((0, path_1.join)(appRoot, project_spec_1.FileName.ExtConfigJson))) && (0, exports2.hasDependency)(appPckJson, "@sap/ux-ui5-tooling") || await isReuseLib(appRoot)) {
90661
+ const projectRoot = await findCapRoot(appRoot);
90662
+ if (projectRoot) {
90663
+ return {
90664
+ appRoot,
90665
+ projectRoot
90666
+ };
90667
+ } else if (
90668
+ // Check for freestyle non CAP
90669
+ ((0, fs_1.existsSync)((0, path_1.join)(appRoot, project_spec_1.FileName.Ui5LocalYaml)) || (0, fs_1.existsSync)((0, path_1.join)(appRoot, project_spec_1.FileName.ExtConfigJson))) && (0, exports2.hasDependency)(appPckJson, "@sap/ux-ui5-tooling") || await isReuseLib(appRoot)
90670
+ ) {
90532
90671
  return {
90533
90672
  appRoot,
90534
90673
  projectRoot: appRoot
90535
90674
  };
90536
90675
  }
90537
- try {
90538
- const { root } = (0, path_1.parse)(appRoot);
90539
- let projectRoot = (0, path_1.dirname)(appRoot);
90540
- while (projectRoot !== root) {
90541
- if (await (0, capProject_1.isCapProject)(projectRoot) && (0, path_1.join)(projectRoot, "app") !== appRoot) {
90542
- return {
90543
- appRoot,
90544
- projectRoot
90545
- };
90546
- }
90547
- projectRoot = (0, path_1.dirname)(projectRoot);
90548
- }
90549
- } catch (e) {
90550
- }
90551
90676
  } catch (error4) {
90552
90677
  console.error(error4);
90553
90678
  }
90554
90679
  return null;
90555
90680
  }
90556
90681
  exports2.findRootsForPath = findRootsForPath;
90682
+ async function findCapRoot(path4) {
90683
+ try {
90684
+ const { root } = (0, path_1.parse)(path4);
90685
+ let projectRoot = (0, path_1.dirname)(path4);
90686
+ while (projectRoot !== root) {
90687
+ if (await (0, capProject_1.isCapProject)(projectRoot) && (0, path_1.join)(projectRoot, "app") !== path4) {
90688
+ return projectRoot;
90689
+ }
90690
+ projectRoot = (0, path_1.dirname)(projectRoot);
90691
+ }
90692
+ } catch (e) {
90693
+ }
90694
+ return null;
90695
+ }
90557
90696
  var findRunnableProjects = async (workspaceRoots, logger) => {
90558
90697
  const result2 = [];
90559
90698
  const roots = await findAllProjectRoots(workspaceRoots, false);
@@ -90919,13 +91058,18 @@ var require_utils10 = __commonJS({
90919
91058
  exports2.checkServeLocalConfig = checkServeLocalConfig;
90920
91059
  function getAppIdForFile(filepath, projectRoot, appIds) {
90921
91060
  let appId = "";
90922
- appIds.forEach((appIdTmp) => {
90923
- const relativeStr = (0, path_1.relative)((0, path_1.join)(projectRoot, appIdTmp), filepath);
91061
+ for (const appIdTmp of appIds) {
91062
+ const appPath = (0, path_1.join)(projectRoot, appIdTmp);
91063
+ if (appPath === filepath) {
91064
+ appId = appIdTmp;
91065
+ break;
91066
+ }
91067
+ const relativeStr = (0, path_1.relative)(appPath, filepath);
90924
91068
  if (relativeStr && !relativeStr.startsWith("..") && !(0, path_1.isAbsolute)(relativeStr)) {
90925
91069
  appId = appIdTmp;
91070
+ break;
90926
91071
  }
90927
- });
90928
- appId = os_1.default.platform() === "win32" ? appId.replace(/\/\//g, "/") : appId;
91072
+ }
90929
91073
  return appId;
90930
91074
  }
90931
91075
  exports2.getAppIdForFile = getAppIdForFile;
@@ -146305,587 +146449,9 @@ var require_archive3 = __commonJS({
146305
146449
  }
146306
146450
  });
146307
146451
 
146308
- // ../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/middlewares.js
146309
- var require_middlewares2 = __commonJS({
146310
- "../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/middlewares.js"(exports2) {
146311
- "use strict";
146312
- Object.defineProperty(exports2, "__esModule", { value: true });
146313
- exports2.getMockServerMiddlewareConfig = exports2.getFioriToolsProxyMiddlewareConfig = exports2.getAppReloadMiddlewareConfig = void 0;
146314
- function getAppReloadMiddlewareConfig() {
146315
- return {
146316
- name: "fiori-tools-appreload",
146317
- afterMiddleware: "compression",
146318
- configuration: {
146319
- port: 35729,
146320
- path: "webapp",
146321
- delay: 300
146322
- }
146323
- };
146324
- }
146325
- exports2.getAppReloadMiddlewareConfig = getAppReloadMiddlewareConfig;
146326
- function getFioriToolsProxyMiddlewareConfig(backends, ui5) {
146327
- var _a2, _b;
146328
- const fioriToolsProxy = {
146329
- name: "fiori-tools-proxy",
146330
- afterMiddleware: "compression",
146331
- configuration: {
146332
- ignoreCertError: false
146333
- }
146334
- };
146335
- const comments = [
146336
- {
146337
- path: "configuration.ignoreCertError",
146338
- comment: " If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted"
146339
- }
146340
- ];
146341
- if (backends && backends.length > 0) {
146342
- backends.forEach((element) => {
146343
- var _a3;
146344
- element.path = (_a3 = element.path) !== null && _a3 !== void 0 ? _a3 : "/";
146345
- });
146346
- fioriToolsProxy.configuration.backend = backends;
146347
- }
146348
- if (ui5 !== void 0) {
146349
- fioriToolsProxy.configuration["ui5"] = {
146350
- path: (_a2 = ui5.path) !== null && _a2 !== void 0 ? _a2 : ["/resources", "/test-resources"],
146351
- url: (_b = ui5.url) !== null && _b !== void 0 ? _b : "https://ui5.sap.com"
146352
- };
146353
- if (ui5.version) {
146354
- fioriToolsProxy.configuration["ui5"].version = ui5.version;
146355
- }
146356
- if (ui5.directLoad) {
146357
- fioriToolsProxy.configuration["ui5"].directLoad = true;
146358
- }
146359
- }
146360
- return { config: fioriToolsProxy, comments };
146361
- }
146362
- exports2.getFioriToolsProxyMiddlewareConfig = getFioriToolsProxyMiddlewareConfig;
146363
- var getMockServerMiddlewareConfig = (path4) => {
146364
- path4 = path4 === null || path4 === void 0 ? void 0 : path4.replace(/\/$/, "");
146365
- return {
146366
- name: "sap-fe-mockserver",
146367
- beforeMiddleware: "csp",
146368
- configuration: {
146369
- mountPath: "/",
146370
- services: [
146371
- {
146372
- urlPath: path4 !== null && path4 !== void 0 ? path4 : "",
146373
- metadataPath: "./webapp/localService/metadata.xml",
146374
- mockdataPath: "./webapp/localService/data",
146375
- generateMockData: true
146376
- }
146377
- ],
146378
- annotations: []
146379
- }
146380
- };
146381
- };
146382
- exports2.getMockServerMiddlewareConfig = getMockServerMiddlewareConfig;
146383
- }
146384
- });
146385
-
146386
- // ../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/ui5config.js
146387
- var require_ui5config2 = __commonJS({
146388
- "../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/ui5config.js"(exports2) {
146389
- "use strict";
146390
- var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
146391
- function adopt(value) {
146392
- return value instanceof P ? value : new P(function(resolve2) {
146393
- resolve2(value);
146394
- });
146395
- }
146396
- return new (P || (P = Promise))(function(resolve2, reject2) {
146397
- function fulfilled(value) {
146398
- try {
146399
- step(generator.next(value));
146400
- } catch (e) {
146401
- reject2(e);
146402
- }
146403
- }
146404
- function rejected(value) {
146405
- try {
146406
- step(generator["throw"](value));
146407
- } catch (e) {
146408
- reject2(e);
146409
- }
146410
- }
146411
- function step(result2) {
146412
- result2.done ? resolve2(result2.value) : adopt(result2.value).then(fulfilled, rejected);
146413
- }
146414
- step((generator = generator.apply(thisArg, _arguments || [])).next());
146415
- });
146416
- };
146417
- Object.defineProperty(exports2, "__esModule", { value: true });
146418
- exports2.UI5Config = void 0;
146419
- var yaml_1 = require_dist11();
146420
- var middlewares_1 = require_middlewares2();
146421
- var UI5Config = class _UI5Config {
146422
- /**
146423
- * Returns a new instance of UI5Config.
146424
- *
146425
- * @static
146426
- * @param {string} serializedYaml - the serialized yaml string
146427
- * @returns {UI5Config} the UI5Config instance
146428
- * @memberof UI5Config
146429
- */
146430
- static newInstance(serializedYaml) {
146431
- return __awaiter(this, void 0, void 0, function* () {
146432
- const instance = new _UI5Config();
146433
- instance.document = yield yaml_1.YamlDocument.newInstance(serializedYaml);
146434
- return instance;
146435
- });
146436
- }
146437
- /**
146438
- * Tries reading the resources/configuration object from the config.
146439
- *
146440
- * @returns resources/configuration object from config or an empty object
146441
- * @memberof UI5Config
146442
- */
146443
- getConfiguration() {
146444
- var _a2;
146445
- let resources;
146446
- try {
146447
- resources = this.document.getMap({ path: "resources" }).toJSON();
146448
- } catch (error4) {
146449
- resources = {};
146450
- }
146451
- return (_a2 = resources.configuration) !== null && _a2 !== void 0 ? _a2 : {};
146452
- }
146453
- /**
146454
- * Adds or replaces the resources/configuration object in the config.
146455
- *
146456
- * @param config configuration object that is to be written to the config
146457
- * @returns {UI5Config} the UI5Config instance
146458
- * @memberof UI5Config
146459
- */
146460
- setConfiguration(config) {
146461
- this.document.setIn({
146462
- path: "resources",
146463
- value: { configuration: config }
146464
- });
146465
- return this;
146466
- }
146467
- /**
146468
- * Set the metadata object in the yaml file.
146469
- * See also https://sap.github.io/ui5-tooling/pages/Configuration/#metadata for reference.
146470
- *
146471
- * @param {Ui5Document['metadata']} value metadata of the project or application
146472
- * @returns {UI5Config} the UI5Config instance
146473
- * @memberof UI5Config
146474
- */
146475
- setMetadata(value) {
146476
- this.document.setIn({ path: "metadata", value });
146477
- return this;
146478
- }
146479
- /**
146480
- * Set the type in the yaml file.
146481
- * See also https://sap.github.io/ui5-tooling/pages/Configuration/#general-configuration for reference.
146482
- *
146483
- * @param {Ui5Document['type']} value - type of the application
146484
- * @returns {UI5Config} the UI5Config instance
146485
- * @memberof UI5Config
146486
- */
146487
- setType(value) {
146488
- this.document.setIn({ path: "type", value });
146489
- return this;
146490
- }
146491
- /**
146492
- * Add a custom configuration to the yaml.
146493
- *
146494
- * @param key key/name of the custom property
146495
- * @param value the properties value
146496
- */
146497
- addCustomConfiguration(key, value) {
146498
- try {
146499
- const configNode = this.document.getMap({ path: "customConfiguration" });
146500
- configNode.setIn([key], value);
146501
- } catch (_error) {
146502
- this.document.setIn({
146503
- path: "customConfiguration",
146504
- value: {
146505
- [key]: value
146506
- }
146507
- });
146508
- }
146509
- }
146510
- /**
146511
- * Get a custom configuration from the yaml.
146512
- *
146513
- * @param key key/name of the custom property
146514
- * @returns the value of the property or undefined
146515
- */
146516
- getCustomConfiguration(key) {
146517
- var _a2, _b;
146518
- try {
146519
- const node = this.document.getMap({ path: "customConfiguration" }).get(key);
146520
- return (_b = (_a2 = node === null || node === void 0 ? void 0 : node.toJSON) === null || _a2 === void 0 ? void 0 : _a2.call(node)) !== null && _b !== void 0 ? _b : node === null || node === void 0 ? void 0 : node.toString();
146521
- } catch (_error) {
146522
- return void 0;
146523
- }
146524
- }
146525
- /**
146526
- * Adds a UI5 Framework entry to the yaml file.
146527
- *
146528
- * @param {string} ui5Framework - whether to user SAPUI5 or OpenUI5
146529
- * @param {string} ui5Version - ui5 version
146530
- * @param {string[]} ui5Libraries - a list of libraries
146531
- * @param {string} ui5Theme - optional ui5 theme
146532
- * @returns {UI5Config} the UI5Config instance
146533
- * @memberof UI5Config
146534
- */
146535
- addUI5Framework(ui5Framework, ui5Version, ui5Libraries, ui5Theme = "sap_fiori_3") {
146536
- const libraryObjs = [];
146537
- for (const library of ui5Libraries) {
146538
- libraryObjs.push({ name: library });
146539
- }
146540
- libraryObjs.push({ name: `themelib_${ui5Theme.replace(/_dark$|_hcw$|_hcb$/, "")}` });
146541
- this.document.setIn({
146542
- path: "framework",
146543
- value: { name: ui5Framework, version: ui5Version, libraries: libraryObjs }
146544
- });
146545
- return this;
146546
- }
146547
- /**
146548
- * Adds a list of custom tasks to the config.
146549
- *
146550
- * @param {CustomTask<any>[]} tasks - the list of custom tasks
146551
- * @param {NodeComment<CustomMiddleware<any>>[]} comments - a list of comments
146552
- * @returns {UI5Config} the UI5Config instance
146553
- * @memberof UI5Config
146554
- */
146555
- addCustomTasks(tasks, comments) {
146556
- for (const task5 of tasks) {
146557
- this.document.appendTo({ path: "builder.customTasks", value: task5, comments });
146558
- }
146559
- return this;
146560
- }
146561
- /**
146562
- * Adds a list of custom middlewares to the config.
146563
- *
146564
- * @param {CustomMiddleware<any>[]} middlewares - the list of custom middlewares
146565
- * @param {NodeComment<CustomMiddleware<any>>[]} comments - a list of comments
146566
- * @returns {UI5Config} the UI5Config instance
146567
- * @memberof UI5Config
146568
- */
146569
- addCustomMiddleware(middlewares, comments) {
146570
- for (const mw of middlewares) {
146571
- this.document.appendTo({ path: "server.customMiddleware", value: mw, comments });
146572
- }
146573
- return this;
146574
- }
146575
- /**
146576
- * Adds a instance of the Fiori tools app-reload middleware to the config.
146577
- *
146578
- * @returns {UI5Config} the UI5Config instance
146579
- * @memberof UI5Config
146580
- */
146581
- addFioriToolsAppReloadMiddleware() {
146582
- this.document.appendTo({
146583
- path: "server.customMiddleware",
146584
- value: (0, middlewares_1.getAppReloadMiddlewareConfig)()
146585
- });
146586
- return this;
146587
- }
146588
- /**
146589
- * Adds a instance of the Fiori tools proxy middleware to the config.
146590
- *
146591
- * @param proxyConfig proxy configuration containing an optional array of backend and an option UI5 host configuration
146592
- * @returns {UI5Config} the UI5Config instance
146593
- * @memberof UI5Config
146594
- */
146595
- addFioriToolsProxydMiddleware(proxyConfig) {
146596
- const { config, comments } = (0, middlewares_1.getFioriToolsProxyMiddlewareConfig)(proxyConfig.backend, proxyConfig.ui5);
146597
- this.document.appendTo({
146598
- path: "server.customMiddleware",
146599
- value: config,
146600
- comments
146601
- });
146602
- return this;
146603
- }
146604
- /**
146605
- * Adds a backend configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.
146606
- *
146607
- * @param backend config of backend that is to be proxied
146608
- * @returns {UI5Config} the UI5Config instance
146609
- * @memberof UI5Config
146610
- */
146611
- addBackendToFioriToolsProxydMiddleware(backend) {
146612
- const middlewareList = this.document.getSequence({ path: "server.customMiddleware" });
146613
- const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === "fiori-tools-proxy");
146614
- if (!proxyMiddleware) {
146615
- throw new Error("Could not find fiori-tools-proxy");
146616
- }
146617
- this.document.getMap({ start: proxyMiddleware, path: "configuration" }).set("backend", [backend]);
146618
- return this;
146619
- }
146620
- /**
146621
- * Adds a ui configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.
146622
- *
146623
- * @param ui5 config of backend that is to be proxied
146624
- * @returns {UI5Config} the UI5Config instance
146625
- * @memberof UI5Config
146626
- */
146627
- addUi5ToFioriToolsProxydMiddleware(ui5) {
146628
- const middlewareList = this.document.getSequence({ path: "server.customMiddleware" });
146629
- const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === "fiori-tools-proxy");
146630
- if (!proxyMiddleware) {
146631
- throw new Error("Could not find fiori-tools-proxy");
146632
- }
146633
- this.document.getMap({ start: proxyMiddleware, path: "configuration" }).set("ui5", [ui5]);
146634
- return this;
146635
- }
146636
- /**
146637
- * Adds a instance of the mockserver middleware to the config.
146638
- *
146639
- * @param path option path that is to be mocked
146640
- * @returns {UI5Config} the UI5Config instance
146641
- * @memberof UI5Config
146642
- */
146643
- addMockServerMiddleware(path4) {
146644
- this.document.appendTo({
146645
- path: "server.customMiddleware",
146646
- value: (0, middlewares_1.getMockServerMiddlewareConfig)(path4)
146647
- });
146648
- return this;
146649
- }
146650
- /**
146651
- * Adds the ABAP deployment task to the config.
146652
- *
146653
- * @param target system that this app is to be deployed to
146654
- * @param app application configuration for the deployment to ABAP
146655
- * @param fioriTools if true use the middleware included in the @sap/ux-ui5-tooling module
146656
- * @returns this UI5Config instance
146657
- * @memberof UI5Config
146658
- */
146659
- addAbapDeployTask(target, app, fioriTools = true) {
146660
- this.document.appendTo({
146661
- path: "builder.resources.excludes",
146662
- value: "/test/**"
146663
- });
146664
- this.document.appendTo({
146665
- path: "builder.resources.excludes",
146666
- value: "/localService/**"
146667
- });
146668
- this.document.appendTo({
146669
- path: "builder.customTasks",
146670
- value: {
146671
- name: fioriTools ? "deploy-to-abap" : "abap-deploy-task",
146672
- afterTask: "generateCachebusterInfo",
146673
- configuration: { target, app }
146674
- }
146675
- });
146676
- return this;
146677
- }
146678
- /**
146679
- * Remove a middleware form the UI5 config.
146680
- *
146681
- * @param name name of the middleware that is to be removed
146682
- * @returns {UI5Config} the UI5Config instance
146683
- * @memberof UI5Config
146684
- */
146685
- removeCustomMiddleware(name2) {
146686
- this.document.deleteAt({
146687
- path: "server.customMiddleware",
146688
- matcher: { key: "name", value: name2 }
146689
- });
146690
- return this;
146691
- }
146692
- /**
146693
- * Remove a task form the UI5 config.
146694
- *
146695
- * @param name name of the task that is to be removed
146696
- * @returns {UI5Config} the UI5Config instance
146697
- * @memberof UI5Config
146698
- */
146699
- removeCustomTask(name2) {
146700
- this.document.deleteAt({
146701
- path: "builder.customTasks",
146702
- matcher: { key: "name", value: name2 }
146703
- });
146704
- return this;
146705
- }
146706
- /**
146707
- * Find a custom item in the UI5 config.
146708
- *
146709
- * @param name name of the item (task or middlewre) that is to be looked for
146710
- * @param path path to the root of the sequence that is to be searched
146711
- * @returns the configuration as object or undefined if not found
146712
- * @memberof UI5Config
146713
- */
146714
- findCustomActivity(name2, path4) {
146715
- let list;
146716
- try {
146717
- list = this.document.getSequence({ path: path4 });
146718
- } catch (error4) {
146719
- }
146720
- let item;
146721
- if (list) {
146722
- item = this.document.findItem(list, (item2) => item2.name === name2);
146723
- }
146724
- return item ? item.toJSON() : void 0;
146725
- }
146726
- /**
146727
- * Find a middleware in the UI5 config.
146728
- *
146729
- * @param name name of the middleware that is to be looked for
146730
- * @returns the middleware configuration as object or undefined if not found
146731
- * @memberof UI5Config
146732
- */
146733
- findCustomMiddleware(name2) {
146734
- return this.findCustomActivity(name2, "server.customMiddleware");
146735
- }
146736
- /**
146737
- * Find a task in the UI5 config.
146738
- *
146739
- * @param name name of the task that is to be looked for
146740
- * @returns the middleware configuration as object or undefined if not found
146741
- * @memberof UI5Config
146742
- */
146743
- findCustomTask(name2) {
146744
- return this.findCustomActivity(name2, "builder.customTasks");
146745
- }
146746
- /**
146747
- * Update an existing custom middleware or create it. Existing custom middleware be overwritten, not merged.
146748
- * If the custom middleware doesn't exist, it will be added.
146749
- *
146750
- * @param middleware - middleware config
146751
- * @returns {UI5Config} the UI5Config instance
146752
- * @memberof UI5Config
146753
- */
146754
- updateCustomMiddleware(middleware) {
146755
- const name2 = middleware.name;
146756
- if (this.findCustomMiddleware(name2)) {
146757
- this.document.updateAt({
146758
- path: "server.customMiddleware",
146759
- matcher: { key: "name", value: name2 },
146760
- value: middleware,
146761
- mode: "overwrite"
146762
- });
146763
- } else {
146764
- this.addCustomMiddleware([middleware]);
146765
- }
146766
- return this;
146767
- }
146768
- /**
146769
- * Returns a string representation of the config.
146770
- *
146771
- * @returns {string} the string representation
146772
- * @memberof UI5Config
146773
- */
146774
- toString() {
146775
- return this.document.toString();
146776
- }
146777
- };
146778
- exports2.UI5Config = UI5Config;
146779
- }
146780
- });
146781
-
146782
- // ../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/utils.js
146783
- var require_utils16 = __commonJS({
146784
- "../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/utils.js"(exports2) {
146785
- "use strict";
146786
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
146787
- return mod && mod.__esModule ? mod : { "default": mod };
146788
- };
146789
- Object.defineProperty(exports2, "__esModule", { value: true });
146790
- exports2.getTypesPackage = exports2.getTypesVersion = exports2.getEsmTypesVersion = exports2.mergeObjects = void 0;
146791
- var mergeWith_1 = __importDefault(require_mergeWith());
146792
- var semver_1 = __importDefault(require_semver2());
146793
- function mergeObjects(base, extension2) {
146794
- return (0, mergeWith_1.default)({}, base, extension2, (objValue, srcValue) => {
146795
- if (objValue instanceof Array && srcValue instanceof Array) {
146796
- return [.../* @__PURE__ */ new Set([...objValue, ...srcValue])];
146797
- } else {
146798
- return void 0;
146799
- }
146800
- });
146801
- }
146802
- exports2.mergeObjects = mergeObjects;
146803
- function getEsmTypesVersion(minUI5Version) {
146804
- const version = semver_1.default.coerce(minUI5Version);
146805
- if (!version) {
146806
- return `~${"1.108.0"}`;
146807
- } else if (semver_1.default.lt(
146808
- version,
146809
- "1.94.0"
146810
- /* UI5_DEFAULT.ESM_TYPES_VERSION_SINCE */
146811
- )) {
146812
- return `~${"1.94.0"}`;
146813
- } else {
146814
- return `~${semver_1.default.major(version)}.${semver_1.default.minor(version)}.0`;
146815
- }
146816
- }
146817
- exports2.getEsmTypesVersion = getEsmTypesVersion;
146818
- function getTypesVersion(minUI5Version) {
146819
- const version = semver_1.default.coerce(minUI5Version);
146820
- if (!version) {
146821
- return `~${"1.108.0"}`;
146822
- } else if (semver_1.default.lt(
146823
- version,
146824
- "1.76.0"
146825
- /* UI5_DEFAULT.TYPES_VERSION_SINCE */
146826
- )) {
146827
- return `~${"1.76.0"}`;
146828
- } else {
146829
- return `~${semver_1.default.major(version)}.${semver_1.default.minor(version)}.0`;
146830
- }
146831
- }
146832
- exports2.getTypesVersion = getTypesVersion;
146833
- function getTypesPackage(ui5Version) {
146834
- var _a2;
146835
- const version = (_a2 = semver_1.default.coerce(ui5Version)) !== null && _a2 !== void 0 ? _a2 : semver_1.default.coerce(
146836
- "1.108.0"
146837
- /* UI5_DEFAULT.TYPES_VERSION_BEST */
146838
- );
146839
- if (version && semver_1.default.lt(
146840
- version,
146841
- "1.113.0"
146842
- /* UI5_DEFAULT.NEW_TYPES_PACKAGE_SINCE */
146843
- )) {
146844
- return "@sapui5/ts-types-esm";
146845
- } else {
146846
- return "@sapui5/types";
146847
- }
146848
- }
146849
- exports2.getTypesPackage = getTypesPackage;
146850
- }
146851
- });
146852
-
146853
- // ../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/index.js
146854
- var require_dist21 = __commonJS({
146855
- "../../node_modules/@sap-ux/deploy-tooling/node_modules/@sap-ux/ui5-config/dist/index.js"(exports2) {
146856
- "use strict";
146857
- Object.defineProperty(exports2, "__esModule", { value: true });
146858
- exports2.YAMLError = exports2.yamlErrorCode = exports2.getTypesPackage = exports2.getTypesVersion = exports2.getEsmTypesVersion = exports2.mergeObjects = exports2.UI5Config = void 0;
146859
- var ui5config_1 = require_ui5config2();
146860
- Object.defineProperty(exports2, "UI5Config", { enumerable: true, get: function() {
146861
- return ui5config_1.UI5Config;
146862
- } });
146863
- var utils_1 = require_utils16();
146864
- Object.defineProperty(exports2, "mergeObjects", { enumerable: true, get: function() {
146865
- return utils_1.mergeObjects;
146866
- } });
146867
- Object.defineProperty(exports2, "getEsmTypesVersion", { enumerable: true, get: function() {
146868
- return utils_1.getEsmTypesVersion;
146869
- } });
146870
- Object.defineProperty(exports2, "getTypesVersion", { enumerable: true, get: function() {
146871
- return utils_1.getTypesVersion;
146872
- } });
146873
- Object.defineProperty(exports2, "getTypesPackage", { enumerable: true, get: function() {
146874
- return utils_1.getTypesPackage;
146875
- } });
146876
- var yaml_1 = require_dist11();
146877
- Object.defineProperty(exports2, "yamlErrorCode", { enumerable: true, get: function() {
146878
- return yaml_1.errorCode;
146879
- } });
146880
- Object.defineProperty(exports2, "YAMLError", { enumerable: true, get: function() {
146881
- return yaml_1.YAMLError;
146882
- } });
146883
- }
146884
- });
146885
-
146886
- // ../../node_modules/@sap-ux/deploy-tooling/dist/cli/config.js
146887
- var require_config6 = __commonJS({
146888
- "../../node_modules/@sap-ux/deploy-tooling/dist/cli/config.js"(exports2) {
146452
+ // ../../node_modules/@sap-ux/deploy-tooling/dist/cli/config.js
146453
+ var require_config6 = __commonJS({
146454
+ "../../node_modules/@sap-ux/deploy-tooling/dist/cli/config.js"(exports2) {
146889
146455
  "use strict";
146890
146456
  var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
146891
146457
  function adopt(value) {
@@ -146916,7 +146482,7 @@ var require_config6 = __commonJS({
146916
146482
  };
146917
146483
  Object.defineProperty(exports2, "__esModule", { value: true });
146918
146484
  exports2.mergeConfig = exports2.getDeploymentConfig = exports2.getVersion = void 0;
146919
- var ui5_config_1 = require_dist21();
146485
+ var ui5_config_1 = require_dist12();
146920
146486
  var fs_1 = require("fs");
146921
146487
  var path_1 = require("path");
146922
146488
  var types_1 = require_types14();
@@ -147157,7 +146723,7 @@ var require_cli4 = __commonJS({
147157
146723
  });
147158
146724
 
147159
146725
  // ../../node_modules/@sap-ux/deploy-tooling/dist/index.js
147160
- var require_dist22 = __commonJS({
146726
+ var require_dist21 = __commonJS({
147161
146727
  "../../node_modules/@sap-ux/deploy-tooling/dist/index.js"(exports2) {
147162
146728
  "use strict";
147163
146729
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
@@ -154843,12 +154409,12 @@ var import_ux_telemetry2 = __toESM(require_src13());
154843
154409
  var import_fs9 = require("fs");
154844
154410
 
154845
154411
  // src/tasks/deploy/util.ts
154846
- var import_deploy_tooling2 = __toESM(require_dist22());
154412
+ var import_deploy_tooling2 = __toESM(require_dist21());
154847
154413
  init_i18next();
154848
154414
  var import_prompts = __toESM(require_prompts3());
154849
154415
 
154850
154416
  // src/tasks/common/index.ts
154851
- var import_deploy_tooling = __toESM(require_dist22());
154417
+ var import_deploy_tooling = __toESM(require_dist21());
154852
154418
  var import_btp_utils3 = __toESM(require_dist10());
154853
154419
  var commands = { runDeploy: import_deploy_tooling.runDeploy, runUndeploy: import_deploy_tooling.runUndeploy };
154854
154420
  var configureCliParamsUsingUI5Config = (config) => {
@@ -155048,7 +154614,7 @@ async function updateTransportDeployConfig(transport, config, log7 = console) {
155048
154614
  var package_default = {
155049
154615
  name: "@sap/ux-ui5-tooling",
155050
154616
  displayName: "SAP Fiori Tools \u2013 UI5 Tooling",
155051
- version: "1.12.2",
154617
+ version: "1.12.3",
155052
154618
  description: "SAP Fiori Tools \u2013 UI5 Tooling",
155053
154619
  publisher: "SAPSE",
155054
154620
  license: "SEE LICENSE IN LICENSE",
@@ -155094,22 +154660,23 @@ var package_default = {
155094
154660
  },
155095
154661
  devDependencies: {
155096
154662
  "@sap-ux/adp-tooling": "0.7.2",
155097
- "@sap-ux/backend-proxy-middleware": "0.7.5",
154663
+ "@sap-ux/backend-proxy-middleware": "0.7.8",
155098
154664
  "@sap-ux/btp-utils": "0.12.1",
155099
154665
  "@sap-ux/deploy-tooling": "0.11.10",
155100
154666
  "@sap-ux/logger": "0.4.0",
155101
- "@sap-ux/project-access": "1.15.3",
154667
+ "@sap-ux/project-access": "1.16.2",
155102
154668
  "@sap-ux/store": "0.4.0",
155103
154669
  "@sap-ux/ui5-config": "0.20.0",
154670
+ "@sap-ux/ui5-info": "0.2.2",
155104
154671
  "@sap-ux/ui5-proxy-middleware": "1.3.0",
155105
- "@sap/ux-app-templates": "1.12.2",
155106
- "@sap/ux-cds": "1.12.2",
155107
- "@sap/ux-common-utils": "1.12.2",
155108
- "@sap/ux-jest-runner-puppeteer": "1.12.2",
155109
- "@sap/ux-odata-client": "1.12.2",
155110
- "@sap/ux-telemetry": "1.12.2",
155111
- "@sap/ux-ui5-info": "1.12.2",
155112
- "@sapux/project-spec": "1.12.2",
154672
+ "@sap/ux-app-templates": "1.12.3",
154673
+ "@sap/ux-cds": "1.12.3",
154674
+ "@sap/ux-common-utils": "1.12.3",
154675
+ "@sap/ux-jest-runner-puppeteer": "1.12.3",
154676
+ "@sap/ux-odata-client": "1.12.3",
154677
+ "@sap/ux-telemetry": "1.12.3",
154678
+ "@sap/ux-ui5-info": "1.12.3",
154679
+ "@sapux/project-spec": "1.12.3",
155113
154680
  "@types/expect-puppeteer": "4.4.5",
155114
154681
  "@types/jest-dev-server": "5.0.0",
155115
154682
  "@types/marked": "4.0.1",