Skip to content

Conversation

@eluce2
Copy link
Collaborator

@eluce2 eluce2 commented Jul 23, 2025

validate multiple portals

add warning

new version

remove unused deps from better-auth

Summary by CodeRabbit

  • New Features

    • Added support for the generic "zod" validator in type generation, alongside "zod/v3" and "zod/v4".
    • Introduced a new utility type for inferring portal types from Zod schemas.
    • Added configuration and scripts for running code analysis with Knip.
  • Bug Fixes

    • Improved portal validation handling in the fmdapi client.
  • Chores

    • Updated dependencies and development tools, including TypeScript and semver.
    • Cleaned up and removed unused dependencies in certain packages.
  • Documentation

    • Updated changelogs to reflect the latest changes and usage instructions.
  • Tests

    • Expanded test coverage for the new "zod" validator support and updated test snapshots.

@vercel
Copy link

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proofkit-docs ✅ Ready (Inspect) Visit Preview Jul 23, 2025 0:33am

@eluce2 eluce2 marked this pull request as ready for review July 23, 2025 12:26
Copy link
Collaborator Author

eluce2 commented Jul 23, 2025

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

@eluce2 eluce2 merged commit 08b0e41 into main Jul 23, 2025
2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces support for a generic "zod" validator in addition to version-specific "zod/v3" and "zod/v4" across type generation and schema handling. It modifies schema typing and validation logic, updates type inference utilities, adds configuration for Knip, adjusts dependencies, and extends test coverage and snapshots to accommodate the new validator and schema structures.

Changes

File(s) Change Summary
knip.config.ts, package.json Added Knip configuration file to ignore specific workspaces, files, and binaries; updated root package.json to add Knip and TypeScript as devDependencies and introduced a Knip script.
packages/better-auth/package.json Removed dependencies: @proofkit/fmdapi and execa.
packages/fmdapi/CHANGELOG.md, packages/fmdapi/package.json Added changelog entry and bumped version to 5.0.1 for portal validation update.
packages/fmdapi/src/client.ts Changed portalData schema typing and validation logic to use a record of schemas keyed by portal name; updated type inference and validation flow accordingly.
packages/fmdapi/src/utils.ts Added new exported utility type InferZodPortals for inferring types from Zod-like schema objects.
packages/fmdapi/tests/zod.test.ts Changed portal schema definitions from Zod object schemas to plain objects; adjusted tests and added TypeScript error suppression for non-existent portal keys.
packages/typegen/CHANGELOG.md, packages/typegen/package.json Added changelog entry for patch 1.0.9, updated dependency on @proofkit/fmdapi to 5.0.1, added semver and its typings as dependencies.
packages/typegen/src/buildLayoutClient.ts Broadened support for "zod" validator string in conditional logic for schema imports and client initialization.
packages/typegen/src/buildSchema.ts Added support for generic "zod" type in schema and override file generation, updated portal object construction to use plain objects, adjusted type aliasing to use InferZodPortals, and refactored for clarity.
packages/typegen/src/typegen.ts Added runtime check for minimum @proofkit/fmdapi version using semver, expanded validator string handling to include "zod".
packages/typegen/src/types.ts Expanded allowed values for validator and type fields to include "zod" in config and type definitions.
packages/typegen/tests/snapshots/strict-numbers.snap.ts Changed portal schema export from Zod object to plain object; updated type inference to use InferZodPortals.
packages/typegen/tests/snapshots/zod-layout-client-customer.snap.ts Added new snapshot file exporting a generated Zod schema and inferred type for a customer layout.
packages/typegen/tests/snapshots/zod-layout-client.snap.ts Added new snapshot file with generated Zod schemas, inferred types, and portals object using InferZodPortals.
packages/typegen/tests/snapshots/zod-layout-overrides.snap.ts Added new snapshot file for custom overrides, re-exporting generated Zod schemas and types, and defining a portals object with type inference.
packages/typegen/tests/typegen.test.ts Added test for "zod" validator, verifying generated files against new snapshots and ensuring cleanup of generated files in tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Typegen CLI
    participant FileSystem
    participant fmdapi Client

    User->>Typegen CLI: Run typegen with validator "zod"
    Typegen CLI->>FileSystem: Read package.json for @proofkit/fmdapi version
    FileSystem-->>Typegen CLI: Return version
    Typegen CLI->>Typegen CLI: Check if version >= 5.0.1
    Typegen CLI->>Typegen CLI: Build schema/overrides with "zod" support
    Typegen CLI->>FileSystem: Write generated schema files
    User->>fmdapi Client: Use generated schemas and types
Loading

Estimated code review effort

4 (~90 minutes)

Suggested reviewers

  • chriscors

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

knip.config.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/fmdapi/src/client.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/fmdapi/tests/zod.test.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

  • 10 others

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15012ab and 83a5823.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • knip.config.ts (1 hunks)
  • package.json (1 hunks)
  • packages/better-auth/package.json (0 hunks)
  • packages/fmdapi/CHANGELOG.md (1 hunks)
  • packages/fmdapi/package.json (1 hunks)
  • packages/fmdapi/src/client.ts (3 hunks)
  • packages/fmdapi/src/utils.ts (2 hunks)
  • packages/fmdapi/tests/zod.test.ts (2 hunks)
  • packages/typegen/CHANGELOG.md (1 hunks)
  • packages/typegen/package.json (2 hunks)
  • packages/typegen/src/buildLayoutClient.ts (2 hunks)
  • packages/typegen/src/buildSchema.ts (7 hunks)
  • packages/typegen/src/typegen.ts (3 hunks)
  • packages/typegen/src/types.ts (2 hunks)
  • packages/typegen/tests/__snapshots__/strict-numbers.snap.ts (2 hunks)
  • packages/typegen/tests/__snapshots__/zod-layout-client-customer.snap.ts (1 hunks)
  • packages/typegen/tests/__snapshots__/zod-layout-client.snap.ts (1 hunks)
  • packages/typegen/tests/__snapshots__/zod-layout-overrides.snap.ts (1 hunks)
  • packages/typegen/tests/typegen.test.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot mentioned this pull request Sep 26, 2025
This was referenced Dec 16, 2025
Closed
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.

2 participants