@sap-ux/deploy-config-sub-generator 0.4.17 → 0.4.20
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/app/index.js +5 -5
- package/generators/app/utils.js +2 -2
- package/generators/headless/index.js +6 -6
- package/generators/prompts/sub-gen.js +2 -2
- package/generators/utils/config.js +2 -2
- package/generators/utils/environment.js +3 -3
- package/generators/utils/targets.js +3 -3
- package/package.json +15 -15
package/generators/app/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.promptNames = void 0;
|
|
7
7
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
|
-
const
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
9
|
const project_access_1 = require("@sap-ux/project-access");
|
|
10
10
|
const deploy_config_generator_shared_1 = require("@sap-ux/deploy-config-generator-shared");
|
|
11
11
|
const utils_1 = require("./utils");
|
|
@@ -53,13 +53,13 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
53
53
|
if (this.options.data?.destinationRoot) {
|
|
54
54
|
this.launchStandaloneFromYui = true;
|
|
55
55
|
this.launchDeployConfigAsSubGenerator ||= this.options.data.launchDeployConfigAsSubGenerator;
|
|
56
|
-
this.options.appRootPath = (0,
|
|
56
|
+
this.options.appRootPath = (0, node_path_1.join)((0, node_path_1.dirname)(this.options.data.destinationRoot), (0, node_path_1.basename)(this.options.data.destinationRoot));
|
|
57
57
|
this.options.projectRoot = this.options.data.destinationRoot;
|
|
58
|
-
dotenv_1.default.config({ path: (0,
|
|
58
|
+
dotenv_1.default.config({ path: (0, node_path_1.join)(this.options.data.destinationRoot, '.env') });
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
if (this.options.projectPath && this.options.projectName) {
|
|
62
|
-
this.options.appRootPath = (0,
|
|
62
|
+
this.options.appRootPath = (0, node_path_1.join)(this.options.projectPath, this.options.projectName);
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
65
|
this.options.appRootPath = this.destinationRoot(); // probably in a CLI context
|
|
@@ -102,7 +102,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
102
102
|
this.target = deploy_config_generator_shared_1.TargetName.ABAP; // Adp projects support only ABAP deployment
|
|
103
103
|
this.launchDeployConfigAsSubGenerator = false;
|
|
104
104
|
}
|
|
105
|
-
this.options.projectRoot = capRoot ?? (this.mtaPath && (0,
|
|
105
|
+
this.options.projectRoot = capRoot ?? (this.mtaPath && (0, node_path_1.dirname)(this.mtaPath)) ?? this.options.appRootPath;
|
|
106
106
|
({ backendConfig: this.backendConfig, isLibrary: this.isLibrary } = await (0, utils_2.getBackendConfig)(this.fs, this.options, this.launchStandaloneFromYui, this.options.appRootPath));
|
|
107
107
|
const { destinationName, servicePath } = await (0, utils_2.getApiHubOptions)(this.fs, {
|
|
108
108
|
appPath: this.options.appRootPath,
|
package/generators/app/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.parseTarget = parseTarget;
|
|
4
4
|
exports.getYUIDetails = getYUIDetails;
|
|
5
5
|
exports.registerNamespaces = registerNamespaces;
|
|
6
|
-
const
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
7
|
/**
|
|
8
8
|
* Parses the target from the CLI args or the options.
|
|
9
9
|
*
|
|
@@ -34,7 +34,7 @@ function getYUIDetails(appRootPath) {
|
|
|
34
34
|
return [
|
|
35
35
|
{
|
|
36
36
|
name: 'Deployment Configuration',
|
|
37
|
-
description: `Configure Deployment settings - ${(0,
|
|
37
|
+
description: `Configure Deployment settings - ${(0, node_path_1.basename)(appRootPath)}`
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
40
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const node_path_1 = require("node:path");
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
5
|
const deploy_config_generator_shared_1 = require("@sap-ux/deploy-config-generator-shared");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
@@ -38,7 +38,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
38
38
|
}
|
|
39
39
|
else if (this.fs.exists(this.options.appConfig)) {
|
|
40
40
|
this.appConfig = JSON.parse(this.fs.read(this.options.appConfig));
|
|
41
|
-
this.absAppConfigPath = (0,
|
|
41
|
+
this.absAppConfigPath = (0, node_path_1.resolve)(this.options.appConfig);
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
44
|
this.appConfig = JSON.parse(this.options.appConfig);
|
|
@@ -86,7 +86,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
86
86
|
destinationAuthType: cf.destinationAuthType,
|
|
87
87
|
addManagedAppRouter: cf.addToManagedAppRouter,
|
|
88
88
|
launchDeployConfigAsSubGenerator: true, // ensures prompting is skipped within cf sub gen
|
|
89
|
-
appRootPath: (0,
|
|
89
|
+
appRootPath: (0, node_path_1.join)(this.appConfig.project.targetFolder, this.appConfig.project.name),
|
|
90
90
|
addMTADestination: cf.addMTADestination,
|
|
91
91
|
lcapModeOnly: cf.lcapModeOnly,
|
|
92
92
|
cloudServiceName: cf.cloudServiceName
|
|
@@ -97,7 +97,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
97
97
|
const abap = this.appConfig.deployConfig;
|
|
98
98
|
if (this.appConfig.project.targetFolder) {
|
|
99
99
|
options = {
|
|
100
|
-
appRootPath: (0,
|
|
100
|
+
appRootPath: (0, node_path_1.join)(this.appConfig.project.targetFolder, this.appConfig.project.name),
|
|
101
101
|
destination: abap?.destination,
|
|
102
102
|
url: abap?.url ?? '', // URL may not be provided in BAS but will be determined in the generator
|
|
103
103
|
client: abap?.client,
|
|
@@ -115,7 +115,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
|
|
|
115
115
|
end() {
|
|
116
116
|
if (this.options.deleteFile && this.fs.exists(this.absAppConfigPath)) {
|
|
117
117
|
deploy_config_generator_shared_1.DeploymentGenerator.logger?.info((0, utils_1.t)('headless.info.deletingApplicationConfigFile', { filepath: this.absAppConfigPath }));
|
|
118
|
-
(0,
|
|
118
|
+
(0, node_fs_1.unlinkSync)(this.absAppConfigPath);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSubGenPrompts = getSubGenPrompts;
|
|
4
4
|
const inquirer_common_1 = require("@sap-ux/inquirer-common");
|
|
5
|
-
const
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const deploy_config_generator_shared_1 = require("@sap-ux/deploy-config-generator-shared");
|
|
8
8
|
const abap_deploy_config_sub_generator_1 = require("@sap-ux/abap-deploy-config-sub-generator");
|
|
@@ -29,7 +29,7 @@ const deploy_target_1 = require("./deploy-target");
|
|
|
29
29
|
*/
|
|
30
30
|
async function getSubGenPrompts(fs, options, { launchDeployConfigAsSubGenerator, launchStandaloneFromYui, promptOptions, supportedTargets, backendConfig, cfDestination, isCap, apiHubConfig, isLibrary }, targetDeployment) {
|
|
31
31
|
deploy_config_generator_shared_1.DeploymentGenerator.logger?.debug((0, utils_1.t)('debug.loadingPrompts'));
|
|
32
|
-
const configExists = fs.exists((0,
|
|
32
|
+
const configExists = fs.exists((0, node_path_1.join)(options.appRootPath, options.config || project_access_1.FileName.UI5DeployYaml));
|
|
33
33
|
const showOverwrite = (0, deploy_config_generator_shared_1.showOverwriteQuestion)(configExists, launchDeployConfigAsSubGenerator, launchStandaloneFromYui, options.overwrite);
|
|
34
34
|
const indexGenerationAllowed = !isLibrary && launchStandaloneFromYui && !(await (0, abap_deploy_config_sub_generator_1.indexHtmlExists)(fs, options.appRootPath));
|
|
35
35
|
let abapPrompts = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBackendConfig = getBackendConfig;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const abap_deploy_config_sub_generator_1 = require("@sap-ux/abap-deploy-config-sub-generator");
|
|
6
6
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
7
7
|
const project_access_1 = require("@sap-ux/project-access");
|
|
@@ -22,7 +22,7 @@ async function getBackendConfig(fs, options, launchStandaloneFromYui, projectRoo
|
|
|
22
22
|
if (launchStandaloneFromYui) {
|
|
23
23
|
// Launched from app modeler where deploy config might already exist
|
|
24
24
|
// need to retrieve backendConfig information.
|
|
25
|
-
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read((0,
|
|
25
|
+
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read((0, node_path_1.join)(projectRoot, options.base ?? project_access_1.FileName.Ui5Yaml)));
|
|
26
26
|
backendConfig = ui5Config.getBackendConfigsFromFioriToolsProxyMiddleware()[0];
|
|
27
27
|
isLibrary = ui5Config.getType() === abap_deploy_config_sub_generator_1.DeployProjectType.Library;
|
|
28
28
|
}
|
|
@@ -7,8 +7,8 @@ exports.getApiHubOptions = getApiHubOptions;
|
|
|
7
7
|
const hasbin = require("hasbin");
|
|
8
8
|
const cf_deploy_config_sub_generator_1 = require("@sap-ux/cf-deploy-config-sub-generator");
|
|
9
9
|
const deploy_config_generator_shared_1 = require("@sap-ux/deploy-config-generator-shared");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
12
|
/**
|
|
13
13
|
* Check if the MTA is installed.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ const path_1 = require("path");
|
|
|
18
18
|
*/
|
|
19
19
|
function isMTAInstalled(choice, projectPath) {
|
|
20
20
|
if ((choice === 'cf' && !hasbin.sync(deploy_config_generator_shared_1.mtaExecutable)) ||
|
|
21
|
-
(choice === 'abap' && !hasbin.sync(deploy_config_generator_shared_1.mtaExecutable) && (0,
|
|
21
|
+
(choice === 'abap' && !hasbin.sync(deploy_config_generator_shared_1.mtaExecutable) && (0, node_fs_1.existsSync)((0, node_path_1.join)(projectPath, 'mta.yaml')))) {
|
|
22
22
|
deploy_config_generator_shared_1.ErrorHandler.getErrorMsgFromType(deploy_config_generator_shared_1.ERROR_TYPE.NO_MTA_BIN);
|
|
23
23
|
return ' ';
|
|
24
24
|
}
|
|
@@ -4,7 +4,7 @@ exports.getSupportedTargets = getSupportedTargets;
|
|
|
4
4
|
const abap_deploy_config_sub_generator_1 = require("@sap-ux/abap-deploy-config-sub-generator");
|
|
5
5
|
const project_access_1 = require("@sap-ux/project-access");
|
|
6
6
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
7
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
9
|
/**
|
|
10
10
|
* Generate a list of targets i.e. CF | ABAP and order based on the project type i.e. library, CF, abap or CAP.
|
|
@@ -19,10 +19,10 @@ const constants_1 = require("./constants");
|
|
|
19
19
|
*/
|
|
20
20
|
async function getSupportedTargets(fs, projectPath, isCap = false, hasMtaConfig = false, apiHubConfig, configFile = project_access_1.FileName.Ui5Yaml) {
|
|
21
21
|
const isApiHubEnt = apiHubConfig?.apiHubType === "API_HUB_ENTERPRISE" /* ApiHubType.apiHubEnterprise */;
|
|
22
|
-
const isProjectExtension = fs.exists((0,
|
|
22
|
+
const isProjectExtension = fs.exists((0, node_path_1.join)(projectPath, '.extconfig.json'));
|
|
23
23
|
let isLibrary = false;
|
|
24
24
|
try {
|
|
25
|
-
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read((0,
|
|
25
|
+
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read((0, node_path_1.join)(projectPath, configFile)));
|
|
26
26
|
isLibrary = ui5Config.getType() === abap_deploy_config_sub_generator_1.DeployProjectType.Library;
|
|
27
27
|
}
|
|
28
28
|
catch {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/deploy-config-sub-generator",
|
|
3
3
|
"description": "Main generator for configuring ABAP or Cloud Foundry deployment configuration",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.20",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"hasbin": "1.2.3",
|
|
25
25
|
"i18next": "25.3.0",
|
|
26
26
|
"yeoman-generator": "5.10.0",
|
|
27
|
-
"@sap-ux/btp-utils": "1.1.
|
|
28
|
-
"@sap-ux/cf-deploy-config-sub-generator": "0.2.
|
|
29
|
-
"@sap-ux/abap-deploy-config-sub-generator": "0.1.
|
|
30
|
-
"@sap-ux/deploy-config-generator-shared": "0.1.
|
|
31
|
-
"@sap-ux/fiori-generator-shared": "0.13.
|
|
32
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
33
|
-
"@sap-ux/odata-service-inquirer": "2.8.
|
|
34
|
-
"@sap-ux/project-access": "1.32.
|
|
35
|
-
"@sap-ux/store": "1.1.
|
|
36
|
-
"@sap-ux/ui5-config": "0.29.
|
|
27
|
+
"@sap-ux/btp-utils": "1.1.4",
|
|
28
|
+
"@sap-ux/cf-deploy-config-sub-generator": "0.2.62",
|
|
29
|
+
"@sap-ux/abap-deploy-config-sub-generator": "0.1.75",
|
|
30
|
+
"@sap-ux/deploy-config-generator-shared": "0.1.40",
|
|
31
|
+
"@sap-ux/fiori-generator-shared": "0.13.21",
|
|
32
|
+
"@sap-ux/inquirer-common": "0.7.48",
|
|
33
|
+
"@sap-ux/odata-service-inquirer": "2.8.9",
|
|
34
|
+
"@sap-ux/project-access": "1.32.3",
|
|
35
|
+
"@sap-ux/store": "1.1.5",
|
|
36
|
+
"@sap-ux/ui5-config": "0.29.7"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/fs-extra": "9.0.13",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"rimraf": "5.0.5",
|
|
52
52
|
"unionfs": "4.4.0",
|
|
53
53
|
"yeoman-test": "6.3.0",
|
|
54
|
-
"@sap-ux/abap-deploy-config-inquirer": "1.6.
|
|
55
|
-
"@sap-ux/cf-deploy-config-inquirer": "0.5.
|
|
56
|
-
"@sap-ux/cf-deploy-config-writer": "0.3.
|
|
57
|
-
"@sap-ux/jest-file-matchers": "0.2.
|
|
54
|
+
"@sap-ux/abap-deploy-config-inquirer": "1.6.26",
|
|
55
|
+
"@sap-ux/cf-deploy-config-inquirer": "0.5.21",
|
|
56
|
+
"@sap-ux/cf-deploy-config-writer": "0.3.30",
|
|
57
|
+
"@sap-ux/jest-file-matchers": "0.2.5"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=20.x"
|