@sap-ux/abap-deploy-config-sub-generator 0.1.62 → 0.1.63

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.
@@ -17,6 +17,7 @@ const i18n_1 = require("../utils/i18n");
17
17
  const feature_toggle_1 = require("@sap-ux/feature-toggle");
18
18
  const btp_utils_1 = require("@sap-ux/btp-utils");
19
19
  const constants_1 = require("@sap-ux/abap-deploy-config-inquirer/dist/constants");
20
+ const project_1 = require("../utils/project");
20
21
  /**
21
22
  * ABAP deploy config generator.
22
23
  */
@@ -237,6 +238,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
237
238
  if (this.abort || this.answers.overwrite === false) {
238
239
  return;
239
240
  }
241
+ const namespace = await (0, project_1.getVariantNamespace)(this.destinationPath(), !!this.answers.isS4HC);
240
242
  await (0, abap_deploy_config_writer_1.generate)(this.destinationPath(), {
241
243
  target: {
242
244
  url: this.answers.url,
@@ -251,7 +253,8 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
251
253
  package: this.answers.package,
252
254
  transport: this.answers.transport
253
255
  },
254
- index: this.answers.index
256
+ index: this.answers.index,
257
+ lrep: namespace
255
258
  }, {
256
259
  baseFile: this.options.base,
257
260
  deployFile: this.options.config
@@ -12,6 +12,7 @@
12
12
  "indexExists": "The `webapp/index.html` file already exists and will not be overwritten.",
13
13
  "initFailed": "Initializing failed. Unable to process the project configuration: {{- error}}",
14
14
  "initTelemetry": "Initializing telemetry in ABAP deployment configuration generator...",
15
- "appRootPath": "Application loaded from: {{- appRootPath}}."
15
+ "appRootPath": "Application loaded from: {{- appRootPath}}.",
16
+ "lrepNamespaceNotFound": "Failed to get the `lrep` namespace: {{- error}}"
16
17
  }
17
18
  }
@@ -7,4 +7,13 @@ import type { Editor } from 'mem-fs-editor';
7
7
  * @returns true if index.html exists
8
8
  */
9
9
  export declare function indexHtmlExists(fs: Editor, path: string): Promise<boolean>;
10
+ /**
11
+ * Get the variant namespace from the manifest.appdescr_variant file.
12
+ * Will return undefined if the project is CloudReady or if the project is not an ADP project.
13
+ *
14
+ * @param path - The path to the project.
15
+ * @param isS4HC - Whether the project is Cloud.
16
+ * @returns The variant namespace.
17
+ */
18
+ export declare function getVariantNamespace(path: string, isS4HC: boolean): Promise<string | undefined>;
10
19
  //# sourceMappingURL=project.d.ts.map
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.indexHtmlExists = indexHtmlExists;
4
+ exports.getVariantNamespace = getVariantNamespace;
4
5
  const project_access_1 = require("@sap-ux/project-access");
5
6
  const path_1 = require("path");
7
+ const fs_1 = require("fs");
8
+ const i18n_1 = require("./i18n");
9
+ const deploy_config_generator_shared_1 = require("@sap-ux/deploy-config-generator-shared");
6
10
  /**
7
11
  * Checks if index.html exists in Fiori project's custom webapp folder path.
8
12
  *
@@ -15,4 +19,29 @@ async function indexHtmlExists(fs, path) {
15
19
  const indexHtmlPath = (0, path_1.join)(customWebappPath, 'index.html');
16
20
  return fs.exists(indexHtmlPath);
17
21
  }
22
+ /**
23
+ * Get the variant namespace from the manifest.appdescr_variant file.
24
+ * Will return undefined if the project is CloudReady or if the project is not an ADP project.
25
+ *
26
+ * @param path - The path to the project.
27
+ * @param isS4HC - Whether the project is Cloud.
28
+ * @returns The variant namespace.
29
+ */
30
+ async function getVariantNamespace(path, isS4HC) {
31
+ if (isS4HC) {
32
+ return undefined;
33
+ }
34
+ try {
35
+ const webappPath = await (0, project_access_1.getWebappPath)(path);
36
+ const filePath = (0, path_1.join)(webappPath, project_access_1.FileName.ManifestAppDescrVar);
37
+ if ((0, fs_1.existsSync)(filePath)) {
38
+ const descriptor = JSON.parse((0, fs_1.readFileSync)(filePath, 'utf-8'));
39
+ return descriptor.namespace;
40
+ }
41
+ }
42
+ catch (e) {
43
+ deploy_config_generator_shared_1.DeploymentGenerator.logger?.debug((0, i18n_1.t)('debug.lrepNamespaceNotFound', { error: e.message }));
44
+ }
45
+ return undefined;
46
+ }
18
47
  //# sourceMappingURL=project.js.map
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/SAP/open-ux-tools.git",
7
7
  "directory": "packages/abap-deploy-config-sub-generator"
8
8
  },
9
- "version": "0.1.62",
9
+ "version": "0.1.63",
10
10
  "license": "Apache-2.0",
11
11
  "main": "generators/app/index.js",
12
12
  "files": [
@@ -21,15 +21,15 @@
21
21
  "dependencies": {
22
22
  "i18next": "25.3.0",
23
23
  "@sap-devx/yeoman-ui-types": "1.14.4",
24
- "@sap-ux/abap-deploy-config-inquirer": "1.6.16",
25
- "@sap-ux/abap-deploy-config-writer": "0.2.11",
24
+ "@sap-ux/abap-deploy-config-inquirer": "1.6.17",
25
+ "@sap-ux/abap-deploy-config-writer": "0.2.12",
26
26
  "@sap-ux/btp-utils": "1.1.1",
27
- "@sap-ux/deploy-config-generator-shared": "0.1.32",
27
+ "@sap-ux/deploy-config-generator-shared": "0.1.33",
28
28
  "@sap-ux/feature-toggle": "0.3.1",
29
- "@sap-ux/fiori-generator-shared": "0.13.13",
29
+ "@sap-ux/fiori-generator-shared": "0.13.14",
30
30
  "@sap-ux/logger": "0.7.0",
31
- "@sap-ux/project-access": "1.30.13",
32
- "@sap-ux/ui5-config": "0.29.3"
31
+ "@sap-ux/project-access": "1.30.14",
32
+ "@sap-ux/ui5-config": "0.29.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/mem-fs": "1.1.2",