@sap-ux/ui5-library-reference-inquirer 0.2.13 → 0.2.15

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/README.md CHANGED
@@ -21,12 +21,15 @@ Example with Yeoman generator no options, e.g. cli prompting only :
21
21
  import Generator from 'yeoman-generator';
22
22
  import { generate, type ReuseLibConfig } from '@sap-ux/ui5-library-reference-writer'
23
23
  import { prompt, type UI5LibraryReferenceAnswers } from '@sap-ux/ui5-library-reference-inquirer';
24
+ import { ToolsLogger } from '@sap-ux/logger';
24
25
 
25
26
  export default class UI5LibraryReferenceGenerator extends Generator {
26
27
  answers: UI5LibraryReferenceAnswers = {};
27
-
28
+ logger: ToolsLogger;
29
+
28
30
  constructor(args: string | string[], opts: Generator.GeneratorOptions) {
29
31
  super(args, opts);
32
+ this.logger = new ToolsLogger();
30
33
  }
31
34
 
32
35
  public async prompting(): Promise<void> {
@@ -50,7 +53,7 @@ export default class UI5LibraryReferenceGenerator extends Generator {
50
53
  try {
51
54
  await generate(this.answers.targetFolder, reuseLibConfigs);
52
55
  } catch (e) {
53
- console.log(`Error adding reference ${e}`)
56
+ this.logger.error('Error generating reference to library');
54
57
  }
55
58
  }
56
59
  }
package/dist/choices.js CHANGED
@@ -22,7 +22,7 @@ const getProjectChoices = (apps) => __awaiter(void 0, void 0, void 0, function*
22
22
  if (apps) {
23
23
  for (const app of apps) {
24
24
  const name = (0, path_1.basename)(app.appRoot);
25
- projectChoices.push({ name, value: { folderName: name, path: app.appRoot } });
25
+ projectChoices.push({ name, value: app.appRoot });
26
26
  }
27
27
  }
28
28
  return projectChoices;
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ exports.getPrompts = getPrompts;
48
48
  */
49
49
  function prompt(wsFolders, adapter, promptOptions) {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
- const ui5LibPrompts = yield exports.getPrompts(promptOptions, wsFolders);
51
+ const ui5LibPrompts = yield exports.getPrompts(wsFolders, promptOptions);
52
52
  return adapter ? adapter.prompt(ui5LibPrompts) : inquirer_1.default.prompt(ui5LibPrompts);
53
53
  });
54
54
  }
@@ -6,6 +6,7 @@ const project_access_1 = require("@sap-ux/project-access");
6
6
  const types_1 = require("../types");
7
7
  const helpers_1 = require("./helpers");
8
8
  const constants_1 = require("./constants");
9
+ const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
9
10
  /**
10
11
  * Get the prompts for the UI5 library reference writing.
11
12
  *
@@ -86,7 +87,11 @@ function getReferenceLibrariesPrompt(reuseLibs) {
86
87
  },
87
88
  choices: reuseLibs,
88
89
  additionalMessages: () => {
89
- return missingDeps ? (0, i18n_1.t)('addtionalMsgs.missingDeps', { dependencies: missingDeps }) : undefined;
90
+ const msg = {
91
+ message: (0, i18n_1.t)('addtionalMsgs.missingDeps', { dependencies: missingDeps }),
92
+ severity: yeoman_ui_types_1.Severity.warning
93
+ };
94
+ return missingDeps ? msg : undefined;
90
95
  },
91
96
  validate: (answer) => {
92
97
  if (!(reuseLibs === null || reuseLibs === void 0 ? void 0 : reuseLibs.length)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-library-reference-inquirer",
3
3
  "description": "Prompts module that can provide prompts for UI5 library writer",
4
- "version": "0.2.13",
4
+ "version": "0.2.15",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -20,11 +20,12 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "i18next": "23.5.1",
23
- "@sap-ux/inquirer-common": "0.2.5",
24
- "@sap-ux/project-access": "1.19.8"
23
+ "@sap-ux/inquirer-common": "0.2.6",
24
+ "@sap-ux/project-access": "1.19.9"
25
25
  },
26
26
  "devDependencies": {
27
27
  "inquirer": "8.2.6",
28
+ "@sap-devx/yeoman-ui-types": "1.14.4",
28
29
  "@types/inquirer": "8.2.6"
29
30
  },
30
31
  "engines": {