@mercurjs/dashboard-sdk 2.0.0-canary.69 → 2.0.0-canary.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +8 -7
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -552,17 +552,20 @@ function resolvePluginRoot(resolve, configDir, nodeModulesRoot) {
552
552
  return null;
553
553
  }
554
554
  }
555
- function resolvePluginDirs(plugins, configDir, appType) {
555
+ function resolvePluginDirs(plugins, configDir) {
556
556
  const nodeModulesRoot = findNodeModulesRoot(configDir);
557
557
  const dirs = [];
558
+ const appTypes = ["admin", "vendor"];
558
559
  for (const plugin of plugins) {
559
560
  const resolve = typeof plugin === "string" ? plugin : plugin?.resolve;
560
561
  if (!resolve || typeof resolve !== "string") continue;
561
562
  const pluginRoot = resolvePluginRoot(resolve, configDir, nodeModulesRoot);
562
563
  if (!pluginRoot) continue;
563
- const extDir = import_path5.default.join(pluginRoot, appType);
564
- if (import_fs4.default.existsSync(extDir) && import_fs4.default.statSync(extDir).isDirectory()) {
565
- dirs.push(extDir);
564
+ for (const appType of appTypes) {
565
+ const extDir = import_path5.default.join(pluginRoot, ".medusa/server/src", appType);
566
+ if (import_fs4.default.existsSync(extDir) && import_fs4.default.statSync(extDir).isDirectory()) {
567
+ dirs.push(extDir);
568
+ }
566
569
  }
567
570
  }
568
571
  return dirs;
@@ -574,19 +577,17 @@ async function loadMedusaConfig(medusaConfigPath, root) {
574
577
  const modules = medusaConfig?.modules ?? {};
575
578
  const configDir = import_path5.default.dirname(medusaConfigPath);
576
579
  let base;
577
- let appType;
578
580
  for (const key of UI_MODULE_KEYS) {
579
581
  const value = modules[key];
580
582
  if (!value || typeof value !== "object" || !value.options?.appDir) continue;
581
583
  const appDir = import_path5.default.resolve(configDir, value.options.appDir);
582
584
  if (appDir === root) {
583
585
  base = value.options.path;
584
- appType = key === "admin_ui" ? "admin" : "vendor";
585
586
  break;
586
587
  }
587
588
  }
588
589
  const plugins = medusaConfig?.plugins ?? [];
589
- const pluginDirs = appType ? resolvePluginDirs(plugins, configDir, appType) : [];
590
+ const pluginDirs = resolvePluginDirs(plugins, configDir);
590
591
  return { base, pluginDirs };
591
592
  } catch {
592
593
  return { pluginDirs: [] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/dashboard-sdk",
3
- "version": "2.0.0-canary.69",
3
+ "version": "2.0.0-canary.70",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",