Content-Length: 314783 | pFad | http://github.com/bootstrap-vue-next/bootstrap-vue-next/pull/2724

54 docs: fix unplugin-vue-components issue by dwgray · Pull Request #2724 · bootstrap-vue-next/bootstrap-vue-next · GitHub
Skip to content

docs: fix unplugin-vue-components issue #2724

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

Merged
merged 1 commit into from
Jun 7, 2025

Conversation

dwgray
Copy link
Member

@dwgray dwgray commented Jun 2, 2025

Describe the PR

Someone over in unplugin-vue-comopnents proposed a solution to the issue that we ran into a while back that unplugin components weren't being registered when building the documents. The proposed solution is to add *.ts to the include list, presumably *.js is implied in some way in the system.

In any case, this works and cleans up our *.md files nicely.

Small replication

Most of the component documentation files.

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix 🐛 - fix(...)
  • Feature - feat(...)
  • ARIA accessibility - fix(...)
  • Documentation update - docs(...)
  • Other (please describe)

The PR fulfills these requirements:

  • Pull request title and all commits follow the Conventional Commits convention or has an override in this pull request body This is very important, as the CHANGELOG is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied

Summary by CodeRabbit

  • Refactor
    • Updated all component documentation files to use the modern Vue 3 <script setup> syntax, simplifying code and improving readability without changing component behavior.
    • Removed unused imports and variables in the progress documentation for cleaner scripts.
  • Chores
    • Enhanced VitePress configuration to support TypeScript files in component auto-imports.

Copy link

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

Copy link

coderabbitai bot commented Jun 2, 2025

Walkthrough

This change refactors multiple Vue component documentation files by converting their script blocks from the Options API with explicit setup() functions to the Composition API using the <script setup> syntax. Additionally, the VitePress configuration is updated to include .ts files for component auto-imports.

Changes

Files/Groups Change Summary
apps/docs/.vitepress/config.mts Expanded unplugin-vue-components plugin to include .ts files for processing.
apps/docs/src/docs/components/*.md (accordion, alert, avatar, badge, breadcrumb, button*, card, carousel, collapse, dropdown, form*, grid-system, image, input-group, link, list-group, nav, navbar, offcanvas, pagination, progress, spinner, table, tabs) Refactored script blocks from Options API with explicit setup() to Composition API <script setup> syntax; removed explicit exports and setup functions, directly importing data. Also removed unused imports and variables in progress.md.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant VitePress
    participant VueComponent

    User->>VitePress: Loads Markdown component doc
    VitePress->>VueComponent: Parses <script setup> block
    VueComponent-->>VitePress: Exposes imported data to template scope
    VitePress-->>User: Renders documentation with simplified component
Loading

Possibly related PRs

Poem

In the docs where Vue scripts dwell,
A rabbit hopped and cast a spell:
"No more setup, no more fuss,
Just <script setup>—that’s enough for us!"
Now the code is lean and neat,
TypeScript joins the auto-import fleet.
Hippity-hop, the docs can't be beat! 🐇✨


📜 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 41dddcd and 985a8bc.

📒 Files selected for processing (35)
  • apps/docs/.vitepress/config.mts (1 hunks)
  • apps/docs/src/docs/components/accordion.md (1 hunks)
  • apps/docs/src/docs/components/alert.md (1 hunks)
  • apps/docs/src/docs/components/avatar.md (1 hunks)
  • apps/docs/src/docs/components/badge.md (1 hunks)
  • apps/docs/src/docs/components/breadcrumb.md (1 hunks)
  • apps/docs/src/docs/components/button-group.md (1 hunks)
  • apps/docs/src/docs/components/button-toolbar.md (1 hunks)
  • apps/docs/src/docs/components/button.md (1 hunks)
  • apps/docs/src/docs/components/card.md (1 hunks)
  • apps/docs/src/docs/components/carousel.md (1 hunks)
  • apps/docs/src/docs/components/collapse.md (1 hunks)
  • apps/docs/src/docs/components/dropdown.md (1 hunks)
  • apps/docs/src/docs/components/form-checkbox.md (1 hunks)
  • apps/docs/src/docs/components/form-group.md (1 hunks)
  • apps/docs/src/docs/components/form-input.md (1 hunks)
  • apps/docs/src/docs/components/form-radio.md (1 hunks)
  • apps/docs/src/docs/components/form-select.md (1 hunks)
  • apps/docs/src/docs/components/form-spinbutton.md (1 hunks)
  • apps/docs/src/docs/components/form-tags.md (1 hunks)
  • apps/docs/src/docs/components/form-textarea.md (1 hunks)
  • apps/docs/src/docs/components/form.md (1 hunks)
  • apps/docs/src/docs/components/grid-system.md (1 hunks)
  • apps/docs/src/docs/components/image.md (1 hunks)
  • apps/docs/src/docs/components/input-group.md (1 hunks)
  • apps/docs/src/docs/components/link.md (1 hunks)
  • apps/docs/src/docs/components/list-group.md (1 hunks)
  • apps/docs/src/docs/components/nav.md (1 hunks)
  • apps/docs/src/docs/components/navbar.md (1 hunks)
  • apps/docs/src/docs/components/offcanvas.md (1 hunks)
  • apps/docs/src/docs/components/pagination.md (1 hunks)
  • apps/docs/src/docs/components/progress.md (0 hunks)
  • apps/docs/src/docs/components/spinner.md (1 hunks)
  • apps/docs/src/docs/components/table.md (1 hunks)
  • apps/docs/src/docs/components/tabs.md (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/docs/src/docs/components/progress.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (30)
apps/docs/.vitepress/config.mts (1)

34-34: LGTM! Correctly enables TypeScript file processing for component auto-imports.

This change appropriately extends the unplugin-vue-components plugin to include .ts files, which directly addresses the component registration issue mentioned in the PR objectives. The addition supports the <script setup lang="ts"> syntax used in the updated documentation components.

apps/docs/src/docs/components/alert.md (1)

82-84: LGTM! Clean conversion to Composition API syntax.

The refactoring from Options API with explicit setup() function to <script setup lang="ts"> syntax is correct and follows Vue 3 best practices. This simplifies the component code while maintaining the same functionality.

apps/docs/src/docs/components/image.md (1)

133-135: LGTM! Consistent with the Composition API refactoring pattern.

The conversion to <script setup lang="ts"> syntax is correctly implemented and consistent with the broader refactoring across the documentation components. The data import and functionality remain unchanged.

apps/docs/src/docs/components/button-toolbar.md (1)

38-40: LGTM! Properly follows the established refactoring pattern.

The conversion to <script setup lang="ts"> syntax is correctly implemented and maintains consistency with the other documentation components. The data import path correctly references the buttonToolbar data file.

apps/docs/src/docs/components/form-select.md (1)

160-163: Conversion to Composition API <script setup>
The new <script setup lang="ts"> block cleanly replaces the old Options API boilerplate (export default + setup()), directly importing data and exposing it to the template.

apps/docs/src/docs/components/badge.md (1)

71-74: Refactored to <script setup lang="ts">
Leveraging the Vue 3 Composition API sugar syntax simplifies the component script. The import path for data appears correct and consistent.

apps/docs/src/docs/components/avatar.md (1)

252-255: Adopted <script setup> pattern
Good modernization: the explicit export default and setup() wrapper are removed in favor of a concise <script setup> import, aligning with other components.

apps/docs/src/docs/components/accordion.md (1)

39-42: Migrated to <script setup lang="ts">
This refactor eliminates boilerplate and uses direct imports to expose data—consistent with the pattern applied across the docs.

apps/docs/src/docs/components/form-group.md (1)

228-231: Simplified to Composition API <script setup>
The new script block correctly imports data and removes the extra Options API wrapper, improving readability and consistency.

apps/docs/src/docs/components/form-checkbox.md (1)

211-214: Verify TypeScript data import resolution
Ensure the relative import path

import {data} from '../../data/components/formCheckbox.data'

correctly resolves to the actual formCheckbox.data.ts module. Confirm that VitePress/Vite configuration supports extensionless .ts imports within markdown files and that no import errors will occur at build time.

apps/docs/src/docs/components/collapse.md (1)

105-107: Composition API <script setup lang="ts"> conversion looks good
Streamlines the component script by removing the Options API boilerplate. The relative import of data is correct given the updated .ts support.

apps/docs/src/docs/components/navbar.md (1)

174-176: Updated to <script setup lang="ts"> correctly
Switching to the Composition API <script setup> syntax simplifies the component setup, and the import path for navbar.data is valid with the new .ts inclusion.

apps/docs/src/docs/components/button-group.md (1)

47-49: Script block refactored to <script setup lang="ts">
The change removes boilerplate and leverages <script setup> for cleaner syntax; the data import path aligns with the project structure.

apps/docs/src/docs/components/input-group.md (1)

118-120: Converted to <script setup lang="ts"> as expected
This refactor follows the Composition API pattern and the import of inputGroup.data is correct under the new .ts inclusion settings.

apps/docs/src/docs/components/list-group.md (1)

126-128: Migration to <script setup lang="ts"> is correct
Removes the old Options API export for a concise <script setup> block; the relative import path is consistent with the data directory.

apps/docs/src/docs/components/dropdown.md (1)

325-327: Refactor to <script setup lang="ts">
The new <script setup> block cleanly imports data and makes it available in the template. Ensure the VitePress config (.vitepress/config.mts) has been updated to include .ts files in the unplugin-vue-components include patterns so these TypeScript blocks are recognized during the docs build.

apps/docs/src/docs/components/link.md (1)

99-101: Modernize to <script setup lang="ts">
This change removes the old Options API boilerplate and directly exposes data via the <script setup> shorthand. The import path is correct and aligns with the project structure.

apps/docs/src/docs/components/form-tags.md (1)

217-219: Adopt Composition API <script setup>
Switching to <script setup lang="ts"> simplifies the component definition—data is imported directly and available in the template without an explicit setup() function. Path and syntax look spot-on.

apps/docs/src/docs/components/tabs.md (1)

265-267: Switch to <script setup lang="ts"> syntax
The snippet cleanly transitions from the Options API to the Composition API shorthand. The data import is correctly resolved and no additional setup boilerplate is needed.

apps/docs/src/docs/components/carousel.md (1)

136-138: Convert to <script setup lang="ts">
Leveraging <script setup> removes unnecessary verbosity and directly pulls in data. The import path matches the repository layout and requires no further adjustments.

apps/docs/src/docs/components/form-textarea.md (1)

202-204: Correct <script setup> migration
The conversion from an Options API block to a <script setup lang="ts"> block is accurate, and the relative import path for data is correct.

apps/docs/src/docs/components/nav.md (1)

206-208: Approve <script setup> refactor
The refactor to <script setup lang="ts"> matches the pattern used across other components, and the data import path is valid.

apps/docs/src/docs/components/form-radio.md (1)

179-181: Approve Composition API <script setup>
The switch to <script setup lang="ts"> is correctly applied, with no changes needed to the imported data reference.

apps/docs/src/docs/components/button.md (1)

152-154: Approve <script setup> syntax update
The migration to <script setup lang="ts"> is seamless, and the import of button.data is correctly resolved.

apps/docs/src/docs/components/grid-system.md (1)

447-449: Approve <script setup> conversion
The <script setup lang="ts"> block is properly introduced, and the gridSystem.data import path is accurate.

apps/docs/src/docs/components/form-input.md (1)

284-286: Simplified to <script setup> correctly
The refactor replaces the Options API boilerplate with a <script setup lang="ts"> block, importing data directly. The import path ../../data/components/formInput.data looks correct relative to this file.

apps/docs/src/docs/components/pagination.md (1)

165-167: Consistent Composition API usage
The conversion to <script setup lang="ts"> cleanly removes the explicit export default and setup() function. The data import path is accurate.

apps/docs/src/docs/components/table.md (1)

1046-1048: Refactored to <script setup> correctly
This change simplifies the component script by using the script setup syntax. The imported data path is correct for the table demo.

apps/docs/src/docs/components/form-spinbutton.md (1)

129-131: Updated to <script setup> syntax
The script block now leverages <script setup lang="ts"> without altering behavior. The import reference seems properly scoped.

apps/docs/src/docs/components/spinner.md (1)

107-109: Adopted Composition API <script setup>
The refactor removes unnecessary boilerplate, directly importing data in a script setup block. The import path is correct.

✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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

pkg-pr-new bot commented Jun 2, 2025

bsvn-vite-ts

npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next@2724
npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next/@bootstrap-vue-next/nuxt@2724

commit: 985a8bc

@VividLemon VividLemon merged commit 9628645 into bootstrap-vue-next:main Jun 7, 2025
5 checks passed
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.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/bootstrap-vue-next/bootstrap-vue-next/pull/2724

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy