@sap-ux/deploy-config-sub-generator 0.3.6 → 0.3.8
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/generators/app/index.js
CHANGED
|
@@ -118,7 +118,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
118
118
|
(0, deploy_config_generator_shared_1.bail)(deploy_config_generator_shared_1.ErrorHandler.unrecognizedTarget(this.target));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
if (!this.target || this.launchDeployConfigAsSubGenerator) {
|
|
122
122
|
// if there is no specified target then prompting will occur
|
|
123
123
|
const { target, answers } = await (0, prompting_1.promptDeployConfigQuestions)(this.fs, this.options, this.prompt.bind(this), {
|
|
124
124
|
launchDeployConfigAsSubGenerator: this.launchDeployConfigAsSubGenerator,
|
|
@@ -130,7 +130,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
130
130
|
isCap: this.isCap,
|
|
131
131
|
apiHubConfig: this.apiHubConfig,
|
|
132
132
|
isLibrary: this.isLibrary
|
|
133
|
-
});
|
|
133
|
+
}, this.target);
|
|
134
134
|
this.target = target;
|
|
135
135
|
this.answers = answers;
|
|
136
136
|
}
|
|
@@ -21,6 +21,7 @@ import type { GeneratorOptions } from 'yeoman-generator';
|
|
|
21
21
|
* @param promptOpts.isCap - whether the project is a CAP project
|
|
22
22
|
* @param promptOpts.apiHubConfig - API Hub configuration
|
|
23
23
|
* @param promptOpts.isLibrary - whether the project is a library
|
|
24
|
+
* @param targetDeployment - target deployment
|
|
24
25
|
* @returns - target deployment CF | ABAP and answers
|
|
25
26
|
*/
|
|
26
27
|
export declare function promptDeployConfigQuestions(fs: Editor, options: DeployConfigOptions, prompt: GeneratorOptions['prompt'], { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, extensionPromptOpts, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }: {
|
|
@@ -33,7 +34,7 @@ export declare function promptDeployConfigQuestions(fs: Editor, options: DeployC
|
|
|
33
34
|
isCap: boolean;
|
|
34
35
|
apiHubConfig: ApiHubConfig;
|
|
35
36
|
isLibrary: boolean;
|
|
36
|
-
}): Promise<{
|
|
37
|
+
}, targetDeployment?: string): Promise<{
|
|
37
38
|
target?: string;
|
|
38
39
|
answers?: AbapDeployConfigAnswersInternal | CfDeployConfigAnswers;
|
|
39
40
|
}>;
|
|
@@ -18,9 +18,10 @@ const prompts_1 = require("../prompts");
|
|
|
18
18
|
* @param promptOpts.isCap - whether the project is a CAP project
|
|
19
19
|
* @param promptOpts.apiHubConfig - API Hub configuration
|
|
20
20
|
* @param promptOpts.isLibrary - whether the project is a library
|
|
21
|
+
* @param targetDeployment - target deployment
|
|
21
22
|
* @returns - target deployment CF | ABAP and answers
|
|
22
23
|
*/
|
|
23
|
-
async function promptDeployConfigQuestions(fs, options, prompt, { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, extensionPromptOpts, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }) {
|
|
24
|
+
async function promptDeployConfigQuestions(fs, options, prompt, { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, extensionPromptOpts, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }, targetDeployment) {
|
|
24
25
|
let answers = {};
|
|
25
26
|
if (launchDeployConfigAsSubGenerator) {
|
|
26
27
|
const { questions, abapAnswers } = await (0, prompts_1.getSubGenPrompts)(fs, options, {
|
|
@@ -33,14 +34,14 @@ async function promptDeployConfigQuestions(fs, options, prompt, { launchDeployCo
|
|
|
33
34
|
isCap,
|
|
34
35
|
apiHubConfig,
|
|
35
36
|
isLibrary
|
|
36
|
-
});
|
|
37
|
+
}, targetDeployment);
|
|
37
38
|
const subGenAnswers = await prompt(questions);
|
|
38
39
|
Object.assign(answers, subGenAnswers, abapAnswers);
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
41
42
|
answers = await prompt((0, prompts_1.getDeployTargetQuestion)([...supportedTargets], options.projectRoot));
|
|
42
43
|
}
|
|
43
|
-
const target = supportedTargets.find((t) => t.name === answers?.targetName)?.name;
|
|
44
|
+
const target = supportedTargets.find((t) => t.name === answers?.targetName || t.name === targetDeployment)?.name;
|
|
44
45
|
return { target, answers };
|
|
45
46
|
}
|
|
46
47
|
//# sourceMappingURL=prompting.js.map
|
|
@@ -20,6 +20,7 @@ import type { DeployConfigOptions, Target } from '../types';
|
|
|
20
20
|
* @param promptOpts.isCap - whether the project is a CAP project
|
|
21
21
|
* @param promptOpts.apiHubConfig - API Hub configuration
|
|
22
22
|
* @param promptOpts.isLibrary - whether the project is a library
|
|
23
|
+
* @param targetDeployment - target deployment
|
|
23
24
|
* @returns - deployment configuration answers
|
|
24
25
|
*/
|
|
25
26
|
export declare function getSubGenPrompts(fs: Editor, options: DeployConfigOptions, { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, extensionPromptOpts, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }: {
|
|
@@ -32,7 +33,7 @@ export declare function getSubGenPrompts(fs: Editor, options: DeployConfigOption
|
|
|
32
33
|
isCap: boolean;
|
|
33
34
|
apiHubConfig: ApiHubConfig;
|
|
34
35
|
isLibrary: boolean;
|
|
35
|
-
}): Promise<{
|
|
36
|
+
}, targetDeployment?: string): Promise<{
|
|
36
37
|
questions: Question[];
|
|
37
38
|
abapAnswers: Partial<AbapDeployConfigAnswersInternal>;
|
|
38
39
|
}>;
|
|
@@ -24,42 +24,56 @@ const deploy_target_1 = require("./deploy-target");
|
|
|
24
24
|
* @param promptOpts.isCap - whether the project is a CAP project
|
|
25
25
|
* @param promptOpts.apiHubConfig - API Hub configuration
|
|
26
26
|
* @param promptOpts.isLibrary - whether the project is a library
|
|
27
|
+
* @param targetDeployment - target deployment
|
|
27
28
|
* @returns - deployment configuration answers
|
|
28
29
|
*/
|
|
29
|
-
async function getSubGenPrompts(fs, options, { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, extensionPromptOpts, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }) {
|
|
30
|
+
async function getSubGenPrompts(fs, options, { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, extensionPromptOpts, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }, targetDeployment) {
|
|
30
31
|
deploy_config_generator_shared_1.DeploymentGenerator.logger?.debug((0, utils_1.t)('debug.loadingPrompts'));
|
|
31
32
|
const configExists = fs.exists((0, path_1.join)(options.appRootPath, options.config || project_access_1.FileName.UI5DeployYaml));
|
|
32
33
|
const showOverwrite = (0, deploy_config_generator_shared_1.showOverwriteQuestion)(configExists, launchDeployConfigAsSubGenerator, launchStandaloneFromYui, options.overwrite);
|
|
33
34
|
const indexGenerationAllowed = !isLibrary && launchStandaloneFromYui && !(await (0, abap_deploy_config_sub_generator_1.indexHtmlExists)(fs, options.appRootPath));
|
|
35
|
+
let abapPrompts = [];
|
|
36
|
+
let abapAnswers = {};
|
|
34
37
|
// ABAP prompts
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
if (!targetDeployment || targetDeployment === deploy_config_generator_shared_1.TargetName.ABAP) {
|
|
39
|
+
({ prompts: abapPrompts, answers: abapAnswers } = await (0, abap_deploy_config_sub_generator_1.getAbapQuestions)({
|
|
40
|
+
appRootPath: options.appRootPath,
|
|
41
|
+
connectedSystem: options.connectedSystem,
|
|
42
|
+
backendConfig,
|
|
43
|
+
configFile: options.config,
|
|
44
|
+
indexGenerationAllowed,
|
|
45
|
+
showOverwriteQuestion: showOverwrite,
|
|
46
|
+
promptOptions: options?.subGenPromptOptions,
|
|
47
|
+
logger: deploy_config_generator_shared_1.DeploymentGenerator.logger
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
45
50
|
// CF prompts
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
let cfPrompts = [];
|
|
52
|
+
if (!targetDeployment || targetDeployment === deploy_config_generator_shared_1.TargetName.CF) {
|
|
53
|
+
cfPrompts = await (0, cf_deploy_config_sub_generator_1.getCFQuestions)({
|
|
54
|
+
projectRoot: options.projectRoot,
|
|
55
|
+
isAbapDirectServiceBinding: options.isAbapDirectServiceBinding,
|
|
56
|
+
cfDestination: cfDestination,
|
|
57
|
+
isCap: isCap,
|
|
58
|
+
addOverwrite: showOverwrite,
|
|
59
|
+
apiHubConfig: apiHubConfig,
|
|
60
|
+
promptOptions: options?.subGenPromptOptions
|
|
61
|
+
});
|
|
62
|
+
}
|
|
55
63
|
// Combine all prompts
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
let questions = [];
|
|
65
|
+
if (!targetDeployment) {
|
|
66
|
+
questions = combineAllPrompts(options.projectRoot, {
|
|
67
|
+
supportedTargets,
|
|
68
|
+
abapPrompts,
|
|
69
|
+
cfPrompts,
|
|
70
|
+
extensionPromptOpts,
|
|
71
|
+
launchStandaloneFromYui
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
questions = targetDeployment === deploy_config_generator_shared_1.TargetName.ABAP ? abapPrompts : cfPrompts;
|
|
76
|
+
}
|
|
63
77
|
return { questions, abapAnswers: abapAnswers };
|
|
64
78
|
}
|
|
65
79
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/deploy-config-sub-generator",
|
|
3
3
|
"description": "Main generator for configuring ABAP or Cloud Foundry deployment configuration",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.8",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"yeoman-generator": "5.10.0",
|
|
27
27
|
"@sap-ux/btp-utils": "1.1.0",
|
|
28
28
|
"@sap-ux/cf-deploy-config-sub-generator": "0.2.11",
|
|
29
|
-
"@sap-ux/abap-deploy-config-sub-generator": "0.1.
|
|
29
|
+
"@sap-ux/abap-deploy-config-sub-generator": "0.1.16",
|
|
30
30
|
"@sap-ux/deploy-config-generator-shared": "0.1.8",
|
|
31
31
|
"@sap-ux/fiori-generator-shared": "0.12.7",
|
|
32
32
|
"@sap-ux/inquirer-common": "0.7.9",
|
|
33
|
-
"@sap-ux/odata-service-inquirer": "2.4.
|
|
33
|
+
"@sap-ux/odata-service-inquirer": "2.4.17",
|
|
34
34
|
"@sap-ux/project-access": "1.30.2",
|
|
35
35
|
"@sap-ux/store": "1.1.0",
|
|
36
36
|
"@sap-ux/ui5-config": "0.28.2"
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"rimraf": "5.0.5",
|
|
51
51
|
"unionfs": "4.4.0",
|
|
52
52
|
"yeoman-test": "6.3.0",
|
|
53
|
-
"@sap-ux/abap-deploy-config-inquirer": "1.4.
|
|
53
|
+
"@sap-ux/abap-deploy-config-inquirer": "1.4.14",
|
|
54
54
|
"@sap-ux/cf-deploy-config-inquirer": "0.3.9",
|
|
55
55
|
"@sap-ux/cf-deploy-config-writer": "0.3.3",
|
|
56
|
-
"@sap-ux/fiori-app-sub-generator": "0.4.
|
|
56
|
+
"@sap-ux/fiori-app-sub-generator": "0.4.16",
|
|
57
57
|
"@sap-ux/jest-file-matchers": "0.2.2"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|