@sap-ux/ui5-application-inquirer 0.2.0
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/LICENSE +201 -0
- package/README.md +79 -0
- package/dist/i18n.d.ts +15 -0
- package/dist/i18n.js +54 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +104 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.js +18 -0
- package/dist/prompts/prompt-helpers.d.ts +54 -0
- package/dist/prompts/prompt-helpers.js +203 -0
- package/dist/prompts/prompts.d.ts +14 -0
- package/dist/prompts/prompts.js +416 -0
- package/dist/prompts/validators.d.ts +10 -0
- package/dist/prompts/validators.js +27 -0
- package/dist/translations/ui5-application-inquirer.i18n.json +46 -0
- package/dist/types.d.ts +125 -0
- package/dist/types.js +44 -0
- package/package.json +54 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompts": {
|
|
3
|
+
"appNameTooltip": "The name of the module for this application that will be loaded at runtime. This also determines the directory name of the generated application.",
|
|
4
|
+
"appNameMessage": "Module name",
|
|
5
|
+
"appNameDefault": "project{{defaultProjectNumber}}",
|
|
6
|
+
"appTitleTooltip": "The title of your application that is displayed in the header of the application.",
|
|
7
|
+
"appTitleMessage": "Application title",
|
|
8
|
+
"appTitleDefault": "App Title",
|
|
9
|
+
"appNamespaceTooltip": "A unique package name for the application module being created. It should follow the standard Java package notation.",
|
|
10
|
+
"appNamespaceMessage": "Application namespace",
|
|
11
|
+
"appDescTooltip": "Project description in package.json of your project",
|
|
12
|
+
"appDescMessage": "Description",
|
|
13
|
+
"appDescDefault": "An SAP Fiori application.",
|
|
14
|
+
"appFolderPathMessage": "Project folder path",
|
|
15
|
+
"appFolderPathBreadcrumb": "Project Path",
|
|
16
|
+
"appUi5VersionTooltip": "Represents the minimum version of SAPUI5 that this application requires.",
|
|
17
|
+
"appUi5VersionMessage": "Minimum SAPUI5 version",
|
|
18
|
+
"appUi5VersionBreadcrumb": "UI5 Version",
|
|
19
|
+
"appAddDeployConfigMessage": "Add deployment configuration",
|
|
20
|
+
"appAddDeployConfigToMtaMessage": "Add deployment configuration to MTA project ({{-path}})",
|
|
21
|
+
"appAddDeployConfigBreadcrumb": "Deploy Config",
|
|
22
|
+
"appAddFlpConfigMessage": "Add FLP configuration",
|
|
23
|
+
"appAddFlpConfigBreadcrumb": "FLP Config",
|
|
24
|
+
"appUi5ThemeMessage": "UI5 theme",
|
|
25
|
+
"appEnableEslintMessage": "Add Eslint configuration to the project",
|
|
26
|
+
"appEnableEslintBreadcrumb": "Eslint",
|
|
27
|
+
"appEnableCodeAssistMessage": "Add code assist libraries to your project",
|
|
28
|
+
"appEnableCodeAssistBreadcrumb": "Code Assist",
|
|
29
|
+
"appSkipAnnotationsMessage": "Skip generation of associated annotations.cds file",
|
|
30
|
+
"appSkipAnnotationsBreadcrumb": "Skip Annotations",
|
|
31
|
+
"appEnableNpmWorkspacesMessage": "Generation of this application can update the CAP project to use NPM workspaces and an associated CDS plugin library (cds-plugin-ui5). Do you want to enable this feature? (Note: this is requirement for generating with TypeScript)",
|
|
32
|
+
"appEnableNpmWorkspacesBreadcrumb": "Enable NPM Workspaces",
|
|
33
|
+
"appEnableTypeScriptMessage": "Enable TypeScript",
|
|
34
|
+
"appShowAdvancedOptionsMessage": "Configure advanced options",
|
|
35
|
+
"appShowAdvancedOptionsHint": "Choosing 'No' will apply defaults"
|
|
36
|
+
},
|
|
37
|
+
"validators": {
|
|
38
|
+
"appFolderExistsAtPath": "A module with this name already exists in the folder: {{-path}}"
|
|
39
|
+
},
|
|
40
|
+
"ui5VersionLabels": {
|
|
41
|
+
"maintained": "Maintained",
|
|
42
|
+
"outOfMaintenance": "Out of maintenance",
|
|
43
|
+
"version_one": "version",
|
|
44
|
+
"version_other": "versions"
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { PromptSeverityMessage, UI5VersionChoice, YUIQuestion, validate } from '@sap-ux/inquirer-common';
|
|
2
|
+
import type { AsyncDynamicQuestionProperty } from 'inquirer';
|
|
3
|
+
import type { AutocompleteQuestionOptions } from 'inquirer-autocomplete-prompt';
|
|
4
|
+
export interface UI5ApplicationAnswers {
|
|
5
|
+
name?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
namespace?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
targetFolder?: string;
|
|
10
|
+
ui5Version?: string;
|
|
11
|
+
addDeployConfig?: boolean;
|
|
12
|
+
addFlpConfig?: boolean;
|
|
13
|
+
ui5Theme?: string;
|
|
14
|
+
enableEslint?: boolean;
|
|
15
|
+
enableCodeAssist?: boolean;
|
|
16
|
+
skipAnnotations?: boolean;
|
|
17
|
+
enableTypeScript?: boolean;
|
|
18
|
+
enableNPMWorkspaces?: boolean;
|
|
19
|
+
showAdvanced?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Enumeration of prompt names used by UI5ApplicationInquirerPromptOptions
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export declare enum promptNames {
|
|
26
|
+
/**
|
|
27
|
+
* Application name
|
|
28
|
+
*/
|
|
29
|
+
name = "name",
|
|
30
|
+
/**
|
|
31
|
+
* Application title
|
|
32
|
+
*/
|
|
33
|
+
title = "title",
|
|
34
|
+
/**
|
|
35
|
+
* Application namespace
|
|
36
|
+
*/
|
|
37
|
+
namespace = "namespace",
|
|
38
|
+
/**
|
|
39
|
+
* Application description
|
|
40
|
+
*/
|
|
41
|
+
description = "description",
|
|
42
|
+
/**
|
|
43
|
+
* Target folder for generated application
|
|
44
|
+
*/
|
|
45
|
+
targetFolder = "targetFolder",
|
|
46
|
+
/**
|
|
47
|
+
* Application ui5 version
|
|
48
|
+
*/
|
|
49
|
+
ui5Version = "ui5Version",
|
|
50
|
+
addDeployConfig = "addDeployConfig",
|
|
51
|
+
addFlpConfig = "addFlpConfig",
|
|
52
|
+
ui5Theme = "ui5Theme",
|
|
53
|
+
enableEslint = "enableEslint",
|
|
54
|
+
enableNPMWorkspaces = "enableNPMWorkspaces",
|
|
55
|
+
enableCodeAssist = "enableCodeAssist",
|
|
56
|
+
skipAnnotations = "skipAnnotations",
|
|
57
|
+
enableTypeScript = "enableTypeScript",
|
|
58
|
+
showAdvanced = "showAdvanced"
|
|
59
|
+
}
|
|
60
|
+
type UI5VersionPromptOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* Specifies the minimum UI5 version to consider when fetching UI5 versions
|
|
63
|
+
*/
|
|
64
|
+
minUI5Version?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Optionally include an Inquirer Separator for grouped UI5 versions
|
|
67
|
+
*/
|
|
68
|
+
includeSeparators?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Optionally register the `inquirer-autocomplete-prompt` plugin and use for UI5 version searching.
|
|
71
|
+
* If the default `false` is used then standard prompting will be used that require scrolling to find entries.
|
|
72
|
+
*/
|
|
73
|
+
useAutocomplete?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Choice will be added to the UI5 versions offered and set as the default selection
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
defaultChoice?: UI5VersionChoice;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* These are boolean value prompt option keys
|
|
82
|
+
*/
|
|
83
|
+
type booleanPromptKeys = 'addDeployConfig' | 'addFlpConfig' | 'enableEslint' | 'skipAnnotations' | 'enableTypeScript' | 'enableCodeAssist' | 'showAdvanced' | 'enableNPMWorkspaces';
|
|
84
|
+
type stringValuePromptType = Omit<typeof promptNames, booleanPromptKeys>;
|
|
85
|
+
type stringValuePrompts = stringValuePromptType[keyof stringValuePromptType];
|
|
86
|
+
type booleanValuePromptType = Pick<typeof promptNames, booleanPromptKeys>;
|
|
87
|
+
type booleanValuePrompts = booleanValuePromptType[keyof booleanValuePromptType];
|
|
88
|
+
type DefaultValueInputPrompts = promptNames.name | promptNames.description | promptNames.namespace | promptNames.ui5Version | promptNames.targetFolder;
|
|
89
|
+
type DefaultValueConfirmPrompts = promptNames.enableCodeAssist | promptNames.enableEslint | promptNames.skipAnnotations | promptNames.enableTypeScript;
|
|
90
|
+
export type PromptDefaultValue<T> = {
|
|
91
|
+
default?: AsyncDynamicQuestionProperty<T>;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Defines prompt/question default values and/or whether or not they should be shown.
|
|
95
|
+
*/
|
|
96
|
+
export type CommonPromptOptions = {
|
|
97
|
+
hide?: boolean;
|
|
98
|
+
advancedOption?: boolean;
|
|
99
|
+
validate?: validate<UI5ApplicationAnswers>;
|
|
100
|
+
additionalMessages?: PromptSeverityMessage;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Provide the correct type checking for string value prompts and `ui5Version` options
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
type stringValuePromptOptions = Record<stringValuePrompts, CommonPromptOptions> & Record<DefaultValueInputPrompts, PromptDefaultValue<string>> & Record<promptNames.ui5Version, UI5VersionPromptOptions>;
|
|
107
|
+
/**
|
|
108
|
+
* Provide the correct type checking for boolean value prompts and validator callback options
|
|
109
|
+
*
|
|
110
|
+
*/
|
|
111
|
+
type booleanValuePromptOtions = Record<booleanValuePrompts, {
|
|
112
|
+
/**
|
|
113
|
+
* Callback function can be provided which will be executed on input validation.
|
|
114
|
+
* This may be used, for example, to trigger conditional steps in Yeoman UI.
|
|
115
|
+
*
|
|
116
|
+
* @param answer
|
|
117
|
+
* @param promptName
|
|
118
|
+
* @returns
|
|
119
|
+
*/
|
|
120
|
+
validatorCallback?: (answer: boolean, promptName: string) => void;
|
|
121
|
+
} & CommonPromptOptions> & Record<DefaultValueConfirmPrompts, PromptDefaultValue<boolean>>;
|
|
122
|
+
export type UI5ApplicationQuestion = YUIQuestion<UI5ApplicationAnswers> & Partial<Pick<AutocompleteQuestionOptions, 'source'>>;
|
|
123
|
+
export type UI5ApplicationPromptOptions = Partial<stringValuePromptOptions & booleanValuePromptOtions>;
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promptNames = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enumeration of prompt names used by UI5ApplicationInquirerPromptOptions
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
var promptNames;
|
|
9
|
+
(function (promptNames) {
|
|
10
|
+
/**
|
|
11
|
+
* Application name
|
|
12
|
+
*/
|
|
13
|
+
promptNames["name"] = "name";
|
|
14
|
+
/**
|
|
15
|
+
* Application title
|
|
16
|
+
*/
|
|
17
|
+
promptNames["title"] = "title";
|
|
18
|
+
/**
|
|
19
|
+
* Application namespace
|
|
20
|
+
*/
|
|
21
|
+
promptNames["namespace"] = "namespace";
|
|
22
|
+
/**
|
|
23
|
+
* Application description
|
|
24
|
+
*/
|
|
25
|
+
promptNames["description"] = "description";
|
|
26
|
+
/**
|
|
27
|
+
* Target folder for generated application
|
|
28
|
+
*/
|
|
29
|
+
promptNames["targetFolder"] = "targetFolder";
|
|
30
|
+
/**
|
|
31
|
+
* Application ui5 version
|
|
32
|
+
*/
|
|
33
|
+
promptNames["ui5Version"] = "ui5Version";
|
|
34
|
+
promptNames["addDeployConfig"] = "addDeployConfig";
|
|
35
|
+
promptNames["addFlpConfig"] = "addFlpConfig";
|
|
36
|
+
promptNames["ui5Theme"] = "ui5Theme";
|
|
37
|
+
promptNames["enableEslint"] = "enableEslint";
|
|
38
|
+
promptNames["enableNPMWorkspaces"] = "enableNPMWorkspaces";
|
|
39
|
+
promptNames["enableCodeAssist"] = "enableCodeAssist";
|
|
40
|
+
promptNames["skipAnnotations"] = "skipAnnotations";
|
|
41
|
+
promptNames["enableTypeScript"] = "enableTypeScript";
|
|
42
|
+
promptNames["showAdvanced"] = "showAdvanced";
|
|
43
|
+
})(promptNames || (exports.promptNames = promptNames = {}));
|
|
44
|
+
//# sourceMappingURL=types.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sap-ux/ui5-application-inquirer",
|
|
3
|
+
"description": "Prompts module that can prompt users for inputs required for UI5 application writing",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
8
|
+
"directory": "packages/ui5-application-inquirer"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-application-inquirer"
|
|
12
|
+
},
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"files": [
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"dist",
|
|
18
|
+
"!dist/*.map",
|
|
19
|
+
"!dist/**/*.map"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"i18next": "23.5.1",
|
|
23
|
+
"inquirer-autocomplete-prompt": "2.0.1",
|
|
24
|
+
"lodash": "4.17.21",
|
|
25
|
+
"semver": "7.5.4",
|
|
26
|
+
"@sap-ux/inquirer-common": "0.2.0",
|
|
27
|
+
"@sap-ux/project-access": "1.17.5",
|
|
28
|
+
"@sap-ux/project-input-validator": "0.2.3",
|
|
29
|
+
"@sap-ux/ui5-info": "0.3.2"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@sap-devx/yeoman-ui-types": "1.14.4",
|
|
33
|
+
"@types/inquirer-autocomplete-prompt": "2.0.1",
|
|
34
|
+
"@types/inquirer": "8.2.6",
|
|
35
|
+
"@types/lodash": "4.14.202",
|
|
36
|
+
"@types/semver": "7.5.4",
|
|
37
|
+
"inquirer": "8.2.6",
|
|
38
|
+
"@sap-ux/cap-config-writer": "0.2.17"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18.x"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc --build",
|
|
45
|
+
"clean": "rimraf --glob dist test/test-output coverage *.tsbuildinfo",
|
|
46
|
+
"watch": "tsc --watch",
|
|
47
|
+
"lint": "eslint . --ext .ts",
|
|
48
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
49
|
+
"test": "jest --ci --forceExit --detectOpenHandles --colors --passWithNoTests",
|
|
50
|
+
"test-u": "jest --ci --forceExit --detectOpenHandles --colors -u",
|
|
51
|
+
"link": "pnpm link --global",
|
|
52
|
+
"unlink": "pnpm unlink --global"
|
|
53
|
+
}
|
|
54
|
+
}
|