Skip to content

feat(website): Initialize VitePress documentation site#241

Merged
yamadashy merged 2 commits intomainfrom
feat/website
Jan 2, 2025
Merged

feat(website): Initialize VitePress documentation site#241
yamadashy merged 2 commits intomainfrom
feat/website

Conversation

@yamadashy
Copy link
Owner

Checklist

  • Run npm run test
  • Run npm run lint

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@codecov
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.26%. Comparing base (a41f903) to head (6621d1f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #241   +/-   ##
=======================================
  Coverage   92.26%   92.26%           
=======================================
  Files          44       44           
  Lines        2106     2106           
  Branches      462      462           
=======================================
  Hits         1943     1943           
  Misses        163      163           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yamadashy yamadashy merged commit 83ed0a2 into main Jan 2, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a comprehensive setup for the Repomix website using VitePress, a static site generator. The changes include creating a new documentation site with custom components, styling, and configuration. The project focuses on presenting Repomix as a tool for transforming repositories into AI-friendly formats, with a clean, modern design and responsive layout. The implementation covers configuration files, Vue components, CSS styling, and documentation content.

Changes

File Change Summary
.gitignore Added entries for .vitepress/cache/, .vitepress/dist/, and node_modules/ directories
.vitepress/config.mts Created VitePress configuration with project title, description, logo, and GitHub link
.vitepress/theme/components/ Added new Vue components: Hero.vue, Home.vue, and TryIt.vue for site layout and functionality
custom.css Defined new CSS custom properties for branding, colors, and hero section styling
theme/index.ts Configured custom VitePress theme with imported components
theme/style.css Added comprehensive CSS variables for theme customization
index.md Created homepage with project description, features, and GitHub link
package.json Added VitePress scripts and development dependency

Sequence Diagram

sequenceDiagram
    participant User
    participant WebsiteUI as Repomix Website
    participant TryItComponent as Try It Component

    User->>WebsiteUI: Visits homepage
    WebsiteUI->>User: Displays project overview
    User->>TryItComponent: Enters GitHub repo URL
    User->>TryItComponent: Selects output format
    User->>TryItComponent: Configures output options
    TryItComponent->>User: Logs submission details
Loading

Possibly Related PRs


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?

❤️ 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. (Beta)
  • @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: 2

🧹 Nitpick comments (9)
website/client/.vitepress/theme/components/TryIt.vue (1)

108-237: Add missing styles for error and loading states.

The current styles need to be enhanced for better user feedback:

  1. Add styles for error messages
  2. Add visual feedback for loading states
  3. Improve focus states for better accessibility

Add these additional styles:

 .checkbox-input {
   width: 16px;
   height: 16px;
   accent-color: var(--vp-c-brand-1);
 }
 
+.error-message {
+  margin-top: 8px;
+  color: var(--vp-c-danger);
+  font-size: 14px;
+}
+
+.pack-button:disabled {
+  opacity: 0.7;
+  cursor: not-allowed;
+  background: var(--vp-c-gray);
+}
+
+.repository-input:disabled {
+  opacity: 0.7;
+  cursor: not-allowed;
+}
+
+/* Improve focus visibility for keyboard navigation */
+.repository-input:focus-visible,
+.pack-button:focus-visible,
+.format-button:focus-visible,
+.checkbox-input:focus-visible {
+  outline: 2px solid var(--vp-c-brand-1);
+  outline-offset: 2px;
+}

 @media (max-width: 640px) {
website/client/.vitepress/theme/components/Hero.vue (2)

10-11: Consider adding a brief docstring or comment for clarity

While the template is straightforward, a short comment or docstring clarifying how site.title is populated could help future maintainers unfamiliar with VitePress.


49-53: Remove unused class or document intended usage

The .hero-tagline style definition is unused in the template. If it's not planned for future usage, removing it keeps the codebase maintainable. Otherwise, consider adding it to improve the hero section.

website/client/.vitepress/theme/index.ts (2)

1-5: Question about h import usage
Although h is imported from 'vue', it appears to be unused in this snippet since the custom layout code is commented out. Unless you plan to use h in future customizations, consider removing the import to keep code clean and consistent.


7-14: Consider activating or removing commented-out layout code
You have a placeholder for a custom layout at lines 9–13. If you plan on providing a unique layout experience, uncomment and adjust it as needed. Otherwise, removing the commented code may help maintain clarity.

website/client/index.md (3)

7-16: Hero configuration looks solid
Defining the hero name, text, and image sources is clear. Consider adding additional action buttons or links if you intend to guide users to multiple resources (e.g., docs, demos) from this hero section.


18-34: Features section is well-structured
The features are well-organized with clear icons and descriptive details. Ensure that emojis are accessible by including an appropriate aria-label or accessible text if needed for screen readers.


37-41: In-line CSS block
The .hero-description__accent class highlights text effectively. If you plan to reuse this accent style in multiple places or have more extensive styling in future expansions, consider moving it to a dedicated CSS or the global style file for maintainability.

website/client/.vitepress/theme/style.css (1)

93-107: Hero component style
The gradient background adds a fresh look to the hero section. Monitor load performance if you plan to layer multiple gradients with effects like blur().

Would you like help measuring performance impacts or exploring alternate gradient solutions?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a41f903 and 6621d1f.

⛔ Files ignored due to path filters (2)
  • website/client/package-lock.json is excluded by !**/package-lock.json
  • website/client/public/repomix-logo.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • website/client/.gitignore (1 hunks)
  • website/client/.vitepress/config.mts (1 hunks)
  • website/client/.vitepress/theme/components/Hero.vue (1 hunks)
  • website/client/.vitepress/theme/components/Home.vue (1 hunks)
  • website/client/.vitepress/theme/components/TryIt.vue (1 hunks)
  • website/client/.vitepress/theme/custom.css (1 hunks)
  • website/client/.vitepress/theme/index.ts (1 hunks)
  • website/client/.vitepress/theme/style.css (1 hunks)
  • website/client/index.md (1 hunks)
  • website/client/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • website/client/.vitepress/theme/components/Home.vue
  • website/client/.vitepress/config.mts
  • website/client/.gitignore
  • website/client/.vitepress/theme/custom.css
🔇 Additional comments (12)
website/client/package.json (2)

2-6: LGTM! Scripts configuration looks good.

The standard VitePress scripts are correctly configured for development, building, and previewing the documentation site.


7-9: 🛠️ Refactor suggestion

Add required peer dependencies for VitePress.

VitePress requires Vue as a peer dependency. Consider adding the following dependencies to ensure proper functionality:

 {
   "devDependencies": {
-    "vitepress": "^1.5.0"
+    "vitepress": "^1.5.0",
+    "vue": "^3.3.0"
   }
 }

Let's verify the VitePress peer dependencies:

website/client/.vitepress/theme/components/TryIt.vue (1)

1-237: Add unit tests for the component.

Please ensure proper test coverage for this component, including:

  1. Form validation
  2. User interactions (submit, format selection, options)
  3. Loading and error states
  4. Responsive behavior

Would you like me to help create a test suite for this component using Vitest or Jest?

website/client/.vitepress/theme/components/Hero.vue (3)

2-6: Use of Composition API looks good

You're correctly extracting the site object from VitePress's useData hook. This is a clean solution that leverages the Composition API effectively.


19-35: Validate gradient support on different browsers

The usage of -webkit-linear-gradient combined with -webkit-background-clip: text might not be fully supported by older browsers. If you need broader compatibility, consider adding a standard linear-gradient fallback or specifying additional vendor prefixes.


55-67: Responsive design is well-structured

Your media queries correctly handle the font sizes for smaller screens, maintaining readability across devices. Great job!

website/client/index.md (1)

1-7: Great use of frontmatter
The frontmatter is clean, clearly specifies important metadata (layout, title, etc.), and aligns well with VitePress conventions.

website/client/.vitepress/theme/style.css (5)

1-71: Confirm color contrast and accessibility
You have well-structured color scales. Just confirm that the brand and default colors meet WCAG contrast ratios when used for text on any background color (including the -soft variants). This step helps ensure accessibility for all users.


77-87: Button variables enhanced
Defining comprehensive states (normal, hover, active) via custom properties is a best practice for consistent styling across the site. The usage of accessible text colors (white on darker backgrounds) is appreciated.


109-119: Responsive design
The incremental blur changes at breakpoints show strong attention to responsive design. Test across various device sizes to ensure the hero images still display correctly on high-resolution screens.


125-130: Custom block tip styling
Using brand-soft variables for background and code blocks gives consistency to the site’s helper messages. Great approach for theming.


136-138: Algolia search color
Overriding the primary color for the search component helps tie it neatly into the site’s brand. Keep an eye out for any upcoming Algolia UI updates that might require further adjustments.

Comment on lines +5 to +22
const url = ref('')
const format = ref('xml')
const removeComments = ref(false)
const removeEmptyLines = ref(false)
const showLineNumbers = ref(false)

const handleSubmit = () => {
// Handle form submission
console.log({
url: url.value,
format: format.value,
options: {
removeComments: removeComments.value,
removeEmptyLines: removeEmptyLines.value,
showLineNumbers: showLineNumbers.value
}
})
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add form validation and error handling.

The current implementation lacks several essential features:

  1. URL validation to ensure it's a valid GitHub repository
  2. Loading states during form submission
  3. Error handling for failed submissions
  4. Actual API integration instead of console.log

Consider implementing these improvements:

 const url = ref('')
 const format = ref('xml')
 const removeComments = ref(false)
 const removeEmptyLines = ref(false)
 const showLineNumbers = ref(false)
+const isLoading = ref(false)
+const error = ref(null)
+
+const isValidGithubUrl = (url) => {
+  const githubUrlPattern = /^(https?:\/\/)?(www\.)?github\.com\/[a-zA-Z0-9-]+\/[a-zA-Z0-9-._]+$/
+  return githubUrlPattern.test(url) || /^[a-zA-Z0-9-]+\/[a-zA-Z0-9-._]+$/.test(url)
+}
 
 const handleSubmit = () => {
-  // Handle form submission
-  console.log({
-    url: url.value,
-    format: format.value,
-    options: {
-      removeComments: removeComments.value,
-      removeEmptyLines: removeEmptyLines.value,
-      showLineNumbers: showLineNumbers.value
-    }
-  })
+  error.value = null
+  if (!url.value) {
+    error.value = 'Please enter a GitHub repository URL'
+    return
+  }
+  if (!isValidGithubUrl(url.value)) {
+    error.value = 'Please enter a valid GitHub repository URL'
+    return
+  }
+  
+  isLoading.value = true
+  // TODO: Implement API call
+  try {
+    // await apiClient.packRepository({ ... })
+  } catch (e) {
+    error.value = 'Failed to process repository. Please try again.'
+  } finally {
+    isLoading.value = false
+  }
 }

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +25 to +106
<template>
<div class="container">
<div class="try-it-container">
<div class="input-group">
<div class="url-input-container">
<input
v-model="url"
type="text"
placeholder="GitHub repo URL or name (e.g., facebook/react)"
class="repository-input"
/>
<button @click="handleSubmit" class="pack-button">
Pack
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14"/>
<path d="m12 5 7 7-7 7"/>
</svg>
</button>
</div>
</div>

<div class="options-container">
<div class="option-group">
<p class="option-label">Output Format</p>
<div class="format-buttons">
<button
class="format-button"
:class="{ active: format === 'xml' }"
@click="format = 'xml'"
>
XML
</button>
<button
class="format-button"
:class="{ active: format === 'markdown' }"
@click="format = 'markdown'"
>
Markdown
</button>
<button
class="format-button"
:class="{ active: format === 'text' }"
@click="format = 'text'"
>
Text
</button>
</div>
</div>

<div class="option-group">
<p class="option-label">Output Options</p>
<div class="checkbox-group">
<label class="checkbox-label">
<input
v-model="removeComments"
type="checkbox"
class="checkbox-input"
/>
<span>Remove Comments</span>
</label>
<label class="checkbox-label">
<input
v-model="removeEmptyLines"
type="checkbox"
class="checkbox-input"
/>
<span>Remove Empty Lines</span>
</label>
<label class="checkbox-label">
<input
v-model="showLineNumbers"
type="checkbox"
class="checkbox-input"
/>
<span>Show Line Numbers</span>
</label>
</div>
</div>
</div>
</div>
</div>
</template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve accessibility and form semantics.

The template structure needs improvements for better accessibility and user experience:

  1. Use semantic <form> element
  2. Add proper ARIA labels
  3. Display loading and error states
  4. Add keyboard navigation support

Here's how to improve the template:

 <template>
   <div class="container">
     <div class="try-it-container">
-      <div class="input-group">
+      <form @submit.prevent="handleSubmit" class="input-group">
         <div class="url-input-container">
           <input
               v-model="url"
               type="text"
+              aria-label="GitHub repository URL"
               placeholder="GitHub repo URL or name (e.g., facebook/react)"
               class="repository-input"
+              :disabled="isLoading"
           />
-          <button @click="handleSubmit" class="pack-button">
-            Pack
+          <button type="submit" class="pack-button" :disabled="isLoading">
+            {{ isLoading ? 'Processing...' : 'Pack' }}
             <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
               <path d="M5 12h14"/>
               <path d="m12 5 7 7-7 7"/>
             </svg>
           </button>
         </div>
+        <div v-if="error" class="error-message" role="alert">
+          {{ error }}
+        </div>
-      </div>
+      </form>

       <div class="options-container">
         <div class="option-group">
           <p class="option-label">Output Format</p>
           <div class="format-buttons" role="radiogroup" aria-label="Output format selection">

Committable suggestion skipped: line range outside the PR's diff.

@yamadashy yamadashy deleted the feat/website branch January 3, 2025 03:44
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.

1 participant