@sap-ux/fiori-elements-writer 2.7.15 → 2.7.17

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.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.extendManifestJson = extendManifestJson;
7
7
  const types_1 = require("../types");
8
8
  const odata_service_writer_1 = require("@sap-ux/odata-service-writer");
9
- const path_1 = require("path");
9
+ const node_path_1 = require("node:path");
10
10
  const ejs_1 = require("ejs");
11
11
  const semver_1 = __importDefault(require("semver"));
12
12
  /**
@@ -60,14 +60,14 @@ function extendManifestJson(fs, targetPath, rootTemplatesPath, feApp) {
60
60
  };
61
61
  // Manifest paths to be extended
62
62
  const extendTemplatePaths = [
63
- (0, path_1.join)(rootTemplatesPath, 'common', 'extend', 'webapp'),
64
- (0, path_1.join)(rootTemplatesPath, templatePath, 'extend', 'webapp'),
65
- (0, path_1.join)(rootTemplatesPath, `v${feApp.service.version}`, templatePath, 'extend', 'webapp'),
66
- (0, path_1.join)(rootTemplatesPath, `v${feApp.service.version}`, 'common', 'extend', 'webapp')
63
+ (0, node_path_1.join)(rootTemplatesPath, 'common', 'extend', 'webapp'),
64
+ (0, node_path_1.join)(rootTemplatesPath, templatePath, 'extend', 'webapp'),
65
+ (0, node_path_1.join)(rootTemplatesPath, `v${feApp.service.version}`, templatePath, 'extend', 'webapp'),
66
+ (0, node_path_1.join)(rootTemplatesPath, `v${feApp.service.version}`, 'common', 'extend', 'webapp')
67
67
  ];
68
- const manifestPath = (0, path_1.join)(targetPath, 'webapp', 'manifest.json');
68
+ const manifestPath = (0, node_path_1.join)(targetPath, 'webapp', 'manifest.json');
69
69
  extendTemplatePaths.forEach((extendTemplatePath) => {
70
- const manifestTemplatePath = (0, path_1.join)(extendTemplatePath, 'manifest.json');
70
+ const manifestTemplatePath = (0, node_path_1.join)(extendTemplatePath, 'manifest.json');
71
71
  if (fs.exists(manifestTemplatePath)) {
72
72
  fs.extendJSON(manifestPath, JSON.parse((0, ejs_1.render)(fs.read(manifestTemplatePath), templateSettings, {})));
73
73
  }
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.minSupportedUI5VersionV4 = exports.minSupportedUI5Version = exports.TemplateTypeAttributes = exports.V2_FE_TYPES_AVAILABLE = void 0;
21
21
  exports.generate = generate;
22
- const path_1 = require("path");
22
+ const node_path_1 = require("node:path");
23
23
  const ejs_1 = require("ejs");
24
24
  const ui5_application_writer_1 = require("@sap-ux/ui5-application-writer");
25
25
  const odata_service_writer_1 = require("@sap-ux/odata-service-writer");
@@ -119,7 +119,7 @@ async function generate(basePath, data, fs, log) {
119
119
  await (0, odata_service_writer_1.generate)(basePath, feApp.service, fs);
120
120
  const coercedUI5Version = semver_1.default.coerce(feApp.ui5?.version);
121
121
  // Add new files from templates e.g.
122
- const rootTemplatesPath = (0, path_1.join)(__dirname, '..', 'templates');
122
+ const rootTemplatesPath = (0, node_path_1.join)(__dirname, '..', 'templates');
123
123
  // Add templates common to all template types
124
124
  const isTypeScriptEnabled = feApp.appOptions?.typescript === true;
125
125
  const ignore = [
@@ -145,13 +145,13 @@ async function generate(basePath, data, fs, log) {
145
145
  ui5Libs
146
146
  };
147
147
  // Copy templates with configuration
148
- fs.copyTpl((0, path_1.join)(rootTemplatesPath, 'common', 'add', '**/*.*'), basePath, {
148
+ fs.copyTpl((0, node_path_1.join)(rootTemplatesPath, 'common', 'add', '**/*.*'), basePath, {
149
149
  ...appConfig,
150
150
  escapeFLPText: templateAttributes_1.escapeFLPText
151
151
  }, undefined, {
152
152
  globOptions: { ignore, dot: true }
153
153
  });
154
- fs.copyTpl((0, path_1.join)(rootTemplatesPath, 'common', 'add', '**/*.*'), basePath, {
154
+ fs.copyTpl((0, node_path_1.join)(rootTemplatesPath, 'common', 'add', '**/*.*'), basePath, {
155
155
  ...appConfig,
156
156
  templateOptions,
157
157
  escapeFLPText: templateAttributes_1.escapeFLPText
@@ -159,18 +159,18 @@ async function generate(basePath, data, fs, log) {
159
159
  globOptions: { ignore, dot: true }
160
160
  });
161
161
  // Extend common files
162
- const packagePath = (0, path_1.join)(basePath, 'package.json');
162
+ const packagePath = (0, node_path_1.join)(basePath, 'package.json');
163
163
  // Extend package.json
164
- fs.extendJSON(packagePath, JSON.parse((0, ejs_1.render)(fs.read((0, path_1.join)(rootTemplatesPath, 'common', 'extend', 'package.json')), feApp, {})));
164
+ fs.extendJSON(packagePath, JSON.parse((0, ejs_1.render)(fs.read((0, node_path_1.join)(rootTemplatesPath, 'common', 'extend', 'package.json')), feApp, {})));
165
165
  // Special handling for FPM because it is not based on template files but used the fpm writer
166
166
  if (feApp.template.type === types_1.TemplateType.FlexibleProgrammingModel) {
167
167
  await (0, fpmConfig_1.generateFpmConfig)(feApp, basePath, fs);
168
168
  }
169
169
  else {
170
170
  // Copy odata version specific common templates and version specific, floorplan specific templates
171
- const templateVersionPath = (0, path_1.join)(rootTemplatesPath, `v${feApp.service?.version}`);
172
- [(0, path_1.join)(templateVersionPath, 'common', 'add'), (0, path_1.join)(templateVersionPath, feApp.template.type, 'add')].forEach((templatePath) => {
173
- fs.copyTpl((0, path_1.join)(templatePath, '**/*.*'), basePath, feApp, {}, { ignoreNoMatch: true, globOptions: { ignore, dot: true } });
171
+ const templateVersionPath = (0, node_path_1.join)(rootTemplatesPath, `v${feApp.service?.version}`);
172
+ [(0, node_path_1.join)(templateVersionPath, 'common', 'add'), (0, node_path_1.join)(templateVersionPath, feApp.template.type, 'add')].forEach((templatePath) => {
173
+ fs.copyTpl((0, node_path_1.join)(templatePath, '**/*.*'), basePath, feApp, {}, { ignoreNoMatch: true, globOptions: { ignore, dot: true } });
174
174
  });
175
175
  }
176
176
  // Update manifest.json with template specific settings
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writeAnnotations = writeAnnotations;
4
- const path_1 = require("path");
4
+ const node_path_1 = require("node:path");
5
5
  const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
6
6
  const types_1 = require("./types");
7
7
  const annotation_generator_1 = require("@sap-ux/annotation-generator");
@@ -17,9 +17,9 @@ const i18n_1 = require("./i18n");
17
17
  function getAnnotationFilePath(appName, capService) {
18
18
  if (capService) {
19
19
  const appPath = capService.appPath ?? (0, fiori_generator_shared_1.getCapFolderPathsSync)(capService.projectPath).app;
20
- return `${appPath}${path_1.sep}${appName}${path_1.sep}annotations.cds`;
20
+ return `${appPath}${node_path_1.sep}${appName}${node_path_1.sep}annotations.cds`;
21
21
  }
22
- return `webapp${path_1.sep}annotations${path_1.sep}annotation.xml`;
22
+ return `webapp${node_path_1.sep}annotations${node_path_1.sep}annotation.xml`;
23
23
  }
24
24
  /**
25
25
  * Writes annotation files for the given application configuration.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-elements-writer",
3
3
  "description": "SAP Fiori elements application writer",
4
- "version": "2.7.15",
4
+ "version": "2.7.17",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -27,14 +27,14 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "read-pkg-up": "7.0.1",
29
29
  "semver": "7.5.4",
30
- "@sap-ux/odata-service-writer": "0.27.23",
31
- "@sap-ux/ui5-application-writer": "1.5.17",
32
- "@sap-ux/fe-fpm-writer": "0.39.3",
33
- "@sap-ux/ui5-config": "0.29.6",
34
- "@sap-ux/ui5-test-writer": "0.7.27",
35
- "@sap-ux/fiori-generator-shared": "0.13.19",
36
- "@sap-ux/cap-config-writer": "0.12.10",
37
- "@sap-ux/annotation-generator": "0.3.64",
30
+ "@sap-ux/odata-service-writer": "0.27.24",
31
+ "@sap-ux/ui5-application-writer": "1.5.18",
32
+ "@sap-ux/fe-fpm-writer": "0.39.4",
33
+ "@sap-ux/ui5-config": "0.29.7",
34
+ "@sap-ux/ui5-test-writer": "0.7.28",
35
+ "@sap-ux/fiori-generator-shared": "0.13.21",
36
+ "@sap-ux/cap-config-writer": "0.12.12",
37
+ "@sap-ux/annotation-generator": "0.3.65",
38
38
  "@sap-ux/logger": "0.7.0"
39
39
  },
40
40
  "devDependencies": {
@@ -45,7 +45,7 @@
45
45
  "@types/mem-fs": "1.1.2",
46
46
  "@types/semver": "7.5.2",
47
47
  "fs-extra": "10.0.0",
48
- "@sap-ux/eslint-plugin-fiori-tools": "0.6.0"
48
+ "@sap-ux/eslint-plugin-fiori-tools": "0.6.1"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=20.x"
@@ -4,7 +4,7 @@ const parsedUI5Version = sap.ui.version.split('.');
4
4
 
5
5
  //For UI5 version >= 1.80, the location of the FileListBaseConnector is different
6
6
  const connectorPath =
7
- parseInt(parsedUI5Version[0], 10) >= 1 && parseInt(parsedUI5Version[1], 10) >= 80
7
+ Number.parseInt(parsedUI5Version[0], 10) >= 1 && Number.parseInt(parsedUI5Version[1], 10) >= 80
8
8
  ? 'sap/ui/fl/write/api/connectors/FileListBaseConnector'
9
9
  : 'sap/ui/fl/initial/api/connectors/FileListBaseConnector';
10
10
 
@@ -6,7 +6,7 @@ const parsedUI5Version = sap.ui.version.split('.');
6
6
 
7
7
  //For UI5 version >= 1.80, the location of the FileListBaseConnector is different
8
8
  const connectorPath =
9
- parseInt(parsedUI5Version[0], 10) >= 1 && parseInt(parsedUI5Version[1], 10) >= 80
9
+ Number.parseInt(parsedUI5Version[0], 10) >= 1 && Number.parseInt(parsedUI5Version[1], 10) >= 80
10
10
  ? 'sap/ui/fl/write/api/connectors/FileListBaseConnector'
11
11
  : 'sap/ui/fl/initial/api/connectors/FileListBaseConnector';
12
12
 
@@ -1,6 +1,6 @@
1
1
  //Load the fake lrep connector only if ui5 version < 1.78
2
2
  var version = sap.ui.version.split(".");
3
- if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
3
+ if (Number.parseInt(version[0], 10) <= 1 && Number.parseInt(version[1], 10) < 78) {
4
4
  sap.ui.getCore().loadLibraries(["sap/ui/fl"]);
5
5
  sap.ui.require(["sap/ui/fl/FakeLrepConnector"], function (FakeLrepConnector) {
6
6
  jQuery.extend(FakeLrepConnector.prototype, {
@@ -2,7 +2,7 @@
2
2
  // @ts-nocheck
3
3
  //Load the fake lrep connector only if ui5 version < 1.78
4
4
  const version = sap.ui.version.split(".");
5
- if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
5
+ if (Number.parseInt(version[0], 10) <= 1 && Number.parseInt(version[1], 10) < 78) {
6
6
  sap.ui.getCore().loadLibraries(["sap/ui/fl"]);
7
7
  sap.ui.require(["sap/ui/fl/FakeLrepConnector"], function (FakeLrepConnector) {
8
8
  jQuery.extend(FakeLrepConnector.prototype, {