Refresh the homepage and improve export and draft guidance
This commit is contained in:
@@ -56,6 +56,23 @@ export const datasetSchema = z
|
||||
.max(4096),
|
||||
})
|
||||
.superRefine((d, ctx) => {
|
||||
const paths = new Set(d.assets.map((asset) => asset.path));
|
||||
const requiredPaths =
|
||||
d.source === "plugin"
|
||||
? ["terrain.json.gz"]
|
||||
: [
|
||||
"map.png",
|
||||
...d.viewpoints.flatMap((point) =>
|
||||
faces.map((face) => `${point.id}/${face}.png`),
|
||||
),
|
||||
];
|
||||
for (const path of requiredPaths) {
|
||||
if (!paths.has(path))
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
message: `Missing required export asset: ${path}`,
|
||||
});
|
||||
}
|
||||
if (new Set(d.viewpoints.map((p) => p.id)).size !== d.viewpoints.length)
|
||||
ctx.addIssue({ code: "custom", message: "Viewpoint IDs must be unique" });
|
||||
if (new Set(d.assets.map((a) => a.path)).size !== d.assets.length)
|
||||
|
||||
Reference in New Issue
Block a user