@mercurjs/dashboard-sdk 2.2.0-canary.23 → 2.2.0-canary.26

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 +26 -1
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -650,6 +650,24 @@ function isRouteFile(file) {
650
650
  return basename === "page";
651
651
  }
652
652
  var UI_MODULE_KEYS = ["admin_ui", "vendor_ui"];
653
+ var MEDUSA_VIRTUAL_MODULES = [
654
+ "virtual:medusa/displays",
655
+ "virtual:medusa/forms",
656
+ "virtual:medusa/i18n",
657
+ "virtual:medusa/menu-items",
658
+ "virtual:medusa/routes",
659
+ "virtual:medusa/widgets",
660
+ "virtual:medusa/links"
661
+ ];
662
+ function isMedusaVirtualModule(id) {
663
+ return MEDUSA_VIRTUAL_MODULES.includes(id);
664
+ }
665
+ function resolveMedusaVirtualModule(id) {
666
+ return "\0" + id;
667
+ }
668
+ function isResolvedMedusaVirtualModule(id) {
669
+ return id.startsWith("\0virtual:medusa/");
670
+ }
653
671
  function findNodeModulesRoot(configDir) {
654
672
  let dir = configDir;
655
673
  while (dir !== import_path5.default.dirname(dir)) {
@@ -804,7 +822,8 @@ function mercurDashboardPlugin(pluginConfig) {
804
822
  "virtual:mercur/routes",
805
823
  "virtual:mercur/components",
806
824
  "virtual:mercur/menu-items",
807
- "virtual:mercur/i18n"
825
+ "virtual:mercur/i18n",
826
+ ...MEDUSA_VIRTUAL_MODULES
808
827
  ],
809
828
  include: [
810
829
  "react",
@@ -828,9 +847,15 @@ function mercurDashboardPlugin(pluginConfig) {
828
847
  if (isVirtualModule(id)) {
829
848
  return resolveVirtualModule(id);
830
849
  }
850
+ if (isMedusaVirtualModule(id)) {
851
+ return resolveMedusaVirtualModule(id);
852
+ }
831
853
  return null;
832
854
  },
833
855
  load(id) {
856
+ if (isResolvedMedusaVirtualModule(id)) {
857
+ return "export default {}";
858
+ }
834
859
  return loadVirtualModule({ cwd: root, id, mercurConfig: config });
835
860
  },
836
861
  configureServer(server) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/dashboard-sdk",
3
- "version": "2.2.0-canary.23",
3
+ "version": "2.2.0-canary.26",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",