-
Notifications
You must be signed in to change notification settings - Fork 6
Adapt ArkType as a core technology #213
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
Conversation
…_CONTENT` response schema.
…', refine query DTOs, and explicitly cast comment ID to number.
…d add a 10-second timeout to `curl` in API tests.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (1)
✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. 📝 WalkthroughWalkthroughMigrates project DTOs and route schemas from Elysia/TypeBox ( Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… documentation and branding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In `@apps/conduit/package.json`:
- Around line 40-41: The dependency "arkregex"@^0.0.5 in package.json is a
pre-stable 0.0.x release and poses risk for production; either remove it if
unused, replace it with a more mature alternative, or at minimum pin to an exact
tested version (change "arkregex": "^0.0.5" to "arkregex": "0.0.5") and document
the rationale; ensure tests still pass and keep "arktype": "^2.1.29" unchanged
if you rely on it.
In `@apps/conduit/src/comments/comments.controller.ts`:
- Line 36: Update the 401 response schema for StatusCodes.UNAUTHORIZED in
comments.controller.ts to match the structured error payload emitted by
requireLogin and shaped by the global error handler (an object with an "errors"
property whose value is a map of string keys to string[]), instead of
type('undefined'); change the schema referenced at the StatusCodes.UNAUTHORIZED
entry so it describes { errors: Record<string, string[]> } (i.e., an object with
an "errors" field containing arrays of error strings) so the OpenAPI/response
spec matches RealWorldError from requireLogin and app.module.ts.
- Line 74: Remove the redundant Number() conversion around params.id in the
comments controller where you call the handler (e.g., inside the method that
currently does Number(params.id)); ArkType's string.numeric.parse already morphs
params.id to a number when Elysia validates, so pass params.id directly to the
function (reference params.id and the handler method in comments.controller.ts)
and delete the Number(...) wrapper to avoid double coercion.
In `@apps/conduit/src/shared/errors/errors.utils.ts`:
- Around line 42-78: The code currently computes a path variable (using err.path
handling and parsePath) but then uses if (path) which drops empty strings (e.g.,
when err.path is [] or parsePath yields ""), losing root-level errors; after
computing path (and after the Array.isArray / parsePath branches) normalize any
empty string or sole "/" back to "general" before using it to index result so
messages are never dropped—update the logic around the path variable in the
function (where parsePath is called and result[path] is looked up) to set path =
'general' if path === '' || path === '/' or otherwise falsy before pushing
message.
In `@apps/conduit/src/users/dto/user-response.dto.ts`:
- Around line 3-10: Update the ArkType schema in UserResponseDto to mark bio and
image as required (remove the '?' suffix) so they read 'bio': 'string | null'
and 'image': 'string | null'; this aligns the type with the response mapper and
DB NOT NULL defaults and ensures TypeScript infers these fields as always
present.
In `@apps/www/what-is-bedstack.md`:
- Line 17: Update the compound adjective in the Drizzle description: change "non
lactose" to "non-lactose" in the line containing
"**[Drizzle](https://orm.drizzle.team/)** - Lightweight, performant, typesafe,
non lactose, gluten-free, flexible, serverless-ready, and headless TypeScript
ORM" so the phrase reads "non-lactose".
…se schemas, pin `arkregex` dependency, and correct a documentation typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/www/what-is-bedstack.md`:
- Line 21: The current phrasing for ArkType ("The first and only runtime
validator ...") is overstated; edit the line mentioning ArkType to remove "first
and only" and use a neutral, accurate descriptor such as "a leading TypeScript
validator" or "a runtime validator that can 1:1 match TypeScript types," e.g.,
update the sentence referencing ArkType to soften the claim while preserving the
point about 1:1 type alignment; ensure the symbol "ArkType" and its descriptive
clause are the parts you change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/www/what-is-bedstack.md`:
- Around line 44-46: Replace the definitive marketing phrase "best-in-class type
inference" in the paragraph about ArkType with a softer, factual wording;
specifically edit the sentence that currently reads "ArkType was chosen because
it offers best-in-class type inference and makes the correct choice the easiest
choice" to something like "ArkType offers excellent type inference and makes the
correct choice the easiest choice" (or similar wording that removes the absolute
"best-in-class" claim while keeping the recommendation and rationale intact).
Description
Migrate from TypeBox to ArkType, TypeScript's 1:1 validator.
PR Checklist
bun docsSummary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.