@sap-ux/generator-adp 0.9.17 → 0.9.18

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.
@@ -319,6 +319,7 @@ class default_1 extends yeoman_generator_1.default {
319
319
  const provider = this.jsonInput ? this.abapProvider : this.prompter.provider;
320
320
  const publicVersions = this.jsonInput ? this.publicVersions : this.prompter.ui5.publicVersions;
321
321
  const manifest = this.jsonInput ? this.manifest : this.prompter.manifest;
322
+ const keyUserChanges = this.jsonInput ? this.jsonInput.keyUserChanges : this.keyUserPrompter?.changes;
322
323
  const projectType = this._getProjectType();
323
324
  const packageJson = (0, deps_1.getPackageInfo)();
324
325
  const config = await (0, adp_tooling_1.getConfig)({
@@ -333,7 +334,7 @@ class default_1 extends yeoman_generator_1.default {
333
334
  logger: this.toolsLogger,
334
335
  projectType,
335
336
  toolsId: this.toolsId,
336
- keyUserChanges: this.keyUserPrompter?.changes
337
+ keyUserChanges
337
338
  });
338
339
  if (config.options) {
339
340
  config.options.templatePathOverwrite = (0, templates_1.getTemplatesOverwritePath)();
@@ -2,7 +2,7 @@ import type Generator from 'yeoman-generator';
2
2
  import type { AppWizard, Prompts as YeomanUiSteps } from '@sap-devx/yeoman-ui-types';
3
3
  import type { YUIQuestion } from '@sap-ux/inquirer-common';
4
4
  import type { TelemetryData } from '@sap-ux/fiori-generator-shared';
5
- import type { AdaptationDescriptor, AdaptationProjectType } from '@sap-ux/axios-extension';
5
+ import type { AdaptationDescriptor, AdaptationProjectType, KeyUserChangeContent } from '@sap-ux/axios-extension';
6
6
  import type { AttributesAnswers, ConfigAnswers, FlexLayer } from '@sap-ux/adp-tooling';
7
7
  export interface AdpGeneratorOptions extends Generator.GeneratorOptions {
8
8
  /**
@@ -256,6 +256,7 @@ export interface JsonInput {
256
256
  projectName?: string;
257
257
  namespace?: string;
258
258
  projectType?: AdaptationProjectType;
259
+ keyUserChanges?: KeyUserChangeContent[];
259
260
  }
260
261
  export declare enum SystemType {
261
262
  CLOUD_READY = "cloudReady",
@@ -29,7 +29,8 @@ function isJsonInput(value) {
29
29
  isOptionalString(value.password) &&
30
30
  isOptionalString(value.targetFolder) &&
31
31
  isOptionalString(value.projectName) &&
32
- isOptionalString(value.namespace));
32
+ isOptionalString(value.namespace) &&
33
+ isOptionalKeyUserChanges(value.keyUserChanges));
33
34
  }
34
35
  /**
35
36
  * Type guard for a plain javascript object.
@@ -49,4 +50,21 @@ function isPlainObject(value) {
49
50
  function isOptionalString(value) {
50
51
  return typeof value === 'undefined' || isString(value);
51
52
  }
53
+ /**
54
+ * Type guard for an optional array of key user change content objects.
55
+ *
56
+ * @param {unknown} value - The value being checked.
57
+ * @returns {boolean} True if the value is undefined or a valid array of key user changes.
58
+ */
59
+ function isOptionalKeyUserChanges(value) {
60
+ if (value === undefined) {
61
+ return true;
62
+ }
63
+ if (!Array.isArray(value)) {
64
+ return false;
65
+ }
66
+ return value.every((item) => isPlainObject(item) &&
67
+ isPlainObject(item.content) &&
68
+ (item.texts === undefined || isPlainObject(item.texts)));
69
+ }
52
70
  //# sourceMappingURL=type-guards.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "SAPUI5 Adaptation Project",
4
4
  "homepage": "https://help.sap.com/viewer/584e0bcbfd4a4aff91c815cefa0bce2d/Cloud/en-US/ada9567b767941aba8d49fdb4fdedea7.html",
5
5
  "description": "Adaptation project allows you to create an app variant for an existing SAP Fiori elements-based or SAPUI5 freestyle application, without changing the original application.",
6
- "version": "0.9.17",
6
+ "version": "0.9.18",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/SAP/open-ux-tools.git",