@sap-ux/adp-tooling 0.18.21 → 0.18.24

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/dist/index.d.ts CHANGED
@@ -17,6 +17,5 @@ export * from './writer/manifest';
17
17
  export * from './writer/writer-config';
18
18
  export { generate, migrate } from './writer';
19
19
  export { generateChange } from './writer/editors';
20
- export { getCustomConfig } from './writer/project-utils';
21
20
  export { generateInboundConfig } from './writer/inbound-navigation';
22
21
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.generateInboundConfig = exports.getCustomConfig = exports.generateChange = exports.migrate = exports.generate = exports.promptGeneratorInput = void 0;
17
+ exports.generateInboundConfig = exports.generateChange = exports.migrate = exports.generate = exports.promptGeneratorInput = void 0;
18
18
  __exportStar(require("./types"), exports);
19
19
  __exportStar(require("./prompts"), exports);
20
20
  __exportStar(require("./common"), exports);
@@ -38,8 +38,6 @@ Object.defineProperty(exports, "generate", { enumerable: true, get: function ()
38
38
  Object.defineProperty(exports, "migrate", { enumerable: true, get: function () { return writer_1.migrate; } });
39
39
  var editors_1 = require("./writer/editors");
40
40
  Object.defineProperty(exports, "generateChange", { enumerable: true, get: function () { return editors_1.generateChange; } });
41
- var project_utils_1 = require("./writer/project-utils");
42
- Object.defineProperty(exports, "getCustomConfig", { enumerable: true, get: function () { return project_utils_1.getCustomConfig; } });
43
41
  var inbound_navigation_1 = require("./writer/inbound-navigation");
44
42
  Object.defineProperty(exports, "generateInboundConfig", { enumerable: true, get: function () { return inbound_navigation_1.generateInboundConfig; } });
45
43
  //# sourceMappingURL=index.js.map
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { UI5FlexLayer, ManifestNamespace, Manifest } from '@sap-ux/project-access';
1
+ import type { UI5FlexLayer, ManifestNamespace, Manifest, Package } from '@sap-ux/project-access';
2
2
  import type { DestinationAbapTarget, UrlAbapTarget } from '@sap-ux/system-access';
3
3
  import type { Adp, BspApp } from '@sap-ux/ui5-config';
4
4
  import type { AxiosRequestConfig, OperationsType } from '@sap-ux/axios-extension';
@@ -946,6 +946,7 @@ export interface CfAdpWriterConfig {
946
946
  path: string;
947
947
  folder: string;
948
948
  };
949
+ customConfig?: CustomConfig;
949
950
  ui5: {
950
951
  version: string;
951
952
  };
@@ -974,6 +975,8 @@ export interface CreateCfConfigParams {
974
975
  projectPath: string;
975
976
  addStandaloneApprouter?: boolean;
976
977
  publicVersions: UI5Version;
978
+ packageJson: Package;
979
+ toolsId: string;
977
980
  }
978
981
  export declare const AppRouterType: {
979
982
  readonly MANAGED: "Managed HTML5 Application Runtime";
@@ -1,5 +1,5 @@
1
1
  import type { UI5Config } from '@sap-ux/ui5-config';
2
- import type { AdpWriterConfig, Content, CloudApp, InternalInboundNavigation, CfAdpWriterConfig } from '../types';
2
+ import type { AdpWriterConfig, Content, CloudApp, InternalInboundNavigation, CfAdpWriterConfig, CustomConfig } from '../types';
3
3
  /**
4
4
  * Generate the configuration for the middlewares required for the ui5.yaml.
5
5
  *
@@ -22,9 +22,9 @@ export declare function enhanceUI5YamlWithCustomTask(ui5Config: UI5Config, confi
22
22
  * Generate custom configuration required for the ui5.yaml.
23
23
  *
24
24
  * @param ui5Config configuration representing the ui5.yaml
25
- * @param config full project configuration
25
+ * @param customConfig custom configuration
26
26
  */
27
- export declare function enhanceUI5YamlWithCustomConfig(ui5Config: UI5Config, config: AdpWriterConfig): void;
27
+ export declare function enhanceUI5YamlWithCustomConfig(ui5Config: UI5Config, customConfig?: CustomConfig): void;
28
28
  /**
29
29
  * Enhances a UI5 YAML configuration with the transpile middleware for TypeScript support.
30
30
  *
@@ -59,10 +59,10 @@ function enhanceUI5YamlWithCustomTask(ui5Config, config) {
59
59
  * Generate custom configuration required for the ui5.yaml.
60
60
  *
61
61
  * @param ui5Config configuration representing the ui5.yaml
62
- * @param config full project configuration
62
+ * @param customConfig custom configuration
63
63
  */
64
- function enhanceUI5YamlWithCustomConfig(ui5Config, config) {
65
- const adp = config.customConfig?.adp;
64
+ function enhanceUI5YamlWithCustomConfig(ui5Config, customConfig) {
65
+ const adp = customConfig?.adp;
66
66
  if (adp) {
67
67
  const { support } = adp;
68
68
  ui5Config.addCustomConfiguration('adp', { support });
@@ -1,7 +1,6 @@
1
1
  import type { Editor } from 'mem-fs-editor';
2
- import { type AdpWriterConfig, type CustomConfig, type TypesConfig, type CfAdpWriterConfig, type DescriptorVariant } from '../types';
2
+ import { type AdpWriterConfig, type TypesConfig, type CfAdpWriterConfig, type DescriptorVariant } from '../types';
3
3
  import type { Package } from '@sap-ux/project-access';
4
- import type { OperationsType } from '@sap-ux/axios-extension';
5
4
  /**
6
5
  * Retrieves the package name and version from the package.json file located two levels up the directory tree.
7
6
  *
@@ -19,16 +18,6 @@ export declare function getPackageJSONInfo(): Package;
19
18
  * @returns {TypesConfig} - The package name and version string for the UI5 types.
20
19
  */
21
20
  export declare function getTypes(ui5Version?: string): TypesConfig;
22
- /**
23
- * Constructs a custom configuration object for the Adaptation Project (ADP).
24
- *
25
- * @param {OperationsType} environment - The operations type ('P' for on-premise or 'C' for cloud ready).
26
- * @param {object} pkg - The parsed contents of `package.json`.
27
- * @param {string} pkg.name - The name of the tool or package generating the config.
28
- * @param {string} pkg.version - The version of the tool generating the config.
29
- * @returns {CustomConfig} The generated ADP custom configuration object.
30
- */
31
- export declare function getCustomConfig(environment: OperationsType, { name: id, version }: Package): CustomConfig;
32
21
  /**
33
22
  * Get the variant for the CF project.
34
23
  *
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPackageJSONInfo = getPackageJSONInfo;
4
4
  exports.getTypes = getTypes;
5
- exports.getCustomConfig = getCustomConfig;
6
5
  exports.getCfVariant = getCfVariant;
7
6
  exports.writeTemplateToFolder = writeTemplateToFolder;
8
7
  exports.writeUI5Yaml = writeUI5Yaml;
@@ -11,7 +10,6 @@ exports.writeUI5DeployYaml = writeUI5DeployYaml;
11
10
  exports.writeCfTemplates = writeCfTemplates;
12
11
  const node_path_1 = require("node:path");
13
12
  const node_fs_1 = require("node:fs");
14
- const uuid_1 = require("uuid");
15
13
  const options_1 = require("./options");
16
14
  const ui5_config_1 = require("@sap-ux/ui5-config");
17
15
  /**
@@ -56,27 +54,6 @@ function getTypes(ui5Version) {
56
54
  typesVersion
57
55
  };
58
56
  }
59
- /**
60
- * Constructs a custom configuration object for the Adaptation Project (ADP).
61
- *
62
- * @param {OperationsType} environment - The operations type ('P' for on-premise or 'C' for cloud ready).
63
- * @param {object} pkg - The parsed contents of `package.json`.
64
- * @param {string} pkg.name - The name of the tool or package generating the config.
65
- * @param {string} pkg.version - The version of the tool generating the config.
66
- * @returns {CustomConfig} The generated ADP custom configuration object.
67
- */
68
- function getCustomConfig(environment, { name: id, version }) {
69
- return {
70
- adp: {
71
- environment,
72
- support: {
73
- id: id ?? '',
74
- version: version ?? '',
75
- toolsId: (0, uuid_1.v4)()
76
- }
77
- }
78
- };
79
- }
80
57
  /**
81
58
  * Get the variant for the CF project.
82
59
  *
@@ -152,7 +129,7 @@ async function writeUI5Yaml(projectPath, data, fs) {
152
129
  const baseUi5ConfigContent = fs.read(ui5ConfigPath);
153
130
  const ui5Config = await ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
154
131
  ui5Config.setConfiguration({ propertiesFileSourceEncoding: 'UTF-8' });
155
- (0, options_1.enhanceUI5YamlWithCustomConfig)(ui5Config, data);
132
+ (0, options_1.enhanceUI5YamlWithCustomConfig)(ui5Config, data.customConfig);
156
133
  (0, options_1.enhanceUI5YamlWithTranspileMiddleware)(ui5Config, data);
157
134
  (0, options_1.enhanceUI5Yaml)(ui5Config, data);
158
135
  (0, options_1.enhanceUI5YamlWithCustomTask)(ui5Config, data);
@@ -176,6 +153,7 @@ async function writeCfUI5Yaml(projectPath, data, fs) {
176
153
  const baseUi5ConfigContent = fs.read(ui5ConfigPath);
177
154
  const ui5Config = await ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
178
155
  ui5Config.setConfiguration({ propertiesFileSourceEncoding: 'UTF-8' });
156
+ (0, options_1.enhanceUI5YamlWithCustomConfig)(ui5Config, data.customConfig);
179
157
  /** Builder task */
180
158
  (0, options_1.enhanceUI5YamlWithCfCustomTask)(ui5Config, data);
181
159
  /** Middlewares */
@@ -40,6 +40,10 @@ export interface ConfigOptions {
40
40
  * Logger instance for debugging and error reporting.
41
41
  */
42
42
  logger: ToolsLogger;
43
+ /**
44
+ * The tools ID.
45
+ */
46
+ toolsId: string;
43
47
  }
44
48
  /**
45
49
  * Generates the configuration object for the Adaptation Project.
@@ -6,7 +6,6 @@ exports.getCfConfig = getCfConfig;
6
6
  const node_path_1 = require("node:path");
7
7
  const ui5_1 = require("../ui5");
8
8
  const abap_1 = require("../abap");
9
- const project_utils_1 = require("./project-utils");
10
9
  const types_1 = require("../types");
11
10
  const i18n_1 = require("../i18n");
12
11
  /**
@@ -23,11 +22,10 @@ const i18n_1 = require("../i18n");
23
22
  * @returns {Promise<AdpWriterConfig>} A promise that resolves to the generated ADP writer configuration.
24
23
  */
25
24
  async function getConfig(options) {
26
- const { configAnswers, attributeAnswers, layer, logger, packageJson, provider, publicVersions, systemVersion, manifest } = options;
25
+ const { configAnswers, attributeAnswers, layer, logger, packageJson, provider, publicVersions, systemVersion, manifest, toolsId } = options;
27
26
  const ato = await provider.getAtoInfo();
28
27
  const operationsType = ato.operationsType ?? 'P';
29
28
  const target = await (0, abap_1.getProviderConfig)(configAnswers.system, logger);
30
- const customConfig = (0, project_utils_1.getCustomConfig)(operationsType, packageJson);
31
29
  const isCloudProject = await provider.isAbapCloud();
32
30
  const isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
33
31
  const ui5Version = isCloudProject
@@ -56,7 +54,16 @@ async function getConfig(options) {
56
54
  return {
57
55
  app,
58
56
  ui5,
59
- customConfig,
57
+ customConfig: {
58
+ adp: {
59
+ environment: operationsType,
60
+ support: {
61
+ id: packageJson.name ?? '',
62
+ version: packageJson.version ?? '',
63
+ toolsId
64
+ }
65
+ }
66
+ },
60
67
  target,
61
68
  options: {
62
69
  fioriTools: true,
@@ -118,6 +125,15 @@ function getCfConfig(params) {
118
125
  path: params.projectPath,
119
126
  folder: (0, node_path_1.join)(params.projectPath, params.attributeAnswers.projectName)
120
127
  },
128
+ customConfig: {
129
+ adp: {
130
+ support: {
131
+ id: params.packageJson?.name ?? '',
132
+ version: params.packageJson?.version ?? '',
133
+ toolsId: params.toolsId ?? ''
134
+ }
135
+ }
136
+ },
121
137
  ui5: {
122
138
  version: ui5Version
123
139
  },
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
11
11
  },
12
- "version": "0.18.21",
12
+ "version": "0.18.24",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -36,17 +36,17 @@
36
36
  "prompts": "2.4.2",
37
37
  "sanitize-filename": "1.6.3",
38
38
  "uuid": "10.0.0",
39
- "@sap-ux/axios-extension": "1.24.6",
39
+ "@sap-ux/axios-extension": "1.25.0",
40
40
  "@sap-ux/btp-utils": "1.1.6",
41
41
  "@sap-ux/i18n": "0.3.6",
42
- "@sap-ux/inquirer-common": "0.9.16",
42
+ "@sap-ux/inquirer-common": "0.10.0",
43
43
  "@sap-ux/logger": "0.7.2",
44
44
  "@sap-ux/nodejs-utils": "0.2.10",
45
- "@sap-ux/odata-service-writer": "0.27.38",
45
+ "@sap-ux/odata-service-writer": "0.28.0",
46
46
  "@sap-ux/project-access": "1.32.16",
47
47
  "@sap-ux/project-input-validator": "0.6.38",
48
- "@sap-ux/store": "1.3.5",
49
- "@sap-ux/system-access": "0.6.32",
48
+ "@sap-ux/store": "1.4.0",
49
+ "@sap-ux/system-access": "0.6.34",
50
50
  "@sap-ux/ui5-config": "0.29.11",
51
51
  "@sap-ux/ui5-info": "0.13.4"
52
52
  },
@@ -68,7 +68,7 @@
68
68
  "nock": "13.4.0",
69
69
  "rimraf": "6.0.1",
70
70
  "supertest": "7.1.4",
71
- "@sap-ux/store": "1.3.5"
71
+ "@sap-ux/store": "1.4.0"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=20.x"