Code Monkey home page Code Monkey logo

ui5-ecosystem-showcase's Introduction

we're UI5, folks!

This is the head space of the UI5 community.

ui5-ecosystem-showcase's People

Contributors

attila-boros avatar dependabot-preview[bot] avatar dependabot[bot] avatar dominikfeininger avatar hannaolb avatar heimwege avatar l4ndoo avatar lboehm avatar lemaiwo avatar lennart-m avatar lucawun avatar magoli1 avatar marcelschork avatar marianfoo avatar matz3 avatar mauriciolauffer avatar maxmoehl avatar menof36go avatar nicoschoenteich avatar nlaenger avatar pavelnikitsiuk avatar petermuessig avatar piejanssens avatar randombyte avatar resitamas avatar sebbi08 avatar stockbal avatar thevivekgowda avatar uxkjaer avatar vobu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui5-ecosystem-showcase's Issues

Dynamic port for ui5-middleware-livereload

I develop several applications and use the ui5-middleware-livereload. I very often encounter the problem that I am not able to start an application because the port which I set for the livereload server is already used by another application's livereload server. I know that it is possible to set different ports, but for that I have to remember which ports have already been taken. It think this is not really flexible.

What do you think about a feature that in case this port is not set explicitly then it is set automatically to one which is not yet used?

ui5-task-zipper error when zipping with ushell library added

Expected Behavior

Can run the ui5-task-zipper as part of the build process without it failing, when the ushell library is added

Current Behavior

when running the ui5-task-zipper if the library ushell has been added the following error occurs, preventing the creation of the zip until that library is removed. This was previously working however I updated my UI5 version and UI5 CLI versions today, so I assume it is one of those which has caused this.

"Couldn't add all resources to the archive: Error: absolute path: /test-resources/sap/ushell/bootstrap/sandbox.js"

Steps to Reproduce the Issue

  1. In your ui5.yaml add the library ushell (it does not matter if it is flagged as a development only library, the behaviour is the same)
  2. Also add the ui5-task-zipper
  3. Attempt to build the UI5 app, and receive the error as described
  4. Remove the ushell module and build again and it builds successfully

Context

  • SAPUI5 Version: 1.84.3
  • UI5 Module Version (output of ui5 --version when using the CLI): 2.7.0
  • Node.js Version: 12.16.1
  • npm Version: 6.14.8
  • OS/Platform: MacOS Catalina 10.15.7
  • Browser (if relevant): NA
  • Other information regarding your environment (optional): I am using nvm, although this has never mattered in the past

Workaround?

Yes, the workaround is to either remove the ushell library when building for deployment, or use a separate config file for developing and building

ui5.yaml file

specVersion: "2.2"
metadata:
  name: capture
type: application
resources:
  configuration:
    paths:
      webapp: webapp
framework:
  name: SAPUI5
  version: 1.84.3
  libraries:
    - name: sap.ui.core
    - name: sap.m
    - name: sap.ui.layout
    - name: sap.ushell
      development: true
    - name: themelib_sap_fiori_3
server:
  customMiddleware:
    - name: ui5-middleware-livereload
      afterMiddleware: compression
      configuration:
        port: 35729
        path: webapp
    - name: ui5-middleware-simpleproxy
      mountPath: /v2/example
      afterMiddleware: compression
      configuration:
        baseUri: http://localhost:4004/v2/example
builder:
  resources:
    excludes:
      - "/test/**"
      - "/test-resources/**"
  customTasks:
    - name: "ui5-task-zipper"
      afterTask: "uglify"
      configuration:
        archiveName: "captureui"
        keepResources: true

Log Output / Stack Trace

npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/Users/<removed>/.nvm/versions/node/v12.16.1/bin/node',
npm verb cli   '/Users/<removed>/.nvm/versions/node/v12.16.1/bin/npm',
npm verb cli   'run',
npm verb cli   'build:ui',
npm verb cli   '--verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm verb run-script [ 'prebuild:ui', 'build:ui', 'postbuild:ui' ]
npm info lifecycle [email protected]~prebuild:ui: [email protected]
npm info lifecycle [email protected]~build:ui: [email protected]

> [email protected] build:ui /Users/<removed>/dev/NGN/audit-apps/capture
> run-s  build:uimodule

npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/Users/<removed>/.nvm/versions/node/v12.16.1/bin/node',
npm verb cli   '/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/bin/npm-cli.js',
npm verb cli   'run',
npm verb cli   'build:uimodule'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm verb run-script [ 'prebuild:uimodule', 'build:uimodule', 'postbuild:uimodule' ]
npm info lifecycle [email protected]~prebuild:uimodule: [email protected]
npm info lifecycle [email protected]~build:uimodule: [email protected]

> [email protected] build:uimodule /Users/<removed>/capture
> ui5 build --config=ui5.yaml --clean-dest --dest dist --include-task=generateManifestBundle generateAppPreload

info normalizer:translators:ui5Framework Using SAPUI5 version: 1.84.3
info builder:builder Building project capture not including dependencies...
info builder:builder ๐Ÿ›   (1/1) Building project capture
info builder:builder application capture ๐Ÿ”จ (1/10) Running task escapeNonAsciiCharacters...
info builder:builder application capture ๐Ÿ”จ (2/10) Running task replaceCopyright...
info builder:builder application capture ๐Ÿ”จ (3/10) Running task replaceVersion...
info builder:builder application capture ๐Ÿ”จ (4/10) Running task generateFlexChangesBundle...
info builder:builder application capture ๐Ÿ”จ (5/10) Running task generateManifestBundle...
info builder:builder application capture ๐Ÿ”จ (6/10) Running task generateComponentPreload...
info builder:builder application capture ๐Ÿ”จ (7/10) Running task createDebugFiles...
info builder:builder application capture ๐Ÿ”จ (8/10) Running task uglify...
info builder:builder application capture ๐Ÿ”จ (9/10) Running task ui5-task-zipper...
ERR! builder:customtask:zipper Couldn't add all resources to the archive: Error: absolute path: /test-resources/sap/ushell/bootstrap/sandbox.js
ERR! builder:builder Build failed in 2.57 s
info builder:builder Executing cleanup tasks...

โš ๏ธ  Process Failed With Error

Error Message:
absolute path: /test-resources/sap/ushell/bootstrap/sandbox.js

For details, execute the same command again with an additional '--verbose' parameter
npm verb lifecycle [email protected]~build:uimodule: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~build:uimodule: PATH: /Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/<removed>/capture/node_modules/.bin:/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/<removed>/capture/node_modules/.bin:/Users/<removed>/.nvm/versions/node/v12.16.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/<removed>/Library/Android/sdk/emulator:/Users/<removed>/Library/Android/sdk/tools:/Users/<removed>/Library/Android/sdk/platform-tools:/Users/<removed>/Library/Android/sdk/cmdline-tools/latest/bin
npm verb lifecycle [email protected]~build:uimodule: CWD: /Users/<removed>/capture
npm info lifecycle [email protected]~build:uimodule: Failed to exec build:uimodule script
npm verb stack Error: [email protected] build:uimodule: `ui5 build --config=ui5.yaml --clean-dest --dest dist --include-task=generateManifestBundle generateAppPreload`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:311:20)
npm verb stack     at ChildProcess.<anonymous> (/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:311:20)
npm verb stack     at maybeClose (internal/child_process.js:1021:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm verb pkgid [email protected]
npm verb cwd /Users/<removed>/capture
npm verb Darwin 19.6.0
npm verb argv "/Users/<removed>/.nvm/versions/node/v12.16.1/bin/node" "/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/bin/npm-cli.js" "run" "build:uimodule"
npm verb node v12.16.1
npm verb npm  v6.14.8
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:uimodule: `ui5 build --config=ui5.yaml --clean-dest --dest dist --include-task=generateManifestBundle generateAppPreload`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:uimodule script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 3441ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/john.murrayuk.ey.com/.npm/_logs/2020-12-18T08_34_32_273Z-debug.log
ERROR: "build:uimodule" exited with 1.
npm verb lifecycle [email protected]~build:ui: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~build:ui: PATH: 
/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/<removed>/capture/node_modules/.bin:/Users/<removed>/.nvm/versions/node/v12.16.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/<removed>/Library/Android/sdk/emulator:/Users/<removed>/Library/Android/sdk/tools:/Users/<removed>/Library/Android/sdk/platform-tools:/Users/<removed>/Library/Android/sdk/cmdline-tools/latest/bin
npm verb lifecycle [email protected]~build:ui: CWD: /Users/<removed>/capture
npm info lifecycle [email protected]~build:ui: Failed to exec build:ui script
npm verb stack Error: [email protected] build:ui: `run-s  build:uimodule`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:311:20)
npm verb stack     at ChildProcess.<anonymous> (/Users/<removed>/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:311:20)
npm verb stack     at maybeClose (internal/child_process.js:1021:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm verb pkgid [email protected]
npm verb cwd /Users/<removed>/capture
npm verb Darwin 19.6.0
npm verb argv "/Users/<removed>/.nvm/versions/node/v12.16.1/bin/node" "/Users/<removed>/.nvm/versions/node/v12.16.1/bin/npm" "run" "build:ui" "--verbose"
npm verb node v12.16.1
npm verb npm  v6.14.8
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:ui: `run-s  build:uimodule`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:ui script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 3812ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/<removed>/.npm/_logs/2020-12-18T08_34_32_303Z-debug.log

Consistent Code Formatting of Source Code

Hi,

having written the first PR, I must confess, that I've had problems to conform to the different code styles of the different packages.

Hence I would like to propose the following changes:

  • decide on one code style ๐Ÿ˜„ (by the way, I prefer semi-colons at the end of the statement ๐Ÿ˜‰)
  • install & configure prettier & eslint in root package
  • reformat all packages and commit (of course, this interfers with a clean git history, but better now than never)
  • install lint-staged / husky to enforce the formatting & linting rules on every commit

Most likely, you know about all this & haven't had the time, so think of this issue as a friendly reminder ๐Ÿ˜„

place each middleware/task in one repo

As seen here
npm install https://github.com/{USER}/{REPO}/tarball/{BRANCH}
doesn't work for monorepos.

This makes forking and adjusting really pointless, i can`t install my own extension in a persistent way into my project.

real live example:
npm install https://github.com/bkrrrr/ui5-ecosystem-showcase/ui5-middleware-livereload

Using http headers with cfdestination

First of all, thank you for all these middlewares and tasks, they are really useful for us.

However, we would like to use the cfdestination middleware, but unfortunately we cannot. The problem is that we are using a predefined JWT token during the development for our backend. Before we introduced UI5 tooling we created a custom approuter and we injected the token into the Authorization header for every request. The relevant code for this:

var approuter = require('@sap/approuter');

var ar = approuter();

ar.beforeRequestHandler.use((req, res, next) => {
    req.headers['Authorization'] = <JWT_TOKEN>;
    next();
});

Is it possible to enhance the cfdestination middleware to make it possible to inject headers into the request?

Another idea that came to my mind is that leaving the cfdestination middleware as it is and enhancing the simpleproxy middleware with this header injection. That would mean we could control that the token is only used for certain destinations.

What do you think?

'keepResources' flag doesn't seem to work?

Hi,

Even though I have specified keepResources: false in the ui5.yaml configuration, the resources are still included in the zip file. I've tried setting it to true/false and removing it all together but it appears to be always ignored.

ui5-task-zipper: 0.4.1
@ui5/cli: 2.7.1

ui5.yaml

specVersion: "2.2"
metadata:
  name: example.app
type: application
resources:
  configuration:
    paths:
      webapp: webapp
framework:
  name: SAPUI5
  version: 1.84.3
  libraries:
    - name: sap.m
    - name: sap.ui.core
    - name: sap.ui.layout
    - name: sap.ushell
      development: true
    - name: themelib_sap_fiori_3
server:
  customMiddleware:
    - name: ui5-middleware-livereload
      afterMiddleware: compression
      configuration:
        port: 35729
        path: webapp
    - name: ui5-middleware-simpleproxy
      mountPath: /v2/example
      afterMiddleware: compression
      configuration:
        baseUri: http://localhost:4004/v2/example
builder:
  resources:
    excludes:
      - "/test/**"
      - "/test-resources/**"
  customTasks:
    - name: "ui5-task-zipper"
      afterTask: "uglify"
      configuration:
        archiveName: "exampleui"
        keepResources: false

Cfdestination hardcoded compatibility

Hey everyone,

I am currently trying to get a scenario running, where the cfdestination middleware (and hence the sap approuter) is used as a proxy to access the real (sandbox) systems, to fetch data. To enable this, the approuter is able to pick up the default-env.json and default-services.json by default. This would allow developers to easily test the ui from their localhost with real backend data, in addition to using the mockserver.

The only thing that hinders me from getting that setup running is the fact that there is no option to configure the authenticationMethod from the ui5.yaml.

I could imagine a new config-option keepAuthenticationMethod which is defaulted to false to keep backward compatibility. Setting it to true would keep the authentication method from the xs-app.json.

Another restriction that could hinder compatibility to a broader range of projects is the fact, that the middleware expects the destination section in the yaml. Not providing it (eg. in case you only have business services configured in the xs-app.json and no destination) results in an invalid value for the environment variable (undefined) and thus an error. This could also be resolved by defaulting it to {}.

What do you think about these enhancements? I would be happy to create two seperate PRs for this.

Best Regards
Robert

Livetranspile: how to use file based Babel config

Is there something special to do to use the default Babel config at the root of the project?

It doesn't work for me as the filename given in the Babel options does not contains the full path, hence the root Babel config (.babelrc.js or babel.config.json) is not taken in account:

config.debug ? log.info(`...${pathname} transpiled!`) : null
const babelConfigForFile = merge({}, babelConfig, {
    filename: pathname // necessary for source map <-> source assoc
})
return babel.transformAsync(source, babelConfigForFile)

Also, how can we pass an empty Babel config in the middleware to configure it with a .babelrc.js only?

Extending ui5-middleware-livetranspile to support different file types (e.g. TS support)

Hi,

I would like to propose a change to make this middleware more generic. Currently it is restricted to consume .js files and I do at least require the consumption of TS files. I think this is the last step to make the middleware a full-blown transpiler enabling all Babel features.

The change itself: Switch from static lookup (resource.byPath) to configurable globbing pattern .{js,ts}.

The configuration I would imagine in ui5.yaml along these lines: pattern: ".{js,ts}" (default = ".js")

Of course, there will be a performance penalty for the dynamic lookup. I'd assume it would be neglible. We could also switch between globbing and static lookup depending on the pattern: either ".js" / ".ts" or ".{js,ts}"...

Another question: do you prefer to define / import all Babel dependencies in the middleware? That's currently more or less the case. I don't see any real problem with this approach and it makes the DX more comfortable. However, it feels kind of wrong... But it would allow to put the essential and most useful Babel transforms into the middleware and enable it by features flag via ui5.yaml. So is this the way to go or do you would like to create a separate livetranspile-middleware?

I would put together the PR if you're fine with this feature and you outline the direction to take :-)

Livereload does not work on Microsoft Edge (chromium)

I have configured the application to use the ui5-middleware-livereload (^0.1.4) and the refresh is working on Chrome but not on Microsoft Edge, even though they share the same platform.
It might be a hard dependency on Chrome and not Chromium.

CORS issue with ui5-middleware-simpleproxy

Hi all, I am trying to use command "ui5 serve"
with the ui5-middleware-simpleproxy. Here is my ui5.yaml:

specVersion: "2.2"
type: application
metadata:
  name: CompanyRepo.appName
framework:
  name: SAPUI5
  version: 1.76.0
  libraries:
    - name: sap.ui.core
    - name: sap.m
    - name: sap.ui.comp
    - name: sap.ushell
    - name: themelib_sap_fiori_3
server:
  customMiddleware:
    - name: ui5-middleware-simpleproxy
      afterMiddleware: compression
      mountPath: /northwind
      configuration:
        baseUri: "http://services.odata.org/Northwind/Northwind.svc/"
        strictSSL: true

This is my controller code, which loads the model:

    return Controller.extend("companyRepo.appName.controller.App", {
      onInit: function() {
        var me = this;
        me.getView().setBusy(true);
        var oModel = new sap.ui.model.odata.v2.ODataModel({
          serviceUrl: "/northwind",
        });
        oModel.metadataLoaded().then(function(oEvent) {
          console.log(oEvent);
          me.getView().setModel(oModel, "NorthwindModel");
          me.getView().setBusy(false);
        });
      },
    });

However, once I try to load model I get error:
Access to XMLHttpRequest at 'https://services.odata.org/Northwind/Northwind.svc/$metadata' (redirected from 'http://localhost:8080/northwind/$metadata') from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Am I doing something wrong?

ui5-task-transpile - regeneratorRuntime is not defined

Hi
i use the task ui5-task-transpile to compile my es6 code to es5.
Unfortunately the app doesn't start after compiling because of the following error

regeneratorRuntime is not defined

I have seen the comment in the Main.controller.js of the demo app
Are there any plans to implement the functionality?

Many greetings

ui5-middleware-cfdestination - auth configuration bug

There seems to be a bug introduced in PR #492. The newly introduced ui5.yaml configuration authenticationMethod is not being evaluated in the routes as far as I can tell. As I understand, this configuration should overwrite the xs-app.json configuration of the app router. Right now my setup is not working.

Let me explain:

I did setup route authentication in my app router's xs-app.json. This xs-app.json is being referenced (and reused) inside the customMiddleware of the SAP-UI5 project. Running locally, I wish to not use any route authentication and instead configured the newly authenticationMethod property to "none".

@d-sooter

Thanks for any input/help.

Add cache handling

Thank you for this showcase project. It comes very handy. ๐Ÿ‘

This is an enhancement request. As resource caching is a central issue in todays web applications, it would be nice to add cache-handling to the best-practice-showcase project. Ideally, such a cache handling would take in to account more advance use-cases that are possible with the ui5-tooling, such as custom bundles.

ui5-middleware-simpleproxy: x-csrf-token scenario

The ui5-middleware-simpleproxy works like a charm for GET requests. However i have problems with PUT/POST requests to a C4C system which requires a valid csrf token.

From Postman my scenario works just fine: I can fetch and use a token for PUT/POST requests.

Also when I do not use the proxy and start Chrome without security, everything works fine out the of the box: ui5 libs fetch a token and uses it in the subsequent requests.

When using ui5-middleware-simpleproxy, the token is still requested and returned with the response, however: I get a 403 on any PUT/POST request with the following response header:

x-csrf-token: Required

It seems that the token is generated by backend system is transparently returned, but somehow the backend server doesn't acknowledge the token.

Am I missing something?

regards,

Wilco Menge

ui5-middleware-simpleproxy: Increase payload limit

Expected Behavior

It should be possible to send requests to the server whose payload is greater than 1MB (e.g. for a file upload)

Current Behavior

The default limit of 1MB of the internal express-http-proxy component is apparently used:
https://www.npmjs.com/package/express-http-proxy

Context

  • UI5 Module Version : 2.2.6
  • Node.js Version: 14.4.0
  • npm Version: 6.14.5
  • OS/Platform: Windows 10

Log Output / Stack Trace

PayloadTooLargeError: request entity too large
    at readStream (C:\Users\weissenfelsn\Documents\workspace\VSCode\Dx4\SmartBridge\node_modules\raw-body\index.js:155:17)
    at executor (C:\Users\weissenfelsn\Documents\workspace\VSCode\Dx4\SmartBridge\node_modules\raw-body\index.js:112:5)
    at new Promise (<anonymous>)
    at getRawBody (C:\Users\weissenfelsn\Documents\workspace\VSCode\Dx4\SmartBridge\node_modules\raw-body\index.js:111:10)
    at maybeParseBody (C:\Users\weissenfelsn\Documents\workspace\VSCode\Dx4\SmartBridge\node_modules\express-http-proxy\lib\requestOptions.js:96:14)        
    at Object.bodyContent (C:\Users\weissenfelsn\Documents\workspace\VSCode\Dx4\SmartBridge\node_modules\express-http-proxy\lib\requestOptions.js:104:12)   
    at buildProxyReq (C:\Users\weissenfelsn\Documents\workspace\VSCode\Dx4\SmartBridge\node_modules\express-http-proxy\app\steps\buildProxyReq.js:12:84)   

Simpleproxy: Configuration of url parameters

For sending OData requests to SAP Netweaver multi client systems the url parameter "sap-client" needs to be specified, e.g.

https://my.sap.system/sap/opu/odata/sap/z_sample_service/$metadata?sap-client=206

By now it's not possible to configure url parameters via the configuration object. Therefore development and testing on multi client systems is not really convenient.

My suggestion is to extend the configuration by a map named "query" which allows to specify url parameters as key-value pairs.

I already implemented it and could provide this feature via a PR.

[FIX] ui5-middleware-cfdestination

Please bump version of SAP app router to version 9.0.1. It fixes an issue with web socket subprotocol handling. And it would be very helpful to have this working for local development as well.

Thank you.

ui5-middleware-stringreplacer fails to start

The ui5-middleware-stringreplacer fails to start with the following error:

middlewareRepository: Failed to require middleware module for ui5-middleware-stringreplacer: Cannot find module 'minimatch'

The minimatch module is not declared in package.json "dependencies" section. I will submit a PR.

ui5-task-transpile - custom babel configuration

Hi, I think it would help a lot to make the babel configuration used by the task configurable.
The configuration could be done in ui5.yaml and at runtime be merged with some defaults already implemented and then passed into babel:
https://github.com/petermuessig/ui5-ecosystem-showcase/blob/master/packages/ui5-task-transpile/lib/transpile.js#L29

Motivation: for some projects some assumptions about the code can be made and those make the transpiled files be smaller in size and more readable, e.g. @babel/plugin-transform-for-of with option assumeArray set to true.

Documentation / Usage of H2

Hi Peter,

I guess for most users it is clear - still maybe it should be added to the documentation that with Chrome 81 (SameSite Attribute - see https://www.chromium.org/updates/same-site ) the ui5-middleware-simpleproxy wont work correctly for Batch requests, for the same reason mentioned in #236 (csrf-token validation fails).
The solution is to simply use https using ui5 serve --h2 (SameSite=Lax - or just eliminate as today, is sufficient, no change on the proxy itself is required).
As most users will use the proxy for odata request forwarding - what do you think? Should it be added?

Thanks,
Timo

Publish NPM modules

Test lerna to publish middleware and task extensibility - somehow we need to think about scope and name

yarn test:ci runs into error: Cannot read property 'waitForUI5' of undefined

> yarn test:ci

[...] 

[chrome 87.0.4280.88 Mac OS X #0-0] javascript error: Cannot read property 'waitForUI5' of undefined
JavaScript stack:
TypeError: Cannot read property 'waitForUI5' of undefined
    at eval (eval at executeAsyncScript (:556:26), <anonymous>:5:18)
    at eval (eval at executeAsyncScript (:556:26), <anonymous>:26:12)
    at eval (eval at executeAsyncScript (:556:26), <anonymous>:27:4)
    at executeAsyncScript (<anonymous>:556:47)
    at apply.selector.id (<anonymous>:571:29)
    at callFunction (<anonymous>:450:22)
    at <anonymous>:464:23
    at <anonymous>:465:3
  (Session info: headless chrome=87.0.4280.88)
  (Driver info: chromedriver=87.0.4280.20 (c99e81631faa0b2a448e658c0dbd8311fb04ddbd-refs/branch-heads/4280@{#355}),platform=Mac OS X 11.0.0 x86_64)

ui5-middleware-servestatic

Relative paths don't work properly on Windows machines for the servestatic middleware. Make the path absolute and add some logging for servestatic.

ui5-middleware-simpleproxy: module dotenv not found

After upgrading to 0.2.2 of ui5-middleware-simpleproxy it gives me the error when trying to run the ui5 serve command:

"middlewareRepository: Failed to require middleware module for ui5-middleware-simpleproxy: Cannot find module 'dotenv'"

I also checked my node-modules folder after npm install and couldn't find the folder dotenv.

stringreplacer - prefix configurable

ui5-task-stringreplacer

its not an issue but looking for this new option.is it possible to make the prefix configurable from ui5.yaml file?

I tried the below command from package.json but it will not take the dot.In general all the env variables normally will have underscore(NODE_ENV) or it should start with stringreplacer_

"build": "cross-env stringreplacer.ENV=dev ui5 build -a --clean-dest",

Simple proxy adds an ETag, "normal" service does not - concurrency error

Hi Peter,

Using the simple proxy after separating UI and Backend results in some cases in a repeated error on the odata services (this was with the V2 adapter)

<message>The requested resource is not concurrent</message>

I think I tracked it down to the addition of an ETag on the request, and the responding if-none-matched header on subsequent calls. The below GIF is a bit crap but the only difference is the ETag and the subsequent if-none-matched response.

My solution was to add a delete proxyReqOpts.headers['if-none-match']; to function proxyReqOptDecorator but that's only because I had no better way of trying to remove the ETAg. The original request to the CAP service itself does not generate an ETag at all. I did not find a way to succesfully set app.set('etag', false).

error

General configuration from environment variables and .env files

It would help a lot for CI scenarios if settings could optionally be pulled from environment variables. Support for dot-env on top of this would be fantastic. I'm mostly interested in this for ui5-middleware-simpleproxy in order to set the baseUri, but seems like something that would be a good standard for all tasks and middleware. Thoughts? Would pull requests to implement this be accepted in theory?

multiple ui5-middleware-simpleproxy

I would like to simulate scp neo destinations for local development.
We have two destinations in the cloud, which means i have to have two ui5-middleware-simpleproxy.

  - name: ui5-middleware-simpleproxy
    afterMiddleware: compression
    mountPath: /uri1
    configuration:
      baseUri: "uri1"
      username: user1
      password: pw1
  - name: ui5-middleware-simpleproxy
    afterMiddleware: compression
    mountPath: /uri2
    configuration:
      baseUri: "uri2"
      username: user2
      password: pw2

If i set the username+password in the yaml, everything works fine. But i would rather not, as ui5.yaml is not ignored in git.

I would like to set the username + password as an env variable, but the problem is the two ui5-middleware-simpleproxy share the same parameter.

Could you help me how can i solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.