@webtypen/webframez-react 0.0.40 → 0.0.41

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/http.cjs CHANGED
@@ -965,13 +965,31 @@ globalThis.__webpack_chunk_load__ = function __webframezNoopChunkLoad() {
965
965
  };
966
966
  function normalizeWebframezRequireCandidate(candidate) {
967
967
  const stagingMarker = path.join(".webframez-build", "");
968
- const appMarker = path.join("app", "");
968
+ const runtimeMarkers = [path.join("app", ""), path.join("modules", "")];
969
969
  const stagingIndex = candidate.indexOf(stagingMarker);
970
- const appIndex = candidate.indexOf(appMarker, stagingIndex >= 0 ? stagingIndex : 0);
971
- if (stagingIndex >= 0 && appIndex >= 0) {
972
- const runtimeCandidate = path.resolve(process.cwd(), candidate.slice(appIndex));
973
- if (fs.existsSync(runtimeCandidate)) {
974
- return runtimeCandidate;
970
+ if (stagingIndex >= 0) {
971
+ for (const runtimeMarker of runtimeMarkers) {
972
+ const markerIndex = candidate.indexOf(runtimeMarker, stagingIndex);
973
+ if (markerIndex < 0) {
974
+ continue;
975
+ }
976
+
977
+ const relativeRuntimePath = candidate.slice(markerIndex);
978
+ const runtimeCandidates = [
979
+ path.resolve(process.cwd(), relativeRuntimePath),
980
+ path.resolve(process.cwd(), "build", relativeRuntimePath)
981
+ ];
982
+ const cwdParts = process.cwd().split(path.sep);
983
+ const buildsIndex = cwdParts.lastIndexOf("builds");
984
+ if (buildsIndex > 0) {
985
+ const projectRoot = cwdParts.slice(0, buildsIndex).join(path.sep) || path.sep;
986
+ runtimeCandidates.push(path.resolve(projectRoot, "build", relativeRuntimePath));
987
+ }
988
+
989
+ const runtimeCandidate = runtimeCandidates.find((candidatePath) => fs.existsSync(candidatePath));
990
+ if (runtimeCandidate) {
991
+ return runtimeCandidate;
992
+ }
975
993
  }
976
994
  }
977
995
 
package/dist/http.js CHANGED
@@ -945,13 +945,31 @@ globalThis.__webpack_chunk_load__ = function __webframezNoopChunkLoad() {
945
945
  };
946
946
  function normalizeWebframezRequireCandidate(candidate) {
947
947
  const stagingMarker = path.join(".webframez-build", "");
948
- const appMarker = path.join("app", "");
948
+ const runtimeMarkers = [path.join("app", ""), path.join("modules", "")];
949
949
  const stagingIndex = candidate.indexOf(stagingMarker);
950
- const appIndex = candidate.indexOf(appMarker, stagingIndex >= 0 ? stagingIndex : 0);
951
- if (stagingIndex >= 0 && appIndex >= 0) {
952
- const runtimeCandidate = path.resolve(process.cwd(), candidate.slice(appIndex));
953
- if (fs.existsSync(runtimeCandidate)) {
954
- return runtimeCandidate;
950
+ if (stagingIndex >= 0) {
951
+ for (const runtimeMarker of runtimeMarkers) {
952
+ const markerIndex = candidate.indexOf(runtimeMarker, stagingIndex);
953
+ if (markerIndex < 0) {
954
+ continue;
955
+ }
956
+
957
+ const relativeRuntimePath = candidate.slice(markerIndex);
958
+ const runtimeCandidates = [
959
+ path.resolve(process.cwd(), relativeRuntimePath),
960
+ path.resolve(process.cwd(), "build", relativeRuntimePath)
961
+ ];
962
+ const cwdParts = process.cwd().split(path.sep);
963
+ const buildsIndex = cwdParts.lastIndexOf("builds");
964
+ if (buildsIndex > 0) {
965
+ const projectRoot = cwdParts.slice(0, buildsIndex).join(path.sep) || path.sep;
966
+ runtimeCandidates.push(path.resolve(projectRoot, "build", relativeRuntimePath));
967
+ }
968
+
969
+ const runtimeCandidate = runtimeCandidates.find((candidatePath) => fs.existsSync(candidatePath));
970
+ if (runtimeCandidate) {
971
+ return runtimeCandidate;
972
+ }
955
973
  }
956
974
  }
957
975
 
package/dist/index.cjs CHANGED
@@ -1005,13 +1005,31 @@ globalThis.__webpack_chunk_load__ = function __webframezNoopChunkLoad() {
1005
1005
  };
1006
1006
  function normalizeWebframezRequireCandidate(candidate) {
1007
1007
  const stagingMarker = path.join(".webframez-build", "");
1008
- const appMarker = path.join("app", "");
1008
+ const runtimeMarkers = [path.join("app", ""), path.join("modules", "")];
1009
1009
  const stagingIndex = candidate.indexOf(stagingMarker);
1010
- const appIndex = candidate.indexOf(appMarker, stagingIndex >= 0 ? stagingIndex : 0);
1011
- if (stagingIndex >= 0 && appIndex >= 0) {
1012
- const runtimeCandidate = path.resolve(process.cwd(), candidate.slice(appIndex));
1013
- if (fs.existsSync(runtimeCandidate)) {
1014
- return runtimeCandidate;
1010
+ if (stagingIndex >= 0) {
1011
+ for (const runtimeMarker of runtimeMarkers) {
1012
+ const markerIndex = candidate.indexOf(runtimeMarker, stagingIndex);
1013
+ if (markerIndex < 0) {
1014
+ continue;
1015
+ }
1016
+
1017
+ const relativeRuntimePath = candidate.slice(markerIndex);
1018
+ const runtimeCandidates = [
1019
+ path.resolve(process.cwd(), relativeRuntimePath),
1020
+ path.resolve(process.cwd(), "build", relativeRuntimePath)
1021
+ ];
1022
+ const cwdParts = process.cwd().split(path.sep);
1023
+ const buildsIndex = cwdParts.lastIndexOf("builds");
1024
+ if (buildsIndex > 0) {
1025
+ const projectRoot = cwdParts.slice(0, buildsIndex).join(path.sep) || path.sep;
1026
+ runtimeCandidates.push(path.resolve(projectRoot, "build", relativeRuntimePath));
1027
+ }
1028
+
1029
+ const runtimeCandidate = runtimeCandidates.find((candidatePath) => fs.existsSync(candidatePath));
1030
+ if (runtimeCandidate) {
1031
+ return runtimeCandidate;
1032
+ }
1015
1033
  }
1016
1034
  }
1017
1035
 
package/dist/index.js CHANGED
@@ -971,13 +971,31 @@ globalThis.__webpack_chunk_load__ = function __webframezNoopChunkLoad() {
971
971
  };
972
972
  function normalizeWebframezRequireCandidate(candidate) {
973
973
  const stagingMarker = path.join(".webframez-build", "");
974
- const appMarker = path.join("app", "");
974
+ const runtimeMarkers = [path.join("app", ""), path.join("modules", "")];
975
975
  const stagingIndex = candidate.indexOf(stagingMarker);
976
- const appIndex = candidate.indexOf(appMarker, stagingIndex >= 0 ? stagingIndex : 0);
977
- if (stagingIndex >= 0 && appIndex >= 0) {
978
- const runtimeCandidate = path.resolve(process.cwd(), candidate.slice(appIndex));
979
- if (fs.existsSync(runtimeCandidate)) {
980
- return runtimeCandidate;
976
+ if (stagingIndex >= 0) {
977
+ for (const runtimeMarker of runtimeMarkers) {
978
+ const markerIndex = candidate.indexOf(runtimeMarker, stagingIndex);
979
+ if (markerIndex < 0) {
980
+ continue;
981
+ }
982
+
983
+ const relativeRuntimePath = candidate.slice(markerIndex);
984
+ const runtimeCandidates = [
985
+ path.resolve(process.cwd(), relativeRuntimePath),
986
+ path.resolve(process.cwd(), "build", relativeRuntimePath)
987
+ ];
988
+ const cwdParts = process.cwd().split(path.sep);
989
+ const buildsIndex = cwdParts.lastIndexOf("builds");
990
+ if (buildsIndex > 0) {
991
+ const projectRoot = cwdParts.slice(0, buildsIndex).join(path.sep) || path.sep;
992
+ runtimeCandidates.push(path.resolve(projectRoot, "build", relativeRuntimePath));
993
+ }
994
+
995
+ const runtimeCandidate = runtimeCandidates.find((candidatePath) => fs.existsSync(candidatePath));
996
+ if (runtimeCandidate) {
997
+ return runtimeCandidate;
998
+ }
981
999
  }
982
1000
  }
983
1001
 
@@ -972,13 +972,31 @@ globalThis.__webpack_chunk_load__ = function __webframezNoopChunkLoad() {
972
972
  };
973
973
  function normalizeWebframezRequireCandidate(candidate) {
974
974
  const stagingMarker = path.join(".webframez-build", "");
975
- const appMarker = path.join("app", "");
975
+ const runtimeMarkers = [path.join("app", ""), path.join("modules", "")];
976
976
  const stagingIndex = candidate.indexOf(stagingMarker);
977
- const appIndex = candidate.indexOf(appMarker, stagingIndex >= 0 ? stagingIndex : 0);
978
- if (stagingIndex >= 0 && appIndex >= 0) {
979
- const runtimeCandidate = path.resolve(process.cwd(), candidate.slice(appIndex));
980
- if (fs.existsSync(runtimeCandidate)) {
981
- return runtimeCandidate;
977
+ if (stagingIndex >= 0) {
978
+ for (const runtimeMarker of runtimeMarkers) {
979
+ const markerIndex = candidate.indexOf(runtimeMarker, stagingIndex);
980
+ if (markerIndex < 0) {
981
+ continue;
982
+ }
983
+
984
+ const relativeRuntimePath = candidate.slice(markerIndex);
985
+ const runtimeCandidates = [
986
+ path.resolve(process.cwd(), relativeRuntimePath),
987
+ path.resolve(process.cwd(), "build", relativeRuntimePath)
988
+ ];
989
+ const cwdParts = process.cwd().split(path.sep);
990
+ const buildsIndex = cwdParts.lastIndexOf("builds");
991
+ if (buildsIndex > 0) {
992
+ const projectRoot = cwdParts.slice(0, buildsIndex).join(path.sep) || path.sep;
993
+ runtimeCandidates.push(path.resolve(projectRoot, "build", relativeRuntimePath));
994
+ }
995
+
996
+ const runtimeCandidate = runtimeCandidates.find((candidatePath) => fs.existsSync(candidatePath));
997
+ if (runtimeCandidate) {
998
+ return runtimeCandidate;
999
+ }
982
1000
  }
983
1001
  }
984
1002
 
@@ -948,13 +948,31 @@ globalThis.__webpack_chunk_load__ = function __webframezNoopChunkLoad() {
948
948
  };
949
949
  function normalizeWebframezRequireCandidate(candidate) {
950
950
  const stagingMarker = path.join(".webframez-build", "");
951
- const appMarker = path.join("app", "");
951
+ const runtimeMarkers = [path.join("app", ""), path.join("modules", "")];
952
952
  const stagingIndex = candidate.indexOf(stagingMarker);
953
- const appIndex = candidate.indexOf(appMarker, stagingIndex >= 0 ? stagingIndex : 0);
954
- if (stagingIndex >= 0 && appIndex >= 0) {
955
- const runtimeCandidate = path.resolve(process.cwd(), candidate.slice(appIndex));
956
- if (fs.existsSync(runtimeCandidate)) {
957
- return runtimeCandidate;
953
+ if (stagingIndex >= 0) {
954
+ for (const runtimeMarker of runtimeMarkers) {
955
+ const markerIndex = candidate.indexOf(runtimeMarker, stagingIndex);
956
+ if (markerIndex < 0) {
957
+ continue;
958
+ }
959
+
960
+ const relativeRuntimePath = candidate.slice(markerIndex);
961
+ const runtimeCandidates = [
962
+ path.resolve(process.cwd(), relativeRuntimePath),
963
+ path.resolve(process.cwd(), "build", relativeRuntimePath)
964
+ ];
965
+ const cwdParts = process.cwd().split(path.sep);
966
+ const buildsIndex = cwdParts.lastIndexOf("builds");
967
+ if (buildsIndex > 0) {
968
+ const projectRoot = cwdParts.slice(0, buildsIndex).join(path.sep) || path.sep;
969
+ runtimeCandidates.push(path.resolve(projectRoot, "build", relativeRuntimePath));
970
+ }
971
+
972
+ const runtimeCandidate = runtimeCandidates.find((candidatePath) => fs.existsSync(candidatePath));
973
+ if (runtimeCandidate) {
974
+ return runtimeCandidate;
975
+ }
958
976
  }
959
977
  }
960
978
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-react",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "TypeScript React RSC addition for @webtypen/webframez-core",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "author": {