Code Monkey home page Code Monkey logo

ui5-schemas's Introduction

npm version Build Status bitHound Overall Score License: MIT

⚠️ NOTE

As SAP sunsetted the support for the SAPUI5 Tools for Eclipse they also removed the XSD schemas from the project. ui5-schemas obviously can not work without those schemas. If you want to continue using ui5-schemas keep using the latest available version of SAPUI5/OpenUI5 that includes schemas which is 1.71.

I'm working together with the SAP colleagues to potentially find an alternative solution to keep this project alive. Stay tuned!

More detailed information on the issue in sap/openui5#2751 resp. ui5experts/ui5-schemas#47

What is UI5 Schemas?

UI5 Schemas allows you to develop SAPUI5/OpenUI5 XML at a maximum convenience. It downloads, upgrades and sets up SAPUI5/OpenUI5 XML schemas for a better development experience in your favorite IDE (if it is WebStorm ;).

Getting Started

$ npm install -g ui5-schemas
$ ui5-schemas

npm 5:

$ npx ui5-schemas

Use cli option --help for more details

$ ui5-schemas --help

Usage: ui5-schemas [options]

Options:
  --origin       The src url (sdk base url) or path (sdk root dir) to be used
                 for schema loading.                                    [string]
  --sdk          The sdk to be used.
   [string] [choices: "sapui5", "openui5", "openui5nightly"] [default: "sapui5"]
  --version, -v  The UI5 version to be used, defaults to '' which means latest.
                                                          [string] [default: ""]
  --upgrade      Whether to upgrade UI5 schemas for a better development
                 experience or leave them untouched.
                                                       [boolean] [default: true]
  --link         Whether to auto-link UI5 schemas with your favorite IDE (if it
                 is WebStorm ;).                       [boolean] [default: true]
  --debug        Whether to show debug output
                                                      [boolean] [default: false]
  -h, --help     Show help

Examples:
  ui5-schemas --sdk openui5 --version 1.28.15       Setup with openui5 schemas in version 1.28.15
  ui5-schemas --sdk openui5nightly                  Setup with openui5nightly
  ui5-schemas --origin '/Users/cschuff/Downloads/sapui5-sdk-1.65.1'  
                                                    Setup schemas from local sdk download
  ui5-schemas --origin 'https://my.abap.system/sap/public/bc/ui5_ui5'  
                                                    Setup schemas from sdk on an ABAP system
  ui5-schemas --no-upgrade                          Setup schemas without schema enhancement
  npx ui5-schemas --sdk openui5 --version 1.28.15   NPM5

Features

Custom Origin

Install schemas from any origin: Use the CDN, a downloaded SDK or even your own remote system.

Multi-SDK Support

Use the 'OpenUI5', 'OpenUI5 Nightly' or 'SAPUI5' SDK for your project.

Multi-Version Support

Use any available OpenUI5/SAPUI5 version in your project. Switch versions with ease!

Known Limitations

The xml schema files provided by SAP come with some limitations that this module does not fix (yet):

  • Binding syntax is not supported (#3)
  • Aggregation Bindings that can be written as properties (#29)
  • ...

Usage behind Proxies

Proxies used according to npm module request. Make sure to have set the following env vars:

  • HTTP_PROXY / http_proxy
  • HTTPS_PROXY / https_proxy
  • NO_PROXY / no_proxy

If you are behind a corporate proxy and experience 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' it is most probably due to an invalid proxy certificate. You can still run ui5-schemas like this at your own risk:

NODE_TLS_REJECT_UNAUTHORIZED=0 ui5-schemas
# windows
set NODE_TLS_REJECT_UNAUTHORIZED=0
ui5-schemas

If none of this works just download a SAPUI5/OpenUI5 SDK and install schemas from the filesystem:

$ ui5-schemas --origin '/Users/cschuff/Downloads/sapui5-sdk-1.65.1'

What is yet to come?

  • Eclipse support
  • Feel free to open an issue if you are missing something else!

ui5-schemas's People

Contributors

cschuff avatar dependabot-preview[bot] avatar dependabot-support 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ui5-schemas's Issues

XSD not loading for UI5 1.85.2

When I try to use the library for Webstorm I have this log:
C:\Projects\Webstorm\SAPUI5 Apps>ui5-schemas
ui5-schemas info Attempting to download latest version of 'sapui5'. Determining latest version...
ui5-schemas info https://sapui5.hana.ondemand.com/resources/sap-ui-version.json
ui5-schemas info Detected version of sdk 'sapui5' is '1.85.3'
ui5-schemas info Preparing 'sapui5' schemas in version '1.85.3'...
ui5-schemas info Yay, all schema files were successfully downloaded!
ui5-schemas info [enhance] Making schemas even cooler...
ui5-schemas info [link] Discovered an .idea project! Registering schemas...
ui5-schemas error [enhance] TypeError: Cannot read property 'xsd:complexType' of undefined
at sapUiCoreView (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\ui5-schemas\lib\upgrade.js:29:34)
at C:\Projects\Webstorm\SAPUI5 Apps\node_modules\ui5-schemas\lib\upgrade.js:107:9
at Parser. (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\xml2js\lib\parser.js:303:18)
at Parser.emit (node:events:329:20)
at SAXParser.onclosetag (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\xml2js\lib\parser.js:261:26)
at emit (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\xml2js\lib\parser.js:322:31)
at Parser.parseString (C:\Projects\Webstorm\SAPUI5 Apps\node_modules\xml2js\lib\parser.js:5:59)
at C:\Projects\Webstorm\SAPUI5 Apps\node_modules\ui5-schemas\lib\upgrade.js:102:14
ui5-schemas info [link] Schemas successfully registered!

The issue in XSD files - they are empty:
<!doctype html><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style>

HTTP Status 404 – Not Found

Node JS - v15.2.0.
SAP UI5 - 1.85.2

Cannot install schemas - runtime exception

A shortdump says more than 100 words:

| => ui5-schemas 
ui5-schemas info Preparing 'sapui5' schemas in version 'latest'...
ui5-schemas info Yay, all schema files were successfully downloaded!
ui5-schemas info [enhance] Making schemas even cooler...
ui5-schemas error [enhance] TypeError: Cannot read property 'xsd:complexType' of undefined
    at sapUiCoreView (/Users/oliverjaegle/.nvm/versions/node/v8.11.4/lib/node_modules/ui5-schemas/lib/upgrade.js:27:34)
    at parser.parseString (/Users/oliverjaegle/.nvm/versions/node/v8.11.4/lib/node_modules/ui5-schemas/lib/upgrade.js:72:9)

Thanks for the effort of providing this, if it works, it's a must ;)

ui5-schemas error [enhance] Error: Unexpected close tag

I installed ui5-schemas with npm install -g ui5-schemas
Then I try to execute ui5-schemas --sdk openui5nightly and get the following error:

ui5-schemas info Attempting to download latest version of 'openui5nightly'. Determining latest version...
ui5-schemas info https://openui5nightly.hana.ondemand.com/resources/sap-ui-version.json
ui5-schemas info Detected version of sdk 'openui5nightly' is '1.74.0-SNAPSHOT'
ui5-schemas info Preparing 'openui5nightly' schemas in version '1.74.0-SNAPSHOT'...
ui5-schemas info Yay, all schema files were successfully downloaded!
ui5-schemas info [enhance] Making schemas even cooler...
ui5-schemas error [enhance] Error: Unexpected close tag
Line: 46
Column: 8
Char: >
at error (C:\Program Files\nodejs\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:651:10)
at strictFail (C:\Program Files\nodejs\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:677:7)
at closeTag (C:\Program Files\nodejs\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:871:9)
at SAXParser.write (C:\Program Files\nodejs\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Program Files\nodejs\node_modules\ui5-schemas\node_modules\xml2js\lib\parser.js:322:31)
at Parser.parseString (C:\Program Files\nodejs\node_modules\ui5-schemas\node_modules\xml2js\lib\parser.js:5:59)
at C:\Program Files\nodejs\node_modules\ui5-schemas\lib\upgrade.js:103:14

When executing ui5-schemas --sdk openui5 in Node.js console everything is OK.

When I execute ui5-schemas --sdk openui5 withing IDEA 2019.3, I get an error:

C:\Users\User\IdeaProjects%PROJ%>ui5-schemas --sdk openui5
ui5-schemas info Attempting to download latest version of 'openui5'. Determining latest version...
ui5-schemas info https://openui5.hana.ondemand.com/resources/sap-ui-version.json
ui5-schemas info Detected version of sdk 'openui5' is '1.72.1'
ui5-schemas info Preparing 'openui5' schemas in version '1.72.1'...
ui5-schemas info Yay, all schema files were successfully downloaded!
ui5-schemas info [enhance] Making schemas even cooler...
ui5-schemas info [link] Discovered an .idea project! Registering schemas...
ui5-schemas error TypeError: Cannot read property 'filter' of undefined
at C:\Users\User\IdeaProjects%PROJ%\node_modules\ui5-schemas\lib\link.js:63:44
at Parser. (C:\Users\User\IdeaProjects%PROJ%\node_modules\xml2js\lib\parser.js:303:18)
at Parser.emit (events.js:223:5)
at SAXParser.onclosetag (C:\Users\User\IdeaProjects%PROJ%\node_modules\xml2js\lib\parser.js:261:26)
at emit (C:\Users\User\IdeaProjects%PROJ%\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Users\User\IdeaProjects%PROJ%\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Users\User\IdeaProjects%PROJ%\node_modules\sax\lib\sax.js:889:7)
at SAXParser.write (C:\Users\User\IdeaProjects%PROJ%\node_modules\sax\lib\sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (C:\Users\User\IdeaProjects%PROJ%\node_modules\xml2js\lib\parser.js:322:31)
at Parser.parseString (C:\Users\User\IdeaProjects%PROJ%\node_modules\xml2js\lib\parser.js:5:59)
at registerLibs (C:\Users\User\IdeaProjects%PROJ%\node_modules\ui5-schemas\lib\link.js:33:12)
at C:\Users\User\IdeaProjects%PROJ%\node_modules\ui5-schemas\lib\link.js:98:11
ui5-schemas info [enhance] Enhancing done!

Issue when running ui5-schemas - enhance

Hey there, have the following issue and not sure if bug in code or something I did. Can you help?
Removed user details.

`C:\Users-\ui5schemas>ui5-schemas

ui5-schemas info Preparing 'sapui5' schemas in version 'latest'...

ui5-schemas info Yay, all schema files were successfully downloaded!

ui5-schemas info [enhance] Making schemas even cooler...

ui5-schemas error [enhance] TypeError: Cannot read property 'xsd:complexType' of undefined

at sapUiCoreView (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\lib\upgrade.js:27:34)

at parser.parseString (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\lib\upgrade.js:72:9)

at Parser.<anonymous> (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\xml2js\lib\parser.js:303:18)

at Parser.emit (events.js:189:13)

at SAXParser.onclosetag (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\xml2js\lib\parser.js:261:26)

at emit (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:624:35)

at emitNode (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:629:5)

at closeTag (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:889:7)

at SAXParser.write (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\sax\lib\sax.js:1436:13)

at Parser.exports.Parser.Parser.parseString (C:\Users\-\AppData\Roaming\npm\node_modules\ui5-schemas\node_modules\xml2js\lib\parser.js:322:31)`

Thanks!

TypeError: Cannot read property 'xsd:complexType' of undefined

Could you please help with the following errors? Thanks!

✗ npx ui5-schemas
npx: installed 116 in 16.837s
ui5-schemas info Attempting to download latest version of 'sapui5'. Determining latest version...
ui5-schemas info https://sapui5.hana.ondemand.com/resources/sap-ui-version.json
ui5-schemas info Detected version of sdk 'sapui5' is '1.87.0'
ui5-schemas info Preparing 'sapui5' schemas in version '1.87.0'...
ui5-schemas info Yay, all schema files were successfully downloaded!
ui5-schemas info [enhance] Making schemas even cooler...
ui5-schemas error [enhance] TypeError: Cannot read property 'xsd:complexType' of undefined
at sapUiCoreView (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/lib/upgrade.js:29:34)
at /Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/lib/upgrade.js:108:9
at Parser. (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/xml2js/lib/parser.js:303:18)
at Parser.emit (events.js:314:20)
at SAXParser.onclosetag (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/xml2js/lib/parser.js:261:26)
at emit (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/sax/lib/sax.js:624:35)
at emitNode (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/sax/lib/sax.js:629:5)
at closeTag (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/sax/lib/sax.js:889:7)
at SAXParser.write (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/sax/lib/sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/xml2js/lib/parser.js:322:31)
at Parser.parseString (/Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/node_modules/xml2js/lib/parser.js:5:59)
at /Users/i/.npm/_npx/94835/lib/node_modules/ui5-schemas/lib/upgrade.js:103:14

Bound aggregation attributes

Aggregations are not allowed as attributes. Example:
image

Can we have all aggregations of element as allowed attributes?

Prevent duplicate schema registration

Running ui-schemas several times will link the schemas over and over again into misc.xml causing webstorm to slow down significantly and to unneccessarily trash it's config.

Atom support?

How do I use this in Atom?
I managed to install it via npm, but I think maybe I need a way to configure the SDK version?

Install schemas into AppData

This will allow reuse of downloaded files. Furhtermore it will stop ui5-schemas from messing up users projects with a massive amount of files they will want to ignore. Not to mention the initial slowdown by indexing these files...

process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + 'Library/Preferences' : '/var/local')

ui5-schemas shell script fails to link WebStorm's ProjectResources

steps to reproduce:

  • add ui5schemas to existing src code repo via package.json: npm install ui5-schemas --save
  • run ui5-schemas (here via node_modules/.bin/ui5-schemas)
  • (downloads fine), then link error occurs
Discovered an .idea project!
Registering schemas...
{ Error: ENOENT: no such file or directory, open '/Users/xyz/git/my_modules/.idea/misc.xml'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/xyz/git/my_modules/.idea/misc.xml' }

Proposed solution: check for .idea/misc.xml first and create if it doesn't exist

macOS 10.12.6
node 8.3.0

Binding Syntax

All attributes with expression binding and input validation get "Wrong attribute value":
image

Can expression binding be valid input for all attributes?

Support: is there a bug in the UI5 XSD files?

Hi there! 😄
Super nice project to have around!
I have an issue with schema validation in PHPStorm... I am not sure who's to blame: the IDE or the schemas from SAP!
Once the schemas are installed and linked to the IDE, the following view definition gives some errors:

<core:View controllerName="example.app.Controller"
           xmlns="sap.m"
           xmlns:tnt="sap.tnt"
           xmlns:core="sap.ui.core" displayBlock="true">
  <tnt:ToolHeader>
    <IconTabHeader>
      <items>
        <IconTabFilter text="{i18n>text}" key="the-key"/>
        <!--Invalid content was found starting with element '{"sap.m":IconTabFilter}'. One of '{"sap.ui.core":Control, "sap.ui.core":Fragment, WC["http://www.w3.org/1999/xhtml"]}' is expected.-->
      </items>
    </IconTabHeader>
  </tnt:ToolHeader>
</core:View>

Of course, IconTabFilter is actually a Control, but the validation fails here... Which is funny, because intelli-sense does suggest IconTabFilter as a valid element to be contained in the <items> aggregation 🙃
Do you know whether this is an IDE's fault or an XSD's one?
Have you faced this issue before? If so... could you get around it? 😅
Thanks a lot and best regards!

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.