@mercurjs/dashboard-sdk 2.2.0-rc.1 → 2.2.0-rc.3
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.
- package/dist/vite.cjs +27 -12
- package/dist/vite.js +27 -12
- package/package.json +1 -1
package/dist/vite.cjs
CHANGED
|
@@ -38,6 +38,7 @@ module.exports = __toCommonJS(vite_exports);
|
|
|
38
38
|
// src/plugin.ts
|
|
39
39
|
var import_path8 = __toESM(require("path"), 1);
|
|
40
40
|
var import_fs7 = __toESM(require("fs"), 1);
|
|
41
|
+
var import_module = require("module");
|
|
41
42
|
|
|
42
43
|
// src/utils.ts
|
|
43
44
|
var import_fs = __toESM(require("fs"), 1);
|
|
@@ -875,6 +876,17 @@ var MEDUSA_VIRTUAL_MODULES = [
|
|
|
875
876
|
function isMedusaVirtualModule(id) {
|
|
876
877
|
return MEDUSA_VIRTUAL_MODULES.includes(id);
|
|
877
878
|
}
|
|
879
|
+
function filterResolvableDeps(specifiers, fromDir) {
|
|
880
|
+
const require2 = (0, import_module.createRequire)(import_path8.default.join(fromDir, "noop.js"));
|
|
881
|
+
return specifiers.filter((specifier) => {
|
|
882
|
+
try {
|
|
883
|
+
require2.resolve(specifier);
|
|
884
|
+
return true;
|
|
885
|
+
} catch {
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
}
|
|
878
890
|
function resolveMedusaVirtualModule(id) {
|
|
879
891
|
return "\0" + id;
|
|
880
892
|
}
|
|
@@ -1040,18 +1052,21 @@ function mercurDashboardPlugin(pluginConfig) {
|
|
|
1040
1052
|
"virtual:mercur/custom-fields",
|
|
1041
1053
|
...MEDUSA_VIRTUAL_MODULES
|
|
1042
1054
|
],
|
|
1043
|
-
include:
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
+
include: filterResolvableDeps(
|
|
1056
|
+
[
|
|
1057
|
+
"react",
|
|
1058
|
+
"react/jsx-runtime",
|
|
1059
|
+
"react-dom/client",
|
|
1060
|
+
"react-router-dom",
|
|
1061
|
+
"react-i18next",
|
|
1062
|
+
"i18next",
|
|
1063
|
+
"@medusajs/ui",
|
|
1064
|
+
"@medusajs/dashboard",
|
|
1065
|
+
"@mercurjs/client",
|
|
1066
|
+
"@tanstack/react-query"
|
|
1067
|
+
],
|
|
1068
|
+
root
|
|
1069
|
+
)
|
|
1055
1070
|
}
|
|
1056
1071
|
};
|
|
1057
1072
|
},
|
package/dist/vite.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
// src/plugin.ts
|
|
6
6
|
import path8 from "path";
|
|
7
7
|
import fs7 from "fs";
|
|
8
|
+
import { createRequire } from "module";
|
|
8
9
|
|
|
9
10
|
// src/utils.ts
|
|
10
11
|
import fs from "fs";
|
|
@@ -855,6 +856,17 @@ var MEDUSA_VIRTUAL_MODULES = [
|
|
|
855
856
|
function isMedusaVirtualModule(id) {
|
|
856
857
|
return MEDUSA_VIRTUAL_MODULES.includes(id);
|
|
857
858
|
}
|
|
859
|
+
function filterResolvableDeps(specifiers, fromDir) {
|
|
860
|
+
const require2 = createRequire(path8.join(fromDir, "noop.js"));
|
|
861
|
+
return specifiers.filter((specifier) => {
|
|
862
|
+
try {
|
|
863
|
+
require2.resolve(specifier);
|
|
864
|
+
return true;
|
|
865
|
+
} catch {
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
}
|
|
858
870
|
function resolveMedusaVirtualModule(id) {
|
|
859
871
|
return "\0" + id;
|
|
860
872
|
}
|
|
@@ -1020,18 +1032,21 @@ function mercurDashboardPlugin(pluginConfig) {
|
|
|
1020
1032
|
"virtual:mercur/custom-fields",
|
|
1021
1033
|
...MEDUSA_VIRTUAL_MODULES
|
|
1022
1034
|
],
|
|
1023
|
-
include:
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
+
include: filterResolvableDeps(
|
|
1036
|
+
[
|
|
1037
|
+
"react",
|
|
1038
|
+
"react/jsx-runtime",
|
|
1039
|
+
"react-dom/client",
|
|
1040
|
+
"react-router-dom",
|
|
1041
|
+
"react-i18next",
|
|
1042
|
+
"i18next",
|
|
1043
|
+
"@medusajs/ui",
|
|
1044
|
+
"@medusajs/dashboard",
|
|
1045
|
+
"@mercurjs/client",
|
|
1046
|
+
"@tanstack/react-query"
|
|
1047
|
+
],
|
|
1048
|
+
root
|
|
1049
|
+
)
|
|
1035
1050
|
}
|
|
1036
1051
|
};
|
|
1037
1052
|
},
|