-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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
There was a problem hiding this 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.
There was a problem hiding this 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}
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:
src/app/(v2)/[...markdownPath]/page.tsx
: Renamed fromsrc/app/[...markdownPath]/page.tsx
and updated to usegetImportPathForVersion
andimportMdxFromPath
for version-specific content imports. (src/app/(v2)/[...markdownPath]/page.tsxL2-R9, src/app/(v2)/[...markdownPath]/page.tsxL24-R33, src/app/(v2)/[...markdownPath]/page.tsxL59-R56, src/app/(v2)/[...markdownPath]/page.tsxL68-R78)src/app/(v2)/page.tsx
: Renamed fromsrc/app/page.tsx
and updated to useimportMdxFromPath
for version-specific content imports. [1] [2]src/app/v3/[...markdownPath]/page.tsx
: Added new file for version 3 with similar updates for version-specific content imports. (src/app/v3/[...markdownPath]/page.tsxR1-R133)src/app/v3/page.tsx
: Added new file for the homepage of version 3 with version-specific content imports.Navigation Components:
src/components/MobileNavigationDropdown.tsx
: Modified to accept aprefix
prop for handling version-specific paths in the navigation. [1] [2] [3] [4]src/components/ProductDropdown.tsx
: Modified to accept aprefix
prop for handling version-specific paths in the navigation. [1] [2] [3] [4]New Components:
src/components/VersionSwitch.tsx
: Added a new component to switch between different documentation versions.Dependency Updates:
package.json
: Updated the@types/node
dependency version.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.