@valbuild/shared 0.60.6 → 0.60.8

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.
@@ -2070,13 +2070,25 @@ var ValStore = /*#__PURE__*/function () {
2070
2070
  case 5:
2071
2071
  data = _context.sent;
2072
2072
  if (!fp.result.isOk(data)) {
2073
- _context.next = 19;
2073
+ _context.next = 22;
2074
2074
  break;
2075
2075
  }
2076
+ if (data.value.modules[moduleId]) {
2077
+ _context.next = 10;
2078
+ break;
2079
+ }
2080
+ console.error("Val: could not find the module", {
2081
+ moduleIds: Object.keys(data.value.modules),
2082
+ moduleId: moduleId
2083
+ });
2084
+ return _context.abrupt("return", fp.result.err({
2085
+ message: "Could not fetch data. Could not find the module: " + moduleId + ". Verify that the module id and file name is correct."
2086
+ }));
2087
+ case 10:
2076
2088
  fetchedSource = data.value.modules[moduleId].source;
2077
2089
  fetchedSchema = data.value.modules[moduleId].schema;
2078
2090
  if (!(fetchedSource !== undefined && fetchedSchema !== undefined)) {
2079
- _context.next = 15;
2091
+ _context.next = 18;
2080
2092
  break;
2081
2093
  }
2082
2094
  this.drafts[moduleId] = fetchedSource;
@@ -2085,20 +2097,20 @@ var ValStore = /*#__PURE__*/function () {
2085
2097
  source: fetchedSource,
2086
2098
  schema: fetchedSchema
2087
2099
  }));
2088
- case 15:
2100
+ case 18:
2089
2101
  console.error("Val: could not find the module source");
2090
2102
  return _context.abrupt("return", fp.result.err({
2091
2103
  message: "Could not fetch data. Verify that the module exists."
2092
2104
  }));
2093
- case 17:
2094
- _context.next = 21;
2105
+ case 20:
2106
+ _context.next = 24;
2095
2107
  break;
2096
- case 19:
2108
+ case 22:
2097
2109
  console.error("Val: failed to get module", data.error);
2098
2110
  return _context.abrupt("return", fp.result.err({
2099
2111
  message: "Could not fetch data. Verify that Val is correctly configured."
2100
2112
  }));
2101
- case 21:
2113
+ case 24:
2102
2114
  case "end":
2103
2115
  return _context.stop();
2104
2116
  }
@@ -2070,13 +2070,25 @@ var ValStore = /*#__PURE__*/function () {
2070
2070
  case 5:
2071
2071
  data = _context.sent;
2072
2072
  if (!fp.result.isOk(data)) {
2073
- _context.next = 19;
2073
+ _context.next = 22;
2074
2074
  break;
2075
2075
  }
2076
+ if (data.value.modules[moduleId]) {
2077
+ _context.next = 10;
2078
+ break;
2079
+ }
2080
+ console.error("Val: could not find the module", {
2081
+ moduleIds: Object.keys(data.value.modules),
2082
+ moduleId: moduleId
2083
+ });
2084
+ return _context.abrupt("return", fp.result.err({
2085
+ message: "Could not fetch data. Could not find the module: " + moduleId + ". Verify that the module id and file name is correct."
2086
+ }));
2087
+ case 10:
2076
2088
  fetchedSource = data.value.modules[moduleId].source;
2077
2089
  fetchedSchema = data.value.modules[moduleId].schema;
2078
2090
  if (!(fetchedSource !== undefined && fetchedSchema !== undefined)) {
2079
- _context.next = 15;
2091
+ _context.next = 18;
2080
2092
  break;
2081
2093
  }
2082
2094
  this.drafts[moduleId] = fetchedSource;
@@ -2085,20 +2097,20 @@ var ValStore = /*#__PURE__*/function () {
2085
2097
  source: fetchedSource,
2086
2098
  schema: fetchedSchema
2087
2099
  }));
2088
- case 15:
2100
+ case 18:
2089
2101
  console.error("Val: could not find the module source");
2090
2102
  return _context.abrupt("return", fp.result.err({
2091
2103
  message: "Could not fetch data. Verify that the module exists."
2092
2104
  }));
2093
- case 17:
2094
- _context.next = 21;
2105
+ case 20:
2106
+ _context.next = 24;
2095
2107
  break;
2096
- case 19:
2108
+ case 22:
2097
2109
  console.error("Val: failed to get module", data.error);
2098
2110
  return _context.abrupt("return", fp.result.err({
2099
2111
  message: "Could not fetch data. Verify that Val is correctly configured."
2100
2112
  }));
2101
- case 21:
2113
+ case 24:
2102
2114
  case "end":
2103
2115
  return _context.stop();
2104
2116
  }
@@ -2046,13 +2046,25 @@ var ValStore = /*#__PURE__*/function () {
2046
2046
  case 5:
2047
2047
  data = _context.sent;
2048
2048
  if (!result.isOk(data)) {
2049
- _context.next = 19;
2049
+ _context.next = 22;
2050
2050
  break;
2051
2051
  }
2052
+ if (data.value.modules[moduleId]) {
2053
+ _context.next = 10;
2054
+ break;
2055
+ }
2056
+ console.error("Val: could not find the module", {
2057
+ moduleIds: Object.keys(data.value.modules),
2058
+ moduleId: moduleId
2059
+ });
2060
+ return _context.abrupt("return", result.err({
2061
+ message: "Could not fetch data. Could not find the module: " + moduleId + ". Verify that the module id and file name is correct."
2062
+ }));
2063
+ case 10:
2052
2064
  fetchedSource = data.value.modules[moduleId].source;
2053
2065
  fetchedSchema = data.value.modules[moduleId].schema;
2054
2066
  if (!(fetchedSource !== undefined && fetchedSchema !== undefined)) {
2055
- _context.next = 15;
2067
+ _context.next = 18;
2056
2068
  break;
2057
2069
  }
2058
2070
  this.drafts[moduleId] = fetchedSource;
@@ -2061,20 +2073,20 @@ var ValStore = /*#__PURE__*/function () {
2061
2073
  source: fetchedSource,
2062
2074
  schema: fetchedSchema
2063
2075
  }));
2064
- case 15:
2076
+ case 18:
2065
2077
  console.error("Val: could not find the module source");
2066
2078
  return _context.abrupt("return", result.err({
2067
2079
  message: "Could not fetch data. Verify that the module exists."
2068
2080
  }));
2069
- case 17:
2070
- _context.next = 21;
2081
+ case 20:
2082
+ _context.next = 24;
2071
2083
  break;
2072
- case 19:
2084
+ case 22:
2073
2085
  console.error("Val: failed to get module", data.error);
2074
2086
  return _context.abrupt("return", result.err({
2075
2087
  message: "Could not fetch data. Verify that Val is correctly configured."
2076
2088
  }));
2077
- case 21:
2089
+ case 24:
2078
2090
  case "end":
2079
2091
  return _context.stop();
2080
2092
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/shared",
3
- "version": "0.60.6",
3
+ "version": "0.60.8",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "exports": true
30
30
  },
31
31
  "dependencies": {
32
- "@valbuild/core": "~0.60.6",
32
+ "@valbuild/core": "~0.60.8",
33
33
  "marked": "^9.0.3",
34
34
  "zod": "^3.22.4"
35
35
  },