@sap-ux/fiori-app-sub-generator 0.2.9 → 0.3.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.
|
@@ -267,7 +267,7 @@ class FioriAppGenerator extends yeoman_generator_1.default {
|
|
|
267
267
|
}
|
|
268
268
|
// Write after app, using values from the transformed state so defaults have been applied
|
|
269
269
|
const readMeUpdated = { ui5Version: appConfig.ui5?.minUI5Version };
|
|
270
|
-
await (0, writing_1.
|
|
270
|
+
await (0, writing_1.writeAppGenInfoFiles)(this.state, types_1.generatorName, this.generatorVersion, destRoot, this.fs, readMeUpdated);
|
|
271
271
|
}
|
|
272
272
|
catch (error) {
|
|
273
273
|
FioriAppGenerator.logger.fatal(`${(0, utils_1.t)('error.errorWritingApplicationFiles')} : ${error}`);
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppGenInfo } from '@sap-ux/fiori-generator-shared';
|
|
2
2
|
import type { Editor } from 'mem-fs-editor';
|
|
3
3
|
import type { ApiHubConfig, State } from '../types';
|
|
4
4
|
/**
|
|
5
|
-
* Writes
|
|
5
|
+
* Writes app related information files - README.md & .appGenInfo.json.
|
|
6
|
+
* The files are based on the project, service, and additional properties.
|
|
6
7
|
*
|
|
7
8
|
* @param state
|
|
8
9
|
* @param state.project
|
|
9
10
|
* @param state.service
|
|
10
11
|
* @param state.floorplan
|
|
11
12
|
* @param state.entityRelatedConfig
|
|
13
|
+
* @param state.appGenInfo
|
|
12
14
|
* @param generatorName
|
|
13
15
|
* @param generatorVersion
|
|
14
16
|
* @param targetPath
|
|
15
17
|
* @param fs
|
|
16
|
-
* @param
|
|
18
|
+
* @param existingAppGenInfo
|
|
17
19
|
*/
|
|
18
|
-
export declare function
|
|
20
|
+
export declare function writeAppGenInfoFiles({ project, service, floorplan, entityRelatedConfig, appGenInfo }: State, generatorName: string, generatorVersion: string, targetPath: string, fs: Editor, existingAppGenInfo?: Partial<AppGenInfo>): Promise<void>;
|
|
19
21
|
/**
|
|
20
22
|
* Create the files for apiHub integration.
|
|
21
23
|
*
|
|
@@ -1,82 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.writeAppGenInfoFiles = writeAppGenInfoFiles;
|
|
4
4
|
exports.writeAPIHubKeyFiles = writeAPIHubKeyFiles;
|
|
5
5
|
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const types_1 = require("../types");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
9
|
/**
|
|
10
|
-
* Writes
|
|
10
|
+
* Writes app related information files - README.md & .appGenInfo.json.
|
|
11
|
+
* The files are based on the project, service, and additional properties.
|
|
11
12
|
*
|
|
12
13
|
* @param state
|
|
13
14
|
* @param state.project
|
|
14
15
|
* @param state.service
|
|
15
16
|
* @param state.floorplan
|
|
16
17
|
* @param state.entityRelatedConfig
|
|
18
|
+
* @param state.appGenInfo
|
|
17
19
|
* @param generatorName
|
|
18
20
|
* @param generatorVersion
|
|
19
21
|
* @param targetPath
|
|
20
22
|
* @param fs
|
|
21
|
-
* @param
|
|
23
|
+
* @param existingAppGenInfo
|
|
22
24
|
*/
|
|
23
|
-
async function
|
|
25
|
+
async function writeAppGenInfoFiles({ project, service, floorplan, entityRelatedConfig, appGenInfo }, generatorName, generatorVersion, targetPath, fs, existingAppGenInfo) {
|
|
24
26
|
const templateLabel = (0, utils_1.t)(`floorplans.label.${floorplan}`, {
|
|
25
27
|
odataVersion: service.version
|
|
26
28
|
});
|
|
27
29
|
const datasourceLabel = (0, utils_1.getReadMeDataSourceLabel)(service.source, (0, utils_1.isBTPHosted)(service.connectedSystem), service.apiHubConfig?.apiHubType);
|
|
28
30
|
// Assign any custom overriding properties that may be provided via headless, adaptors
|
|
29
|
-
const
|
|
31
|
+
const appGenInfoCustom = Object.assign({
|
|
30
32
|
generatorName,
|
|
31
33
|
generatorVersion,
|
|
32
34
|
template: templateLabel,
|
|
33
35
|
serviceType: datasourceLabel,
|
|
34
36
|
serviceUrl: `${service.capService ? types_1.DEFAULT_CAP_HOST : service.host ?? ''}${service.servicePath ?? ''}` ||
|
|
35
37
|
(0, utils_1.t)('texts.notApplicable')
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
+
}, existingAppGenInfo, appGenInfo);
|
|
39
|
+
appGenInfoCustom.entityRelatedConfig ??= [];
|
|
38
40
|
if (entityRelatedConfig?.mainEntity) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
appGenInfoCustom.entityRelatedConfig.push({
|
|
42
|
+
type: (0, utils_1.t)('readme.label.mainEntity'),
|
|
41
43
|
value: entityRelatedConfig.mainEntity.entitySetName
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
46
|
if (entityRelatedConfig?.navigationEntity) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
appGenInfoCustom.entityRelatedConfig.push({
|
|
48
|
+
type: (0, utils_1.t)('readme.label.navigationEntity'),
|
|
47
49
|
value: entityRelatedConfig.navigationEntity.navigationPropertyName || 'None'
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
if (entityRelatedConfig?.filterEntitySet) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
appGenInfoCustom.entityRelatedConfig.push({
|
|
54
|
+
type: (0, utils_1.t)('readme.label.filterEntityType'),
|
|
53
55
|
value: entityRelatedConfig.filterEntitySet.entitySetName
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
const launchText = await (0, utils_1.getLaunchText)(service.capService, project.name, !!project.enableTypeScript, project.namespace);
|
|
57
|
-
const
|
|
58
|
-
generationDate:
|
|
59
|
-
generatorPlatform:
|
|
60
|
-
serviceType:
|
|
59
|
+
const genInfo = {
|
|
60
|
+
generationDate: appGenInfoCustom?.generationDate ?? new Date().toString(),
|
|
61
|
+
generatorPlatform: appGenInfoCustom?.generatorPlatform ?? (0, fiori_generator_shared_1.getHostEnvironment)().name,
|
|
62
|
+
serviceType: appGenInfoCustom?.serviceType,
|
|
61
63
|
metadataFilename: service.localEdmxFilePath ? (0, path_1.basename)(service.localEdmxFilePath) : '',
|
|
62
|
-
serviceUrl:
|
|
64
|
+
serviceUrl: appGenInfoCustom?.serviceUrl,
|
|
63
65
|
appName: project.name,
|
|
64
66
|
appTitle: project.title,
|
|
65
67
|
appDescription: project.description,
|
|
66
68
|
appNamespace: project.namespace ?? '',
|
|
67
69
|
ui5Theme: project.ui5Theme,
|
|
68
|
-
ui5Version:
|
|
70
|
+
ui5Version: appGenInfoCustom?.ui5Version || project.manifestMinUI5Version || project.ui5Version,
|
|
69
71
|
enableCodeAssist: project.enableCodeAssist,
|
|
70
72
|
enableEslint: project.enableEslint,
|
|
71
73
|
enableTypeScript: project.enableTypeScript,
|
|
72
74
|
showMockDataInfo: !!service.edmx && !service.capService,
|
|
73
|
-
generatorVersion:
|
|
74
|
-
template:
|
|
75
|
-
generatorName:
|
|
76
|
-
|
|
75
|
+
generatorVersion: appGenInfoCustom?.generatorVersion ?? '',
|
|
76
|
+
template: appGenInfoCustom?.template ?? '',
|
|
77
|
+
generatorName: appGenInfoCustom?.generatorName ?? '',
|
|
78
|
+
entityRelatedConfig: appGenInfoCustom?.entityRelatedConfig ?? [],
|
|
79
|
+
externalParameters: appGenInfoCustom?.externalParameters,
|
|
77
80
|
launchText
|
|
78
81
|
};
|
|
79
|
-
(0, fiori_generator_shared_1.
|
|
82
|
+
(0, fiori_generator_shared_1.generateAppGenInfo)(targetPath, genInfo, fs);
|
|
80
83
|
}
|
|
81
84
|
/**
|
|
82
85
|
* Create the files for apiHub integration.
|
|
@@ -5,6 +5,7 @@ import type { TableSelectionMode } from '@sap-ux/fiori-elements-writer';
|
|
|
5
5
|
import type { CapService, DatasourceType, EntityRelatedAnswers, OdataServiceAnswers, OdataVersion } from '@sap-ux/odata-service-inquirer';
|
|
6
6
|
import type { ApiHubType, SapSystemSourceType } from '../types/constants';
|
|
7
7
|
import type { Script } from './common';
|
|
8
|
+
import type { AppGenInfo } from '@sap-ux/fiori-generator-shared';
|
|
8
9
|
export interface Project {
|
|
9
10
|
targetFolder: string;
|
|
10
11
|
addDeployConfig?: boolean;
|
|
@@ -113,6 +114,10 @@ export interface State {
|
|
|
113
114
|
* The template selected by the user, maybe FE or FF
|
|
114
115
|
*/
|
|
115
116
|
floorplan: Floorplan;
|
|
117
|
+
/**
|
|
118
|
+
* General information about the application - used for README and appGenInfo.json
|
|
119
|
+
*/
|
|
120
|
+
appGenInfo?: Partial<AppGenInfo>;
|
|
116
121
|
}
|
|
117
122
|
/** Only used by headless */
|
|
118
123
|
export interface ALPOptions {
|
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.3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"@sap-ux/annotation-generator": "0.3.34",
|
|
33
33
|
"@sap-ux/axios-extension": "1.21.1",
|
|
34
34
|
"@sap-ux/btp-utils": "1.1.0",
|
|
35
|
-
"@sap-ux/cap-config-writer": "0.10.
|
|
35
|
+
"@sap-ux/cap-config-writer": "0.10.2",
|
|
36
36
|
"@sap-ux/feature-toggle": "0.3.0",
|
|
37
|
-
"@sap-ux/fiori-elements-writer": "2.4.
|
|
38
|
-
"@sap-ux/fiori-freestyle-writer": "2.4.
|
|
39
|
-
"@sap-ux/fiori-generator-shared": "0.12.
|
|
37
|
+
"@sap-ux/fiori-elements-writer": "2.4.7",
|
|
38
|
+
"@sap-ux/fiori-freestyle-writer": "2.4.4",
|
|
39
|
+
"@sap-ux/fiori-generator-shared": "0.12.2",
|
|
40
40
|
"@sap-ux/fiori-tools-settings": "0.2.0",
|
|
41
41
|
"@sap-ux/launch-config": "0.10.1",
|
|
42
|
-
"@sap-ux/odata-service-inquirer": "2.4.
|
|
42
|
+
"@sap-ux/odata-service-inquirer": "2.4.7",
|
|
43
43
|
"@sap-ux/odata-service-writer": "0.27.3",
|
|
44
44
|
"@sap-ux/project-access": "1.30.1",
|
|
45
45
|
"@sap-ux/store": "1.1.0",
|
|
46
|
-
"@sap-ux/telemetry": "0.6.
|
|
47
|
-
"@sap-ux/ui5-application-inquirer": "0.14.
|
|
46
|
+
"@sap-ux/telemetry": "0.6.2",
|
|
47
|
+
"@sap-ux/ui5-application-inquirer": "0.14.3",
|
|
48
48
|
"@sap-ux/ui5-info": "0.11.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"mock-spawn": "0.2.6",
|
|
63
63
|
"rimraf": "5.0.5",
|
|
64
64
|
"yeoman-test": "6.3.0",
|
|
65
|
-
"@sap-ux/flp-config-sub-generator": "0.2.
|
|
66
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
67
|
-
"@sap-ux/jest-file-matchers": "0.2.
|
|
65
|
+
"@sap-ux/flp-config-sub-generator": "0.2.9",
|
|
66
|
+
"@sap-ux/inquirer-common": "0.7.3",
|
|
67
|
+
"@sap-ux/jest-file-matchers": "0.2.2",
|
|
68
68
|
"@sap-ux/logger": "0.7.0"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|