@valbuild/server 0.77.0 → 0.78.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.
@@ -1721,7 +1721,19 @@ class ValOps {
|
|
1721
1721
|
};
|
1722
1722
|
}
|
1723
1723
|
|
1724
|
-
// #region
|
1724
|
+
// #region getPreviews
|
1725
|
+
async getPreviews(schemas, sources) {
|
1726
|
+
const previews = {};
|
1727
|
+
for (const [pathS, schema] of Object.entries(schemas)) {
|
1728
|
+
const path = pathS;
|
1729
|
+
previews[path] = schema["executePreview"](path, sources[path]);
|
1730
|
+
}
|
1731
|
+
return {
|
1732
|
+
previews
|
1733
|
+
};
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
// #region getSources
|
1725
1737
|
async getSources(analysis) {
|
1726
1738
|
if (!analysis) {
|
1727
1739
|
const {
|
@@ -5612,6 +5624,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5612
5624
|
};
|
5613
5625
|
}
|
5614
5626
|
const patchAnalysis = serverOps.analyzePatches(patchOps.patches);
|
5627
|
+
const schemasRes = await serverOps.getSchemas();
|
5615
5628
|
let sourcesRes = await serverOps.getSources();
|
5616
5629
|
const onlyPatchedTreeModules = await serverOps.getSources({
|
5617
5630
|
...patchAnalysis,
|
@@ -5627,6 +5640,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5627
5640
|
...(onlyPatchedTreeModules.errors || {})
|
5628
5641
|
}
|
5629
5642
|
};
|
5643
|
+
const previewsRes = await serverOps.getPreviews(schemasRes, sourcesRes.sources);
|
5630
5644
|
let sourcesValidation = {
|
5631
5645
|
errors: {},
|
5632
5646
|
files: {},
|
@@ -5673,6 +5687,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5673
5687
|
}
|
5674
5688
|
modules[moduleFilePath] = {
|
5675
5689
|
source: module,
|
5690
|
+
preview: previewsRes.previews[moduleFilePath] || null,
|
5676
5691
|
patches: appliedPatches.length > 0 || skippedPatches.length > 0 || Object.keys(patchErrors).length > 0 ? {
|
5677
5692
|
applied: appliedPatches,
|
5678
5693
|
skipped: skippedPatches.length > 0 ? skippedPatches : undefined,
|
@@ -1721,7 +1721,19 @@ class ValOps {
|
|
1721
1721
|
};
|
1722
1722
|
}
|
1723
1723
|
|
1724
|
-
// #region
|
1724
|
+
// #region getPreviews
|
1725
|
+
async getPreviews(schemas, sources) {
|
1726
|
+
const previews = {};
|
1727
|
+
for (const [pathS, schema] of Object.entries(schemas)) {
|
1728
|
+
const path = pathS;
|
1729
|
+
previews[path] = schema["executePreview"](path, sources[path]);
|
1730
|
+
}
|
1731
|
+
return {
|
1732
|
+
previews
|
1733
|
+
};
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
// #region getSources
|
1725
1737
|
async getSources(analysis) {
|
1726
1738
|
if (!analysis) {
|
1727
1739
|
const {
|
@@ -5612,6 +5624,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5612
5624
|
};
|
5613
5625
|
}
|
5614
5626
|
const patchAnalysis = serverOps.analyzePatches(patchOps.patches);
|
5627
|
+
const schemasRes = await serverOps.getSchemas();
|
5615
5628
|
let sourcesRes = await serverOps.getSources();
|
5616
5629
|
const onlyPatchedTreeModules = await serverOps.getSources({
|
5617
5630
|
...patchAnalysis,
|
@@ -5627,6 +5640,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5627
5640
|
...(onlyPatchedTreeModules.errors || {})
|
5628
5641
|
}
|
5629
5642
|
};
|
5643
|
+
const previewsRes = await serverOps.getPreviews(schemasRes, sourcesRes.sources);
|
5630
5644
|
let sourcesValidation = {
|
5631
5645
|
errors: {},
|
5632
5646
|
files: {},
|
@@ -5673,6 +5687,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5673
5687
|
}
|
5674
5688
|
modules[moduleFilePath] = {
|
5675
5689
|
source: module,
|
5690
|
+
preview: previewsRes.previews[moduleFilePath] || null,
|
5676
5691
|
patches: appliedPatches.length > 0 || skippedPatches.length > 0 || Object.keys(patchErrors).length > 0 ? {
|
5677
5692
|
applied: appliedPatches,
|
5678
5693
|
skipped: skippedPatches.length > 0 ? skippedPatches : undefined,
|
@@ -1690,7 +1690,19 @@ class ValOps {
|
|
1690
1690
|
};
|
1691
1691
|
}
|
1692
1692
|
|
1693
|
-
// #region
|
1693
|
+
// #region getPreviews
|
1694
|
+
async getPreviews(schemas, sources) {
|
1695
|
+
const previews = {};
|
1696
|
+
for (const [pathS, schema] of Object.entries(schemas)) {
|
1697
|
+
const path = pathS;
|
1698
|
+
previews[path] = schema["executePreview"](path, sources[path]);
|
1699
|
+
}
|
1700
|
+
return {
|
1701
|
+
previews
|
1702
|
+
};
|
1703
|
+
}
|
1704
|
+
|
1705
|
+
// #region getSources
|
1694
1706
|
async getSources(analysis) {
|
1695
1707
|
if (!analysis) {
|
1696
1708
|
const {
|
@@ -5581,6 +5593,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5581
5593
|
};
|
5582
5594
|
}
|
5583
5595
|
const patchAnalysis = serverOps.analyzePatches(patchOps.patches);
|
5596
|
+
const schemasRes = await serverOps.getSchemas();
|
5584
5597
|
let sourcesRes = await serverOps.getSources();
|
5585
5598
|
const onlyPatchedTreeModules = await serverOps.getSources({
|
5586
5599
|
...patchAnalysis,
|
@@ -5596,6 +5609,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5596
5609
|
...(onlyPatchedTreeModules.errors || {})
|
5597
5610
|
}
|
5598
5611
|
};
|
5612
|
+
const previewsRes = await serverOps.getPreviews(schemasRes, sourcesRes.sources);
|
5599
5613
|
let sourcesValidation = {
|
5600
5614
|
errors: {},
|
5601
5615
|
files: {},
|
@@ -5642,6 +5656,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
5642
5656
|
}
|
5643
5657
|
modules[moduleFilePath] = {
|
5644
5658
|
source: module,
|
5659
|
+
preview: previewsRes.previews[moduleFilePath] || null,
|
5645
5660
|
patches: appliedPatches.length > 0 || skippedPatches.length > 0 || Object.keys(patchErrors).length > 0 ? {
|
5646
5661
|
applied: appliedPatches,
|
5647
5662
|
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.
|
15
|
+
"version": "0.78.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.
|
27
|
-
"@valbuild/shared": "~0.
|
28
|
-
"@valbuild/ui": "~0.
|
26
|
+
"@valbuild/core": "~0.78.0",
|
27
|
+
"@valbuild/shared": "~0.78.0",
|
28
|
+
"@valbuild/ui": "~0.78.0",
|
29
29
|
"chokidar": "^4.0.1",
|
30
30
|
"image-size": "^1.0.2",
|
31
31
|
"minimatch": "^3.0.4",
|