@jupyterlab/settingregistry
Advanced tools
Comparing version 4.0.0-alpha.18 to 4.0.0-alpha.19
@@ -33,13 +33,9 @@ import { IDataConnector } from '@jupyterlab/statedb'; | ||
/** | ||
* The path in the data where the error occurred. | ||
*/ | ||
dataPath: string; | ||
/** | ||
* The keyword whose validation failed. | ||
*/ | ||
keyword: string; | ||
keyword: string | string[]; | ||
/** | ||
* The error message. | ||
*/ | ||
message: string; | ||
message?: string; | ||
/** | ||
@@ -53,2 +49,22 @@ * Optional parameter metadata that might be included in an error. | ||
schemaPath: string; | ||
/** | ||
* @todo handle new fields from ajv8 | ||
**/ | ||
schema?: unknown; | ||
/** | ||
* @todo handle new fields from ajv8 | ||
**/ | ||
instancePath: string; | ||
/** | ||
* @todo handle new fields from ajv8 | ||
**/ | ||
propertyName?: string; | ||
/** | ||
* @todo handle new fields from ajv8 | ||
**/ | ||
data?: unknown; | ||
/** | ||
* @todo handle new fields from ajv8 | ||
**/ | ||
parentSchema?: unknown; | ||
} | ||
@@ -55,0 +71,0 @@ } |
@@ -14,2 +14,13 @@ // Copyright (c) Jupyter Development Team. | ||
const copy = JSONExt.deepCopy; | ||
/** Default arguments for Ajv instances. | ||
* | ||
* https://ajv.js.org/options.html | ||
*/ | ||
const AJV_DEFAULT_OPTIONS = { | ||
/** | ||
* @todo the implications of enabling strict mode are beyond the scope of | ||
* the initial PR | ||
*/ | ||
strict: false | ||
}; | ||
/** | ||
@@ -33,4 +44,7 @@ * The default number of milliseconds before a `load()` call to the registry | ||
constructor() { | ||
this._composer = new Ajv({ useDefaults: true }); | ||
this._validator = new Ajv(); | ||
this._composer = new Ajv({ | ||
useDefaults: true, | ||
...AJV_DEFAULT_OPTIONS | ||
}); | ||
this._validator = new Ajv({ ...AJV_DEFAULT_OPTIONS }); | ||
this._composer.addSchema(SCHEMA, 'jupyterlab-plugin-schema'); | ||
@@ -60,3 +74,3 @@ this._validator.addSchema(SCHEMA, 'jupyterlab-plugin-schema'); | ||
`'object', rejecting type: ${plugin.schema.type}`; | ||
return [{ dataPath: 'type', keyword, schemaPath: '', message }]; | ||
return [{ instancePath: 'type', keyword, schemaPath: '', message }]; | ||
} | ||
@@ -75,3 +89,3 @@ const errors = this._addSchema(plugin.id, plugin.schema); | ||
{ | ||
dataPath: '', | ||
instancePath: '', | ||
keyword: 'syntax', | ||
@@ -87,3 +101,3 @@ schemaPath: '', | ||
{ | ||
dataPath: '', | ||
instancePath: '', | ||
keyword: 'parse', | ||
@@ -234,3 +248,3 @@ schemaPath: '', | ||
{ | ||
dataPath: '', | ||
instancePath: '', | ||
keyword: 'id', | ||
@@ -361,5 +375,5 @@ message: `Could not fetch settings for ${plugin}.`, | ||
errors.forEach((error, index) => { | ||
const { dataPath, schemaPath, keyword, message } = error; | ||
if (dataPath || schemaPath) { | ||
output.push(`${index} - schema @ ${schemaPath}, data @ ${dataPath}`); | ||
const { instancePath, schemaPath, keyword, message } = error; | ||
if (instancePath || schemaPath) { | ||
output.push(`${index} - schema @ ${schemaPath}, data @ ${instancePath}`); | ||
} | ||
@@ -411,3 +425,3 @@ output.push(`{${keyword}} ${message}`); | ||
{ | ||
dataPath: '', | ||
instancePath: '', | ||
keyword: 'id', | ||
@@ -438,3 +452,3 @@ message: `Could not fetch settings for ${plugin}.`, | ||
{ | ||
dataPath: '', | ||
instancePath: '', | ||
keyword: 'id', | ||
@@ -459,3 +473,3 @@ message: 'Plugin transformations cannot change plugin IDs.', | ||
{ | ||
dataPath: '', | ||
instancePath: '', | ||
keyword: 'timeout', | ||
@@ -462,0 +476,0 @@ message: `Transforming ${plugin.id} timed out.`, |
@@ -7,2 +7,3 @@ import { CellType } from '@jupyterlab/nbformat'; | ||
import { ISchemaValidator } from './settingregistry'; | ||
import type { RJSFSchema, UiSchema } from '@rjsf/utils'; | ||
/** | ||
@@ -521,5 +522,2 @@ * The setting registry token. | ||
* The metadata schema. | ||
* | ||
* ## Notes: | ||
* To change to type @rjsf/utils -> RJSFSchema when upgrading rjsf to v5. | ||
*/ | ||
@@ -529,8 +527,5 @@ metadataSchema: IMetadataSchema; | ||
* The ui schema as used by react-JSON-schema-form. | ||
* | ||
* ## Notes: | ||
* To change to type @rjsf/utils -> UiSchema when upgrading rjsf to v5. | ||
*/ | ||
uiSchema?: { | ||
[metadataKey: string]: PartialJSONObject; | ||
[metadataKey: string]: UiSchema; | ||
}; | ||
@@ -562,12 +557,5 @@ /** | ||
* The metadata schema as defined in JSON schema. | ||
* | ||
* ## Notes: | ||
* To remove in favour of @rjsf/utils -> RJSFSchema when upgrading rjsf to v5. | ||
*/ | ||
interface IMetadataSchema extends PartialJSONObject { | ||
interface IMetadataSchema extends RJSFSchema { | ||
/** | ||
* The type of data (should be object at first level). | ||
*/ | ||
type: string; | ||
/** | ||
* The properties as defined in JSON schema, and interpretable by react-JSON-schema-form. | ||
@@ -574,0 +562,0 @@ */ |
{ | ||
"name": "@jupyterlab/settingregistry", | ||
"version": "4.0.0-alpha.18", | ||
"version": "4.0.0-alpha.19", | ||
"description": "Settings registry for Jupyterlab", | ||
@@ -38,13 +38,14 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyterlab/nbformat": "^4.0.0-alpha.18", | ||
"@jupyterlab/statedb": "^4.0.0-alpha.18", | ||
"@lumino/commands": "^2.0.0-alpha.6", | ||
"@lumino/coreutils": "^2.0.0-alpha.6", | ||
"@lumino/disposable": "^2.0.0-alpha.6", | ||
"@lumino/signaling": "^2.0.0-alpha.6", | ||
"ajv": "^6.12.3", | ||
"@jupyterlab/nbformat": "^4.0.0-alpha.19", | ||
"@jupyterlab/statedb": "^4.0.0-alpha.19", | ||
"@lumino/commands": "^2.0.0-beta.1", | ||
"@lumino/coreutils": "^2.0.0-beta.0", | ||
"@lumino/disposable": "^2.0.0-beta.1", | ||
"@lumino/signaling": "^2.0.0-beta.1", | ||
"@rjsf/utils": "^5.1.0", | ||
"ajv": "^8.12.0", | ||
"json5": "^2.2.3" | ||
}, | ||
"devDependencies": { | ||
"@jupyterlab/testing": "^4.0.0-alpha.18", | ||
"@jupyterlab/testing": "^4.0.0-alpha.19", | ||
"@types/jest": "^29.2.0", | ||
@@ -51,0 +52,0 @@ "rimraf": "~3.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117002
2601
9
+ Added@rjsf/utils@^5.1.0
+ Added@rjsf/utils@5.23.2(transitive)
+ Addedajv@8.17.1(transitive)
+ Addedcompute-gcd@1.2.1(transitive)
+ Addedcompute-lcm@1.1.2(transitive)
+ Addedfast-uri@3.0.3(transitive)
+ Addedjson-schema-compare@0.2.2(transitive)
+ Addedjson-schema-merge-allof@0.8.1(transitive)
+ Addedjson-schema-traverse@1.0.0(transitive)
+ Addedjsonpointer@5.0.1(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash-es@4.17.21(transitive)
+ Addedreact@19.0.0(transitive)
+ Addedreact-is@18.3.1(transitive)
+ Addedrequire-from-string@2.0.2(transitive)
+ Addedvalidate.io-array@1.0.6(transitive)
+ Addedvalidate.io-function@1.0.2(transitive)
+ Addedvalidate.io-integer@1.0.5(transitive)
+ Addedvalidate.io-integer-array@1.0.0(transitive)
+ Addedvalidate.io-number@1.0.3(transitive)
- Removedajv@6.12.6(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedpunycode@2.3.1(transitive)
- Removeduri-js@4.4.1(transitive)
Updatedajv@^8.12.0