@sap-ux/abap-deploy-config-sub-generator 0.1.148 → 0.2.2

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.
@@ -15,6 +15,7 @@ export default class extends DeploymentGenerator {
15
15
  private configExists;
16
16
  private answers;
17
17
  private projectType;
18
+ private adpProjectType?;
18
19
  private isAdp;
19
20
  /**
20
21
  * Constructor for the ABAP deploy config generator.
@@ -18,6 +18,8 @@ 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
20
  const project_1 = require("../utils/project");
21
+ const adp_tooling_1 = require("@sap-ux/adp-tooling");
22
+ const axios_extension_1 = require("@sap-ux/axios-extension");
21
23
  /**
22
24
  * ABAP deploy config generator.
23
25
  */
@@ -32,6 +34,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
32
34
  configExists;
33
35
  answers;
34
36
  projectType;
37
+ adpProjectType;
35
38
  isAdp;
36
39
  /**
37
40
  * Constructor for the ABAP deploy config generator.
@@ -43,6 +46,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
43
46
  super(args, opts);
44
47
  this.launchDeployConfigAsSubGenerator = opts.launchDeployConfigAsSubGenerator ?? false;
45
48
  this.launchStandaloneFromYui = opts.launchStandaloneFromYui;
49
+ this.adpProjectType = opts.adpProjectType;
46
50
  this.appWizard = opts.appWizard || yeoman_ui_types_1.AppWizard.create(opts);
47
51
  this.vscode = opts.vscode;
48
52
  this.options = opts;
@@ -62,6 +66,11 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
62
66
  (0, fiori_generator_shared_1.setYeomanEnvConflicterForce)(this.env, this.options.force);
63
67
  if (!this.launchDeployConfigAsSubGenerator) {
64
68
  await this._initializing();
69
+ // NOTE: This _initializing() method is called here when the generator is started as standalone generator.
70
+ // In the writing phase the same method is called when the generator is started as a sub-generator.
71
+ // This casues the adpProjectType field to be overriden with undefined in case the generator is started as
72
+ // sub-generator, that's why we leave the initialization out of the _initializing() method.
73
+ this.adpProjectType = await (0, adp_tooling_1.getExistingAdpProjectType)(this.destinationRoot());
65
74
  }
66
75
  }
67
76
  _initDestinationRoot() {
@@ -138,16 +147,17 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
138
147
  shouldValidatePackageType: this.isAdp,
139
148
  shouldValidateFormatAndSpecialCharacters: this.isAdp
140
149
  };
150
+ const hideIfOnPremise = this.adpProjectType === axios_extension_1.AdaptationProjectType.ON_PREMISE;
141
151
  const promptOptions = {
142
- ui5AbapRepo: { hideIfOnPremise: this.isAdp },
143
- transportInputChoice: { hideIfOnPremise: this.isAdp },
152
+ ui5AbapRepo: { hideIfOnPremise },
153
+ transportInputChoice: { hideIfOnPremise },
144
154
  packageAutocomplete: {
145
155
  additionalValidation: packageAdditionalValidation
146
156
  },
147
157
  packageManual: {
148
158
  additionalValidation: packageAdditionalValidation
149
159
  },
150
- targetSystem: { additionalValidation: { shouldRestrictDifferentSystemType: this.isAdp } }
160
+ adpProjectType: this.adpProjectType
151
161
  };
152
162
  const indexGenerationAllowed = this.indexGenerationAllowed && !this.isAdp;
153
163
  const { prompts: abapDeployConfigPrompts, answers: abapAnswers = {} } = await (0, questions_1.getAbapQuestions)({
@@ -235,7 +245,8 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
235
245
  if (this.abort || this.answers.overwrite === false) {
236
246
  return;
237
247
  }
238
- const namespace = await (0, project_1.getVariantNamespace)(this.destinationPath(), !!this.answers.isAbapCloud, this.fs);
248
+ const isCloudAdpProject = this.adpProjectType === axios_extension_1.AdaptationProjectType.CLOUD_READY;
249
+ const namespace = await (0, project_1.getVariantNamespace)(this.destinationPath(), isCloudAdpProject, this.fs);
239
250
  await (0, abap_deploy_config_writer_1.generate)(this.destinationPath(), {
240
251
  target: {
241
252
  url: this.answers.url,
@@ -90,6 +90,7 @@ async function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, c
90
90
  serviceProvider,
91
91
  type: projectType
92
92
  },
93
+ adpProjectType: promptOptions.adpProjectType,
93
94
  ui5AbapRepo: {
94
95
  default: deployAppConfig?.name,
95
96
  ...promptOptions?.ui5AbapRepo
@@ -106,8 +107,7 @@ async function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, c
106
107
  ...promptOptions?.packageAutocomplete
107
108
  },
108
109
  overwriteAbapConfig: { hide: !showOverwriteQuestion },
109
- transportInputChoice: { hideIfOnPremise: promptOptions?.transportInputChoice?.hideIfOnPremise ?? false },
110
- targetSystem: promptOptions?.targetSystem
110
+ transportInputChoice: { hideIfOnPremise: promptOptions?.transportInputChoice?.hideIfOnPremise ?? false }
111
111
  }, logger, (0, fiori_generator_shared_1.getHostEnvironment)() !== fiori_generator_shared_1.hostEnvironment.cli);
112
112
  }
113
113
  //# sourceMappingURL=questions.js.map
@@ -2,6 +2,7 @@ import type { AbapDeployConfigAnswersInternal, AbapDeployConfigPromptOptions } f
2
2
  import type { AppWizard } from '@sap-devx/yeoman-ui-types';
3
3
  import type { ConnectedSystem } from '@sap-ux/deploy-config-generator-shared';
4
4
  import type { TelemetryData } from '@sap-ux/fiori-generator-shared';
5
+ import type { AdaptationProjectType } from '@sap-ux/axios-extension';
5
6
  export interface AbapDeployConfigOptions extends AbapDeployConfigAnswersInternal {
6
7
  /**
7
8
  * VSCode instance
@@ -51,6 +52,10 @@ export interface AbapDeployConfigOptions extends AbapDeployConfigAnswersInternal
51
52
  * Prompts options for the ABAP deploy config inquirer
52
53
  */
53
54
  promptOptions?: AbapDeployConfigPromptOptions;
55
+ /**
56
+ * The type of the adaptation project.
57
+ */
58
+ adpProjectType?: AdaptationProjectType;
54
59
  }
55
60
  export declare enum DeployProjectType {
56
61
  Application = "application",
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.148",
9
+ "version": "0.2.2",
10
10
  "license": "Apache-2.0",
11
11
  "main": "generators/app/index.js",
12
12
  "files": [
@@ -21,15 +21,17 @@
21
21
  "dependencies": {
22
22
  "i18next": "25.8.0",
23
23
  "@sap-devx/yeoman-ui-types": "1.14.4",
24
- "@sap-ux/abap-deploy-config-inquirer": "1.6.99",
25
- "@sap-ux/abap-deploy-config-writer": "0.2.72",
26
- "@sap-ux/btp-utils": "1.1.8",
27
- "@sap-ux/deploy-config-generator-shared": "0.1.90",
24
+ "@sap-ux/abap-deploy-config-inquirer": "1.7.2",
25
+ "@sap-ux/abap-deploy-config-writer": "0.2.75",
26
+ "@sap-ux/btp-utils": "1.1.9",
27
+ "@sap-ux/deploy-config-generator-shared": "0.1.93",
28
28
  "@sap-ux/feature-toggle": "0.3.6",
29
- "@sap-ux/fiori-generator-shared": "0.13.71",
29
+ "@sap-ux/fiori-generator-shared": "0.13.74",
30
30
  "@sap-ux/logger": "0.8.1",
31
- "@sap-ux/project-access": "1.35.3",
32
- "@sap-ux/ui5-config": "0.29.16"
31
+ "@sap-ux/project-access": "1.35.5",
32
+ "@sap-ux/ui5-config": "0.29.17",
33
+ "@sap-ux/adp-tooling": "0.18.66",
34
+ "@sap-ux/axios-extension": "1.25.14"
33
35
  },
34
36
  "devDependencies": {
35
37
  "@types/mem-fs": "1.1.2",
@@ -40,8 +42,8 @@
40
42
  "unionfs": "4.4.0",
41
43
  "yeoman-test": "6.3.0",
42
44
  "@sap-ux/store": "1.5.6",
43
- "@sap-ux/system-access": "0.6.51",
44
- "@sap-ux/telemetry": "0.6.72"
45
+ "@sap-ux/system-access": "0.6.54",
46
+ "@sap-ux/telemetry": "0.6.75"
45
47
  },
46
48
  "scripts": {
47
49
  "build": "tsc --build",