Enhance document validation with scheduling resources and local build content checks
This commit is contained in:
@@ -245,7 +245,8 @@ import {
|
||||
import {
|
||||
formatSceneDiagnosticSummary,
|
||||
validateProjectDocument,
|
||||
validateSceneDocument
|
||||
validateProjectSchedulingResources,
|
||||
validateSceneDocumentLocalBuildContent
|
||||
} from "../document/scene-document-validation";
|
||||
import {
|
||||
cloneProjectAssetStorageRecord,
|
||||
@@ -3208,10 +3209,15 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
editorSimulationControllerRef.current = new EditorSimulationController();
|
||||
}
|
||||
const editorSimulationController = editorSimulationControllerRef.current;
|
||||
const documentValidation = validateSceneDocument(editorState.document);
|
||||
const documentValidation = validateSceneDocumentLocalBuildContent(
|
||||
editorState.document
|
||||
);
|
||||
const projectValidation = validateProjectDocument(
|
||||
editorState.projectDocument
|
||||
);
|
||||
const projectSchedulingValidation = validateProjectSchedulingResources(
|
||||
editorState.projectDocument
|
||||
);
|
||||
const activeSceneProjectDiagnostics = projectValidation.diagnostics.filter(
|
||||
(diagnostic) =>
|
||||
diagnostic.path?.startsWith(`scenes.${editorState.activeSceneId}.`) &&
|
||||
@@ -3228,6 +3234,8 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
const diagnostics = [
|
||||
...documentValidation.errors,
|
||||
...documentValidation.warnings,
|
||||
...projectSchedulingValidation.errors,
|
||||
...projectSchedulingValidation.warnings,
|
||||
...activeSceneProjectDiagnostics,
|
||||
...runValidation.errors,
|
||||
...runValidation.warnings
|
||||
@@ -7772,6 +7780,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
|
||||
return buildRuntimeSceneFromDocument(sceneDocument, {
|
||||
loadedModelAssets,
|
||||
projectDocument: editorState.projectDocument,
|
||||
runtimeClock: runtimeGlobalState.clock,
|
||||
sceneEntryId: options.sceneEntryId
|
||||
});
|
||||
|
||||
@@ -666,6 +666,9 @@ describe("validateSceneDocument", () => {
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-target-button-cycles-active-target"
|
||||
}),
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-invert-mouse-camera-horizontal"
|
||||
}),
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-movement-template-kind"
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user