@cludosearch/cludo-search-components

中文文档
1.0.160发布于 2026/11/06ISCTypeScriptESM + CJS近 30 天下载 4406

Cludo Search Components in React

原始使用文档
文档目录10 节
  1. Install
  2. Usage
  3. Documentation
  4. Upgrading from @cludo
  5. For Cludo developers
  6. Contributing to the Library
  7. Important Notes
  8. Local Development
  9. Publishing a New Version
  10. Running Storybook Locally

cludo-search-components

React components for building a Cludo search experience. The package is published as @cludosearch/cludo-search-components on the public npm registry and works with React 16.8.0 to 19.

Install

npm install @cludosearch/cludo-search-components

Usage

The package has three entry points. The root entry is for client side rendering, /ssr is for Next.js and other server rendering, and /styles is the stylesheet.

// Client side rendering
import { initCludo, CludoWrapper } from "@cludosearch/cludo-search-components";

// Server side rendering (Next.js and similar)
import { CludoWrapper } from "@cludosearch/cludo-search-components/ssr";

// Stylesheet
import "@cludosearch/cludo-search-components/styles";

Import the stylesheet yourself in most setups. The root entry only injects it when initCludo is called with cssTheme.

The root entry has an import condition only, so load it with ESM import. require() is not supported.

Documentation

  • Component documentation and examples: Storybook. The Storybook currently documents the legacy @cludo package. The @cludosearch documentation is not published yet.
  • Release notes: CHANGELOG.md. The changelog ships inside the package.

Upgrading from @cludo

The package was previously published as @cludo/cludo-search-components on GitHub Packages. That line stopped at 1.0.63 and is no longer updated. New releases are published only under the @cludosearch scope on npm, so rename your imports and install the new package. The first section of the changelog is the migration guide.

For Cludo developers

Contributing to the Library

For detailed contribution guidelines, please see our Confluence documentation.

Important Notes

  • @cludosearch vs @cludo: For new features on the @cludosearch version (the version published on npm), base your branch off npm-migration-updates. The main branch is for the older @cludo version.
  • Upgrading your project from @cludo to @cludosearch? See the migration guide for important information and best practices.

Local Development

Working with React Search Controller

Prerequisites
  • A local project in the Cludo.CustomerTemplates repository
  • Yalc installed globally: npm i yalc -g
Setup Steps
  1. Clone and create a branch

    • Clone the cludo-search-components repository
    • Create a new feature branch following the naming convention: [f|h]/[JIRA-ID]-description
      • f/ for features, h/ for hotfixes
      • Example: f/REACT-32-new-categorized-serp-component
  2. Prepare the library for local development

    cd cludo-search-components
    npm install
    npm i yalc -g
    yalc publish
    
  3. Link to your local project

    cd /path/to/your/customer-template
    yalc link @cludosearch/cludo-search-components
    cludosearch dev
    
  4. Develop and test

    • Make changes in the cludo-search-components directory
    • When ready to test changes:
      npm run build
      yalc publish --push
      
    • Your linked project will automatically recompile with the changes
    • Refresh your browser to see the updates
  5. Cleanup when done

    yalc remove @cludosearch/cludo-search-components
    npm install @cludosearch/cludo-search-components
    

Working with React Search Core (Vite Projects)

  1. Create a Vite project

    npm create vite@latest .
    

    Select React + TypeScript when prompted

  2. Initialize React Search Core Follow the documentation to set up React Search Core

  3. Link with Yalc Follow steps 2-4 from the React Search Controller section above

  4. Configure Vite for local development Add to your vite.config.ts:

    optimizeDeps: {
      include: ["@cludosearch/cludo-search-components"],
    }
    
  5. Clear Vite cache if needed If changes aren't appearing:

    rm -rf node_modules/.vite && rm -rf node_modules/.cache/vite
    

Publishing a New Version

Version Bumping

The library uses Semantic Versioning: MAJOR.MINOR.PATCH. The number tells consumers whether an update is safe to take.

BumpWhen to use itWhat to do
PatchA bug fix with no change to the public API.Nothing. The update-version workflow bumps the patch version on every pull request.
MinorA new feature that keeps existing code working.Run npm version minor --no-git-tag-version on your branch and push.
MajorAny breaking change.Run npm version major --no-git-tag-version, agree the release with the team first, and add migration notes.

When your version is already ahead of the base branch, the workflow skips its patch bump.

A change is breaking if it removes or renames an export, prop or type, makes a prop required, changes a default or a return value, changes markup or class names that templates style or query, or changes peerDependencies, exports or sideEffects. If unsure, treat it as breaking. Deprecate in a minor release before removing in a major one.

Full guide: Versioning the React component library.

Changelog

Every minor or major release adds a section to CHANGELOG.md (create the file if it does not exist yet), newest version first. Each breaking change gets three lines, followed by a before/after code example:

  • What changed: the old and new behaviour, with the PR number and Jira key.
  • Who is affected: a concrete setup readers can check against their own code.
  • What to do: the action that fixes it.

For a major release, also add a Storybook migration page under src/stories/, because self-hosting customers read Storybook rather than the repo.

The search-components-changelog AI skill in the Cludo/ai repo classifies the change, sets the bump and drafts the entry. Ask Claude to "write the changelog entry for this PR".

Automatic Publishing to NPM

When a pull request is merged into the npm-migration-updates branch, the package is automatically published to the public npm registry using GitHub Actions.

Important: Every merge publishes the version in package.json, so check it matches the bump your change needs (see Version Bumping) before merging.

Beta Versions

To publish a beta version for testing (manual):

  1. Append -beta.0 to the version (e.g., 1.0.75-beta.0)
  2. Publish with: npm publish --tag beta
  3. Install in consuming project: npm install @cludosearch/[email protected]

Running Storybook Locally

Versions 0.18.3+ include Storybook documentation:

npm install
npm run storybook

版本与发布记录

@cludosearch/cludo-search-components 共发布 193 个版本,首次发布于 2024/06/18;过去 12 个月发布了 158 个版本。

版本发布日期距今
1.0.160latest2026/11/063 天前
1.0.1592026/11/063 天前
1.0.1582026/10/3010 天前
1.0.1572026/10/2713 天前
1.0.1562026/10/2713 天前
1.0.1552026/10/2713 天前

其他发布通道:ssr-next → 1.0.54,ssr → 1.0.56,beta → 1.0.85-beta.1。

关于 @cludosearch/cludo-search-components 的常见问题

@cludosearch/cludo-search-components 是什么?

Cludo Search Components in React

如何安装 @cludosearch/cludo-search-components?

在项目目录运行 npm install @cludosearch/cludo-search-components,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(16.8.0 - 19)、react-dom(16.8.0 - 19)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cludosearch/cludo-search-components 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cludosearch/cludo-search-components 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cludosearch/cludo-search-components 可以商用吗?

@cludosearch/cludo-search-components 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cludosearch/cludo-search-components 的下载量有多少?

根据 npm 官方下载统计,@cludosearch/cludo-search-components 在 2026/10/10 – 2026/11/08 这 30 天内被下载 4,406 次,日均约 147 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cludosearch/cludo-search-components 还在维护吗?

最新版本 1.0.160 发布于 2026/11/06(3 天前);至今共发布 193 个版本,其中过去 12 个月发布了 158 个;首次发布于 2024/06/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。