refactor modes implementation and improve validation handling

refactor `code` and `hybrid` modes for better type safety and configuration flexibility. add `_isProd` helper to standardize environment checks and improve plugin syncing warnings. adjust validation logic for clean JSON schema handling and enhance test coverage for modes.
This commit is contained in:
dswbx
2025-11-20 21:08:16 +01:00
parent 079d613b2e
commit a2fa11ccd0
11 changed files with 119 additions and 63 deletions

View File

@@ -26,7 +26,9 @@ export class JsonSchemaField<
constructor(name: string, config: Partial<JsonSchemaFieldConfig>) {
super(name, config);
this.validator = new Validator({ ...this.getJsonSchema() });
// make sure to hand over clean json
this.validator = new Validator(JSON.parse(JSON.stringify(this.getJsonSchema())));
}
protected getSchema() {