generator-mtaproject
v0.1.6
Published
Creates a fully configured and deployable MTA project
Maintainers
Readme
generator-mtaproject
A powerful Yeoman generator for creating fully configured SAP MTA projects with SAP CAP, SAP Fiori, and automated SAP BTP deployment support.
Please note: On Windows, make must be installed. Otherwise, the script will fail during mbt build before deployment.
Features
- Freely configurable project name
- Optional
cds addcomponents:hanaworkzone-standardapprouterxsuaamta
- Optional creation of:
- example
schema.cds - example CAP service
- example
- Create any number of SAP Fiori apps using the
@sap/fiorigenerator - Automatic deployment to multiple SAP BTP targets
- Automatic maintenance of redirect URIs in
xs-security.json - Automatic generation of a
README.mdcontaining:- service URLs
- application URLs
- target-specific information
- Configuration files can be saved and reused later
Requirements
The following tools must be installed globally:
- Node.js
- Yeoman
- SAP CDS Development Kit
- SAP Fiori Generator
Install required tools:
npm install -g yo
npm install -g @sap/cds-dk
npm install -g @sap/generator-fioriSAP CLI Tools Installation Tutorial
A dedicated video tutorial showing how to install the SAP CLI tools is available here:
https://youtu.be/4gPXgPQLRsg
Installation
Install the generator globally:
npm install -g generator-mtaprojectUsage
Create a new project:
yo mtaprojectUse a previously saved configuration:
yo mtaproject --configfile <saved configfile>Example:
yo mtaproject --configfile myproject-config.jsonWhat the Generator Can Do
SAP CAP Project Setup
Automatically creates and configures:
- CAP project structure
- HANA configuration
- XSUAA configuration
- Approuter configuration
- MTA configuration
- Work Zone support
Example CDS Content
Optional generation of:
db/schema.cds- CAP service definitions
- Example entities and projections
SAP Fiori App Generation
The generator can create multiple SAP Fiori applications during setup.
Internally it uses:
@sap/generator-fiori
This allows flexible generation of:
- SAP Fiori Elements apps
- SAPUI5 freestyle apps
- OData V4 applications
Multi-Target Deployment
Supports automatic deployment to multiple SAP BTP targets.
Examples:
- DEV
- TEST
- QA
- PROD
The generator can automatically:
- build the MTA
- deploy the application
- configure destinations
- maintain redirect URIs
Automatic Redirect URI Maintenance
The generator automatically updates:
xs-security.jsonwith the required redirect URIs for all generated applications and SAP BTP targets.
Auto-Generated README
A project-specific README.md can be generated automatically containing:
- service URLs
- application URLs
- target information
- deployment information
Configuration Files
During generation, settings can optionally be saved into a configuration file.
Benefits:
- reuse configurations
- quickly recreate projects
- modify settings later
- standardize project templates
Example:
yo mtaproject --configfile customer-a.jsonRoadmap
Roles and authorization setup
- 2 example services with 2 roles
- automatic
xs-security.jsonupdates - automatic approuter
xs-app.jsonupdates
Mock users and roles in
package.jsonAdd
build:cfscripts to all generated appsOptional standard template app (without Yeoman)
Re-deployment to all targets after redirect URI updates
Hybrid mode support
- bind to ONE target only
- IMPORTANT: only ONE target
Add draft support to CAP services
Cross Navigation configuration in
manifest.jsonOData 4.01 compatibility checks
Automatic destination configuration:
srv-api(projectName)-srv-api
CI/CD integration using GitHub Actions
- GitHub-hosted runners
- self-hosted runners
Example Workflow
- Start the generator
- Select CAP components
- Create sample CDS model
- Generate SAP Fiori apps
- Configure SAP BTP targets
- Deploy automatically
- Receive generated documentation
Technologies
- Node.js
- Yeoman
- SAP CAP
- SAP HANA
- SAP BTP
- SAP Fiori
- SAPUI5
- MTA
- XSUAA
- Approuter
License
MIT
History
- 0.1.1 : Initial release with core features
- 0.1.2 : Automatic deployment and redirect URI maintenance
- 0.1.3 : ci/cd Push to npmjs.com
- 0.1.4 : Bugfixes (logs, deployment) - Add Readme
- 0.1.5 : Using console.log() instead of this.log() for better output formatting
- 0.1.6 : Service Name adjustment, roles (xs-security.json and service), mock users in package.json
