DB UX Design System v3 Core Web is a monorepo containing CSS/SCSS styles, components, and framework-specific implementations (Angular, React, Vue, Web Components) for the Deutsche Bahn design system.
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
- Node.js 24: Check
.nvmrcfile. Usenode --versionto verify current version. - pnpm: Package manager for dependency management and build scripts.
-
CRITICAL: Copy
.env.templateto.envand add your email:cp .env.template .env # Edit .env file: Set COMMIT_MAIL=your.email@example.com -
Install dependencies:
pnpm install
-
Build core packages:
pnpm run build
TIMING: Takes ~30 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
-
Build all framework outputs:
pnpm run build-outputs
TIMING: Takes ~2 minutes. NEVER CANCEL. Set timeout to 300+ seconds.
-
Run tests:
pnpm run testTIMING: Takes ~10 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
-
Start interactive development server:
pnpm run dev
Interactive: Will prompt to select frameworks (plain-html, angular, react, vue, stencil, etc.). Default selection is plain-html. TIMING: Takes ~30 seconds to start. Runs on http://localhost:5173/
-
Start documentation site (Patternhub):
pnpm run start
TIMING: Takes ~2 minutes to start. NEVER CANCEL. Set timeout to 300+ seconds. ACCESS: Runs on http://localhost:3000 - full design system documentation and examples.
pnpm run build # Verify core packages build
pnpm run test # Verify all tests pass, NOTE: May fail for some tests because of a Timeout
pnpm run lint # NOTE: May fail if Nuxt showcase hasn't been run yet - this is known
pnpm run build-outputs # Verify framework outputs buildALWAYS test actual functionality after making changes:
Framework-Specific Validation: Run pnpm run dev and select target framework (react, vue, angular), test component integration in selected framework, verify framework-specific showcase builds: pnpm run build-showcases
Most showcases have a test:ui script that opens Playwright in UI mode for local visual testing:
# Run from the specific showcase directory, e.g.:
cd showcases/react-showcase && pnpm run test:ui
cd showcases/vue-showcase && pnpm run test:ui
cd showcases/angular-showcase && pnpm run test:uiDo NOT run pnpm run regenerate:screenshots locally. Snapshots are generated automatically in CI/CD.
This repository uses Changesets to manage versioning and changelogs.
Always add a new changeset when making changes inside the following folders:
| Folder | Packages to include |
|---|---|
packages/components/src |
@db-ux/core-components, @db-ux/ngx-core-components, @db-ux/react-core-components, @db-ux/wc-core-components, @db-ux/v-core-components |
packages/foundations/scss |
@db-ux/core-foundations |
Use the following bump types for changeset entries:
patch— for bug fixesminor— for new featuresmajor— for breaking changes (e.g. a property in anymodel.tshas been added, removed, renamed, or its type has changed)
Run the following command and follow the interactive prompts:
npx changeset- Select the affected packages (see table above).
- Choose
patch(fix),minor(feature), ormajor(breaking change) as the bump type. - Write a short description of the change.
Alternatively, you can manually create a changeset file in .changeset/ with a unique name (e.g. .changeset/my-change.md) with the packages listed in the YAML frontmatter and the description afterwards:
---
"@db-ux/core-components": minor
---
Short description of the feature.---
"@db-ux/core-components": patch
---
Short description of the fix.---
"@db-ux/core-components": major
---
Short description of the breaking change.- Generate new component:
pnpm run generate:component - Component build location:
packages/components/build/ - Framework outputs:
output/react/,output/vue/,output/angular/,output/stencil/
- Foundation styles:
packages/foundations/ - Component styles:
packages/components/src/styles/ - Build artifacts:
packages/foundations/build/andpackages/components/build/
├── packages/
│ ├── foundations/ # Base CSS/SCSS styles and design tokens
│ ├── components/ # Component CSS and build definitions
│ ├── migration/ # Migration utilities between versions
│ └── stylelint/ # DB UX Design System Stylelint plugin for QS
├── output/ # Framework-specific generated code
│ ├── angular/ # Angular components (@db-ux/ngx-core-components)
│ ├── react/ # React components (@db-ux/react-core-components)
│ ├── vue/ # Vue 3 components (@db-ux/v-core-components)
│ └── stencil/ # Web Components (@db-ux/wc-core-components)
├── showcases/ # Example applications for each framework
└── docs/ # Documentation files
# Development
pnpm run dev # Interactive dev server (framework selection)
pnpm run start # Start Patternhub documentation site
# Building
pnpm run build # Build core packages (~30 seconds)
pnpm run build-outputs # Build all framework outputs (~2 minutes)
pnpm run build-showcases # Build example applications
# Testing & Quality
pnpm run test # Run test suite (~10 seconds)
pnpm run lint # Run all linters (known issue: may fail if Nuxt showcase hasn't been run yet; see "Known Issues and Workarounds" below)
# Utilities
pnpm run clean # Clean build artifacts
pnpm run generate:component # Generate new component scaffolding- chromedriver fails: Use
pnpm install --ignore-scripts- this is expected in restricted network environments - Font decoding fails: Expected with placeholder credentials - does not affect basic development
- Nuxt-related linting failures: May fail if Nuxt showcase hasn't been run yet (requires
showcases/nuxt-showcase/.nuxt/tsconfig.jsonto be generated) - Stencil warnings: Component prop name conflicts are expected and documented
Husky blocking git commit: To prevent Husky blocking commits due to missing COMMIT_MAIL within .env file, just add --no-verify to your git commit command:
git commit -m "Your commit message" --no-verify- Asset downloads: DB Theme assets require valid credentials from Deutsche Bahn Marketing Portal
If possible, start by writing a test that you could use to verify your solution, as well as we could use for ongoing regression testing throughout the product's development.
pnpm run generate:component- Follow interactive prompts- Implement component in
packages/components/src/components/[name]/ - Build and test:
pnpm run build && pnpm run test - Generate framework outputs:
pnpm run build-outputs - Test in development server:
pnpm run dev
- Make changes in
packages/components/src/components/[name]/ - Update examples in
packages/components/src/components/[name]/examples/; showcase files are generated from these and must not be edited manually. - Always run:
pnpm run build && pnpm run dev - Manual validation: Test component behavior in browser
- Before committing:
pnpm run test && pnpm run build-outputs
- Check Node.js version: Must be v24 (see
.nvmrc) - Clean rebuild:
pnpm run clean && pnpm run build - Check dependencies:
pnpm install --ignore-scripts - Isolate issue: Build individual packages using workspace commands
Remember: This is a design system used by Deutsche Bahn applications. Always ensure changes maintain accessibility, consistency, and brand compliance.
- Use
!cancelled()instead ofalways()for controlling the step execution in GitHub Actions. This ensures that steps are skipped if the workflow run has been cancelled, preventing unnecessary execution and resource usage.
packages/agent-cli/AGENTS.md— CLI tool for generating AI agent instructionspackages/components/AGENTS.md— component authoring, Mitosis, changeset rulespackages/foundations/AGENTS.md— design tokens, assets, SCSS structurepackages/migration/AGENTS.md— migration CLI developmentpackages/postcss-plugin/AGENTS.md— PostCSS flatten pluginpackages/stylelint/AGENTS.md— Stylelint plugin rulespackages/vite-plugin/AGENTS.md— Vite plugin for optimized CSSpackages/eslint-plugin/AGENTS.md— ESLint plugin rule developmentpackages/mcp-server/AGENTS.md— MCP server development
Keep package-level AGENTS.md files up to date. When making changes inside a packages/* folder that affect architecture, structure, workflows, or conventions (e.g. adding a new plugin system, deprecating a pattern, introducing a new shared abstraction), update the corresponding AGENTS.md in that package as part of the same commit.
When an agent completes a task and commits + pushes to a branch, it must follow this workflow:
Before committing, go through every item in .github/PULL_REQUEST_TEMPLATE.md and verify it applies to your changes. Do not commit if any applicable item is unresolved.
git add .
git commit -m "<type>: <short description>" -m "<summary of what changed and why>"
git push origin <branch-name>Branch names must use
-as separator (e.g.feat-my-feature,fix-button-style). Never use/— it breaks preview URLs.The second
-mis the commit body. Always include a concise summary of what was changed and why. This is used as the PR description.If Husky blocks the commit due to a missing
.env, add--no-verify(see "Git hook issues" above).
When opening a pull request, use .github/PULL_REQUEST_TEMPLATE.md as the PR body. Fill in the Proposed changes section with a concise summary of:
- What was changed and why
- The linked issue number (if applicable)
- Any notable decisions or trade-offs made
Check every checklist item that applies to the changes made.
Example:
## Proposed changes
Adds `no-missing-label` ESLint rule for `DBInput` that reports when the `label` prop is missing.
Covers React, Angular, and Vue. Includes unit tests and README documentation.
resolves #123