diff --git a/.github/workflows/docs-update-version.yml b/.github/workflows/docs-update-version.yml
new file mode 100644
index 0000000000..ea300fb24c
--- /dev/null
+++ b/.github/workflows/docs-update-version.yml
@@ -0,0 +1,54 @@
+name: Update Version in Docs
+on:
+ release:
+ types: [published]
+
+jobs:
+ update-docs-version:
+ runs-on: ubuntu-latest
+ env:
+ GH_TOKEN: ${{ secrets.REFERENCE_PAT }}
+ steps:
+ - name: Cancel Previous Runs
+ uses: styfle/cancel-workflow-action@0.11.0
+ with:
+ access_token: ${{ github.token }}
+
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Setup Node.js environment
+ uses: actions/setup-node@v3
+ with:
+ node-version: 20
+ cache: "yarn"
+
+ - name: Install dependencies
+ uses: ./.github/actions/cache-deps
+ with:
+ extension: docs-update-version
+
+ - name: Install Workspace dependencies
+ run: yarn install
+ working-directory: www/utils
+
+ - name: Build Workspace packages
+ run: yarn build
+ working-directory: www/utils
+
+ - name: Update Docs Version
+ run: yarn update:config-version
+ working-directory: www/utils/packages/scripts
+
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v4
+ with:
+ commit-message: "chore(docs): Update version in documentation (automated)"
+ base: "develop"
+ title: "chore(docs): Update version in documentation (automated)"
+ labels: "type: chore"
+ add-paths: www/packages/docs-ui/src/global-config.ts
+ branch: "docs/update-config-version"
+ branch-suffix: "timestamp"
\ No newline at end of file
diff --git a/www/apps/api-reference/config/index.ts b/www/apps/api-reference/config/index.ts
index b4a875caf6..917be855b6 100644
--- a/www/apps/api-reference/config/index.ts
+++ b/www/apps/api-reference/config/index.ts
@@ -1,8 +1,10 @@
+import { globalConfig } from "docs-ui"
import { DocsConfig } from "types"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
+ ...globalConfig,
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
// sidebar is auto generated
diff --git a/www/apps/book/config/index.ts b/www/apps/book/config/index.ts
index 43c73a685a..1807b17682 100644
--- a/www/apps/book/config/index.ts
+++ b/www/apps/book/config/index.ts
@@ -1,9 +1,11 @@
import { DocsConfig } from "types"
import { sidebarConfig } from "./sidebar"
+import { globalConfig } from "docs-ui"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
+ ...globalConfig,
titleSuffix: "Medusa v2 Documentation",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
diff --git a/www/apps/resources/config/index.ts b/www/apps/resources/config/index.ts
index caf5a1006f..0b160b1e27 100644
--- a/www/apps/resources/config/index.ts
+++ b/www/apps/resources/config/index.ts
@@ -1,9 +1,11 @@
import { DocsConfig, SidebarItem } from "types"
import { generatedSidebar } from "../generated/sidebar.mjs"
+import { globalConfig } from "docs-ui"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
+ ...globalConfig,
titleSuffix: "Medusa Development Resources",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
diff --git a/www/apps/ui/src/config/site.ts b/www/apps/ui/src/config/site.ts
index 081ecc616b..763386324a 100644
--- a/www/apps/ui/src/config/site.ts
+++ b/www/apps/ui/src/config/site.ts
@@ -1,3 +1,4 @@
+import { globalConfig } from "docs-ui"
import { DocsConfig } from "types"
type SiteConfig = {
@@ -9,6 +10,7 @@ type SiteConfig = {
const baseUrl = process.env.NEXT_PUBLIC_DOCS_URL || "http://localhost:3000"
export const siteConfig: SiteConfig = {
+ ...globalConfig,
name: "Medusa UI",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
diff --git a/www/apps/user-guide/config/index.ts b/www/apps/user-guide/config/index.ts
index 5113d4f24b..7d39f26c91 100644
--- a/www/apps/user-guide/config/index.ts
+++ b/www/apps/user-guide/config/index.ts
@@ -1,9 +1,11 @@
import { DocsConfig, SidebarItem } from "types"
import { generatedSidebar as sidebar } from "@/generated/sidebar.mjs"
+import { globalConfig } from "docs-ui"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
+ ...globalConfig,
titleSuffix: "Medusa Admin User Guide",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
diff --git a/www/packages/docs-ui/src/components/MainNav/Version/index.tsx b/www/packages/docs-ui/src/components/MainNav/Version/index.tsx
new file mode 100644
index 0000000000..f9e4380aa1
--- /dev/null
+++ b/www/packages/docs-ui/src/components/MainNav/Version/index.tsx
@@ -0,0 +1,65 @@
+"use state"
+
+import React, { useEffect, useMemo, useState } from "react"
+import { useIsBrowser, useSiteConfig } from "../../../providers"
+import Link from "next/link"
+import { Tooltip } from "../../Tooltip"
+import clsx from "clsx"
+
+const LOCAL_STORAGE_SUFFIX = "-seen"
+
+export const MainNavVersion = () => {
+ const {
+ config: { version },
+ } = useSiteConfig()
+ const [showNewBadge, setShowNewBadge] = useState(false)
+ const { isBrowser } = useIsBrowser()
+ const localStorageKey = useMemo(
+ () => `${version.number}${LOCAL_STORAGE_SUFFIX}`,
+ [version]
+ )
+
+ useEffect(() => {
+ if (!isBrowser) {
+ return
+ }
+
+ if (!localStorage.getItem(localStorageKey)) {
+ setShowNewBadge(true)
+ }
+ }, [isBrowser, localStorageKey])
+
+ const afterHover = () => {
+ if (!showNewBadge) {
+ return
+ }
+
+ setShowNewBadge(false)
+ localStorage.setItem(localStorageKey, "true")
+ }
+
+ return (
+ <>
+
+