UI5 Template example for development env
- Install Node.js (https://nodejs.org/en/download/package-manager)
- Install grunt
npm install -g grunt-cli
- Install ui5-cli
npm install -g @ui5/cli
- Install mbt tools (https://sap.github.io/cloud-mta-build-tool/download/)
- Install packages (based on package.json) -
npm install
To use "build" and "deploy" tasks the '.env' file have to be fullfieled based on example (.env.example).
There is predefined grunt task - 'default' in root directory of application Build is based on UI5-Tooling and also can be started using command - 'ui5 build'
Note: babel task is turned on by default - can be deactivated in ui5.yaml (delete 'ui5-task-transpile'
)
There is predefined task
- mta - the mtar container will be created based on build version of source code in './mta' folder
There is predefined task deploy - will deploy the library without changing the version of lib;
Note: the user-defined (like user name, password, system, WB and etc) parameters will be filled from ".env" file
The version in manifest.json is updated during build task from package.json
Note: version in package.json have to be managed manually using 'npm version'
There is predefinded grunt tsak - 'server'.
command line: grunt server
Note: local server is based on UI5-Tooling and can be started using command - 'ui5 serve'
Server will be started at:
localhost:3070/3071 (3070 - by default, can be changed in 'ui5.yaml')
There is predefined ESLint rules to validate and format soruce code.
Predefined set of rules (see .eslintrc): airbnb-base
Also is available tools to format js and xml files automatically
prettier - to js files (see config prettier.config.js)
jsbeautify - to xml files (see config .jsbeautifyrc)
There are predefined scripts (see package.json) for format all files:
npm run prettier-js
npm run pretty-xml
Note: also single file can be added to scripts (just put it as parameter)