Skip to content

Add fallback config paths for typegen CLI#295

Merged
eluce2 merged 1 commit into
mainfrom
codex/add-typegen-config-paths
Jun 26, 2026
Merged

Add fallback config paths for typegen CLI#295
eluce2 merged 1 commit into
mainfrom
codex/add-typegen-config-paths

Conversation

@eluce2

@eluce2 eluce2 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve proofkit.config.* and adt.config.* alongside existing typegen config names
  • Keep jsonc preferred over json for each config name
  • Add coverage for fallback lookup and priority order

Testing

  • Added unit tests for config resolution order and fallback matches
  • Not run (not requested)

Summary by CodeRabbit

  • New Features

    • Typegen now looks for additional default configuration files, including proofkit.config and adt.config, with support for both .jsonc and .json formats.
    • The CLI’s config path resolution is now available for broader use.
  • Tests

    • Added coverage to verify config discovery order and file preference when multiple valid configuration files are present.

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 04a3edf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@proofkit/typegen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
proofkit-docs Ready Ready Preview, Comment Jun 25, 2026 8:08pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/better-auth@295

@proofkit/fmdapi

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/fmdapi@295

@proofkit/fmodata

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/fmodata@295

@proofkit/typegen

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/typegen@295

@proofkit/webviewer

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/webviewer@295

commit: 04a3edf

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The typegen CLI now searches additional default config names and file extensions, and getConfigPath is exported. New tests cover fallback discovery and precedence rules for config selection. A changeset records the patch release.

Changes

Typegen config resolution

Layer / File(s) Summary
Config search defaults and export
packages/typegen/src/cli.ts, .changeset/quiet-walls-move.md
defaultConfigPaths expands to additional config names and extensions, getConfigPath becomes exported, and the changeset records the patch release note.
Config discovery tests
packages/typegen/tests/cli-config.test.ts
Vitest coverage sets up an isolated working directory and checks fallback lookup, config-name precedence, and .jsonc over .json selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: expanding typegen CLI fallback config path resolution.
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 codex/add-typegen-config-paths

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.changeset/quiet-walls-move.md (1)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Changeset note understates the change.

The release note only mentions .json, but the feature also resolves the .jsonc variants (proofkit.config.jsonc, adt.config.jsonc). Consider clarifying so the changelog reflects both extensions.

📝 Suggested wording
-Find `proofkit.config.json` and `adt.config.json` when resolving typegen CLI config.
+Find `proofkit.config.{jsonc,json}` and `adt.config.{jsonc,json}` when resolving typegen CLI config.
🤖 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/quiet-walls-move.md at line 5, The changeset note is incomplete
because it only mentions the .json config files; update the wording to also
include the .jsonc variants resolved by the typegen CLI config logic, and
reference the proofkit.config/adt.config note so the changelog accurately
reflects both extensions.
🤖 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.

Nitpick comments:
In @.changeset/quiet-walls-move.md:
- Line 5: The changeset note is incomplete because it only mentions the .json
config files; update the wording to also include the .jsonc variants resolved by
the typegen CLI config logic, and reference the proofkit.config/adt.config note
so the changelog accurately reflects both extensions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0b9ec4d4-5218-41fb-98b6-d7e48bdf4354

📥 Commits

Reviewing files that changed from the base of the PR and between 5c9815e and 04a3edf.

📒 Files selected for processing (3)
  • .changeset/quiet-walls-move.md
  • packages/typegen/src/cli.ts
  • packages/typegen/tests/cli-config.test.ts

eluce2 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@eluce2 eluce2 merged commit b4a85ef into main Jun 26, 2026
19 checks passed
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