Skip to content

Prepare leadtype package release#21

Merged
KayleeWilliams merged 4 commits into
mainfrom
KayleeWilliams/fix-issues
May 10, 2026
Merged

Prepare leadtype package release#21
KayleeWilliams merged 4 commits into
mainfrom
KayleeWilliams/fix-issues

Conversation

@KayleeWilliams
Copy link
Copy Markdown
Collaborator

Summary

  • Cleans up the leadtype package surface for release by lazy-loading optional TypeScript usage and moving bash search helpers behind leadtype/search/bash.
  • Removes dead remark/search code and tightens package dependency metadata.
  • Adds release coverage for public entry points, docs URL behavior, conversion, search, and generated artifacts.
  • Adds a Changesets release entry for leadtype 0.1.0 named Release leadtype.

Validation

  • bun run --filter leadtype build
  • bun run --filter leadtype check-types
  • bun run --filter leadtype test
  • bun run --filter leadtype lint
  • bun run --filter example pipeline:build
  • bun run --filter example check-types
  • bun x ultracite check
  • bun pm pack --dry-run
  • root pre-commit bun test passed: 140 tests

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 48e73ad8-9bd5-4824-a45b-0e0f90f17830

📥 Commits

Reviewing files that changed from the base of the PR and between dc5ac66 and 6c5ffcc.

⛔ Files ignored due to path filters (4)
  • apps/example/src/generated/agent-readability.json is excluded by !**/generated/**
  • apps/example/src/generated/docs-search-content.json is excluded by !**/generated/**
  • apps/example/src/generated/docs-search-index.json is excluded by !**/generated/**
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (49)
  • .changeset/config.json
  • .changeset/release-leadtype.md
  • README.md
  • apps/example/content/docs/guides/extracted-type-table-fixture.mdx
  • apps/example/scripts/bench.ts
  • apps/example/scripts/llm-generate.ts
  • apps/example/scripts/search-generate.ts
  • apps/example/tests/e2e/smoke.e2e.ts
  • docs/build/connect-docs-site.mdx
  • docs/build/optimize-docs-for-agents.mdx
  • docs/quickstart.mdx
  • docs/reference/cli.mdx
  • docs/reference/llm.mdx
  • docs/reference/search.mdx
  • package.json
  • packages/leadtype/README.md
  • packages/leadtype/package.json
  • packages/leadtype/src/cli.test.ts
  • packages/leadtype/src/convert/convert.test.ts
  • packages/leadtype/src/convert/convert.ts
  • packages/leadtype/src/internal/docs-context.ts
  • packages/leadtype/src/internal/docs-url.test.ts
  • packages/leadtype/src/internal/docs-url.ts
  • packages/leadtype/src/internal/package-surface.test.ts
  • packages/leadtype/src/lint/schema.ts
  • packages/leadtype/src/llm/llm.test.ts
  • packages/leadtype/src/llm/llm.ts
  • packages/leadtype/src/llm/readability.ts
  • packages/leadtype/src/remark/plugins/link-icon.remark.ts
  • packages/leadtype/src/remark/plugins/toc-extract.remark.ts
  • packages/leadtype/src/remark/plugins/type-table.remark.ts
  • packages/leadtype/src/remark/remark-output.test.ts
  • packages/leadtype/src/search/ai-index.ts
  • packages/leadtype/src/search/bash-index.ts
  • packages/leadtype/src/search/bash.ts
  • packages/leadtype/src/search/cloudflare-index.ts
  • packages/leadtype/src/search/cloudflare.test.ts
  • packages/leadtype/src/search/docs-bash.test.ts
  • packages/leadtype/src/search/node.test.ts
  • packages/leadtype/src/search/node.ts
  • packages/leadtype/src/search/search.test.ts
  • packages/leadtype/src/search/search.ts
  • packages/leadtype/src/search/tanstack-bash.test.ts
  • packages/leadtype/src/search/tanstack-index.ts
  • packages/leadtype/src/search/tanstack.test.ts
  • packages/leadtype/src/search/vercel-bash.test.ts
  • packages/leadtype/src/search/vercel-index.ts
  • packages/leadtype/src/search/vercel.test.ts
  • packages/leadtype/tsconfig.json

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced search with synonym expansion, stemming, typo tolerance, and phrase-matching support for improved query results.
  • Documentation

    • Updated all documentation examples and URLs to use the new leadtype.dev domain.

Walkthrough

This PR consolidates the leadtype monorepo by migrating the documentation domain from docs.example.com to leadtype.dev, extracting shared URL/path normalization utilities into a centralized docs-url module, making TypeScript an optional runtime dependency in the type-table Remark plugin, updating the default documentation source directory to docs, removing unused Remark plugins, reorganizing search adapter exports to separate bash tooling, and enhancing search with synonym-based query expansion and weighted relevance scoring.

Changes

Domain migration, helper consolidation, and search enhancements

Layer / File(s) Summary
Configuration and package metadata
package.json, .changeset/config.json, .changeset/release-leadtype.md
Root package renamed to leadtype-monorepo; monorepo workspaces extended with evals; Changesets configured to ignore example directory; new minor release entry for leadtype.
Centralized URL and path helper module
packages/leadtype/src/internal/docs-url.ts, packages/leadtype/src/internal/docs-url.test.ts
New module exports path normalization utilities (normalizeDocsPath, stripTrailingSlashes, normalizeWhitespace, stripDocsExtension), URL builders (toDocsUrlPath, toMarkdownUrlPath, toAbsoluteUrl), URL normalization (normalizeDocsUrl), and base URL resolution (normalizeBaseUrl) with environment variable and browser detection support.
Path normalization refactoring in docs-context
packages/leadtype/src/internal/docs-context.ts
Delegates path normalization and URL path generation to new docs-url module; removes local Windows-path regex and re-exports normalizeDocsUrl and toDocsUrlPath from centralized helpers.
Default source directory update
packages/leadtype/src/convert/convert.ts, packages/leadtype/src/convert/convert.test.ts
writeMdxFileAsMarkdown and convertAllMdx now default input directory to docs via new DEFAULT_SOURCE_DIR constant; adds test validating default conversion behavior.
TypeScript optional in type-table plugin
packages/leadtype/src/remark/plugins/type-table.remark.ts
Refactored to dynamically load TypeScript via createRequire with caching; throws dedicated error when TypeScript is missing instead of silent failure; default basePath changed from .c15t to docs.
Remark plugin removals
packages/leadtype/src/remark/plugins/link-icon.remark.ts, packages/leadtype/src/remark/plugins/toc-extract.remark.ts
Removed external-link icon appending plugin and MDX table-of-contents extraction plugin.
Module consolidation: LLM and readability
packages/leadtype/src/llm/llm.ts, packages/leadtype/src/llm/readability.ts
Refactored to import URL/path helpers from docs-url instead of local implementations; consolidates path normalization and relative path derivation using centralized utilities.
Search node module consolidation
packages/leadtype/src/search/node.ts
Refactored to import URL/path helpers from docs-url; removes local base-URL resolution and path builders; updates readMarkdownDocs to use normalizeDocsPath and toDocsUrlPath.
Search adapter API reorganization
packages/leadtype/src/search/ai-index.ts, packages/leadtype/src/search/bash-index.ts, packages/leadtype/src/search/bash.ts, packages/leadtype/src/search/cloudflare-index.ts, packages/leadtype/src/search/tanstack-index.ts, packages/leadtype/src/search/vercel-index.ts
Bash adapter exports restructured: removed bash-tool re-exports from provider indices (ai-index, vercel-index, tanstack-index, cloudflare-index); removed all re-exports from bash.ts barrel; added TanStack bash tooling re-exports to bash-index to consolidate bash adapters in dedicated entrypoint.
Search algorithm enhancement
packages/leadtype/src/search/search.ts
Upgraded with weighted query term expansion (exact, stem, synonyms, prefix, typo matches), default synonym map for common terms, phrase/proximity boosting, and updated SearchDocsOptions to accept optional custom synonyms; BM25 scoring multiplied by term expansion weights and augmented with content-match boosts; refactored createAnswerContext to pass search options through.
Package and build configuration
packages/leadtype/package.json, packages/leadtype/tsconfig.json, packages/leadtype/README.md
Added metadata fields (homepage, repository, bugs) to package.json; moved mdast-util-mdx* and github-slugger from dependencies to devDependencies; inlined full tsconfig.json compilerOptions with declaration, strictness, and module resolution settings; updated README entry points to document bash adapter separation.
Documentation URL migration
README.md, packages/leadtype/README.md, docs/**/*.mdx, apps/example/scripts/*, apps/example/tests/e2e/smoke.e2e.ts
All documentation and example app references updated from docs.example.com to leadtype.dev: root README and package README link lists, docs reference guides, example app generation scripts (llm-generate.ts, bench.ts, search-generate.ts), and e2e test assertions.
Test fixtures and assertions
packages/leadtype/src/cli.test.ts, packages/leadtype/src/search/**/*.test.ts, packages/leadtype/src/llm/llm.test.ts
All test fixtures updated to use leadtype.dev domain for absoluteUrl values; search tests expanded with new cases for synonym expansion, custom synonyms, phrase-match boosting, and createAnswerContext synonym forwarding; llm tests updated for sitemap and canonical URL assertions.
Adapter tests and package surface validation
packages/leadtype/src/search/cloudflare.test.ts, packages/leadtype/src/search/vercel-bash.test.ts, packages/leadtype/src/search/tanstack-bash.test.ts, packages/leadtype/src/internal/package-surface.test.ts
Adapter tests corrected to use leadtype.dev domain and proper bash import sources; package surface tests added to verify TypeScript import isolation in type-table plugin and absence of bash adapters in provider index sources.
Remark output and fixture integration
packages/leadtype/src/remark/remark-output.test.ts, apps/example/content/docs/guides/extracted-type-table-fixture.mdx
Added test validating ExtractedTypeTable component resolves relative paths from docs/ directory by default; new MDX fixture documenting extracted-type-table usage pattern for example pipeline test.
Schema documentation
packages/leadtype/src/lint/schema.ts
Updated JSDoc comments for clarity: availableIn entry documented as framework-neutral, defaultFrontmatterSchema described with coverage scope, defaultChangelogFrontmatterSchema comment reworded.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • inthhq/leadtype#7: Refactors docs search export surface into provider-specific entrypoints and restructures bash-tool and streaming exports across modules.
  • inthhq/leadtype#19: Implements Vercel Agent Readability feature set including leadtype/llm/readability runtime helpers, generateAgentReadabilityArtifacts, and related manifest/sitemap infrastructure.
  • inthhq/docs#12: Performs comprehensive rebranding from old package names and URLs (e.g., @inth/docs / docs.example.com) to leadtype across imports, environment variables, and documentation references.

Poem

🐰 The bundled helpers now reside together,
URL paths and base URLs normalized forever,
TypeScript becomes optional, links point anew,
Bash tools regrouped, search learns synonyms true—
A monorepo reborn with cleaner, truer hue! 🥕

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@KayleeWilliams KayleeWilliams marked this pull request as ready for review May 10, 2026 20:46
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3455f43288

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


export type SearchDocsOptions = ContentStoreOptions & {
limit?: number;
synonyms?: Record<string, string[]>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Forward custom synonyms into answer contexts

Because AnswerContextOptions extends SearchDocsOptions, this new synonyms option is also advertised for createAnswerContext and the provider searchOptions, but createAnswerContext builds a fresh searchDocs options object and only forwards content and limit. In contexts where callers pass product-specific synonyms for answer generation, retrieval silently ignores them even though direct searchDocs calls honor them, so grounded answers can miss the intended sources.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant