@valbuild/server 0.36.0 → 0.38.0

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.
@@ -696,7 +696,7 @@ globalThis.valModule = {
696
696
  const fatalErrors = [];
697
697
  if (result.error) {
698
698
  const error = result.error.consume(context.dump);
699
- console.error(`Fatal error reading val file: ${error.message}\n`, error.stack);
699
+ console.error(`Fatal error reading val file: ${id}. Error: ${error.message}\n`, error.stack);
700
700
  return {
701
701
  path: id,
702
702
  errors: {
@@ -951,19 +951,29 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
951
951
  value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };"
952
952
  };
953
953
  }
954
+ if (modulePath.startsWith("next/navigation")) {
955
+ return {
956
+ value: "export const useRouter = () => { throw Error(`Cannot use 'useRouter' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } );"
957
+ };
958
+ }
954
959
  if (modulePath.startsWith("next")) {
955
960
  return {
956
- value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } )"
961
+ value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } );"
962
+ };
963
+ }
964
+ if (modulePath.startsWith("react/jsx-runtime")) {
965
+ return {
966
+ value: "export const jsx = () => { throw Error(`Cannot use 'jsx' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } ); export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
957
967
  };
958
968
  }
959
969
  if (modulePath.startsWith("react")) {
960
970
  return {
961
- value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
971
+ value: "export const useTransition = () => { throw Error(`Cannot use 'useTransition' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } ); export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
962
972
  };
963
973
  }
964
- if (modulePath === "./ValNextProvider") {
974
+ if (modulePath.includes("/ValNextProvider")) {
965
975
  return {
966
- value: "export const ValNextProvider = new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'ValProvider' in this file`) } } } )"
976
+ value: "export const ValNextProvider = new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'ValNextProvider' in this file`) } } } )"
967
977
  };
968
978
  }
969
979
  return {
@@ -991,17 +1001,27 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
991
1001
  value: requestedName
992
1002
  };
993
1003
  }
1004
+ if (requestedName.startsWith("next/navigation")) {
1005
+ return {
1006
+ value: requestedName
1007
+ };
1008
+ }
994
1009
  if (requestedName.startsWith("next")) {
995
1010
  return {
996
1011
  value: requestedName
997
1012
  };
998
1013
  }
1014
+ if (requestedName.startsWith("react/jsx-runtime")) {
1015
+ return {
1016
+ value: requestedName
1017
+ };
1018
+ }
999
1019
  if (requestedName.startsWith("react")) {
1000
1020
  return {
1001
1021
  value: requestedName
1002
1022
  };
1003
1023
  }
1004
- if (requestedName === "./ValNextProvider") {
1024
+ if (requestedName.includes("/ValNextProvider")) {
1005
1025
  return {
1006
1026
  value: requestedName
1007
1027
  };
@@ -696,7 +696,7 @@ globalThis.valModule = {
696
696
  const fatalErrors = [];
697
697
  if (result.error) {
698
698
  const error = result.error.consume(context.dump);
699
- console.error(`Fatal error reading val file: ${error.message}\n`, error.stack);
699
+ console.error(`Fatal error reading val file: ${id}. Error: ${error.message}\n`, error.stack);
700
700
  return {
701
701
  path: id,
702
702
  errors: {
@@ -951,19 +951,29 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
951
951
  value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };"
952
952
  };
953
953
  }
954
+ if (modulePath.startsWith("next/navigation")) {
955
+ return {
956
+ value: "export const useRouter = () => { throw Error(`Cannot use 'useRouter' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } );"
957
+ };
958
+ }
954
959
  if (modulePath.startsWith("next")) {
955
960
  return {
956
- value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } )"
961
+ value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } );"
962
+ };
963
+ }
964
+ if (modulePath.startsWith("react/jsx-runtime")) {
965
+ return {
966
+ value: "export const jsx = () => { throw Error(`Cannot use 'jsx' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } ); export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
957
967
  };
958
968
  }
959
969
  if (modulePath.startsWith("react")) {
960
970
  return {
961
- value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
971
+ value: "export const useTransition = () => { throw Error(`Cannot use 'useTransition' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } ); export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
962
972
  };
963
973
  }
964
- if (modulePath === "./ValNextProvider") {
974
+ if (modulePath.includes("/ValNextProvider")) {
965
975
  return {
966
- value: "export const ValNextProvider = new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'ValProvider' in this file`) } } } )"
976
+ value: "export const ValNextProvider = new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'ValNextProvider' in this file`) } } } )"
967
977
  };
968
978
  }
969
979
  return {
@@ -991,17 +1001,27 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
991
1001
  value: requestedName
992
1002
  };
993
1003
  }
1004
+ if (requestedName.startsWith("next/navigation")) {
1005
+ return {
1006
+ value: requestedName
1007
+ };
1008
+ }
994
1009
  if (requestedName.startsWith("next")) {
995
1010
  return {
996
1011
  value: requestedName
997
1012
  };
998
1013
  }
1014
+ if (requestedName.startsWith("react/jsx-runtime")) {
1015
+ return {
1016
+ value: requestedName
1017
+ };
1018
+ }
999
1019
  if (requestedName.startsWith("react")) {
1000
1020
  return {
1001
1021
  value: requestedName
1002
1022
  };
1003
1023
  }
1004
- if (requestedName === "./ValNextProvider") {
1024
+ if (requestedName.includes("/ValNextProvider")) {
1005
1025
  return {
1006
1026
  value: requestedName
1007
1027
  };
@@ -666,7 +666,7 @@ globalThis.valModule = {
666
666
  const fatalErrors = [];
667
667
  if (result.error) {
668
668
  const error = result.error.consume(context.dump);
669
- console.error(`Fatal error reading val file: ${error.message}\n`, error.stack);
669
+ console.error(`Fatal error reading val file: ${id}. Error: ${error.message}\n`, error.stack);
670
670
  return {
671
671
  path: id,
672
672
  errors: {
@@ -921,19 +921,29 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
921
921
  value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };"
922
922
  };
923
923
  }
924
+ if (modulePath.startsWith("next/navigation")) {
925
+ return {
926
+ value: "export const useRouter = () => { throw Error(`Cannot use 'useRouter' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } );"
927
+ };
928
+ }
924
929
  if (modulePath.startsWith("next")) {
925
930
  return {
926
- value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } )"
931
+ value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } );"
932
+ };
933
+ }
934
+ if (modulePath.startsWith("react/jsx-runtime")) {
935
+ return {
936
+ value: "export const jsx = () => { throw Error(`Cannot use 'jsx' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } ); export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
927
937
  };
928
938
  }
929
939
  if (modulePath.startsWith("react")) {
930
940
  return {
931
- value: "export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
941
+ value: "export const useTransition = () => { throw Error(`Cannot use 'useTransition' in this type of file`) }; export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'next' in this file`) } } } ); export default new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'react' in this file`) } } } )"
932
942
  };
933
943
  }
934
- if (modulePath === "./ValNextProvider") {
944
+ if (modulePath.includes("/ValNextProvider")) {
935
945
  return {
936
- value: "export const ValNextProvider = new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'ValProvider' in this file`) } } } )"
946
+ value: "export const ValNextProvider = new Proxy({}, { get() { return () => { throw new Error(`Cannot import 'ValNextProvider' in this file`) } } } )"
937
947
  };
938
948
  }
939
949
  return {
@@ -961,17 +971,27 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
961
971
  value: requestedName
962
972
  };
963
973
  }
974
+ if (requestedName.startsWith("next/navigation")) {
975
+ return {
976
+ value: requestedName
977
+ };
978
+ }
964
979
  if (requestedName.startsWith("next")) {
965
980
  return {
966
981
  value: requestedName
967
982
  };
968
983
  }
984
+ if (requestedName.startsWith("react/jsx-runtime")) {
985
+ return {
986
+ value: requestedName
987
+ };
988
+ }
969
989
  if (requestedName.startsWith("react")) {
970
990
  return {
971
991
  value: requestedName
972
992
  };
973
993
  }
974
- if (requestedName === "./ValNextProvider") {
994
+ if (requestedName.includes("/ValNextProvider")) {
975
995
  return {
976
996
  value: requestedName
977
997
  };
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "./package.json": "./package.json"
13
13
  },
14
14
  "types": "dist/valbuild-server.cjs.d.ts",
15
- "version": "0.36.0",
15
+ "version": "0.38.0",
16
16
  "scripts": {
17
17
  "typecheck": "tsc --noEmit",
18
18
  "test": "jest",
@@ -24,9 +24,9 @@
24
24
  "concurrently": "^7.6.0"
25
25
  },
26
26
  "dependencies": {
27
- "@valbuild/core": "~0.36.0",
28
- "@valbuild/shared": "~0.36.0",
29
- "@valbuild/ui": "~0.36.0",
27
+ "@valbuild/core": "~0.38.0",
28
+ "@valbuild/shared": "~0.38.0",
29
+ "@valbuild/ui": "~0.38.0",
30
30
  "express": "^4.18.2",
31
31
  "image-size": "^1.0.2",
32
32
  "queue": "^6.0.2",