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.

feat(vendor): restructure vendor template with Vite setup and add pages README

vholikc98fec307c30
diff --git a/packages/vendor/CLAUDE.md b/packages/vendor/CLAUDE.md
deleted file mode 100644
index 0d390046e..000000000
--- a/packages/vendor/CLAUDE.md
+++ /dev/null
@@ -1,246 +0,0 @@
-# Core Admin - File-Based Routing Guide
-
-## Quick Reference
-
-```
-src/pages/
-├── _layout.tsx # Root layout (ProtectedRoute)
-├── products/ # Main route: /products
-│ ├── index.tsx # List page (export Component)
-│ ├── [id]/ # Dynamic route: /products/:id
-│ │ ├── index.tsx # Detail page (export Component, loader, Breadcrumb)
-│ │ └── edit/ # Nested: /products/:id/edit
-│ ├── create/ # /products/create
-│ └── _components/ # Internal components (not routes)
-├── settings/ # Settings section: /settings/*
-│ ├── index.tsx # Settings landing page
-│ ├── regions/ # /settings/regions
-│ └── users/ # /settings/users
-└── login/ # Public route (no auth required)
-```
-
-## Page File Requirements
-
-Every page MUST export `Component`:
-
-```tsx
-// Minimal page
-export const Component = () => <div>Hello</div>
-
-// With loader (for data pre-fetching)
-export const loader = (queryClient: QueryClient) => async () => {
- // Pre-fetch data
- return queryClient.fetchQuery(...)
-}
-export const Component = () => { ... }
-
-// With breadcrumb (for dynamic routes like [id])
-export const Breadcrumb = (props: UIMatch<DataType>) => {
- return <span>{props.data.name}</span>
-}
-export const Component = () => { ... }
-export { loader } from "./loader"
-```
-
-## Folder Conventions
-
-| Pattern | URL | Description |
-|---------|-----|-------------|
-| `products/index.tsx` | `/products` | List page |
-| `products/[id]/index.tsx` | `/products/:id` | Detail page (dynamic) |
-| `products/[id]/edit/index.tsx` | `/products/:id/edit` | Edit page |
-| `products/create/index.tsx` | `/products/create` | Create page |
-| `products/_components/` | - | Internal components (NOT routes) |
-| `products/common/` | - | Shared utilities (NOT routes) |
-| `settings/regions/` | `/settings/regions` | Settings sub-route |
-
-## Route Classification
-
-Routes are automatically classified:
-
-1. **Public routes** - `/login`, `/invite`, `/reset-password` → `PublicLayout`
-2. **Settings routes** - `/settings/*` → `SettingsLayout` (separate from main)
-3. **Main routes** - Everything else → `MainLayout` with sidebar
-
-## Creating a New Route
-
-### 1. Main Route (e.g., /vendors)
-
-```
-src/pages/vendors/
-├── index.tsx # List page
-├── [id]/
-│ ├── index.tsx # Detail page
-│ ├── edit/index.tsx # Edit modal/page
-│ ├── breadcrumb.tsx # Dynamic breadcrumb
-│ ├── loader.ts # Data loader
-│ └── _components/ # Page-specific components
-├── create/index.tsx # Create modal/page
-├── _components/ # Shared list components
-└── common/ # Shared hooks, utils, constants
-```
-
-### 2. Settings Route (e.g., /settings/api-keys)
-
-```
-src/pages/settings/api-keys/
-├── index.tsx # List page
-├── [id]/
-│ └── index.tsx # Detail/edit page
-├── create/index.tsx
-└── _components/
-```
-
-## Component Patterns
-
-### List Page Pattern
-
-```tsx
-// pages/vendors/index.tsx
-import { SingleColumnPage } from "@components/layout/pages"
-import { useExtension } from "@providers/extension-provider"
-import { VendorListTable } from "./_components/vendor-list-table"
-
-const VendorList = () => {
- const { getWidgets } = useExtension()
-
- return (
- <SingleColumnPage
- widgets={{
- before: getWidgets("vendor.list.before"),
- after: getWidgets("vendor.list.after"),
- }}
- >
- <VendorListTable />
- </SingleColumnPage>
- )
-}
-
-export const Component = VendorList
-```
-
-### Detail Page Pattern
-
-```tsx
-// pages/vendors/[id]/index.tsx
-import { useLoaderData, useParams } from "react-router-dom"
-import { SingleColumnPage } from "@components/layout/pages"
-import { useVendor } from "@hooks/api/vendors"
-
-const VendorDetail = () => {
- const initialData = useLoaderData()
- const { id } = useParams()
- const { vendor, isPending } = useVendor(id!, { initialData })
-
- if (isPending || !vendor) {
- return <SingleColumnPageSkeleton />
- }
-
- return (
- <SingleColumnPage data={vendor} showJSON showMetadata>
- <VendorGeneralSection vendor={vendor} />
- </SingleColumnPage>
- )
-}
-
-export const Component = VendorDetail
-export { vendorLoader as loader } from "./loader"
-export { VendorBreadcrumb as Breadcrumb } from "./breadcrumb"
-```
-
-### Breadcrumb Pattern
-
-```tsx
-// pages/vendors/[id]/breadcrumb.tsx
-import { UIMatch } from "react-router-dom"
-import { useVendor } from "@hooks/api/vendors"
-
-type Props = UIMatch<VendorResponse>
-
-export const VendorBreadcrumb = (props: Props) => {
- const { id } = props.params || {}
- const { vendor } = useVendor(id!, { initialData: props.data })
-
- return <span>{vendor?.name}</span>
-}
-```
-
-### Loader Pattern
-
-```tsx
-// pages/vendors/[id]/loader.ts
-import { QueryClient } from "@tanstack/react-query"
-import { vendorQueryKeys } from "@hooks/api/vendors"
-import { sdk } from "@lib/client"
-import { queryClient } from "@lib/query-client"
-
-const vendorDetailQuery = (id: string) => ({
- queryKey: vendorQueryKeys.detail(id),
- queryFn: () => sdk.admin.vendor.retrieve(id),
-})
-
-export const vendorLoader = (client: QueryClient) => {
- return async ({ params }: { params: { id: string } }) => {
- const query = vendorDetailQuery(params.id)
- return queryClient.getQueryData(query.queryKey) ??
- (await client.fetchQuery(query))
- }
-}
-```
-
-## Import Aliases
-
-Always use aliases, never relative imports outside the module:
-
-```tsx
-// Good
-import { Button } from "@components/ui/button"
-import { useVendor } from "@hooks/api/vendors"
-import { sdk } from "@lib/client"
-
-// Bad
-import { Button } from "../../../components/ui/button"
-```
-
-Available aliases:
-- `@components/` → `src/components/`
-- `@hooks/` → `src/hooks/`
-- `@lib/` → `src/lib/`
-- `@providers/` → `src/providers/`
-- `@pages/` → `src/pages/`
-
-## Modal Routes
-
-For create/edit modals that appear over the list:
-
-```tsx
-// pages/vendors/create/index.tsx
-import { RouteFocusModal } from "@components/modals"
-import { CreateVendorForm } from "./_components/create-vendor-form"
-
-export const Component = () => {
- return (
- <RouteFocusModal>
- <CreateVendorForm />
- </RouteFocusModal>
- )
-}
-```
-
-## Drawer Routes
-
-For side panel edits:
-
-```tsx
-// pages/vendors/[id]/edit/index.tsx
-import { RouteDrawer } from "@components/modals"
-import { EditVendorForm } from "./_components/edit-vendor-form"
-
-export const Component = () => {
- return (
- <RouteDrawer>
- <EditVendorForm />
- </RouteDrawer>
- )
-}
-```
diff --git a/templates/basic/apps/admin/.env.template b/templates/basic/apps/admin/.env.template
deleted file mode 100644
index 387f38772..000000000
--- a/templates/basic/apps/admin/.env.template
+++ /dev/null
@@ -1 +0,0 @@
-ADMIN_TEST=TEST
\ No newline at end of file
diff --git a/templates/basic/apps/admin/package.json b/templates/basic/apps/admin/package.json
deleted file mode 100644
index 33a23f908..000000000
--- a/templates/basic/apps/admin/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "@acme/admin",
- "version": "0.0.0",
- "private": true,
- "type": "module",
- "scripts": {
- "dev": "vite",
- "build": "vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@mercurjs/vendor": "*",
- "react": "^18.2.0",
- "react-dom": "^18.2.0"
- },
- "devDependencies": {
- "@mercurjs/dashboard-sdk": "*",
- "@types/react": "^18.2.66",
- "@types/react-dom": "^18.2.22",
- "@vitejs/plugin-react": "^4.2.1",
- "typescript": "5.9.3",
- "vite": "^5.4.21"
- }
-}
diff --git a/templates/basic/apps/admin/src/index.ts b/templates/basic/apps/admin/src/index.ts
deleted file mode 100644
index e69de29bb..000000000
diff --git a/templates/basic/apps/admin/tsconfig.json b/templates/basic/apps/admin/tsconfig.json
deleted file mode 100644
index 102ed5cf4..000000000
--- a/templates/basic/apps/admin/tsconfig.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": "../../tsconfig.base.json",
- "compilerOptions": {
- "lib": ["ES2022", "dom", "dom.iterable"],
- "jsx": "preserve",
- "paths": {
- "~/*": ["./src/*"]
- }
- },
- "include": ["**/*.ts", "**/*.tsx"],
- "exclude": ["node_modules"]
-}
diff --git a/templates/basic/apps/vendor/.env.template b/templates/basic/apps/vendor/.env.template
deleted file mode 100644
index a4e95632d..000000000
--- a/templates/basic/apps/vendor/.env.template
+++ /dev/null
@@ -1 +0,0 @@
-VENDOR_TEST=TEST
\ No newline at end of file
diff --git a/templates/basic/apps/vendor/.gitignore b/templates/basic/apps/vendor/.gitignore
new file mode 100644
index 000000000..a547bf36d
--- /dev/null
+++ b/templates/basic/apps/vendor/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/templates/basic/apps/vendor/README.md b/templates/basic/apps/vendor/README.md
new file mode 100644
index 000000000..d2e77611f
--- /dev/null
+++ b/templates/basic/apps/vendor/README.md
@@ -0,0 +1,73 @@
+# React + TypeScript + Vite
+
+This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
+
+Currently, two official plugins are available:
+
+- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
+- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
+
+## React Compiler
+
+The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
+
+## Expanding the ESLint configuration
+
+If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
+
+```js
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{ts,tsx}'],
+ extends: [
+ // Other configs...
+
+ // Remove tseslint.configs.recommended and replace with this
+ tseslint.configs.recommendedTypeChecked,
+ // Alternatively, use this for stricter rules
+ tseslint.configs.strictTypeChecked,
+ // Optionally, add this for stylistic rules
+ tseslint.configs.stylisticTypeChecked,
+
+ // Other configs...
+ ],
+ languageOptions: {
+ parserOptions: {
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
+ tsconfigRootDir: import.meta.dirname,
+ },
+ // other options...
+ },
+ },
+])
+```
+
+You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
+
+```js
+// eslint.config.js
+import reactX from 'eslint-plugin-react-x'
+import reactDom from 'eslint-plugin-react-dom'
+
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{ts,tsx}'],
+ extends: [
+ // Other configs...
+ // Enable lint rules for React
+ reactX.configs['recommended-typescript'],
+ // Enable lint rules for React DOM
+ reactDom.configs.recommended,
+ ],
+ languageOptions: {
+ parserOptions: {
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
+ tsconfigRootDir: import.meta.dirname,
+ },
+ // other options...
+ },
+ },
+])
+```
diff --git a/templates/basic/apps/vendor/eslint.config.js b/templates/basic/apps/vendor/eslint.config.js
new file mode 100644
index 000000000..97fee7139
--- /dev/null
+++ b/templates/basic/apps/vendor/eslint.config.js
@@ -0,0 +1,26 @@
+import js from '@eslint/js'
+import globals from 'globals'
+import reactHooks from 'eslint-plugin-react-hooks'
+import reactRefresh from 'eslint-plugin-react-refresh'
+import tseslint from 'typescript-eslint'
+import { defineConfig, globalIgnores } from 'eslint/config'
+
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{ts,tsx}'],
+ extends: [
+ js.configs.recommended,
+ tseslint.configs.recommended,
+ reactHooks.configs.flat.recommended,
+ reactRefresh.configs.vite,
+ ],
+ languageOptions: {
+ ecmaVersion: 2020,
+ globals: globals.browser,
+ parserOptions: {
+ tsconfigRootDir: import.meta.dirname,
+ },
+ },
+ },
+])
diff --git a/templates/basic/apps/vendor/index.html b/templates/basic/apps/vendor/index.html
new file mode 100644
index 000000000..3eba2070a
--- /dev/null
+++ b/templates/basic/apps/vendor/index.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <link rel="icon" type="image/svg+xml" href="/public/logo.svg" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Vendor Hub</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="/src/main.tsx"></script>
+ </body>
+</html>
diff --git a/templates/basic/apps/vendor/mercur.config.ts b/templates/basic/apps/vendor/mercur.config.ts
new file mode 100644
index 000000000..82a04094c
--- /dev/null
+++ b/templates/basic/apps/vendor/mercur.config.ts
@@ -0,0 +1,6 @@
+import { defineConfig } from '@mercurjs/dashboard-sdk'
+
+export default defineConfig({
+ name: 'WeTest',
+ logo: 'https://ui-avatars.com/api/?name=WeTest&background=18181B&color=fff&size=200&bold=true&format=svg',
+})
diff --git a/templates/basic/apps/vendor/package.json b/templates/basic/apps/vendor/package.json
index 909fc4f0a..7c758620e 100644
--- a/templates/basic/apps/vendor/package.json
+++ b/templates/basic/apps/vendor/package.json
@@ -1,5 +1,33 @@
{
"name": "@acme/vendor",
+ "private": true,
"version": "0.0.0",
- "private": true
-}
+ "type": "module",
+ "scripts": {
+ "dev": "vite --port 7001",
+ "build": "tsc -b && vite build",
+ "lint": "eslint .",
+ "preview": "vite preview --port 7001"
+ },
+ "dependencies": {
+ "@medusajs/icons": "^2.13.1",
+ "@mercurjs/dashboard-sdk": "*",
+ "@mercurjs/vendor": "*",
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0"
+ },
+ "devDependencies": {
+ "@eslint/js": "^9.39.1",
+ "@types/node": "^24.10.1",
+ "@types/react": "^18.2.66",
+ "@types/react-dom": "^18.2.22",
+ "@vitejs/plugin-react": "^4.2.1",
+ "eslint": "^9.39.1",
+ "eslint-plugin-react-hooks": "^7.0.1",
+ "eslint-plugin-react-refresh": "^0.4.24",
+ "globals": "^16.5.0",
+ "typescript": "5.9.3",
+ "typescript-eslint": "^8.46.4",
+ "vite": "^5.4.21"
+ }
+}
\ No newline at end of file
diff --git a/templates/basic/apps/vendor/public/logo.svg b/templates/basic/apps/vendor/public/logo.svg
new file mode 100644
index 000000000..8c2518166
--- /dev/null
+++ b/templates/basic/apps/vendor/public/logo.svg
@@ -0,0 +1,38 @@
+ <svg
+ width='44'
+ height='44'
+ viewBox='0 0 44 44'
+ fill='none'
+ xmlns='http://www.w3.org/2000/svg'
+ >
+ <rect
+ width='44'
+ height='44'
+ rx='10'
+ fill='#FAFAFA'
+ />
+ <g clipPath='url(#clip0_11_175)'>
+ <path
+ d='M8 7V20.7349L19.821 13.8675L8 7Z'
+ fill='#4C24DD'
+ />
+ <path
+ d='M36.0002 37.0001V23.2651L24.1792 30.1326L36.0002 37.0001Z'
+ fill='#4C24DD'
+ />
+ <path
+ d='M8 23.2651V37L36 20.7349V7L8 23.2651Z'
+ fill='#4C24DD'
+ />
+ </g>
+ <defs>
+ <clipPath id='clip0_11_175'>
+ <rect
+ width='28'
+ height='30'
+ fill='white'
+ transform='translate(8 7)'
+ />
+ </clipPath>
+ </defs>
+ </svg>
\ No newline at end of file
diff --git a/templates/basic/apps/vendor/src/README.md b/templates/basic/apps/vendor/src/README.md
new file mode 100644
index 000000000..1b2697508
--- /dev/null
+++ b/templates/basic/apps/vendor/src/README.md
@@ -0,0 +1,130 @@
+# Custom Pages
+
+A custom page lets you add new views to the vendor portal. Pages are automatically discovered using file-based routing powered by the `@mercurjs/dashboard-sdk` Vite plugin.
+
+> Learn more about the dashboard SDK in the [Mercur documentation](https://docs.mercurjs.com).
+
+To create a custom page:
+
+## 1. Create a Page File
+
+Create a `page.tsx` file inside the `src/pages/` directory. The file path determines the URL route.
+
+For example, create the file `src/pages/blog/page.tsx` with the following content:
+
+```tsx
+const BlogPage = () => {
+ return (
+ <div>
+ <h1>Blog Posts</h1>
+ <p>My custom vendor page</p>
+ </div>
+ )
+}
+
+export default BlogPage
+```
+
+This page will be accessible at `/blog` in the vendor portal.
+
+## 2. File-Based Routing
+
+The route is derived from the file path relative to `src/pages/`. Each route must be defined in a file named `page.tsx` (or `.ts`, `.jsx`, `.js`).
+
+| File Path | Route |
+|---|---|
+| `src/pages/page.tsx` | `/` |
+| `src/pages/blog/page.tsx` | `/blog` |
+| `src/pages/blog/[id]/page.tsx` | `/blog/:id` (dynamic) |
+| `src/pages/blog/[[id]]/page.tsx` | `/blog/:id?` (optional dynamic) |
+| `src/pages/blog/[*]/page.tsx` | `/blog/*` (splat/catch-all) |
+| `src/pages/(group)/foo/page.tsx` | `/foo` (route grouping) |
+| `src/pages/dashboard/@sidebar/page.tsx` | Parallel route (nested child) |
+
+## 3. Add a Sidebar Menu Item
+
+To add your page to the sidebar navigation, export a `config` object from the page file:
+
+```tsx
+import { Building } from "lucide-react"
+import type { RouteConfig } from "@mercurjs/dashboard-sdk"
+
+export const config: RouteConfig = {
+ label: "Blog",
+ icon: Building,
+}
+
+const BlogPage = () => {
+ return (
+ <div>
+ <h1>Blog Posts</h1>
+ </div>
+ )
+}
+
+export default BlogPage
+```
+
+### Config Options
+
+| Property | Type | Description |
+|---|---|---|
+| `label` | `string` | **(required)** Display name in the sidebar |
+| `icon` | `ComponentType` | Icon component shown next to the label |
+| `rank` | `number` | Controls ordering in the sidebar |
+| `nested` | `string` | Parent menu item path to nest under |
+| `translationNs` | `string` | i18n translation namespace for the label |
+
+## 4. Add Data Loading
+
+Use React Router's loader pattern to pre-fetch data before the page renders:
+
+```tsx
+import { useLoaderData } from "react-router-dom"
+import type { LoaderFunctionArgs } from "react-router-dom"
+
+export const loader = async ({ params }: LoaderFunctionArgs) => {
+ const response = await fetch(`/api/blog/${params.id}`)
+ return response.json()
+}
+
+const BlogDetailPage = () => {
+ const data = useLoaderData()
+
+ return (
+ <div>
+ <h1>{data.title}</h1>
+ <p>{data.content}</p>
+ </div>
+ )
+}
+
+export default BlogDetailPage
+```
+
+## 5. Add Route Metadata
+
+Export a `handle` object to attach metadata to the route, accessible via React Router's `useMatches()`:
+
+```tsx
+export const handle = {
+ breadcrumb: "Blog",
+}
+
+const BlogPage = () => {
+ return <div>Blog</div>
+}
+
+export default BlogPage
+```
+
+## Summary
+
+Each `page.tsx` file supports these exports:
+
+| Export | Required | Description |
+|---|---|---|
+| `default` | Yes | The React component to render |
+| `config` | No | Sidebar menu item configuration |
+| `loader` | No | Data loading function (React Router) |
+| `handle` | No | Route metadata (React Router) |
diff --git a/templates/basic/apps/vendor/src/i18n/en.json b/templates/basic/apps/vendor/src/i18n/en.json
new file mode 100644
index 000000000..72011729b
--- /dev/null
+++ b/templates/basic/apps/vendor/src/i18n/en.json
@@ -0,0 +1,7 @@
+{
+ "customFields": {
+ "title": "Custom Fields",
+ "description": "Manage your custom fields and configurations",
+ "noFields": "No custom fields configured yet"
+ }
+}
diff --git a/templates/basic/apps/vendor/src/i18n/index.ts b/templates/basic/apps/vendor/src/i18n/index.ts
new file mode 100644
index 000000000..84da0cb86
--- /dev/null
+++ b/templates/basic/apps/vendor/src/i18n/index.ts
@@ -0,0 +1,9 @@
+import en from "./en.json"
+
+const i18nResources = {
+ en: {
+ translation: en,
+ },
+}
+
+export default i18nResources
diff --git a/templates/basic/apps/vendor/src/index.ts b/templates/basic/apps/vendor/src/index.ts
deleted file mode 100644
index e69de29bb..000000000
diff --git a/templates/basic/apps/vendor/src/main.tsx b/templates/basic/apps/vendor/src/main.tsx
new file mode 100644
index 000000000..ce1b1e708
--- /dev/null
+++ b/templates/basic/apps/vendor/src/main.tsx
@@ -0,0 +1,10 @@
+import { StrictMode } from "react";
+import { createRoot } from "react-dom/client";
+import "@mercurjs/vendor/index.css";
+import App from "@mercurjs/vendor";
+
+createRoot(document.getElementById("root")!).render(
+ <StrictMode>
+ <App />
+ </StrictMode>,
+);
diff --git a/templates/basic/apps/vendor/tsconfig.app.json b/templates/basic/apps/vendor/tsconfig.app.json
new file mode 100644
index 000000000..26a772c26
--- /dev/null
+++ b/templates/basic/apps/vendor/tsconfig.app.json
@@ -0,0 +1,35 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
+ "target": "ES2022",
+ "useDefineForClassFields": true,
+ "lib": [
+ "ES2022",
+ "DOM",
+ "DOM.Iterable"
+ ],
+ "module": "ESNext",
+ "types": [
+ "vite/client"
+ ],
+ "skipLibCheck": true,
+ "baseUrl": ".",
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "verbatimModuleSyntax": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+ "jsx": "react-jsx",
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "erasableSyntaxOnly": true,
+ "noFallthroughCasesInSwitch": true,
+ "noUncheckedSideEffectImports": true
+ },
+ "include": [
+ "src",
+ ]
+}
\ No newline at end of file
diff --git a/templates/basic/apps/vendor/tsconfig.json b/templates/basic/apps/vendor/tsconfig.json
index 102ed5cf4..1ffef600d 100644
--- a/templates/basic/apps/vendor/tsconfig.json
+++ b/templates/basic/apps/vendor/tsconfig.json
@@ -1,12 +1,7 @@
{
- "extends": "../../tsconfig.base.json",
- "compilerOptions": {
- "lib": ["ES2022", "dom", "dom.iterable"],
- "jsx": "preserve",
- "paths": {
- "~/*": ["./src/*"]
- }
- },
- "include": ["**/*.ts", "**/*.tsx"],
- "exclude": ["node_modules"]
+ "files": [],
+ "references": [
+ { "path": "./tsconfig.app.json" },
+ { "path": "./tsconfig.node.json" }
+ ]
}
diff --git a/templates/basic/apps/vendor/tsconfig.node.json b/templates/basic/apps/vendor/tsconfig.node.json
new file mode 100644
index 000000000..ed01be245
--- /dev/null
+++ b/templates/basic/apps/vendor/tsconfig.node.json
@@ -0,0 +1,32 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
+ "target": "ES2023",
+ "lib": [
+ "ES2023"
+ ],
+ "module": "ESNext",
+ "jsx": "react-jsx",
+ "types": [
+ "node"
+ ],
+ "skipLibCheck": true,
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "verbatimModuleSyntax": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "erasableSyntaxOnly": true,
+ "noFallthroughCasesInSwitch": true,
+ "noUncheckedSideEffectImports": true
+ },
+ "include": [
+ "vite.config.ts",
+ "mercur.config.ts"
+ ]
+}
\ No newline at end of file
diff --git a/templates/basic/apps/vendor/vite.config.ts b/templates/basic/apps/vendor/vite.config.ts
new file mode 100644
index 000000000..2d9bc2f9b
--- /dev/null
+++ b/templates/basic/apps/vendor/vite.config.ts
@@ -0,0 +1,8 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import { dashboardPlugin } from '@mercurjs/dashboard-sdk'
+
+// https://vite.dev/config/
+export default defineConfig({
+ plugins: [react(), dashboardPlugin()],
+})
diff --git a/templates/basic/packages/api/medusa-config.ts b/templates/basic/packages/api/medusa-config.ts
index e2840feac..cf0181b42 100644
--- a/templates/basic/packages/api/medusa-config.ts
+++ b/templates/basic/packages/api/medusa-config.ts
@@ -14,5 +14,5 @@ module.exports = defineConfig({
jwtSecret: process.env.JWT_SECRET || "supersecret",
cookieSecret: process.env.COOKIE_SECRET || "supersecret",
}
- }
+ },
})