@webtypen/webframez-react 0.0.24 → 0.0.25
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/defaults/webpack.client.cjs +8 -1
- package/dist/http.cjs +65 -9
- package/dist/http.js +65 -9
- package/dist/index.cjs +65 -9
- package/dist/index.js +65 -9
- package/dist/webframez-core.cjs +65 -9
- package/dist/webframez-core.js +65 -9
- package/package.json +1 -1
|
@@ -6,9 +6,14 @@ const frameworkDistDir = path.resolve(__dirname, "..", "dist");
|
|
|
6
6
|
const clientEntry = process.env.WEBFRAMEZ_REACT_CLIENT_ENTRY
|
|
7
7
|
? path.resolve(projectRoot, process.env.WEBFRAMEZ_REACT_CLIENT_ENTRY)
|
|
8
8
|
: path.resolve(projectRoot, "src/client.tsx");
|
|
9
|
+
const isWatchMode = process.argv.includes("--watch");
|
|
10
|
+
const mode =
|
|
11
|
+
process.env.NODE_ENV === "production" || (typeof process.env.NODE_ENV === "undefined" && !isWatchMode)
|
|
12
|
+
? "production"
|
|
13
|
+
: "development";
|
|
9
14
|
|
|
10
15
|
module.exports = {
|
|
11
|
-
mode
|
|
16
|
+
mode,
|
|
12
17
|
entry: {
|
|
13
18
|
client: clientEntry,
|
|
14
19
|
},
|
|
@@ -38,6 +43,8 @@ module.exports = {
|
|
|
38
43
|
optimization: {
|
|
39
44
|
splitChunks: false,
|
|
40
45
|
runtimeChunk: false,
|
|
46
|
+
moduleIds: "named",
|
|
47
|
+
chunkIds: "named",
|
|
41
48
|
},
|
|
42
49
|
plugins: [
|
|
43
50
|
new ReactFlightWebpackPlugin({
|
package/dist/http.cjs
CHANGED
|
@@ -732,7 +732,21 @@ globalThis.__webpack_require__ = function __webframezNodeRequire(id) {
|
|
|
732
732
|
}
|
|
733
733
|
|
|
734
734
|
if (id.startsWith("./")) {
|
|
735
|
-
|
|
735
|
+
const relativeId = id.slice(2);
|
|
736
|
+
const candidates = [
|
|
737
|
+
path.resolve(process.cwd(), relativeId),
|
|
738
|
+
path.resolve(process.cwd(), "..", relativeId)
|
|
739
|
+
];
|
|
740
|
+
for (const candidate of candidates) {
|
|
741
|
+
try {
|
|
742
|
+
return require(candidate);
|
|
743
|
+
} catch (error) {
|
|
744
|
+
const missingCandidate = error && error.code === "MODULE_NOT_FOUND" && typeof error.message === "string" && error.message.includes("'" + candidate + "'");
|
|
745
|
+
if (!missingCandidate) {
|
|
746
|
+
throw error;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
736
750
|
}
|
|
737
751
|
|
|
738
752
|
return require(id);
|
|
@@ -1036,22 +1050,64 @@ function normalizeClientManifest(manifest, options) {
|
|
|
1036
1050
|
}
|
|
1037
1051
|
function createServerConsumerManifest(manifest) {
|
|
1038
1052
|
const consumerManifest = {};
|
|
1053
|
+
const normalizeWorkerModuleId = (requestKey, rawModuleId) => {
|
|
1054
|
+
if (typeof rawModuleId === "string" && rawModuleId.trim() !== "") {
|
|
1055
|
+
return rawModuleId;
|
|
1056
|
+
}
|
|
1057
|
+
if (typeof rawModuleId !== "number" || !Number.isFinite(rawModuleId)) {
|
|
1058
|
+
return null;
|
|
1059
|
+
}
|
|
1060
|
+
if (!requestKey || requestKey.trim() === "") {
|
|
1061
|
+
return String(rawModuleId);
|
|
1062
|
+
}
|
|
1063
|
+
if (requestKey.startsWith("file://")) {
|
|
1064
|
+
try {
|
|
1065
|
+
return (0, import_node_url.fileURLToPath)(requestKey);
|
|
1066
|
+
} catch {
|
|
1067
|
+
return String(rawModuleId);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
if (requestKey.startsWith("/")) {
|
|
1071
|
+
return requestKey;
|
|
1072
|
+
}
|
|
1073
|
+
if (requestKey.startsWith("./")) {
|
|
1074
|
+
return requestKey;
|
|
1075
|
+
}
|
|
1076
|
+
if (requestKey.startsWith("node_modules/") || requestKey.startsWith("build/")) {
|
|
1077
|
+
return `./${requestKey}`;
|
|
1078
|
+
}
|
|
1079
|
+
return requestKey;
|
|
1080
|
+
};
|
|
1081
|
+
const addReference = (lookupKey, reference) => {
|
|
1082
|
+
if (!lookupKey || lookupKey.trim() === "") {
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
if (lookupKey in consumerManifest) {
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
consumerManifest[lookupKey] = {
|
|
1089
|
+
"*": reference
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1039
1092
|
for (const [key, value] of Object.entries(manifest)) {
|
|
1040
1093
|
if (!value || typeof value !== "object") {
|
|
1041
1094
|
continue;
|
|
1042
1095
|
}
|
|
1043
1096
|
const entry = value;
|
|
1044
|
-
|
|
1097
|
+
const workerModuleId = normalizeWorkerModuleId(key, entry.id);
|
|
1098
|
+
if (!workerModuleId) {
|
|
1045
1099
|
continue;
|
|
1046
1100
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
...entry.async ? { async: entry.async } : {}
|
|
1053
|
-
}
|
|
1101
|
+
const reference = {
|
|
1102
|
+
id: workerModuleId,
|
|
1103
|
+
chunks: Array.isArray(entry.chunks) ? entry.chunks : [],
|
|
1104
|
+
name: entry.name ?? "*",
|
|
1105
|
+
...entry.async ? { async: entry.async } : {}
|
|
1054
1106
|
};
|
|
1107
|
+
addReference(key, reference);
|
|
1108
|
+
if (typeof entry.id === "number" && Number.isFinite(entry.id)) {
|
|
1109
|
+
addReference(String(entry.id), reference);
|
|
1110
|
+
}
|
|
1055
1111
|
}
|
|
1056
1112
|
return consumerManifest;
|
|
1057
1113
|
}
|
package/dist/http.js
CHANGED
|
@@ -707,7 +707,21 @@ globalThis.__webpack_require__ = function __webframezNodeRequire(id) {
|
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
if (id.startsWith("./")) {
|
|
710
|
-
|
|
710
|
+
const relativeId = id.slice(2);
|
|
711
|
+
const candidates = [
|
|
712
|
+
path.resolve(process.cwd(), relativeId),
|
|
713
|
+
path.resolve(process.cwd(), "..", relativeId)
|
|
714
|
+
];
|
|
715
|
+
for (const candidate of candidates) {
|
|
716
|
+
try {
|
|
717
|
+
return require(candidate);
|
|
718
|
+
} catch (error) {
|
|
719
|
+
const missingCandidate = error && error.code === "MODULE_NOT_FOUND" && typeof error.message === "string" && error.message.includes("'" + candidate + "'");
|
|
720
|
+
if (!missingCandidate) {
|
|
721
|
+
throw error;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
711
725
|
}
|
|
712
726
|
|
|
713
727
|
return require(id);
|
|
@@ -1011,22 +1025,64 @@ function normalizeClientManifest(manifest, options) {
|
|
|
1011
1025
|
}
|
|
1012
1026
|
function createServerConsumerManifest(manifest) {
|
|
1013
1027
|
const consumerManifest = {};
|
|
1028
|
+
const normalizeWorkerModuleId = (requestKey, rawModuleId) => {
|
|
1029
|
+
if (typeof rawModuleId === "string" && rawModuleId.trim() !== "") {
|
|
1030
|
+
return rawModuleId;
|
|
1031
|
+
}
|
|
1032
|
+
if (typeof rawModuleId !== "number" || !Number.isFinite(rawModuleId)) {
|
|
1033
|
+
return null;
|
|
1034
|
+
}
|
|
1035
|
+
if (!requestKey || requestKey.trim() === "") {
|
|
1036
|
+
return String(rawModuleId);
|
|
1037
|
+
}
|
|
1038
|
+
if (requestKey.startsWith("file://")) {
|
|
1039
|
+
try {
|
|
1040
|
+
return fileURLToPath(requestKey);
|
|
1041
|
+
} catch {
|
|
1042
|
+
return String(rawModuleId);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
if (requestKey.startsWith("/")) {
|
|
1046
|
+
return requestKey;
|
|
1047
|
+
}
|
|
1048
|
+
if (requestKey.startsWith("./")) {
|
|
1049
|
+
return requestKey;
|
|
1050
|
+
}
|
|
1051
|
+
if (requestKey.startsWith("node_modules/") || requestKey.startsWith("build/")) {
|
|
1052
|
+
return `./${requestKey}`;
|
|
1053
|
+
}
|
|
1054
|
+
return requestKey;
|
|
1055
|
+
};
|
|
1056
|
+
const addReference = (lookupKey, reference) => {
|
|
1057
|
+
if (!lookupKey || lookupKey.trim() === "") {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
if (lookupKey in consumerManifest) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
consumerManifest[lookupKey] = {
|
|
1064
|
+
"*": reference
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1014
1067
|
for (const [key, value] of Object.entries(manifest)) {
|
|
1015
1068
|
if (!value || typeof value !== "object") {
|
|
1016
1069
|
continue;
|
|
1017
1070
|
}
|
|
1018
1071
|
const entry = value;
|
|
1019
|
-
|
|
1072
|
+
const workerModuleId = normalizeWorkerModuleId(key, entry.id);
|
|
1073
|
+
if (!workerModuleId) {
|
|
1020
1074
|
continue;
|
|
1021
1075
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
...entry.async ? { async: entry.async } : {}
|
|
1028
|
-
}
|
|
1076
|
+
const reference = {
|
|
1077
|
+
id: workerModuleId,
|
|
1078
|
+
chunks: Array.isArray(entry.chunks) ? entry.chunks : [],
|
|
1079
|
+
name: entry.name ?? "*",
|
|
1080
|
+
...entry.async ? { async: entry.async } : {}
|
|
1029
1081
|
};
|
|
1082
|
+
addReference(key, reference);
|
|
1083
|
+
if (typeof entry.id === "number" && Number.isFinite(entry.id)) {
|
|
1084
|
+
addReference(String(entry.id), reference);
|
|
1085
|
+
}
|
|
1030
1086
|
}
|
|
1031
1087
|
return consumerManifest;
|
|
1032
1088
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -769,7 +769,21 @@ globalThis.__webpack_require__ = function __webframezNodeRequire(id) {
|
|
|
769
769
|
}
|
|
770
770
|
|
|
771
771
|
if (id.startsWith("./")) {
|
|
772
|
-
|
|
772
|
+
const relativeId = id.slice(2);
|
|
773
|
+
const candidates = [
|
|
774
|
+
path.resolve(process.cwd(), relativeId),
|
|
775
|
+
path.resolve(process.cwd(), "..", relativeId)
|
|
776
|
+
];
|
|
777
|
+
for (const candidate of candidates) {
|
|
778
|
+
try {
|
|
779
|
+
return require(candidate);
|
|
780
|
+
} catch (error) {
|
|
781
|
+
const missingCandidate = error && error.code === "MODULE_NOT_FOUND" && typeof error.message === "string" && error.message.includes("'" + candidate + "'");
|
|
782
|
+
if (!missingCandidate) {
|
|
783
|
+
throw error;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
773
787
|
}
|
|
774
788
|
|
|
775
789
|
return require(id);
|
|
@@ -1073,22 +1087,64 @@ function normalizeClientManifest(manifest, options) {
|
|
|
1073
1087
|
}
|
|
1074
1088
|
function createServerConsumerManifest(manifest) {
|
|
1075
1089
|
const consumerManifest = {};
|
|
1090
|
+
const normalizeWorkerModuleId = (requestKey, rawModuleId) => {
|
|
1091
|
+
if (typeof rawModuleId === "string" && rawModuleId.trim() !== "") {
|
|
1092
|
+
return rawModuleId;
|
|
1093
|
+
}
|
|
1094
|
+
if (typeof rawModuleId !== "number" || !Number.isFinite(rawModuleId)) {
|
|
1095
|
+
return null;
|
|
1096
|
+
}
|
|
1097
|
+
if (!requestKey || requestKey.trim() === "") {
|
|
1098
|
+
return String(rawModuleId);
|
|
1099
|
+
}
|
|
1100
|
+
if (requestKey.startsWith("file://")) {
|
|
1101
|
+
try {
|
|
1102
|
+
return (0, import_node_url.fileURLToPath)(requestKey);
|
|
1103
|
+
} catch {
|
|
1104
|
+
return String(rawModuleId);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
if (requestKey.startsWith("/")) {
|
|
1108
|
+
return requestKey;
|
|
1109
|
+
}
|
|
1110
|
+
if (requestKey.startsWith("./")) {
|
|
1111
|
+
return requestKey;
|
|
1112
|
+
}
|
|
1113
|
+
if (requestKey.startsWith("node_modules/") || requestKey.startsWith("build/")) {
|
|
1114
|
+
return `./${requestKey}`;
|
|
1115
|
+
}
|
|
1116
|
+
return requestKey;
|
|
1117
|
+
};
|
|
1118
|
+
const addReference = (lookupKey, reference) => {
|
|
1119
|
+
if (!lookupKey || lookupKey.trim() === "") {
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
if (lookupKey in consumerManifest) {
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
consumerManifest[lookupKey] = {
|
|
1126
|
+
"*": reference
|
|
1127
|
+
};
|
|
1128
|
+
};
|
|
1076
1129
|
for (const [key, value] of Object.entries(manifest)) {
|
|
1077
1130
|
if (!value || typeof value !== "object") {
|
|
1078
1131
|
continue;
|
|
1079
1132
|
}
|
|
1080
1133
|
const entry = value;
|
|
1081
|
-
|
|
1134
|
+
const workerModuleId = normalizeWorkerModuleId(key, entry.id);
|
|
1135
|
+
if (!workerModuleId) {
|
|
1082
1136
|
continue;
|
|
1083
1137
|
}
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
...entry.async ? { async: entry.async } : {}
|
|
1090
|
-
}
|
|
1138
|
+
const reference = {
|
|
1139
|
+
id: workerModuleId,
|
|
1140
|
+
chunks: Array.isArray(entry.chunks) ? entry.chunks : [],
|
|
1141
|
+
name: entry.name ?? "*",
|
|
1142
|
+
...entry.async ? { async: entry.async } : {}
|
|
1091
1143
|
};
|
|
1144
|
+
addReference(key, reference);
|
|
1145
|
+
if (typeof entry.id === "number" && Number.isFinite(entry.id)) {
|
|
1146
|
+
addReference(String(entry.id), reference);
|
|
1147
|
+
}
|
|
1092
1148
|
}
|
|
1093
1149
|
return consumerManifest;
|
|
1094
1150
|
}
|
package/dist/index.js
CHANGED
|
@@ -733,7 +733,21 @@ globalThis.__webpack_require__ = function __webframezNodeRequire(id) {
|
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
if (id.startsWith("./")) {
|
|
736
|
-
|
|
736
|
+
const relativeId = id.slice(2);
|
|
737
|
+
const candidates = [
|
|
738
|
+
path.resolve(process.cwd(), relativeId),
|
|
739
|
+
path.resolve(process.cwd(), "..", relativeId)
|
|
740
|
+
];
|
|
741
|
+
for (const candidate of candidates) {
|
|
742
|
+
try {
|
|
743
|
+
return require(candidate);
|
|
744
|
+
} catch (error) {
|
|
745
|
+
const missingCandidate = error && error.code === "MODULE_NOT_FOUND" && typeof error.message === "string" && error.message.includes("'" + candidate + "'");
|
|
746
|
+
if (!missingCandidate) {
|
|
747
|
+
throw error;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
737
751
|
}
|
|
738
752
|
|
|
739
753
|
return require(id);
|
|
@@ -1037,22 +1051,64 @@ function normalizeClientManifest(manifest, options) {
|
|
|
1037
1051
|
}
|
|
1038
1052
|
function createServerConsumerManifest(manifest) {
|
|
1039
1053
|
const consumerManifest = {};
|
|
1054
|
+
const normalizeWorkerModuleId = (requestKey, rawModuleId) => {
|
|
1055
|
+
if (typeof rawModuleId === "string" && rawModuleId.trim() !== "") {
|
|
1056
|
+
return rawModuleId;
|
|
1057
|
+
}
|
|
1058
|
+
if (typeof rawModuleId !== "number" || !Number.isFinite(rawModuleId)) {
|
|
1059
|
+
return null;
|
|
1060
|
+
}
|
|
1061
|
+
if (!requestKey || requestKey.trim() === "") {
|
|
1062
|
+
return String(rawModuleId);
|
|
1063
|
+
}
|
|
1064
|
+
if (requestKey.startsWith("file://")) {
|
|
1065
|
+
try {
|
|
1066
|
+
return fileURLToPath(requestKey);
|
|
1067
|
+
} catch {
|
|
1068
|
+
return String(rawModuleId);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
if (requestKey.startsWith("/")) {
|
|
1072
|
+
return requestKey;
|
|
1073
|
+
}
|
|
1074
|
+
if (requestKey.startsWith("./")) {
|
|
1075
|
+
return requestKey;
|
|
1076
|
+
}
|
|
1077
|
+
if (requestKey.startsWith("node_modules/") || requestKey.startsWith("build/")) {
|
|
1078
|
+
return `./${requestKey}`;
|
|
1079
|
+
}
|
|
1080
|
+
return requestKey;
|
|
1081
|
+
};
|
|
1082
|
+
const addReference = (lookupKey, reference) => {
|
|
1083
|
+
if (!lookupKey || lookupKey.trim() === "") {
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
if (lookupKey in consumerManifest) {
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1089
|
+
consumerManifest[lookupKey] = {
|
|
1090
|
+
"*": reference
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1040
1093
|
for (const [key, value] of Object.entries(manifest)) {
|
|
1041
1094
|
if (!value || typeof value !== "object") {
|
|
1042
1095
|
continue;
|
|
1043
1096
|
}
|
|
1044
1097
|
const entry = value;
|
|
1045
|
-
|
|
1098
|
+
const workerModuleId = normalizeWorkerModuleId(key, entry.id);
|
|
1099
|
+
if (!workerModuleId) {
|
|
1046
1100
|
continue;
|
|
1047
1101
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
...entry.async ? { async: entry.async } : {}
|
|
1054
|
-
}
|
|
1102
|
+
const reference = {
|
|
1103
|
+
id: workerModuleId,
|
|
1104
|
+
chunks: Array.isArray(entry.chunks) ? entry.chunks : [],
|
|
1105
|
+
name: entry.name ?? "*",
|
|
1106
|
+
...entry.async ? { async: entry.async } : {}
|
|
1055
1107
|
};
|
|
1108
|
+
addReference(key, reference);
|
|
1109
|
+
if (typeof entry.id === "number" && Number.isFinite(entry.id)) {
|
|
1110
|
+
addReference(String(entry.id), reference);
|
|
1111
|
+
}
|
|
1056
1112
|
}
|
|
1057
1113
|
return consumerManifest;
|
|
1058
1114
|
}
|
package/dist/webframez-core.cjs
CHANGED
|
@@ -735,7 +735,21 @@ globalThis.__webpack_require__ = function __webframezNodeRequire(id) {
|
|
|
735
735
|
}
|
|
736
736
|
|
|
737
737
|
if (id.startsWith("./")) {
|
|
738
|
-
|
|
738
|
+
const relativeId = id.slice(2);
|
|
739
|
+
const candidates = [
|
|
740
|
+
path.resolve(process.cwd(), relativeId),
|
|
741
|
+
path.resolve(process.cwd(), "..", relativeId)
|
|
742
|
+
];
|
|
743
|
+
for (const candidate of candidates) {
|
|
744
|
+
try {
|
|
745
|
+
return require(candidate);
|
|
746
|
+
} catch (error) {
|
|
747
|
+
const missingCandidate = error && error.code === "MODULE_NOT_FOUND" && typeof error.message === "string" && error.message.includes("'" + candidate + "'");
|
|
748
|
+
if (!missingCandidate) {
|
|
749
|
+
throw error;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
739
753
|
}
|
|
740
754
|
|
|
741
755
|
return require(id);
|
|
@@ -1039,22 +1053,64 @@ function normalizeClientManifest(manifest, options) {
|
|
|
1039
1053
|
}
|
|
1040
1054
|
function createServerConsumerManifest(manifest) {
|
|
1041
1055
|
const consumerManifest = {};
|
|
1056
|
+
const normalizeWorkerModuleId = (requestKey, rawModuleId) => {
|
|
1057
|
+
if (typeof rawModuleId === "string" && rawModuleId.trim() !== "") {
|
|
1058
|
+
return rawModuleId;
|
|
1059
|
+
}
|
|
1060
|
+
if (typeof rawModuleId !== "number" || !Number.isFinite(rawModuleId)) {
|
|
1061
|
+
return null;
|
|
1062
|
+
}
|
|
1063
|
+
if (!requestKey || requestKey.trim() === "") {
|
|
1064
|
+
return String(rawModuleId);
|
|
1065
|
+
}
|
|
1066
|
+
if (requestKey.startsWith("file://")) {
|
|
1067
|
+
try {
|
|
1068
|
+
return (0, import_node_url.fileURLToPath)(requestKey);
|
|
1069
|
+
} catch {
|
|
1070
|
+
return String(rawModuleId);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
if (requestKey.startsWith("/")) {
|
|
1074
|
+
return requestKey;
|
|
1075
|
+
}
|
|
1076
|
+
if (requestKey.startsWith("./")) {
|
|
1077
|
+
return requestKey;
|
|
1078
|
+
}
|
|
1079
|
+
if (requestKey.startsWith("node_modules/") || requestKey.startsWith("build/")) {
|
|
1080
|
+
return `./${requestKey}`;
|
|
1081
|
+
}
|
|
1082
|
+
return requestKey;
|
|
1083
|
+
};
|
|
1084
|
+
const addReference = (lookupKey, reference) => {
|
|
1085
|
+
if (!lookupKey || lookupKey.trim() === "") {
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
if (lookupKey in consumerManifest) {
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
consumerManifest[lookupKey] = {
|
|
1092
|
+
"*": reference
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1042
1095
|
for (const [key, value] of Object.entries(manifest)) {
|
|
1043
1096
|
if (!value || typeof value !== "object") {
|
|
1044
1097
|
continue;
|
|
1045
1098
|
}
|
|
1046
1099
|
const entry = value;
|
|
1047
|
-
|
|
1100
|
+
const workerModuleId = normalizeWorkerModuleId(key, entry.id);
|
|
1101
|
+
if (!workerModuleId) {
|
|
1048
1102
|
continue;
|
|
1049
1103
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
...entry.async ? { async: entry.async } : {}
|
|
1056
|
-
}
|
|
1104
|
+
const reference = {
|
|
1105
|
+
id: workerModuleId,
|
|
1106
|
+
chunks: Array.isArray(entry.chunks) ? entry.chunks : [],
|
|
1107
|
+
name: entry.name ?? "*",
|
|
1108
|
+
...entry.async ? { async: entry.async } : {}
|
|
1057
1109
|
};
|
|
1110
|
+
addReference(key, reference);
|
|
1111
|
+
if (typeof entry.id === "number" && Number.isFinite(entry.id)) {
|
|
1112
|
+
addReference(String(entry.id), reference);
|
|
1113
|
+
}
|
|
1058
1114
|
}
|
|
1059
1115
|
return consumerManifest;
|
|
1060
1116
|
}
|
package/dist/webframez-core.js
CHANGED
|
@@ -707,7 +707,21 @@ globalThis.__webpack_require__ = function __webframezNodeRequire(id) {
|
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
if (id.startsWith("./")) {
|
|
710
|
-
|
|
710
|
+
const relativeId = id.slice(2);
|
|
711
|
+
const candidates = [
|
|
712
|
+
path.resolve(process.cwd(), relativeId),
|
|
713
|
+
path.resolve(process.cwd(), "..", relativeId)
|
|
714
|
+
];
|
|
715
|
+
for (const candidate of candidates) {
|
|
716
|
+
try {
|
|
717
|
+
return require(candidate);
|
|
718
|
+
} catch (error) {
|
|
719
|
+
const missingCandidate = error && error.code === "MODULE_NOT_FOUND" && typeof error.message === "string" && error.message.includes("'" + candidate + "'");
|
|
720
|
+
if (!missingCandidate) {
|
|
721
|
+
throw error;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
711
725
|
}
|
|
712
726
|
|
|
713
727
|
return require(id);
|
|
@@ -1011,22 +1025,64 @@ function normalizeClientManifest(manifest, options) {
|
|
|
1011
1025
|
}
|
|
1012
1026
|
function createServerConsumerManifest(manifest) {
|
|
1013
1027
|
const consumerManifest = {};
|
|
1028
|
+
const normalizeWorkerModuleId = (requestKey, rawModuleId) => {
|
|
1029
|
+
if (typeof rawModuleId === "string" && rawModuleId.trim() !== "") {
|
|
1030
|
+
return rawModuleId;
|
|
1031
|
+
}
|
|
1032
|
+
if (typeof rawModuleId !== "number" || !Number.isFinite(rawModuleId)) {
|
|
1033
|
+
return null;
|
|
1034
|
+
}
|
|
1035
|
+
if (!requestKey || requestKey.trim() === "") {
|
|
1036
|
+
return String(rawModuleId);
|
|
1037
|
+
}
|
|
1038
|
+
if (requestKey.startsWith("file://")) {
|
|
1039
|
+
try {
|
|
1040
|
+
return fileURLToPath(requestKey);
|
|
1041
|
+
} catch {
|
|
1042
|
+
return String(rawModuleId);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
if (requestKey.startsWith("/")) {
|
|
1046
|
+
return requestKey;
|
|
1047
|
+
}
|
|
1048
|
+
if (requestKey.startsWith("./")) {
|
|
1049
|
+
return requestKey;
|
|
1050
|
+
}
|
|
1051
|
+
if (requestKey.startsWith("node_modules/") || requestKey.startsWith("build/")) {
|
|
1052
|
+
return `./${requestKey}`;
|
|
1053
|
+
}
|
|
1054
|
+
return requestKey;
|
|
1055
|
+
};
|
|
1056
|
+
const addReference = (lookupKey, reference) => {
|
|
1057
|
+
if (!lookupKey || lookupKey.trim() === "") {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
if (lookupKey in consumerManifest) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
consumerManifest[lookupKey] = {
|
|
1064
|
+
"*": reference
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1014
1067
|
for (const [key, value] of Object.entries(manifest)) {
|
|
1015
1068
|
if (!value || typeof value !== "object") {
|
|
1016
1069
|
continue;
|
|
1017
1070
|
}
|
|
1018
1071
|
const entry = value;
|
|
1019
|
-
|
|
1072
|
+
const workerModuleId = normalizeWorkerModuleId(key, entry.id);
|
|
1073
|
+
if (!workerModuleId) {
|
|
1020
1074
|
continue;
|
|
1021
1075
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
...entry.async ? { async: entry.async } : {}
|
|
1028
|
-
}
|
|
1076
|
+
const reference = {
|
|
1077
|
+
id: workerModuleId,
|
|
1078
|
+
chunks: Array.isArray(entry.chunks) ? entry.chunks : [],
|
|
1079
|
+
name: entry.name ?? "*",
|
|
1080
|
+
...entry.async ? { async: entry.async } : {}
|
|
1029
1081
|
};
|
|
1082
|
+
addReference(key, reference);
|
|
1083
|
+
if (typeof entry.id === "number" && Number.isFinite(entry.id)) {
|
|
1084
|
+
addReference(String(entry.id), reference);
|
|
1085
|
+
}
|
|
1030
1086
|
}
|
|
1031
1087
|
return consumerManifest;
|
|
1032
1088
|
}
|