@cbs-consulting/generator-btp
v1.2.10
Published
Yeoman generator for bootstrapping CAP/UI5 projects with TypeScript, ESLint, and other essential configurations
Readme
CAP/UI5 Foundation Generator
A Yeoman generator for creating the foundation of CAP/UI5 projects with TypeScript, ESLint, Prettier, and other essential development configurations.
Features
This generator sets up a solid foundation for your CAP/UI5 projects with:
- ✅ TypeScript - Full TypeScript configuration with strict settings
- ✅ ESLint - Code quality and linting rules optimized for TypeScript
- ✅ Prettier - Consistent code formatting
- ✅ Husky - Git hooks for pre-commit quality checks
- ✅ Jest - Testing framework with TypeScript support
- ✅ GitHub Actions - CI/CD pipeline for automated testing and building
- ✅ VS Code - Optimized settings and recommended extensions
- ✅ Docker - Container configuration for deployment (optional)
Installation
First, install Yeoman and this generator globally:
npm install -g yo
npm install -g @cbs-consulting/generator-btpOr install locally in your project:
npm install --save-dev @cbs-consulting/generator-btpUsage
This generator is split into two sub-generators.
- CAP flow
mkdir my-cap
cd my-cap
yo @cbs-consulting/btp:cap
# read and execute the printed steps shown in the terminal- UI5 flow
mkdir my-ui5
cd my-ui5
# ensure you have a UI5 project skeleton (or after cds init)
yo @cbs-consulting/btp:ui5
# read and execute the printed steps in the terminalThe CAP sub-generator copies all templates from generators/app/templatesCAP into your project and merges additions from generators/app/additionsCAP into existing files. The scripting.txt is shown but not executed automatically.
Generated Project Structure
my-project/
├── src/ # Source TypeScript files
├── tests/ # Test files (if Jest is selected)
├── dist/ # Compiled output (after build)
├── .github/workflows/ # GitHub Actions CI/CD (if selected)
├── .vscode/ # VS Code settings (if selected)
├── .eslintrc.js # ESLint configuration
├── .prettierrc # Prettier configuration
├── .gitignore # Git ignore rules
├── tsconfig.json # TypeScript configuration
├── jest.config.js # Jest configuration (if selected)
├── package.json # Project dependencies and scripts
└── README.md # Project documentationAvailable Scripts
The generated project includes these npm scripts:
npm run build- Compile TypeScript to JavaScriptnpm run build:watch- Watch mode compilationnpm run lint- Run ESLint on your codenpm run lint:fix- Fix auto-fixable ESLint issuesnpm run format- Format code with Prettiernpm run format:check- Check if code is properly formattednpm test- Run Jest tests (if enabled)npm run test:watch- Run tests in watch modenpm run test:coverage- Generate test coverage report
Development
To develop this generator locally:
- Clone this repository
- Install dependencies:
npm install - Link the generator:
npm link - Test in a new directory:
yo @cbs-consulting/btp
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
