@sap-ux/ui5-library-reference-inquirer 0.2.11 → 0.2.12

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
@@ -36,8 +36,8 @@ export default class UI5LibraryReferenceGenerator extends Generator {
36
36
 
37
37
  public async writing(): Promise<void> {
38
38
  const reuseLibConfigs: ReuseLibConfig[] = [];
39
- if (answers.referenceLibraries) {
40
- for (const lib of answers.referenceLibraries) {
39
+ if (this.answers.referenceLibraries) {
40
+ for (const lib of this.answers.referenceLibraries) {
41
41
  reuseLibConfigs.push({
42
42
  name: lib.name,
43
43
  path: lib.path,
@@ -49,7 +49,9 @@ export default class UI5LibraryReferenceGenerator extends Generator {
49
49
 
50
50
  try {
51
51
  await generate(this.answers.targetFolder, reuseLibConfigs);
52
- } catch (e) {}
52
+ } catch (e) {
53
+ console.log(`Error adding reference ${e}`)
54
+ }
53
55
  }
54
56
  }
55
57
  ```
@@ -43,7 +43,7 @@ function getTargetProjectFolderPrompt(projectChoices) {
43
43
  },
44
44
  name: types_1.promptNames.targetProjectFolder,
45
45
  message: (0, i18n_1.t)('prompts.targetProjectFolderLabel'),
46
- choices: () => projectChoices,
46
+ choices: projectChoices,
47
47
  default: () => {
48
48
  return (projectChoices === null || projectChoices === void 0 ? void 0 : projectChoices.length) ? 0 : undefined;
49
49
  },
@@ -65,7 +65,7 @@ function getSourcePrompt() {
65
65
  },
66
66
  name: types_1.promptNames.source,
67
67
  message: (0, i18n_1.t)('prompts.sourceLabel'),
68
- choices: [{ name: (0, i18n_1.t)('LABEL_WORKSPACE'), value: constants_1.SourceType.Workspace }],
68
+ choices: [{ name: (0, i18n_1.t)('choices.workspace'), value: constants_1.SourceType.Workspace }],
69
69
  default: 0
70
70
  };
71
71
  }
@@ -84,16 +84,16 @@ function getReferenceLibrariesPrompt(reuseLibs) {
84
84
  guiOptions: {
85
85
  breadcrumb: true
86
86
  },
87
- choices: () => reuseLibs,
87
+ choices: reuseLibs,
88
88
  additionalMessages: () => {
89
- return missingDeps ? (0, i18n_1.t)('STATUS_MISSING_DEPS', { dependencies: missingDeps }) : undefined;
89
+ return missingDeps ? (0, i18n_1.t)('addtionalMsgs.missingDeps', { dependencies: missingDeps }) : undefined;
90
90
  },
91
91
  validate: (answer) => {
92
92
  if (!(reuseLibs === null || reuseLibs === void 0 ? void 0 : reuseLibs.length)) {
93
- return (0, i18n_1.t)('ERROR_NO_LIBS_FOUND');
93
+ return (0, i18n_1.t)('error.noLibsFound');
94
94
  }
95
95
  else if ((answer === null || answer === void 0 ? void 0 : answer.length) < 1) {
96
- return (0, i18n_1.t)('ERROR_NO_LIB_SELECTED');
96
+ return (0, i18n_1.t)('error.noLibSelected');
97
97
  }
98
98
  else if (answer === null || answer === void 0 ? void 0 : answer.length) {
99
99
  missingDeps = (0, project_access_1.checkDependencies)(answer, reuseLibs.map((libs) => libs.value));
@@ -4,6 +4,12 @@
4
4
  "sourceLabel": "Reusable Library Source",
5
5
  "referenceLibrariesLabel": "Select Reusable Libraries"
6
6
  },
7
+ "choices": {
8
+ "workspace": "Workspace"
9
+ },
10
+ "addtionalMsgs": {
11
+ "missingDeps": "Missing dependencies detected: {{dependencies}}"
12
+ },
7
13
  "error": {
8
14
  "noProjectsFound": "No Fiori tools projects found in the workspace",
9
15
  "noLibsFound": "No reuse libraries or components found in the workspace",
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.11",
4
+ "version": "0.2.12",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",