From 1a20c5eb93993cbdd3fc53e98857d6969ae4fdd2 Mon Sep 17 00:00:00 2001 From: Alexander Karaulshchikov Date: Tue, 6 Apr 2021 22:53:59 +0200 Subject: [PATCH] Libraries update. Includes pug@3.0.1 crit update. --- app.js | 13 ++++++++----- config/app-config-schema.json | 11 +++-------- config/services-schema.json | 14 ++++++-------- package.json | 7 ++++--- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/app.js b/app.js index a859c6c..986ae7a 100644 --- a/app.js +++ b/app.js @@ -27,7 +27,7 @@ const resourcesPath = currentEnv == environment.prod ? path.dist : path.src // System config loading var properties = require('./config/app-config.json'); -var loideUrl = properties.loide_url; +var loideUrl = properties.loide_url; var httpPort = properties.port.http; var httpsPortP = properties.port.https; var key = properties.path.key; @@ -38,7 +38,8 @@ var maxAge = properties.max_age; var servicesConfig = require('./config/services.json'); // This function validates the JSON schemas -var Ajv = require('ajv'); +var Ajv = require('ajv'); +var formats = require('ajv-formats'); validateJsonSchemas(); var pckg = require('./package.json'); @@ -185,11 +186,13 @@ function validateSchema(jsonPath, schemaPath) { var schema = require(schemaPath); // Config - var ajv = new Ajv({ - allErrors: true, - jsonPointers: true + var ajv = new Ajv.default({ + allErrors: true }); + // Adding format support + formats(ajv); + // Compiling the schema var compiledSchema = ajv.compile(schema); var validated = false; diff --git a/config/app-config-schema.json b/config/app-config-schema.json index c5866d7..6408172 100644 --- a/config/app-config-schema.json +++ b/config/app-config-schema.json @@ -1,19 +1,14 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "app-config-schema.json", - "self": { - "vendor": "unical", - "name": "app-config", - "format": "jsonschema", - "version": "1-0-0" - }, + "title": "Configurations", + "description": "LoIDE configurations", "type": "object", "properties": { "loide_url": { "title": "LoIDE URL", "description": "This is the URL where the application can be reached", - "type": "string", - "minimum": 0 + "type": "string" }, "max_age": { "title": "HSTS max age", diff --git a/config/services-schema.json b/config/services-schema.json index 02db96e..da2e368 100644 --- a/config/services-schema.json +++ b/config/services-schema.json @@ -1,12 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "services-schema.json", - "self": { - "vendor": "unical", - "name": "services", - "format": "jsonschema", - "version": "1-0-0" - }, + "title": "Services", + "description": "Services tha LoIDE runs", + "type": "object", "properties": { "languages": { "title": "Supported languages.", @@ -54,7 +51,8 @@ "path": { "title": "Syntax-Highlighter path.", "description": "This property indicates the syntax-highlighter file path.", - "type": "string" + "type": "string", + "format": "uri-reference" } }, "required": [ @@ -181,7 +179,7 @@ "title": "Executor path.", "description": "This property indicates the executor path relative to its URL.", "type": "string", - "_comment": "Add the pattern to match with the 'path'." + "format": "uri-reference" }, "port": { "title": "Connection port number.", diff --git a/package.json b/package.json index 7f3a234..129883d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loide", - "version": "2.10.1", + "version": "2.11.0", "description": "Web-based IDE for Logic Programming", "main": "app.js", "scripts": { @@ -44,12 +44,13 @@ "url": "https://github.com/DeMaCS-UNICAL/LoIDE/issues" }, "dependencies": { - "ajv": "^6.12.4", + "ajv": "^8.0.5", + "ajv-formats": "^2.0.2", "express": "^4.17.1", "express-force-ssl": "^0.3.2", "helmet": "^3.21.1", "json-pointer": "^0.6.0", - "pug": "^3.0.0", + "pug": "^3.0.1", "socket.io": "^2.3.0", "websocket": "^1.0.32" },