Skip to content
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

feat: OAIntroduction component #145

Merged
merged 3 commits into from
Dec 30, 2024
Merged

feat: OAIntroduction component #145

merged 3 commits into from
Dec 30, 2024

Conversation

enzonotario
Copy link
Owner

Description

Add OAIntroduction component to show info and servers sections.

Related issues/external references

Types of changes

  • New feature

Copy link

vercel bot commented Dec 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vitepress-openapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 30, 2024 2:10am

Copy link
Contributor

coderabbitai bot commented Dec 30, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces a new OAIntroduction component and updates the documentation structure for the VitePress OpenAPI package. The changes involve modifying the sidebar configuration, adding a new component for displaying OpenAPI introduction information, and updating documentation files to reflect these changes. The modifications aim to improve the navigation and presentation of OpenAPI-related content in the documentation.

Changes

File Change Summary
docs/.vitepress/config.mts Removed "Info and Servers" sidebar entry, replaced with "Introduction"
docs/.vitepress/theme/components/sandbox/SandboxPreview.vue Added OAIntroduction component to template with conditional rendering
docs/.vitepress/theme/components/theme/ThemeConfig.vue Added 'OAIntroduction' to availableComponents array
docs/.vitepress/theme/sandboxData.ts Updated SandboxData interface to include 'OAIntroduction' in previewComponent
docs/guide/getting-started.md Updated installation and usage instructions
docs/pages/info-servers.md Deleted file
docs/pages/introduction.md New documentation page for OAIntroduction, OAInfo, and OAServers components
src/components/Common/OAIntroduction.vue New Vue component for rendering OpenAPI introduction
src/components/index.ts Added OAIntroduction to component exports
package.json Updated version from 0.0.3-alpha.54 to 0.0.3-alpha.55

Possibly related PRs


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b459dbc and fda82c1.

📒 Files selected for processing (2)
  • docs/pages/introduction.md (1 hunks)
  • package.json (1 hunks)

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

pkg-pr-new bot commented Dec 30, 2024

Open in Stackblitz

npm i https://pkg.pr.new/vitepress-openapi@145

commit: fda82c1

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2631da4 and b459dbc.

📒 Files selected for processing (9)
  • docs/.vitepress/config.mts (1 hunks)
  • docs/.vitepress/theme/components/sandbox/SandboxPreview.vue (1 hunks)
  • docs/.vitepress/theme/components/theme/ThemeConfig.vue (1 hunks)
  • docs/.vitepress/theme/sandboxData.ts (1 hunks)
  • docs/guide/getting-started.md (1 hunks)
  • docs/pages/info-servers.md (0 hunks)
  • docs/pages/introduction.md (1 hunks)
  • src/components/Common/OAIntroduction.vue (1 hunks)
  • src/components/index.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • docs/pages/info-servers.md
🧰 Additional context used
🪛 LanguageTool
docs/pages/introduction.md

[uncategorized] ~11-~11: You might be missing the article “the” here.
Context: ... </script> # Introduction You can use OAIntroduction component to display the...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 Markdownlint (0.37.0)
docs/pages/introduction.md

5-5: Element: script
Inline HTML

(MD033, no-inline-html)


13-13: Element: ScopeConfigurationTabs
Inline HTML

(MD033, no-inline-html)


43-43: Element: SandboxIframe
Inline HTML

(MD033, no-inline-html)


49-49: Element: ScopeConfigurationTabs
Inline HTML

(MD033, no-inline-html)


5-5: null
First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🔇 Additional comments (10)
src/components/Common/OAIntroduction.vue (1)

2-19: 🧹 Nitpick (assertive)

Consider adding error-handling or fallback behavior for invalid inputs.

You’re using props.openapi ?? getOpenApiInstance(...) to set the openapi object. While helpful for ensuring a default, consider verifying the validity of props.spec or handling errors that might occur within getOpenApiInstance(). This will make the component more robust if the input data or external function call behaves unexpectedly.

Do you want me to generate a script to locate all calls to getOpenApiInstance() and check for error handling patterns across the codebase?

docs/.vitepress/theme/sandboxData.ts (1)

16-16: Keep the documentation in sync with the newly added 'OAIntroduction' value.

The new value 'OAIntroduction' expands the previewComponent options. Be sure to update any related docs or references so that users understand the availability and purpose of this new preview mode.

src/components/index.ts (1)

25-25: Nice addition of OAIntroduction to the exports.

Exporting the OAIntroduction component alongside the others ensures it’s discoverable and can be imported throughout the codebase. This change appears consistent with your overall approach for exposing common components.

Also applies to: 55-55

docs/.vitepress/theme/components/sandbox/SandboxPreview.vue (1)

89-93: Seamless integration of the <OAIntroduction> component.

You’ve integrated <OAIntroduction> in the same pattern as the existing components, conditionally rendering it based on sandboxData.previewComponent. This is a straightforward approach and should keep your preview logic consistent.

docs/.vitepress/theme/components/theme/ThemeConfig.vue (1)

14-14: Add 'OAIntroduction' to the preview component list.
It seems well-integrated and consistent with how other components are registered.

docs/.vitepress/config.mts (1)

49-50: Renamed "Info and Servers" to "Introduction".
The updated sidebar text and link appear straightforward.

docs/pages/introduction.md (2)

5-7: Inline script block is acceptable.
Including <script setup> for component imports is a common practice in Vue documentation.

🧰 Tools
🪛 Markdownlint (0.37.0)

5-5: Element: script
Inline HTML

(MD033, no-inline-html)


5-5: null
First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


43-43: Inline element usage.
<SandboxIframe> is used inside Markdown, which might trigger MD033 warnings. However, if the documentation format allows inline components, this is fine.

🧰 Tools
🪛 Markdownlint (0.37.0)

43-43: Element: SandboxIframe
Inline HTML

(MD033, no-inline-html)

docs/guide/getting-started.md (2)

29-29: Clearer installation directive.
Stating that users can install the package via their preferred package manager is an improvement for clarity.


31-50: Multi-package-manager instructions.
These code-group sections comprehensively cover installation methods. This approach is user-friendly and well-structured.

src/components/Common/OAIntroduction.vue Show resolved Hide resolved
docs/pages/introduction.md Outdated Show resolved Hide resolved
@enzonotario enzonotario changed the title chore(docs): package managers tabs feat: OAIntroduction component Dec 30, 2024
@enzonotario enzonotario merged commit 116e2f9 into develop Dec 30, 2024
3 of 5 checks passed
@enzonotario enzonotario deleted the feature/oaintroduction branch January 8, 2025 22:04
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