Component verification
Run pnpm verify:component GhostButton (or Button) from the repository root. It writes reports/verify-component/GhostButton.json and prints a short summary. Use --report path/to/report.json to choose a different destination. Any failed check produces exit code 1. Reports and temporary configs in the default report directory are gitignored. The command does not install dependencies or browsers.
The selected scope includes headless and themed source files, compound parts, matching composables/contracts, colocated and named integration tests, and examples/<component>/. Imported dependencies remain in type and boundary graphs. Use this command for focused component feedback. CI runs repository-wide verification and browser checks.
Checks
lint: existing ESLint and Prettier configs on selected source, tests and examples.typecheck:vue-tscwith the canonical strict compiler settings and selected files as entries. Public barrel imports may also pull dependencies into the graph.unit-coverage: the selected tests run once with the existing Vitest config, coverage exclusions and shared 80% line policy. Coverage includes only selected production files; the total and applicable package gates still apply.manifests: the existing source-to-manifest sync, example ownership validation, and canonical JSON Schema, scoped to the selected component family.boundaries: the existing boundary checker/rules with selected source entries. Workspace package metadata still defines the dependency contract.e2e-axe: build the playground/docs hosts with their existing scripts, then run the existingchromium-e2ePlaywright project. Titles matching the public component name, its example prefix (button/), or docs path (/components/button) select behavior and Axe tests. Use@component:GhostButtontags when a shared test has a generic title. Follow these naming conventions for new tests. Visual baselines remain in the separate visual project and full browser CI.
Missing components, tests, manifests, browsers, failed host builds and command timeouts fail. Discovery failure marks dependent checks skip with a reason; ordinary failures do not prevent independent checks from running. A failed host build stops the browser check before Playwright, preventing stale assets from producing a green result. Each subprocess has a three-minute timeout.
JSON report (version 1)
The canonical TypeScript shape lives in scripts/lib/verify-component.d.ts:
interface ComponentVerificationReport {
schemaVersion: 1
component: string // normalized public name, e.g. GhostButton
status: 'pass' | 'fail'
durationMs: number
checks: {
name: string
status: 'pass' | 'fail' | 'skip'
durationMs: number
errors: string[]
}[]
}Durations are nonnegative wall-clock milliseconds. Successful checks have no errors. Failed checks contain up to twelve initial diagnostic lines with terminal control codes removed and each line capped at 500 characters. Skipped checks include a reason. Invalid names use InvalidComponent.json, so input is never interpreted as a path. Failure reports are written before the CLI exits.
Worked selection workflow
pnpm verify:component selects tests by file name for Vitest and by title for Playwright. Shared catalogue suites and dedicated docs page suites do not always follow those names. The examples below show how to confirm that the right tests run. Each one was checked on master (5c31a77) with playwright test --list against the configured projects.
Check the selection before running anything slow. The e2e-axe check uses this grep for Tabs:
pnpm exec playwright test --list --project=chromium-e2e \
--grep 'GhostTabs\b|tabs/|/components/tabs\b'
# Total: 15 tests in 6 filesTo list the visual baselines that the same component can affect, use the chromium project, which only runs @visual tests:
pnpm exec playwright test --list --project=chromium --grep 'tabs/'
# Total: 10 tests in 3 files
# docs-showcase-visual, examples-visual, forced-colors-visualRunning Playwright directly needs built hosts. Build them first with pnpm --filter @ghostvue/playground build and pnpm --filter @ghostvue/docs build. pnpm verify:component builds them for you.
Component behavior edit
Example: change keyboard selection in packages/vue/src/use-ghost-tabs.ts.
Run pnpm verify:component Tabs. Discovery covers the whole GhostTabs* family (GhostTabs, GhostTabsList, GhostTabsTrigger, GhostTabsContent).
- Vitest:
packages/vue/src/GhostTabs.test.ts,tests/integration/ghost-tabs-theme-css.test.tsandtests/integration/ghost-tabs-themed.test.ts(3 files, 28 tests). - Playwright behavior tests:
ghost-tabs.spec.ts›GhostTabs›basic example selects tabs with keyboard and pointerghost-tabs.spec.ts›GhostTabs›manual example keeps selection when tabbing into the selected tabrtl-roving.spec.ts›RTL horizontal roving @cross-browser›GhostTabs mirrors arrows and selects with focus in RTLroving-focus-modifiers.spec.ts›useRovingFocus modified navigation shortcuts›GhostTabs keeps focus and selection for modified keysdocs-landing.spec.ts›docs landing page›progression GhostTabs exposes tabpanel and arrow keys move focus
- The same grep also selects the five
tabs/*rows ofexamples.spec.tsand thetabs/workspacerows ofdocs-showcase-focus.spec.ts.
For a faster loop while editing, run just the behavior files:
pnpm exec vitest run packages/vue/src/GhostTabs.test.ts
pnpm exec playwright test --project=chromium-e2e --grep GhostTabs \
ghost-tabs.spec.ts rtl-roving.spec.ts roving-focus-modifiers.spec.ts
# 4 passedDocker visual update: not needed for a pure keyboard or ARIA change. If the edit changes rendering, for example selected-state styling in packages/themes/src/ghost-tabs.css, the 10 chromium tests listed above can change. Regenerate them with pnpm test:visual:docker.
Example-only edit
Example: change copy or layout in examples/tabs/workspace.vue.
pnpm verify:component Tabs lints, typechecks and boundary-checks the example. Its grep selects the following:
examples.spec.ts›registered examples accessibility and host boundary›tabs/workspace keeps its themed boundary, paints visual parts, and passes axe in light and dark modes- the
tabs/workspacerows indocs-showcase-focus.spec.ts(focus at 3:1 and 200% text)
It misses two suites that cover this example, so run them by file:
- Vitest
tests/integration/tabs-workspace-example.test.ts›tabs/workspace example. Discovery only picks up integration files namedghost-tabs-*. - Playwright
docs-tabs-showcase.spec.ts›docs Tabs workspace showcase(8 tests). It is the dedicated docs page suite, and its titles contain none of the grep terms.
pnpm exec vitest run tests/integration/tabs-workspace-example.test.ts
pnpm exec playwright test --project=chromium-e2e docs-tabs-showcase.spec.tsDocker visual update: needed whenever the rendering changes. This example has baselines in two files:
pnpm exec playwright test --list --project=chromium --grep 'tabs/workspace'
# examples-visual.spec.ts › example visual baselines › tabs/workspace matches docs host snapshots in light and dark
# examples-visual.spec.ts › … › tabs/workspace matches default-comfortable host snapshots in light and dark
# docs-showcase-visual.spec.ts › docs hero showcase visual baselines › tabs/workspace source closed at 390 and 1280px in light and dark
# docs-showcase-visual.spec.ts › … › tabs/workspace source open at 768px in light and dark
# Total: 4 tests in 2 filesDocs-host edit
Example: change the preview frame in apps/docs/.vitepress/theme/DemoPreview.vue.
This file is part of the docs host, not a component, so pnpm verify:component does not apply. pnpm verify:component DemoPreview fails discovery with Component GhostDemoPreview not found in packages/vue/src. and skips every other check. Select the tests by path instead:
- Vitest:
tests/integration/docs-demo-preview.test.ts,docs-demo-preview-controls.test.ts,docs-demo-preview-ssr.test.tsanddocs-demo-playgrounds.test.ts(all undertests/integration/). - Playwright:
docs-demo-preview.spec.ts›docs DemoPreview frame(5 tests), for exampletoolbar wraps inside the frame at 320px without page overflow.
pnpm exec vitest run tests/integration/docs-demo-preview tests/integration/docs-demo-playgrounds
pnpm --filter @ghostvue/docs build
pnpm exec playwright test --project=chromium-e2e docs-demo-preview.spec.tsDocker visual update: needed if the frame's rendering changes. Four @visual suites screenshot docs pages that render DemoPreview (ghost-example-preview):
docs-showcase-visual.spec.ts: each hero showcase inside its frame (18 tests).docs-visual.spec.ts: docs chrome and previews on/components/input(6).docs-date-picker-examples.spec.ts›docs DatePicker open-state visual baselines:date-picker/basic,rangeandthemedopen (3).docs-headless-overlays.spec.ts›docs headless overlay open-state visual baselines:select/basicandhover-card/basicopen (2).
pnpm exec playwright test --list --project=chromium docs-visual.spec.ts \
docs-showcase-visual.spec.ts docs-date-picker-examples.spec.ts \
docs-headless-overlays.spec.ts
# Total: 29 tests in 4 filesA docs-host edit can also reach pages outside this list, for example the landing page, which reuses the ghost-example__preview styles. Before deciding that no other baseline applies, list the whole visual project (pnpm exec playwright test --list --project=chromium, 448 tests in 16 files on 5c31a77) and check every docs-* file. Finish with pnpm docs:build and pnpm docs:links.
Prove that a filter selects the intended tests
Compare the filtered listing with an unfiltered listing of the files you expect. Any difference is a test the filter skips or a test that belongs to something else.
Compound family (DataTable). The component grep stops at a word boundary, so GhostDataTable\b does not match GhostDataTablePreset or GhostDataTableTable titles or tags:
pnpm exec playwright test --list --project=chromium-e2e \
--grep 'GhostDataTable\b|data-table/|/components/data-table\b'
# Total: 19 tests in 6 files (13 behavior tests plus 6 data-table/* example rows)
pnpm exec playwright test --list --project=chromium-e2e ghost-data-table
# Total: 24 tests in 6 filesThe 11 missing tests are the 9 Themed GhostDataTablePreset tests in ghost-data-table-themed.spec.ts, plus the GhostDataTableTable and GhostDataTablePreset describes in ghost-data-table.spec.ts. Vitest discovery has the same gap. It takes GhostDataTable.*.test.ts and use-ghost-data-table* files, so packages/vue/src/GhostDataTablePreset.test.ts and GhostDataTableTable.test.ts are left out. For an edit that reaches a part, also run the part by name. pnpm verify:component DataTablePreset selects 10 Playwright tests in 2 files.
Shared suite (examples.spec.ts with Table). The example-prefix term table/ is not anchored, so it also matches data-table/ rows:
pnpm exec playwright test --list --project=chromium-e2e \
--grep 'GhostTable\b|table/|/components/table\b'
# Total: 19 tests in 3 files, 6 of them data-table/* rows
pnpm exec playwright test --list --project=chromium-e2e --grep ' table/' \
tests/e2e/examples.spec.ts
# Total: 6 tests in 1 file: only the table/* rowsFile arguments are regular expressions matched against paths too. A bare examples.spec.ts lists 313 tests in 5 files, including docs-examples.spec.ts and the docs-*-examples.spec.ts suites. tests/e2e/examples.spec.ts lists only that suite's 269 tests.
Empty selection, environment failure or assertion failure
- Empty selection. Playwright reports
Error: No tests foundand exits 1, both with and without--list. For example,--grep 'GhostTab\b'listsTotal: 0 tests in 0 files. The rootpnpm test <path>script passes--passWithNoTests, so a mistyped path printsNo test files found, exiting with code 0and looks green. Usepnpm exec vitest run <path>, which exits 1, or check theTest Filescount. In a report,unit-coveragefails withNo unit tests found for this component.and an emptye2e-axegrep fails with Playwright'sNo tests found. - Environment failure. Every selected test fails the same way before it reaches a component assertion. Rerunning one test with the same inputs gives the same result. Typical messages:
browserType.launch: Executable doesn't exist at …: the installed browser does not match@playwright/test.- A host-level locator such as
locator('.ghost-landing')reportselement(s) not found. Check thatapps/docs/.vitepress/dist/index.htmlorapps/playground/dist/index.htmlexists, rebuild the host, and rerun. - A subprocess stops at the three-minute timeout.
- Assertion failure. After a fresh host build, the failure is in specific tests and shows
Expected/Receivedfor a behavior. For example, invertingaria-selectedinGhostTabsTrigger.vuefails 6 tests inGhostTabs.test.ts(6 failed | 14 passed) withexpected 'false' to be 'true'. Fix the code, not the test.