@sap-ux/adp-tooling 1.0.14 → 1.0.16

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.
@@ -24,11 +24,14 @@ export declare function updateVariant(basePath: string, variant: DescriptorVaria
24
24
  /**
25
25
  * Checks if FLP configuration changes exist in the manifest.appdescr_variant.
26
26
  *
27
- * This function determines whether there are changes of type `appdescr_app_changeInbound`
28
- * or `appdescr_app_addNewInbound` present in the content of the descriptor variant.
27
+ * This function determines whether there are changes of type `appdescr_app_setInbounds`,
28
+ * `appdescr_app_changeInbound`, or `appdescr_app_addNewInbound` present in the content of the
29
+ * descriptor variant. `appdescr_app_setInbounds` is the change type written by the current
30
+ * cloud-ADP FLP configuration writer; `appdescr_app_changeInbound` and `appdescr_app_addNewInbound`
31
+ * are retained for variants written by older versions of the tooling.
29
32
  *
30
33
  * @param {DescriptorVariant} variant - The descriptor variant object to check for FLP configuration changes.
31
- * @returns {Promise<boolean>} Returns `true` if FLP configuration changes exist, otherwise `false`.
34
+ * @returns {boolean} Returns `true` if FLP configuration changes exist, otherwise `false`.
32
35
  */
33
36
  export declare function flpConfigurationExists(variant: DescriptorVariant): boolean;
34
37
  /**
@@ -30,14 +30,19 @@ export async function updateVariant(basePath, variant, fs) {
30
30
  /**
31
31
  * Checks if FLP configuration changes exist in the manifest.appdescr_variant.
32
32
  *
33
- * This function determines whether there are changes of type `appdescr_app_changeInbound`
34
- * or `appdescr_app_addNewInbound` present in the content of the descriptor variant.
33
+ * This function determines whether there are changes of type `appdescr_app_setInbounds`,
34
+ * `appdescr_app_changeInbound`, or `appdescr_app_addNewInbound` present in the content of the
35
+ * descriptor variant. `appdescr_app_setInbounds` is the change type written by the current
36
+ * cloud-ADP FLP configuration writer; `appdescr_app_changeInbound` and `appdescr_app_addNewInbound`
37
+ * are retained for variants written by older versions of the tooling.
35
38
  *
36
39
  * @param {DescriptorVariant} variant - The descriptor variant object to check for FLP configuration changes.
37
- * @returns {Promise<boolean>} Returns `true` if FLP configuration changes exist, otherwise `false`.
40
+ * @returns {boolean} Returns `true` if FLP configuration changes exist, otherwise `false`.
38
41
  */
39
42
  export function flpConfigurationExists(variant) {
40
- return variant.content?.some(({ changeType }) => changeType === 'appdescr_app_changeInbound' || changeType === 'appdescr_app_addNewInbound');
43
+ return variant.content?.some(({ changeType }) => changeType === 'appdescr_app_setInbounds' ||
44
+ changeType === 'appdescr_app_changeInbound' ||
45
+ changeType === 'appdescr_app_addNewInbound');
41
46
  }
42
47
  /**
43
48
  * Checks whether TypeScript is supported in the project by verifying the existence of `tsconfig.json`.
@@ -48,6 +48,12 @@ export declare class AdpPreview {
48
48
  * @returns merged manifest.
49
49
  */
50
50
  get descriptor(): MergedAppDescriptor;
51
+ /**
52
+ * @returns `true` when the preview was initialized for a Cloud Foundry adaptation
53
+ * project that serves a pre-built bundle from `cfBuildPath`. CF mode skips the
54
+ * backend descriptor merge, so callers must avoid touching `descriptor`/`resources`.
55
+ */
56
+ get isCloudFoundry(): boolean;
51
57
  /**
52
58
  * @returns a list of resources required to the adaptation project as well as the original app.
53
59
  */
@@ -53,6 +53,14 @@ export class AdpPreview {
53
53
  throw new Error('Not initialized');
54
54
  }
55
55
  }
56
+ /**
57
+ * @returns `true` when the preview was initialized for a Cloud Foundry adaptation
58
+ * project that serves a pre-built bundle from `cfBuildPath`. CF mode skips the
59
+ * backend descriptor merge, so callers must avoid touching `descriptor`/`resources`.
60
+ */
61
+ get isCloudFoundry() {
62
+ return 'cfBuildPath' in this.config;
63
+ }
56
64
  /**
57
65
  * @returns a list of resources required to the adaptation project as well as the original app.
58
66
  */
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
12
12
  },
13
- "version": "1.0.14",
13
+ "version": "1.0.16",
14
14
  "license": "Apache-2.0",
15
15
  "author": "@SAP/ux-tools-team",
16
16
  "main": "dist/index.js",