Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Aug 6, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (7)
  • packages/misc/redwood/package.json is excluded by !**/*.json
  • packages/plugins/swr/package.json is excluded by !**/*.json
  • packages/plugins/tanstack-query/package.json is excluded by !**/*.json
  • packages/plugins/trpc/package.json is excluded by !**/*.json
  • packages/schema/package.json is excluded by !**/*.json
  • packages/sdk/package.json is excluded by !**/*.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/*.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The changes introduce optional chaining in test files to safely access nested properties, preventing runtime errors. The TypeScript project compilation in the schema utility was refactored to create and write a tsconfig.json inline instead of invoking tsc --init. The test scaffold script was updated to pin the TypeScript version during npm installation.

Changes

Cohort / File(s) Change Summary
Tanstack Query Plugin Test Updates
packages/plugins/tanstack-query/tests/plugin.test.ts
Updated nested property accesses (e.g., data.pages[0][0].published) to use optional chaining for safer access.
Portable Test Updates
packages/plugins/tanstack-query/tests/portable.test.ts
Applied optional chaining to nested property access (e.g., data?.posts[0]?.title) to prevent runtime errors.
Schema Compilation Refactor
packages/testtools/src/schema.ts
Removed tsc --init invocation; created and wrote tsconfig.json inline with predefined compiler options and path mappings before running TypeScript compile.
Test Scaffold Script Update
script/test-scaffold.ts
Modified npm install command to pin TypeScript version to approximately 5.8.0 and reformatted the command into multiple lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix-tanstack-tests

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

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

Support

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

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 generate unit tests to generate unit tests 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
Contributor

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6d11737 and 36ed219.

📒 Files selected for processing (3)
  • packages/plugins/tanstack-query/tests/plugin.test.ts (9 hunks)
  • packages/plugins/tanstack-query/tests/portable.test.ts (3 hunks)
  • packages/testtools/src/schema.ts (2 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
packages/testtools/src/schema.ts

[warning] 367-367: Unsafe shell command constructed from library input
This string concatenation which depends on library input is later used in a shell command.
This string concatenation which depends on library input is later used in a shell command.
This string concatenation which depends on library input is later used in a shell command.
This string concatenation which depends on library input is later used in a shell command.
This string concatenation which depends on library input is later used in a shell command.
This string concatenation which depends on library input is later used in a shell command.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: OSSAR-Scan
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
  • GitHub Check: dependency-review
  • GitHub Check: build-test (20.x)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
packages/testtools/src/schema.ts (1)

154-154: LGTM - Good addition for flexibility.

The optional tscInitArgs parameter enhances the configurability of TypeScript compiler initialization.

packages/plugins/tanstack-query/tests/portable.test.ts (2)

44-44: Excellent improvement for runtime safety.

The addition of optional chaining (?.) when accessing array elements prevents potential runtime errors when posts[0] is undefined.

Also applies to: 105-105


48-48: Good standardization of TypeScript compiler settings.

Adding consistent tscInitArgs across all test configurations ensures uniform module resolution and compilation behavior.

Also applies to: 109-109, 152-152

packages/plugins/tanstack-query/tests/plugin.test.ts (2)

68-68: Excellent defensive programming with optional chaining.

The additional optional chaining operators (?.) prevent potential runtime errors when accessing nested array elements that might be undefined. This makes the test code more robust.

Also applies to: 134-134, 162-162, 240-240


100-100: Consistent TypeScript configuration across test suites.

The standardized tscInitArgs with --moduleResolution bundler --module esnext ensures consistent compilation behavior across React, Vue, and Svelte test configurations.

Also applies to: 140-140, 194-194, 217-217, 272-272, 295-295

@ymc9 ymc9 merged commit ceb6be3 into dev Aug 6, 2025
12 of 13 checks passed
@ymc9 ymc9 deleted the chore/fix-tanstack-tests branch August 6, 2025 14:51
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