docs: create docs workspace (#5174)
* docs: migrate ui docs to docs universe * created yarn workspace * added eslint and tsconfig configurations * fix eslint configurations * fixed eslint configurations * shared tailwind configurations * added shared ui package * added more shared components * migrating more components * made details components shared * move InlineCode component * moved InputText * moved Loading component * Moved Modal component * moved Select components * Moved Tooltip component * moved Search components * moved ColorMode provider * Moved Notification components and providers * used icons package * use UI colors in api-reference * moved Navbar component * used Navbar and Search in UI docs * added Feedback to UI docs * general enhancements * fix color mode * added copy colors file from ui-preset * added features and enhancements to UI docs * move Sidebar component and provider * general fixes and preparations for deployment * update docusaurus version * adjusted versions * fix output directory * remove rootDirectory property * fix yarn.lock * moved code component * added vale for all docs MD and MDX * fix tests * fix vale error * fix deployment errors * change ignore commands * add output directory * fix docs test * general fixes * content fixes * fix announcement script * added changeset * fix vale checks * added nofilter option * fix vale error
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
---
|
||||
description: 'Actions Required for Vite Update'
|
||||
sidebar_label: '(Repository) Vite'
|
||||
slug: /upgrade-guides/admin/admin-vite
|
||||
sidebar_custom_props:
|
||||
iconName: 'computer-desktop-solid'
|
||||
---
|
||||
|
||||
# Updating Medusa Admin from Gatsby to Vite
|
||||
|
||||
Medusa Admin has been updated to Vite. Learn about breaking changes since the update.
|
||||
|
||||
:::warning
|
||||
|
||||
This guide applies if you're using an old version of the admin repository and you're adding the latest changes of the repository. However, this repository is now deprecated and it's highly recommended to switch to using an admin plugin instead. You can learn more in [the upgrade guide](./1-0-0.md)
|
||||
|
||||
:::
|
||||
|
||||
## 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
|
||||
|
||||
<!-- vale docs.Numbers = NO -->
|
||||
|
||||
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.
|
||||
|
||||
<!-- vale docs.Numbers = YES -->
|
||||
|
||||
---
|
||||
|
||||
## Changed Environment Variables
|
||||
|
||||
Previously, the Medusa Admin used the environment variables `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` to store the Medusa backend’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=<YOUR_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.
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
description: "Migrate from the GitHub repository to the NPM package."
|
||||
sidebar_label: 'v1.0.0'
|
||||
sidebar_custom_props:
|
||||
iconName: 'computer-desktop-solid'
|
||||
---
|
||||
|
||||
# Medusa Admin: v1.0.0
|
||||
|
||||
Medusa Admin has been moved from being hosted on a GitHub repository to being published as an NPM package that can be installed in the same project as the Medusa backend. This upgrade guide will help you find the right resources to make the upgrade.
|
||||
|
||||
:::note
|
||||
|
||||
If you made customizations to the admin and you want to preserve these customization, then it's recommended not to update to use the new admin plugin. You can learn more in [this section](#preserving-customizations-in-the-admin).
|
||||
|
||||
:::
|
||||
|
||||
## Overview
|
||||
|
||||
The Admin is now composed of two packages `@medusajs/admin` and `@medusajs/admin-ui`. The `@medusajs/admin` package is the plugin that can be installed in the Medusa server project. The `@medusajs/admin-ui` package is the UI that is served by the plugin.
|
||||
|
||||
This guide will cover three cases where the move might affect your current setup:
|
||||
|
||||
- Updating your existing project to use the plugin
|
||||
- Replacing your already deployed admin with the plugin
|
||||
- Preserving customizations in the plugin
|
||||
|
||||
## Actions required
|
||||
|
||||
### Updating your existing project to use the plugin
|
||||
|
||||
As mentioned, Medusa Admin is now distributed via NPM and installed as a plugins. To replace your existing admin, you first need to install the plugin in your Medusa server project.
|
||||
|
||||
Follow the [admin quickstart guide](../../admin/quickstart.mdx) to learn how to set up the plugin with the Medusa backend.
|
||||
|
||||
### Deploy the New Admin Plugin
|
||||
|
||||
The move to an NPM package has implications for the workflow to deploy the Admin. The plugin offers to ways to deploy the admin, either by serving the Admin directly from the Medusa server, or by deploying the Admin to a separate hosting platform.
|
||||
|
||||
To host the Admin directly from your Medusa server, you can follow the [Admin Quickstart Guide](../../admin/quickstart.mdx).
|
||||
|
||||
You can learn how to deploy the Admin to a host through the [Vercel Deployment Guide](../../deployments/admin/deploying-on-vercel.mdx). The process is similar for other Git based hosting platforms.
|
||||
|
||||
### Preserving Customizations in the Admin
|
||||
|
||||
If you have made customizations to the Admin, it is recommend that you keep your current setup and wait for the next minor release of Medusa Admin, that will introduce a more seamless way to extend the UI. Migrating customizations to the new admin plugin is not supported, and will require manually patching any changes or forking the Admin plugin. The current Admin repository will still receive critical bug fixes while in maintenance, but it will not be updated with new features. If you can forego the latest features introduced in 1.8 you can continue to use the standalone admin repository for now.
|
||||
|
||||
While it's generally not recommended, if you want to maintain your customizations while upgrading to the latest version of Medusa Admin, you have two options:
|
||||
|
||||
1. Fork the @medusajs/admin plugin and @medusajs/admin-ui, and manually patch in your customizations.
|
||||
2. Use the medusa-admin eject -o <output_directory> command to eject the Admin UI from the plugin and use it as a separate project. This way, you can make your customizations and deploy them to a separate hosting platform.
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
description: "Migrate to v7.0.0 of the admin that supports Admin Extensions"
|
||||
sidebar_label: 'v7.0.0'
|
||||
sidebar_custom_props:
|
||||
iconName: 'computer-desktop-solid'
|
||||
---
|
||||
|
||||
# Medusa Admin: v7.0.0
|
||||
|
||||
Version 7.0.0 introduces Admin Extensions, which were previously available as a `beta` version. By upgrading to this version, you'll be able to create admin [widgets](../../admin/widgets.md), [UI routes](../../admin/routes.md), and [setting pages](../../admin/setting-pages.md).
|
||||
|
||||
This version also introduces a breaking change to the `path` configuration of the admin plugin.
|
||||
|
||||
---
|
||||
|
||||
## How to Update
|
||||
|
||||
Run the following command in the root directory of your Medusa backend to update the admin plugin:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @medusajs/admin@7.0.0
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Actions Required
|
||||
|
||||
### Path Configuration
|
||||
|
||||
Previously, the `path` configuration of the admin plugin set in `medusa-config.js` expected the path to not include a backslash `/` at its beginning or its end.
|
||||
|
||||
Starting from v7.0.0 of `@medusajs/admin`, the `path` configuration is required to start with a `/`, but not end with one.
|
||||
|
||||
For example, if you've set the admin configuration as follows:
|
||||
|
||||
```js title=medusa-config.js
|
||||
const plugins = [
|
||||
// ...
|
||||
{
|
||||
resolve: "@medusajs/admin",
|
||||
/** @type {import('@medusajs/admin').PluginOptions} */
|
||||
options: {
|
||||
path: "admin",
|
||||
// ...
|
||||
},
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
You should change the value of `path` to `/admin`:
|
||||
|
||||
```js title=medusa-config.js
|
||||
const plugins = [
|
||||
// ...
|
||||
{
|
||||
resolve: "@medusajs/admin",
|
||||
/** @type {import('@medusajs/admin').PluginOptions} */
|
||||
options: {
|
||||
path: "/admin",
|
||||
// ...
|
||||
},
|
||||
},
|
||||
]
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"position": 3,
|
||||
"collapsed": true,
|
||||
"link": null,
|
||||
"label": "Medusa Admin"
|
||||
}
|
||||
Reference in New Issue
Block a user