@sap-ux/project-input-validator 0.6.23 → 0.6.25

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.
@@ -9,8 +9,8 @@ exports.validateProjectNameInternal = validateProjectNameInternal;
9
9
  exports.validateDuplicateProjectName = validateDuplicateProjectName;
10
10
  exports.validateNamespaceAdp = validateNamespaceAdp;
11
11
  exports.validateAch = validateAch;
12
- const path_1 = require("path");
13
- const fs_1 = require("fs");
12
+ const node_path_1 = require("node:path");
13
+ const node_fs_1 = require("node:fs");
14
14
  const i18n_1 = require("../i18n");
15
15
  const validators_1 = require("../general/validators");
16
16
  /**
@@ -108,7 +108,7 @@ function validateProjectNameInternal(value) {
108
108
  * @returns {string | boolean} If project with same name already exists return error message otherwise true.
109
109
  */
110
110
  function validateDuplicateProjectName(value, destinationPath) {
111
- if ((0, fs_1.existsSync)((0, path_1.join)(destinationPath, value))) {
111
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(destinationPath, value))) {
112
112
  return (0, i18n_1.t)('adp.duplicatedProjectName');
113
113
  }
114
114
  return true;
@@ -5,7 +5,7 @@ exports.validateAppDescription = validateAppDescription;
5
5
  exports.validateTransportRequestNumber = validateTransportRequestNumber;
6
6
  exports.validatePackage = validatePackage;
7
7
  const i18n_1 = require("../i18n");
8
- const os_1 = require("os");
8
+ const node_os_1 = require("node:os");
9
9
  /**
10
10
  * Validator Fiori app name is compatble with Fiori project requirements.
11
11
  *
@@ -63,8 +63,8 @@ function processErrorMessages(errorMessages) {
63
63
  return errorMessages[0];
64
64
  }
65
65
  else {
66
- const indentErrorMessageRows = errorMessages.map((errorMessage) => `${' '.repeat(8)}${errorMessage}`).join(os_1.EOL);
67
- return `${(0, i18n_1.t)('deploy.invalidAppNameMultipleReason')}${os_1.EOL}${indentErrorMessageRows}${os_1.EOL}`;
66
+ const indentErrorMessageRows = errorMessages.map((errorMessage) => `${' '.repeat(8)}${errorMessage}`).join(node_os_1.EOL);
67
+ return `${(0, i18n_1.t)('deploy.invalidAppNameMultipleReason')}${node_os_1.EOL}${indentErrorMessageRows}${node_os_1.EOL}`;
68
68
  }
69
69
  }
70
70
  /**
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateFioriAppProjectFolder = validateFioriAppProjectFolder;
4
4
  exports.validateFioriAppTargetFolder = validateFioriAppTargetFolder;
5
5
  const project_access_1 = require("@sap-ux/project-access");
6
- const path_1 = require("path");
6
+ const node_path_1 = require("node:path");
7
7
  const i18n_1 = require("../i18n");
8
8
  const validators_1 = require("../ui5/validators");
9
9
  const validators_2 = require("./validators");
@@ -63,7 +63,7 @@ async function validateFioriAppTargetFolder(targetPath, appName, validateFioriAp
63
63
  return isProjectValid;
64
64
  }
65
65
  // Windows path length validation
66
- const winPathResult = (0, validators_2.validateWindowsPathLength)((0, path_1.join)(targetPath, appName), (0, i18n_1.t)(`general.windowsFolderPathTooLong`));
66
+ const winPathResult = (0, validators_2.validateWindowsPathLength)((0, node_path_1.join)(targetPath, appName), (0, i18n_1.t)(`general.windowsFolderPathTooLong`));
67
67
  if (winPathResult !== true) {
68
68
  return winPathResult;
69
69
  }
@@ -7,9 +7,9 @@ exports.validateNamespace = validateNamespace;
7
7
  exports.validateLibModuleName = validateLibModuleName;
8
8
  exports.validateProjectFolder = validateProjectFolder;
9
9
  exports.validateModuleName = validateModuleName;
10
- const path_1 = require("path");
10
+ const node_path_1 = require("node:path");
11
11
  const i18n_1 = require("../i18n");
12
- const fs_1 = require("fs");
12
+ const node_fs_1 = require("node:fs");
13
13
  const validate_npm_package_name_1 = __importDefault(require("validate-npm-package-name"));
14
14
  /**
15
15
  * Validator: UI5 application namespace.
@@ -95,10 +95,10 @@ function validateProjectFolder(targetFolder, projectName) {
95
95
  if (!folderWritePermExists(targetFolder)) {
96
96
  return (0, i18n_1.t)('ui5.folderDoesNotHaveCorrectPermissions');
97
97
  }
98
- if (targetFolder && targetFolder.length > 0 && !folderExists((0, path_1.join)(targetFolder, projectName))) {
98
+ if (targetFolder && targetFolder.length > 0 && !folderExists((0, node_path_1.join)(targetFolder, projectName))) {
99
99
  return true;
100
100
  }
101
- else if (targetFolder && targetFolder.length > 0 && folderExists((0, path_1.join)(targetFolder, projectName))) {
101
+ else if (targetFolder && targetFolder.length > 0 && folderExists((0, node_path_1.join)(targetFolder, projectName))) {
102
102
  return (0, i18n_1.t)('ui5.moduleAlreadyExists', { folderName: projectName });
103
103
  }
104
104
  else {
@@ -158,7 +158,7 @@ function folderExists(dirPath) {
158
158
  if (dirPath && typeof dirPath !== 'string') {
159
159
  return (0, i18n_1.t)('ERROR_NAME_NOT_STRING');
160
160
  }
161
- return (0, fs_1.existsSync)(dirPath) && (0, fs_1.lstatSync)(dirPath).isDirectory();
161
+ return (0, node_fs_1.existsSync)(dirPath) && (0, node_fs_1.lstatSync)(dirPath).isDirectory();
162
162
  }
163
163
  /**
164
164
  * Test for directory write permissions.
@@ -170,7 +170,7 @@ function folderWritePermExists(dirPath) {
170
170
  let folderPerm = true;
171
171
  const isWin = process.platform === 'win32';
172
172
  try {
173
- (0, fs_1.accessSync)(isWin ? path_1.posix.basename(dirPath) : dirPath, fs_1.constants.W_OK);
173
+ (0, node_fs_1.accessSync)(isWin ? node_path_1.posix.basename(dirPath) : dirPath, node_fs_1.constants.W_OK);
174
174
  }
175
175
  catch (err) {
176
176
  folderPerm = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-input-validator",
3
- "version": "0.6.23",
3
+ "version": "0.6.25",
4
4
  "description": "Library to validate Fiori project input formats",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "i18next": "25.3.0",
18
18
  "validate-npm-package-name": "5.0.0",
19
- "@sap-ux/project-access": "1.32.2"
19
+ "@sap-ux/project-access": "1.32.4"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/validate-npm-package-name": "4.0.1",