Repository: enzonotario/vitepress-openapi
Pull request #135 (2024-12-12 02:30:17)

fix(sidebar): change collapsable by collapsible option
<!-- Provide a general summary of your changes in the title above. -->

# Description

Fix typo.

## Related issues/external references


## Types of changes

- Bug fix


vercel[bot]: [vc]: #ymwrHJkwxZ9IOpzGVUh5FQDim0sUojks1pkSlFYD25o=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ2aXRlcHJlc3Mtb3BlbmFwaSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9lbnpvLW5vdGFyaW9zLXByb2plY3RzL3ZpdGVwcmVzcy1vcGVuYXBpLzZjakozV2Fzbmo1NUxVY0dmRzFOTVJwTWd2VEYiLCJwcmV2aWV3VXJsIjoidml0ZXByZXNzLW9wZW5hcGktZ2l0LWZlYXR1cmUtdHlwby1lbnpvLW5vdGFyaW9zLXByb2plY3RzLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiUEVORElORyIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJ2aXRlcHJlc3Mtb3BlbmFwaS1naXQtZmVhdHVyZS10eXBvLWVuem8tbm90YXJpb3MtcHJvamVjdHMudmVyY2VsLmFwcCJ9fV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **vitepress-openapi** | 🔄 Building ([Inspect](https://vercel.com/enzo-notarios-projects/vitepress-openapi/6cjJ3Wasnj55LUcGfG1NMRpMgvTF)) | [Visit Preview](https://vitepress-openapi-git-feature-typo-enzo-notarios-projects.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/vitepress-openapi-git-feature-typo-enzo-notarios-projects.vercel.app?via=pr-comment-feedback-link) | Dec 12, 2024 2:30am |


coderabbitai[bot]: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->

> [!NOTE]
> Currently processing new changes in this PR. This may take a few minutes, please wait...
> 
> <details>
> <summary>📥 Commits</summary>
> 
> Reviewing files that changed from the base of the PR and between abc8f80e2da863bf567a44f46593d404a71e4bce and bbaaab13aa4c2bea3b5fc747859524a2721f37ac.
> 
> </details>
> 
> <details>
> <summary>📒 Files selected for processing (5)</summary>
> 
> * `docs/layouts/sidebar.md` (1 hunks)
> * `package.json` (1 hunks)
> * `src/composables/useSidebar.ts` (2 hunks)
> * `src/lib/sidebar/generateSidebarItemsByPaths.ts` (2 hunks)
> * `test/composables/useSidebar.itemsByPaths.test.ts` (2 hunks)
> 
> </details>
> 
> ```ascii
>  _____________________________________________________________________________________________________
> < Trained in all forms of code review, from the ancient art of waterfall to the modern ways of agile. >
>  -----------------------------------------------------------------------------------------------------
>   \
>    \   \
>         \ /\
>         ( )
>       .( o ).
> ```

<!-- end of auto-generated comment: review in progress by coderabbit.ai -->

<!-- usage_tips_start -->

> [!TIP]
> <details>
> <summary>You can validate your CodeRabbit configuration file in your editor.</summary>
> 
> If your editor has YAML language server, you can enable auto-completion and validation by adding `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` at the top of your CodeRabbit configuration file.
> 
> </details>

<!-- usage_tips_end -->
<!-- tips_start -->

---

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?

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai):

- 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](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR. ([Experiment](https://docs.coderabbit.ai/early-access#experiments))
- `@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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Patch:
diff --git a/docs/layouts/sidebar.md b/docs/layouts/sidebar.md
index 511fcd9..4985076 100644
--- a/docs/layouts/sidebar.md
+++ b/docs/layouts/sidebar.md
@@ -99,9 +99,9 @@ module.exports = {
                 startsWith: '',
 
                 /**
-                 * Optionally, you can specify if the sidebar items are collapsable. Default is true.
+                 * Optionally, you can specify if the sidebar items are collapsible. Default is true.
                  */
-                collapsable: true,
+                collapsible: true,
                 
                 /**
                  * Optionally, you can specify a depth for the sidebar items. Default is 6, which is the maximum VitePress sidebar depth.
diff --git a/package.json b/package.json
index beae8be..decc50c 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "vitepress-openapi",
   "type": "module",
-  "version": "0.0.3-alpha.51",
+  "version": "0.0.3-alpha.52",
   "packageManager": "pnpm@9.1.1",
   "homepage": "https://vitepress-openapi.vercel.app/",
   "repository": {
diff --git a/src/composables/useSidebar.ts b/src/composables/useSidebar.ts
index 35faea5..2374bfa 100644
--- a/src/composables/useSidebar.ts
+++ b/src/composables/useSidebar.ts
@@ -203,13 +203,13 @@ export function useSidebar({
 
   function itemsByPaths({
     startsWith = '',
-    collapsable = true,
+    collapsible = true,
     depth = 6,
     sidebarItemTemplate = sidebarItemTemplateForMethodPath,
     linkPrefix: itemLinkPrefix = linkPrefix,
   }: {
     startsWith?: string
-    collapsable?: boolean
+    collapsible?: boolean
     depth?: number
     sidebarItemTemplate?: (method: OpenAPIV3.HttpMethods, path: string) => string
     linkPrefix?: string
@@ -219,7 +219,7 @@ export function useSidebar({
     const sidebarItems = generateSidebarItemsByPaths({
       paths,
       startsWith,
-      collapsable,
+      collapsible,
       depth,
       itemLinkPrefix,
       sidebarItemTemplate,
diff --git a/src/lib/sidebar/generateSidebarItemsByPaths.ts b/src/lib/sidebar/generateSidebarItemsByPaths.ts
index f3351e8..264c3a3 100644
--- a/src/lib/sidebar/generateSidebarItemsByPaths.ts
+++ b/src/lib/sidebar/generateSidebarItemsByPaths.ts
@@ -9,14 +9,14 @@ import { flatSidebarItems } from './flatSidebarItems'
 export function generateSidebarItemsByPaths({
   paths,
   startsWith = '',
-  collapsable = true,
+  collapsible = true,
   itemLinkPrefix = '',
   depth = 6,
   sidebarItemTemplate,
 }: {
   paths: OpenAPIV3.PathsObject
   startsWith?: string
-  collapsable?: boolean
+  collapsible?: boolean
   itemLinkPrefix?: string
   depth?: number
   sidebarItemTemplate?: (method: OpenAPIV3.HttpMethods, path: string) => string
@@ -74,7 +74,7 @@ export function generateSidebarItemsByPaths({
 
   sidebarItems = ensureGroupTextSlashPrefix(sidebarItems)
 
-  if (collapsable) {
+  if (collapsible) {
     sidebarItems = setItemCollapsedState(sidebarItems)
   }
 


Test patch:
diff --git a/test/composables/useSidebar.itemsByPaths.test.ts b/test/composables/useSidebar.itemsByPaths.test.ts
index 575d197..7cb3cf7 100644
--- a/test/composables/useSidebar.itemsByPaths.test.ts
+++ b/test/composables/useSidebar.itemsByPaths.test.ts
@@ -272,7 +272,7 @@ describe('useSidebar itemsByPaths', () => {
 
   it('generate items by path without collapsed option', () => {
     const result = sidebar.itemsByPaths({
-      collapsable: false,
+      collapsible: false,
     })
 
     expect(
@@ -342,7 +342,7 @@ describe('useSidebar itemsByPaths', () => {
   it('generate items witn linkPrefix option', () => {
     const result = sidebar.itemsByPaths({
       linkPrefix: '/custom-prefix/',
-      collapsable: false,
+      collapsible: false,
     })
 
     expect(