npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sapui5-runtime

v1.5.5

Published

Downloads the official SAPUI5 runtime for local development

Downloads

19

Readme

SAPUI5 Runtime

A package which downloads the official SAPUI5 runtime from https://tools.hana.ondemand.com/ for local development.

Installation

By using this npm package you agree to the EULA from SAP: https://tools.hana.ondemand.com/developer-license-3_1.txt/

npm install -D sapui5-runtime

or

yarn add -D sapui5-runtime

This will download and unzip the latest SAPUI5 runtime.

Proxy support

It is possible to use this package behind a proxy by setting the environment variables HTTP_PROXY and HTTPS_PROXY.

Linux / macOS
export HTTP_PROXY http://hostname:port
export HTTPS_PROXY https://hostname:port
Windows
set HTTP_PROXY=http://hostname:port
set HTTPS_PROXY=https://hostname:port

It is also possible to use proxy servers which require authentication: https://username:password@hostname:port

Installing a specific version

In case you need a specific version of SAPUI5 you can specify it in your package.json. Add the following line to your package.json:

"sapui5-runtime": {
  "version": "X.Y.Z"
}

You need to replace X.Y.Z with a valid version from https://tools.hana.ondemand.com/.

If you already added sapui5-runtime to your dependencies you need to run npm rebuild after setting a specified version. If you added this setting to your package.json before installing the package, you can just install sapui5-runtime as usual.

Get started

After a successful installation you can use a server to serve the runtime as static files.

Express example

const express = require('express')
const sapui5 = require('sapui5-runtime')
const app = express()

app.use('/resources', express.static(sapui5))

app.listen(3000)

Hapi example

const Hapi = require('hapi')
const inert = require('inert')
const sapui5 = require('sapui5-runtime')

const server = Hapi.server({
    port: 3000,
    host: 'localhost'
})

const init = async () => {
    await server.register(inert)
    server.route({
        method: 'GET',
        path: '/resources/{param*}',
        handler: {
            directory: {
                path: sapui5
            }
        }
    });
    await server.start()
}

init()

UI5 Tooling example

Add the custom UI5 middleware to serve static resources:

npm install -D ui5-middleware-servestatic

or

yarn add -D ui5-middleware-servestatic

Add the UI5 dependency declaration to package.json:

"ui5": {
  "dependencies": [
    "ui5-middleware-servestatic"
  ]
}

Add the custom middleware configuration to ui5.yaml

server:
  customMiddleware:
  - name: ui5-middleware-servestatic
    afterMiddleware: compression
    mountPath: /resources
    configuration:
      rootPath: "./node_modules/sapui5-runtime/lib/resources"

Grunt OpenUI5 example

const sapui5 = require('sapui5-runtime')

module.exports = function (grunt) {
  grunt.initConfig({
    connect: {
      options: {
        port: 3000,
        hostname: '*'
      },
      src: {},
      dist: {}
    },
    openui5_connect: {
      options: {
        resources: [sapui5],
        cors: {
          origin: '*'
        }
      },
      src: {
        options: {
          appresources: 'webapp'
        }
      },
      dist: {
        options: {
          appresources: 'dist'
        }
      }
    },
    openui5_preload: {
      component: {
        options: {
          resources: {
            cwd: 'webapp',
            prefix: 'sap/ui/demo/todo',
            src: [
              '**/*.js',
              '**/*.fragment.html',
              '**/*.fragment.json',
              '**/*.fragment.xml',
              '**/*.view.html',
              '**/*.view.json',
              '**/*.view.xml',
              '**/*.properties',
              'manifest.json',
              '!test/**'
            ]
          },
          dest: 'dist'
        },
        components: true
      }
    },
    clean: {
      dist: 'dist',
    },
    copy: {
      dist: {
        files: [{
          expand: true,
          cwd: 'webapp',
          src: [
            '**',
            '!test/**'
          ],
          dest: 'dist'
        }]
      }
    },
  })

  grunt.loadNpmTasks('grunt-contrib-connect')
  grunt.loadNpmTasks('grunt-contrib-clean')
  grunt.loadNpmTasks('grunt-contrib-copy')
  grunt.loadNpmTasks('grunt-openui5')

  grunt.registerTask('serve', function (target) {
    grunt.task.run('openui5_connect:' + (target || 'src') + ':keepalive')
  })
  grunt.registerTask('build', ['clean:dist', 'openui5_preload', 'copy'])
  grunt.registerTask('default', ['serve'])
}

Contribution

I'm happy to accept Pull Requests! Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

This project was heavily inspired by openui5.runtime.downloader by Marius Augenstein.

License

MIT :heart: