Skip to content

Commit e7b1bc0

Browse files
authored
Merge branch 'main' into 4934-dbcard-global-styles-overwrite-all-inherit-styles-for-dbcard
2 parents 83c49c6 + 34210c8 commit e7b1bc0

38 files changed

+373
-285
lines changed

.github/copilot-instructions.md

Lines changed: 82 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,81 @@ DB UX Design System v3 Core Web is a monorepo containing CSS/SCSS styles, compon
77
## Working Effectively
88

99
### Required Prerequisites
10+
1011
- **Node.js 24**: Check `.nvmrc` file. Use `node --version` to verify current version.
1112
- **npm**: Package manager for dependency management and build scripts.
1213

1314
### Bootstrap and Setup
15+
1416
1. **CRITICAL**: Copy `.env.template` to `.env` and add your email:
15-
```bash
16-
cp .env.template .env
17-
# Edit .env file: Set [email protected]
18-
```
17+
18+
```bash
19+
cp .env.template .env
20+
# Edit .env file: Set [email protected]
21+
```
1922

2023
2. **Install dependencies**:
21-
```bash
22-
npm install --ignore-scripts
23-
24-
**NOTE**: Use the `--ignore-scripts` flag because the chromedriver package attempts to download binaries during installation, which fails in restricted corporate networks (e.g., behind firewalls or proxies). This workaround prevents installation errors in such environments.
24+
25+
```bash
26+
npm install --ignore-scripts
27+
```
28+
29+
**NOTE**: Use the `--ignore-scripts` flag because the chromedriver package attempts to download binaries during installation, which fails in restricted corporate networks (e.g., behind firewalls or proxies). This workaround prevents installation errors in such environments.
2530

2631
3. **Decode DB Theme assets** (optional for basic development):
27-
```bash
28-
node node_modules/@db-ux/db-theme-fonts/build/scripts/index.js
29-
node node_modules/@db-ux/db-theme-icons/build/scripts/index.js
30-
node node_modules/@db-ux/db-theme-illustrative-icons/build/scripts/index.js
31-
```
32-
**NOTE**: These will fail with placeholder credentials in `.env` but are not required for basic development.
32+
```bash
33+
node node_modules/@db-ux/db-theme-fonts/build/scripts/index.js
34+
node node_modules/@db-ux/db-theme-icons/build/scripts/index.js
35+
node node_modules/@db-ux/db-theme-illustrative-icons/build/scripts/index.js
36+
```
37+
**NOTE**: These will fail with placeholder credentials in `.env` but are not required for basic development.
3338

3439
### Build and Test
40+
3541
- **Build core packages**:
36-
```bash
37-
npm run build
38-
```
39-
**TIMING**: Takes ~30 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
42+
43+
```bash
44+
npm run build
45+
```
46+
47+
**TIMING**: Takes ~30 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
4048

4149
- **Build all framework outputs**:
42-
```bash
43-
npm run build-outputs
44-
```
45-
**TIMING**: Takes ~2 minutes. NEVER CANCEL. Set timeout to 300+ seconds.
50+
51+
```bash
52+
npm run build-outputs
53+
```
54+
55+
**TIMING**: Takes ~2 minutes. NEVER CANCEL. Set timeout to 300+ seconds.
4656

4757
- **Run tests**:
48-
```bash
49-
npm run test
50-
```
51-
**TIMING**: Takes ~10 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
58+
```bash
59+
npm run test
60+
```
61+
**TIMING**: Takes ~10 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
5262

5363
### Development
64+
5465
- **Start interactive development server**:
55-
```bash
56-
npm run dev
57-
```
58-
**Interactive**: Will prompt to select frameworks (plain-html, angular, react, vue, stencil, etc.). Default selection is plain-html.
59-
**TIMING**: Takes ~30 seconds to start. Runs on <http://localhost:5173/>
66+
67+
```bash
68+
npm run dev
69+
```
70+
71+
**Interactive**: Will prompt to select frameworks (plain-html, angular, react, vue, stencil, etc.). Default selection is plain-html.
72+
**TIMING**: Takes ~30 seconds to start. Runs on <http://localhost:5173/>
6073

6174
- **Start documentation site (Patternhub)**:
62-
```bash
63-
npm run start
64-
```
65-
**TIMING**: Takes ~2 minutes to start. NEVER CANCEL. Set timeout to 300+ seconds.
66-
**ACCESS**: Runs on <http://localhost:3000> - full design system documentation and examples.
75+
```bash
76+
npm run start
77+
```
78+
**TIMING**: Takes ~2 minutes to start. NEVER CANCEL. Set timeout to 300+ seconds.
79+
**ACCESS**: Runs on <http://localhost:3000> - full design system documentation and examples.
6780

6881
## Validation
6982

7083
### Always Run These Commands Before Committing
84+
7185
```bash
7286
npm run build # Verify core packages build
7387
npm run test # Verify all tests pass
@@ -76,43 +90,49 @@ npm run build-outputs # Verify framework outputs build
7690
```
7791

7892
### Manual Validation Scenarios
93+
7994
**ALWAYS test actual functionality after making changes:**
8095

8196
1. **Component Development Validation**:
82-
- Run `npm run dev` and select `plain-html`
83-
- Open <http://localhost:5173/> in browser
84-
- Navigate to components and verify visual rendering
85-
- Test interactive components (buttons, forms, etc.)
97+
- Run `npm run dev` and select `plain-html`
98+
- Open <http://localhost:5173/> in browser
99+
- Navigate to components and verify visual rendering
100+
- Test interactive components (buttons, forms, etc.)
86101

87102
2. **Documentation Site Validation**:
88-
- Run `npm run start`
89-
- Open <http://localhost:3000> in browser
90-
- Navigate through component documentation
91-
- Verify code examples render correctly
103+
- Run `npm run start`
104+
- Open <http://localhost:3000> in browser
105+
- Navigate through component documentation
106+
- Verify code examples render correctly
92107

93108
3. **Framework-Specific Validation**:
94-
- Run `npm run dev` and select target framework (react, vue, angular)
95-
- Test component integration in selected framework
96-
- Verify framework-specific showcase builds: `npm run build-showcases`
109+
- Run `npm run dev` and select target framework (react, vue, angular)
110+
- Test component integration in selected framework
111+
- Verify framework-specific showcase builds: `npm run build-showcases`
97112

98113
### Visual Regression Testing
114+
99115
**E2E testing with Playwright** (requires Docker):
116+
100117
```bash
101118
# Generate/update screenshots:
102119
npm run regenerate:screenshots
103120
# Test visual regression:
104121
docker-compose --file ./e2e/docker-compose.yml up
105122
```
123+
106124
**TIMING**: Visual tests take 10+ minutes. NEVER CANCEL. Set timeout to 1800+ seconds.
107125

108126
## Common Tasks
109127

110128
### Working with Components
129+
111130
- **Generate new component**: `npm run generate:component`
112131
- **Component build location**: `packages/components/build/`
113132
- **Framework outputs**: `output/react/`, `output/vue/`, `output/angular/`, `output/stencil/`
114133

115134
### Working with Styles
135+
116136
- **Foundation styles**: `packages/foundations/`
117137
- **Component styles**: `packages/components/src/styles/`
118138
- **Build artifacts**: `packages/foundations/build/` and `packages/components/build/`
@@ -136,6 +156,7 @@ docker-compose --file ./e2e/docker-compose.yml up
136156
```
137157

138158
### Package Scripts Reference
159+
139160
```bash
140161
# Development
141162
npm run dev # Interactive dev server (framework selection)
@@ -159,14 +180,25 @@ npm run generate:component # Generate new component scaffolding
159180
## Known Issues and Workarounds
160181

161182
### Installation Issues
183+
162184
- **chromedriver fails**: Use `npm install --ignore-scripts` - this is expected in restricted network environments
163185
- **Font decoding fails**: Expected with placeholder credentials - does not affect basic development
164186

165187
### Build Issues
188+
166189
- **Nuxt-related linting failures**: May fail if Nuxt showcase hasn't been run yet (requires `showcases/nuxt-showcase/.nuxt/tsconfig.json` to be generated)
167190
- **Stencil warnings**: Component prop name conflicts are expected and documented
168191
192+
### Git hook issues
193+
194+
**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:
195+
196+
```bash
197+
git commit -m "Your commit message" --no-verify
198+
```
199+
169200
### Network Restrictions
201+
170202
- **Docker registry access**: E2E testing requires Docker and may need proxy configuration
171203
- **Asset downloads**: DB Theme assets require valid credentials from Deutsche Bahn Marketing Portal
172204
@@ -175,20 +207,23 @@ npm run generate:component # Generate new component scaffolding
175207
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.
176208

177209
### Adding a New Component
210+
178211
1. `npm run generate:component` - Follow interactive prompts
179212
2. Implement component in `packages/components/src/components/[name]/`
180213
3. Build and test: `npm run build && npm run test`
181214
4. Generate framework outputs: `npm run build-outputs`
182215
5. Test in development server: `npm run dev`
183216

184217
### Modifying Existing Components
218+
185219
1. Make changes in `packages/components/src/components/[name]/`
186220
2. Adapt those changes into the `showcases/vue-showcase`, `showcases/angular-showcase` and `showcases/react-showcase` folders.
187221
3. **Always run**: `npm run build && npm run dev`
188222
4. **Manual validation**: Test component behavior in browser
189223
5. **Before committing**: `npm run test && npm run build-outputs`
190224

191225
### Debugging Build Issues
226+
192227
1. **Check Node.js version**: Must be v24 (see `.nvmrc`)
193228
2. **Clean rebuild**: `npm run clean && npm run build`
194229
3. **Check dependencies**: `npm install --ignore-scripts`

.github/workflows/codeql.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '23 2 * * 2'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: actions
47+
build-mode: none
48+
- language: javascript-typescript
49+
build-mode: none
50+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v5
61+
62+
# Add any setup steps before running the `github/codeql-action/init` action.
63+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
64+
# or others). This is typically only required for manual builds.
65+
# - name: Setup runtime (example)
66+
# uses: actions/setup-example@v1
67+
68+
# Initializes the CodeQL tools for scanning.
69+
- name: Initialize CodeQL
70+
uses: github/codeql-action/init@v3
71+
with:
72+
languages: ${{ matrix.language }}
73+
build-mode: ${{ matrix.build-mode }}
74+
# If you wish to specify custom queries, you can do so here or in a config file.
75+
# By default, queries listed here will override any specified in a config file.
76+
# Prefix the list here with "+" to use these queries and those in the config file.
77+
78+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79+
# queries: security-extended,security-and-quality
80+
81+
# If the analyze step fails for one of the languages you are analyzing with
82+
# "We were unable to automatically build your code", modify the matrix above
83+
# to set the build mode to "manual" for that language. Then modify this step
84+
# to build your code.
85+
# ℹ️ Command-line programs to run using the OS shell.
86+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87+
- if: matrix.build-mode == 'manual'
88+
shell: bash
89+
run: |
90+
echo 'If you are using a "manual" build mode for one or more of the' \
91+
'languages you are analyzing, replace this with the commands to build' \
92+
'your code, for example:'
93+
echo ' make bootstrap'
94+
echo ' make release'
95+
exit 1
96+
97+
- name: Perform CodeQL Analysis
98+
uses: github/codeql-action/analyze@v3
99+
with:
100+
category: "/language:${{matrix.language}}"

.github/workflows/default.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ jobs:
218218
uses: ./.github/workflows/02-e2e-regenerated-snapshots-commit.yml
219219
secrets: inherit
220220
if: |
221-
needs.regenerate-snapshots-components.result == 'success' ||
222-
needs.regenerate-snapshots-foundations.result == 'success' ||
223-
needs.regenerate-snapshots-patternhub.result == 'success' ||
224-
needs.regenerate-snapshots.result == 'success'
221+
${{ !cancelled() &&
222+
( needs.regenerate-snapshots-components.result == 'success' ||
223+
needs.regenerate-snapshots-foundations.result == 'success' ||
224+
needs.regenerate-snapshots-patternhub.result == 'success' ||
225+
needs.regenerate-snapshots.result == 'success' )
226+
}}
225227
needs:
226228
[
227229
regenerate-snapshots-components,
Loading
110 Bytes
Loading
100 Bytes
Loading
-6 Bytes
Loading
-11 Bytes
Loading
-9 Bytes
Loading
-6 Bytes
Loading

0 commit comments

Comments
 (0)