@sap-ux/ui5-proxy-middleware 1.0.7 → 1.0.8
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/package.json +6 -7
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%3Aui5-proxy-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.0.
|
|
12
|
+
"version": "1.0.8",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"files": [
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"ui5.yaml"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@sap-ux/logger": "0.1.
|
|
22
|
-
"@sap-ux/ui5-config": "0.13.
|
|
21
|
+
"@sap-ux/logger": "0.1.6",
|
|
22
|
+
"@sap-ux/ui5-config": "0.13.3",
|
|
23
23
|
"express": "4.17.2",
|
|
24
24
|
"http-proxy-middleware": "2.0.1",
|
|
25
25
|
"https-proxy-agent": "5.0.0",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"dependencies": []
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
|
-
"pnpm": ">=6.26.1",
|
|
40
|
-
"node": ">=12.22.5 < 13.0.0 || >= 14.16.0 < 15.0.0 || >=16.1.0 < 17.0.0"
|
|
39
|
+
"pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
|
|
40
|
+
"node": ">=12.22.5 < 13.0.0 || >= 14.16.0 < 15.0.0 || >=16.1.0 < 17.0.0 || >=18.0.0 < 19.0.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "pnpm clean && tsc",
|
|
@@ -47,6 +47,5 @@
|
|
|
47
47
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
48
48
|
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
49
49
|
"watch": "tsc --watch"
|
|
50
|
-
}
|
|
51
|
-
"readme": "# `@sap-ux/ui5-proxy-middleware`\n\nThe `@sap-ux/ui5-proxy-middleware` is a [Custom UI5 Server Middleware](https://sap.github.io/ui5-tooling/pages/extensibility/CustomServerMiddleware) for loading the UI5 sources in your application. It can be used either with the `ui5 serve` or the `fiori run` commands.\n\n## Configuration Options\n| Option | Default Value | Description |\n| ------------ | ------------- | ----------- |\n| `ui5` | mandatory | List of mount paths and target urls that should be handled by the proxy |\n| `version` | `undefined` | The UI5 version. If this property is not defined, then the `minUI5Version` from the `manifest.json` will be used |\n| `secure` | true | Defines if SSL certs should be verified |\n| `debug` | false | Enables debug output |\n| `proxy` | `undefined` | Use for adding corporate proxy configuration |\n| `directLoad` | false | Defines whether the UI5 sources should be loaded directly from UI5 CDN |\n\n## Usage\nIn order to use the middleware this is the minimal configuration that you need to provide in the `ui5.yaml` of your application.\n\n```Yaml\nserver:\n customMiddleware:\n - name: ui5-proxy-middleware\n afterMiddleware: compression\n configuration:\n ui5:\n - path: /resources\n url: https://ui5.sap.com\n - path: /test-resources\n url: https://ui5.sap.com\n```\n\nAlternatively you can use the following syntax if all paths should be proxied to the same url.\n\n```Yaml\nserver:\n customMiddleware:\n - name: ui5-proxy-middleware\n afterMiddleware: compression\n configuration:\n ui5:\n path: \n - /resources\n - /test-resources\n url: https://ui5.sap.com\n```\n**NOTE: You can't mix both syntaxes!**\n\nFinally don't forget to add the following in your `package.json`.\n\n```JSON\n\"ui5\": {\n \"dependencies\": [\n \"@sap-ux/ui5-proxy-middleware\"\n ]\n}\n```\n\n## Examples\n### Loading a specific UI5 version\nTo load a specific a UI5 version in your application you can use the `version` parameter, e.g.\n\n```Yaml\nserver:\n customMiddleware:\n - name: ui5-proxy-middleware\n afterMiddleware: compression\n configuration:\n ui5:\n - path: /resources\n url: https://ui5.sap.com\n - path: /test-resources\n url: https://ui5.sap.com\n version: 1.96.1\n```\n\n### Loading UI5 sources directly from UI5 CDN\nIf you don't load all UI5 source through the `ui5-proxy-middleware`, then you can set `directLoad: true`. This will inject the absolute UI5 URL in the bootstrap of your HTML file, thus loading the libraries directly from UI5 CDN.\n\n**NOTE: this works only for the default HTML files created by the [Fiori generator](https://www.npmjs.com/package/@sap/generator-fiori) when a project is generated. Hence index.html, flpSandbox.html and flpSandboxMockServer.html!**\n\n```Yaml\nserver:\n customMiddleware:\n - name: ui5-proxy-middleware\n afterMiddleware: compression\n configuration:\n ui5:\n - path: /resources\n url: https://ui5.sap.com\n - path: /test-resources\n url: https://ui5.sap.com\n directLoad: true\n```\n\n### Adding corporate proxy configuration\nIf you are behind a corporate proxy then you can provide your corporate proxy configuration as follows.\n\n```Yaml\nserver:\n customMiddleware:\n - name: ui5-proxy-middleware\n afterMiddleware: compression\n configuration:\n ui5:\n - path: /resources\n url: https://ui5.sap.com\n - path: /test-resources\n url: https://ui5.sap.com\n proxy: https://my.corporate.proxy.example\n```\n\n## Programmatic Usage\nAlternatively you can only use the underlying proxy function, e.g. for the case when you want to incorporate the `ui5-proxy-middleware` functionality in your own middleware.\n\n```Typescript\nimport { ui5Proxy } from '@sap-ux/ui5-proxy-middleware';\nconst ui5ProxyMiddlewareFn = ui5Proxy(config, options, filter)\n```\n- **config** - The UI5 configuration\n- **options** - Options of the [http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware#options)\n- **filter** - a custom function to determine which requests should be proxied or not, [example](https://www.npmjs.com/package/http-proxy-middleware#context-matching)\n\n## Keywords\nUI5 Proxy Middleware\n"
|
|
50
|
+
}
|
|
52
51
|
}
|