Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

chore(template): remove old admin path from packages/api/src

vholik4e6af018e18a
diff --git a/templates/basic/README.md b/templates/basic/README.md
index 55e3d5d82..5ad7495c5 100644
--- a/templates/basic/README.md
+++ b/templates/basic/README.md
@@ -62,7 +62,6 @@ This monorepo includes the following packages and apps:
├── packages/
│ └── api/ # Medusa backend
│ ├── src/
-│ │ ├── admin/ # Admin UI extensions
│ │ ├── api/ # Custom API routes
│ │ ├── jobs/ # Background jobs
│ │ ├── links/ # Module links
diff --git a/templates/basic/packages/api/src/admin/README.md b/templates/basic/packages/api/src/admin/README.md
deleted file mode 100644
index 47983fb79..000000000
--- a/templates/basic/packages/api/src/admin/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Admin Customizations
-
-You can extend the Medusa Admin to add widgets and new pages. Your customizations interact with API routes to provide merchants with custom functionalities.
-
-> Learn more about Admin Extensions in [this documentation](https://docs.medusajs.com/learn/fundamentals/admin).
-
-## Example: Create a Widget
-
-A widget is a React component that can be injected into an existing page in the admin dashboard.
-
-For example, create the file `src/admin/widgets/product-widget.tsx` with the following content:
-
-```tsx title="src/admin/widgets/product-widget.tsx"
-import { defineWidgetConfig } from "@medusajs/admin-sdk"
-
-// The widget
-const ProductWidget = () => {
- return (
- <div>
- <h2>Product Widget</h2>
- </div>
- )
-}
-
-// The widget's configurations
-export const config = defineWidgetConfig({
- zone: "product.details.after",
-})
-
-export default ProductWidget
-```
-
-This inserts a widget with the text “Product Widget” at the end of a product’s details page.
\ No newline at end of file
diff --git a/templates/basic/packages/api/src/admin/i18n/README.md b/templates/basic/packages/api/src/admin/i18n/README.md
deleted file mode 100644
index 04d511042..000000000
--- a/templates/basic/packages/api/src/admin/i18n/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# Admin Customizations Translations
-
-The Medusa Admin dashboard supports multiple languages for its interface. Medusa uses [react-i18next](https://react.i18next.com/) to manage translations in the admin dashboard.
-
-To add translations, create JSON translation files for each language under the `src/admin/i18n/json` directory. For example, create the `src/admin/i18n/json/en.json` file with the following content:
-
-```json
-{
- "brands": {
- "title": "Brands",
- "description": "Manage your product brands"
- },
- "done": "Done"
-}
-```
-
-Then, export the translations in `src/admin/i18n/index.ts`:
-
-```ts
-import en from "./json/en.json" with { type: "json" }
-
-export default {
- en: {
- translation: en,
- },
-}
-```
-
-Finally, use translations in your admin widgets and routes using the `useTranslation` hook:
-
-```tsx
-import { defineWidgetConfig } from "@medusajs/admin-sdk"
-import { Button, Container, Heading } from "@medusajs/ui"
-import { useTranslation } from "react-i18next"
-
-const ProductWidget = () => {
- const { t } = useTranslation()
- return (
- <Container className="p-0">
- <div className="flex items-center justify-between px-6 py-4">
- <Heading level="h2">{t("brands.title")}</Heading>
- <p>{t("brands.description")}</p>
- </div>
- <div className="flex justify-end px-6 py-4">
- <Button variant="primary">{t("done")}</Button>
- </div>
- </Container>
- )
-}
-
-export const config = defineWidgetConfig({
- zone: "product.details.before",
-})
-
-export default ProductWidget
-```
-
-Learn more about translating admin extensions in the [Translate Admin Customizations](https://docs.medusajs.com/learn/fundamentals/admin/translations) documentation.
\ No newline at end of file
diff --git a/templates/basic/packages/api/src/admin/i18n/index.ts b/templates/basic/packages/api/src/admin/i18n/index.ts
deleted file mode 100644
index 56004c9f9..000000000
--- a/templates/basic/packages/api/src/admin/i18n/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export default {}
\ No newline at end of file
diff --git a/templates/basic/packages/api/src/admin/tsconfig.json b/templates/basic/packages/api/src/admin/tsconfig.json
deleted file mode 100644
index ea4bf122b..000000000
--- a/templates/basic/packages/api/src/admin/tsconfig.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2020",
- "useDefineForClassFields": true,
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
- "module": "ESNext",
- "skipLibCheck": true,
-
- /* Bundler mode */
- "moduleResolution": "bundler",
- "allowImportingTsExtensions": true,
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
-
- /* Linting */
- "strict": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "noFallthroughCasesInSwitch": true
- },
- "include": ["."]
-}
\ No newline at end of file
diff --git a/templates/basic/packages/api/src/admin/vite-env.d.ts b/templates/basic/packages/api/src/admin/vite-env.d.ts
deleted file mode 100644
index 151aa6856..000000000
--- a/templates/basic/packages/api/src/admin/vite-env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-/// <reference types="vite/client" />
\ No newline at end of file