feat(website): Add include patterns support to web interface#249
feat(website): Add include patterns support to web interface#249
Conversation
|
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
=======================================
Coverage 92.26% 92.26%
=======================================
Files 44 44
Lines 2108 2108
Branches 462 462
=======================================
Hits 1945 1945
Misses 163 163 ☔ View full report in Codecov by Sentry. |
📝 WalkthroughWalkthroughThis pull request introduces a new feature for specifying include patterns when processing GitHub repositories. The changes span multiple files across the client and server components, adding an Changes
Sequence DiagramsequenceDiagram
participant User
participant ClientUI
participant Analytics
participant Backend
User->>ClientUI: Enter include patterns
ClientUI->>Analytics: Track include patterns update
ClientUI->>Backend: Submit repository with include patterns
Backend->>Backend: Validate and sanitize patterns
Backend->>Backend: Process repository using include patterns
Backend-->>ClientUI: Return processed repository
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
website/server/src/types.ts (1)
7-7: Consider allowing an array type for multiple include patterns.
Currently, this property is defined as a string analogous toignorePatterns. If supporting multiple patterns more naturally, consider making this an array of strings or clarifying the delimiter-based approach.website/server/src/utils/validation.ts (1)
16-16: Double-check absolute paths on Windows.
This filter removes patterns that start with “/” or contain “../” or “..\”. If Windows drive letters (e.g., “C:\”) need to be excluded, consider adding a check for them as well.website/server/src/schemas/request.ts (1)
17-21: Optionally align validation withignorePatterns.
If you want to restrict the allowed characters forincludePatternssimilarly toignorePatterns, consider applying the same regex for consistent pattern rules.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
website/client/.vitepress/theme/components/TryIt.vue(5 hunks)website/client/.vitepress/theme/components/api/client.ts(1 hunks)website/client/.vitepress/theme/components/utils/analytics.ts(2 hunks)website/server/src/remoteRepo.ts(3 hunks)website/server/src/schemas/request.ts(1 hunks)website/server/src/types.ts(1 hunks)website/server/src/utils/validation.ts(1 hunks)
🔇 Additional comments (11)
website/client/.vitepress/theme/components/api/client.ts (1)
7-7: Property definition aligns with server schema.
No concerns — this property correctly mirrors the server interface addition.website/server/src/remoteRepo.ts (3)
9-9: Use of a unifiedsanitizePatternis well-structuredImporting the unified
sanitizePatternfunction to handle both include and ignore patterns keeps the code DRY and consistent.
44-45: Validate undefined or empty pattern arraysYour
sanitizePattern(validatedData.options.includePatterns)andsanitizePattern(validatedData.options.ignorePatterns)calls are well-placed, but please confirm that edge cases—like empty strings or null/undefined—won’t cause issues or bypass the validation.
60-60: Ensure proper mapping in CLI optionsIncluding both
includeandignorepatterns in thecliOptionsobject is good. Just verify that the downstream library (repomix) handles them as expected, especially if the sanitized result is[]or[''].website/client/.vitepress/theme/components/utils/analytics.ts (2)
27-27: Addition ofUPDATE_INCLUDE_PATTERNSconstantDefining a separate analytics constant for include patterns helps clearly distinguish these events. Nicely done.
111-117: New method for tracking include patterns updatesThe
trackIncludePatternsUpdatemethod is straightforward and consistent with your analytics pattern. Ensure it’s called at all necessary points whereincludePatternschanges.website/client/.vitepress/theme/components/TryIt.vue (5)
17-17: New state variable forincludePatternsHaving a dedicated
reffor include patterns is a clean approach.
71-71: Include patterns in request optionsSending
includePatterns(when non-empty) aligns well with the server’s new logic. Consider an additional client-side safety check or preview before submission, if relevant to the UX.
145-148: Refined analytics for include patternsThe
handleIncludePatternsUpdatefunction uses analytics to track changes, which is an excellent way to gain insights on how users use the feature.
247-258: User-friendly input for include patternsProviding direct guidance and an external reference link (glob syntax doc) is a valuable addition to help users properly define patterns.
450-456: Good link stylingHighlighting the external link with a brand color and an underline on hover is a user-friendly approach.
Deploying repomix with
|
| Latest commit: |
cd2c172
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d0a570c9.repomix.pages.dev |
| Branch Preview URL: | https://feat-website-include-pattern.repomix.pages.dev |
ref: #219 (comment)
Checklist
npm run testnpm run lint