Skip to content

Shrink leadtype dependency closure#32

Merged
KayleeWilliams merged 3 commits into
mainfrom
KayleeWilliams/optimize-deps
May 12, 2026
Merged

Shrink leadtype dependency closure#32
KayleeWilliams merged 3 commits into
mainfrom
KayleeWilliams/optimize-deps

Conversation

@KayleeWilliams
Copy link
Copy Markdown
Collaborator

Summary

Swaps heavier deps out of the published leadtype package, mirroring the PR #29 fast-glob → tinyglobby swap. Multiple drop-ins so they ride one PR rather than 6 separate ones.

Consumer-facing (leadtype)

Dep Replacement Notes
gray-matter vfile-matter + yaml Drops js-yaml@3, section-matter, kind-of, strip-bom-string, extend-shallow, is-extendable, argparse@1, sprintf-js. Shared helper in src/internal/frontmatter.ts.
jiti optional peer + lazy import Now only required when authoring docs.config.ts. .js/.mjs/.cjs configs load via native import(). Throws with install hint if a .ts config is loaded without jiti installed.
decode-named-character-reference inline named-entity map Small map of common entities in steps.remark; rare ones fall through unchanged (same behavior as before for unrecognized entities).
mdast-util-to-markdown existing remark() processor prompt.remark stringifies via the unified pipeline.
mdast-util-compact 15-line in-tree visitor Mirrors the subset of behavior steps.remark relied on (merge adjacent text + blockquote).
unist-builder mdast object literals 6 u(...) call sites → { type, ...props, children }.
unist-util-is direct node.type === "..." 7 call sites.

Closure delta (per packages/leadtype install)

Approx size Packages
Removed ~2.27 MB gray-matter + js-yaml@3 + section-matter + kind-of + strip-bom-string + extend-shallow + is-extendable + argparse@1 + sprintf-js + mdast-util-compact + unist-builder + jiti (now optional) = 12 deps
Added ~1.24 MB vfile-matter + yaml = 2 deps
Net ~−1 MB, −10 explicit deps Consumers without a .ts docs config save the full ~1 MB; with .ts config they still save ~700 KB.

Behavior change worth flagging

YAML frontmatter timestamps now round-trip through the yaml package's timestamp tag. Date-only scalars like 2026-04-19 emit as 2026-04-19 (compact) instead of 2026-04-19T00:00:00.000Z. Datetime scalars without sub-second precision emit as 2026-04-19T12:00:00 instead of 2026-04-19T12:00:00.000Z. The values remain Date instances in JS, so consuming code is unaffected. One test (remark-output.test.ts) updated to assert the new wire format.

Monorepo hygiene (dev-only, no consumer impact)

  • evals/: vitest ^2.1.8^4.1.5 to match root + packages/leadtype.
  • Root: dropped prettier. format script now runs ultracite fix. VSCode editor.defaultFormatter switched to biomejs.biome (every file-type override was already pointing at Biome).
  • packages/leadtype/: dropped ultracite from devDeps (uses the root-hoisted one).

Backed out from the original plan

  • Hoisting typescript + @typescript/native-preview to root-only triggered a bun resolution swap on @tanstack/ai (0.15.0 → 0.14.0 won the hoist), breaking example#check-types with a duplicate-install type error. Underlying tangle: @tanstack/ai-client@0.8.0 pins @tanstack/ai to exactly 0.14.0 while leadtype peer-requires >=0.15.0. The committed bun.lock papered over this. Worth a separate PR — bump the @tanstack/ai-* family to a release that uses @tanstack/ai@0.15, then the hoist becomes safe.
  • @mdx-js/react stays at root devDeps — docs/index.mdx at repo root isn't a workspace package and resolves modules via root node_modules.

Test plan

  • bun x ultracite check — clean (217 files)
  • bun run check-types — passes (leadtype + example)
  • bun run test in packages/leadtype — 146/146 pass
  • bun run test in evals — 17/17 pass
  • Confirmed apps/example dev server boots and serves docs/index.mdx

🤖 Generated with Claude Code

Swap heavier deps out of the published `leadtype` package and clean up
adjacent monorepo hygiene:

- `gray-matter` → `vfile-matter` + `yaml` (drops js-yaml@3 + 4 transitive deps)
- `jiti` moved from `dependencies` to optional `peerDependencies`, lazy-imported
  only for `.ts` docs configs
- `decode-named-character-reference` → small inline named-entity map
- `mdast-util-to-markdown` → existing `remark()` processor
- `mdast-util-compact` → 15-line inline adjacent-node merger
- `unist-builder` → mdast object literals
- `unist-util-is` → `node.type === "type"` direct checks
- Round-trip YAML timestamps now use the `yaml` package's timestamp tag
  (date-only scalars emit compact `2026-04-19` instead of full ISO; values
  remain `Date` instances in JS)

Monorepo hygiene: bump `evals` vitest 2.x → 4.x to match the rest;
drop `prettier` in favor of ultracite/Biome for the `format` script;
hoist `ultracite` to the root only.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0c6c6b50-60a2-4956-81ff-0573a59da2e1

📥 Commits

Reviewing files that changed from the base of the PR and between 494739e and 34be347.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • evals/package.json
  • packages/leadtype/package.json
  • packages/leadtype/src/cli/generate.ts
  • packages/leadtype/src/convert/convert.ts
  • packages/leadtype/src/lint/runner.ts
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/leadtype/src/lint/runner.ts
  • packages/leadtype/src/cli/generate.ts
  • packages/leadtype/src/convert/convert.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/leadtype/src/lint/runner.ts
  • packages/leadtype/src/cli/generate.ts
  • packages/leadtype/src/convert/convert.ts
🔇 Additional comments (6)
evals/package.json (1)

16-16: Verify that all breaking changes from vitest v2→v4 have been addressed in the configuration and dependencies.

Upgrading vitest from ^2.1.8 to ^4.1.5 introduces significant breaking changes. The v4.0 release requires Vite >=6.0.0 and Node.js >=20.0.0. Key changes include:

  • Coverage API: coverage.all and coverage.extensions removed; coverage.include and coverage.exclude must be explicitly defined
  • Mocking: spyOn and fn behavior changed; mock implementations must use function or class keyword
  • Workspace: workspace option replaced with projects
  • Module runner: vite-node replaced
  • Browser provider: Now requires object config instead of string

Although tests are passing, verify that the root package.json has Vite >=6.0.0, Node.js version requirement is >=20.0.0, and all configuration files have been updated accordingly.

packages/leadtype/src/lint/runner.ts (1)

16-16: LGTM! Clean migration from gray-matter to internal frontmatter helper.

The parseFrontmatter usage is API-compatible with the previous matter() calls, accessing the same .data and .content properties. Control flow and error handling remain intact.

Also applies to: 398-399, 420-420

packages/leadtype/src/cli/generate.ts (2)

242-243: LGTM! Consistent migration to parseFrontmatter for group inference.

The change maintains the same behavior while using the internal helper instead of gray-matter.


319-337: Well-structured lazy loading pattern for optional jiti dependency.

The importConfigModule function correctly:

  • Dynamically imports jiti only when a .ts config is detected
  • Provides a clear, actionable error message when jiti is missing
  • Uses jiti.import(configPath, { default: true }) to handle default export resolution (valid jiti v2 API)
  • Uses pathToFileURL for native ESM imports of .js/.mjs/.cjs configs (correct cross-platform approach)
  • Falls back to the module object when no default export exists (mod.default ?? mod)

All code patterns follow the guidelines: explicit return type, error handling with descriptive messages, proper async/await usage, and Error objects.

packages/leadtype/package.json (1)

102-106: LGTM! Dependency changes align with the architecture.

The dependency updates correctly implement the PR objectives:

  • vfile, vfile-matter, and yaml replace gray-matter for frontmatter parsing
  • jiti as optional peer dependency (>=2.0.0) with devDependency for local development matches the lazy import pattern in generate.ts
  • Consumers without .ts docs configs avoid the ~1MB jiti closure entirely

Also applies to: 114-114, 130-130, 147-149

packages/leadtype/src/convert/convert.ts (1)

297-311: LGTM! Frontmatter enrichment and placeholder resolution correctly migrated.

The wrapping pattern (---\n${frontmatterBlock}\n---\n) before parsing is correct since:

  1. FRONTMATTER_REGEX captures content between the delimiters (without them)
  2. stringifyFrontmatter returns just the YAML content
  3. The caller at line 377-378 re-wraps with delimiters

Early returns for no-op cases (no enrichment, empty block) are properly preserved.

Also applies to: 313-327


📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Switched default code formatter from Prettier to Biome and updated the project format script.
    • Replaced several heavier packages with lighter alternatives to reduce install footprint.
    • Upgraded development tooling and test framework (Vitest) versions.
  • Behavior Changes

    • YAML frontmatter date-only timestamps now serialize compactly (e.g., YYYY-MM-DD); JS Date values remain Date instances.

Walkthrough

This PR reduces dependency weight by replacing gray-matter and several mdast/unist utilities with a vfile-matter/yaml frontmatter abstraction, inlining small helpers (entity decoding, tree compaction), converting u(...) calls to mdast literals, centralizing remark stringification, and updating editor/CI metadata.

Changes

Dependency Optimization

Layer / File(s) Summary
Configuration & Dependency Updates
.changeset/optimize-dependencies.md, .vscode/settings.json, evals/package.json, package.json, packages/leadtype/package.json
Update package manifests and editor settings: remove gray-matter, decode-named-character-reference, mdast-util-to-markdown, mdast-util-compact, unist-builder, unist-util-is; add vfile, vfile-matter, yaml; move jiti to optional peer dependency and add to devDependencies; switch VS Code formatter to Biome; bump vitest; change format script to ultracite fix.
Frontmatter Parsing Abstraction
packages/leadtype/src/internal/frontmatter.ts
Add ParsedFrontmatter type and parseFrontmatter / stringifyFrontmatter using vfile-matter + yaml with YAML 1.1 timestamp handling to preserve Date instances.
Frontmatter Usage Migration
packages/leadtype/src/cli/generate.ts, packages/leadtype/src/convert/convert.ts, packages/leadtype/src/llm/llm.ts, packages/leadtype/src/lint/runner.ts, packages/leadtype/src/search/node.ts
Replace gray-matter calls with parseFrontmatter/stringifyFrontmatter; add importConfigModule helper to load .ts configs via optional jiti and dynamic import for non-TS configs.
AST Node Refactoring
packages/leadtype/src/remark/libs/content-processor.ts, packages/leadtype/src/remark/plugins/cards.remark.ts, packages/leadtype/src/remark/plugins/topic-switcher.remark.ts, packages/leadtype/src/remark/plugins/type-table.remark.ts
Replace is(node, ...) checks with node.type comparisons; replace u(...) constructions with plain MDAST object literals.
Prompt Serialization
packages/leadtype/src/remark/plugins/prompt.remark.ts
Centralize Markdown stringification via a module-level remark() instance with remark-gfm instead of mdast-util-to-markdown.
Steps Plugin Refactoring
packages/leadtype/src/remark/plugins/steps.remark.ts
Inline named HTML entity decoding and local compactTree to merge adjacent text/blockquote nodes; switch step/title detection to node.type checks.
Test Updates
packages/leadtype/src/remark/remark-output.test.ts
Update fixture and expected output to match new YAML timestamp serialization (preserve full ISO timestamp form).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • inthhq/leadtype#23: Touches the prompt.remark markdown stringification pipeline and related changes.
  • inthhq/leadtype#28: Related docs config loading and jiti handling in generate.ts.
  • inthhq/leadtype#21: Overlaps on dependency/refactor changes to remark/frontmatter handling.

Poem

🐰
I nibble gray-matter away,
stitch YAML threads where dates now stay.
Small hops inline the helper art,
remark hums softly — nodes take part.
A tidy burrow, lighter heart.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Shrink leadtype dependency closure' directly and clearly summarizes the main objective of the PR—reducing the published leadtype package's dependency footprint by replacing heavier dependencies with lighter alternatives.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, detailing all consumer-facing dependency swaps, closure delta metrics, behavior changes, test results, and rationale for decisions, with clear connection to the files modified.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KayleeWilliams/optimize-deps

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/optimize-dependencies.md:
- Line 5: Add a top-level H1 heading to the Markdown body so markdownlint MD041
is satisfied: insert a single line starting with "# " (e.g., "# Optimize
dependencies") immediately after the existing frontmatter and before the current
paragraph text in the .changeset file so the document begins with an H1 heading.

In `@packages/leadtype/src/remark/plugins/cards.remark.ts`:
- Around line 95-99: The object literal creating linkNode uses unnecessary type
assertions (the "as Text" on children) — remove those assertions and let
TypeScript infer the child text node type from the Link type and
PhrasingContent[]; update the linkNode literal (and any similar literal nearby
that uses "as Text") so children: [{ type: "text", value: item.text }] is used
without casting, relying on the existing Link and Text types to provide correct
typing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: aa0fab09-ffae-437f-aff3-a545890b81d7

📥 Commits

Reviewing files that changed from the base of the PR and between 3e03d9d and 5f5d59d.

⛔ 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 (18)
  • .changeset/optimize-dependencies.md
  • .vscode/settings.json
  • evals/package.json
  • package.json
  • packages/leadtype/package.json
  • packages/leadtype/src/cli/generate.ts
  • packages/leadtype/src/convert/convert.ts
  • packages/leadtype/src/internal/frontmatter.ts
  • packages/leadtype/src/lint/runner.ts
  • packages/leadtype/src/llm/llm.ts
  • packages/leadtype/src/remark/libs/content-processor.ts
  • packages/leadtype/src/remark/plugins/cards.remark.ts
  • packages/leadtype/src/remark/plugins/prompt.remark.ts
  • packages/leadtype/src/remark/plugins/steps.remark.ts
  • packages/leadtype/src/remark/plugins/topic-switcher.remark.ts
  • packages/leadtype/src/remark/plugins/type-table.remark.ts
  • packages/leadtype/src/remark/remark-output.test.ts
  • packages/leadtype/src/search/node.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/leadtype/src/remark/libs/content-processor.ts
  • packages/leadtype/src/search/node.ts
  • packages/leadtype/src/remark/plugins/cards.remark.ts
  • packages/leadtype/src/internal/frontmatter.ts
  • packages/leadtype/src/remark/plugins/steps.remark.ts
  • packages/leadtype/src/remark/plugins/prompt.remark.ts
  • packages/leadtype/src/remark/plugins/type-table.remark.ts
  • packages/leadtype/src/lint/runner.ts
  • packages/leadtype/src/cli/generate.ts
  • packages/leadtype/src/llm/llm.ts
  • packages/leadtype/src/convert/convert.ts
  • packages/leadtype/src/remark/remark-output.test.ts
  • packages/leadtype/src/remark/plugins/topic-switcher.remark.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/leadtype/src/remark/libs/content-processor.ts
  • packages/leadtype/src/search/node.ts
  • packages/leadtype/src/remark/plugins/cards.remark.ts
  • packages/leadtype/src/internal/frontmatter.ts
  • packages/leadtype/src/remark/plugins/steps.remark.ts
  • packages/leadtype/src/remark/plugins/prompt.remark.ts
  • packages/leadtype/src/remark/plugins/type-table.remark.ts
  • packages/leadtype/src/lint/runner.ts
  • packages/leadtype/src/cli/generate.ts
  • packages/leadtype/src/llm/llm.ts
  • packages/leadtype/src/convert/convert.ts
  • packages/leadtype/src/remark/remark-output.test.ts
  • packages/leadtype/src/remark/plugins/topic-switcher.remark.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/leadtype/src/remark/remark-output.test.ts
🪛 LanguageTool
.changeset/optimize-dependencies.md

[style] ~11-~11: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...rk()processor. -mdast-util-compactdropped insteps.remark` — small in-tree adjac...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🪛 markdownlint-cli2 (0.22.1)
.changeset/optimize-dependencies.md

[warning] 5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🔇 Additional comments (20)
evals/package.json (1)

16-16: Vitest upgrade looks scoped and consistent.

No blocking concerns in this manifest change.

package.json (1)

19-19: Formatter script switch is coherent with repo tooling direction.

No issues on this script update.

.vscode/settings.json (1)

2-2: Default formatter update is aligned with the new formatting stack.

Looks good.

packages/leadtype/src/remark/plugins/type-table.remark.ts (1)

870-870: Direct Table literal construction is clean and type-safe here.

No concerns with this replacement.

packages/leadtype/src/remark/plugins/prompt.remark.ts (1)

2-3: Stringifier refactor is cohesive and keeps markdown settings centralized.

Looks good from correctness and maintainability perspectives.

Also applies to: 13-20, 31-33

packages/leadtype/package.json (1)

102-105: Dependency realignment is consistent with the optional-peer loading model.

No blocking issues in this manifest update.

Also applies to: 114-114, 130-130, 147-149

packages/leadtype/src/remark/plugins/topic-switcher.remark.ts (1)

79-83: Direct mdast node literals here are clear and behavior-preserving.

This change looks solid.

Also applies to: 87-87, 90-90

packages/leadtype/src/remark/libs/content-processor.ts (2)

19-45: Type-guard simplification and block-structure preservation are good.

The direct node.type branching is clear, and preserving table/list nodes avoids flattening structured content.


72-76: Code-node object construction is clean and equivalent.

The literal code node construction with safe defaults is straightforward and keeps behavior predictable.

packages/leadtype/src/remark/plugins/steps.remark.ts (2)

16-69: Entity decoding replacement is implemented defensively.

Numeric entity bounds/surrogate checks and named-entity passthrough behavior are handled clearly.


280-307: In-place compaction logic is well-guarded.

The merge conditions and index-adjusted splice flow are careful and readable for this compacting pass.

packages/leadtype/src/internal/frontmatter.ts (1)

5-24: Shared frontmatter utility is a solid abstraction.

The parser/stringifier split and typed return shape make downstream call sites simpler and consistent.

packages/leadtype/src/llm/llm.ts (1)

22-22: Frontmatter parser migration is clean and consistent.

Both ingestion paths now use the same internal parser, which reduces parsing divergence across features.

Also applies to: 530-530, 586-586

packages/leadtype/src/search/node.ts (1)

13-13: Search indexing frontmatter read path looks good.

Using the shared parser here aligns search metadata extraction with the rest of the pipeline.

Also applies to: 98-98

packages/leadtype/src/convert/convert.ts (2)

16-19: Frontmatter utility integration at import boundary is well-structured.

The dependency swap is localized and keeps module boundaries clean.


304-327: Enrichment and placeholder resolution flow remains clear after migration.

Parsing to data, transforming, then stringifying is consistent and easy to reason about.

packages/leadtype/src/remark/remark-output.test.ts (1)

485-485: Timestamp expectation update is appropriate for the parser/stringifier change.

The adjusted assertion keeps this regression test aligned with the new frontmatter serialization behavior.

Also applies to: 494-494

packages/leadtype/src/lint/runner.ts (1)

16-16: Lint frontmatter parsing migration is consistent and safe.

Using the shared parser in both validation and link-check phases improves consistency across tooling.

Also applies to: 395-397, 417-417

packages/leadtype/src/cli/generate.ts (2)

240-242: Frontmatter inference migration looks solid.

Using parseFrontmatter(...) here keeps group inference aligned with the new shared frontmatter path and preserves existing normalization behavior.


317-335: Config loading refactor is clean and well-contained.

The .ts optional-peer path and native import() fallback for .js/.mjs/.cjs are integrated clearly, and validation remains centralized in loadDocsConfig.

Also applies to: 349-353

"leadtype": patch
---

Shrink published install closure by swapping out heavier deps:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a top-level heading to satisfy markdownlint MD041.

This file currently starts with plain text after frontmatter; promoting it to an H1 will clear the warning with minimal churn.

Proposed diff
-Shrink published install closure by swapping out heavier deps:
+# Shrink published install closure by swapping out heavier deps
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Shrink published install closure by swapping out heavier deps:
# Shrink published install closure by swapping out heavier deps
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/optimize-dependencies.md at line 5, Add a top-level H1 heading to
the Markdown body so markdownlint MD041 is satisfied: insert a single line
starting with "# " (e.g., "# Optimize dependencies") immediately after the
existing frontmatter and before the current paragraph text in the .changeset
file so the document begins with an H1 heading.

Comment thread packages/leadtype/src/remark/plugins/cards.remark.ts
…ze-deps

# Conflicts:
#	bun.lock
#	evals/package.json
#	packages/leadtype/package.json
#	packages/leadtype/src/cli/generate.ts
#	packages/leadtype/src/convert/convert.ts
#	packages/leadtype/src/lint/runner.ts
@KayleeWilliams KayleeWilliams merged commit 1bca5cf into main May 12, 2026
3 checks passed
@KayleeWilliams KayleeWilliams deleted the KayleeWilliams/optimize-deps branch May 12, 2026 02:12
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