Skip to content

Commit 2902391

Browse files
committed
Merge remote-tracking branch 'origin/42-integrate-changeset' into chore-changesets-dryrun
2 parents 75eaaf8 + b33e196 commit 2902391

File tree

62 files changed

+7881
-5341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+7881
-5341
lines changed

.changeset/README.md

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npx changeset
3333
You’ll be prompted to:
3434

3535
- Select affected packages
36-
- Choose the bump type (patch, minor, major)
36+
- Choose the bump/release type (patch, minor, major)
3737
- Provide a short summary for the changelog
3838

3939
This creates a file like `.changeset/abcd123.md.`
@@ -43,15 +43,14 @@ This creates a file like `.changeset/abcd123.md.`
4343

4444
- Every PR that changes published code must include a changeset file.
4545
- CI will check that at least one changeset exists when relevant.
46-
- If your PR introduces a minor or major change, you may need to add the release:approved label to satisfy the approval gate.
4746

4847
### 3. Release PRs
4948

50-
When PRs are merged into main, the Release workflow will:
49+
When PRs are merged into `main` branch, the Release workflow will:
5150

5251
- Collect pending changesets
5352
- Open (or update) a Release PR called “Version Packages”
54-
- Run changeset version to bump versions and update changelogs
53+
- Run `changeset version` to bump versions and update changelogs
5554

5655
This PR should be reviewed like any other:
5756

@@ -62,12 +61,13 @@ Once everything looks good, merge the Release PR.
6261

6362
### 4. Publishing
6463

65-
After the Release PR is merged into main:
64+
After the Release PR is merged into `main` branch:
6665

67-
- CI will build the packages (build-outputs)
68-
- Run the publish script (scripts/github/publish-npm.js)
69-
- Publish new versions to npm with the tag latest (or next for pre-releases)
66+
- CI will build the packages (`build-outputs`)
67+
- Run the publish script (`scripts/github/publish-npm.js`)
68+
- Publish new versions to npm with the tag `latest` (or `next` for pre-releases)
7069
- Push git tags
70+
- Create a [GitHub Release](https://github.com/db-ux-design-system/core-web/releases)
7171

7272
You don’t have to run anything manually, it’s handled by CI.
7373

@@ -77,48 +77,73 @@ You don’t have to run anything manually, it’s handled by CI.
7777

7878
- **Always add a changeset**
7979

80-
If your code change affects published packages, create a changeset.
80+
If your code change affects published packages, create a changeset.
8181

8282
No changeset → no version bump → no release.
8383

8484
- **Choose the correct bump type**
8585
- patch: bugfix, no API or HTML changes
86-
- minor: new features, changes in markup or behavior, backwards-compatible
87-
- major: breaking changes (removed props, changed APIs)
86+
- minor: new features, changes in inner component markup or behavior, backwards-compatible
87+
- major: breaking changes (e.g. removed props, changed APIs)
8888

8989
- **Write user-friendly summaries**
9090

91-
The text you provide will be copied into the CHANGELOG.md. Keep it concise and helpful.
91+
The text you provide will be copied into the `CHANGELOG.md`. Keep it concise and helpful.
9292

9393
- **One changeset per PR**
9494

9595
Usually you only need one. If a PR touches multiple packages with different bump types, a single changeset can cover them all.
9696

97-
- **Approval for larger changes**
98-
99-
If you mark something as minor or major, make sure the PR gets the release:approved label before merge.
100-
10197
- **Baseline snapshots**
10298

103-
HTML snapshots help detect markup changes. If they change, prefer minor instead of patch.
99+
ARIA snapshots by Playwright help detect markup changes. If they change, prefer minor instead of patch.
100+
And please mention those HTML changes within the `CHANGELOG` or of necessary (like bigger changes) in a [migration guide](https://github.com/db-ux-design-system/core-web/tree/main/docs/migration).
104101

105102
- **Avoid manual version bumps**
106103

107-
Never edit package.json versions by hand. Changesets handles this automatically.
104+
Never edit `package.json` `version` field by hand. Changesets handles this automatically.
108105

109106
---
110107

111108
## 🚧 Pre-Releases
112109

113-
For pre-releases (tagged next):
110+
For [pre-releases](https://github.com/changesets/changesets/blob/main/docs/prereleases.md) (tagged `next`):
114111

115112
```bash
116113
npx changeset pre enter next
117114
# work as usual, add changesets, publish...
118115
npx changeset pre exit
119116
```
120117

121-
CI will publish with tag next. Useful for testing before a stable release.
118+
CI will publish with tag `next`. Useful for testing before a stable release.
119+
120+
---
121+
122+
## 📸 Snapshot Checks
123+
124+
- CI monitors changes in snapshot files (`__snapshots__/**/*.png`, `__snapshots__/**/*.yml`).
125+
- If snapshots are changed, the pipeline enforces at least a minor or major bump in your changeset.
126+
- Snapshot changes usually mean visual or markup changes, these should never be published as just a patch.
127+
- If only a patch bump is detected, the PR will be blocked with an error:
128+
129+
“PNG/YML snapshots changed. Please bump at least MINOR in your changeset.”
130+
131+
## ✅ How to handle this
132+
133+
1. If the snapshot changes are intentional (e.g. new component, markup updates, visual updates):
134+
135+
- Run npx changeset
136+
- Select at least minor or major
137+
- Commit the changes
138+
139+
2. If the snapshot changes are unintentional (e.g. test noise, local mismatches):
140+
141+
- Revert or update the snapshots correctly
142+
- Commit the fixed snapshots, the pipeline should pass afterwards
143+
144+
## 🔒 Approval Gate
145+
146+
- For PRs containing any version bumps (patch, minor or major releases), the PR requires explicit approval (as all other PRs).
122147

123148
---
124149

@@ -135,7 +160,7 @@ npx changeset
135160
npx changeset status --verbose
136161

137162
# Apply version bumps and changelogs
138-
npm run release:version
163+
npx changeset version
139164

140165
# Publish (if you want to do it locally, not in CI)
141166
npm run release:publish
@@ -149,8 +174,9 @@ npx changeset pre exit # exit prerelease
149174

150175
## 📂 File Overview
151176

152-
- .changeset/ → contains pending changesets (.md files)
153-
- package.json → versions are updated here automatically
154-
- CHANGELOG.md → updated by changeset version
155-
- .github/workflows/release.yml → automation for Release PRs & publishing
156-
- scripts/github/publish-npm.js → custom publish script (packs & publishes built outputs)
177+
- `.changeset/` → contains pending changesets (`.md` files)
178+
- `package.json` → versions are updated automatically in this file
179+
- `CHANGELOG.md` → updated by changeset version
180+
- `.github/workflows/changesets-release-pr.yml` → automation for Release PRs & publishing
181+
- `.github/workflows/pull-request-snapshot-diff.yml` → validates changes in PNG/YML snapshots and enforces at least a MINOR bump
182+
- `scripts/github/publish-npm.js` → custom publish script (packs & publishes built outputs)

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3-
"changelog": "@changesets/changelog-git",
3+
"changelog": "@changesets/changelog-github",
44
"commit": true,
55
"fixed": [],
66
"linked": [
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@db-ux/core-components": minor
3+
---
4+
5+
refactor(select): not hiding the first `option` HTML element anymore

.changeset/old-wings-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@db-ux/core-components": minor
3+
---
4+
5+
feat(Custom Select): Add Enter key support for keyboard navigation

.changeset/plenty-adults-unite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@db-ux/core-components": minor
3+
---
4+
5+
feat(DBInput): add `enterkeyhint` and `inputmode` attributes

.config/.lintstagedrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export default {
99
// And elsewhere we don't, compare to https://github.com/stylelint/stylelint/pull/8009
1010
'*.{css,scss}': 'stylelint --fix --allow-empty-input --no-validate',
1111
'*.{js,ts,tsx,jsx,mjs,cjs}': 'xo --fix',
12-
// ensure that security vulnerabilities are fixed before committing
13-
'package-lock.json': 'npm audit fix --omit=dev'
12+
// ensure that security vulnerabilities are fixed before committing - we need to skip `dev` for the moment as there are some unsolveable conflicts
13+
'package-lock.json': 'npm audit fix --omit=dev',
14+
// ensure that lock file is up to date
15+
'**/package.json': () => 'npm install --package-lock-only --ignore-scripts',
1416
};

.github/copilot-instructions.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# DB UX Design System v3 Core Web
2+
3+
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.
4+
5+
**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.**
6+
7+
## Working Effectively
8+
9+
### Required Prerequisites
10+
- **Node.js 24**: Check `.nvmrc` file. Use `node --version` to verify current version.
11+
- **npm**: Package manager for dependency management and build scripts.
12+
13+
### Bootstrap and Setup
14+
1. **CRITICAL**: Copy `.env.template` to `.env` and add your email:
15+
```bash
16+
cp .env.template .env
17+
# Edit .env file: Set COMMIT_MAIL=your.email@example.com
18+
```
19+
20+
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.
25+
26+
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.
33+
34+
### Build and Test
35+
- **Build core packages**:
36+
```bash
37+
npm run build
38+
```
39+
**TIMING**: Takes ~30 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
40+
41+
- **Build all framework outputs**:
42+
```bash
43+
npm run build-outputs
44+
```
45+
**TIMING**: Takes ~2 minutes. NEVER CANCEL. Set timeout to 300+ seconds.
46+
47+
- **Run tests**:
48+
```bash
49+
npm run test
50+
```
51+
**TIMING**: Takes ~10 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
52+
53+
### Development
54+
- **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/>
60+
61+
- **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.
67+
68+
## Validation
69+
70+
### Always Run These Commands Before Committing
71+
```bash
72+
npm run build # Verify core packages build
73+
npm run test # Verify all tests pass
74+
npm run lint # NOTE: May fail if Nuxt showcase hasn't been run yet - this is known
75+
npm run build-outputs # Verify framework outputs build
76+
```
77+
78+
### Manual Validation Scenarios
79+
**ALWAYS test actual functionality after making changes:**
80+
81+
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.)
86+
87+
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
92+
93+
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`
97+
98+
### Visual Regression Testing
99+
**E2E testing with Playwright** (requires Docker):
100+
```bash
101+
# Generate/update screenshots:
102+
npm run regenerate:screenshots
103+
# Test visual regression:
104+
docker-compose --file ./e2e/docker-compose.yml up
105+
```
106+
**TIMING**: Visual tests take 10+ minutes. NEVER CANCEL. Set timeout to 1800+ seconds.
107+
108+
## Common Tasks
109+
110+
### Working with Components
111+
- **Generate new component**: `npm run generate:component`
112+
- **Component build location**: `packages/components/build/`
113+
- **Framework outputs**: `output/react/`, `output/vue/`, `output/angular/`, `output/stencil/`
114+
115+
### Working with Styles
116+
- **Foundation styles**: `packages/foundations/`
117+
- **Component styles**: `packages/components/src/styles/`
118+
- **Build artifacts**: `packages/foundations/build/` and `packages/components/build/`
119+
120+
### Key Repository Locations
121+
122+
```text
123+
├── packages/
124+
│ ├── foundations/ # Base CSS/SCSS styles and design tokens
125+
│ ├── components/ # Component CSS and build definitions
126+
│ ├── migration/ # Migration utilities between versions
127+
│ └── stylelint/ # DB UX Design System Stylelint plugin for QS
128+
├── output/ # Framework-specific generated code
129+
│ ├── angular/ # Angular components (@db-ux/ngx-core-components)
130+
│ ├── react/ # React components (@db-ux/react-core-components)
131+
│ ├── vue/ # Vue 3 components (@db-ux/v-core-components)
132+
│ └── stencil/ # Web Components (@db-ux/wc-core-components)
133+
├── showcases/ # Example applications for each framework
134+
├── e2e/ # End-to-end testing with Playwright
135+
└── docs/ # Documentation files
136+
```
137+
138+
### Package Scripts Reference
139+
```bash
140+
# Development
141+
npm run dev # Interactive dev server (framework selection)
142+
npm run start # Start Patternhub documentation site
143+
144+
# Building
145+
npm run build # Build core packages (~30 seconds)
146+
npm run build-outputs # Build all framework outputs (~2 minutes)
147+
npm run build-showcases # Build example applications
148+
149+
# Testing & Quality
150+
npm run test # Run test suite (~10 seconds)
151+
npm run lint # Run all linters (known issue: may fail if Nuxt showcase hasn't been run yet; see "Known Issues and Workarounds" below)
152+
npm run regenerate:screenshots # Update visual regression tests material
153+
154+
# Utilities
155+
npm run clean # Clean build artifacts
156+
npm run generate:component # Generate new component scaffolding
157+
```
158+
159+
## Known Issues and Workarounds
160+
161+
### Installation Issues
162+
- **chromedriver fails**: Use `npm install --ignore-scripts` - this is expected in restricted network environments
163+
- **Font decoding fails**: Expected with placeholder credentials - does not affect basic development
164+
165+
### Build Issues
166+
- **Nuxt-related linting failures**: May fail if Nuxt showcase hasn't been run yet (requires `showcases/nuxt-showcase/.nuxt/tsconfig.json` to be generated)
167+
- **Stencil warnings**: Component prop name conflicts are expected and documented
168+
169+
### Network Restrictions
170+
- **Docker registry access**: E2E testing requires Docker and may need proxy configuration
171+
- **Asset downloads**: DB Theme assets require valid credentials from Deutsche Bahn Marketing Portal
172+
173+
## Development Workflows
174+
175+
### Adding a New Component
176+
1. `npm run generate:component` - Follow interactive prompts
177+
2. Implement component in `packages/components/src/components/[name]/`
178+
3. Build and test: `npm run build && npm run test`
179+
4. Generate framework outputs: `npm run build-outputs`
180+
5. Test in development server: `npm run dev`
181+
182+
### Modifying Existing Components
183+
1. Make changes in `packages/components/src/components/[name]/`
184+
2. Adapt those changes into the `showcases/vue-showcase`, `showcases/angular-showcase` and `showcases/react-showcase` folders.
185+
3. **Always run**: `npm run build && npm run dev`
186+
4. **Manual validation**: Test component behavior in browser
187+
5. **Before committing**: `npm run test && npm run build-outputs`
188+
189+
### Debugging Build Issues
190+
1. **Check Node.js version**: Must be v24 (see `.nvmrc`)
191+
2. **Clean rebuild**: `npm run clean && npm run build`
192+
3. **Check dependencies**: `npm install --ignore-scripts`
193+
4. **Isolate issue**: Build individual packages using workspace commands
194+
195+
Remember: This is a design system used by Deutsche Bahn applications. Always ensure changes maintain accessibility, consistency, and brand compliance.

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ updates:
3838
update-types: ["version-update:semver-minor"]
3939
# There is an issue with sass:1.77.5 and additional colors in foundations we ignore updates for now
4040
- dependency-name: "sass"
41-
# We currently need to ignore eslint@v9
42-
- dependency-name: "eslint"
43-
update-types: ["version-update:semver-major"]
4441
pull-request-branch-name:
4542
separator: "-"
4643
# https://github.com/dependabot/dependabot-core/issues/5226#issuecomment-1179434437

0 commit comments

Comments
 (0)