docs: prep for v2 documentation (#6710)
This PR includes documentation that preps for v2 docs (but doesn't introduce new docs). _Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._ ## Changes - Change Medusa version in base OAS used for v2. - Fix to docblock generator related to not catching all path parameters. - Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules. - Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used. - Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment. - Upgraded docusaurus to v3.0.1 - Added new Vale rules to ensure correct spelling of Medusa Admin and module names. - Added new components to the `docs-ui` package that will be used in future documentation changes.
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
export const colors = {
|
||||
dark: {
|
||||
"--code-text-subtle": "rgba(105, 110, 119, 1)",
|
||||
"--button-transparent-pressed": "rgba(46, 48, 53, 1)",
|
||||
"--border-base": "rgba(46, 48, 53, 1)",
|
||||
"--code-text-base": "rgba(237, 238, 240, 1)",
|
||||
"--tag-neutral-icon": "rgba(125, 130, 138, 1)",
|
||||
"--bg-switch-off-hover": "rgba(70, 75, 80, 1)",
|
||||
"--fg-on-color": "rgba(255, 255, 255, 1)",
|
||||
"--button-neutral-hover": "rgba(53, 55, 60, 1)",
|
||||
"--bg-switch-off": "rgba(53, 55, 60, 1)",
|
||||
"--border-strong": "rgba(53, 55, 60, 1)",
|
||||
"--fg-subtle": "rgba(173, 177, 184, 1)",
|
||||
@@ -20,12 +17,13 @@ export const colors = {
|
||||
"--bg-subtle-pressed": "rgba(39, 40, 45, 1)",
|
||||
"--tag-neutral-text": "rgba(173, 177, 184, 1)",
|
||||
"--fg-muted": "rgba(105, 110, 119, 1)",
|
||||
"--button-danger-pressed": "rgba(225, 29, 72, 1)",
|
||||
"--code-bg-header": "rgba(24, 24, 26, 1)",
|
||||
"--border-loud": "rgba(237, 238, 240, 1)",
|
||||
"--bg-base-pressed": "rgba(46, 48, 53, 1)",
|
||||
"--bg-disabled": "rgba(39, 40, 45, 1)",
|
||||
"--code-icon": "rgba(70, 75, 80, 1)",
|
||||
"--code-fg-subtle": "rgba(105, 110, 119, 1)",
|
||||
"--code-fg-base": "rgba(237, 238, 240, 1)",
|
||||
"--code-bg-subtle": "rgba(24, 24, 26, 1)",
|
||||
"--code-fg-muted": "rgba(70, 75, 80, 1)",
|
||||
"--bg-highlight-hover": "rgba(30, 58, 138, 1)",
|
||||
"--border-danger": "rgba(190, 18, 60, 1)",
|
||||
"--border-interactive": "rgba(96, 165, 250, 1)",
|
||||
@@ -40,7 +38,6 @@ export const colors = {
|
||||
"--fg-interactive": "rgba(96, 165, 250, 1)",
|
||||
"--bg-overlay": "rgba(24, 24, 26, 0.7)",
|
||||
"--fg-on-inverted": "rgba(24, 24, 26, 1)",
|
||||
"--button-neutral-pressed": "rgba(60, 63, 68, 1)",
|
||||
"--tag-red-border": "rgba(136, 19, 55, 1)",
|
||||
"--tag-red-bg": "rgba(76, 5, 25, 1)",
|
||||
"--button-transparent-hover": "rgba(39, 40, 45, 1)",
|
||||
@@ -67,13 +64,9 @@ export const colors = {
|
||||
"--tag-orange-bg": "rgba(69, 26, 3, 1)",
|
||||
"--tag-orange-bg-hover": "rgba(120, 53, 15, 1)",
|
||||
"--code-bg-base": "rgba(27, 27, 31, 1)",
|
||||
"--button-transparent": "rgba(255, 255, 255, 0)",
|
||||
"--button-neutral": "rgba(39, 40, 45, 1)",
|
||||
"--button-neutral-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-neutral-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-inverted-pressed": "rgba(237, 238, 240, 1)",
|
||||
"--button-inverted-hover": "rgba(255, 255, 255, 1)",
|
||||
"--button-danger-hover": "rgba(190, 18, 60, 1)",
|
||||
"--tag-neutral-bg-hover": "rgba(53, 55, 60, 1)",
|
||||
"--tag-blue-icon": "rgba(59, 130, 246, 1)",
|
||||
"--tag-red-icon": "rgba(244, 63, 94, 1)",
|
||||
@@ -86,18 +79,46 @@ export const colors = {
|
||||
"--bg-component": "rgba(39, 40, 45, 1)",
|
||||
"--bg-field": "rgba(39, 40, 45, 1)",
|
||||
"--bg-field-hover": "rgba(46, 48, 53, 1)",
|
||||
"--contrast-fg-primary": "rgba(28, 32, 36, 1)",
|
||||
"--contrast-bg-base": "rgba(228, 228, 233, 1)",
|
||||
"--contrast-fg-secondary": "rgba(96, 100, 108, 1)",
|
||||
"--contrast-border-base": "rgba(185, 187, 198, 1)",
|
||||
"--contrast-bg-base-pressed": "rgba(242, 242, 245, 1)",
|
||||
"--contrast-bg-subtle": "rgba(211, 212, 219, 1)",
|
||||
"--contrast-bg-base-hover": "rgba(235, 235, 239, 1)",
|
||||
"--contrast-bg-highlight": "rgba(242, 242, 245, 1)",
|
||||
"--button-neutral-pressed": "rgba(60, 63, 68, 1)",
|
||||
"--button-neutral-pressed-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-neutral-pressed-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-inverted-pressed": "rgba(237, 238, 240, 1)",
|
||||
"--button-inverted-pressed-gradient-from": "rgba(0, 0, 0, 0)",
|
||||
"--button-inverted-pressed-gradient-to": "rgba(24, 24, 26, 1)",
|
||||
"--button-neutral-hover": "rgba(53, 55, 60, 1)",
|
||||
"--button-neutral-hover-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-neutral-hover-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-inverted-hover": "rgba(255, 255, 255, 1)",
|
||||
"--button-inverted-hover-gradient-from": "rgba(24, 24, 26, 0)",
|
||||
"--button-inverted-hover-gradient-to": "rgba(24, 24, 26, 1)",
|
||||
"--button-danger-pressed": "rgba(225, 29, 72, 1)",
|
||||
"--button-danger-pressed-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-danger-pressed-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-danger-hover": "rgba(190, 18, 60, 1)",
|
||||
"--button-danger-hover-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-danger-hover-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-transparent": "rgba(0, 0, 0, 0.01)",
|
||||
},
|
||||
light: {
|
||||
"--button-inverted": "rgba(3, 7, 18, 1)",
|
||||
"--button-inverted-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-inverted-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-inverted-hover": "rgba(31, 41, 55, 1)",
|
||||
"--code-text-base": "rgba(249, 250, 251, 1)",
|
||||
"--code-fg-subtle": "rgba(156, 163, 175, 1)",
|
||||
"--code-fg-muted": "rgba(107, 114, 128, 1)",
|
||||
"--code-bg-subtle": "rgba(31, 41, 55, 1)",
|
||||
"--code-fg-base": "rgba(249, 250, 251, 1)",
|
||||
"--tag-green-bg": "rgba(209, 250, 229, 1)",
|
||||
"--border-strong": "rgba(209, 213, 219, 1)",
|
||||
"--border-interactive": "rgba(59, 130, 246, 1)",
|
||||
"--bg-highlight": "rgba(239, 246, 255, 1)",
|
||||
"--bg-base-hover": "rgba(249, 250, 251, 1)",
|
||||
"--tag-neutral-bg": "rgba(243, 244, 246, 1)",
|
||||
"--tag-red-bg": "rgba(255, 228, 230, 1)",
|
||||
"--tag-orange-bg": "rgba(254, 244, 199, 1)",
|
||||
@@ -116,8 +137,6 @@ export const colors = {
|
||||
"--border-loud": "rgba(3, 7, 18, 1)",
|
||||
"--fg-on-inverted": "rgba(255, 255, 255, 1)",
|
||||
"--fg-on-color": "rgba(255, 255, 255, 1)",
|
||||
"--button-transparent": "rgba(255, 255, 255, 0)",
|
||||
"--button-danger-pressed": "rgba(190, 18, 60, 1)",
|
||||
"--fg-interactive-hover": "rgba(37, 99, 235, 1)",
|
||||
"--fg-interactive": "rgba(59, 130, 246, 1)",
|
||||
"--fg-error": "rgba(225, 29, 72, 1)",
|
||||
@@ -128,7 +147,6 @@ export const colors = {
|
||||
"--bg-subtle-pressed": "rgba(229, 231, 235, 1)",
|
||||
"--fg-subtle": "rgba(75, 85, 99, 1)",
|
||||
"--fg-muted": "rgba(156, 163, 175, 1)",
|
||||
"--bg-base-pressed": "rgba(243, 244, 246, 1)",
|
||||
"--bg-subtle-hover": "rgba(243, 244, 246, 1)",
|
||||
"--tag-neutral-border": "rgba(229, 231, 235, 1)",
|
||||
"--tag-green-bg-hover": "rgba(167, 243, 208, 1)",
|
||||
@@ -148,23 +166,26 @@ export const colors = {
|
||||
"--tag-red-border": "rgba(254, 205, 211, 1)",
|
||||
"--tag-green-border": "rgba(167, 243, 208, 1)",
|
||||
"--tag-green-text": "rgba(4, 120, 87, 1)",
|
||||
"--button-transparent-hover": "rgba(249, 250, 251, 1)",
|
||||
"--button-transparent-pressed": "rgba(243, 244, 246, 1)",
|
||||
"--code-bg-base": "rgba(17, 24, 39, 1)",
|
||||
"--code-bg-header": "rgba(31, 41, 55, 1)",
|
||||
"--code-text-subtle": "rgba(156, 163, 175, 1)",
|
||||
"--code-border": "rgba(55, 65, 81, 1)",
|
||||
"--code-icon": "rgba(107, 114, 128, 1)",
|
||||
"--button-neutral-pressed": "rgba(243, 244, 246, 1)",
|
||||
"--button-inverted-pressed": "rgba(55, 65, 81, 1)",
|
||||
"--button-neutral": "rgba(255, 255, 255, 1)",
|
||||
"--button-neutral-gradient-from": "rgba(3, 7, 18, 0)",
|
||||
"--button-neutral-gradient-to": "rgba(3, 7, 18, 1)",
|
||||
"--button-danger": "rgba(225, 29, 72, 1)",
|
||||
"--button-danger-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-danger-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-neutral-hover": "rgba(249, 250, 251, 1)",
|
||||
"--button-danger-hover": "rgba(225, 29, 72, 1)",
|
||||
"--button-inverted-pressed": "rgba(31, 41, 55, 1)",
|
||||
"--button-inverted-pressed-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-inverted-pressed-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-danger-pressed": "rgba(159, 18, 57, 1)",
|
||||
"--button-danger-pressed-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-danger-pressed-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-inverted-hover": "rgba(17, 24, 39, 1)",
|
||||
"--button-inverted-hover-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-inverted-hover-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--button-danger-hover": "rgba(190, 18, 60, 1)",
|
||||
"--button-danger-hover-gradient-from": "rgba(255, 255, 255, 1)",
|
||||
"--button-danger-hover-gradient-to": "rgba(255, 255, 255, 0)",
|
||||
"--bg-component": "rgba(241, 243, 245, 1)",
|
||||
"--bg-overlay": "rgba(3, 7, 18, 0.4)",
|
||||
"--bg-switch-off": "rgba(229, 231, 235, 1)",
|
||||
@@ -174,5 +195,24 @@ export const colors = {
|
||||
"--bg-highlight-hover": "rgba(219, 234, 254, 1)",
|
||||
"--bg-switch-off-hover": "rgba(209, 213, 219, 1)",
|
||||
"--bg-disabled": "rgba(243, 244, 246, 1)",
|
||||
"--contrast-bg-subtle": "rgba(46, 48, 53, 1)",
|
||||
"--contrast-bg-base": "rgba(27, 27, 31, 1)",
|
||||
"--contrast-border-base": "rgba(60, 63, 68, 1)",
|
||||
"--contrast-fg-primary": "rgba(237, 238, 240, 1)",
|
||||
"--contrast-bg-base-pressed": "rgba(53, 55, 60, 1)",
|
||||
"--contrast-fg-secondary": "rgba(173, 177, 184, 1)",
|
||||
"--contrast-bg-highlight": "rgba(53, 55, 60, 1)",
|
||||
"--contrast-bg-base-hover": "rgba(46, 48, 53, 1)",
|
||||
"--button-transparent-hover": "rgba(243, 244, 246, 1)",
|
||||
"--button-neutral-pressed": "rgba(229, 231, 235, 1)",
|
||||
"--button-neutral-pressed-gradient-from": "rgba(3, 7, 18, 0)",
|
||||
"--button-neutral-pressed-gradient-to": "rgba(3, 7, 18, 1)",
|
||||
"--button-transparent-pressed": "rgba(229, 231, 235, 1)",
|
||||
"--button-neutral-hover": "rgba(243, 244, 246, 1)",
|
||||
"--button-neutral-hover-gradient-from": "rgba(3, 7, 18, 0)",
|
||||
"--button-neutral-hover-gradient-to": "rgba(3, 7, 18, 1)",
|
||||
"--bg-base-pressed": "rgba(243, 244, 246, 1)",
|
||||
"--bg-base-hover": "rgba(249, 250, 251, 1)",
|
||||
"--button-transparent": "rgba(255, 255, 255, 0.01)",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { ArrowUpRightOnBox } from "@medusajs/icons"
|
||||
import { NavbarLinkProps, SidebarSectionItemsType } from "docs-ui"
|
||||
import { NavbarLinkProps, getNavbarItems, mobileSidebarItems } from "docs-ui"
|
||||
import { SidebarSectionItemsType } from "types"
|
||||
import { siteConfig } from "./site"
|
||||
|
||||
type DocsConfig = {
|
||||
mainNav: NavbarLinkProps[]
|
||||
@@ -7,39 +9,10 @@ type DocsConfig = {
|
||||
}
|
||||
|
||||
export const docsConfig: DocsConfig = {
|
||||
mainNav: [
|
||||
{
|
||||
label: "Docs",
|
||||
target: "_blank",
|
||||
rel: "noreferrer",
|
||||
href: `${process.env.NEXT_PUBLIC_DOCS_URL}`,
|
||||
},
|
||||
{
|
||||
label: "User Guide",
|
||||
target: "_blank",
|
||||
rel: "noreferrer",
|
||||
href: `${process.env.NEXT_PUBLIC_DOCS_URL}/user-guide`,
|
||||
},
|
||||
{
|
||||
label: "Store API",
|
||||
target: "_blank",
|
||||
rel: "noreferrer",
|
||||
href: `${process.env.NEXT_PUBLIC_DOCS_URL}/api/store`,
|
||||
},
|
||||
{
|
||||
label: "Admin API",
|
||||
target: "_blank",
|
||||
rel: "noreferrer",
|
||||
href: `${process.env.NEXT_PUBLIC_DOCS_URL}/api/admin`,
|
||||
},
|
||||
{
|
||||
label: "UI",
|
||||
target: "_blank",
|
||||
rel: "noreferrer",
|
||||
href: `${process.env.NEXT_PUBLIC_DOCS_URL}/ui`,
|
||||
activeValuePattern: new RegExp("/ui"),
|
||||
},
|
||||
],
|
||||
mainNav: getNavbarItems({
|
||||
basePath: siteConfig.baseUrl,
|
||||
activePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui",
|
||||
}),
|
||||
sidebar: {
|
||||
top: [
|
||||
{
|
||||
@@ -311,32 +284,6 @@ export const docsConfig: DocsConfig = {
|
||||
],
|
||||
},
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
title: "Docs",
|
||||
path: `${process.env.NEXT_PUBLIC_DOCS_URL}`,
|
||||
isPathHref: true,
|
||||
},
|
||||
{
|
||||
title: "User Guide",
|
||||
path: `${process.env.NEXT_PUBLIC_DOCS_URL}/user-guide`,
|
||||
isPathHref: true,
|
||||
},
|
||||
{
|
||||
title: "Store API",
|
||||
path: `${process.env.NEXT_PUBLIC_DOCS_URL}/api/store`,
|
||||
isPathHref: true,
|
||||
},
|
||||
{
|
||||
title: "Admin API",
|
||||
path: `${process.env.NEXT_PUBLIC_DOCS_URL}/api/admin`,
|
||||
isPathHref: true,
|
||||
},
|
||||
{
|
||||
title: "UI",
|
||||
path: `${process.env.NEXT_PUBLIC_DOCS_URL}/ui`,
|
||||
isPathHref: true,
|
||||
},
|
||||
],
|
||||
mobile: mobileSidebarItems,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
import { DocsConfig } from "types"
|
||||
|
||||
type SiteConfig = {
|
||||
name: string
|
||||
url: string
|
||||
description: string
|
||||
}
|
||||
} & DocsConfig
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_DOCS_URL || "http://localhost:3000"
|
||||
|
||||
export const siteConfig: SiteConfig = {
|
||||
name: "Medusa UI",
|
||||
url: `${process.env.NEXT_PUBLIC_DOCS_URL}/ui`,
|
||||
baseUrl,
|
||||
url: `${baseUrl}/${process.env.NEXT_PUBLIC_BASE_PATH}`,
|
||||
description: "Primitives for building Medusa applications.",
|
||||
// sidebar is defined in docs.tsx
|
||||
sidebar: {
|
||||
top: [],
|
||||
bottom: [],
|
||||
mobile: [],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user