@sap-ux/odata-service-inquirer 2.4.0 → 2.4.2

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.
@@ -13,6 +13,7 @@ const i18n_1 = require("../../../i18n");
13
13
  const logger_helper_1 = __importDefault(require("../../logger-helper"));
14
14
  const prompt_helpers_1 = require("../../prompt-helpers");
15
15
  const inquirer_common_1 = require("@sap-ux/inquirer-common");
16
+ const promises_1 = require("fs/promises");
16
17
  exports.enterCapPathChoiceValue = 'enterCapPath';
17
18
  /**
18
19
  * Search for CAP projects in the specified paths.
@@ -27,7 +28,9 @@ async function getCapProjectPaths(paths) {
27
28
  const folderNameCount = new Map();
28
29
  for (const root of capProjectRoots) {
29
30
  const folderName = (0, path_1.basename)(root);
30
- capRootPaths.push({ folderName, path: root });
31
+ // On Windows the path may have been returned with a different casing.
32
+ // Use `realPath` to generate the same casing as used by cds compiler facade.
33
+ capRootPaths.push({ folderName, path: process.platform === 'win32' ? await (0, promises_1.realpath)(root) : root });
31
34
  folderNameCount.set(folderName, (folderNameCount.get(folderName) ?? 0) + 1);
32
35
  }
33
36
  capRootPaths.sort((a, b) => a.folderName.localeCompare(b.folderName));
@@ -11,6 +11,7 @@ const prompt_helpers_1 = require("../../prompt-helpers");
11
11
  const cap_helpers_1 = require("./cap-helpers");
12
12
  const types_2 = require("./types");
13
13
  const validators_1 = require("./validators");
14
+ const promises_1 = require("fs/promises");
14
15
  /**
15
16
  * Find the specified choice in the list of CAP project choices and return its index.
16
17
  *
@@ -47,6 +48,7 @@ function getLocalCapProjectPrompts(promptOptions) {
47
48
  let selectedCapProject;
48
49
  let capServiceChoices;
49
50
  let defaultServiceIndex = 0;
51
+ let validCapPath = false;
50
52
  utils_1.PromptState.reset();
51
53
  const prompts = [
52
54
  {
@@ -81,9 +83,14 @@ function getLocalCapProjectPrompts(promptOptions) {
81
83
  },
82
84
  guiOptions: { mandatory: true, breadcrumb: (0, i18n_1.t)('prompts.capProject.breadcrumb') },
83
85
  validate: async (projectPath) => {
84
- const validCapPath = await (0, validators_1.validateCapPath)(projectPath);
86
+ validCapPath = await (0, validators_1.validateCapPath)(projectPath);
85
87
  // Load the cap paths if the path is valid
86
88
  if (validCapPath === true) {
89
+ // On Windows the path my have been returned with a different casing.
90
+ // Use `realPath` to generate the same casing as used by cds compiler facade.
91
+ if (process.platform === 'win32') {
92
+ projectPath = await (0, promises_1.realpath)(projectPath);
93
+ }
87
94
  selectedCapProject = Object.assign({ path: projectPath }, await (0, project_access_1.getCapCustomPaths)(projectPath));
88
95
  return true;
89
96
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/odata-service-inquirer",
3
3
  "description": "Prompts module that can prompt users for inputs required for odata service writing",
4
- "version": "2.4.0",
4
+ "version": "2.4.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,13 +30,13 @@
30
30
  "os-name": "4.0.1",
31
31
  "@sap-ux/axios-extension": "1.21.0",
32
32
  "@sap-ux/btp-utils": "1.1.0",
33
- "@sap-ux/fiori-generator-shared": "0.12.0",
33
+ "@sap-ux/fiori-generator-shared": "0.12.1",
34
34
  "@sap-ux/guided-answers-helper": "0.3.0",
35
- "@sap-ux/telemetry": "0.6.0",
36
- "@sap-ux/inquirer-common": "0.7.0",
35
+ "@sap-ux/telemetry": "0.6.1",
36
+ "@sap-ux/inquirer-common": "0.7.1",
37
37
  "@sap-ux/logger": "0.7.0",
38
- "@sap-ux/project-access": "1.30.0",
39
- "@sap-ux/project-input-validator": "0.6.0",
38
+ "@sap-ux/project-access": "1.30.1",
39
+ "@sap-ux/project-input-validator": "0.6.1",
40
40
  "@sap-ux/store": "1.1.0"
41
41
  },
42
42
  "devDependencies": {
@@ -46,12 +46,12 @@
46
46
  "@types/inquirer": "8.2.6",
47
47
  "@types/lodash": "4.14.202",
48
48
  "jest-extended": "3.2.4",
49
- "@sap-ux/fiori-generator-shared": "0.12.0",
50
- "@sap-ux/fiori-elements-writer": "2.4.0",
51
- "@sap-ux/fiori-freestyle-writer": "2.4.0",
49
+ "@sap-ux/fiori-generator-shared": "0.12.1",
50
+ "@sap-ux/fiori-elements-writer": "2.4.3",
51
+ "@sap-ux/fiori-freestyle-writer": "2.4.1",
52
52
  "@sap-ux/feature-toggle": "0.3.0",
53
- "@sap-ux/odata-service-writer": "0.27.0",
54
- "@sap-ux/cap-config-writer": "0.10.0"
53
+ "@sap-ux/odata-service-writer": "0.27.1",
54
+ "@sap-ux/cap-config-writer": "0.10.1"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=20.x"