@sap-ux/ui5-config
Advanced tools
Comparing version 0.20.0 to 0.21.0
export { UI5Config } from './ui5config'; | ||
export { Configuration, CustomTask, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, FioriToolsServeStaticPath, FioriToolsServeStaticConfig, AbapApp, AbapTarget, AbapDeployConfig, UI5ProxyConfig, UI5ProxyConfigTarget } from './types'; | ||
export { Configuration, CustomTask, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, FioriToolsServeStaticPath, FioriToolsServeStaticConfig, Adp, BspApp, AbapTarget, AbapDeployConfig, UI5ProxyConfig, UI5ProxyConfigTarget } from './types'; | ||
export { UI5_DEFAULT } from './defaults'; | ||
@@ -4,0 +4,0 @@ export { mergeObjects, getEsmTypesVersion, getTypesVersion, getTypesPackage } from './utils'; |
@@ -29,2 +29,3 @@ "use strict"; | ||
function getFioriToolsProxyMiddlewareConfig(backends, ui5) { | ||
var _a, _b; | ||
const fioriToolsProxy = { | ||
@@ -45,3 +46,4 @@ name: 'fiori-tools-proxy', | ||
backends.forEach((element) => { | ||
element.path = element.path || '/'; | ||
var _a; | ||
element.path = (_a = element.path) !== null && _a !== void 0 ? _a : '/'; | ||
}); | ||
@@ -52,4 +54,4 @@ fioriToolsProxy.configuration.backend = backends; | ||
fioriToolsProxy.configuration['ui5'] = { | ||
path: ui5.path || ['/resources', '/test-resources'], | ||
url: ui5.url || 'https://ui5.sap.com' | ||
path: (_a = ui5.path) !== null && _a !== void 0 ? _a : ['/resources', '/test-resources'], | ||
url: (_b = ui5.url) !== null && _b !== void 0 ? _b : 'https://ui5.sap.com' | ||
}; | ||
@@ -75,3 +77,3 @@ if (ui5.version) { | ||
{ | ||
urlPath: path || '', | ||
urlPath: path !== null && path !== void 0 ? path : '', | ||
metadataPath: './webapp/localService/metadata.xml', | ||
@@ -78,0 +80,0 @@ mockdataPath: './webapp/localService/data', |
export * from './ui5yaml'; | ||
export * from './middlewares'; | ||
export interface AbapApp { | ||
export interface BspApp { | ||
name: string; | ||
description: string; | ||
package: string; | ||
transport: string; | ||
description?: string; | ||
transport?: string; | ||
} | ||
export interface AbapTarget { | ||
[key: string]: string | boolean | undefined; | ||
url?: string; | ||
export interface Adp { | ||
package: string; | ||
description?: string; | ||
transport?: string; | ||
} | ||
export interface UrlAbapTarget { | ||
url: string; | ||
client?: string; | ||
destination?: string; | ||
scp?: boolean; | ||
} | ||
export interface DestinationAbapTarget { | ||
destination: string; | ||
} | ||
export type AbapTarget = (UrlAbapTarget & Partial<DestinationAbapTarget>) | (DestinationAbapTarget & Partial<UrlAbapTarget>); | ||
export interface AbapDeployConfig { | ||
target: AbapTarget; | ||
app: AbapApp; | ||
app: BspApp | Adp; | ||
ignoreCertError?: boolean; | ||
@@ -20,0 +27,0 @@ } |
@@ -5,3 +5,3 @@ export interface CustomItem<C> { | ||
} | ||
export interface CustomMiddleware<C> extends CustomItem<C> { | ||
export interface CustomMiddleware<C = unknown> extends CustomItem<C> { | ||
beforeMiddleware?: string; | ||
@@ -11,3 +11,3 @@ afterMiddleware?: string; | ||
} | ||
export interface CustomTask<C> extends CustomItem<C> { | ||
export interface CustomTask<C = unknown> extends CustomItem<C> { | ||
beforeTask?: string; | ||
@@ -14,0 +14,0 @@ afterTask?: string; |
@@ -1,2 +0,2 @@ | ||
import type { AbapApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document } from './types'; | ||
import type { BspApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document, Adp } from './types'; | ||
import type { NodeComment } from '@sap-ux/yaml'; | ||
@@ -53,2 +53,16 @@ /** | ||
/** | ||
* Add a custom configuration to the yaml. | ||
* | ||
* @param key key/name of the custom property | ||
* @param value the properties value | ||
*/ | ||
addCustomConfiguration(key: string, value: object | string): void; | ||
/** | ||
* Get a custom configuration from the yaml. | ||
* | ||
* @param key key/name of the custom property | ||
* @returns the value of the property or undefined | ||
*/ | ||
getCustomConfiguration(key: string): object | string | undefined; | ||
/** | ||
* Adds a UI5 Framework entry to the yaml file. | ||
@@ -126,6 +140,7 @@ * | ||
* @param app application configuration for the deployment to ABAP | ||
* @returns {UI5Config} the UI5Config instance | ||
* @param fioriTools if true use the middleware included in the @sap/ux-ui5-tooling module | ||
* @returns this UI5Config instance | ||
* @memberof UI5Config | ||
*/ | ||
addAbapDeployTask(target: AbapTarget, app: AbapApp): UI5Config; | ||
addAbapDeployTask(target: AbapTarget, app: BspApp | Adp, fioriTools?: boolean): this; | ||
/** | ||
@@ -132,0 +147,0 @@ * Remove a middleware form the UI5 config. |
@@ -92,2 +92,38 @@ "use strict"; | ||
/** | ||
* Add a custom configuration to the yaml. | ||
* | ||
* @param key key/name of the custom property | ||
* @param value the properties value | ||
*/ | ||
addCustomConfiguration(key, value) { | ||
try { | ||
const configNode = this.document.getMap({ path: 'customConfiguration' }); | ||
configNode.setIn([key], value); | ||
} | ||
catch (_error) { | ||
this.document.setIn({ | ||
path: 'customConfiguration', | ||
value: { | ||
[key]: value | ||
} | ||
}); | ||
} | ||
} | ||
/** | ||
* Get a custom configuration from the yaml. | ||
* | ||
* @param key key/name of the custom property | ||
* @returns the value of the property or undefined | ||
*/ | ||
getCustomConfiguration(key) { | ||
var _a, _b; | ||
try { | ||
const node = this.document.getMap({ path: 'customConfiguration' }).get(key); | ||
return (_b = (_a = node === null || node === void 0 ? void 0 : node.toJSON) === null || _a === void 0 ? void 0 : _a.call(node)) !== null && _b !== void 0 ? _b : node === null || node === void 0 ? void 0 : node.toString(); | ||
} | ||
catch (_error) { | ||
return undefined; | ||
} | ||
} | ||
/** | ||
* Adds a UI5 Framework entry to the yaml file. | ||
@@ -223,16 +259,19 @@ * | ||
* @param app application configuration for the deployment to ABAP | ||
* @returns {UI5Config} the UI5Config instance | ||
* @param fioriTools if true use the middleware included in the @sap/ux-ui5-tooling module | ||
* @returns this UI5Config instance | ||
* @memberof UI5Config | ||
*/ | ||
addAbapDeployTask(target, app) { | ||
addAbapDeployTask(target, app, fioriTools = true) { | ||
this.document.appendTo({ | ||
path: 'builder.resources', | ||
value: { | ||
excludes: ['/test/**', '/localService/**'] | ||
} | ||
path: 'builder.resources.excludes', | ||
value: '/test/**' | ||
}); | ||
this.document.appendTo({ | ||
path: 'builder.resources.excludes', | ||
value: '/localService/**' | ||
}); | ||
this.document.appendTo({ | ||
path: 'builder.customTasks', | ||
value: { | ||
name: 'deploy-to-abap', | ||
name: fioriTools ? 'deploy-to-abap' : 'abap-deploy-task', | ||
afterTask: 'generateCachebusterInfo', | ||
@@ -239,0 +278,0 @@ configuration: { target, app } |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"license": "Apache-2.0", | ||
@@ -28,4 +28,2 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"mem-fs": "2.1.0", | ||
"mem-fs-editor": "9.4.0", | ||
"@types/lodash": "4.14.198", | ||
@@ -32,0 +30,0 @@ "@types/semver": "7.5.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53361
2
1015