@valbuild/server 0.82.0 → 0.84.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.
@@ -954,8 +954,6 @@ globalThis.valModule = {
954
954
  (valModule === null || valModule === void 0 ? void 0 : valModule.path) !== undefined || (valModule === null || valModule === void 0 ? void 0 : valModule.schema) !== undefined || (valModule === null || valModule === void 0 ? void 0 : valModule.source) !== undefined) {
955
955
  if (valModule.path !== moduleFilePath) {
956
956
  fatalErrors.push(`Wrong c.define path! Expected: '${moduleFilePath}', found: '${valModule.path}'`);
957
- } else if (encodeURIComponent(valModule.path).replace(/%2F/g, "/") !== valModule.path) {
958
- fatalErrors.push(`Invalid c.define path! Must be a web-safe path without escape characters, found: '${valModule.path}', which was encoded as: '${encodeURIComponent(valModule.path).replace("%2F", "/")}'`);
959
957
  } else if ((valModule === null || valModule === void 0 ? void 0 : valModule.schema) === undefined && options.schema) {
960
958
  fatalErrors.push(`Expected val path: '${moduleFilePath}' to have a schema`);
961
959
  } else if ((valModule === null || valModule === void 0 ? void 0 : valModule.source) === undefined && options.source) {
@@ -1722,15 +1720,15 @@ class ValOps {
1722
1720
  };
1723
1721
  }
1724
1722
 
1725
- // #region getPreviews
1726
- async getPreviews(schemas, sources) {
1727
- const previews = {};
1723
+ // #region getRenders
1724
+ async getRenders(schemas, sources) {
1725
+ const renders = {};
1728
1726
  for (const [pathS, schema] of Object.entries(schemas)) {
1729
1727
  const path = pathS;
1730
- previews[path] = schema["executePreview"](path, sources[path]);
1728
+ renders[path] = schema["executeRender"](path, sources[path]);
1731
1729
  }
1732
1730
  return {
1733
- previews
1731
+ renders
1734
1732
  };
1735
1733
  }
1736
1734
 
@@ -5641,7 +5639,7 @@ const ValServer = (valModules, options, callbacks) => {
5641
5639
  ...(onlyPatchedTreeModules.errors || {})
5642
5640
  }
5643
5641
  };
5644
- const previewsRes = await serverOps.getPreviews(schemasRes, sourcesRes.sources);
5642
+ const renderRes = await serverOps.getRenders(schemasRes, sourcesRes.sources);
5645
5643
  let sourcesValidation = {
5646
5644
  errors: {},
5647
5645
  files: {},
@@ -5688,7 +5686,7 @@ const ValServer = (valModules, options, callbacks) => {
5688
5686
  }
5689
5687
  modules[moduleFilePath] = {
5690
5688
  source: module,
5691
- preview: previewsRes.previews[moduleFilePath] || null,
5689
+ render: renderRes.renders[moduleFilePath] || null,
5692
5690
  patches: appliedPatches.length > 0 || skippedPatches.length > 0 || Object.keys(patchErrors).length > 0 ? {
5693
5691
  applied: appliedPatches,
5694
5692
  skipped: skippedPatches.length > 0 ? skippedPatches : undefined,
@@ -954,8 +954,6 @@ globalThis.valModule = {
954
954
  (valModule === null || valModule === void 0 ? void 0 : valModule.path) !== undefined || (valModule === null || valModule === void 0 ? void 0 : valModule.schema) !== undefined || (valModule === null || valModule === void 0 ? void 0 : valModule.source) !== undefined) {
955
955
  if (valModule.path !== moduleFilePath) {
956
956
  fatalErrors.push(`Wrong c.define path! Expected: '${moduleFilePath}', found: '${valModule.path}'`);
957
- } else if (encodeURIComponent(valModule.path).replace(/%2F/g, "/") !== valModule.path) {
958
- fatalErrors.push(`Invalid c.define path! Must be a web-safe path without escape characters, found: '${valModule.path}', which was encoded as: '${encodeURIComponent(valModule.path).replace("%2F", "/")}'`);
959
957
  } else if ((valModule === null || valModule === void 0 ? void 0 : valModule.schema) === undefined && options.schema) {
960
958
  fatalErrors.push(`Expected val path: '${moduleFilePath}' to have a schema`);
961
959
  } else if ((valModule === null || valModule === void 0 ? void 0 : valModule.source) === undefined && options.source) {
@@ -1722,15 +1720,15 @@ class ValOps {
1722
1720
  };
1723
1721
  }
1724
1722
 
1725
- // #region getPreviews
1726
- async getPreviews(schemas, sources) {
1727
- const previews = {};
1723
+ // #region getRenders
1724
+ async getRenders(schemas, sources) {
1725
+ const renders = {};
1728
1726
  for (const [pathS, schema] of Object.entries(schemas)) {
1729
1727
  const path = pathS;
1730
- previews[path] = schema["executePreview"](path, sources[path]);
1728
+ renders[path] = schema["executeRender"](path, sources[path]);
1731
1729
  }
1732
1730
  return {
1733
- previews
1731
+ renders
1734
1732
  };
1735
1733
  }
1736
1734
 
@@ -5641,7 +5639,7 @@ const ValServer = (valModules, options, callbacks) => {
5641
5639
  ...(onlyPatchedTreeModules.errors || {})
5642
5640
  }
5643
5641
  };
5644
- const previewsRes = await serverOps.getPreviews(schemasRes, sourcesRes.sources);
5642
+ const renderRes = await serverOps.getRenders(schemasRes, sourcesRes.sources);
5645
5643
  let sourcesValidation = {
5646
5644
  errors: {},
5647
5645
  files: {},
@@ -5688,7 +5686,7 @@ const ValServer = (valModules, options, callbacks) => {
5688
5686
  }
5689
5687
  modules[moduleFilePath] = {
5690
5688
  source: module,
5691
- preview: previewsRes.previews[moduleFilePath] || null,
5689
+ render: renderRes.renders[moduleFilePath] || null,
5692
5690
  patches: appliedPatches.length > 0 || skippedPatches.length > 0 || Object.keys(patchErrors).length > 0 ? {
5693
5691
  applied: appliedPatches,
5694
5692
  skipped: skippedPatches.length > 0 ? skippedPatches : undefined,
@@ -923,8 +923,6 @@ globalThis.valModule = {
923
923
  (valModule === null || valModule === void 0 ? void 0 : valModule.path) !== undefined || (valModule === null || valModule === void 0 ? void 0 : valModule.schema) !== undefined || (valModule === null || valModule === void 0 ? void 0 : valModule.source) !== undefined) {
924
924
  if (valModule.path !== moduleFilePath) {
925
925
  fatalErrors.push(`Wrong c.define path! Expected: '${moduleFilePath}', found: '${valModule.path}'`);
926
- } else if (encodeURIComponent(valModule.path).replace(/%2F/g, "/") !== valModule.path) {
927
- fatalErrors.push(`Invalid c.define path! Must be a web-safe path without escape characters, found: '${valModule.path}', which was encoded as: '${encodeURIComponent(valModule.path).replace("%2F", "/")}'`);
928
926
  } else if ((valModule === null || valModule === void 0 ? void 0 : valModule.schema) === undefined && options.schema) {
929
927
  fatalErrors.push(`Expected val path: '${moduleFilePath}' to have a schema`);
930
928
  } else if ((valModule === null || valModule === void 0 ? void 0 : valModule.source) === undefined && options.source) {
@@ -1691,15 +1689,15 @@ class ValOps {
1691
1689
  };
1692
1690
  }
1693
1691
 
1694
- // #region getPreviews
1695
- async getPreviews(schemas, sources) {
1696
- const previews = {};
1692
+ // #region getRenders
1693
+ async getRenders(schemas, sources) {
1694
+ const renders = {};
1697
1695
  for (const [pathS, schema] of Object.entries(schemas)) {
1698
1696
  const path = pathS;
1699
- previews[path] = schema["executePreview"](path, sources[path]);
1697
+ renders[path] = schema["executeRender"](path, sources[path]);
1700
1698
  }
1701
1699
  return {
1702
- previews
1700
+ renders
1703
1701
  };
1704
1702
  }
1705
1703
 
@@ -5610,7 +5608,7 @@ const ValServer = (valModules, options, callbacks) => {
5610
5608
  ...(onlyPatchedTreeModules.errors || {})
5611
5609
  }
5612
5610
  };
5613
- const previewsRes = await serverOps.getPreviews(schemasRes, sourcesRes.sources);
5611
+ const renderRes = await serverOps.getRenders(schemasRes, sourcesRes.sources);
5614
5612
  let sourcesValidation = {
5615
5613
  errors: {},
5616
5614
  files: {},
@@ -5657,7 +5655,7 @@ const ValServer = (valModules, options, callbacks) => {
5657
5655
  }
5658
5656
  modules[moduleFilePath] = {
5659
5657
  source: module,
5660
- preview: previewsRes.previews[moduleFilePath] || null,
5658
+ render: renderRes.renders[moduleFilePath] || null,
5661
5659
  patches: appliedPatches.length > 0 || skippedPatches.length > 0 || Object.keys(patchErrors).length > 0 ? {
5662
5660
  applied: appliedPatches,
5663
5661
  skipped: skippedPatches.length > 0 ? skippedPatches : undefined,
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.82.0",
15
+ "version": "0.84.0",
16
16
  "scripts": {
17
17
  "typecheck": "tsc --noEmit",
18
18
  "test": "jest",
@@ -23,9 +23,9 @@
23
23
  "@types/jest": "^29.2.5"
24
24
  },
25
25
  "dependencies": {
26
- "@valbuild/core": "~0.82.0",
27
- "@valbuild/shared": "~0.82.0",
28
- "@valbuild/ui": "~0.82.0",
26
+ "@valbuild/core": "~0.84.0",
27
+ "@valbuild/shared": "~0.84.0",
28
+ "@valbuild/ui": "~0.84.0",
29
29
  "chokidar": "^4.0.1",
30
30
  "image-size": "^1.0.2",
31
31
  "minimatch": "^3.0.4",