Skip to content

Add versioning to support multiple Tiptap versions #115

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

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

bdbch
Copy link
Member

@bdbch bdbch commented Mar 24, 2025

This pull request includes significant updates to the codebase to support versioning for the documentation and improve the navigation components. The most important changes include the introduction of version-specific paths for importing content, the addition of a version switch component, and modifications to the dropdown components to handle version prefixes.

Versioning Support:

Navigation Components:

New Components:

Dependency Updates:

These changes collectively enhance the documentation site's ability to handle multiple versions and improve the user experience with better navigation and version switching capabilities.

@bdbch bdbch requested a review from Copilot March 24, 2025 16:58
Copy link

vercel bot commented Mar 24, 2025

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

Name Status Preview Comments Updated (UTC)
tiptap-docs ❌ Failed (Inspect) Mar 28, 2025 11:23am

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces versioning support for the documentation site, allowing users to switch between different versions (v1, v2, v3) with updated content imports and navigation components. Key changes include:

  • Adding version-specific content import logic and pages for v2 and v3.
  • Introducing a new VersionSwitch component for selecting documentation versions.
  • Updating navigation components (MobileNavigationDropdown and ProductDropdown) to handle version-specific path prefixes.

Reviewed Changes

Copilot reviewed 532 out of 533 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/VersionSwitch.tsx New component to toggle between different documentation versions.
src/app/v3/page.tsx Homepage implementation for version 3 with versioned MDX import and metadata.
src/components/VersionedLink.tsx New component for generating links that include the current version in the URL.
src/app/v3/[...markdownPath]/page.tsx MDX page routing for version 3 with sidebar resolution and schema injection.
src/components/MobileNavigationDropdown.tsx Updated navigation dropdown to accept a prefix prop for version-specific routes.
src/components/Extensions.tsx Extended functionality for fetching extensions with version and subpath support.
src/components/ProductDropdown.tsx Updated dropdown navigation with prefix handling for version-specific links.
src/components/layouts/Layout.tsx Modified header layout to incorporate the version switch and prefix-aware links.
src/app/(v2)/page.tsx and src/app/(v2)/[...markdownPath]/page.tsx Updated version 2 pages to support versioned MDX imports and sidebar configurations.
src/app/[...markdownPath]/sidebars.ts Removal of legacy sidebar configuration not used in the versioned implementation.
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/components/VersionedLink.tsx:17

  • The variable name 'finalHrf' appears to contain a typo; consider renaming it to 'finalHref' for better clarity and consistency.
const finalHrf = version && isInternal ? `/${version}${href}` : href

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@bdbch bdbch requested a review from Copilot March 27, 2025 12:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds versioning support to the documentation site, enabling multiple TipTap versions with dedicated routes and version‐specific content imports. The changes include:

  • Introducing version-specific paths for markdown and metadata generation (v2 and v3).
  • Adding new components (VersionSwitch and VersionedLink) to handle version navigation.
  • Updating navigation and layout components to incorporate version prefixes.

Reviewed Changes

Copilot reviewed 576 out of 578 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/components/ui/Section.tsx Updated link handling to use the Link component.
src/components/ui/PageEditStatus.tsx Adjusted pathname resolution to incorporate versioning logic.
src/components/layouts/Layout.tsx Modified LayoutHeader to accept a prefix and integrated VersionSwitch into the header.
src/components/VersionedLink.tsx Added a new component for generating versioned internal links.
src/components/VersionSwitch.tsx Created a new dropdown component to switch between documentation versions.
src/components/Search.tsx Updated search configuration to filter based on the current version.
src/components/ProductDropdown.tsx Modified navigation items to include a version prefix for internal links.
src/components/MobileNavigationDropdown.tsx Adjusted mobile navigation to handle version prefixes in links.
src/components/Extensions.tsx Extended the parameter set for fetching extensions to include version and subpath.
src/components/CodeDemo.tsx Updated the demo URL selection based on the current, internal version.
src/app/sitemap.ts Updated sitemap generation to account for version prefixes.
src/app/page.tsx, src/app/[...markdownPath]/page.tsx Removed legacy versionless pages.
src/app/3.x/* and src/app/(2.x)/* Added new version-specific pages and dynamic metadata generation.
Files not reviewed (2)
  • docsearch.config.json: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (2)

src/components/ProductDropdown.tsx:50

  • [nitpick] Ensure that the 'prefix' variable includes a trailing slash or adjust the concatenation logic so that URL constructions do not result in malformed paths when 'prefix' is non-empty.
<NavLink href={`${prefix}${option.href}`}>{option.label}</NavLink>

src/components/MobileNavigationDropdown.tsx:80

  • [nitpick] Ensure that the 'prefix' variable is correctly formatted (with necessary leading and/or trailing slashes) to avoid generating incorrect URLs for navigation links.
href={!option.target ? `${prefix}${option.href}` : option.href}

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