@sap-ux/adp-tooling 0.10.22 → 0.11.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/dist/base/prompt.d.ts +2 -1
- package/dist/base/prompt.js +17 -5
- package/dist/types.d.ts +99 -11
- package/dist/writer/index.d.ts +1 -1
- package/dist/writer/index.js +10 -0
- package/dist/writer/options.d.ts +22 -5
- package/dist/writer/options.js +162 -16
- package/dist/writer/project-utils.d.ts +2 -2
- package/dist/writer/project-utils.js +5 -1
- package/package.json +2 -2
- package/templates/project/package.json +5 -3
- package/templates/project/ui5.yaml +2 -2
- package/templates/project/webapp/i18n/i18n.properties +7 -1
- package/templates/project/webapp/manifest.appdescr_variant +3 -0
package/dist/base/prompt.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdpWriterConfig } from '../types';
|
|
1
|
+
import type { CustomConfig, AdpWriterConfig } from '../types';
|
|
2
2
|
import type { AbapTarget } from '@sap-ux/system-access';
|
|
3
3
|
import type { Logger } from '@sap-ux/logger';
|
|
4
4
|
import type { UI5FlexLayer } from '@sap-ux/project-access';
|
|
@@ -32,5 +32,6 @@ export declare function promptTarget(defaults: PromptDefaults, logger: Logger):
|
|
|
32
32
|
apps: AppIndex;
|
|
33
33
|
layer: UI5FlexLayer;
|
|
34
34
|
target: AbapTarget;
|
|
35
|
+
customConfig: CustomConfig;
|
|
35
36
|
}>;
|
|
36
37
|
//# sourceMappingURL=prompt.d.ts.map
|
package/dist/base/prompt.js
CHANGED
|
@@ -27,7 +27,7 @@ function promptGeneratorInput(defaults, logger) {
|
|
|
27
27
|
var _a;
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
defaults = defaults !== null && defaults !== void 0 ? defaults : {};
|
|
30
|
-
const { target, apps, layer } = yield promptTarget(defaults, logger);
|
|
30
|
+
const { target, apps, layer, customConfig } = yield promptTarget(defaults, logger);
|
|
31
31
|
const app = yield (0, prompts_1.default)([
|
|
32
32
|
{
|
|
33
33
|
type: 'autocomplete',
|
|
@@ -99,7 +99,8 @@ function promptGeneratorInput(defaults, logger) {
|
|
|
99
99
|
app: Object.assign(Object.assign({}, app), { layer }),
|
|
100
100
|
target,
|
|
101
101
|
options,
|
|
102
|
-
deploy
|
|
102
|
+
deploy,
|
|
103
|
+
customConfig
|
|
103
104
|
};
|
|
104
105
|
});
|
|
105
106
|
}
|
|
@@ -167,6 +168,7 @@ exports.promptTarget = promptTarget;
|
|
|
167
168
|
* @returns app index and layer
|
|
168
169
|
*/
|
|
169
170
|
function fetchSystemInformation(target, ignoreCertErrors, logger) {
|
|
171
|
+
var _a;
|
|
170
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
173
|
const provider = yield (0, system_access_1.createAbapServiceProvider)(target, {
|
|
172
174
|
ignoreCertErrors
|
|
@@ -174,14 +176,24 @@ function fetchSystemInformation(target, ignoreCertErrors, logger) {
|
|
|
174
176
|
logger.info('Fetching system information...');
|
|
175
177
|
const ato = yield provider.getAtoInfo();
|
|
176
178
|
const layer = ato.tenantType === 'SAP' ? 'VENDOR' : 'CUSTOMER_BASE';
|
|
179
|
+
const customConfig = {
|
|
180
|
+
adp: {
|
|
181
|
+
environment: (_a = ato.operationsType) !== null && _a !== void 0 ? _a : 'P',
|
|
182
|
+
safeMode: true
|
|
183
|
+
}
|
|
184
|
+
};
|
|
177
185
|
logger.info(`Target layer: ${layer}`);
|
|
178
186
|
logger.info('Fetching list of available applications... (it can take a moment)');
|
|
179
187
|
const appIndex = provider.getAppIndex();
|
|
180
|
-
const
|
|
188
|
+
const searchParams = {
|
|
181
189
|
'sap.ui/technology': 'UI5',
|
|
182
190
|
'sap.app/type': 'application'
|
|
183
|
-
}
|
|
184
|
-
|
|
191
|
+
};
|
|
192
|
+
if (customConfig.adp.environment === 'C') {
|
|
193
|
+
searchParams['sap.fiori/cloudDevAdaptationStatus'] = 'released';
|
|
194
|
+
}
|
|
195
|
+
const apps = yield appIndex.search(searchParams, ['sap.app/id', 'sap.app/title', 'sap.fiori/registrationIds']);
|
|
196
|
+
return { apps, layer, customConfig };
|
|
185
197
|
});
|
|
186
198
|
}
|
|
187
199
|
//# sourceMappingURL=prompt.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { UI5FlexLayer } from '@sap-ux/project-access';
|
|
2
2
|
import type { DestinationAbapTarget, UrlAbapTarget } from '@sap-ux/system-access';
|
|
3
|
-
import type { Adp } from '@sap-ux/ui5-config';
|
|
4
|
-
import type { Editor } from 'mem-fs-editor';
|
|
3
|
+
import type { Adp, BspApp } from '@sap-ux/ui5-config';
|
|
5
4
|
import type { OperationsType } from '@sap-ux/axios-extension';
|
|
5
|
+
import type { Editor } from 'mem-fs-editor';
|
|
6
6
|
export interface DescriptorVariant {
|
|
7
7
|
layer: UI5FlexLayer;
|
|
8
8
|
reference: string;
|
|
@@ -21,13 +21,26 @@ export interface AdpPreviewConfig {
|
|
|
21
21
|
*/
|
|
22
22
|
ignoreCertErrors?: boolean;
|
|
23
23
|
}
|
|
24
|
+
export interface OnpremApp {
|
|
25
|
+
/** Application variant id. */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Reference associated with the ID of the base application. */
|
|
28
|
+
reference: string;
|
|
29
|
+
layer?: UI5FlexLayer;
|
|
30
|
+
title?: string;
|
|
31
|
+
/** Optional: Application variant change content. */
|
|
32
|
+
content?: Content[];
|
|
33
|
+
}
|
|
34
|
+
export interface CloudApp extends OnpremApp {
|
|
35
|
+
/** bspName associated with the ABAP Cloud repository name of the base application. */
|
|
36
|
+
bspName: string;
|
|
37
|
+
/** Cloud app active languages. */
|
|
38
|
+
languages: Language[];
|
|
39
|
+
}
|
|
40
|
+
export type App = OnpremApp | CloudApp;
|
|
41
|
+
export type DeployConfig = Adp | BspApp;
|
|
24
42
|
export interface AdpWriterConfig {
|
|
25
|
-
app:
|
|
26
|
-
id: string;
|
|
27
|
-
reference: string;
|
|
28
|
-
layer?: UI5FlexLayer;
|
|
29
|
-
title?: string;
|
|
30
|
-
};
|
|
43
|
+
app: App;
|
|
31
44
|
target: AbapTarget;
|
|
32
45
|
ui5?: {
|
|
33
46
|
minVersion?: string;
|
|
@@ -38,11 +51,12 @@ export interface AdpWriterConfig {
|
|
|
38
51
|
name?: string;
|
|
39
52
|
description?: string;
|
|
40
53
|
};
|
|
41
|
-
|
|
54
|
+
flp?: FlpConfig;
|
|
55
|
+
customConfig?: CustomConfig;
|
|
42
56
|
/**
|
|
43
57
|
* Optional: configuration for deployment to ABAP
|
|
44
58
|
*/
|
|
45
|
-
deploy?:
|
|
59
|
+
deploy?: DeployConfig;
|
|
46
60
|
options?: {
|
|
47
61
|
/**
|
|
48
62
|
* Optional: if set to true then the generated project will be recognized by the SAP Fiori tools
|
|
@@ -50,6 +64,36 @@ export interface AdpWriterConfig {
|
|
|
50
64
|
fioriTools?: boolean;
|
|
51
65
|
};
|
|
52
66
|
}
|
|
67
|
+
export interface ChangeInboundNavigation {
|
|
68
|
+
/** Identifier for the inbound navigation. */
|
|
69
|
+
inboundId: string;
|
|
70
|
+
/** Title associated with the inbound navigation. */
|
|
71
|
+
title?: string;
|
|
72
|
+
/** Subtitle associated with the inbound navigation. */
|
|
73
|
+
subTitle?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface NewInboundNavigation {
|
|
76
|
+
/** Represent business entities that reflect a specific scenario. */
|
|
77
|
+
semanticObject: string;
|
|
78
|
+
/** Operations which can be performed on a semantic object. */
|
|
79
|
+
action: string;
|
|
80
|
+
additionalParameters?: object;
|
|
81
|
+
/** Title associated with the inbound navigation. */
|
|
82
|
+
title: string;
|
|
83
|
+
/** Optional: Subtitle associated with the inbound navigation. */
|
|
84
|
+
subTitle?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface InternalInboundNavigation extends NewInboundNavigation {
|
|
87
|
+
/** Identifier for the inbound navigation. */
|
|
88
|
+
inboundId: string;
|
|
89
|
+
/** Flag indicating if the new inbound navigation should be added. */
|
|
90
|
+
addInboundId: boolean;
|
|
91
|
+
}
|
|
92
|
+
export type FlpConfig = ChangeInboundNavigation | NewInboundNavigation;
|
|
93
|
+
export interface Language {
|
|
94
|
+
sap: string;
|
|
95
|
+
i18n: string;
|
|
96
|
+
}
|
|
53
97
|
export interface ManifestAppdescr {
|
|
54
98
|
fileName: string;
|
|
55
99
|
layer: string;
|
|
@@ -312,11 +356,55 @@ export interface AdpProjectData {
|
|
|
312
356
|
reference: string;
|
|
313
357
|
id: string;
|
|
314
358
|
}
|
|
315
|
-
export interface
|
|
359
|
+
export interface CustomConfig {
|
|
316
360
|
adp: {
|
|
317
361
|
safeMode: boolean;
|
|
318
362
|
environment: OperationsType;
|
|
319
363
|
};
|
|
320
364
|
}
|
|
365
|
+
export interface InboundChangeContentAddInboundId {
|
|
366
|
+
inbound: {
|
|
367
|
+
[inboundId: string]: AddInboundModel;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
export interface AddInboundModel {
|
|
371
|
+
/** Represent business entities that reflect a specific scenario. */
|
|
372
|
+
semanticObject: string;
|
|
373
|
+
/** Operations which can be performed on a semantic object. */
|
|
374
|
+
action: string;
|
|
375
|
+
/** Title associated with the inbound navigation data. */
|
|
376
|
+
title: string;
|
|
377
|
+
/** Optional: Subtitle associated with the inbound navigation data. */
|
|
378
|
+
subTitle?: string;
|
|
379
|
+
signature: AddInboundSignitureModel;
|
|
380
|
+
}
|
|
381
|
+
export interface AddInboundSignitureModel {
|
|
382
|
+
parameters: InboundParameters;
|
|
383
|
+
additionalParameters: string;
|
|
384
|
+
}
|
|
385
|
+
export interface InboundParameters {
|
|
386
|
+
'sap-appvar-id'?: object;
|
|
387
|
+
'sap-priority'?: object;
|
|
388
|
+
}
|
|
389
|
+
export interface InboundChange {
|
|
390
|
+
inbound: {
|
|
391
|
+
[key: string]: {
|
|
392
|
+
/** Represent business entities that reflect a specific scenario. */
|
|
393
|
+
semanticObject: string;
|
|
394
|
+
/** Operations which can be performed on a semantic object. */
|
|
395
|
+
action: string;
|
|
396
|
+
/** Icon associated with the inbound navigation data. */
|
|
397
|
+
icon: string;
|
|
398
|
+
/** Title associated with the inbound navigation data. */
|
|
399
|
+
title: string;
|
|
400
|
+
/** Subtitle associated with the inbound navigation data. */
|
|
401
|
+
subTitle: string;
|
|
402
|
+
signature: {
|
|
403
|
+
parameters: object | string;
|
|
404
|
+
additionalParameters: 'allowed';
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
}
|
|
321
409
|
export {};
|
|
322
410
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/writer/index.d.ts
CHANGED
package/dist/writer/index.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.migrate = exports.generate = void 0;
|
|
|
13
13
|
const path_1 = require("path");
|
|
14
14
|
const mem_fs_1 = require("mem-fs");
|
|
15
15
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
16
|
+
const options_1 = require("./options");
|
|
16
17
|
const project_utils_1 = require("./project-utils");
|
|
17
18
|
const tmplPath = (0, path_1.join)(__dirname, '../../templates/project');
|
|
18
19
|
/**
|
|
@@ -30,6 +31,7 @@ function setDefaults(config) {
|
|
|
30
31
|
ui5: Object.assign({}, config.ui5),
|
|
31
32
|
deploy: config.deploy ? Object.assign({}, config.deploy) : undefined,
|
|
32
33
|
options: Object.assign({}, config.options),
|
|
34
|
+
flp: config.flp ? Object.assign({}, config.flp) : undefined,
|
|
33
35
|
customConfig: config.customConfig ? Object.assign({}, config.customConfig) : undefined
|
|
34
36
|
};
|
|
35
37
|
(_a = (_f = configWithDefaults.app).title) !== null && _a !== void 0 ? _a : (_f.title = `Adaptation of ${config.app.reference}`);
|
|
@@ -37,6 +39,10 @@ function setDefaults(config) {
|
|
|
37
39
|
(_c = configWithDefaults.package) !== null && _c !== void 0 ? _c : (configWithDefaults.package = config.package ? Object.assign({}, config.package) : {});
|
|
38
40
|
(_d = (_h = configWithDefaults.package).name) !== null && _d !== void 0 ? _d : (_h.name = config.app.id.toLowerCase().replace(/\./g, '-'));
|
|
39
41
|
(_e = (_j = configWithDefaults.package).description) !== null && _e !== void 0 ? _e : (_j.description = configWithDefaults.app.title);
|
|
42
|
+
if (configWithDefaults.flp && !configWithDefaults.flp.inboundId) {
|
|
43
|
+
configWithDefaults.flp.addInboundId = true;
|
|
44
|
+
configWithDefaults.flp.inboundId = `${configWithDefaults.app.id}.InboundID`;
|
|
45
|
+
}
|
|
40
46
|
return configWithDefaults;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
@@ -48,11 +54,15 @@ function setDefaults(config) {
|
|
|
48
54
|
* @returns the updated memfs editor instance
|
|
49
55
|
*/
|
|
50
56
|
function generate(basePath, config, fs) {
|
|
57
|
+
var _a;
|
|
51
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
59
|
if (!fs) {
|
|
53
60
|
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
54
61
|
}
|
|
55
62
|
const fullConfig = setDefaults(config);
|
|
63
|
+
if (((_a = fullConfig.customConfig) === null || _a === void 0 ? void 0 : _a.adp.environment) === 'C' && fullConfig.flp) {
|
|
64
|
+
(0, options_1.enhanceManifestChangeContentWithFlpConfig)(fullConfig.flp, fullConfig.app.id, fullConfig.app.content);
|
|
65
|
+
}
|
|
56
66
|
(0, project_utils_1.writeTemplateToFolder)((0, path_1.join)(tmplPath, '**/*.*'), (0, path_1.join)(basePath), fullConfig, fs);
|
|
57
67
|
yield (0, project_utils_1.writeUI5DeployYaml)(basePath, fullConfig, fs);
|
|
58
68
|
yield (0, project_utils_1.writeUI5Yaml)(basePath, fullConfig, fs);
|
package/dist/writer/options.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UI5Config } from '@sap-ux/ui5-config';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomConfig, AdpWriterConfig, Content, CloudApp, InternalInboundNavigation } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Generate the configuration for the middlewares required for the ui5.yaml.
|
|
5
5
|
*
|
|
@@ -7,6 +7,22 @@ import type { AdpCustomConfig, AdpWriterConfig } from '../types';
|
|
|
7
7
|
* @param config full project configuration
|
|
8
8
|
*/
|
|
9
9
|
export declare function enhanceUI5Yaml(ui5Config: UI5Config, config: AdpWriterConfig): void;
|
|
10
|
+
/**
|
|
11
|
+
* Generate the configuration for the custom tasks required for the ui5.yaml.
|
|
12
|
+
*
|
|
13
|
+
* @param ui5Config configuration representing the ui5.yaml
|
|
14
|
+
* @param config full project configuration
|
|
15
|
+
*/
|
|
16
|
+
export declare function enhanceUI5YamlWithCustomTask(ui5Config: UI5Config, config: AdpWriterConfig & {
|
|
17
|
+
app: CloudApp;
|
|
18
|
+
}): void;
|
|
19
|
+
/**
|
|
20
|
+
* Generate custom configuration required for the ui5.yaml.
|
|
21
|
+
*
|
|
22
|
+
* @param ui5Config configuration representing the ui5.yaml
|
|
23
|
+
* @param config full project configuration
|
|
24
|
+
*/
|
|
25
|
+
export declare function enhanceUI5YamlWithCustomConfig(ui5Config: UI5Config, config?: CustomConfig): void;
|
|
10
26
|
/**
|
|
11
27
|
* Writer configuration with deploy configuration.
|
|
12
28
|
*/
|
|
@@ -28,11 +44,12 @@ export declare function hasDeployConfig(config: AdpWriterConfig): config is AdpW
|
|
|
28
44
|
*/
|
|
29
45
|
export declare function enhanceUI5DeployYaml(ui5Config: UI5Config, config: AdpWriterConfigWithDeploy): void;
|
|
30
46
|
/**
|
|
31
|
-
* Generate
|
|
47
|
+
* Generate Inbound change content required for manifest.appdescriptor.
|
|
32
48
|
*
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
49
|
+
* @param flpConfiguration FLP cloud project configuration
|
|
50
|
+
* @param appId Application variant id
|
|
51
|
+
* @param manifestChangeContent Application variant change content
|
|
35
52
|
*/
|
|
36
|
-
export declare function
|
|
53
|
+
export declare function enhanceManifestChangeContentWithFlpConfig(flpConfiguration: InternalInboundNavigation, appId: string, manifestChangeContent?: Content[]): void;
|
|
37
54
|
export {};
|
|
38
55
|
//# sourceMappingURL=options.d.ts.map
|
package/dist/writer/options.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.enhanceManifestChangeContentWithFlpConfig = exports.enhanceUI5DeployYaml = exports.hasDeployConfig = exports.enhanceUI5YamlWithCustomConfig = exports.enhanceUI5YamlWithCustomTask = exports.enhanceUI5Yaml = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Generate the configuration for the middlewares required for the ui5.yaml.
|
|
6
6
|
*
|
|
@@ -14,6 +14,30 @@ function enhanceUI5Yaml(ui5Config, config) {
|
|
|
14
14
|
ui5Config.addCustomMiddleware(middlewares);
|
|
15
15
|
}
|
|
16
16
|
exports.enhanceUI5Yaml = enhanceUI5Yaml;
|
|
17
|
+
/**
|
|
18
|
+
* Generate the configuration for the custom tasks required for the ui5.yaml.
|
|
19
|
+
*
|
|
20
|
+
* @param ui5Config configuration representing the ui5.yaml
|
|
21
|
+
* @param config full project configuration
|
|
22
|
+
*/
|
|
23
|
+
function enhanceUI5YamlWithCustomTask(ui5Config, config) {
|
|
24
|
+
const tasks = getAdpCloudCustomTasks(config);
|
|
25
|
+
ui5Config.addCustomTasks(tasks);
|
|
26
|
+
}
|
|
27
|
+
exports.enhanceUI5YamlWithCustomTask = enhanceUI5YamlWithCustomTask;
|
|
28
|
+
/**
|
|
29
|
+
* Generate custom configuration required for the ui5.yaml.
|
|
30
|
+
*
|
|
31
|
+
* @param ui5Config configuration representing the ui5.yaml
|
|
32
|
+
* @param config full project configuration
|
|
33
|
+
*/
|
|
34
|
+
function enhanceUI5YamlWithCustomConfig(ui5Config, config) {
|
|
35
|
+
if (config === null || config === void 0 ? void 0 : config.adp) {
|
|
36
|
+
const { safeMode } = config.adp;
|
|
37
|
+
ui5Config.addCustomConfiguration('adp', { safeMode });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.enhanceUI5YamlWithCustomConfig = enhanceUI5YamlWithCustomConfig;
|
|
17
41
|
/**
|
|
18
42
|
* Checks if a writer config has a deploy configuration.
|
|
19
43
|
*
|
|
@@ -35,19 +59,6 @@ function enhanceUI5DeployYaml(ui5Config, config) {
|
|
|
35
59
|
ui5Config.addAbapDeployTask(config.target, config.deploy, ((_a = config.options) === null || _a === void 0 ? void 0 : _a.fioriTools) === true);
|
|
36
60
|
}
|
|
37
61
|
exports.enhanceUI5DeployYaml = enhanceUI5DeployYaml;
|
|
38
|
-
/**
|
|
39
|
-
* Generate custom configuration required for the ui5.yaml.
|
|
40
|
-
*
|
|
41
|
-
* @param ui5Config configuration representing the ui5.yaml
|
|
42
|
-
* @param config full project configuration
|
|
43
|
-
*/
|
|
44
|
-
function enhanceUI5YamlWithCustomConfig(ui5Config, config) {
|
|
45
|
-
if (config === null || config === void 0 ? void 0 : config.adp) {
|
|
46
|
-
const { safeMode } = config.adp;
|
|
47
|
-
ui5Config.addCustomConfiguration('adp', { safeMode });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.enhanceUI5YamlWithCustomConfig = enhanceUI5YamlWithCustomConfig;
|
|
51
62
|
/**
|
|
52
63
|
* Get a list of required middlewares using the Fiori tools.
|
|
53
64
|
*
|
|
@@ -63,7 +74,7 @@ function getFioriToolsMiddlwares(config) {
|
|
|
63
74
|
configuration: {
|
|
64
75
|
port: 35729,
|
|
65
76
|
path: 'webapp',
|
|
66
|
-
delay: 300
|
|
77
|
+
delay: 300
|
|
67
78
|
}
|
|
68
79
|
},
|
|
69
80
|
{
|
|
@@ -107,7 +118,7 @@ function getOpenSourceMiddlewares(config) {
|
|
|
107
118
|
configuration: {
|
|
108
119
|
port: 35729,
|
|
109
120
|
path: 'webapp',
|
|
110
|
-
delay: 300
|
|
121
|
+
delay: 300
|
|
111
122
|
}
|
|
112
123
|
},
|
|
113
124
|
{
|
|
@@ -144,4 +155,139 @@ function getOpenSourceMiddlewares(config) {
|
|
|
144
155
|
}
|
|
145
156
|
];
|
|
146
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Get a list of required custom tasks for Cloud application.
|
|
160
|
+
*
|
|
161
|
+
* @param config full project configuration
|
|
162
|
+
* @returns list of required tasks.
|
|
163
|
+
*/
|
|
164
|
+
function getAdpCloudCustomTasks(config) {
|
|
165
|
+
var _a, _b, _c, _d;
|
|
166
|
+
return [
|
|
167
|
+
{
|
|
168
|
+
name: 'app-variant-bundler-build',
|
|
169
|
+
beforeTask: 'escapeNonAsciiCharacters',
|
|
170
|
+
configuration: {
|
|
171
|
+
type: 'abap',
|
|
172
|
+
destination: (_a = config.target) === null || _a === void 0 ? void 0 : _a.destination,
|
|
173
|
+
appName: (_b = config === null || config === void 0 ? void 0 : config.app) === null || _b === void 0 ? void 0 : _b.bspName,
|
|
174
|
+
languages: (_d = (_c = config === null || config === void 0 ? void 0 : config.app) === null || _c === void 0 ? void 0 : _c.languages) === null || _d === void 0 ? void 0 : _d.map((language) => {
|
|
175
|
+
return {
|
|
176
|
+
sap: language.sap,
|
|
177
|
+
i18n: language.i18n
|
|
178
|
+
};
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get a Inbound change content with provided inboundId.
|
|
186
|
+
*
|
|
187
|
+
* @param flpConfiguration FLP cloud project configuration
|
|
188
|
+
* @param appId application id
|
|
189
|
+
* @returns Inbound change content.
|
|
190
|
+
*/
|
|
191
|
+
function getInboundChangeContentWithExistingInboundId(flpConfiguration, appId) {
|
|
192
|
+
const inboundContent = {
|
|
193
|
+
inboundId: flpConfiguration.inboundId,
|
|
194
|
+
entityPropertyChange: [
|
|
195
|
+
{
|
|
196
|
+
propertyPath: 'title',
|
|
197
|
+
operation: 'UPSERT',
|
|
198
|
+
propertyValue: `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.title}}`
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
};
|
|
202
|
+
if (flpConfiguration.subTitle) {
|
|
203
|
+
inboundContent.entityPropertyChange.push({
|
|
204
|
+
propertyPath: 'subTitle',
|
|
205
|
+
operation: 'UPSERT',
|
|
206
|
+
propertyValue: `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.subTitle}}`
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
inboundContent.entityPropertyChange.push({
|
|
210
|
+
propertyPath: 'signature/parameters/sap-appvar-id',
|
|
211
|
+
operation: 'UPSERT',
|
|
212
|
+
propertyValue: {
|
|
213
|
+
required: true,
|
|
214
|
+
filter: {
|
|
215
|
+
value: appId,
|
|
216
|
+
format: 'plain'
|
|
217
|
+
},
|
|
218
|
+
launcherValue: {
|
|
219
|
+
value: appId
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
return inboundContent;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Get a Inbound change content without provided inboundId.
|
|
227
|
+
*
|
|
228
|
+
* @param flpConfiguration FLP cloud project configuration
|
|
229
|
+
* @param appId application id
|
|
230
|
+
* @returns Inbound change content.
|
|
231
|
+
*/
|
|
232
|
+
function getInboundChangeContentWithNewInboundID(flpConfiguration, appId) {
|
|
233
|
+
var _a;
|
|
234
|
+
const content = {
|
|
235
|
+
inbound: {
|
|
236
|
+
[flpConfiguration.inboundId]: {
|
|
237
|
+
action: flpConfiguration.action,
|
|
238
|
+
semanticObject: flpConfiguration.semanticObject,
|
|
239
|
+
title: `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.title}}`,
|
|
240
|
+
signature: {
|
|
241
|
+
additionalParameters: 'allowed',
|
|
242
|
+
parameters: (_a = flpConfiguration.additionalParameters) !== null && _a !== void 0 ? _a : {}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
if (flpConfiguration.subTitle) {
|
|
248
|
+
content.inbound[flpConfiguration.inboundId].subTitle = `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.subTitle}}`;
|
|
249
|
+
}
|
|
250
|
+
content.inbound[flpConfiguration.inboundId].signature.parameters['sap-appvar-id'] = {
|
|
251
|
+
required: true,
|
|
252
|
+
filter: {
|
|
253
|
+
value: appId,
|
|
254
|
+
format: 'plain'
|
|
255
|
+
},
|
|
256
|
+
launcherValue: {
|
|
257
|
+
value: appId
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
return content;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Generate Inbound change content required for manifest.appdescriptor.
|
|
264
|
+
*
|
|
265
|
+
* @param flpConfiguration FLP cloud project configuration
|
|
266
|
+
* @param appId Application variant id
|
|
267
|
+
* @param manifestChangeContent Application variant change content
|
|
268
|
+
*/
|
|
269
|
+
function enhanceManifestChangeContentWithFlpConfig(flpConfiguration, appId, manifestChangeContent = []) {
|
|
270
|
+
const inboundChangeContent = flpConfiguration.addInboundId
|
|
271
|
+
? getInboundChangeContentWithNewInboundID(flpConfiguration, appId)
|
|
272
|
+
: getInboundChangeContentWithExistingInboundId(flpConfiguration, appId);
|
|
273
|
+
if (inboundChangeContent) {
|
|
274
|
+
const addInboundChange = {
|
|
275
|
+
changeType: flpConfiguration.addInboundId ? 'appdescr_app_addNewInbound' : 'appdescr_app_changeInbound',
|
|
276
|
+
content: inboundChangeContent,
|
|
277
|
+
texts: {
|
|
278
|
+
'i18n': 'i18n/i18n.properties'
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const removeOtherInboundsChange = {
|
|
282
|
+
changeType: 'appdescr_app_removeAllInboundsExceptOne',
|
|
283
|
+
content: {
|
|
284
|
+
'inboundId': flpConfiguration.inboundId
|
|
285
|
+
},
|
|
286
|
+
texts: {}
|
|
287
|
+
};
|
|
288
|
+
manifestChangeContent.push(addInboundChange);
|
|
289
|
+
manifestChangeContent.push(removeOtherInboundsChange);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
exports.enhanceManifestChangeContentWithFlpConfig = enhanceManifestChangeContentWithFlpConfig;
|
|
147
293
|
//# sourceMappingURL=options.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Editor } from 'mem-fs-editor';
|
|
2
|
-
import { AdpWriterConfig } from '../types';
|
|
2
|
+
import type { AdpWriterConfig } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Writes a given project template files within a specified folder in the project directory.
|
|
5
5
|
*
|
|
6
6
|
* @param {string} templatePath - The root path of the project template.
|
|
7
7
|
* @param {string} projectPath - The root path of the project.
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {AdpWriterConfig} data - The data to be populated in the template file.
|
|
9
9
|
* @param {Editor} fs - The `mem-fs-editor` instance used for file operations.
|
|
10
10
|
* @returns {void}
|
|
11
11
|
*/
|
|
@@ -18,7 +18,7 @@ const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
|
18
18
|
*
|
|
19
19
|
* @param {string} templatePath - The root path of the project template.
|
|
20
20
|
* @param {string} projectPath - The root path of the project.
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {AdpWriterConfig} data - The data to be populated in the template file.
|
|
22
22
|
* @param {Editor} fs - The `mem-fs-editor` instance used for file operations.
|
|
23
23
|
* @returns {void}
|
|
24
24
|
*/
|
|
@@ -43,6 +43,7 @@ exports.writeTemplateToFolder = writeTemplateToFolder;
|
|
|
43
43
|
* @returns {void}
|
|
44
44
|
*/
|
|
45
45
|
function writeUI5Yaml(projectPath, data, fs) {
|
|
46
|
+
var _a, _b;
|
|
46
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
48
|
try {
|
|
48
49
|
const ui5ConfigPath = (0, path_1.join)(projectPath, 'ui5.yaml');
|
|
@@ -50,6 +51,9 @@ function writeUI5Yaml(projectPath, data, fs) {
|
|
|
50
51
|
const ui5Config = yield ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
|
|
51
52
|
(0, options_1.enhanceUI5Yaml)(ui5Config, data);
|
|
52
53
|
(0, options_1.enhanceUI5YamlWithCustomConfig)(ui5Config, data === null || data === void 0 ? void 0 : data.customConfig);
|
|
54
|
+
if (((_b = (_a = data.customConfig) === null || _a === void 0 ? void 0 : _a.adp) === null || _b === void 0 ? void 0 : _b.environment) === 'C') {
|
|
55
|
+
(0, options_1.enhanceUI5YamlWithCustomTask)(ui5Config, data);
|
|
56
|
+
}
|
|
53
57
|
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
54
58
|
}
|
|
55
59
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.11.0",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@sap-ux/axios-extension": "1.13.1",
|
|
33
33
|
"@sap-ux/project-access": "1.22.0",
|
|
34
34
|
"@sap-ux/logger": "0.5.1",
|
|
35
|
-
"@sap-ux/system-access": "0.
|
|
35
|
+
"@sap-ux/system-access": "0.4.1",
|
|
36
36
|
"@sap-ux/ui5-config": "0.22.7",
|
|
37
37
|
"@sap-ux/btp-utils": "0.14.4"
|
|
38
38
|
},
|
|
@@ -10,17 +10,19 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
<%if (locals.options?.fioriTools) {%>"@sap/ux-ui5-tooling": "
|
|
13
|
+
<%if (locals.options?.fioriTools) {%>"@sap/ux-ui5-tooling": "1"<%} else {%>"@sap-ux/backend-proxy-middleware": "^0.7.5",
|
|
14
14
|
"@sap-ux/preview-middleware": "^0.11.1",
|
|
15
15
|
"@sap-ux/ui5-proxy-middleware": "^1.3.0",
|
|
16
16
|
"@sap-ux/deploy-tooling": "^0.11.7"<%}%>,
|
|
17
|
-
"@ui5/
|
|
17
|
+
"@ui5/task-adaptation": "^1.3.0",
|
|
18
|
+
"@ui5/cli": "^3.9.2"
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
21
|
"build": "ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest",
|
|
21
22
|
"start": "<%= locals.options?.fioriTools ? 'fiori run' : 'ui5 serve' %> --open /test/flp.html#app-preview",
|
|
22
23
|
"start-editor": "<%= locals.options?.fioriTools ? 'fiori run' : 'ui5 serve' %> --open /test/adaptation-editor.html"<%if (locals.deploy) {%>,
|
|
23
24
|
"deploy": "ui5 build --config ui5-deploy.yaml --exclude-task <%= locals.options?.fioriTools ? 'deploy-to-abap' : 'abap-deploy-task' %> generateFlexChangesBundle generateComponentPreload --clean-dest && <%= locals.options?.fioriTools ? 'fiori deploy' : 'deploy' %> --config ui5-deploy.yaml",
|
|
24
|
-
"undeploy": "<%= locals.options?.fioriTools ? 'fiori undeploy' : 'undeploy' %> --config ui5-deploy.yaml --lrep \"apps/<%= app.reference %>/appVariants/<%= app.id %>/\""
|
|
25
|
+
"undeploy": "<%= locals.options?.fioriTools ? 'fiori undeploy' : 'undeploy' %> --config ui5-deploy.yaml --lrep \"apps/<%= app.reference %>/appVariants/<%= app.id %>/\"",
|
|
26
|
+
"deploy-test": "npm run build && fiori deploy --config ui5-deploy.yaml --testMode true"<%}%>
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -3,4 +3,10 @@
|
|
|
3
3
|
#Texts for manifest.json
|
|
4
4
|
|
|
5
5
|
#XTIT: Application name
|
|
6
|
-
<%- app.id %>_sap.app.title=<%- app.title %>
|
|
6
|
+
<%- app.id %>_sap.app.title=<%- app.title %>
|
|
7
|
+
<% if (customConfig?.adp.environment === "C" && flp) { %>
|
|
8
|
+
# FLP Configuration
|
|
9
|
+
|
|
10
|
+
<%= app.id %>_sap.app.crossNavigation.inbounds.<%= flp.inboundId %>.title=<%= flp.title %><% if (flp.subTitle) { %>
|
|
11
|
+
<%= app.id %>_sap.app.crossNavigation.inbounds.<%= flp.inboundId %>.subTitle=<%= flp.subTitle %><% } %>
|
|
12
|
+
<% } %>
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
"namespace": "apps/<%- app.reference %>/appVariants/<%- app.id %>/",
|
|
8
8
|
"version": "0.1.0",
|
|
9
9
|
"content": [
|
|
10
|
+
<%if(app.content){-%><% for(let change of app.content){-%>
|
|
11
|
+
<%- JSON.stringify(change, undefined, 4) %><%-","%>
|
|
12
|
+
<%}-%><%}-%>
|
|
10
13
|
{
|
|
11
14
|
"changeType": "appdescr_app_setTitle",
|
|
12
15
|
"content": {},
|