@sap-ux/cf-deploy-config-writer 0.0.1
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/LICENSE +201 -0
- package/README.md +84 -0
- package/dist/cf-writer/app-config.d.ts +21 -0
- package/dist/cf-writer/app-config.js +368 -0
- package/dist/cf-writer/base-config.d.ts +13 -0
- package/dist/cf-writer/base-config.js +143 -0
- package/dist/cf-writer/index.d.ts +3 -0
- package/dist/cf-writer/index.js +8 -0
- package/dist/constants.d.ts +111 -0
- package/dist/constants.js +115 -0
- package/dist/i18n.d.ts +14 -0
- package/dist/i18n.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +24 -0
- package/dist/logger-helper.d.ts +20 -0
- package/dist/logger-helper.js +27 -0
- package/dist/mta-config/index.d.ts +43 -0
- package/dist/mta-config/index.js +101 -0
- package/dist/mta-config/mta.d.ts +242 -0
- package/dist/mta-config/mta.js +874 -0
- package/dist/translations/cf-deploy-config-writer.i18n.json +25 -0
- package/dist/types/index.d.ts +89 -0
- package/dist/types/index.js +14 -0
- package/dist/utils.d.ts +91 -0
- package/dist/utils.js +149 -0
- package/package.json +62 -0
- package/templates/app/mta-ext.mtaext +25 -0
- package/templates/app/mta.yaml +12 -0
- package/templates/app/xs-app-destination.json +31 -0
- package/templates/app/xs-app-no-destination.json +24 -0
- package/templates/common/xs-security.json +7 -0
- package/templates/gitignore.tmpl +10 -0
- package/templates/package.json +15 -0
- package/templates/router/package.json +18 -0
- package/templates/router/xs-app-abapservice.json +25 -0
- package/templates/router/xs-app-server.json +17 -0
- package/templates/router/xs-app.json +18 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"debug": {
|
|
3
|
+
"logError": "{{method}} error found {{ error }}",
|
|
4
|
+
"mtaLoaded": "MTA {{ type }} loaded",
|
|
5
|
+
"ui5YamlDoesNotExist": "File ui5.yaml does not exist in the project"
|
|
6
|
+
},
|
|
7
|
+
"error": {
|
|
8
|
+
"unableToLoadMTA": "Unable to load mta.yaml configuration",
|
|
9
|
+
"updatingMTAExtensionFailed": "Unable to add mta extension configuration to file: {{mtaExtFilePath}}",
|
|
10
|
+
"cannotFindBinary": "Cannot find the \"{{bin}}\" executable. Please add it to the path or use \"npm i -g {{pkg}}\" to install it.",
|
|
11
|
+
"mtaExtensionFailed": "Unable to create or update the mta extension file for Api Hub Enterprise destination configuration: {{error}}",
|
|
12
|
+
"serviceKeyFailed": "Failed to fetch service key",
|
|
13
|
+
"missingMtaParameters": "Missing required parameters, MTA path, MTA ID or router type is missing",
|
|
14
|
+
"invalidMtaIdWithChars": "The MTA ID can only contain letters, numbers, dashes, periods, underscores",
|
|
15
|
+
"invalidMtaId": "The MTA ID must start with a letter or underscore and be less than 128 characters long",
|
|
16
|
+
"missingABAPServiceBindingDetails": "Missing ABAP service details for direct service binding",
|
|
17
|
+
"mtaAlreadyExists": "A folder with same name already exists in the target directory"
|
|
18
|
+
},
|
|
19
|
+
"info": {
|
|
20
|
+
"existingMTAExtensionNotFound": "Cannot find a valid existing mta extension file, a new one will be created",
|
|
21
|
+
"existingDestinationNotFound": "A destination service resource cannot be found in the mta.yaml. An mta extension destination instance cannot be added",
|
|
22
|
+
"mtaExtensionCreated": "Created file: {{mtaExtFile}} to extend mta module {{appMtaId}} with destination configuration",
|
|
23
|
+
"mtaExtensionUpdated": "Updated file: {{mtaExtFile}} with module destination configuration"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Destination, Authentication } from '@sap-ux/btp-utils';
|
|
2
|
+
export type ResourceType = 'xsuaa' | 'destination' | 'portal' | 'connectivity' | 'managed:xsuaa' | 'html5-apps-repo:app-host' | 'html5-apps-repo:app-runtime';
|
|
3
|
+
export type ModuleType = 'hdb' | 'nodejs' | 'java' | 'approuter.nodejs' | 'com.sap.application.content' | 'com.sap.application.content:destination' | 'com.sap.application.content:resource' | 'html5' | 'com.sap.portal.content';
|
|
4
|
+
export declare enum CloudFoundryServiceType {
|
|
5
|
+
Existing = "org.cloudfoundry.existing-service",
|
|
6
|
+
Managed = "org.cloudfoundry.managed-service"
|
|
7
|
+
}
|
|
8
|
+
export type MTADestinationType = Destination & {
|
|
9
|
+
ServiceInstanceName: string;
|
|
10
|
+
ServiceKeyName: string;
|
|
11
|
+
'sap.cloud.service': string;
|
|
12
|
+
};
|
|
13
|
+
export declare enum RouterModuleType {
|
|
14
|
+
Standard = "standard",
|
|
15
|
+
Managed = "managed"
|
|
16
|
+
}
|
|
17
|
+
export interface MTABaseConfig {
|
|
18
|
+
mtaId: string;
|
|
19
|
+
mtaPath: string;
|
|
20
|
+
mtaDescription?: string;
|
|
21
|
+
mtaVersion?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CFBaseConfig extends MTABaseConfig {
|
|
24
|
+
routerType: RouterModuleType;
|
|
25
|
+
addConnectivityService?: boolean;
|
|
26
|
+
addDestinationService?: boolean;
|
|
27
|
+
abapServiceProvider?: {
|
|
28
|
+
abapServiceName?: string;
|
|
29
|
+
abapService?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface CFAppConfig {
|
|
33
|
+
appPath: string;
|
|
34
|
+
addManagedAppRouter?: boolean;
|
|
35
|
+
destinationName?: string;
|
|
36
|
+
apiHubConfig?: ApiHubConfig;
|
|
37
|
+
serviceHost?: string;
|
|
38
|
+
lcapMode?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface CFConfig extends CFAppConfig, CFBaseConfig {
|
|
41
|
+
appId: string;
|
|
42
|
+
rootPath: string;
|
|
43
|
+
serviceHost: string;
|
|
44
|
+
capRoot?: string;
|
|
45
|
+
isCap?: boolean;
|
|
46
|
+
servicePath?: string;
|
|
47
|
+
firstServicePathSegment?: string;
|
|
48
|
+
isFullUrlDest?: boolean;
|
|
49
|
+
destinationAuthType?: Authentication;
|
|
50
|
+
cloudServiceName?: string;
|
|
51
|
+
isMtaRoot?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare const enum ApiHubType {
|
|
54
|
+
apiHub = "API_HUB",
|
|
55
|
+
apiHubEnterprise = "API_HUB_ENTERPRISE"
|
|
56
|
+
}
|
|
57
|
+
export interface ApiHubConfig {
|
|
58
|
+
apiHubKey: string;
|
|
59
|
+
apiHubType: ApiHubType;
|
|
60
|
+
}
|
|
61
|
+
export interface XSAppRoute {
|
|
62
|
+
source?: string;
|
|
63
|
+
target?: string;
|
|
64
|
+
destination?: string;
|
|
65
|
+
csrfProtection?: boolean;
|
|
66
|
+
scope?: string;
|
|
67
|
+
service?: string;
|
|
68
|
+
endpoint?: string;
|
|
69
|
+
authenticationType?: string;
|
|
70
|
+
dependency?: string;
|
|
71
|
+
}
|
|
72
|
+
export type XSAppRouteProperties = keyof XSAppRoute;
|
|
73
|
+
export interface XSAppDocument {
|
|
74
|
+
authenticationMethod?: string;
|
|
75
|
+
routes?: XSAppRoute[];
|
|
76
|
+
welcomeFile?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface HTML5App {
|
|
79
|
+
path: string;
|
|
80
|
+
'build-parameters': {
|
|
81
|
+
builder: string;
|
|
82
|
+
'build-result': string;
|
|
83
|
+
commands: string[];
|
|
84
|
+
'supported-platforms': string[];
|
|
85
|
+
};
|
|
86
|
+
name: string;
|
|
87
|
+
type: string;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RouterModuleType = exports.CloudFoundryServiceType = void 0;
|
|
4
|
+
var CloudFoundryServiceType;
|
|
5
|
+
(function (CloudFoundryServiceType) {
|
|
6
|
+
CloudFoundryServiceType["Existing"] = "org.cloudfoundry.existing-service";
|
|
7
|
+
CloudFoundryServiceType["Managed"] = "org.cloudfoundry.managed-service";
|
|
8
|
+
})(CloudFoundryServiceType || (exports.CloudFoundryServiceType = CloudFoundryServiceType = {}));
|
|
9
|
+
var RouterModuleType;
|
|
10
|
+
(function (RouterModuleType) {
|
|
11
|
+
RouterModuleType["Standard"] = "standard";
|
|
12
|
+
RouterModuleType["Managed"] = "managed";
|
|
13
|
+
})(RouterModuleType || (exports.RouterModuleType = RouterModuleType = {}));
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Authentication } from '@sap-ux/btp-utils';
|
|
2
|
+
import { type Manifest } from '@sap-ux/project-access';
|
|
3
|
+
import type { Editor } from 'mem-fs-editor';
|
|
4
|
+
import type { Destinations } from '@sap-ux/btp-utils';
|
|
5
|
+
import type { MTABaseConfig } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Read manifest file for processing.
|
|
8
|
+
*
|
|
9
|
+
* @param manifestPath Path to the manifest file
|
|
10
|
+
* @param fs reference to a mem-fs editor
|
|
11
|
+
* @returns Manifest object
|
|
12
|
+
*/
|
|
13
|
+
export declare function readManifest(manifestPath: string, fs: Editor): Promise<Manifest>;
|
|
14
|
+
/**
|
|
15
|
+
* Locates template files relative to the dist folder.
|
|
16
|
+
* This helps to locate templates when this module is bundled and the dir structure is flattened, maintaining the relative paths.
|
|
17
|
+
*
|
|
18
|
+
* @param relativeTemplatePath - optional, the path of the required template relative to the ./templates folder. If not specified the root templates folder is returned.
|
|
19
|
+
* @returns the path of the template specified or templates root folder
|
|
20
|
+
*/
|
|
21
|
+
export declare function getTemplatePath(relativeTemplatePath?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Convert an app name to an MTA ID that is suitable for CF deployment.
|
|
24
|
+
*
|
|
25
|
+
* @param id Name of the app, like `sap.ux.app`
|
|
26
|
+
* @returns Name that's acceptable in an mta.yaml
|
|
27
|
+
*/
|
|
28
|
+
export declare function toMtaModuleName(id: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Return a consistent file path across different platforms.
|
|
31
|
+
*
|
|
32
|
+
* @param dirPath Path to the directory
|
|
33
|
+
* @returns Path to the directory with consistent separators
|
|
34
|
+
*/
|
|
35
|
+
export declare function toPosixPath(dirPath: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the destination properties, based on the destination value.
|
|
38
|
+
*
|
|
39
|
+
* @param destination destination name
|
|
40
|
+
* @returns Destination properties, default properties returned if not found
|
|
41
|
+
*/
|
|
42
|
+
export declare function getDestinationProperties(destination: string | undefined): Promise<{
|
|
43
|
+
isFullUrlDest: boolean;
|
|
44
|
+
destinationAuthType: Authentication;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve the list of destinations from SAP BTP.
|
|
48
|
+
*
|
|
49
|
+
* @returns Destinations list
|
|
50
|
+
*/
|
|
51
|
+
export declare function getBTPDestinations(): Promise<Destinations>;
|
|
52
|
+
/**
|
|
53
|
+
* Validates the MTA version passed in the config.
|
|
54
|
+
*
|
|
55
|
+
* @param mtaVersion MTA version
|
|
56
|
+
* @returns true if the version is valid
|
|
57
|
+
*/
|
|
58
|
+
export declare function validateVersion(mtaVersion?: string): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Append xs-security.json to project folder.
|
|
61
|
+
*
|
|
62
|
+
* @param root0 MTA base configuration
|
|
63
|
+
* @param root0.mtaPath Path to the MTA project
|
|
64
|
+
* @param root0.mtaId MTA ID
|
|
65
|
+
* @param fs reference to a mem-fs editor
|
|
66
|
+
*/
|
|
67
|
+
export declare function addXSSecurityConfig({ mtaPath, mtaId }: MTABaseConfig, fs: Editor): void;
|
|
68
|
+
/**
|
|
69
|
+
* Append .gitignore to project folder.
|
|
70
|
+
*
|
|
71
|
+
* @param targetPath Path to the project folder
|
|
72
|
+
* @param fs reference to a mem-fs editor
|
|
73
|
+
*/
|
|
74
|
+
export declare function addGitIgnore(targetPath: string, fs: Editor): void;
|
|
75
|
+
/**
|
|
76
|
+
* Append server package.json to project folder.
|
|
77
|
+
*
|
|
78
|
+
* @param root0 MTA base configuration
|
|
79
|
+
* @param root0.mtaPath Path to the MTA project
|
|
80
|
+
* @param root0.mtaId MTA ID
|
|
81
|
+
* @param fs reference to a mem-fs editor
|
|
82
|
+
*/
|
|
83
|
+
export declare function addRootPackage({ mtaPath, mtaId }: MTABaseConfig, fs: Editor): void;
|
|
84
|
+
/**
|
|
85
|
+
* Add common dependencies to the HTML5 app package.json.
|
|
86
|
+
*
|
|
87
|
+
* @param targetPath Path to the package.json file
|
|
88
|
+
* @param fs reference to a mem-fs editor
|
|
89
|
+
*/
|
|
90
|
+
export declare function addCommonPackageDependencies(targetPath: string, fs: Editor): Promise<void>;
|
|
91
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readManifest = readManifest;
|
|
4
|
+
exports.getTemplatePath = getTemplatePath;
|
|
5
|
+
exports.toMtaModuleName = toMtaModuleName;
|
|
6
|
+
exports.toPosixPath = toPosixPath;
|
|
7
|
+
exports.getDestinationProperties = getDestinationProperties;
|
|
8
|
+
exports.getBTPDestinations = getBTPDestinations;
|
|
9
|
+
exports.validateVersion = validateVersion;
|
|
10
|
+
exports.addXSSecurityConfig = addXSSecurityConfig;
|
|
11
|
+
exports.addGitIgnore = addGitIgnore;
|
|
12
|
+
exports.addRootPackage = addRootPackage;
|
|
13
|
+
exports.addCommonPackageDependencies = addCommonPackageDependencies;
|
|
14
|
+
const path_1 = require("path");
|
|
15
|
+
const semver_1 = require("semver");
|
|
16
|
+
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
17
|
+
const project_access_1 = require("@sap-ux/project-access");
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
let cachedDestinationsList = {};
|
|
20
|
+
/**
|
|
21
|
+
* Read manifest file for processing.
|
|
22
|
+
*
|
|
23
|
+
* @param manifestPath Path to the manifest file
|
|
24
|
+
* @param fs reference to a mem-fs editor
|
|
25
|
+
* @returns Manifest object
|
|
26
|
+
*/
|
|
27
|
+
async function readManifest(manifestPath, fs) {
|
|
28
|
+
return fs.readJSON(manifestPath);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Locates template files relative to the dist folder.
|
|
32
|
+
* This helps to locate templates when this module is bundled and the dir structure is flattened, maintaining the relative paths.
|
|
33
|
+
*
|
|
34
|
+
* @param relativeTemplatePath - optional, the path of the required template relative to the ./templates folder. If not specified the root templates folder is returned.
|
|
35
|
+
* @returns the path of the template specified or templates root folder
|
|
36
|
+
*/
|
|
37
|
+
function getTemplatePath(relativeTemplatePath = '') {
|
|
38
|
+
return (0, path_1.join)(__dirname, '../templates', relativeTemplatePath);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Convert an app name to an MTA ID that is suitable for CF deployment.
|
|
42
|
+
*
|
|
43
|
+
* @param id Name of the app, like `sap.ux.app`
|
|
44
|
+
* @returns Name that's acceptable in an mta.yaml
|
|
45
|
+
*/
|
|
46
|
+
function toMtaModuleName(id) {
|
|
47
|
+
return id.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>]/gi, '');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Return a consistent file path across different platforms.
|
|
51
|
+
*
|
|
52
|
+
* @param dirPath Path to the directory
|
|
53
|
+
* @returns Path to the directory with consistent separators
|
|
54
|
+
*/
|
|
55
|
+
function toPosixPath(dirPath) {
|
|
56
|
+
return (0, path_1.normalize)(dirPath).split(/[\\/]/g).join(path_1.posix.sep);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get the destination properties, based on the destination value.
|
|
60
|
+
*
|
|
61
|
+
* @param destination destination name
|
|
62
|
+
* @returns Destination properties, default properties returned if not found
|
|
63
|
+
*/
|
|
64
|
+
async function getDestinationProperties(destination) {
|
|
65
|
+
const destinationProperties = {
|
|
66
|
+
isFullUrlDest: false,
|
|
67
|
+
destinationAuthType: btp_utils_1.Authentication.NO_AUTHENTICATION
|
|
68
|
+
};
|
|
69
|
+
if ((0, btp_utils_1.isAppStudio)() && destination) {
|
|
70
|
+
const destinations = await getBTPDestinations();
|
|
71
|
+
if (destinations[destination]) {
|
|
72
|
+
destinationProperties.isFullUrlDest = (0, btp_utils_1.isFullUrlDestination)(destinations[destination]);
|
|
73
|
+
destinationProperties.destinationAuthType = destinations[destination].Authentication;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return destinationProperties;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Retrieve the list of destinations from SAP BTP.
|
|
80
|
+
*
|
|
81
|
+
* @returns Destinations list
|
|
82
|
+
*/
|
|
83
|
+
async function getBTPDestinations() {
|
|
84
|
+
if (Object.keys(cachedDestinationsList).length === 0) {
|
|
85
|
+
cachedDestinationsList = await (0, btp_utils_1.listDestinations)();
|
|
86
|
+
}
|
|
87
|
+
return cachedDestinationsList;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Validates the MTA version passed in the config.
|
|
91
|
+
*
|
|
92
|
+
* @param mtaVersion MTA version
|
|
93
|
+
* @returns true if the version is valid
|
|
94
|
+
*/
|
|
95
|
+
function validateVersion(mtaVersion) {
|
|
96
|
+
const version = (0, semver_1.coerce)(mtaVersion);
|
|
97
|
+
if ((mtaVersion && !version) || (version && !(0, semver_1.satisfies)(version, `>=${constants_1.MTAVersion}`))) {
|
|
98
|
+
throw new Error('Invalid MTA version specified. Please use version 0.0.1 or higher.');
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Append xs-security.json to project folder.
|
|
104
|
+
*
|
|
105
|
+
* @param root0 MTA base configuration
|
|
106
|
+
* @param root0.mtaPath Path to the MTA project
|
|
107
|
+
* @param root0.mtaId MTA ID
|
|
108
|
+
* @param fs reference to a mem-fs editor
|
|
109
|
+
*/
|
|
110
|
+
function addXSSecurityConfig({ mtaPath, mtaId }, fs) {
|
|
111
|
+
fs.copyTpl(getTemplatePath(`common/${constants_1.XSSecurityFile}`), (0, path_1.join)(mtaPath, constants_1.XSSecurityFile), {
|
|
112
|
+
id: mtaId.slice(0, 100)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Append .gitignore to project folder.
|
|
117
|
+
*
|
|
118
|
+
* @param targetPath Path to the project folder
|
|
119
|
+
* @param fs reference to a mem-fs editor
|
|
120
|
+
*/
|
|
121
|
+
function addGitIgnore(targetPath, fs) {
|
|
122
|
+
fs.copyTpl(getTemplatePath('gitignore.tmpl'), (0, path_1.join)(targetPath, '.gitignore'), {});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Append server package.json to project folder.
|
|
126
|
+
*
|
|
127
|
+
* @param root0 MTA base configuration
|
|
128
|
+
* @param root0.mtaPath Path to the MTA project
|
|
129
|
+
* @param root0.mtaId MTA ID
|
|
130
|
+
* @param fs reference to a mem-fs editor
|
|
131
|
+
*/
|
|
132
|
+
function addRootPackage({ mtaPath, mtaId }, fs) {
|
|
133
|
+
fs.copyTpl(getTemplatePath('package.json'), (0, path_1.join)(mtaPath, 'package.json'), {
|
|
134
|
+
mtaId: mtaId
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Add common dependencies to the HTML5 app package.json.
|
|
139
|
+
*
|
|
140
|
+
* @param targetPath Path to the package.json file
|
|
141
|
+
* @param fs reference to a mem-fs editor
|
|
142
|
+
*/
|
|
143
|
+
async function addCommonPackageDependencies(targetPath, fs) {
|
|
144
|
+
await (0, project_access_1.addPackageDevDependency)(targetPath, constants_1.Rimraf, constants_1.RimrafVersion, fs);
|
|
145
|
+
await (0, project_access_1.addPackageDevDependency)(targetPath, constants_1.MbtPackage, constants_1.MbtPackageVersion, fs);
|
|
146
|
+
await (0, project_access_1.addPackageDevDependency)(targetPath, constants_1.UI5BuilderWebIdePackage, constants_1.UI5BuilderWebIdePackageVersion, fs);
|
|
147
|
+
await (0, project_access_1.addPackageDevDependency)(targetPath, constants_1.UI5TaskZipperPackage, constants_1.UI5TaskZipperPackageVersion, fs);
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=utils.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sap-ux/cf-deploy-config-writer",
|
|
3
|
+
"description": "Add or amend Cloud Foundry and ABAP deployment configuration for SAP projects",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
8
|
+
"directory": "packages/cf-deploy-config-writer"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Acf-deploy-config-writer"
|
|
12
|
+
},
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"author": "@SAP/ux-tools-team",
|
|
16
|
+
"files": [
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"dist",
|
|
19
|
+
"templates",
|
|
20
|
+
"!dist/*.map",
|
|
21
|
+
"!dist/**/*.map"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@sap/mta-lib": "1.7.4",
|
|
25
|
+
"@sap/cf-tools": "3.2.0",
|
|
26
|
+
"semver": "7.5.4",
|
|
27
|
+
"ejs": "3.1.10",
|
|
28
|
+
"i18next": "21.10.0",
|
|
29
|
+
"mem-fs": "2.1.0",
|
|
30
|
+
"mem-fs-editor": "9.4.0",
|
|
31
|
+
"hasbin": "1.2.3",
|
|
32
|
+
"@sap-ux/project-access": "1.28.5",
|
|
33
|
+
"@sap-ux/yaml": "0.16.0",
|
|
34
|
+
"@sap-ux/btp-utils": "0.15.2",
|
|
35
|
+
"@sap-ux/logger": "0.6.0",
|
|
36
|
+
"@sap-ux/ui5-config": "0.25.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/ejs": "3.1.2",
|
|
40
|
+
"@types/mem-fs": "1.1.2",
|
|
41
|
+
"@types/mem-fs-editor": "7.0.1",
|
|
42
|
+
"@types/hasbin": "1.2.2",
|
|
43
|
+
"@types/fs-extra": "9.0.13",
|
|
44
|
+
"@types/js-yaml": "4.0.9",
|
|
45
|
+
"@types/semver": "7.5.2",
|
|
46
|
+
"memfs": "3.4.13",
|
|
47
|
+
"js-yaml": "3.14.0",
|
|
48
|
+
"fs-extra": "10.0.0"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=18.x"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsc --build",
|
|
55
|
+
"clean": "rimraf dist coverage *.tsbuildinfo",
|
|
56
|
+
"format": "prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",
|
|
57
|
+
"lint": "eslint . --ext .ts",
|
|
58
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
59
|
+
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
60
|
+
"watch": "tsc --watch"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## SAP UX Tools generated mtaext file
|
|
2
|
+
_schema-version: "3.2"
|
|
3
|
+
ID: <%- mtaExtensionId %>
|
|
4
|
+
extends: <%- appMtaId %>
|
|
5
|
+
version: <%- mtaVersion %>
|
|
6
|
+
|
|
7
|
+
resources:
|
|
8
|
+
- name: <%- destinationServiceName %>
|
|
9
|
+
parameters:
|
|
10
|
+
config:
|
|
11
|
+
init_data:
|
|
12
|
+
instance:
|
|
13
|
+
destinations:
|
|
14
|
+
- Authentication: NoAuthentication
|
|
15
|
+
Name: <%- destinationName %>
|
|
16
|
+
ProxyType: Internet
|
|
17
|
+
Type: HTTP
|
|
18
|
+
URL: <%- destinationUrl %>
|
|
19
|
+
URL.headers.<%- headerKey %>: <%- headerValue %>
|
|
20
|
+
- Authentication: NoAuthentication
|
|
21
|
+
Name: ui5
|
|
22
|
+
Type: HTTP
|
|
23
|
+
URL: https://ui5.sap.com
|
|
24
|
+
ProxyType: Internet
|
|
25
|
+
existing_destinations_policy: update
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"welcomeFile": "/index.html",
|
|
3
|
+
"authenticationMethod": "route",
|
|
4
|
+
"routes": [
|
|
5
|
+
{
|
|
6
|
+
"source": "^<%- servicePathSegment %>/(.*)$",
|
|
7
|
+
"target": "<%- targetPath %>",
|
|
8
|
+
"destination": "<%- destination %>",
|
|
9
|
+
"authenticationType": "<%- authentication %>",
|
|
10
|
+
"csrfProtection": false
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"source": "^/resources/(.*)$",
|
|
14
|
+
"target": "/resources/$1",
|
|
15
|
+
"authenticationType": "none",
|
|
16
|
+
"destination": "ui5"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"source": "^/test-resources/(.*)$",
|
|
20
|
+
"target": "/test-resources/$1",
|
|
21
|
+
"authenticationType": "none",
|
|
22
|
+
"destination": "ui5"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"source": "^(.*)$",
|
|
26
|
+
"target": "$1",
|
|
27
|
+
"service": "html5-apps-repo-rt",
|
|
28
|
+
"authenticationType": "xsuaa"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"welcomeFile": "/index.html",
|
|
3
|
+
"authenticationMethod": "route",
|
|
4
|
+
"routes": [
|
|
5
|
+
{
|
|
6
|
+
"source": "^/resources/(.*)$",
|
|
7
|
+
"target": "/resources/$1",
|
|
8
|
+
"authenticationType": "none",
|
|
9
|
+
"destination": "ui5"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"source": "^/test-resources/(.*)$",
|
|
13
|
+
"target": "/test-resources/$1",
|
|
14
|
+
"authenticationType": "none",
|
|
15
|
+
"destination": "ui5"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"source": "^(.*)$",
|
|
19
|
+
"target": "$1",
|
|
20
|
+
"service": "html5-apps-repo-rt",
|
|
21
|
+
"authenticationType": "xsuaa"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mta-project",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Build and deployment scripts",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"clean": "rimraf resources mta_archives mta-op*",
|
|
7
|
+
"build": "rimraf resources mta_archives && mbt build --mtar archive",
|
|
8
|
+
"deploy": "cf deploy mta_archives/archive.mtar --retries 1",
|
|
9
|
+
"undeploy": "cf undeploy <%- mtaId %> --delete-services --delete-service-keys --delete-service-brokers"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"mbt": "^1.2.27",
|
|
13
|
+
"rimraf": "^5.0.5"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "app-router",
|
|
3
|
+
"private": true,
|
|
4
|
+
"description": "App router",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">= 16.0.0"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "node node_modules/@sap/approuter/approuter.js",
|
|
10
|
+
"start-local": "node node_modules/@sap/html5-repo-mock/index.js"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@sap/approuter": "^14"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@sap/html5-repo-mock": "^2.1.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"authenticationMethod": "route",
|
|
3
|
+
"routes": [
|
|
4
|
+
{
|
|
5
|
+
"source": "^/sap/(.*)$",
|
|
6
|
+
"target": "/sap/$1",
|
|
7
|
+
"service": "<%- servicekeyService %>",
|
|
8
|
+
"endpoint": "<%- servicekeyEndpoint %>",
|
|
9
|
+
"authenticationType": "xsuaa",
|
|
10
|
+
"csrfProtection": false
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"source": "^/resources/(.*)$",
|
|
14
|
+
"target": "/resources/$1",
|
|
15
|
+
"authenticationType": "none",
|
|
16
|
+
"destination": "ui5"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"source": "^/test-resources/(.*)$",
|
|
20
|
+
"target": "/test-resources/$1",
|
|
21
|
+
"authenticationType": "none",
|
|
22
|
+
"destination": "ui5"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"authenticationMethod": "route",
|
|
3
|
+
"routes": [
|
|
4
|
+
{
|
|
5
|
+
"source": "^(?:/app|/app/.*)?/resources/(.*)$",
|
|
6
|
+
"target": "/resources/$1",
|
|
7
|
+
"authenticationType": "none",
|
|
8
|
+
"destination": "ui5"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"source": "^(?:/app|/app/.*)?/test-resources/(.*)$",
|
|
12
|
+
"target": "/test-resources/$1",
|
|
13
|
+
"authenticationType": "none",
|
|
14
|
+
"destination": "ui5"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"welcomeFile": "/<%- appName %>/",
|
|
3
|
+
"authenticationMethod": "route",
|
|
4
|
+
"routes": [
|
|
5
|
+
{
|
|
6
|
+
"source": "^/resources/(.*)$",
|
|
7
|
+
"target": "/resources/$1",
|
|
8
|
+
"authenticationType": "none",
|
|
9
|
+
"destination": "ui5"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"source": "^/test-resources/(.*)$",
|
|
13
|
+
"target": "/test-resources/$1",
|
|
14
|
+
"authenticationType": "none",
|
|
15
|
+
"destination": "ui5"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|