Skip to content

feat(samples): create publishable headless-search-vite sample (Lit + Vite)#7850

Merged
alexprudhomme merged 1 commit into
mainfrom
KIT-5679-headless-search
Jul 10, 2026
Merged

feat(samples): create publishable headless-search-vite sample (Lit + Vite)#7850
alexprudhomme merged 1 commit into
mainfrom
KIT-5679-headless-search

Conversation

@alexprudhomme

@alexprudhomme alexprudhomme commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

A vanilla Vite + Lit @coveo/headless search sample, published to npm as a @coveo/create-ui scaffolding template.

What it does

  • Search box with query suggestions and instant results, a standalone header search box, facets (incl. a category facet with breadbox support), sort, a numbered pager, breadcrumbs, and a result list — against the searchuisamples sample org.
  • Published via pnpm's publishConfig.directory: the shared prepack builder (scripts/build-sample-publish-dir.mjs) emits ./publish with the runnable app and a package.json that keeps build tooling (vite) but drops test-only devDependencies (incl. the internal @coveo/platform-mock-api) and the e2e script. Source package.json is untouched; ./publish is gitignored.

Tested

  • pnpm install --frozen-lockfile passes; the lockfile change is a minimal, additive search-vite importer (+ publishDirectory), no transitive drift.
  • Builder output verified: publish/ ships the app only (no e2e/), dependencies = @coveo/headless + lit, devDependencies = vite, scripts dev/build/preview.
  • oxlint / oxfmt clean; deterministic Playwright smoke test with @coveo/platform-mock-api + MSW.

Rebased onto main (single commit); uses the shared publish builder introduced with the commerce samples.

@changeset-bot

changeset-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1882a7f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svcsnykcoveo

svcsnykcoveo commented Jun 19, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@pkg-pr-new

pkg-pr-new Bot commented Jun 19, 2026

Copy link
Copy Markdown
@coveo/atomic

npm i https://pkg.pr.new/@coveo/atomic@7850

@coveo/atomic-hosted-page

npm i https://pkg.pr.new/@coveo/atomic-hosted-page@7850

@coveo/atomic-legacy

npm i https://pkg.pr.new/@coveo/atomic-legacy@7850

@coveo/atomic-react

npm i https://pkg.pr.new/@coveo/atomic-react@7850

@coveo/auth

npm i https://pkg.pr.new/@coveo/auth@7850

@coveo/bueno

npm i https://pkg.pr.new/@coveo/bueno@7850

@coveo/create-atomic

npm i https://pkg.pr.new/@coveo/create-atomic@7850

@coveo/create-atomic-component

npm i https://pkg.pr.new/@coveo/create-atomic-component@7850

@coveo/create-atomic-component-project

npm i https://pkg.pr.new/@coveo/create-atomic-component-project@7850

@coveo/create-atomic-result-component

npm i https://pkg.pr.new/@coveo/create-atomic-result-component@7850

@coveo/create-atomic-rollup-plugin

npm i https://pkg.pr.new/@coveo/create-atomic-rollup-plugin@7850

@coveo/headless

npm i https://pkg.pr.new/@coveo/headless@7850

@coveo/headless-react

npm i https://pkg.pr.new/@coveo/headless-react@7850

@coveo/shopify

npm i https://pkg.pr.new/@coveo/shopify@7850

commit: 1882a7f

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new vanilla JavaScript + Vite sample under samples/headless/search-vite to demonstrate building a Headless-powered search UI (DOM-driven) with basic controllers and a Playwright smoke test.

Changes:

  • Introduces a new Vite-based Headless search sample (HTML/CSS/JS) with facets, sorting, pagination, and query summary.
  • Adds Playwright E2E scaffolding (MSW-backed mock API) for a basic “page loads and shows results” smoke test.
  • Wires the new sample into the workspace lockfile.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
samples/headless/search-vite/vite.config.js Vite dev-server configuration for the sample.
samples/headless/search-vite/src/style.css Styling for the sample layout, facets, results, pager, etc.
samples/headless/search-vite/src/main.js Sample app logic using Headless controllers and direct DOM manipulation.
samples/headless/search-vite/README.md Usage instructions and feature list for the new sample.
samples/headless/search-vite/public/coveo-logo.svg Sample asset (logo) used in the page header.
samples/headless/search-vite/playwright.config.ts Playwright config to run E2E against vite preview.
samples/headless/search-vite/package.json Workspace package definition and scripts for the sample.
samples/headless/search-vite/index.html Sample page skeleton and mounting points.
samples/headless/search-vite/e2e/smoke.spec.ts Basic E2E smoke test.
samples/headless/search-vite/e2e/fixtures.ts MSW/MockSearchApi Playwright fixture setup.
samples/headless/search-vite/.gitignore Ignores build/test output for the sample.
pnpm-lock.yaml Adds the new sample workspace importer and its dependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread samples/headless/search-vite/src/main.js Outdated
Comment thread samples/headless/search-vite/src/main.js Outdated
Comment thread samples/headless/search-vite/src/main.js Outdated
Comment thread samples/headless/search-vite/src/style.css Outdated
Comment thread samples/headless/search-vite/src/main.js Outdated
Comment thread samples/headless/search-vite/package.json Outdated
Comment thread samples/headless/search-vite/README.md Outdated
Comment thread samples/headless/search-vite/README.md Outdated
@chromatic-com

chromatic-com Bot commented Jul 7, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 458 tests unchanged
🟢 UI Review: 458 stories published -- no changes
Storybook icon Storybook Publish: 458 stories published

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🔗 Scratch Orgs ready to test this PR:

@y-lakhdar y-lakhdar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERY NICE!

…Vite)

A vanilla Vite + Lit @coveo/headless search sample: search box with query suggestions and instant results, facets (incl. a category facet with breadbox support), sort, numbered pager, breadcrumbs, and result list. Published to npm as a @coveo/create-ui scaffolding template via publishConfig.directory; the prepack builder drops test-only tooling from the published copy. Verified with @coveo/platform-mock-api + Playwright smoke tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants