@sap-ux/adp-tooling 0.14.16 → 0.14.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.
package/dist/types.d.ts CHANGED
@@ -111,6 +111,8 @@ export interface AttributesAnswers {
111
111
  targetFolder: string;
112
112
  ui5Version: string;
113
113
  enableTypeScript: boolean;
114
+ addDeployConfig?: boolean;
115
+ addFlpConfig?: boolean;
114
116
  }
115
117
  export interface SourceApplication {
116
118
  id: string;
@@ -1,11 +1,13 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
1
2
  import type { UI5Version } from '../types';
2
3
  /**
3
4
  * Fetches public UI5 version data from the SAP CDN.
4
5
  *
5
- * @returns {Promise<UI5Version>} A promise that resolves to the UI5 version data object.
6
- * @throws Will throw an error if the fetch fails.
6
+ * @param {ToolsLogger} logger - Optional logger instance.
7
+ * @returns {Promise<UI5Version>} A promise that resolves to the UI5 version data object if request completes.
8
+ * Otherwise, returns fallback ui5 versions.
7
9
  */
8
- export declare function fetchPublicVersions(): Promise<UI5Version>;
10
+ export declare function fetchPublicVersions(logger?: ToolsLogger): Promise<UI5Version>;
9
11
  /**
10
12
  * Fetches internal UI5 versions from the Neo CDN and maps them to formatted version strings.
11
13
  *
package/dist/ui5/fetch.js CHANGED
@@ -2,19 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchPublicVersions = fetchPublicVersions;
4
4
  exports.fetchInternalVersions = fetchInternalVersions;
5
+ const format_1 = require("./format");
5
6
  const constants_1 = require("../base/constants");
6
7
  /**
7
8
  * Fetches public UI5 version data from the SAP CDN.
8
9
  *
9
- * @returns {Promise<UI5Version>} A promise that resolves to the UI5 version data object.
10
- * @throws Will throw an error if the fetch fails.
10
+ * @param {ToolsLogger} logger - Optional logger instance.
11
+ * @returns {Promise<UI5Version>} A promise that resolves to the UI5 version data object if request completes.
12
+ * Otherwise, returns fallback ui5 versions.
11
13
  */
12
- async function fetchPublicVersions() {
13
- const response = await fetch(constants_1.UI5_VERSIONS_CDN_URL);
14
- if (!response.ok) {
15
- throw new Error(`Failed to fetch public UI5 versions. Status: ${response.status}`);
14
+ async function fetchPublicVersions(logger) {
15
+ try {
16
+ const response = await fetch(constants_1.UI5_VERSIONS_CDN_URL);
17
+ if (!response.ok) {
18
+ throw new Error(`Failed to fetch public UI5 versions. Status: ${response.status}`);
19
+ }
20
+ return (await response.json());
21
+ }
22
+ catch (e) {
23
+ logger?.warn('[ui5-info] Falling back to built-in UI5 version list: ' + (e instanceof Error ? e.message : String(e)));
24
+ return (0, format_1.buildFallbackMap)();
16
25
  }
17
- return response.json();
18
26
  }
19
27
  /**
20
28
  * Fetches internal UI5 versions from the Neo CDN and maps them to formatted version strings.
@@ -1,3 +1,4 @@
1
+ import type { UI5Version } from '../types';
1
2
  /**
2
3
  * Gets the official base URL for SAP UI5 resources based on the version information.
3
4
  * If the version includes 'snapshot', it returns a preview URL; otherwise, it returns the main SAP UI5 CDN URL.
@@ -77,4 +78,11 @@ export declare function parseUI5Version(version: string): {
77
78
  * @returns {boolean} - Returns true if the current version supports the feature, false otherwise.
78
79
  */
79
80
  export declare function isFeatureSupportedVersion(featureVersion: string, version?: string): boolean;
81
+ /**
82
+ * Build a `UI5Version` from the curated fallback list
83
+ * that ships with **@sap-ux/ui5-info**.
84
+ *
85
+ * @returns {UI5Version} An object whose keys are the version strings (e.g. `"1.135.0"`).
86
+ */
87
+ export declare function buildFallbackMap(): UI5Version;
80
88
  //# sourceMappingURL=format.d.ts.map
@@ -9,6 +9,8 @@ exports.removeTimestampFromVersion = removeTimestampFromVersion;
9
9
  exports.addSnapshot = addSnapshot;
10
10
  exports.parseUI5Version = parseUI5Version;
11
11
  exports.isFeatureSupportedVersion = isFeatureSupportedVersion;
12
+ exports.buildFallbackMap = buildFallbackMap;
13
+ const ui5_info_1 = require("@sap-ux/ui5-info");
12
14
  const constants_1 = require("../base/constants");
13
15
  /**
14
16
  * Gets the official base URL for SAP UI5 resources based on the version information.
@@ -124,12 +126,38 @@ function isFeatureSupportedVersion(featureVersion, version) {
124
126
  if (isNaN(major) && isNaN(minor) && isNaN(patch)) {
125
127
  return true;
126
128
  }
127
- if (major > featMajorVersion) {
128
- return true;
129
+ if (major !== featMajorVersion) {
130
+ return major > featMajorVersion;
129
131
  }
130
- else if (minor < featMinorVersion) {
131
- return false;
132
+ if (minor !== featMinorVersion) {
133
+ return minor > featMinorVersion;
132
134
  }
133
135
  return patch >= featPatchVersion;
134
136
  }
137
+ /**
138
+ * Convert a supported UI5 version entry to a `VersionDetail`.
139
+ *
140
+ * @param {SupportedUi5VersionEntry} entry - An entry from the supported fallback list.
141
+ * @returns {VersionDetail} A normalized version detail object.
142
+ */
143
+ function toVersionDetail(entry) {
144
+ return {
145
+ version: entry.version,
146
+ support: entry.support ?? '',
147
+ lts: !!entry.lts
148
+ };
149
+ }
150
+ /**
151
+ * Build a `UI5Version` from the curated fallback list
152
+ * that ships with **@sap-ux/ui5-info**.
153
+ *
154
+ * @returns {UI5Version} An object whose keys are the version strings (e.g. `"1.135.0"`).
155
+ */
156
+ function buildFallbackMap() {
157
+ const latest = toVersionDetail(ui5_info_1.supportedUi5VersionFallbacks[0]);
158
+ return ui5_info_1.supportedUi5VersionFallbacks.reduce((acc, entry) => {
159
+ acc[entry.version] = toVersionDetail(entry);
160
+ return acc;
161
+ }, { latest });
162
+ }
135
163
  //# sourceMappingURL=format.js.map
@@ -109,7 +109,7 @@ function checkSystemVersionPattern(version) {
109
109
  */
110
110
  async function getInternalVersions(latestVersion) {
111
111
  const releasedVersions = await (0, fetch_1.fetchInternalVersions)(latestVersion);
112
- return releasedVersions.filter((version) => (0, format_1.isFeatureSupportedVersion)(version, '1.71.0'));
112
+ return releasedVersions.filter((version) => (0, format_1.isFeatureSupportedVersion)('1.71.0', version));
113
113
  }
114
114
  /**
115
115
  * Fetches versions that are higher than the specified version.
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.14.16",
12
+ "version": "0.14.18",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -32,14 +32,15 @@
32
32
  "prompts": "2.4.2",
33
33
  "sanitize-filename": "1.6.3",
34
34
  "uuid": "10.0.0",
35
- "@sap-ux/axios-extension": "1.21.2",
35
+ "@sap-ux/axios-extension": "1.21.3",
36
36
  "@sap-ux/btp-utils": "1.1.0",
37
37
  "@sap-ux/inquirer-common": "0.7.9",
38
38
  "@sap-ux/logger": "0.7.0",
39
39
  "@sap-ux/project-access": "1.30.2",
40
40
  "@sap-ux/project-input-validator": "0.6.2",
41
- "@sap-ux/system-access": "0.6.2",
41
+ "@sap-ux/system-access": "0.6.3",
42
42
  "@sap-ux/ui5-config": "0.28.2",
43
+ "@sap-ux/ui5-info": "0.11.0",
43
44
  "@sap-ux/odata-service-writer": "0.27.5",
44
45
  "@sap-ux/nodejs-utils": "0.2.1",
45
46
  "@sap-ux/i18n": "0.3.0",