Skip to content

feat(valibot): ValibotToJsonSchemaConverter #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 18, 2025
Merged

Conversation

unnoq
Copy link
Owner

@unnoq unnoq commented Mar 18, 2025

closes: #162

Summary by CodeRabbit

  • New Features

    • Expanded API specification generation to support an additional schema library option, allowing users to choose between multiple schema integrations.
    • Streamlined setup by removing an outdated dependency from installation commands.
    • Introduced experimental warnings for emerging features.
  • Documentation

    • Updated guides and installation instructions to reflect broader schema support.
    • Added comprehensive documentation outlining the new integration for enhanced developer experience.
    • Introduced a new README for the valibot package detailing its capabilities and usage.

Copy link

vercel bot commented Mar 18, 2025

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

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 6:00am

Copy link

coderabbitai bot commented Mar 18, 2025

Walkthrough

The changes remove the mandatory use of the @orpc/zod package in installation commands and add support for the Valibot schema library. Documentation in the OpenAPI specification now reflects integration with both Zod and Valibot, and an experimental warning is added for Valibot-related features. Additionally, a new dependency is added to the content module’s package.json. A new valibot package is introduced with its own configuration, documentation, source files for schema conversion, tests, and Git ignore rules.

Changes

File(s) Change Summary
apps/.../openapi-specification.md Removed @orpc/zod from installation commands, added support for Valibot by including an experimental converter import, updated schemaConverters array, and inserted a warning for experimental features.
apps/.../package.json Added dependency "@orpc/valibot": "workspace:*".
packages/valibot/{.gitignore, README.md, package.json, tsconfig.json, src/converter.ts, src/converter.test.ts, src/index.ts} Introduced a new package for Valibot with documentation, Git ignore settings, package configuration, TypeScript settings, implementation of a converter class (with condition and convert methods for schema conversion), tests, and aggregated exports.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant H as Schema Conversion Handler
    participant Z as ZodToJsonSchemaConverter
    participant V as ValibotToJsonSchemaConverter

    C->>H: Request schema conversion
    H->>Z: Check conversion condition (is Zod schema?)
    Note over Z: Fails if using Valibot schema
    H->>V: Check conversion condition (is Valibot schema?)
    V->>V: Execute convert method for JSON schema
    V-->>H: Return converted JSON schema
    H-->>C: Deliver converted schema
Loading

Assessment against linked issues

Objective Addressed Explanation
Support for Valibot in OpenAPI Specification generation (162)

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link

pkg-pr-new bot commented Mar 18, 2025

Open in Stackblitz

More templates

@orpc/client

npm i https://pkg.pr.new/@orpc/client@261

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@261

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@261

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@261

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@261

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@261

@orpc/server

npm i https://pkg.pr.new/@orpc/server@261

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@261

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@261

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@261

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@261

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@261

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@261

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@261

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@261

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@261

commit: 0badc44

Copy link

@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: 3

🧹 Nitpick comments (6)
packages/valibot/package.json (1)

36-40: Consider specifying a version range for the valibot peer dependency.

Using a wildcard ("*") for the valibot peer dependency may lead to compatibility issues if there are breaking changes in future versions. Consider specifying a version range that matches your testing and compatibility requirements.

  "peerDependencies": {
    "@orpc/contract": "workspace:*",
    "@orpc/server": "workspace:*",
-   "valibot": "*"
+   "valibot": "^0.25.0" // or whatever minimum version you've tested with
  },
packages/valibot/README.md (1)

37-37: Update the "Standard Schema Support" to highlight Valibot.

Since this is a Valibot-specific package, consider emphasizing Valibot in the Standard Schema Support section.

- **Standard Schema Support 🗂️**: Effortlessly work with Zod, Valibot, ArkType, and others right out of the box.
+ **Standard Schema Support 🗂️**: Effortlessly work with Valibot, Zod, ArkType, and others right out of the box.
packages/valibot/src/converter.ts (3)

5-7: Consider adding additional configuration options or documentation.

The experimental_ValibotToJsonSchemaConverterOptions interface currently only extends Pick<ConversionConfig, 'errorMode'> without adding any new properties. Consider:

  1. Adding more configuration options if needed
  2. Adding JSDoc comments explaining the purpose of this interface and available options
  3. Documenting the experimental status and potential future changes

9-14: Add documentation for the experimental prefix and error modes.

The class is marked as experimental, but there's no documentation explaining:

  1. What "experimental" means in this context
  2. When it might become stable
  3. What error modes are available and what they do

Add JSDoc comments to explain these aspects:

+/**
+ * Converter for Valibot schemas to JSON Schema.
+ * @experimental This API may change in future versions without a major version bump.
+ */
 export class experimental_ValibotToJsonSchemaConverter implements ConditionalSchemaConverter {
   private readonly errorMode: experimental_ValibotToJsonSchemaConverterOptions['errorMode']
 
+  /**
+   * Creates a new Valibot to JSON Schema converter.
+   * @param options Configuration options
+   * @param options.errorMode How to handle conversion errors: 'throw', 'warn', or 'ignore' (default)
+   */
   constructor(options: experimental_ValibotToJsonSchemaConverterOptions = {}) {
     this.errorMode = options.errorMode ?? 'ignore'
   }

16-18: Add validation for schema structure.

The condition method checks if the schema vendor is 'valibot', but doesn't validate that the schema has the expected structure before accessing properties.

Add more robust validation:

 condition(schema: AnySchema | undefined): boolean {
-  return schema !== undefined && schema['~standard'].vendor === 'valibot'
+  return schema !== undefined && 
+         typeof schema === 'object' && 
+         '~standard' in schema && 
+         typeof schema['~standard'] === 'object' &&
+         schema['~standard'].vendor === 'valibot'
 }
apps/content/docs/openapi/openapi-specification.md (1)

41-42: Politeness in Call-to-Action

The info block reads:
“Interested in support for additional schema libraries? Let us know!”
According to style suggestions, consider prefacing the call-to-action with “please” for a more courteous tone. For example:

-Interested in support for additional schema libraries? [Let us know](https://github.com/unnoq/orpc/discussions/categories/ideas)!
+Interested in support for additional schema libraries? [Please let us know](https://github.com/unnoq/orpc/discussions/categories/ideas)!
🧰 Tools
🪛 LanguageTool

[style] ~41-~41: This expression usually appears with a “please” in front of it.
Context: ...pport for additional schema libraries? [Let us know](https://github.com/unnoq/orpc/discussi...

(INSERT_PLEASE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 283e153 and b1f565e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • apps/content/docs/openapi/openapi-specification.md (2 hunks)
  • apps/content/package.json (1 hunks)
  • packages/valibot/.gitignore (1 hunks)
  • packages/valibot/README.md (1 hunks)
  • packages/valibot/package.json (1 hunks)
  • packages/valibot/src/converter.test.ts (1 hunks)
  • packages/valibot/src/converter.ts (1 hunks)
  • packages/valibot/src/index.ts (1 hunks)
  • packages/valibot/tsconfig.json (1 hunks)
🧰 Additional context used
🪛 GitHub Check: test
packages/valibot/src/converter.test.ts

[failure] 7-7:
AssertionError: expected [ true, { …(2) } ] to deeply equal [ true, { type: 'string' } ]

  • Expected
  • Received

    [
    true,
    {

  • "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "string",
    

    },
    ]

❯ packages/valibot/src/converter.test.ts:7:64

🪛 GitHub Actions: CI
packages/valibot/src/converter.test.ts

[error] 7-7: AssertionError: expected [ true, { …(2) } ] to deeply equal [ true, { type: 'string' } ]

🪛 LanguageTool
packages/valibot/README.md

[misspelling] ~35-~35: Possible spelling mistakes found.
Context: ...tack Query (React, Vue, Solid, Svelte), Pinia Colada, and more. - Server Actions ⚡️: Ful...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... your API or implement API contract. - [@orpc/client](https://www.npmjs.com/package/@...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... API on the client with type-safety. - [@orpc/react-query](https://www.npmjs.com/pack...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...test/docs/framework/react/overview). - [@orpc/vue-query](https://www.npmjs.com/packag...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~58-~58: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...latest/docs/framework/vue/overview). - [@orpc/solid-query](https://www.npmjs.com/pack...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~59-~59: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...test/docs/framework/solid/overview). - [@orpc/svelte-query](https://www.npmjs.com/pac...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~60-~60: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...est/docs/framework/svelte/overview). - [@orpc/vue-colada](https://www.npmjs.com/packa...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[misspelling] ~60-~60: Possible spelling mistakes found.
Context: ...ge/@orpc/vue-colada): Integration with Pinia Colada. - [@or...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~61-~61: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ada](https://pinia-colada.esm.dev/). - [@orpc/openapi](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~62-~62: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...I specs and handle OpenAPI requests. - [@orpc/zod](https://www.npmjs.com/package/@orp...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[uncategorized] ~70-~70: Loose punctuation mark.
Context: ...API specs. ### More Schemas - oz.url: Zod schema for [URL](https://developer....

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~71-~71: Loose punctuation mark.
Context: .../docs/Web/API/URL) instance. - oz.blob: Zod schema for [Blob](https://developer...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~72-~72: Loose punctuation mark.
Context: ...docs/Web/API/Blob) instance. - oz.file: Zod schema for [File](https://developer...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~73-~73: Loose punctuation mark.
Context: ...cs/Web/API/File) instance. - oz.regexp: Zod schema for [RegExp](https://develop...

(UNLIKELY_OPENING_PUNCTUATION)

apps/content/docs/openapi/openapi-specification.md

[style] ~41-~41: This expression usually appears with a “please” in front of it.
Context: ...pport for additional schema libraries? [Let us know](https://github.com/unnoq/orpc/discussi...

(INSERT_PLEASE)

🔇 Additional comments (11)
packages/valibot/src/index.ts (1)

1-1: Export looks good!

Clean export statement that follows the standard pattern for exposing the module's public API.

apps/content/package.json (1)

15-15: Workspace dependency correctly added.

The new Valibot package is properly added as a workspace dependency.

packages/valibot/src/converter.test.ts (1)

11-17: Condition method tests look good.

The tests for the condition method correctly verify that it returns true for Valibot schemas and false for Zod schemas, which is the expected behavior for this converter class.

packages/valibot/.gitignore (1)

1-26: Well-structured .gitignore file.

This .gitignore file follows best practices with comprehensive patterns for excluding:

  • Hidden files (with specific exceptions)
  • Generated folders (node_modules, dist, coverage)
  • Generated files (logs, build info)
  • Common manual ignore files

The structure is clean and thorough, appropriate for a TypeScript package.

packages/valibot/package.json (1)

41-45:

✅ Verification successful

Note the use of a pre-release dependency.

The package depends on @valibot/to-json-schema version 1.0.0-rc.0, which is a release candidate. This may not be stable for production use. Consider adding appropriate warning documentation if this package is intended for production use, or wait for a stable release of the dependency.


🌐 Web query:

Is valibot-to-json-schema 1.0.0-rc.0 stable enough for production use?

💡 Result:

Valibot's official @valibot/to-json-schema package (v1 RC) demonstrates production-ready stability for JSON Schema conversion, though with some considerations:

Core Stability Indicators

  • Official Integration: Now part of Valibot's v1 release candidate ([7][4][8]), developed in collaboration with Valibot's core team
  • Key Production Features:
    • Handles complex use cases like recursive schemas
    • Extremely lightweight (1.67 kB gzip) with no dependencies
    • 100% test coverage as per Valibot's standards
// Example production implementation
import { toJsonSchema } from '@valibot/to-json-schema';
import * as v from 'valibot';

const UserSchema = v.object({
  id: v.number([v.integer()]),
  email: v.string([v.email()])
});

const JsonSchema = toJsonSchema(UserSchema); // { type: 'object', ... }

Migration Considerations

  • Deprecated Alternatives: Older community packages ([1][2]) should transition to @valibot/to-json-schema
  • Limitations:
    • No support for JS-specific types (Blob, Date, etc.)
    • Lacks validation logic (pure schema conversion only)
    • Requires manual handling for custom validations

Ecosystem Support

  • CLI Tools: Dedicated @gcornut/cli-valibot-to-json-schema for batch conversions
  • Type Safety: Full TypeScript integration with schema inference
  • Adoption: Already integrated in production-ready starters like Relivator ([3]) and validation frameworks ([5][15])

While still labeled as RC, Valibot's track record (4.5M+ monthly npm downloads) and extensive testing make this package suitable for production use. However, verify specific edge cases in your schema implementation first using safeParse for validation workflows[7][14].

Citations:


Dependency Stable for Production Use

The use of @valibot/to-json-schema version 1.0.0-rc.0 in packages/valibot/package.json (lines 41–45) has been verified as production-ready. Although it's marked as an RC, official documentation and production usage indicate that it meets stability standards. No additional warning documentation is required unless you encounter specific edge cases requiring further validation.

packages/valibot/tsconfig.json (1)

1-20: LGTM!

The TypeScript configuration is properly set up, with appropriate references to dependent packages and correct inclusion/exclusion patterns for source and test files.

apps/content/docs/openapi/openapi-specification.md (5)

15-32: Installation Commands Updated

The installation blocks for npm, yarn, pnpm, bun, and deno now reference only @orpc/openapi@latest, removing any reference to @orpc/zod. This correctly aligns with the PR objective to remove the mandatory use of @orpc/zod in installation commands.


38-39: Enhanced Schema Support Messaging

The updated text now clearly states that oRPC supports both Zod and Valibot for schema conversion. This expanded description meets the new requirements and helps users understand the multi-schema support capability.


49-49: Importing the Experimental Valibot Converter

The new import statement correctly brings in the experimental Valibot converter with an alias. This change is consistent with introducing Valibot support. Ensure that its experimental status is also clearly documented elsewhere in the project.


52-56: SchemaConverters Array Updated

The schemaConverters array now includes both new ZodToJsonSchemaConverter() and new ValibotToJsonSchemaConverter(), which enables support for both schema libraries. This arrangement appears correct; however, please verify that the order of converters does not cause any unforeseen priority conflicts during schema conversion.


73-75: Experimental Feature Warning Added

The newly added warning block clearly cautions users that features prefixed with experimental_ may be unstable. This is an important inclusion to set proper user expectations regarding the experimental Valibot integration.

Comment on lines +20 to +24
convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>] {
const jsonSchema = toJsonSchema(schema as any, { errorMode: this.errorMode })

return [true, jsonSchema as any]
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid type assertions and handle errors properly.

The convert method contains two as any type assertions which bypass TypeScript's type checking and could hide potential issues. Additionally, there's no error handling around the toJsonSchema call.

Consider implementing proper typing and error handling:

-  convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>] {
-    const jsonSchema = toJsonSchema(schema as any, { errorMode: this.errorMode })
-
-    return [true, jsonSchema as any]
+  convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>] {
+    if (!schema) {
+      throw new Error('Schema is undefined')
+    }
+    
+    try {
+      // Still using a type assertion, but with a more specific type
+      const jsonSchema = toJsonSchema(schema as unknown as import('valibot').BaseSchema, { 
+        errorMode: this.errorMode 
+      })
+      
+      return [true, jsonSchema as Exclude<JSONSchema, boolean>]
+    } catch (error) {
+      if (this.errorMode === 'throw') {
+        throw error
+      }
+      // Provide a fallback schema or more specific error handling based on your needs
+      return [true, { type: 'object' } as Exclude<JSONSchema, boolean>]
+    }
   }
📝 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
convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>] {
const jsonSchema = toJsonSchema(schema as any, { errorMode: this.errorMode })
return [true, jsonSchema as any]
}
convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>] {
if (!schema) {
throw new Error('Schema is undefined')
}
try {
// Still using a type assertion, but with a more specific type
const jsonSchema = toJsonSchema(schema as unknown as import('valibot').BaseSchema, {
errorMode: this.errorMode
})
return [true, jsonSchema as Exclude<JSONSchema, boolean>]
} catch (error) {
if (this.errorMode === 'throw') {
throw error
}
// Provide a fallback schema or more specific error handling based on your needs
return [true, { type: 'object' } as Exclude<JSONSchema, boolean>]
}
}

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/valibot/src/index.ts 0.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@unnoq unnoq merged commit 98e1b3d into main Mar 18, 2025
6 of 8 checks passed
Copy link

@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: 0

🧹 Nitpick comments (5)
packages/valibot/README.md (5)

1-3: HTML Tag ⚠️: Replace <image> with <img>.

The logo block uses a non-standard <image> tag. Switching to <img> will ensure better cross-browser support and adhere to HTML best practices.


5-5: Empty <h1> Tag: Provide a Title or Remove It.

The <h1> element on line 5 is empty. Consider adding a descriptive title relevant to the @orpc/valibot package or removing the tag if it’s not needed.


22-24: Subheading & Description Clarity: Consider Rewording.

The subheading and description (line 22–24) provide a solid overview of oRPC’s capabilities. However, rephrasing the opening sentence (for example, "oRPC seamlessly combines RPC and OpenAPI to deliver end-to-end type safety") might improve readability.


67-67: Converter Description: Note Experimental Status.

While the description succinctly introduces the ValibotToJsonSchemaConverter, it may be beneficial to mention its experimental status (as suggested by its naming in the code snippet) so users are aware of potential changes in future releases.


69-94: Code Snippet: Clear & Informative Example.

The example demonstrates how to integrate ValibotToJsonSchemaConverter with the OpenAPIGenerator effectively. It would be helpful to add an inline comment clarifying that this snippet must be run within an asynchronous context (for example, inside an async function due to the use of await).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1f565e and 0badc44.

📒 Files selected for processing (2)
  • packages/valibot/README.md (1 hunks)
  • packages/valibot/src/converter.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/valibot/src/converter.test.ts
🧰 Additional context used
🪛 LanguageTool
packages/valibot/README.md

[misspelling] ~35-~35: Possible spelling mistakes found.
Context: ...tack Query (React, Vue, Solid, Svelte), Pinia Colada, and more. - Server Actions ⚡️: Ful...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... your API or implement API contract. - [@orpc/client](https://www.npmjs.com/package/@...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... API on the client with type-safety. - [@orpc/react-query](https://www.npmjs.com/pack...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...test/docs/framework/react/overview). - [@orpc/vue-query](https://www.npmjs.com/packag...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~58-~58: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...latest/docs/framework/vue/overview). - [@orpc/solid-query](https://www.npmjs.com/pack...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~59-~59: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...test/docs/framework/solid/overview). - [@orpc/svelte-query](https://www.npmjs.com/pac...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~60-~60: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...est/docs/framework/svelte/overview). - [@orpc/vue-colada](https://www.npmjs.com/packa...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[misspelling] ~60-~60: Possible spelling mistakes found.
Context: ...ge/@orpc/vue-colada): Integration with Pinia Colada. - [@or...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~61-~61: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ada](https://pinia-colada.esm.dev/). - [@orpc/openapi](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~62-~62: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...I specs and handle OpenAPI requests. - [@orpc/zod](https://www.npmjs.com/package/@orp...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~63-~63: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tps://zod.dev/) doesn't support yet. - [@orpc/valibot](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (6)
packages/valibot/README.md (6)

7-20: Centered Badge Section: Looks Good.

The badges are well-organized within a centered container and effectively communicate key project details. No changes required here.


28-46: Highlights Section: Well Structured.

The bullet list clearly presents the key features of oRPC. The section is informative and engaging; great job!

🧰 Tools
🪛 LanguageTool

[misspelling] ~35-~35: Possible spelling mistakes found.
Context: ...tack Query (React, Vue, Solid, Svelte), Pinia Colada, and more. - Server Actions ⚡️: Ful...

(EN_MULTITOKEN_SPELLING_TWO)


47-50: Documentation Link: Looks Good.

The documentation section includes a direct link to full docs, which is concise and useful.


51-64: Packages Section: Update Package Link & Enhance Consistency.

  • Incorrect Link: The entry for @orpc/valibot on line 63 incorrectly points to the Zod package URL. Please update it as follows:
- [@orpc/valibot](https://www.npmjs.com/package/@orpc/zod): OpenAPI spec generation from [Valibot](https://valibot.dev/).
+ [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/).
  • Stylistic Consistency: Several package descriptions begin with similar phrasing. Consider varying the sentence structures to improve readability.
🧰 Tools
🪛 LanguageTool

[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... your API or implement API contract. - [@orpc/client](https://www.npmjs.com/package/@...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... API on the client with type-safety. - [@orpc/react-query](https://www.npmjs.com/pack...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...test/docs/framework/react/overview). - [@orpc/vue-query](https://www.npmjs.com/packag...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~58-~58: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...latest/docs/framework/vue/overview). - [@orpc/solid-query](https://www.npmjs.com/pack...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~59-~59: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...test/docs/framework/solid/overview). - [@orpc/svelte-query](https://www.npmjs.com/pac...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~60-~60: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...est/docs/framework/svelte/overview). - [@orpc/vue-colada](https://www.npmjs.com/packa...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[misspelling] ~60-~60: Possible spelling mistakes found.
Context: ...ge/@orpc/vue-colada): Integration with Pinia Colada. - [@or...

(EN_MULTITOKEN_SPELLING_TWO)


[style] ~61-~61: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ada](https://pinia-colada.esm.dev/). - [@orpc/openapi](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~62-~62: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...I specs and handle OpenAPI requests. - [@orpc/zod](https://www.npmjs.com/package/@orp...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~63-~63: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tps://zod.dev/) doesn't support yet. - [@orpc/valibot](https://www.npmjs.com/package/...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


65-66: @orpc/valibot Section Header: Clear and Appropriate.

The header clearly delineates the section for the @orpc/valibot package. This is well implemented.


96-98: License Section: Well Declared.

The license information is clearly stated and provides a useful link to the full MIT License text. No modifications are needed.

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.

OpenAPI Specification generation support for Valibot?
1 participant