diff --git a/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md b/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md new file mode 100644 index 0000000000..ffe9ddc266 --- /dev/null +++ b/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md @@ -0,0 +1,57 @@ +--- +description: 'Actions Required for Vite Update' +--- + +# Updating Medusa Admin from Gatsby to Vite + +Medusa Admin has been updated to Vite. Learn about breaking changes since the update. + +## Overview + +Medusa Admin previously was built using Gatsby. As of a recent update, the Admin is now migrated to Vite 3. + +This introduced breaking changes related to environment variables used and the published directory. Read below for actions required following this update. + +## Required Node.js Version + + + +Following the change to Vite 3, the required Node.js version for the Admin has changed. [Vite 3](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) requires versions 14.8+ or 16+ of Node.js. + + + +## Changed Environment Variables + +Previously, the Medusa Admin used the environment variables `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` to store the Medusa server’s URL. + +After the update to Vite, the environment variable name changed to `MEDUSA_BACKEND_URL`. + +The Medusa admin remains backward compatible, which means you can still use the same environment variables. However, it is advised to make the change to the new variable. + +### Actions Required + +Change your `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` environment variables to be `MEDUSA_BACKEND_URL`: + +```bash +MEDUSA_BACKEND_URL= +``` + +## Changed Publish Directory + +Previously, the build output of the Medusa Admin was placed in the `dist` directory. After this update, the build output is placed in the `public` directory. + +For local usage and development, this shouldn’t have an effect. However, this is a breaking change if you deployed Medusa admin. + +### Actions Required + +If you deployed your Medusa admin, you must change the Publish directory in your hosting. + +For Netlify, you can do that by following these steps: + +1. On your Medusa admin dashboard, click on “Site settings”. +2. From the sidebar, choose “Build & deploy”. +3. Find the “Build settings” section and click on the “Edit settings” button. +4. Change the “Publish directory” field to `public`. +5. Click on the Save button. + +This should trigger a new deployment of your Medusa admin. If not, you must redeploy it manually for changes to take effect. diff --git a/docs/content/advanced/backend/upgrade-guides/index.mdx b/docs/content/advanced/backend/upgrade-guides/index.mdx index 7c2c8cb261..338ef22178 100644 --- a/docs/content/advanced/backend/upgrade-guides/index.mdx +++ b/docs/content/advanced/backend/upgrade-guides/index.mdx @@ -1,8 +1,19 @@ +--- +hide_table_of_contents: true +--- + import DocCardList from '@theme/DocCardList'; import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; +import filterListItems from '@site/src/utils/filterListItems'; # Upgrade Guides Find in this page the upgrade guides that require necessary steps when upgrading to a new version. - \ No newline at end of file +## Server + + + +## Admin + + \ No newline at end of file diff --git a/docs/styles/Vocab/Base/accept.txt b/docs/styles/Vocab/Base/accept.txt index 1bd5903cc0..66e53f879b 100644 --- a/docs/styles/Vocab/Base/accept.txt +++ b/docs/styles/Vocab/Base/accept.txt @@ -1,4 +1,5 @@ (?i)Medusa (?i)Qovery (?i)Netlify -(?i)s3 \ No newline at end of file +(?i)s3 +(?i)vite \ No newline at end of file diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 317114cc31..25571dfd65 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -199,6 +199,11 @@ module.exports = { id: "advanced/backend/upgrade-guides/1-7-0", label: "v1.7.0" }, + { + type: "doc", + id: "advanced/backend/upgrade-guides/admin/admin-vite", + label: "Medusa Admin: Vite" + }, ] }, { diff --git a/www/docs/src/utils/filterListItems.ts b/www/docs/src/utils/filterListItems.ts new file mode 100644 index 0000000000..21c1e74e4f --- /dev/null +++ b/www/docs/src/utils/filterListItems.ts @@ -0,0 +1,9 @@ +export default function filterListItems (items: any[], pathPattern: string | RegExp) { + if (!items.length) { + return items + } + + let pattern = new RegExp(pathPattern) + + return items.filter((item) => pattern.test(item.href)) +} \ No newline at end of file