@sap-ux/fiori-app-sub-generator 0.5.29 → 0.6.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/generators/fiori-app-generator/fioriAppGenerator.js +2 -3
- package/generators/fiori-app-generator/fioriAppGeneratorOptions.d.ts +3 -1
- package/generators/fiori-app-generator/prompting.js +18 -9
- package/generators/fiori-app-generator/subgenHelpers.d.ts +10 -8
- package/generators/fiori-app-generator/subgenHelpers.js +8 -6
- package/generators/types/common.d.ts +11 -6
- package/generators/types/external.d.ts +2 -4
- package/package.json +7 -8
|
@@ -194,10 +194,9 @@ class FioriAppGenerator extends yeoman_generator_1.default {
|
|
|
194
194
|
(0, subgenHelpers_1.addDeployGen)({
|
|
195
195
|
service: this.state.service,
|
|
196
196
|
projectName: this.state.project.name,
|
|
197
|
-
promptSettings: generatorOptions.promptSettings,
|
|
198
197
|
targetFolder: this.state.project.targetFolder,
|
|
199
198
|
applicationType: this.state.floorplan === types_1.FloorplanFF.FF_SIMPLE ? 'FF' : 'FE' // Telemetry data
|
|
200
|
-
}, this.composeWith.bind(this), FioriAppGenerator.logger, this.appWizard);
|
|
199
|
+
}, this.composeWith.bind(this), FioriAppGenerator.logger, this.appWizard, generatorOptions.promptSettings?.['@sap-ux/deploy-config-sub-generator']);
|
|
201
200
|
}
|
|
202
201
|
if (this.state.project?.addFlpConfig) {
|
|
203
202
|
// Allows back nav where we have interdependent steps
|
|
@@ -211,7 +210,7 @@ class FioriAppGenerator extends yeoman_generator_1.default {
|
|
|
211
210
|
targetFolder: this.state.project.targetFolder,
|
|
212
211
|
title: this.state.project.title,
|
|
213
212
|
skipPrompt: !(0, utils_1.hasStep)(this.fioriSteps, types_1.STEP_FLP_CONFIG)
|
|
214
|
-
}, this.composeWith.bind(this), FioriAppGenerator.logger, generatorOptions.vscode, this.appWizard);
|
|
213
|
+
}, this.composeWith.bind(this), FioriAppGenerator.logger, generatorOptions.vscode, this.appWizard, generatorOptions.promptSettings?.['@sap-ux/flp-config-sub-generator']);
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
216
|
catch (error) {
|
|
@@ -25,6 +25,8 @@ export interface FioriAppGeneratorOptions extends Generator.GeneratorOptions, Fi
|
|
|
25
25
|
data?: Object;
|
|
26
26
|
/**
|
|
27
27
|
* Customer provided extensions used to customize existing questions
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Use `promptSettings` instead.
|
|
28
30
|
*/
|
|
29
31
|
extensions?: UI5ApplicationPromptOptions;
|
|
30
32
|
/**
|
|
@@ -32,7 +34,7 @@ export interface FioriAppGeneratorOptions extends Generator.GeneratorOptions, Fi
|
|
|
32
34
|
*/
|
|
33
35
|
floorplan?: Floorplan;
|
|
34
36
|
/**
|
|
35
|
-
* Prompt settings to control visibility
|
|
37
|
+
* Prompt settings to control visibility, default values and other prompt related settings.
|
|
36
38
|
*/
|
|
37
39
|
promptSettings?: FioriAppGeneratorPromptSettings;
|
|
38
40
|
/**
|
|
@@ -149,7 +149,8 @@ async function createUI5ApplicationPromptOptions(service, appGenStepConfigList,
|
|
|
149
149
|
// prompt settings may be additionally provided e.g. set by adaptors
|
|
150
150
|
const ui5VersionPromptOptions = {
|
|
151
151
|
hide: promptSettings?.[ui5_application_inquirer_1.promptNames.ui5Version]?.hide ?? false,
|
|
152
|
-
minUI5Version:
|
|
152
|
+
minUI5Version: promptSettings?.[ui5_application_inquirer_1.promptNames.ui5Version]?.minUI5Version ??
|
|
153
|
+
(0, utils_1.getMinSupportedUI5Version)(service.version ?? odata_service_inquirer_1.OdataVersion.v2, floorplan),
|
|
153
154
|
includeSeparators: (0, fiori_generator_shared_1.getHostEnvironment)() !== fiori_generator_shared_1.hostEnvironment.cli,
|
|
154
155
|
useAutocomplete: (0, fiori_generator_shared_1.getHostEnvironment)() === fiori_generator_shared_1.hostEnvironment.cli
|
|
155
156
|
};
|
|
@@ -249,7 +250,7 @@ async function createUI5ApplicationPromptOptions(service, appGenStepConfigList,
|
|
|
249
250
|
* @param options.requiredOdataVersion will trigger warnings in prompts if the OData version is not supported.
|
|
250
251
|
* @param options.allowNoDatasource If true, the user will be able to select 'None' as the datasource type. Fiori Freestyle specific.
|
|
251
252
|
* @param options.capService If provided, the user will not be prompted for the CAP project and the default datasource type will be set to CAP project.
|
|
252
|
-
* @param options.promptOptions
|
|
253
|
+
* @param options.promptOptions Odata service inquirer prompt options that can be set by the caller.
|
|
253
254
|
* @param options.showCollabDraftWarning If true, a warning will be shown in the prompt if the service is a collaborative draft service.
|
|
254
255
|
* @returns
|
|
255
256
|
*/
|
|
@@ -265,27 +266,35 @@ function createOdataServicePromptOptions(options) {
|
|
|
265
266
|
return {
|
|
266
267
|
[odata_service_inquirer_1.promptNames.datasourceType]: {
|
|
267
268
|
default: defaultDatasourceSelection,
|
|
268
|
-
includeNone: !!options.allowNoDatasource
|
|
269
|
+
includeNone: !!options.allowNoDatasource,
|
|
270
|
+
...options.promptOptions?.datasourceType
|
|
269
271
|
},
|
|
270
272
|
[odata_service_inquirer_1.promptNames.metadataFilePath]: {
|
|
271
|
-
requiredOdataVersion: options.requiredOdataVersion
|
|
273
|
+
requiredOdataVersion: options.requiredOdataVersion,
|
|
274
|
+
...options.promptOptions?.metadataFilePath
|
|
272
275
|
},
|
|
273
276
|
[odata_service_inquirer_1.promptNames.capProject]: {
|
|
274
277
|
capSearchPaths: options.workspaceFolders ?? [],
|
|
275
|
-
defaultChoice: options.capService?.projectPath
|
|
278
|
+
defaultChoice: options.capService?.projectPath,
|
|
279
|
+
...options.promptOptions?.capProject
|
|
276
280
|
},
|
|
277
281
|
[odata_service_inquirer_1.promptNames.capService]: {
|
|
278
|
-
defaultChoice: options.capService
|
|
282
|
+
defaultChoice: options.capService,
|
|
283
|
+
...options.promptOptions?.capService
|
|
279
284
|
},
|
|
280
285
|
[odata_service_inquirer_1.promptNames.serviceUrl]: {
|
|
281
286
|
requiredOdataVersion: options.requiredOdataVersion,
|
|
282
|
-
showCollaborativeDraftWarning: options.showCollabDraftWarning && isYUI
|
|
287
|
+
showCollaborativeDraftWarning: options.showCollabDraftWarning && isYUI,
|
|
288
|
+
...options.promptOptions?.serviceUrl
|
|
283
289
|
},
|
|
284
290
|
[odata_service_inquirer_1.promptNames.serviceSelection]: {
|
|
285
291
|
useAutoComplete: (0, fiori_generator_shared_1.getHostEnvironment)() === fiori_generator_shared_1.hostEnvironment.cli,
|
|
286
|
-
requiredOdataVersion: options.requiredOdataVersion
|
|
292
|
+
requiredOdataVersion: options.requiredOdataVersion,
|
|
287
293
|
showCollaborativeDraftWarning: options.showCollabDraftWarning && isYUI,
|
|
288
|
-
|
|
294
|
+
...options.promptOptions?.serviceSelection
|
|
295
|
+
},
|
|
296
|
+
[odata_service_inquirer_1.promptNames.userSystemName]: {
|
|
297
|
+
...options.promptOptions?.userSystemName
|
|
289
298
|
},
|
|
290
299
|
[odata_service_inquirer_1.promptNames.systemSelection]: {
|
|
291
300
|
destinationFilters: {
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import type { AppWizard } from '@sap-devx/yeoman-ui-types';
|
|
2
|
-
import { type ILogWrapper } from '@sap-ux/fiori-generator-shared';
|
|
3
1
|
import type Generator from 'yeoman-generator';
|
|
4
|
-
import
|
|
2
|
+
import type { AppWizard } from '@sap-devx/yeoman-ui-types';
|
|
3
|
+
import type { ILogWrapper } from '@sap-ux/fiori-generator-shared';
|
|
4
|
+
import type { FLPConfigPromptOptions } from '@sap-ux/flp-config-sub-generator';
|
|
5
|
+
import type { Service } from '../types';
|
|
6
|
+
import type { DeployConfigSubGenPromptOptions } from '@sap-ux/deploy-config-sub-generator';
|
|
5
7
|
/**
|
|
6
8
|
* Add the '@sap/fiori:fiori-deployment' generator as a subgenerator.
|
|
7
9
|
*
|
|
8
10
|
* @param deployGenOpts
|
|
9
11
|
* @param deployGenOpts.service - service object
|
|
10
12
|
* @param deployGenOpts.projectName - project name
|
|
11
|
-
* @param deployGenOpts.promptSettings - prompt settings for the deployment generator
|
|
12
13
|
* @param deployGenOpts.targetFolder - target folder for the deployment configuration
|
|
13
14
|
* @param deployGenOpts.applicationType - application type, used for telemetry (FF | FE)
|
|
14
15
|
* @param composeWith - the composeWith function from the Yeoman generator
|
|
15
16
|
* @param logger - logger instance
|
|
16
17
|
* @param appWizard - instance of the AppWizard
|
|
18
|
+
* @param promptSettings - prompt settings for the deployment generator
|
|
17
19
|
*/
|
|
18
|
-
export declare function addDeployGen({ service, projectName,
|
|
20
|
+
export declare function addDeployGen({ service, projectName, targetFolder, applicationType }: {
|
|
19
21
|
service: Partial<Service>;
|
|
20
22
|
projectName: string;
|
|
21
|
-
promptSettings?: FioriAppGeneratorPromptSettings;
|
|
22
23
|
targetFolder: string;
|
|
23
24
|
applicationType: string;
|
|
24
|
-
}, composeWith: Generator['composeWith'], logger: ILogWrapper, appWizard?: AppWizard): void;
|
|
25
|
+
}, composeWith: Generator['composeWith'], logger: ILogWrapper, appWizard?: AppWizard, promptSettings?: DeployConfigSubGenPromptOptions): void;
|
|
25
26
|
/**
|
|
26
27
|
* Add the '@sap/fiori:flp-config' generator as a subgenerator using `composeWith`.
|
|
27
28
|
* Skipping the prompting (`skipPrompt`) will still write the config, but not ask for any input.
|
|
@@ -35,11 +36,12 @@ export declare function addDeployGen({ service, projectName, promptSettings, tar
|
|
|
35
36
|
* @param logger
|
|
36
37
|
* @param appWizard
|
|
37
38
|
* @param vscode
|
|
39
|
+
* @param promptSettings - prompt settings for the flp generator used in the inquirer
|
|
38
40
|
*/
|
|
39
41
|
export declare function addFlpGen({ projectName, targetFolder, title, skipPrompt }: {
|
|
40
42
|
projectName: string;
|
|
41
43
|
targetFolder: string;
|
|
42
44
|
title: string;
|
|
43
45
|
skipPrompt: boolean;
|
|
44
|
-
}, composeWith: Generator['composeWith'], logger: ILogWrapper, appWizard?: AppWizard, vscode?: any): void;
|
|
46
|
+
}, composeWith: Generator['composeWith'], logger: ILogWrapper, appWizard?: AppWizard, vscode?: any, promptSettings?: FLPConfigPromptOptions): void;
|
|
45
47
|
//# sourceMappingURL=subgenHelpers.d.ts.map
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addDeployGen = addDeployGen;
|
|
4
4
|
exports.addFlpGen = addFlpGen;
|
|
5
|
-
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
6
5
|
const path_1 = require("path");
|
|
7
6
|
const types_1 = require("../types");
|
|
7
|
+
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
8
8
|
/**
|
|
9
9
|
* Add the '@sap/fiori:fiori-deployment' generator as a subgenerator.
|
|
10
10
|
*
|
|
11
11
|
* @param deployGenOpts
|
|
12
12
|
* @param deployGenOpts.service - service object
|
|
13
13
|
* @param deployGenOpts.projectName - project name
|
|
14
|
-
* @param deployGenOpts.promptSettings - prompt settings for the deployment generator
|
|
15
14
|
* @param deployGenOpts.targetFolder - target folder for the deployment configuration
|
|
16
15
|
* @param deployGenOpts.applicationType - application type, used for telemetry (FF | FE)
|
|
17
16
|
* @param composeWith - the composeWith function from the Yeoman generator
|
|
18
17
|
* @param logger - logger instance
|
|
19
18
|
* @param appWizard - instance of the AppWizard
|
|
19
|
+
* @param promptSettings - prompt settings for the deployment generator
|
|
20
20
|
*/
|
|
21
|
-
function addDeployGen({ service, projectName,
|
|
21
|
+
function addDeployGen({ service, projectName, targetFolder, applicationType }, composeWith, logger, appWizard, promptSettings) {
|
|
22
22
|
composeWith('@sap/fiori:deploy-config', {
|
|
23
23
|
launchDeployConfigAsSubGenerator: true,
|
|
24
24
|
appGenServiceHost: service.host,
|
|
@@ -32,7 +32,7 @@ function addDeployGen({ service, projectName, promptSettings, targetFolder, appl
|
|
|
32
32
|
appWizard: appWizard,
|
|
33
33
|
telemetryData: { appType: applicationType },
|
|
34
34
|
logWrapper: logger,
|
|
35
|
-
subGenPromptOptions: promptSettings
|
|
35
|
+
subGenPromptOptions: promptSettings
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -48,14 +48,16 @@ function addDeployGen({ service, projectName, promptSettings, targetFolder, appl
|
|
|
48
48
|
* @param logger
|
|
49
49
|
* @param appWizard
|
|
50
50
|
* @param vscode
|
|
51
|
+
* @param promptSettings - prompt settings for the flp generator used in the inquirer
|
|
51
52
|
*/
|
|
52
|
-
function addFlpGen({ projectName, targetFolder, title, skipPrompt }, composeWith, logger, appWizard, vscode) {
|
|
53
|
+
function addFlpGen({ projectName, targetFolder, title, skipPrompt }, composeWith, logger, appWizard, vscode, promptSettings) {
|
|
53
54
|
let flpConfigOptions = {
|
|
54
55
|
launchFlpConfigAsSubGenerator: true,
|
|
55
56
|
appWizard,
|
|
56
57
|
vscode,
|
|
57
58
|
appRootPath: (0, path_1.join)(targetFolder, projectName),
|
|
58
|
-
logWrapper: logger
|
|
59
|
+
logWrapper: logger,
|
|
60
|
+
inquirerPromptOptions: promptSettings
|
|
59
61
|
};
|
|
60
62
|
if (skipPrompt) {
|
|
61
63
|
flpConfigOptions = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DatasourceType, OdataServicePromptOptions, OdataVersion
|
|
1
|
+
import type { DatasourceType, OdataServicePromptOptions, OdataVersion } from '@sap-ux/odata-service-inquirer';
|
|
2
2
|
import type { UI5ApplicationPromptOptions } from '@sap-ux/ui5-application-inquirer';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { FLPConfigPromptOptions } from '@sap-ux/flp-config-sub-generator';
|
|
4
|
+
import type { DeployConfigSubGenPromptOptions } from '@sap-ux/deploy-config-sub-generator';
|
|
5
5
|
/**
|
|
6
6
|
* package.json script entries (commands and tasks)
|
|
7
7
|
*/
|
|
@@ -16,9 +16,14 @@ export type WorkspaceFolder = {
|
|
|
16
16
|
folderName: string;
|
|
17
17
|
path: string;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
20
|
-
'@sap-ux/deploy-config-sub-generator'?:
|
|
21
|
-
|
|
19
|
+
export interface SubGeneratorPromptSettings {
|
|
20
|
+
'@sap-ux/deploy-config-sub-generator'?: DeployConfigSubGenPromptOptions;
|
|
21
|
+
'@sap-ux/flp-config-sub-generator'?: FLPConfigPromptOptions;
|
|
22
|
+
}
|
|
23
|
+
export interface FioriGeneratorPromptSettings {
|
|
24
|
+
'@sap/generator-fiori': OdataServicePromptOptions & UI5ApplicationPromptOptions;
|
|
25
|
+
}
|
|
26
|
+
export type FioriAppGeneratorPromptSettings = FioriGeneratorPromptSettings['@sap/generator-fiori'] & SubGeneratorPromptSettings;
|
|
22
27
|
/**
|
|
23
28
|
* Custom environment type until yeoman-environment provides one
|
|
24
29
|
*/
|
|
@@ -4,7 +4,7 @@ import { TemplateType as FFTemplateType } from '@sap-ux/fiori-freestyle-writer';
|
|
|
4
4
|
import { AppConfig, type Floorplan, FloorplanFE, FloorplanFF } from '@sap-ux/fiori-generator-shared';
|
|
5
5
|
import type { CapRuntime, EntityRelatedAnswers } from '@sap-ux/odata-service-inquirer';
|
|
6
6
|
import { OdataVersion } from '@sap-ux/odata-service-inquirer';
|
|
7
|
-
import {
|
|
7
|
+
import type { FioriGeneratorPromptSettings, SubGeneratorPromptSettings } from './common';
|
|
8
8
|
import type { Answers } from 'inquirer';
|
|
9
9
|
import { type ALPOptions, type Project, type Service } from './state';
|
|
10
10
|
export { Floorplan, FloorplanFE, FloorplanFF, AppConfig };
|
|
@@ -94,9 +94,7 @@ export interface FioriGeneratorSettings {
|
|
|
94
94
|
*/
|
|
95
95
|
showLayoutPrompts?: boolean;
|
|
96
96
|
}
|
|
97
|
-
export
|
|
98
|
-
[generatorName: string]: UI5ApplicationPromptOptions;
|
|
99
|
-
}
|
|
97
|
+
export type FioriGeneratorPromptExtension = FioriGeneratorPromptSettings & SubGeneratorPromptSettings;
|
|
100
98
|
export interface ConditionalStep extends Step {
|
|
101
99
|
/**
|
|
102
100
|
* Provide a function which returns true when a step should be added, answers to previous questions will be provided
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-app-sub-generator",
|
|
3
3
|
"description": "A yeoman (sub) generator that can generate Fiori applications. Not for standalone use.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@sap-ux/fiori-generator-shared": "0.13.3",
|
|
40
40
|
"@sap-ux/fiori-tools-settings": "0.2.0",
|
|
41
41
|
"@sap-ux/launch-config": "0.10.14",
|
|
42
|
-
"@sap-ux/odata-service-inquirer": "2.5.
|
|
42
|
+
"@sap-ux/odata-service-inquirer": "2.5.22",
|
|
43
43
|
"@sap-ux/odata-service-writer": "0.27.12",
|
|
44
44
|
"@sap-ux/project-access": "1.30.7",
|
|
45
45
|
"@sap-ux/store": "1.1.2",
|
|
@@ -57,14 +57,13 @@
|
|
|
57
57
|
"@types/yeoman-environment": "2.10.11",
|
|
58
58
|
"@types/yeoman-generator": "5.2.14",
|
|
59
59
|
"@types/yeoman-test": "4.0.6",
|
|
60
|
-
"jest-extended": "
|
|
61
|
-
"jest-mock": "
|
|
60
|
+
"jest-extended": "6.0.0",
|
|
61
|
+
"jest-mock": "30.0.1",
|
|
62
62
|
"mock-spawn": "0.2.6",
|
|
63
63
|
"rimraf": "5.0.5",
|
|
64
64
|
"yeoman-test": "6.3.0",
|
|
65
|
-
"@sap-ux/
|
|
66
|
-
"@sap-ux/
|
|
67
|
-
"@sap-ux/flp-config-sub-generator": "0.2.55",
|
|
65
|
+
"@sap-ux/deploy-config-sub-generator": "0.3.47",
|
|
66
|
+
"@sap-ux/flp-config-sub-generator": "0.3.0",
|
|
68
67
|
"@sap-ux/inquirer-common": "0.7.27",
|
|
69
68
|
"@sap-ux/jest-file-matchers": "0.2.4",
|
|
70
69
|
"@sap-ux/logger": "0.7.0"
|
|
@@ -78,7 +77,7 @@
|
|
|
78
77
|
"watch": "tsc --watch",
|
|
79
78
|
"lint": "eslint . --ext .ts",
|
|
80
79
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
81
|
-
"test": "jest --ci --forceExit --detectOpenHandles --colors
|
|
80
|
+
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
82
81
|
"test-u": "jest --ci --forceExit --detectOpenHandles --colors -u",
|
|
83
82
|
"link": "pnpm link --global",
|
|
84
83
|
"unlink": "pnpm unlink --global"
|