@sap-ux/adp-flp-config-sub-generator 0.1.219 → 0.1.221
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.
|
@@ -25,6 +25,7 @@ export default class AdpFlpConfigGenerator extends Generator {
|
|
|
25
25
|
private variant;
|
|
26
26
|
private tileSettingsAnswers?;
|
|
27
27
|
private provider;
|
|
28
|
+
private isCfProject;
|
|
28
29
|
/**
|
|
29
30
|
* Creates an instance of the generator.
|
|
30
31
|
*
|
|
@@ -119,6 +120,18 @@ export default class AdpFlpConfigGenerator extends Generator {
|
|
|
119
120
|
* @returns {Promise<void>} A promise that resolves when the initialization is complete.
|
|
120
121
|
*/
|
|
121
122
|
private _initializeStandAloneGenerator;
|
|
123
|
+
/**
|
|
124
|
+
* Initializes the ABAP-specific parts of the standalone generator.
|
|
125
|
+
*
|
|
126
|
+
* @returns {Promise<void>} A promise that resolves when initialization is complete.
|
|
127
|
+
*/
|
|
128
|
+
private _initializeAbapGenerator;
|
|
129
|
+
/**
|
|
130
|
+
* Initializes the CF-specific parts of the standalone generator.
|
|
131
|
+
*
|
|
132
|
+
* @returns {Promise<void>} A promise that resolves when initialization is complete.
|
|
133
|
+
*/
|
|
134
|
+
private _initializeCfGenerator;
|
|
122
135
|
/**
|
|
123
136
|
* Initializes the AbapServiceProvider for the generator. If the generator is launched as a sub-generator, the provider is taken from the options.
|
|
124
137
|
* If the provider is cached in the app wizard, it is retrieved from the cache, otherwise, a new AbapServiceProvider is created using the ui5.yaml configuration.
|
package/generators/app/index.js
CHANGED
|
@@ -45,6 +45,7 @@ class AdpFlpConfigGenerator extends yeoman_generator_1.default {
|
|
|
45
45
|
variant;
|
|
46
46
|
tileSettingsAnswers;
|
|
47
47
|
provider;
|
|
48
|
+
isCfProject = false;
|
|
48
49
|
/**
|
|
49
50
|
* Creates an instance of the generator.
|
|
50
51
|
*
|
|
@@ -62,6 +63,7 @@ class AdpFlpConfigGenerator extends yeoman_generator_1.default {
|
|
|
62
63
|
this.vscode = opts.vscode;
|
|
63
64
|
this.inbounds = opts.inbounds;
|
|
64
65
|
this.layer = opts.layer;
|
|
66
|
+
this.isCfProject = !!opts.isCfProject;
|
|
65
67
|
(0, appWizardCache_1.initAppWizardCache)(this.logger, this.appWizard);
|
|
66
68
|
this._setupFLPConfigPrompts();
|
|
67
69
|
this._setupLogging();
|
|
@@ -96,7 +98,7 @@ class AdpFlpConfigGenerator extends yeoman_generator_1.default {
|
|
|
96
98
|
if (this.abort) {
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
|
-
if (!this.launchAsSubGen) {
|
|
101
|
+
if (!this.launchAsSubGen && !this.isCfProject) {
|
|
100
102
|
await this._validateCloudProject();
|
|
101
103
|
if (this.abort) {
|
|
102
104
|
return;
|
|
@@ -358,9 +360,11 @@ class AdpFlpConfigGenerator extends yeoman_generator_1.default {
|
|
|
358
360
|
*/
|
|
359
361
|
async _validateProjectType() {
|
|
360
362
|
const isFioriAdaptation = (await (0, project_access_1.getAppType)(this.projectRootPath)) === 'Fiori Adaptation';
|
|
361
|
-
if (!isFioriAdaptation
|
|
363
|
+
if (!isFioriAdaptation) {
|
|
362
364
|
this._abortExecution((0, utils_1.t)('error.projectNotSupported'));
|
|
365
|
+
return;
|
|
363
366
|
}
|
|
367
|
+
this.isCfProject = await (0, adp_tooling_1.isCFEnvironment)(this.projectRootPath);
|
|
364
368
|
}
|
|
365
369
|
/**
|
|
366
370
|
* Validates the project is cloud ready.
|
|
@@ -380,10 +384,26 @@ class AdpFlpConfigGenerator extends yeoman_generator_1.default {
|
|
|
380
384
|
*/
|
|
381
385
|
async _initializeStandAloneGenerator() {
|
|
382
386
|
await this._validateProjectType();
|
|
383
|
-
|
|
387
|
+
if (this.abort) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
384
390
|
this.variant = await (0, adp_tooling_1.getVariant)(this.projectRootPath, this.fs);
|
|
385
391
|
this.appId = this.variant.reference;
|
|
386
392
|
this.layer = this.variant.layer;
|
|
393
|
+
if (this.isCfProject) {
|
|
394
|
+
await this._initializeCfGenerator();
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
await this._initializeAbapGenerator();
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Initializes the ABAP-specific parts of the standalone generator.
|
|
402
|
+
*
|
|
403
|
+
* @returns {Promise<void>} A promise that resolves when initialization is complete.
|
|
404
|
+
*/
|
|
405
|
+
async _initializeAbapGenerator() {
|
|
406
|
+
this.ui5Yaml = await (0, adp_tooling_1.getAdpConfig)(this.projectRootPath, (0, node_path_1.join)(this.projectRootPath, project_access_1.FileName.Ui5Yaml));
|
|
387
407
|
await this._initAbapServiceProvider();
|
|
388
408
|
try {
|
|
389
409
|
this.inbounds = this.inbounds ?? (await (0, adp_tooling_1.getBaseAppInbounds)(this.appId, this.provider));
|
|
@@ -396,6 +416,32 @@ class AdpFlpConfigGenerator extends yeoman_generator_1.default {
|
|
|
396
416
|
this._handleFetchingError(error);
|
|
397
417
|
}
|
|
398
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Initializes the CF-specific parts of the standalone generator.
|
|
421
|
+
*
|
|
422
|
+
* @returns {Promise<void>} A promise that resolves when initialization is complete.
|
|
423
|
+
*/
|
|
424
|
+
async _initializeCfGenerator() {
|
|
425
|
+
const cfConfig = (0, adp_tooling_1.loadCfConfig)(this.toolsLogger);
|
|
426
|
+
if (!cfConfig?.token) {
|
|
427
|
+
this._abortExecution((0, utils_1.t)('error.cfLoginRequired'));
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
const appParams = (0, adp_tooling_1.getAppParamsFromUI5Yaml)(this.projectRootPath);
|
|
431
|
+
if (!appParams.appHostId) {
|
|
432
|
+
this._abortExecution((0, utils_1.t)('error.cfAppHostIdMissing'));
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
try {
|
|
436
|
+
this.inbounds =
|
|
437
|
+
this.inbounds ??
|
|
438
|
+
(await (0, adp_tooling_1.getCfBaseAppInbounds)(this.appId, appParams.appHostId, cfConfig, this.toolsLogger));
|
|
439
|
+
}
|
|
440
|
+
catch (e) {
|
|
441
|
+
this.toolsLogger.error(`CF inbounds fetching failed: ${e}`);
|
|
442
|
+
this._abortExecution((0, utils_1.t)('error.cfInboundsFetchFailed', { error: e.message }));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
399
445
|
/**
|
|
400
446
|
* Initializes the AbapServiceProvider for the generator. If the generator is launched as a sub-generator, the provider is taken from the options.
|
|
401
447
|
* If the provider is cached in the app wizard, it is retrieved from the cache, otherwise, a new AbapServiceProvider is created using the ui5.yaml configuration.
|
|
@@ -39,6 +39,10 @@ export interface FlpConfigOptions extends Generator.GeneratorOptions {
|
|
|
39
39
|
data?: {
|
|
40
40
|
projectRootPath: string;
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Flag indicating whether this is a CF environment project
|
|
44
|
+
*/
|
|
45
|
+
isCfProject?: boolean;
|
|
42
46
|
}
|
|
43
47
|
export interface State {
|
|
44
48
|
provider?: AbapServiceProvider;
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"authenticationFailed": "Authentication failed.",
|
|
26
26
|
"projectNotCloudReady": "FLP Configuration is supported for Cloud Ready adaptation projects only",
|
|
27
27
|
"baseAppInboundsFetching": "Error while fetching base application inbounds",
|
|
28
|
+
"cfConfigRequired": "Cloud Foundry configuration is required for Cloud Foundry adaptation projects.",
|
|
29
|
+
"cfLoginRequired": "Cloud Foundry login required. Please run `cf login` and try again.",
|
|
30
|
+
"cfAppHostIdMissing": "Could not determine the `appHostId` from the project's `ui5.yaml` configuration.",
|
|
31
|
+
"cfInboundsFetchFailed": "Failed to fetch inbounds for the Cloud Foundry application: {{error}}",
|
|
28
32
|
"warningCachingNotSupported": "Warning: caching is not supported"
|
|
29
33
|
}
|
|
30
34
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/adp-flp-config-sub-generator",
|
|
3
3
|
"description": "Generator for adding FLP configuration to an Adaptation Project",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.221",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"@sap-devx/yeoman-ui-types": "1.23.0",
|
|
23
23
|
"i18next": "25.10.10",
|
|
24
24
|
"yeoman-generator": "5.10.0",
|
|
25
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
25
|
+
"@sap-ux/adp-tooling": "0.18.109",
|
|
26
26
|
"@sap-ux/axios-extension": "1.25.28",
|
|
27
27
|
"@sap-ux/btp-utils": "1.1.12",
|
|
28
28
|
"@sap-ux/feature-toggle": "0.3.8",
|
|
29
|
-
"@sap-ux/fiori-generator-shared": "0.13.
|
|
30
|
-
"@sap-ux/flp-config-inquirer": "0.4.
|
|
31
|
-
"@sap-ux/inquirer-common": "0.11.
|
|
29
|
+
"@sap-ux/fiori-generator-shared": "0.13.95",
|
|
30
|
+
"@sap-ux/flp-config-inquirer": "0.4.168",
|
|
31
|
+
"@sap-ux/inquirer-common": "0.11.33",
|
|
32
32
|
"@sap-ux/logger": "0.8.4",
|
|
33
|
-
"@sap-ux/project-access": "1.35.
|
|
33
|
+
"@sap-ux/project-access": "1.35.18",
|
|
34
34
|
"@sap-ux/store": "1.5.12",
|
|
35
35
|
"@sap-ux/system-access": "0.7.4"
|
|
36
36
|
},
|