feat(dashboard,admin-vite-plugin,admin-bundler,admin-sdk): Rework admin extensions and introduce custom fields API (#9338)

This commit is contained in:
Kasper Fabricius Kristensen authored and GitHub committed 2024-10-09 11:44:40 +00:00
1 parent 35e69d32f2
commit d71343d6ab
159 files changed
+5264 -2224

No files matched your search

+11
View File
@@ -1,3 +1,4 @@
import { logger } from "@medusajs/framework/logger"
import { AdminOptions, ConfigModule } from "@medusajs/framework/types"
import { Express } from "express"
import fs from "fs"
@@ -16,6 +17,8 @@ type IntializedOptions = Required<
sources?: string[]
}
const NOT_ALLOWED_PATHS = ["/auth", "/store", "/admin"]
export default async function adminLoader({
app,
configModule,
@@ -44,6 +47,14 @@ export default async function adminLoader({
return app
}
if (NOT_ALLOWED_PATHS.includes(adminOptions.path)) {
logger.error(
`The 'admin.path' in 'medusa-config.js' is set to a value that is not allowed. This can prevent your server from working correctly. Please set 'admin.path' to a value that is not one of the following: ${NOT_ALLOWED_PATHS.join(
", "
)}.`
)
}
if (process.env.NODE_ENV === "development") {
return initDevelopmentServer(app, adminOptions)
}