@sap/ux-ui5-tooling 1.7.1 → 1.7.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
@@ -21347,115 +21347,6 @@ var require_browser2 = __commonJS({
21347
21347
  }
21348
21348
  });
21349
21349
 
21350
- // ../lib/store/node_modules/has-flag/index.js
21351
- var require_has_flag2 = __commonJS({
21352
- "../lib/store/node_modules/has-flag/index.js"(exports2, module2) {
21353
- "use strict";
21354
- module2.exports = (flag, argv) => {
21355
- argv = argv || process.argv;
21356
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
21357
- const pos = argv.indexOf(prefix + flag);
21358
- const terminatorPos = argv.indexOf("--");
21359
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
21360
- };
21361
- }
21362
- });
21363
-
21364
- // ../lib/store/node_modules/supports-color/index.js
21365
- var require_supports_color2 = __commonJS({
21366
- "../lib/store/node_modules/supports-color/index.js"(exports2, module2) {
21367
- "use strict";
21368
- var os = require("os");
21369
- var hasFlag = require_has_flag2();
21370
- var env3 = process.env;
21371
- var forceColor;
21372
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
21373
- forceColor = false;
21374
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
21375
- forceColor = true;
21376
- }
21377
- if ("FORCE_COLOR" in env3) {
21378
- forceColor = env3.FORCE_COLOR.length === 0 || parseInt(env3.FORCE_COLOR, 10) !== 0;
21379
- }
21380
- function translateLevel(level) {
21381
- if (level === 0) {
21382
- return false;
21383
- }
21384
- return {
21385
- level,
21386
- hasBasic: true,
21387
- has256: level >= 2,
21388
- has16m: level >= 3
21389
- };
21390
- }
21391
- function supportsColor(stream) {
21392
- if (forceColor === false) {
21393
- return 0;
21394
- }
21395
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
21396
- return 3;
21397
- }
21398
- if (hasFlag("color=256")) {
21399
- return 2;
21400
- }
21401
- if (stream && !stream.isTTY && forceColor !== true) {
21402
- return 0;
21403
- }
21404
- const min = forceColor ? 1 : 0;
21405
- if (process.platform === "win32") {
21406
- const osRelease = os.release().split(".");
21407
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
21408
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
21409
- }
21410
- return 1;
21411
- }
21412
- if ("CI" in env3) {
21413
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") {
21414
- return 1;
21415
- }
21416
- return min;
21417
- }
21418
- if ("TEAMCITY_VERSION" in env3) {
21419
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
21420
- }
21421
- if (env3.COLORTERM === "truecolor") {
21422
- return 3;
21423
- }
21424
- if ("TERM_PROGRAM" in env3) {
21425
- const version = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
21426
- switch (env3.TERM_PROGRAM) {
21427
- case "iTerm.app":
21428
- return version >= 3 ? 3 : 2;
21429
- case "Apple_Terminal":
21430
- return 2;
21431
- }
21432
- }
21433
- if (/-256(color)?$/i.test(env3.TERM)) {
21434
- return 2;
21435
- }
21436
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
21437
- return 1;
21438
- }
21439
- if ("COLORTERM" in env3) {
21440
- return 1;
21441
- }
21442
- if (env3.TERM === "dumb") {
21443
- return min;
21444
- }
21445
- return min;
21446
- }
21447
- function getSupportLevel(stream) {
21448
- const level = supportsColor(stream);
21449
- return translateLevel(level);
21450
- }
21451
- module2.exports = {
21452
- supportsColor: getSupportLevel,
21453
- stdout: getSupportLevel(process.stdout),
21454
- stderr: getSupportLevel(process.stderr)
21455
- };
21456
- }
21457
- });
21458
-
21459
21350
  // ../lib/store/node_modules/debug/src/node.js
21460
21351
  var require_node2 = __commonJS({
21461
21352
  "../lib/store/node_modules/debug/src/node.js"(exports2, module2) {
@@ -21471,7 +21362,7 @@ var require_node2 = __commonJS({
21471
21362
  }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
21472
21363
  exports2.colors = [6, 2, 3, 4, 5, 1];
21473
21364
  try {
21474
- const supportsColor = require_supports_color2();
21365
+ const supportsColor = require_supports_color();
21475
21366
  if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
21476
21367
  exports2.colors = [
21477
21368
  20,
@@ -58644,7 +58535,7 @@ var require_package5 = __commonJS({
58644
58535
  "../lib/telemetry/dist/package.json"(exports2, module2) {
58645
58536
  module2.exports = {
58646
58537
  name: "@sap/ux-telemetry",
58647
- version: "1.7.1",
58538
+ version: "1.7.3",
58648
58539
  description: "SAP Fiori tools telemetry library",
58649
58540
  main: "dist/src/index.js",
58650
58541
  author: "SAP SE",
@@ -58669,10 +58560,10 @@ var require_package5 = __commonJS({
58669
58560
  },
58670
58561
  dependencies: {
58671
58562
  "@sap-ux/store": "0.3.0",
58672
- "@sap/ux-cds": "1.7.1",
58673
- "@sap/ux-common-utils": "1.7.1",
58674
- "@sap/ux-feature-toggle": "1.7.1",
58675
- "@sap/ux-project-access": "1.7.1",
58563
+ "@sap/ux-cds": "1.7.3",
58564
+ "@sap/ux-common-utils": "1.7.3",
58565
+ "@sap/ux-feature-toggle": "1.7.3",
58566
+ "@sap/ux-project-access": "1.7.3",
58676
58567
  applicationinsights: "1.4.1",
58677
58568
  "performance-now": "2.1.0",
58678
58569
  yaml: "2.0.0-10"
@@ -62181,10 +62072,36 @@ var require_yamlFile = __commonJS({
62181
62072
  }
62182
62073
  exports2.readUi5YamlConfig = readUi5YamlConfig;
62183
62074
  async function getParsedUi5YamlConfig(dirPath, filename) {
62075
+ var _a2;
62184
62076
  const contents = await readUi5YamlConfig(dirPath, filename);
62185
62077
  if (contents) {
62186
62078
  try {
62187
- return yaml.parse(contents);
62079
+ const parsed = yaml.parse(contents);
62080
+ if (((_a2 = parsed == null ? void 0 : parsed.server) == null ? void 0 : _a2.customMiddleware) && Array.isArray(parsed.server.customMiddleware)) {
62081
+ for (const middleware of parsed.server.customMiddleware) {
62082
+ const configuration = middleware == null ? void 0 : middleware.configuration;
62083
+ const services = [];
62084
+ if (Array.isArray(configuration == null ? void 0 : configuration.service)) {
62085
+ services.push(...configuration.service);
62086
+ } else if (configuration == null ? void 0 : configuration.service) {
62087
+ services.push(configuration.service);
62088
+ }
62089
+ if (Array.isArray(configuration == null ? void 0 : configuration.services)) {
62090
+ services.push(...configuration.services);
62091
+ } else if (configuration == null ? void 0 : configuration.services) {
62092
+ services.push(configuration.services);
62093
+ }
62094
+ for (const service of services) {
62095
+ if (service.mockdataRootPath) {
62096
+ service.mockdataPath = service.mockdataRootPath;
62097
+ }
62098
+ if (service.metadataXmlPath) {
62099
+ service.metadataPath = service.metadataXmlPath;
62100
+ }
62101
+ }
62102
+ }
62103
+ }
62104
+ return parsed;
62188
62105
  } catch (e) {
62189
62106
  throw new Error(i18n_1.i18n.t("ERROR_UI5_YAML_PARSING", { filePath: path_1.join(dirPath, filename), parsingError: e.message }));
62190
62107
  }
@@ -62272,10 +62189,10 @@ var require_mockServer = __commonJS({
62272
62189
  }
62273
62190
  return (services == null ? void 0 : services.length) ? services : null;
62274
62191
  }
62275
- function matchMockServiceByMetadataPath(mockService, metadataPath) {
62276
- const { metadataXmlPath } = mockService;
62277
- if (metadataXmlPath) {
62278
- return metadataPath.endsWith(path_1.normalize(metadataXmlPath));
62192
+ function matchMockServiceByMetadataPath(mockService, path4) {
62193
+ const { metadataPath } = mockService;
62194
+ if (metadataPath) {
62195
+ return path4.endsWith(path_1.normalize(metadataPath));
62279
62196
  }
62280
62197
  return false;
62281
62198
  }
@@ -63062,9 +62979,9 @@ var require_utils9 = __commonJS({
63062
62979
  const { services, mockFolder } = await ui5Config_1.getMockServicesConfiguration(configDir, config2);
63063
62980
  if (services) {
63064
62981
  const mockService = ui5Config_1.findMockServiceByMetadataPath(services, serviceMetadataPath);
63065
- if (mockService == null ? void 0 : mockService.mockdataRootPath) {
62982
+ if (mockService == null ? void 0 : mockService.mockdataPath) {
63066
62983
  const servicesConfigFilePath = mockFolder ? path_1.resolve(configDir, mockFolder) : configDir;
63067
- return path_1.resolve(servicesConfigFilePath, mockService.mockdataRootPath);
62984
+ return path_1.resolve(servicesConfigFilePath, mockService.mockdataPath);
63068
62985
  }
63069
62986
  }
63070
62987
  }
@@ -63078,6 +62995,11 @@ var require_types4 = __commonJS({
63078
62995
  "../lib/telemetry/dist/src/toolsSuiteTelemetry/types.js"(exports2) {
63079
62996
  "use strict";
63080
62997
  Object.defineProperty(exports2, "__esModule", { value: true });
62998
+ var ToolsId;
62999
+ (function(ToolsId2) {
63000
+ ToolsId2["UNKNOWN"] = "UNKNOWN";
63001
+ ToolsId2["NO_TOOLS_ID"] = "NO_TOOLS_ID";
63002
+ })(ToolsId = exports2.ToolsId || (exports2.ToolsId = {}));
63081
63003
  var ODataSource;
63082
63004
  (function(ODataSource2) {
63083
63005
  ODataSource2["CAPJava"] = "CAPJava";
@@ -63102,6 +63024,7 @@ var require_types4 = __commonJS({
63102
63024
  CommonProperties2["TemplateType"] = "cmn.template";
63103
63025
  CommonProperties2["DeployTargetType"] = "cmn.deployTarget";
63104
63026
  CommonProperties2["ODataSourceType"] = "cmn.odataSource";
63027
+ CommonProperties2["AppToolsId"] = "cmn.toolsId";
63105
63028
  })(CommonProperties = exports2.CommonProperties || (exports2.CommonProperties = {}));
63106
63029
  }
63107
63030
  });
@@ -63297,10 +63220,12 @@ var require_toolsSuiteTelemetryDataProcessor = __commonJS({
63297
63220
  const templateType = await getTemplateType(appPath);
63298
63221
  const deployTarget = await getDeployTarget(appPath);
63299
63222
  const odataSource = await getODataSource(appPath);
63223
+ const toolsId = await getToolsId(appPath);
63300
63224
  const output3 = {};
63301
63225
  output3[types_1.CommonProperties.TemplateType] = templateType;
63302
63226
  output3[types_1.CommonProperties.DeployTargetType] = deployTarget;
63303
63227
  output3[types_1.CommonProperties.ODataSourceType] = odataSource;
63228
+ output3[types_1.CommonProperties.AppToolsId] = toolsId;
63304
63229
  return output3;
63305
63230
  }
63306
63231
  async function getTemplateType(appPath) {
@@ -63385,6 +63310,20 @@ var require_toolsSuiteTelemetryDataProcessor = __commonJS({
63385
63310
  function getInternalVsExternal() {
63386
63311
  return ux_feature_toggle_1.isInternalFeaturesSettingEnabled() ? "internal" : "external";
63387
63312
  }
63313
+ async function getToolsId(appPath) {
63314
+ var _a2, _b, _c;
63315
+ try {
63316
+ const manifestPath = path_1.default.join(appPath, "webapp", "manifest.json");
63317
+ if (fs_1.default.existsSync(manifestPath)) {
63318
+ const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, "utf-8"));
63319
+ return (_c = (_b = (_a2 = manifest["sap.app"]) == null ? void 0 : _a2.sourceTemplate) == null ? void 0 : _b.toolsId) != null ? _c : types_1.ToolsId.NO_TOOLS_ID;
63320
+ }
63321
+ return types_1.ToolsId.NO_TOOLS_ID;
63322
+ } catch (err) {
63323
+ console.log(`[Telemetry]: ${err.message}`);
63324
+ return types_1.ToolsId.NO_TOOLS_ID;
63325
+ }
63326
+ }
63388
63327
  }
63389
63328
  });
63390
63329
 
@@ -69119,7 +69058,7 @@ var require_styles = __commonJS({
69119
69058
  });
69120
69059
 
69121
69060
  // ../../node_modules/@colors/colors/lib/system/has-flag.js
69122
- var require_has_flag3 = __commonJS({
69061
+ var require_has_flag2 = __commonJS({
69123
69062
  "../../node_modules/@colors/colors/lib/system/has-flag.js"(exports2, module2) {
69124
69063
  "use strict";
69125
69064
  module2.exports = function(flag, argv) {
@@ -69137,7 +69076,7 @@ var require_supports_colors = __commonJS({
69137
69076
  "../../node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
69138
69077
  "use strict";
69139
69078
  var os = require("os");
69140
- var hasFlag = require_has_flag3();
69079
+ var hasFlag = require_has_flag2();
69141
69080
  var env3 = process.env;
69142
69081
  var forceColor = void 0;
69143
69082
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
@@ -141260,7 +141199,7 @@ var require_styles2 = __commonJS({
141260
141199
  });
141261
141200
 
141262
141201
  // ../../node_modules/cli-table3/node_modules/colors/lib/system/has-flag.js
141263
- var require_has_flag4 = __commonJS({
141202
+ var require_has_flag3 = __commonJS({
141264
141203
  "../../node_modules/cli-table3/node_modules/colors/lib/system/has-flag.js"(exports2, module2) {
141265
141204
  "use strict";
141266
141205
  module2.exports = function(flag, argv) {
@@ -141278,7 +141217,7 @@ var require_supports_colors2 = __commonJS({
141278
141217
  "../../node_modules/cli-table3/node_modules/colors/lib/system/supports-colors.js"(exports2, module2) {
141279
141218
  "use strict";
141280
141219
  var os = require("os");
141281
- var hasFlag = require_has_flag4();
141220
+ var hasFlag = require_has_flag3();
141282
141221
  var env3 = process.env;
141283
141222
  var forceColor = void 0;
141284
141223
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {