Skip to content

chore(types): export type of RustPlugin #2129

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fu050409
Copy link
Member

@fu050409 fu050409 commented Mar 22, 2025

Resolved #2126

Summary by CodeRabbit

  • New Features
    • Introduced a new Rust plugin type that enhances type definitions in the plugin system.
    • Improved type safety for managing Rust-based integrations, ensuring more reliable usage.

@fu050409 fu050409 requested review from wre232114 and ErKeLost March 22, 2025 10:55
Copy link

changeset-bot bot commented Mar 22, 2025

🦋 Changeset detected

Latest commit: d198687

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

This PR includes changesets to release 3 packages
Name Type
@farmfe/core Patch
@farmfe-examples/tailwind-next Patch
@farmfe/js-plugin-tailwindcss 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

Copy link

coderabbitai bot commented Mar 22, 2025

Walkthrough

This pull request adds the export of the TypeScript type RustPlugin to the @farmfe/core package. A new changeset entry is introduced to record the patch release. In the core plugin files, the import statements have been updated to include RustPlugin, and the variable declaration for rustPlugins is now strictly typed as RustPlugin[]. Additionally, the export in the type definition file has been modified to include RustPlugin alongside rustPluginResolver, thereby enhancing type safety and clarity.

Changes

File(s) Change Summary
.changeset/serious-peaches-cheer.md Added a new changeset entry that indicates a patch for @farmfe/core, noting the export of the RustPlugin type.
packages/core/.../plugin/index.ts, packages/core/.../plugin/type.ts Updated import/export statements to include RustPlugin; modified rustPlugins declaration in index.ts to ensure it is typed as RustPlugin[].

Assessment against linked issues

Objective Addressed Explanation
Export type RustPlugin (#2126)

Poem

In the code garden where rabbits play,
I’ve hopped in with a patch today.
RustPlugin now shines bright and clear,
A type so strong, there's nothing to fear.
From these lines, my joy overflows—
Hopping forward wherever the code goes! 🥕🐇


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7a69a88 and 3119c2c.

📒 Files selected for processing (3)
  • .changeset/serious-peaches-cheer.md (1 hunks)
  • packages/core/src/plugin/index.ts (2 hunks)
  • packages/core/src/plugin/type.ts (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
packages/core/src/plugin/index.ts (2)
packages/core/src/plugin/type.ts (1) (1)
  • RustPlugin (258-258)
packages/core/src/plugin/rust/rustPluginResolver.ts (1) (1)
  • RustPlugin (5-5)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: call-rust-build / Build and Upload Artifacts - darwin-arm64
  • GitHub Check: call-rust-build / Build and Upload Artifacts - android-arm64
  • GitHub Check: call-rust-build / Build and Upload Artifacts - darwin-x64
  • GitHub Check: call-rust-build / Build and Upload Artifacts - win32-arm64-msvc
  • GitHub Check: call-rust-build / Build and Upload Artifacts - win32-ia32-msvc
  • GitHub Check: call-rust-build / Build and Upload Artifacts - x86_64-unknown-freebsd
  • GitHub Check: call-rust-build / Build and Upload Artifacts - linux-x64-gnu
  • GitHub Check: Test - macos-latest
  • GitHub Check: Test - windows-latest
  • GitHub Check: Test - ubuntu-latest
🔇 Additional comments (4)
.changeset/serious-peaches-cheer.md (1)

1-6: Changeset is clear and appropriate for this change.

The changeset correctly identifies this as a patch-level change for the @farmfe/core package, with a clear description of the exported TypeScript type.

packages/core/src/plugin/type.ts (1)

258-258: Successfully exported the RustPlugin type.

This change correctly exports the RustPlugin type alongside the existing rustPluginResolver export, making the type available for external use as intended by the PR.

packages/core/src/plugin/index.ts (2)

7-7: Added necessary import for RustPlugin type.

Importing the RustPlugin type is required for the type annotation added to the rustPlugins array.


22-22: Improved type safety with explicit RustPlugin[] annotation.

Adding the RustPlugin[] type annotation to the rustPlugins array enhances type checking, ensuring that only valid Rust plugins can be added to this array.

✨ Finishing Touches
  • 📝 Generate Docstrings

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:

  • 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

codspeed-hq bot commented Mar 22, 2025

CodSpeed Performance Report

Merging #2129 will create unknown performance changes

Comparing chore/export-rust-plugin (d198687) with main (a785d6f)

Summary

⚠️ No benchmarks were detected in both the base of the PR and the PR.\

@wre232114 wre232114 enabled auto-merge (squash) March 23, 2025 12:58
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.

[Feature Request]: export type RustPlugin
3 participants