Prepare Frost 1.0.0 release candidate
CI / Test and package (push) Successful in 1m29s
Release and RC / Verify and publish (push) Failing after 6m12s

This commit is contained in:
2026-11-21 14:48:53 +01:00
parent ebfd15796f
commit 50fe5ec2e9
66 changed files with 577 additions and 22 deletions
+49
View File
@@ -0,0 +1,49 @@
name: Release and RC
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
publish:
name: Verify and publish
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: mcr.microsoft.com/playwright:v1.65.1-noble
steps:
- name: Check out tagged source
uses: actions/checkout@v4
- name: Configure Node and npm registry
uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Install locked dependencies
run: npm ci
- name: Verify tag and select npm channel
id: release
shell: bash
run: |
channel="$(node scripts/check-release-tag.mjs "${{ gitea.ref_name }}")"
echo "channel=${channel}" >> "${GITHUB_OUTPUT}"
- name: Run the complete release contract
run: npm run test:release
- name: Verify generated contracts are committed
run: git diff --exit-code -- utilities.css public-api.json package-lock.json
- name: Publish package
run: npm publish --tag "${{ steps.release.outputs.channel }}" --access public
env:
NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}"
+3
View File
@@ -1,4 +1,7 @@
node_modules/ node_modules/
playwright-report/ playwright-report/
test-results/ test-results/
.idea/
dist/
*.tgz
+6 -1
View File
@@ -1,6 +1,6 @@
# Changelog # Changelog
## 0.5.0 ## 1.0.0-rc.1
- Added a generated utility layer for layout, spacing, typography, colors, borders, shadows, responsive breakpoints, and interaction states. - Added a generated utility layer for layout, spacing, typography, colors, borders, shadows, responsive breakpoints, and interaction states.
- Added standalone package exports for tokens, components, utilities, and base styles. - Added standalone package exports for tokens, components, utilities, and base styles.
@@ -9,6 +9,11 @@
- Expanded the example page and validation checks for the public API. - Expanded the example page and validation checks for the public API.
- Added a generated public API manifest, breaking-change detection, release metadata validation, and isolated tarball consumer tests. - Added a generated public API manifest, breaking-change detection, release metadata validation, and isolated tarball consumer tests.
- Added forced-colors support with system-color mappings, non-color state cues, catalog guidance, and component-level Playwright regressions. - Added forced-colors support with system-color mappings, non-color state cues, catalog guidance, and component-level Playwright regressions.
- Made the built, import-free stylesheet the default package export while retaining modular source exports.
- Added Chromium, Firefox, and WebKit release coverage plus a real PostCSS tarball-consumer build.
- Added tag-verified npm release automation with `next` for release candidates and `latest` for stable releases.
- Added browser, SemVer, deprecation, migration, and release-candidate support contracts.
- Extended public API breaking-change detection to cover keyframe names.
## 0.4.0 ## 0.4.0
+36
View File
@@ -0,0 +1,36 @@
# Migrating from Frost 0.4 to 1.0
Frost 1.0 keeps the existing component and token names and adds a formal public API contract. The main packaging change is the default entrypoint.
## Default import
`@fretuks/frost` now resolves to the built, import-free `dist/frost.css` bundle. Existing imports normally continue to work:
```css
@import "@fretuks/frost";
```
If a build intentionally depended on the modular source entrypoint, use:
```css
@import "@fretuks/frost/frost.css";
```
The explicit `core`, `utility-layer`, `component-layer`, `tokens`, `components`, `utilities`, and `forced-colors` exports remain available. Bundled aliases are available as `@fretuks/frost/bundle` and `@fretuks/frost/bundle.min`. Import-free layer bundles are exported under `@fretuks/frost/dist/utility-layer.css` and `@fretuks/frost/dist/component-layer.css`, with matching `.min.css` variants.
## New behavior to verify
- Check custom themes in `forced-colors: active` and `prefers-contrast: more`.
- Confirm interactive code still synchronizes `hidden`, `aria-expanded`, tab selection, and dialog focus; Frost supplies styles rather than behavior.
- Review newly strengthened disabled, validation, current-page, and focus states.
- If application CSS targets internal selectors instead of documented `frost-*` classes and properties, move those overrides to the public semantic tokens.
## Release-candidate installation
Install the candidate without changing the stable npm tag:
```bash
npm install @fretuks/frost@next
```
Run the application in Chromium, Firefox, and Safari/WebKit before promoting the exact candidate commit to `1.0.0`.
+21 -4
View File
@@ -2,6 +2,8 @@
Frost ist eine kleine CSS-Basis für persönliche Websites und Web-Apps. Sie bringt Tokens, zugängliche Grundstyles, Utility-Klassen, Layout-Helfer, Controls und fertige Komponenten mit. Du kannst Frost also entweder eher wie Tailwind mit einzelnen Utilities oder eher wie Bootstrap mit Komponenten verwenden. Frost ist eine kleine CSS-Basis für persönliche Websites und Web-Apps. Sie bringt Tokens, zugängliche Grundstyles, Utility-Klassen, Layout-Helfer, Controls und fertige Komponenten mit. Du kannst Frost also entweder eher wie Tailwind mit einzelnen Utilities oder eher wie Bootstrap mit Komponenten verwenden.
Die aktuelle 1.0-Vorabversion wird über den npm-Tag `next` veröffentlicht. Installiere sie mit `npm install @fretuks/frost@next`. Hinweise für bestehende 0.4-Projekte stehen in [MIGRATION.md](MIGRATION.md); Browser-, SemVer- und Deprecation-Verträge in [SUPPORT.md](SUPPORT.md).
## Komponentenkatalog ## Komponentenkatalog
Der interaktive [Komponentenkatalog](examples/index.html) zeigt die öffentliche Komponenten-API mit echten Live-Beispielen, kopierbarem HTML und konkreten Accessibility-Hinweisen. Suche und Theme-Wechsel funktionieren direkt im Browser; Dropdowns, Tabs, Accordions und Modals demonstrieren das erwartete Tastatur- und Fokusverhalten. Der interaktive [Komponentenkatalog](examples/index.html) zeigt die öffentliche Komponenten-API mit echten Live-Beispielen, kopierbarem HTML und konkreten Accessibility-Hinweisen. Suche und Theme-Wechsel funktionieren direkt im Browser; Dropdowns, Tabs, Accordions und Modals demonstrieren das erwartete Tastatur- und Fokusverhalten.
@@ -15,7 +17,7 @@ Frost hat bewusst getrennte Schichten:
- `@fretuks/frost/core`: Tokens, Reset und Accessibility-Grundlagen - `@fretuks/frost/core`: Tokens, Reset und Accessibility-Grundlagen
- `@fretuks/frost/utility-layer`: Core plus Layout- und Utility-first-Klassen - `@fretuks/frost/utility-layer`: Core plus Layout- und Utility-first-Klassen
- `@fretuks/frost/component-layer`: Core plus Controls und fertige Komponenten - `@fretuks/frost/component-layer`: Core plus Controls und fertige Komponenten
- `@fretuks/frost`: alle Schichten zusammen - `@fretuks/frost`: gebündelte, import-freie Ausgabe mit allen Schichten
Für eine statische Website: Für eine statische Website:
@@ -39,6 +41,8 @@ npm install @fretuks/frost
@import "@fretuks/frost"; @import "@fretuks/frost";
``` ```
Der Standardimport zeigt auf `dist/frost.css`. Für die minifizierte Ausgabe gibt es `@fretuks/frost/bundle.min`; die modulare Quell-Entrypoint bleibt unter `@fretuks/frost/frost.css` verfügbar.
Für die Utility-Schicht: Für die Utility-Schicht:
```css ```css
@@ -272,7 +276,7 @@ npm pack --dry-run
`prepack` erzeugt vor jedem Tarball die Utilities und `public-api.json` neu, baut alle Dateien unter `dist/` und prüft anschließend Version, Changelog und API-Vertrag. `npm run test:package` installiert den gebauten Tarball in ein isoliertes temporäres Consumer-Projekt und löst jeden Eintrag aus `package.json#exports` auf. `prepack` erzeugt vor jedem Tarball die Utilities und `public-api.json` neu, baut alle Dateien unter `dist/` und prüft anschließend Version, Changelog und API-Vertrag. `npm run test:package` installiert den gebauten Tarball in ein isoliertes temporäres Consumer-Projekt und löst jeden Eintrag aus `package.json#exports` auf.
`public-api.json` ist die versionierte Baseline für alle öffentlichen `frost-*`-Klassen, `--frost-*`-Properties, CSS-Layer und Paket-Exports. Neue APIs werden mit `npm run generate:api` aufgenommen. Entfernte Klassen, Properties, Layer oder Exportpfade werden als Breaking Change abgelehnt. Für einen bewusst brechenden Release muss die Baseline explizit aktualisiert werden: `public-api.json` ist die versionierte Baseline für alle öffentlichen `frost-*`-Klassen, `--frost-*`-Properties, Keyframes, CSS-Layer und Paket-Exports. Neue APIs werden mit `npm run generate:api` aufgenommen. Entfernte Klassen, Properties, Keyframes, Layer oder Exportpfade werden als Breaking Change abgelehnt. Für einen bewusst brechenden Release muss die Baseline explizit aktualisiert werden:
```bash ```bash
npm run generate:api -- --allow-breaking npm run generate:api -- --allow-breaking
@@ -283,11 +287,11 @@ Nach einer Generierung sollten `utilities.css` und `public-api.json` gemeinsam m
Browser- und Accessibility-Regressionstests laufen mit Playwright und axe-core gegen die Beispielseite. Beim ersten Mal muss Chromium installiert werden: Browser- und Accessibility-Regressionstests laufen mit Playwright und axe-core gegen die Beispielseite. Beim ersten Mal muss Chromium installiert werden:
```bash ```bash
npx playwright install chromium npx playwright install chromium firefox webkit
npm run test:browser npm run test:browser
``` ```
Die Suite prüft Desktop- und Mobile-Ansichten, helle und dunkle Themes, Forced Colors, Tastaturinteraktionen und WCAG-A/AA-Regeln. Die Forced-Colors-Fälle kontrollieren zusätzlich Systemfarb-Mappings sowie sichtbare Fokus-, Fehler-, Auswahl- und Disabled-Zustände. Absichtliche visuelle Änderungen aktualisieren die gespeicherten Referenzbilder mit: Die Suite prüft Chromium, Firefox und WebKit sowie Desktop- und Mobile-Ansichten, helle und dunkle Themes, Forced Colors, Tastaturinteraktionen und WCAG-A/AA-Regeln. Die Forced-Colors-Fälle kontrollieren zusätzlich Systemfarb-Mappings sowie sichtbare Fokus-, Fehler-, Auswahl- und Disabled-Zustände. Pixelbaselines bleiben bewusst Chromium-spezifisch; die anderen Engines laufen durch semantische, interaktive und Accessibility-Prüfungen. Absichtliche visuelle Änderungen aktualisieren die gespeicherten Referenzbilder mit:
```bash ```bash
npm run test:browser:update npm run test:browser:update
@@ -295,6 +299,19 @@ npm run test:browser:update
`npm run test:all` verbindet die schnellen Strukturprüfungen mit den Browser-Tests und ist der empfohlene CI-Einstiegspunkt. `npm run test:all` verbindet die schnellen Strukturprüfungen mit den Browser-Tests und ist der empfohlene CI-Einstiegspunkt.
## Release Candidate und Veröffentlichung
Ein Release wird ausschließlich von einem Tag veröffentlicht, der exakt zur Version in `package.json`, `package-lock.json` und `CHANGELOG.md` passt. `scripts/check-release-tag.mjs` lehnt abweichende Tags ab. Vorabversionen wie `v1.0.0-rc.1` landen automatisch unter `next`; stabile Versionen wie `v1.0.0` unter `latest`.
```bash
npm run check:tag -- v1.0.0-rc.1
npm run test:release
git tag v1.0.0-rc.1
git push origin v1.0.0-rc.1
```
Die Gitea-Release-Action benötigt ein Repository-Secret `NPM_TOKEN` mit Publish-Rechten für `@fretuks/frost`. npm Trusted Publishing unterstützt die selbst gehostete Gitea-Instanz nicht; der Token sollte deshalb granular auf dieses Paket begrenzt und regelmäßig rotiert werden. Nach erfolgreicher RC-Prüfung wird dieselbe Commit-Basis auf `1.0.0` umgestellt, erneut vollständig getestet und als `v1.0.0` getaggt.
Neben dem vollständigen Paket können einzelne Schichten importiert werden: Neben dem vollständigen Paket können einzelne Schichten importiert werden:
```css ```css
+31
View File
@@ -0,0 +1,31 @@
# Frost support contract
## Browser baseline
Frost 1.x supports evergreen browser engines from this minimum baseline:
- Chromium 111, including Microsoft Edge 111
- Firefox 113
- Safari 16.4 and the corresponding WebKit generation
The baseline is aligned with the modern CSS used by Frost, including cascade layers and `color-mix()`. Chromium, Firefox, and WebKit run semantic, interaction, axe, and rendering smoke tests. Forced-colors and increased-contrast assertions run when the engine exposes the relevant emulation and are feature-detected otherwise. Pixel snapshots remain Chromium-only so rendering-engine differences do not produce noisy baselines.
Support means the public styles render and documented component states remain usable. It does not promise pixel-identical output between engines or operating systems.
## Versioning and deprecation
Frost follows Semantic Versioning after 1.0:
- Patch releases fix bugs without intentionally changing the public contract.
- Minor releases may add classes, custom properties, keyframes, layers, and export paths.
- Major releases may remove or change public API after migration guidance has been published.
Public classes, `--frost-*` custom properties, named keyframes, cascade layers, and package exports are recorded in `public-api.json`. A removal or export retarget is rejected unless the manifest is deliberately regenerated with `--allow-breaking`.
Deprecations remain available for at least one minor release and are called out in the changelog before removal. Accessibility regressions are treated as bugs, not breaking changes.
## Security and support requests
Use the repository issue tracker for browser bugs, accessibility problems, and packaging defects. Do not include credentials, private npm tokens, or sensitive application data in reports.
The project ships CSS and build-time validation scripts; it does not execute JavaScript in consumer applications.
+1 -1
View File
@@ -24,7 +24,7 @@
<main class="catalog-main" id="main"> <main class="catalog-main" id="main">
<header class="catalog-hero"> <header class="catalog-hero">
<div><p class="catalog-eyebrow">Frost CSS Framework</p><h1>Komponenten, die sich erklären.</h1><p class="catalog-hero__copy">Jedes Beispiel läuft mit echtem Frost-Markup. Kopiere den HTML-Ausschnitt, prüfe die Zustände und beachte den Accessibility-Vertrag.</p><div class="frost-cluster catalog-hero__meta"><span class="frost-badge frost-badge--info" id="visible-count">9 von 9 Gruppen</span><span class="frost-text-muted">Version 0.5.0</span></div></div> <div><p class="catalog-eyebrow">Frost CSS Framework</p><h1>Komponenten, die sich erklären.</h1><p class="catalog-hero__copy">Jedes Beispiel läuft mit echtem Frost-Markup. Kopiere den HTML-Ausschnitt, prüfe die Zustände und beachte den Accessibility-Vertrag.</p><div class="frost-cluster catalog-hero__meta"><span class="frost-badge frost-badge--info" id="visible-count">9 von 9 Gruppen</span><span class="frost-text-muted">Version 1.0.0-rc.1</span></div></div>
<div class="catalog-hero__actions"><button class="frost-button frost-button--secondary" id="theme-toggle" type="button" aria-pressed="false">Theme wechseln</button></div> <div class="catalog-hero__actions"><button class="frost-button frost-button--secondary" id="theme-toggle" type="button" aria-pressed="false">Theme wechseln</button></div>
</header> </header>
<p class="catalog-empty" id="catalog-empty" role="status" hidden>Keine Komponente passt zu deiner Suche.</p> <p class="catalog-empty" id="catalog-empty" role="status" hidden>Keine Komponente passt zu deiner Suche.</p>
+1 -1
View File
@@ -1,5 +1,5 @@
@layer frost.forced-colors { @layer frost.forced-colors {
@media (prefers-contrast: more) and (forced-colors: none) { @media (prefers-contrast: more) {
:where(.frost-button, .frost-input, .frost-select, .frost-textarea, .frost-card, .frost-surface, .frost-notice, .frost-alert, .frost-toast, .frost-dropdown__menu, .frost-popover__content, .frost-modal__content, .frost-pagination__item) { :where(.frost-button, .frost-input, .frost-select, .frost-textarea, .frost-card, .frost-surface, .frost-notice, .frost-alert, .frost-toast, .frost-dropdown__menu, .frost-popover__content, .frost-modal__content, .frost-pagination__item) {
border-width: 2px; border-width: 2px;
} }
+278
View File
@@ -0,0 +1,278 @@
{
"name": "@fretuks/frost",
"version": "1.0.0-rc.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@fretuks/frost",
"version": "1.0.0-rc.1",
"license": "MIT",
"devDependencies": {
"@axe-core/playwright": "^4.14.0",
"@playwright/test": "^1.65.1",
"postcss": "^8.5.33",
"postcss-import": "^17.0.1"
}
},
"node_modules/@axe-core/playwright": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@axe-core/playwright/-/playwright-4.14.0.tgz",
"integrity": "sha512-SGUhG5PIHd2eMdpgBF2PyQLOhX+qyDR2PT4cmoS4Qk2ak+jX/rrSvst9l0PGv5WTHolKpUMvVmoHpr4cZgf1RQ==",
"dev": true,
"license": "MPL-2.0",
"dependencies": {
"axe-core": "~4.14.0"
},
"engines": {
"node": ">=22.12.0"
},
"peerDependencies": {
"playwright-core": ">= 1.0.0"
}
},
"node_modules/@playwright/test": {
"version": "1.65.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.1.tgz",
"integrity": "sha512-y+NCIRm2LvY4slUVWvGh1nujJ8RF/hEisIsq2mtUPgdQC4L701bq5hZGMhrpeXjACvwvO9tj5dJqhvM6TP9lbw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.65.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/axe-core": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.14.1.tgz",
"integrity": "sha512-FHfa+lmNjQZfJz1q8wKqIDwC6DExcHt/pkjNQb09a3NPjCKg2rhu5qb2S4r76ASyFNNtuFooJpZe37OgudVGtQ==",
"dev": true,
"license": "MPL-2.0",
"engines": {
"node": ">=4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
"integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
"dev": true,
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/is-core-module": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.18.0.tgz",
"integrity": "sha512-qyax9fgaKOEC4qK8WZn7Q4IcoZC9RC1O1fFxRcRTq/oMMkWT/uXpqpXa12kzWR409zAt1drYN9N9BO26UmBCmw==",
"dev": true,
"license": "MIT",
"dependencies": {
"hasown": "^2.0.4"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/nanoid": {
"version": "3.3.20",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true,
"license": "MIT"
},
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"dev": true,
"license": "ISC"
},
"node_modules/playwright": {
"version": "1.65.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz",
"integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.65.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/playwright-core": {
"version": "1.65.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz",
"integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/postcss": {
"version": "8.5.33",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz",
"integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.20",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/postcss-import": {
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-17.0.1.tgz",
"integrity": "sha512-lthLZRa+sMc/xo+lG7TMUvOviwP9ngR0VULnvfXTyOE3JIc0mFrbjcubI6Jx52X+B3IKt9yfp6wwVWE768JezA==",
"dev": true,
"license": "MIT",
"dependencies": {
"postcss-value-parser": "^4.0.0",
"read-cache": "^1.0.0",
"resolve": "^1.1.7"
},
"engines": {
"node": ">=22.0.0"
},
"peerDependencies": {
"postcss": "^8.0.0"
}
},
"node_modules/postcss-value-parser": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
"dev": true,
"license": "MIT"
},
"node_modules/read-cache": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.2.tgz",
"integrity": "sha512-/peqiBB/n07gQGLsWaHho3WfvUyRscw0gYTsEFMhrIe/nWLkYaf5SbKYjGYqtRV3aPwykJgF2VEMo1ac4bnsGA==",
"dev": true,
"license": "MIT"
},
"node_modules/resolve": {
"version": "1.22.14",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.14.tgz",
"integrity": "sha512-1ZjYvR9sbkiwC5+9QHetqW5HmA2pHRMaoupD01t2HlYnV/vydC2zPwLixhsMieSWVZt0JJRg5LVIk0Ow1D/TrA==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"is-core-module": "^2.18.0",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/source-map-js": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz",
"integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==",
"dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
}
}
}
+32 -4
View File
@@ -1,10 +1,20 @@
{ {
"name": "@fretuks/frost", "name": "@fretuks/frost",
"version": "0.5.0", "version": "1.0.0-rc.1",
"description": "A compact, semantic CSS foundation for websites and web applications.", "description": "A compact, semantic CSS foundation for websites and web applications.",
"style": "./frost.css", "style": "./dist/frost.css",
"exports": { "exports": {
".": "./frost.css", ".": "./dist/frost.css",
"./bundle": "./dist/frost.css",
"./bundle.css": "./dist/frost.css",
"./bundle.min": "./dist/frost.min.css",
"./bundle.min.css": "./dist/frost.min.css",
"./dist/frost.css": "./dist/frost.css",
"./dist/frost.min.css": "./dist/frost.min.css",
"./dist/utility-layer.css": "./dist/utility-layer.css",
"./dist/utility-layer.min.css": "./dist/utility-layer.min.css",
"./dist/component-layer.css": "./dist/component-layer.css",
"./dist/component-layer.min.css": "./dist/component-layer.min.css",
"./frost.css": "./frost.css", "./frost.css": "./frost.css",
"./core.css": "./core.css", "./core.css": "./core.css",
"./utility-layer.css": "./utility-layer.css", "./utility-layer.css": "./utility-layer.css",
@@ -33,6 +43,8 @@
"dist/*.css", "dist/*.css",
"README.md", "README.md",
"CHANGELOG.md", "CHANGELOG.md",
"MIGRATION.md",
"SUPPORT.md",
"LICENSE", "LICENSE",
"public-api.json", "public-api.json",
"scripts/*.mjs" "scripts/*.mjs"
@@ -51,12 +63,25 @@
"url": "https://git.bachmannj.ch/Fretux/Frost.git" "url": "https://git.bachmannj.ch/Fretux/Frost.git"
}, },
"homepage": "https://git.bachmannj.ch/Fretux/Frost", "homepage": "https://git.bachmannj.ch/Fretux/Frost",
"bugs": {
"url": "https://git.bachmannj.ch/Fretux/Frost/issues"
},
"publishConfig": {
"access": "public"
},
"browserslist": [
"Chrome >= 111",
"Edge >= 111",
"Firefox >= 113",
"Safari >= 16.4"
],
"scripts": { "scripts": {
"lint": "node scripts/check.mjs", "lint": "node scripts/check.mjs",
"size": "node scripts/size.mjs", "size": "node scripts/size.mjs",
"build": "node scripts/build.mjs", "build": "node scripts/build.mjs",
"check:api": "node scripts/public-api.mjs --check", "check:api": "node scripts/public-api.mjs --check",
"check:release": "node scripts/check-release.mjs && npm run check:api", "check:release": "node scripts/check-release.mjs && npm run check:api",
"check:tag": "node scripts/check-release-tag.mjs",
"generate:api": "node scripts/public-api.mjs --write", "generate:api": "node scripts/public-api.mjs --write",
"test": "node scripts/check.mjs && node scripts/check-example.mjs", "test": "node scripts/check.mjs && node scripts/check-example.mjs",
"test:all": "npm test && npm run test:browser", "test:all": "npm test && npm run test:browser",
@@ -64,12 +89,15 @@
"test:browser:update": "playwright test --update-snapshots", "test:browser:update": "playwright test --update-snapshots",
"test:example": "node scripts/check-example.mjs", "test:example": "node scripts/check-example.mjs",
"test:package": "npm run prepack && node scripts/test-package.mjs", "test:package": "npm run prepack && node scripts/test-package.mjs",
"test:release": "npm run test:all && npm run size && npm run test:package && npm pack --dry-run",
"generate:utilities": "node scripts/generate-utilities.mjs", "generate:utilities": "node scripts/generate-utilities.mjs",
"prepack": "npm run generate:utilities && npm run generate:api && npm run build && npm run check:release" "prepack": "npm run generate:utilities && npm run generate:api && npm run build && npm run check:release"
}, },
"sideEffects": true, "sideEffects": true,
"devDependencies": { "devDependencies": {
"@axe-core/playwright": "^4.14.0", "@axe-core/playwright": "^4.14.0",
"@playwright/test": "^1.65.1" "@playwright/test": "^1.65.1",
"postcss": "^8.5.33",
"postcss-import": "^17.0.1"
} }
} }
+14
View File
@@ -38,6 +38,20 @@ export default defineConfig({
colorScheme: "light", colorScheme: "light",
}, },
}, },
{
name: "desktop-firefox",
use: {
...devices["Desktop Firefox"],
colorScheme: "light",
},
},
{
name: "desktop-webkit",
use: {
...devices["Desktop Safari"],
colorScheme: "light",
},
},
], ],
webServer: { webServer: {
command: "node tests/browser/serve-example.mjs", command: "node tests/browser/serve-example.mjs",
+17 -3
View File
@@ -1,6 +1,6 @@
{ {
"schemaVersion": 1, "schemaVersion": 2,
"packageVersion": "0.5.0", "packageVersion": "1.0.0-rc.1",
"classes": [ "classes": [
"frost-absolute", "frost-absolute",
"frost-accordion", "frost-accordion",
@@ -562,6 +562,10 @@
"--frost-z-popover", "--frost-z-popover",
"--frost-z-toast" "--frost-z-toast"
], ],
"keyframes": [
"frost-control-loading",
"frost-spin"
],
"layers": [ "layers": [
"frost.tokens", "frost.tokens",
"frost.base", "frost.base",
@@ -573,10 +577,14 @@
"frost.forced-colors" "frost.forced-colors"
], ],
"exports": { "exports": {
".": "./frost.css", ".": "./dist/frost.css",
"./accessibility.css": "./accessibility.css", "./accessibility.css": "./accessibility.css",
"./base": "./base.css", "./base": "./base.css",
"./base.css": "./base.css", "./base.css": "./base.css",
"./bundle": "./dist/frost.css",
"./bundle.css": "./dist/frost.css",
"./bundle.min": "./dist/frost.min.css",
"./bundle.min.css": "./dist/frost.min.css",
"./component-layer": "./component-layer.css", "./component-layer": "./component-layer.css",
"./component-layer.css": "./component-layer.css", "./component-layer.css": "./component-layer.css",
"./components": "./components.css", "./components": "./components.css",
@@ -584,6 +592,12 @@
"./controls.css": "./controls.css", "./controls.css": "./controls.css",
"./core": "./core.css", "./core": "./core.css",
"./core.css": "./core.css", "./core.css": "./core.css",
"./dist/component-layer.css": "./dist/component-layer.css",
"./dist/component-layer.min.css": "./dist/component-layer.min.css",
"./dist/frost.css": "./dist/frost.css",
"./dist/frost.min.css": "./dist/frost.min.css",
"./dist/utility-layer.css": "./dist/utility-layer.css",
"./dist/utility-layer.min.css": "./dist/utility-layer.min.css",
"./forced-colors": "./forced-colors.css", "./forced-colors": "./forced-colors.css",
"./forced-colors.css": "./forced-colors.css", "./forced-colors.css": "./forced-colors.css",
"./frost.css": "./frost.css", "./frost.css": "./frost.css",
+19
View File
@@ -0,0 +1,19 @@
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
const root = fileURLToPath(new URL("..", import.meta.url));
const packageJson = JSON.parse(await readFile(resolve(root, "package.json"), "utf8"));
const suppliedTag = process.argv[2] ?? process.env.GITEA_REF_NAME ?? process.env.GITHUB_REF_NAME;
const expectedTag = `v${packageJson.version}`;
if (!suppliedTag) {
console.error("Release tag is required as an argument or through GITEA_REF_NAME/GITHUB_REF_NAME.");
process.exitCode = 1;
} else if (suppliedTag !== expectedTag) {
console.error(`Release tag ${suppliedTag} does not match package version ${packageJson.version}; expected ${expectedTag}.`);
process.exitCode = 1;
} else {
const channel = packageJson.version.includes("-") ? "next" : "latest";
console.log(channel);
}
+7
View File
@@ -14,6 +14,13 @@ if (packageLock.name !== packageJson.name) errors.push(`package-lock.json: packa
if (packageLock.version !== packageJson.version) errors.push(`package-lock.json: version ${packageLock.version} does not match ${packageJson.version}`); if (packageLock.version !== packageJson.version) errors.push(`package-lock.json: version ${packageLock.version} does not match ${packageJson.version}`);
if (packageLock.packages?.[""]?.name !== packageJson.name) errors.push("package-lock.json: root package name is stale"); if (packageLock.packages?.[""]?.name !== packageJson.name) errors.push("package-lock.json: root package name is stale");
if (packageLock.packages?.[""]?.version !== packageJson.version) errors.push("package-lock.json: root package version is stale"); if (packageLock.packages?.[""]?.version !== packageJson.version) errors.push("package-lock.json: root package version is stale");
if (packageJson.publishConfig?.access !== "public") errors.push("package.json: publishConfig.access must be public");
for (const requiredFile of ["README.md", "CHANGELOG.md", "MIGRATION.md", "SUPPORT.md", "public-api.json"]) {
if (!packageJson.files?.includes(requiredFile)) errors.push(`package.json: files must include ${requiredFile}`);
}
for (const browser of ["Chrome >= 111", "Edge >= 111", "Firefox >= 113", "Safari >= 16.4"]) {
if (!packageJson.browserslist?.includes(browser)) errors.push(`package.json: browserslist is missing ${browser}`);
}
const releases = [...changelog.matchAll(/^##\s+\[?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\]?\s*$/gm)].map((match) => ({ version: match[1], index: match.index })); const releases = [...changelog.matchAll(/^##\s+\[?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\]?\s*$/gm)].map((match) => ({ version: match[1], index: match.index }));
if (!releases.length) errors.push("CHANGELOG.md: no release headings found"); if (!releases.length) errors.push("CHANGELOG.md: no release headings found");
+5
View File
@@ -71,6 +71,11 @@ for (const exportPath of ["./core", "./utility-layer", "./component-layer"]) {
for (const exportPath of ["./forced-colors", "./forced-colors.css"]) { for (const exportPath of ["./forced-colors", "./forced-colors.css"]) {
if (!packageJson.exports[exportPath]) errors.push(`package.json: missing forced-colors export ${exportPath}`); if (!packageJson.exports[exportPath]) errors.push(`package.json: missing forced-colors export ${exportPath}`);
} }
if (packageJson.style !== "./dist/frost.css") errors.push("package.json: style must point to the built dist/frost.css bundle");
if (packageJson.exports["."] !== "./dist/frost.css") errors.push("package.json: default export must point to the built dist/frost.css bundle");
for (const exportPath of ["./bundle", "./bundle.css", "./bundle.min", "./bundle.min.css", "./dist/frost.css", "./dist/frost.min.css", "./dist/utility-layer.css", "./dist/utility-layer.min.css", "./dist/component-layer.css", "./dist/component-layer.min.css"]) {
if (!packageJson.exports[exportPath]) errors.push(`package.json: missing bundled export ${exportPath}`);
}
if (errors.length) { if (errors.length) {
console.error(errors.join("\n")); console.error(errors.join("\n"));
+9 -3
View File
@@ -17,16 +17,18 @@ for (const match of combinedCss.matchAll(/\.(frost-[A-Za-z0-9_-]+(?:\\:[A-Za-z0-
} }
const customProperties = new Set(combinedCss.match(/--frost-[a-z0-9-]+/g) ?? []); const customProperties = new Set(combinedCss.match(/--frost-[a-z0-9-]+/g) ?? []);
const keyframes = new Set([...combinedCss.matchAll(/@keyframes\s+([A-Za-z0-9_-]+)/g)].map((match) => match[1]));
const entryCss = await readFile(resolve(root, "frost.css"), "utf8"); const entryCss = await readFile(resolve(root, "frost.css"), "utf8");
const layerDeclaration = entryCss.match(/@layer\s+([^;]+);/); const layerDeclaration = entryCss.match(/@layer\s+([^;]+);/);
const layers = layerDeclaration ? layerDeclaration[1].split(",").map((layer) => layer.trim()) : []; const layers = layerDeclaration ? layerDeclaration[1].split(",").map((layer) => layer.trim()) : [];
const packageExports = Object.fromEntries(sortLexically(Object.keys(packageJson.exports)).map((key) => [key, packageJson.exports[key]])); const packageExports = Object.fromEntries(sortLexically(Object.keys(packageJson.exports)).map((key) => [key, packageJson.exports[key]]));
const currentManifest = { const currentManifest = {
schemaVersion: 1, schemaVersion: 2,
packageVersion: packageJson.version, packageVersion: packageJson.version,
classes: sortLexically(classes), classes: sortLexically(classes),
customProperties: sortLexically(customProperties), customProperties: sortLexically(customProperties),
keyframes: sortLexically(keyframes),
layers, layers,
exports: packageExports, exports: packageExports,
}; };
@@ -50,6 +52,9 @@ const findBreakingChanges = (baseline, current) => {
for (const property of baseline.customProperties ?? []) { for (const property of baseline.customProperties ?? []) {
if (!current.customProperties.includes(property)) changes.push(`removed custom property ${property}`); if (!current.customProperties.includes(property)) changes.push(`removed custom property ${property}`);
} }
for (const keyframe of baseline.keyframes ?? []) {
if (!current.keyframes.includes(keyframe)) changes.push(`removed keyframes ${keyframe}`);
}
for (const [key, target] of Object.entries(baseline.exports ?? {})) { for (const [key, target] of Object.entries(baseline.exports ?? {})) {
if (!(key in current.exports)) changes.push(`removed package export ${key}`); if (!(key in current.exports)) changes.push(`removed package export ${key}`);
else if (current.exports[key] !== target) changes.push(`changed package export ${key}: ${target} -> ${current.exports[key]}`); else if (current.exports[key] !== target) changes.push(`changed package export ${key}: ${target} -> ${current.exports[key]}`);
@@ -76,7 +81,7 @@ if (!command) {
const next = serialize(currentManifest); const next = serialize(currentManifest);
const previous = existingManifest ? serialize(existingManifest) : null; const previous = existingManifest ? serialize(existingManifest) : null;
if (next !== previous) await writeFile(manifestPath, next); if (next !== previous) await writeFile(manifestPath, next);
console.log(`Public API manifest contains ${currentManifest.classes.length} classes, ${currentManifest.customProperties.length} custom properties, and ${Object.keys(currentManifest.exports).length} exports.`); console.log(`Public API manifest contains ${currentManifest.classes.length} classes, ${currentManifest.customProperties.length} custom properties, ${currentManifest.keyframes.length} keyframes, and ${Object.keys(currentManifest.exports).length} exports.`);
} }
} else if (!existingManifest) { } else if (!existingManifest) {
console.error("public-api.json is missing. Run npm run generate:api."); console.error("public-api.json is missing. Run npm run generate:api.");
@@ -85,11 +90,12 @@ if (!command) {
const additions = [ const additions = [
...currentManifest.classes.filter((value) => !existingManifest.classes.includes(value)).map((value) => `added class .${value}`), ...currentManifest.classes.filter((value) => !existingManifest.classes.includes(value)).map((value) => `added class .${value}`),
...currentManifest.customProperties.filter((value) => !existingManifest.customProperties.includes(value)).map((value) => `added custom property ${value}`), ...currentManifest.customProperties.filter((value) => !existingManifest.customProperties.includes(value)).map((value) => `added custom property ${value}`),
...currentManifest.keyframes.filter((value) => !(existingManifest.keyframes ?? []).includes(value)).map((value) => `added keyframes ${value}`),
...Object.keys(currentManifest.exports).filter((value) => !(value in existingManifest.exports)).map((value) => `added package export ${value}`), ...Object.keys(currentManifest.exports).filter((value) => !(value in existingManifest.exports)).map((value) => `added package export ${value}`),
]; ];
console.error(["public-api.json does not match the current CSS/package surface.", ...breakingChanges.map((change) => `BREAKING: ${change}`), ...additions.map((change) => `NEW: ${change}`), "Run npm run generate:api and commit the result."].join("\n")); console.error(["public-api.json does not match the current CSS/package surface.", ...breakingChanges.map((change) => `BREAKING: ${change}`), ...additions.map((change) => `NEW: ${change}`), "Run npm run generate:api and commit the result."].join("\n"));
process.exitCode = 1; process.exitCode = 1;
} else { } else {
console.log(`Public API contract is current: ${currentManifest.classes.length} classes, ${currentManifest.customProperties.length} custom properties, ${Object.keys(currentManifest.exports).length} exports.`); console.log(`Public API contract is current: ${currentManifest.classes.length} classes, ${currentManifest.customProperties.length} custom properties, ${currentManifest.keyframes.length} keyframes, ${Object.keys(currentManifest.exports).length} exports.`);
} }
} }
+16 -3
View File
@@ -5,12 +5,13 @@ import { basename, join, resolve, sep } from "node:path";
import { createRequire } from "node:module"; import { createRequire } from "node:module";
import { promisify } from "node:util"; import { promisify } from "node:util";
import { fileURLToPath } from "node:url"; import { fileURLToPath } from "node:url";
import postcss from "postcss";
import postcssImport from "postcss-import";
const execFileAsync = promisify(execFile); const execFileAsync = promisify(execFile);
const root = fileURLToPath(new URL("..", import.meta.url)); const root = fileURLToPath(new URL("..", import.meta.url));
const packageJson = JSON.parse(await readFile(resolve(root, "package.json"), "utf8")); const packageJson = JSON.parse(await readFile(resolve(root, "package.json"), "utf8"));
const temporaryRoot = await mkdtemp(join(tmpdir(), "frost-consumer-")); const temporaryRoot = await mkdtemp(join(tmpdir(), "frost-consumer-"));
const fixture = join(temporaryRoot, "fixture");
const npmCli = process.env.npm_execpath; const npmCli = process.env.npm_execpath;
const runNpm = async (arguments_, options = {}) => { const runNpm = async (arguments_, options = {}) => {
@@ -29,7 +30,7 @@ try {
const path = target.replace(/^\.\//, ""); const path = target.replace(/^\.\//, "");
if (!packedPaths.has(path)) throw new Error(`Tarball is missing export target ${target}`); if (!packedPaths.has(path)) throw new Error(`Tarball is missing export target ${target}`);
} }
for (const required of ["public-api.json", "dist/frost.css", "dist/frost.min.css", "dist/utility-layer.css", "dist/component-layer.css"]) { for (const required of ["public-api.json", "SUPPORT.md", "MIGRATION.md", "dist/frost.css", "dist/frost.min.css", "dist/utility-layer.css", "dist/component-layer.css"]) {
if (!packedPaths.has(required)) throw new Error(`Tarball is missing required file ${required}`); if (!packedPaths.has(required)) throw new Error(`Tarball is missing required file ${required}`);
} }
const forbidden = [...packedPaths].filter((path) => /^(?:examples|tests|\.gitea|node_modules)\//.test(path)); const forbidden = [...packedPaths].filter((path) => /^(?:examples|tests|\.gitea|node_modules)\//.test(path));
@@ -52,8 +53,20 @@ try {
if (!metadata.isFile() || metadata.size === 0) throw new Error(`${specifier} resolved to an empty or non-file target`); if (!metadata.isFile() || metadata.size === 0) throw new Error(`${specifier} resolved to an empty or non-file target`);
} }
const consumerCss = join(temporaryRoot, "consumer.css");
await writeFile(consumerCss, `@import "${packageJson.name}";\n.consumer-smoke { color: var(--frost-color-text); }\n`);
const bundledConsumer = await postcss([
postcssImport({
resolve: (specifier) => requireFromFixture.resolve(specifier),
}),
]).process(await readFile(consumerCss, "utf8"), { from: consumerCss });
if (/@import\b/.test(bundledConsumer.css)) throw new Error("Bundled default export left unresolved CSS imports in the consumer build");
for (const marker of [".frost-button", "@layer frost.forced-colors", "@media (forced-colors: active)", ".consumer-smoke"]) {
if (!bundledConsumer.css.includes(marker)) throw new Error(`Bundled consumer output is missing ${marker}`);
}
const tarballMetadata = await stat(tarball); const tarballMetadata = await stat(tarball);
console.log(`Installed ${basename(tarball)} (${tarballMetadata.size} bytes) and resolved all ${Object.keys(packageJson.exports).length} package exports from an isolated consumer.`); console.log(`Installed ${basename(tarball)} (${tarballMetadata.size} bytes), resolved all ${Object.keys(packageJson.exports).length} exports, and bundled the default CSS from an isolated consumer.`);
} finally { } finally {
if (!resolve(temporaryRoot).startsWith(resolve(tmpdir()) + sep)) throw new Error("Refusing to remove a temporary directory outside the system temp root"); if (!resolve(temporaryRoot).startsWith(resolve(tmpdir()) + sep)) throw new Error("Refusing to remove a temporary directory outside the system temp root");
await rm(temporaryRoot, { recursive: true, force: true }); await rm(temporaryRoot, { recursive: true, force: true });
+32 -2
View File
@@ -37,7 +37,8 @@ const visualCases = [
]; ];
for (const visualCase of visualCases) { for (const visualCase of visualCases) {
test(`${visualCase.name} matches its component baselines`, async ({ page }) => { test(`${visualCase.name} matches its component baselines`, async ({ page, browserName }) => {
test.skip(browserName !== "chromium", "Pixel baselines are intentionally pinned to Chromium; other engines run behavioral and accessibility coverage.");
await page.addStyleTag({ content: ".frost-skip-link { display: none !important; }" }); await page.addStyleTag({ content: ".frost-skip-link { display: none !important; }" });
for (const theme of ["light", "dark"]) { for (const theme of ["light", "dark"]) {
await page.locator("html").evaluate((element, selectedTheme) => { await page.locator("html").evaluate((element, selectedTheme) => {
@@ -49,7 +50,8 @@ for (const visualCase of visualCases) {
} }
}); });
test(`${visualCase.name} matches its forced-colors baseline`, async ({ page }) => { test(`${visualCase.name} matches its forced-colors baseline`, async ({ page, browserName }) => {
test.skip(browserName !== "chromium", "Forced-colors pixel baselines are intentionally pinned to Chromium.");
await page.emulateMedia({ colorScheme: "light", forcedColors: "active" }); await page.emulateMedia({ colorScheme: "light", forcedColors: "active" });
await page.addStyleTag({ content: ".frost-skip-link { display: none !important; }" }); await page.addStyleTag({ content: ".frost-skip-link { display: none !important; }" });
await visualCase.prepare?.(page); await visualCase.prepare?.(page);
@@ -150,6 +152,8 @@ test("modal restores focus to its trigger after closing", async ({ page }) => {
test("forced colors preserves system mappings and non-color state cues", async ({ page }) => { test("forced colors preserves system mappings and non-color state cues", async ({ page }) => {
await page.emulateMedia({ colorScheme: "light", forcedColors: "active" }); await page.emulateMedia({ colorScheme: "light", forcedColors: "active" });
const supportsForcedColors = await page.evaluate(() => matchMedia("(forced-colors: active)").matches && CSS.supports("forced-color-adjust: none"));
test.skip(!supportsForcedColors, "This browser engine does not expose forced-color-adjust with forced-colors emulation.");
const primary = page.locator("#buttons .frost-button--primary").first(); const primary = page.locator("#buttons .frost-button--primary").first();
const disabled = page.locator("#buttons .frost-button:disabled"); const disabled = page.locator("#buttons .frost-button:disabled");
@@ -196,6 +200,9 @@ test("forced colors preserves system mappings and non-color state cues", async (
test("increased contrast strengthens component boundaries and states", async ({ page }) => { test("increased contrast strengthens component boundaries and states", async ({ page }) => {
await page.emulateMedia({ colorScheme: "light", contrast: "more", forcedColors: "none" }); await page.emulateMedia({ colorScheme: "light", contrast: "more", forcedColors: "none" });
const supportsIncreasedContrast = await page.evaluate(() => matchMedia("(prefers-contrast: more)").matches
&& Number.parseFloat(getComputedStyle(document.querySelector("#buttons .frost-button--primary")).borderWidth) >= 2);
test.skip(!supportsIncreasedContrast, "This browser engine does not expose prefers-contrast emulation.");
const states = await page.evaluate(() => { const states = await page.evaluate(() => {
const style = (selector) => getComputedStyle(document.querySelector(selector)); const style = (selector) => getComputedStyle(document.querySelector(selector));
@@ -220,3 +227,26 @@ test("increased contrast strengthens component boundaries and states", async ({
expect(states.selectedBorderWidth).toBeGreaterThanOrEqual(3); expect(states.selectedBorderWidth).toBeGreaterThanOrEqual(3);
}); });
test("renders the framework smoke fixture", async ({ page, browserName }) => {
const rendering = await page.evaluate(() => {
const button = getComputedStyle(document.querySelector("#buttons .frost-button--primary"));
const card = getComputedStyle(document.querySelector("#surfaces .frost-card"));
const dialog = getComputedStyle(document.querySelector("#example-dialog"));
return {
buttonDisplay: button.display,
buttonMinHeight: Number.parseFloat(button.minHeight),
cardDisplay: card.display,
cardBorderStyle: card.borderStyle,
closedDialogDisplay: dialog.display,
};
});
expect(rendering, `${browserName} framework rendering`).toEqual({
buttonDisplay: "flex",
buttonMinHeight: 40,
cardDisplay: "block",
cardBorderStyle: "solid",
closedDialogDisplay: "none",
});
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB