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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cbs-consulting/generator-btp

v1.3.3

Published

CBS Best Practice Generator - Yeoman generator for bootstrapping CAP/UI5 projects with TypeScript, ESLint, and other essential configurations

Readme

CBS Best Practice Generator

A modular Yeoman generator for bootstrapping and enhancing SAP CAP and UI5 projects with industry best practices, including TypeScript, linting, formatting, dev containers, and Azure DevOps CI/CD configuration.

Overview

This generator provides a suite of modular sub-generators that can be used together or independently:

  • 🎯 Main Entry Point - Interactive menu to select which generator to run
  • 🚀 CAP Generator - Complete CAP project setup with TypeScript, MTA, dev container, and optional Azure DevOps
  • 🎨 UI5 Generator - Add best practices to existing UI5 applications (ESLint, UI5lint, TypeScript)
  • 🐳 Devcontainer Generator - VS Code dev container for consistent development environments
  • ☁️ Azure DevOps Setup - Automated scripts for configuring branch policies, merge strategies, and CI/CD pipelines

Prerequisites

The CAP generator requires @sap/cds-dk to be installed globally, as it invokes cds init directly during execution:

npm install -g @sap/cds-dk

Installation

Install Yeoman and this generator globally:

npm install -g yo @cbs-consulting/generator-btp

Or install as a dev dependency:

npm install --save-dev yo @cbs-consulting/generator-btp

Quick Start

Interactive Mode (Recommended)

Run the generator and select from the menu:

yo @cbs-consulting/btp

Direct Generator Access

Invoke specific generators directly:

# Bootstrap a new CAP project (includes devcontainer + optional Azure DevOps)
yo @cbs-consulting/btp:cap

# Add best practices to existing UI5 apps
yo @cbs-consulting/btp:ui5

# Add devcontainer only
yo @cbs-consulting/btp:devcontainer

# Add Azure DevOps setup scripts only
yo @cbs-consulting/btp:setup-azure-devops

Generators

🚀 CAP Generator

Purpose: Bootstrap a complete CAP project with all best practices.

Requires @sap/cds-dk installed globally (npm install -g @sap/cds-dk).

What it does:

  • Runs cds init with TypeScript, MTA, XSUAA, HANA, and sample content
  • Configures ESLint and Prettier (using @cbs-consulting/tools)
  • Sets up git workflows with advanced aliases (ticket-based branches, PR automation)
  • Adds pre-commit hooks (linting, formatting) with simple-git-hooks
  • Generates MTA deployment descriptors with environment-specific extensions (dev/test/prod)
  • Configures VS Code with 30+ recommended extensions
  • Includes devcontainer generator (always)
  • Includes setup-azure-devops generator (optional, if selected)

Key files added:

  • .gitignore, .gitconfig.aliases, .gitattributes, .npmrc
  • eslint.config.mjs, prettier.config.mjs
  • mta.yaml + mta-ext/{dev,test,prod}.mtaext
  • azure-pipelines.yaml (if Azure DevOps enabled)
  • .devcontainer/ folder
  • scripts/setup-azure-devops/ folder (if Azure DevOps enabled)

Usage:

mkdir my-cap-project
cd my-cap-project
yo @cbs-consulting/btp:cap

🎨 UI5 Generator

Purpose: Add best practices to existing UI5 applications.

What it does:

  • Auto-detects UI5 apps in the app/ folder (by finding ui5.yaml)
  • Adds ESLint and UI5lint configurations per app
  • Configures TypeScript to work with CAP-generated models
  • Adds npm scripts for linting and UI5-specific linting

Key files added (per app):

  • eslint.config.mjs, ui5lint.config.mjs
  • Updates package.json and tsconfig.json

Usage:

# Run from CAP project root with app/ folder
yo @cbs-consulting/btp:ui5

🐳 Devcontainer Generator

Purpose: Set up VS Code dev container for consistent development environments.

What it does:

  • Creates .devcontainer/ configuration using CBS Docker image
  • Pre-configures 30+ VS Code extensions
  • Auto-installs Cloud Foundry and Azure DevOps CLI tools on container creation
  • Provides isolated, reproducible development environment

Key files added:

  • .devcontainer/devcontainer.json
  • .devcontainer/Dockerfile
  • .devcontainer/post-create.sh

Usage:

yo @cbs-consulting/btp:devcontainer

Note: This generator is automatically included when using the CAP generator.


☁️ Azure DevOps Setup Generator

Purpose: Create automation scripts for Azure DevOps branch policies and CI/CD pipelines.

What it does:

  • Generates bash script to automate Azure DevOps configuration
  • Creates main and development branches with policies
  • Configures code review requirements, merge strategies, and build validation
  • Sets up Azure Pipeline from azure-pipelines.yaml

Key files added:

  • scripts/setup-azure-devops/setup.sh (automation script)
  • scripts/setup-azure-devops/azure-devops.env (configuration variables)
  • scripts/setup-azure-devops/README.md (detailed documentation)

Usage:

yo @cbs-consulting/btp:setup-azure-devops
# Then run: bash scripts/setup-azure-devops/setup.sh

Note: This generator is automatically included when using the CAP generator with Azure DevOps enabled.


Generated Project Structure (CAP)

When using the CAP generator, your project will include:

my-cap-project/
├── .devcontainer/              # Dev container configuration
│   ├── devcontainer.json
│   ├── Dockerfile
│   └── post-create.sh
├── .vscode/                    # VS Code settings & extensions
│   ├── settings.json
│   └── extensions.json
├── app/                        # UI5 applications (from cds init)
├── db/                         # Database models (from cds init)
├── srv/                        # Service definitions (from cds init)
├── mta-ext/                    # MTA extensions for environments
│   ├── dev.mtaext
│   ├── test.mtaext
│   └── prod.mtaext
├── scripts/                    # Automation scripts
│   └── setup-azure-devops/     # Azure DevOps setup (if enabled)
│       ├── setup.sh
│       ├── azure-devops.env
│       └── README.md
├── .gitignore                  # Comprehensive ignore patterns
├── .gitconfig.aliases          # Git workflow aliases
├── .gitattributes              # Line ending configuration
├── .npmrc                      # npm settings
├── azure-pipelines.yaml        # CI/CD pipeline (if enabled)
├── tsconfig.json               # Project TypeScript config
├── eslint.config.mjs           # ESLint configuration
├── prettier.config.mjs         # Prettier configuration
├── mta.yaml                    # MTA deployment descriptor
└── package.json                # Dependencies and scripts

Available Scripts

The CAP generator adds these npm scripts:

Code Quality:

  • npm run format - Format code with Prettier
  • npm run format:check - Check if code is properly formatted
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix auto-fixable ESLint issues

Testing & Building:

  • npm test - Run tests
  • npm run build - Build TypeScript
  • npm run coverage-report - Generate test coverage report

Deployment:

  • npm run build:mta - Build MTA archive
  • npm run deploy-dev - Deploy to dev environment

Utilities:

  • npm run git-config - Set up git aliases
  • npm run check-deps - Check for outdated dependencies
  • npm run upgrade-deps - Upgrade dependencies (minor versions)

Git Hooks:

  • Pre-commit hook automatically runs linting and formatting on staged files

Key Features

  • TypeScript-first with strict compiler settings
  • Code quality enforced via ESLint, Prettier, and pre-commit hooks
  • Git workflows with advanced aliases for ticket-based development
  • MTA deployment with environment-specific configurations
  • Dev containers for reproducible development environments
  • Azure DevOps automation for branch policies and CI/CD
  • VS Code optimized with 30+ recommended extensions
  • UI5 linting with @ui5/linter integration
  • Centralized configs via @cbs-consulting/tools package

Development

To develop this generator locally:

git clone <repository-url>
cd generator-btp
npm install
npm link
yo @cbs-consulting/btp

Run tests:

npm test
npm run test:watch
npm run test:coverage

See DEVELOPMENT.md for more details.