-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: package slug #2
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis PR updates the import paths in Sequence diagram for updated import rewriting logicsequenceDiagram
participant C as Codemod
participant AST as Abstract Syntax Tree
C->>AST: Find ImportDeclaration nodes
loop For each ImportDeclaration
C->>AST: Get source value
C->>C: Match source value against regex
alt Framework match
C->>AST: Update source value with @ai-toolkit scope
else Streamable match
C->>AST: Update source value with @ai-toolkit scope
else Root match
C->>AST: Update source value to '@ai-toolkit/core'
end
end
Updated class diagram for rewrite-framework-imports.tsclassDiagram
class ImportDeclaration {
+source: string
}
class rewrite_framework_imports {
+forEach(path: ImportDeclaration)
+match(sourceValue: string): string[]
}
rewrite_framework_imports -- ImportDeclaration : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThis pull request removes a temporary TypeScript configuration file from the ai-toolkit package and updates the import transformation logic in the codemod. The transformer now distinguishes between framework and streamable imports using two separate regex patterns, while also handling root imports of "ai" to be mapped to "@ai-toolkit/core". No changes were made to public API declarations. Changes
Sequence Diagram(s)sequenceDiagram
participant Parser as Source Parser
participant Transformer as Import Transformer
participant Checker as Regex Checker
Parser->>Transformer: Provide import statement
Transformer->>Checker: Evaluate import string
alt Matches framework pattern
Checker-->>Transformer: Return framework match details
Transformer->>Parser: Update import to "@ai-toolkit[/sub-path]"
else Matches streamable pattern
Checker-->>Transformer: Return streamable match details
Transformer->>Parser: Update import accordingly
else Import is root "ai"
Transformer->>Parser: Update import to "@ai-toolkit/core"
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (7)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
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.
Hey @NxPKG - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a test case to ensure the codemod correctly transforms the root import
ai
to@ai-toolkit/core
.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
User description
Notes for Reviewers
This PR fixes #
Signed commits
PR Type
Enhancement, Other
Description
Enhanced framework import handling for
rewrite-framework-imports.ts
.Added support for
streamable
androot
imports in the transformer.Removed unused
tsconfig.vitest-temp.json
configuration file.Changes walkthrough 📝
rewrite-framework-imports.ts
Enhance framework and streamable import handling
packages/codemod/src/codemods/rewrite-framework-imports.ts
svelte
,vue
, andsolid
.streamable
androot
imports.@ai-toolkit
namespace.tsconfig.vitest-temp.json
Remove unused TypeScript configuration file
packages/ai-toolkit/tsconfig.vitest-temp.json
Summary by CodeRabbit