Skip to main content

Development

WF-Algolia is a pnpm monorepo. The client script, the Designer extension, the backend sync, the shared registry and this documentation site all live together so that a change to the attribute surface updates every surface at once.

Setup

pnpm install
pnpm build

Node 20 or later, pnpm 10 or later.

The packages

PackageWhat it is
scriptThe CDN client script that runs on customer sites
extensionThe Webflow Designer extension
backendSync from Webflow CMS into Algolia
shared-typesThe attribute registry and shared interfaces
docsThis site

The registry is the source of truth

packages/shared-types/src/attributeRegistry.ts defines every attribute, role and component. Both the Designer panel and this site render from it, so neither can describe the attribute surface differently.

After editing it:

pnpm --filter @candidleap/wf-algolia-shared-types build

Consumers import from dist/, never from source, so skipping the build means they read stale types.

Working on the docs

pnpm --filter @candidleap/wf-algolia-docs start
pnpm --filter @candidleap/wf-algolia-docs generate:docs
pnpm --filter @candidleap/wf-algolia-docs generate:docs:check

Some pages are generated and must not be hand-edited — each opens with a GENERATED banner in its frontmatter. See the docs package README for the split.

Three guards worth knowing about

Adding an attribute trips all three if you stop halfway, which is the point.

Drift. generate:docs:check regenerates in memory and fails if the committed output differs. Run it in CI.

Tokens. Every wf-algolia-* name in every markdown file, generated or hand-written, must exist in the registry. An invented or retired name fails the build.

Attribute sync. packages/script asserts in both directions that the runtime and the docs agree on which attributes exist.

Testing

pnpm test # everything
pnpm --filter @candidleap/wf-algolia-docs test # generator tests
pnpm --filter @candid-leap/wf-algolia test:unit # script unit tests

Browser tests need pnpm exec playwright install once.

Conventions

  • Conventional commits: feat, fix, chore, docs, test, refactor
  • JSDoc on exported functions
  • No any
  • Tests before implementation