Skip to content

Commit cb89f35

Browse files
committed
Site search
1 parent 55e538a commit cb89f35

9 files changed

Lines changed: 1278 additions & 14 deletions

File tree

.github/workflows/pending-changes.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ jobs:
99
- uses: pnpm/action-setup@v2
1010
with:
1111
version: 10
12+
1213
- name: Install dependencies
1314
run: pnpm install --frozen-lockfile --recursive
15+
16+
- name: Install Playwright browsers and dependencies
17+
run: pnpm dlx puppeteer browsers install chrome
18+
1419
- uses: nickcharlton/diff-check@main
1520
with:
16-
command: pnpm run compile
21+
command: pnpm dev & pnpm run compile

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
],
2121
"scripts": {
2222
"dev": "vite",
23-
"dev:integrations": "concurrently -k \"pnpm run dev:integrations:next\" \"pnpm run dev:integrations:vike\" \"pnpm run dev:integrations:vite\"",
23+
"dev:integrations": "pnpm run /^dev:integrations:.*/",
2424
"dev:integrations:next": "pnpm -C integrations/next/ run dev",
2525
"dev:integrations:vike": "pnpm -C integrations/vike/ run dev",
2626
"dev:integrations:vite": "pnpm -C integrations/vite/ run dev",
27-
"build": "pnpm run build:lib && pnpm run build:docs",
27+
"build": "pnpm run /^build:.*/",
2828
"build:docs": "cross-env TARGET=docs vite build",
2929
"build:lib": "cross-env TARGET=lib vite build",
30-
"compile": "pnpm run compile:docs && pnpm run compile:examples",
30+
"compile": "pnpm run /^compile:.*/",
3131
"compile:docs": "tsx ./scripts/compile-docs",
3232
"compile:examples": "tsx ./scripts/compile-examples",
33+
"compile:search-index": "tsx ./scripts/compile-search-index",
3334
"compress:og-image": "tsx ./scripts/compress-og-image",
3435
"e2e:install": "pnpm -C integrations/tests exec playwright install --with-deps",
3536
"e2e:test": "pnpm -C integrations/tests run test",
@@ -95,7 +96,7 @@
9596
"react-docgen-typescript": "^2.4.0",
9697
"react-dom": "^19.2.3",
9798
"react-error-boundary": "^6.0.0",
98-
"react-lib-tools": "0.0.35",
99+
"react-lib-tools": "^0.0.38",
99100
"react-router-dom": "^7.6.3",
100101
"rimraf": "^6.1.2",
101102
"rollup-plugin-terser": "^7.0.2",

pnpm-lock.yaml

Lines changed: 573 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/generated/search-index.json

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.

public/generated/search-records.json

Lines changed: 171 additions & 0 deletions
Large diffs are not rendered by default.

scripts/compile-search-index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { compileSearchIndex } from "react-lib-tools/scripts/compile-search-index.ts";
2+
3+
await compileSearchIndex({
4+
filterSelector: "[data-group]"
5+
});

src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
type CommonQuestion
99
} from "react-lib-tools";
1010
import { repository } from "../package.json";
11-
import { html as GroupExplicitHeightHTML } from "../public/generated/examples/GroupExplicitHeight.json";
1211
import { html as ConditionallyRenderPanel } from "../public/generated/examples/ConditionallyRenderPanel.json";
12+
import { html as GroupExplicitHeightHTML } from "../public/generated/examples/GroupExplicitHeight.json";
1313
import { Link } from "./components/Link";
1414
import { NavLink } from "./components/NavLink";
1515
import { Group } from "./components/styled-panels/Group";
@@ -21,6 +21,7 @@ export default function App() {
2121
return (
2222
<AppRoot
2323
commonQuestions={commonQuestions}
24+
enableSiteSearch
2425
navLinks={
2526
<>
2627
<NavLink path="/">Getting started</NavLink>

src/components/NavLink.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export function NavLink({
1111
path: Path | DefaultPath;
1212
}>) {
1313
return (
14-
<NavLinkExternal children={children} className={className} path={path} />
14+
<NavLinkExternal<Path | DefaultPath>
15+
children={children}
16+
className={className}
17+
path={path}
18+
/>
1519
);
1620
}

src/components/styled-panels/Group.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export function Group({
1111
className?: string;
1212
}) {
1313
return (
14-
<GroupExternal className={cn("gap-2 sm:gap-1", className)} {...rest} />
14+
<GroupExternal
15+
className={cn("gap-2 sm:gap-1", className)}
16+
data-demo
17+
{...rest}
18+
/>
1519
);
1620
}

0 commit comments

Comments
 (0)