diff --git a/www/apps/api-reference/.env.sample b/www/apps/api-reference/.env.sample index bfa84af2aa..e038601614 100644 --- a/www/apps/api-reference/.env.sample +++ b/www/apps/api-reference/.env.sample @@ -4,7 +4,7 @@ NEXT_PUBLIC_DOCS_ALGOLIA_INDEX_NAME= NEXT_PUBLIC_API_ALGOLIA_INDEX_NAME= NEXT_PUBLIC_ALGOLIA_API_KEY= NEXT_PUBLIC_ALGOLIA_APP_ID= -NEXT_PUBLIC_ENV= +NEXT_PUBLIC_ENV=development # change to production when running npm start NEXT_PUBLIC_BASE_URL= NEXT_PUBLIC_DOCS_URL= NEXT_PUBLIC_UI_URL= diff --git a/www/apps/api-reference/app/_mdx/admin.mdx b/www/apps/api-reference/app/_mdx/admin.mdx index 5c89f431e1..00df884dc7 100644 --- a/www/apps/api-reference/app/_mdx/admin.mdx +++ b/www/apps/api-reference/app/_mdx/admin.mdx @@ -838,7 +838,7 @@ If you click on the workflow, you'll view a reference of that workflow, includin This is useful if you want to extend an API route and pass additional data or perform custom actions. -Refer to [this guide](https://docs.medusajs.com/v2/customization/extend-models/extend-create-product) to find an example of extending an API route. +Refer to [this guide](https://docs.medusajs.com/customization/extend-models/extend-create-product) to find an example of extending an API route. Just Getting Started? -Check out the [Medusa v2 Documentation](https://docs.medusajs.com/v2). +Check out the [Medusa v2 Documentation](https://docs.medusajs.com). @@ -16,7 +16,7 @@ To use Medusa's JS SDK library, install the following packages in your project ( npm install @medusajs/js-sdk@latest @medusajs/types@latest ``` -Learn more about the JS SDK in [this documentation](https://docs.medusajs.com/v2/resources/js-sdk). +Learn more about the JS SDK in [this documentation](https://docs.medusajs.com/resources/js-sdk). ### Download Full Reference diff --git a/www/apps/api-reference/app/_mdx/store.mdx b/www/apps/api-reference/app/_mdx/store.mdx index efd6b75f80..6c44473c5d 100644 --- a/www/apps/api-reference/app/_mdx/store.mdx +++ b/www/apps/api-reference/app/_mdx/store.mdx @@ -270,7 +270,7 @@ and associate placed orders with the specified sales channel. {/* TODO add v2 links */} -Create a publishable API key either using the [admin REST APIs](https://docs.medusajs.com/v2/api/admin#api-keys_postapikeys), or using the Medusa Admin. +Create a publishable API key either using the [admin REST APIs](https://docs.medusajs.com/api/admin#api-keys_postapikeys), or using the Medusa Admin. ### How to Use a Publishable API Key @@ -839,7 +839,7 @@ If you click on the workflow, you'll view a reference of that workflow, includin This is useful if you want to extend an API route and pass additional data or perform custom actions. -Refer to [this guide](https://docs.medusajs.com/v2/customization/extend-models/extend-create-product) to find an example of extending an API route. +Refer to [this guide](https://docs.medusajs.com/customization/extend-models/extend-create-product) to find an example of extending an API route. { return ( diff --git a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/WorkflowBadge/index.tsx b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/WorkflowBadge/index.tsx index b2f3544976..6ff4d10767 100644 --- a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/WorkflowBadge/index.tsx +++ b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/WorkflowBadge/index.tsx @@ -13,7 +13,7 @@ const TagsOperationDescriptionSectionWorkflowBadge = ({

Workflow{" "} { }>( loadData && tag["x-associatedSchema"] ? basePathUrl( - `/api/schema?name=${tag["x-associatedSchema"].$ref}&area=${area}` + `/schema?name=${tag["x-associatedSchema"].$ref}&area=${area}` ) : null, swrFetcher, @@ -81,9 +81,7 @@ const TagSectionComponent = ({ tag }: TagSectionProps) => { const { data: pathsData } = useSWR<{ paths: PathsObject }>( - loadData - ? basePathUrl(`/api/tag?tagName=${slugTagName}&area=${area}`) - : null, + loadData ? basePathUrl(`/tag?tagName=${slugTagName}&area=${area}`) : null, swrFetcher, { errorRetryInterval: 2000, diff --git a/www/apps/api-reference/lib/index.ts b/www/apps/api-reference/lib/index.ts index 2584c817c5..b8dc4aa565 100644 --- a/www/apps/api-reference/lib/index.ts +++ b/www/apps/api-reference/lib/index.ts @@ -6,7 +6,7 @@ const URL = `${process.env.NEXT_PUBLIC_BASE_URL}${process.env.NEXT_PUBLIC_BASE_P export async function getBaseSpecs(area: Area) { try { - const res = await fetch(`${URL}/api/base-specs?area=${area}`, { + const res = await fetch(`${URL}/base-specs?area=${area}`, { next: { revalidate: 3000, tags: [area], diff --git a/www/apps/api-reference/next.config.mjs b/www/apps/api-reference/next.config.mjs index 89b345aaa7..21f1820858 100644 --- a/www/apps/api-reference/next.config.mjs +++ b/www/apps/api-reference/next.config.mjs @@ -5,13 +5,22 @@ import rehypeSlug from "rehype-slug" /** @type {import('next').NextConfig} */ const nextConfig = { - basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/api", + basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/api", webpack: (config) => { config.ignoreWarnings = [{ module: /node_modules\/keyv\/src\/index\.js/ }] return config }, transpilePackages: ["docs-ui"], + async redirects() { + return [ + { + source: "/api/download/:path", + destination: "/download/:path", + permanent: true, + }, + ] + }, } const withMDX = mdx({ diff --git a/www/apps/api-reference/vercel.json b/www/apps/api-reference/vercel.json index b0923b0acd..f1a53d3670 100644 --- a/www/apps/api-reference/vercel.json +++ b/www/apps/api-reference/vercel.json @@ -1,6 +1,6 @@ { "crons": [{ - "path": "/v2/api/api/algolia", + "path": "/api/algolia", "schedule": "0 0 * * 4" }], "framework": "nextjs", diff --git a/www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx index aa747de235..bc16f332e1 100644 --- a/www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx +++ b/www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx @@ -201,4 +201,4 @@ export default MyCustom ## Properties Reference -Refer to the [Data Model API reference](https://docs.medusajs.com/v2/resources/references/data-model) for a full reference of the properties. \ No newline at end of file +Refer to the [Data Model API reference](!resources!/references/data-model) for a full reference of the properties. \ No newline at end of file diff --git a/www/apps/book/app/learn/customization/extend-models/extend-create-product/page.mdx b/www/apps/book/app/learn/customization/extend-models/extend-create-product/page.mdx index 98b30092b8..962e8fdbc2 100644 --- a/www/apps/book/app/learn/customization/extend-models/extend-create-product/page.mdx +++ b/www/apps/book/app/learn/customization/extend-models/extend-create-product/page.mdx @@ -14,7 +14,7 @@ This chapter covers how to extend the Create Product API route to link a product ## Additional Data in API Routes -Some API routes, including the [Create Product API route](https://docs.medusajs.com/v2/api/admin#products_postproducts), accept an `additional_data` request body parameter. +Some API routes, including the [Create Product API route](!api!/admin#products_postproducts), accept an `additional_data` request body parameter. It's useful when you want to pass custom data, such as the brand ID, then perform an action based on this data, such as link the brand to the product. diff --git a/www/apps/book/app/learn/storefront-development/nextjs-starter/page.mdx b/www/apps/book/app/learn/storefront-development/nextjs-starter/page.mdx index b760985f5d..f0518e0060 100644 --- a/www/apps/book/app/learn/storefront-development/nextjs-starter/page.mdx +++ b/www/apps/book/app/learn/storefront-development/nextjs-starter/page.mdx @@ -20,10 +20,10 @@ In this chapter, you’ll learn how to install and use the Next.js Starter store }, ]} /> -1. Clone the `v2` branch of the [Next.js Starter](https://github.com/medusajs/nextjs-starter-medusa/tree/v2): +1. Clone the `v2` branch of the [Next.js Starter](https://github.com/medusajs/nextjs-starter-medusa): ```bash -git clone https://github.com/medusajs/nextjs-starter-medusa -b v2 my-medusa-storefront +git clone https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront ``` 2. Change to the `my-medusa-storefront` directory, install the dependencies, and rename the template environment variable: diff --git a/www/apps/book/app/opengraph-image.jpg b/www/apps/book/app/opengraph-image.jpg index 8e6f6515dd..58886be285 100644 Binary files a/www/apps/book/app/opengraph-image.jpg and b/www/apps/book/app/opengraph-image.jpg differ diff --git a/www/apps/book/app/twitter-image.jpg b/www/apps/book/app/twitter-image.jpg index 8e6f6515dd..58886be285 100644 Binary files a/www/apps/book/app/twitter-image.jpg and b/www/apps/book/app/twitter-image.jpg differ diff --git a/www/apps/book/components/Homepage/LinksSection/index.tsx b/www/apps/book/components/Homepage/LinksSection/index.tsx index ac3672c6f7..6de53458f8 100644 --- a/www/apps/book/components/Homepage/LinksSection/index.tsx +++ b/www/apps/book/components/Homepage/LinksSection/index.tsx @@ -15,7 +15,7 @@ const HomepageLinksSection = () => { text: "Build a Module", }, { - href: "https://docs.medusajs.com/v2/resources/integrations", + href: "https://docs.medusajs.com/resources/integrations", text: "Browse third-party integrations", }, ], @@ -41,11 +41,11 @@ const HomepageLinksSection = () => { title: "Storefront Development", links: [ { - href: "https://docs.medusajs.com/v2/resources/nextjs-starter", + href: "https://docs.medusajs.com/resources/nextjs-starter", text: "Explore our storefront starter", }, { - href: "https://docs.medusajs.com/v2/resources/storefront-development", + href: "https://docs.medusajs.com/resources/storefront-development", text: "Build a custom storefront", }, { diff --git a/www/apps/book/components/Homepage/RecipesSection/index.tsx b/www/apps/book/components/Homepage/RecipesSection/index.tsx index a9d834576d..67be258bfc 100644 --- a/www/apps/book/components/Homepage/RecipesSection/index.tsx +++ b/www/apps/book/components/Homepage/RecipesSection/index.tsx @@ -17,28 +17,28 @@ const HomepageRecipesSection = () => { type: "large", title: "Marketplace", text: "Build a marketplace with multiple vendors", - href: "https://docs.medusajs.com/v2/resources/recipes/marketplace/examples/vendors", + href: "https://docs.medusajs.com/resources/recipes/marketplace/examples/vendors", icon: ShopIcon, }, { type: "large", title: "Subscriptions", text: "Implement a subscription-based commerce store.", - href: "https://docs.medusajs.com/v2/resources/recipes/subscriptions/examples/standard", + href: "https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard", icon: CalendarRefreshIcon, }, { type: "large", title: "Restaurant-Delivery", text: "Build a restaurant marketplace inspired by UberEats, with real-time delivery handling", - href: "https://docs.medusajs.com/v2/resources/recipes/marketplace/examples/restaurant-delivery", + href: "https://docs.medusajs.com/resources/recipes/marketplace/examples/restaurant-delivery", icon: ChefHatIcon, }, { type: "large", title: "Digital Products", text: "Sell digital products with custom fulfillment.", - href: "https://docs.medusajs.com/v2/resources/recipes/digital-products/examples/standard", + href: "https://docs.medusajs.com/resources/recipes/digital-products/examples/standard", icon: ImageBinaryIcon, }, ] @@ -63,7 +63,7 @@ const HomepageRecipesSection = () => { diff --git a/www/apps/book/next.config.mjs b/www/apps/book/next.config.mjs index ec25b25b9f..b4f752655c 100644 --- a/www/apps/book/next.config.mjs +++ b/www/apps/book/next.config.mjs @@ -21,11 +21,11 @@ const withMDX = mdx({ projectUrls: { resources: { url: process.env.NEXT_PUBLIC_RESOURCES_URL, - path: "v2/resources", + path: "resources", }, "user-guide": { url: process.env.NEXT_PUBLIC_RESOURCES_URL, - path: "v2/user-guide", + path: "user-guide", }, ui: { url: process.env.NEXT_PUBLIC_RESOURCES_URL, @@ -33,7 +33,7 @@ const withMDX = mdx({ }, api: { url: process.env.NEXT_PUBLIC_RESOURCES_URL, - path: "v2/api", + path: "api", }, }, useBaseUrl: @@ -81,29 +81,49 @@ const nextConfig = { pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], transpilePackages: ["docs-ui"], - basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2", async rewrites() { return { fallback: [ { - source: "/v2/resources", + source: "/resources", destination: `${ process.env.NEXT_PUBLIC_RESOURCES_URL || "https://localhost:3001" - }/v2/resources`, + }/resources`, basePath: false, }, { - source: "/v2/resources/:path*", + source: "/resources/:path*", destination: `${ process.env.NEXT_PUBLIC_RESOURCES_URL || "https://localhost:3001" - }/v2/resources/:path*`, + }/resources/:path*`, basePath: false, }, { - source: "/v2/api/:path*", + source: "/api", destination: `${ process.env.NEXT_PUBLIC_API_URL || "https://localhost:3001" - }/v2/api/:path*`, + }/api`, + basePath: false, + }, + { + source: "/api/:path*", + destination: `${ + process.env.NEXT_PUBLIC_API_URL || "https://localhost:3001" + }/api/:path*`, + basePath: false, + }, + { + source: "/v1", + destination: `${ + process.env.NEXT_PUBLIC_DOCS_V1_URL || "https://localhost:3001" + }/v1`, + basePath: false, + }, + { + source: "/v1/:path*", + destination: `${ + process.env.NEXT_PUBLIC_DOCS_V1_URL || "https://localhost:3001" + }/v1/:path*`, basePath: false, }, // TODO comment out once we have the user guide published @@ -123,48 +143,8 @@ const nextConfig = { async redirects() { return [ { - source: "/advanced-development/:path*", - destination: "/learn/advanced-development/:path*", - permanent: true, - }, - { - source: "/basics/:path*", - destination: "/learn/basics/:path*", - permanent: true, - }, - { - source: "/customization/:path*", - destination: "/learn/customization/:path*", - permanent: true, - }, - { - source: "/debugging-and-testing/:path*", - destination: "/learn/debugging-and-testing/:path*", - permanent: true, - }, - { - source: "/deployment/:path*", - destination: "/learn/deployment/:path*", - permanent: true, - }, - { - source: "/first-customizations/:path*", - destination: "/learn/first-customizations/:path*", - permanent: true, - }, - { - source: "/more-resources/:path*", - destination: "/learn/more-resources/:path*", - permanent: true, - }, - { - source: "/storefront-development/:path*", - destination: "/learn/storefront-development/:path*", - permanent: true, - }, - { - source: "/more-resources/examples", - destination: "/resources/examples", + source: "/v2/:path*", + destination: "/:path*", permanent: true, }, ] diff --git a/www/apps/book/providers/search.tsx b/www/apps/book/providers/search.tsx index 723a1ae09e..96bf7e9bd9 100644 --- a/www/apps/book/providers/search.tsx +++ b/www/apps/book/providers/search.tsx @@ -48,7 +48,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => { }, ], checkInternalPattern: new RegExp( - `^${config.baseUrl}/v2/([^(resources)])*` + `^${config.baseUrl}/([^(resources)])*` ), filterOptions: searchFilters, }} diff --git a/www/apps/book/tailwind.config.js b/www/apps/book/tailwind.config.js index 488af7843f..52cd27e4d9 100644 --- a/www/apps/book/tailwind.config.js +++ b/www/apps/book/tailwind.config.js @@ -32,8 +32,8 @@ module.exports = { "search-no-result-dark": "url('/images/search-no-result.svg')", "magnifying-glass": "url('/images/magnifying-glass.svg')", "magnifying-glass-dark": "url('/images/magnifying-glass-dark.svg')", - "bg-stripes": "url('/v2/images/bg-stripes.png')", - "bg-stripes-dark": "url('/v2/images/bg-stripes-dark.png')", + "bg-stripes": "url('/images/bg-stripes.png')", + "bg-stripes-dark": "url('/images/bg-stripes-dark.png')", }, }, } diff --git a/www/apps/resources/app/examples/page.mdx b/www/apps/resources/app/examples/page.mdx index eda0a89feb..4ccda8d90c 100644 --- a/www/apps/resources/app/examples/page.mdx +++ b/www/apps/resources/app/examples/page.mdx @@ -2388,7 +2388,7 @@ export const myWorkflow = createWorkflow( ) ``` -Learn more in [this documentation](https://docs.medusajs.com/v2/advanced-development/workflows/add-workflow-hook). +Learn more in [this documentation](!book!/learn/advanced-development/workflows/add-workflow-hook). ### Retry Steps diff --git a/www/apps/resources/app/opengraph-image.jpg b/www/apps/resources/app/opengraph-image.jpg index 89c90792ca..58886be285 100644 Binary files a/www/apps/resources/app/opengraph-image.jpg and b/www/apps/resources/app/opengraph-image.jpg differ diff --git a/www/apps/resources/app/twitter-image.jpg b/www/apps/resources/app/twitter-image.jpg index 89c90792ca..58886be285 100644 Binary files a/www/apps/resources/app/twitter-image.jpg and b/www/apps/resources/app/twitter-image.jpg differ diff --git a/www/apps/resources/next.config.mjs b/www/apps/resources/next.config.mjs index 279c857702..bea39d3cbe 100644 --- a/www/apps/resources/next.config.mjs +++ b/www/apps/resources/next.config.mjs @@ -41,7 +41,7 @@ const nextConfig = { transpilePackages: ["docs-ui"], - basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/resources", + basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/resources", async redirects() { return [ { diff --git a/www/apps/resources/providers/search.tsx b/www/apps/resources/providers/search.tsx index b092132610..9c51fa917b 100644 --- a/www/apps/resources/providers/search.tsx +++ b/www/apps/resources/providers/search.tsx @@ -38,7 +38,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => { ], }, ], - checkInternalPattern: new RegExp(`^${config.baseUrl}/v2/resources/.*`), + checkInternalPattern: new RegExp(`^${config.baseUrl}/resources/.*`), filterOptions: searchFilters, }} commands={[ diff --git a/www/apps/ui/src/app/opengraph-image.jpg b/www/apps/ui/src/app/opengraph-image.jpg index 938d262904..58886be285 100644 Binary files a/www/apps/ui/src/app/opengraph-image.jpg and b/www/apps/ui/src/app/opengraph-image.jpg differ diff --git a/www/apps/ui/src/app/twitter-image.jpg b/www/apps/ui/src/app/twitter-image.jpg index 938d262904..58886be285 100644 Binary files a/www/apps/ui/src/app/twitter-image.jpg and b/www/apps/ui/src/app/twitter-image.jpg differ diff --git a/www/apps/user-guide/app/opengraph-image.jpg b/www/apps/user-guide/app/opengraph-image.jpg new file mode 100644 index 0000000000..58886be285 Binary files /dev/null and b/www/apps/user-guide/app/opengraph-image.jpg differ diff --git a/www/apps/user-guide/app/twitter-image.jpg b/www/apps/user-guide/app/twitter-image.jpg new file mode 100644 index 0000000000..58886be285 Binary files /dev/null and b/www/apps/user-guide/app/twitter-image.jpg differ diff --git a/www/apps/user-guide/next.config.mjs b/www/apps/user-guide/next.config.mjs index 3581c5a111..40184cd6d4 100644 --- a/www/apps/user-guide/next.config.mjs +++ b/www/apps/user-guide/next.config.mjs @@ -34,7 +34,7 @@ const withMDX = mdx({ }, api: { url: process.env.NEXT_PUBLIC_API_URL, - path: "v2/api", + path: "api", }, }, useBaseUrl: @@ -82,7 +82,7 @@ const nextConfig = { transpilePackages: ["docs-ui"], // TODO uncomment if we decide on baes path - basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/user-guide", + basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide", } export default withMDX(nextConfig) diff --git a/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx b/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx index 98f664ac14..baca99ef5e 100644 --- a/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx @@ -38,12 +38,12 @@ export const MainNavDesktopMenu = () => { title: "Homepage", link: "https://medusajs.com", }, - // { - // type: "link", - // icon: , - // title: "Medusa v1", - // link: "https://docs.medusajs.com", - // }, + { + type: "link", + icon: , + title: "Medusa v1", + link: "https://docs.medusajs.com/v1", + }, { type: "link", icon: , @@ -54,7 +54,7 @@ export const MainNavDesktopMenu = () => { type: "link", icon: , title: "Troubleshooting", - link: "https://docs.medusajs.com/v2/resources/troubleshooting", + link: "https://docs.medusajs.com/resources/troubleshooting", }, ] diff --git a/www/packages/docs-ui/src/components/MainNav/index.tsx b/www/packages/docs-ui/src/components/MainNav/index.tsx index 370238d61c..89b57be920 100644 --- a/www/packages/docs-ui/src/components/MainNav/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/index.tsx @@ -50,7 +50,7 @@ export const MainNav = ({ className, itemsClassName }: MainNavProps) => { )} - +