docs: update admin extension docs (#4778)

* docs: update admin extension docs

* eslint fixes

* fix broken links

* fix broken link

* added admin upgrade guide

* fix lint errors
This commit is contained in:
Shahed Nasser
2023-08-17 20:04:13 +03:00
committed by GitHub
parent 75881a2cfe
commit 80b1bff8cb
21 changed files with 234 additions and 146 deletions
@@ -89,7 +89,7 @@ In the `package.json` of the Medusa backend, add or change a build script for th
Aside from `--deployment`, you can use the following options when building your admin for deployment:
- `--backend` or `-b`: a string specifying the URL of the Medusa backend. The default here is the value of the environment variable `MEDUSA_BACKEND_URL`. If this options is added, the value you set for `MEDUSA_BACKEND_URL` in Vercel will no longer have an effect. For example, `medusa-admin build --deployment --backend example.com`
- `--backend` or `-b`: a string specifying the URL of the Medusa backend. The default here is the value of the environment variable `MEDUSA_ADMIN_BACKEND_URL`. If this options is added, the value you set for `MEDUSA_ADMIN_BACKEND_URL` in Vercel will no longer have an effect. For example, `medusa-admin build --deployment --backend example.com`
- `--out-dir` or `-o`: a string specifying a custom path to output the build files to. By default, it will be the `build` directory. For example, `medusa-admin --deployment --out-dir public`.
- `--include` or `-i`: a list of strings of paths to files you want to include in the build output. It can be useful if you want to inject files that are relevant to your hosting. For example, `medusa-admin --deployment --include 200.html`
- `--include-dist` or `-d`: a string specifying the path to copy the files specified in `--include` to. By default, the files are coopied to the root of the build directory. You can use this option to change that. For example, `medusa-admin --deployment --include 200.html --include-dist static`.
@@ -135,7 +135,7 @@ This section explains how to deploy the admin using the Vercel website:
5. In the Configure Project form:
1. Set the Framework Preset to Vite.
2. Open the Build and Output Settings collapsible, and set the Build Command to `yarn build:admin` and the Output Directory to `build`. If youve configured the admin to use a different output directory, then change it to that directory.
3. Open the Environment Variables collapsible, and add an environment variable with the name `MEDUSA_BACKEND_URL` with the value being the URL to your deployed Medusa backend.
3. Open the Environment Variables collapsible, and add an environment variable with the name `MEDUSA_ADMIN_BACKEND_URL` with the value being the URL to your deployed Medusa backend.
4. You can optionally edit the Project Name.
6. Once youre done, click on the “Deploy” button.
@@ -154,7 +154,7 @@ This section explains how to deploy the admin using the Vercel CLI tool. You sho
In the directory of your Medusa backend, run the following command to deploy your admin:
```bash
vercel --build-env MEDUSA_BACKEND_URL=<YOUR_BACKEND_URL>
vercel --build-env MEDUSA_ADMIN_BACKEND_URL=<YOUR_BACKEND_URL>
```
Where `<YOUR_BACKEND_URL>` is the URL of your deployed Medusa backend.