From 6a674cdeac3d7567a889771e2471a03adf99a716 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:25:15 +0000 Subject: [PATCH 1/5] chore(deps): bump @hyperjump/json-schema from 1.6.7 to 1.9.3 Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 1.6.7 to 1.9.3. - [Commits](https://github.com/hyperjump-io/json-schema/compare/v1.6.7...v1.9.3) --- updated-dependencies: - dependency-name: "@hyperjump/json-schema" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 62 +++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 870d5a01399..370fc1b8bd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -324,15 +324,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@gulp-sourcemaps/identity-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", @@ -464,39 +455,35 @@ "dev": true }, "node_modules/@hyperjump/json-pointer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-1.0.1.tgz", - "integrity": "sha512-vV2pSc7JCwbKEMzh8kr/ICZdO+UZbA3aZ7N8t7leDi9cduWKa9yoP5LS04LnsbErlPbUNHvWBFlbTaR/o/uf7A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-1.1.0.tgz", + "integrity": "sha512-tFCKxMKDKK3VEdtUA3EBOS9GmSOS4mbrTjh9v3RnK10BphDMOb6+bxTh++/ae1AyfHyWb6R54O/iaoAtPMZPCg==", "dev": true, - "dependencies": { - "just-curry-it": "^5.3.0" - }, "funding": { "type": "github", "url": "https://github.com/sponsors/jdesrosiers" } }, "node_modules/@hyperjump/json-schema": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.6.7.tgz", - "integrity": "sha512-6ufO5Iov85FBXQ1a//7sQDwzZRoyEMR1MD7Te6k00DvApvj1/x3k/S1RcPmmPCCuj7BDxHVixu4qBTM6sBsmBA==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.9.3.tgz", + "integrity": "sha512-NZyQ+PSQKUVIO0PInwqk2EOOObJD/ZqR9awzZeOddwtJyLZaxim9/xizZ6gGxGZi5ZGIdIB1mkBTM9fBu85E4A==", "dev": true, "dependencies": { - "@hyperjump/json-pointer": "^1.0.0", + "@hyperjump/json-pointer": "^1.1.0", "@hyperjump/pact": "^1.2.0", "@hyperjump/uri": "^1.2.0", "content-type": "^1.0.4", - "fastest-stable-stringify": "^2.0.2", + "json-stringify-deterministic": "^1.0.12", "just-curry-it": "^5.3.0", - "undici": "^5.19.1", "uuid": "^9.0.0" }, - "engines": { - "node": ">=18.0.0" - }, "funding": { "type": "github", "url": "https://github.com/sponsors/jdesrosiers" + }, + "peerDependencies": { + "@hyperjump/browser": "^1.1.0" } }, "node_modules/@hyperjump/pact": { @@ -4827,12 +4814,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fastest-stable-stringify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz", - "integrity": "sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==", - "dev": true - }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -7573,6 +7554,15 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "node_modules/json-stringify-deterministic": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/json-stringify-deterministic/-/json-stringify-deterministic-1.0.12.tgz", + "integrity": "sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -11470,18 +11460,6 @@ "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=", "dev": true }, - "node_modules/undici": { - "version": "5.28.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", - "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", - "dev": true, - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", From 3a04899445a59286b43183bf05f734347efc2533 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 18 Jul 2024 11:07:51 +0100 Subject: [PATCH 2/5] chore(deps): Add dev dependency on @hyperjump/browser @hyperjump/json-schema (v1.7.0 and later) depends upon @hyperjump/browser, but fails to declare it as a dependency, only listing it as a peer dependency, so said package must be installed separately. --- package-lock.json | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) diff --git a/package-lock.json b/package-lock.json index 370fc1b8bd5..df47a0301d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@blockly/block-test": "^6.0.4", "@blockly/dev-tools": "^8.0.4", "@blockly/theme-modern": "^6.0.3", + "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", @@ -454,6 +455,26 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, + "node_modules/@hyperjump/browser": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@hyperjump/browser/-/browser-1.1.4.tgz", + "integrity": "sha512-85rfa3B79MssMOxNChvXJhfgvIXqA2FEzwrxKe9iMpCKZVQIxQe54w210VeFM0D33pVOeNskg7TyptSjenY2+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hyperjump/json-pointer": "^1.1.0", + "@hyperjump/uri": "^1.2.0", + "content-type": "^1.0.5", + "just-curry-it": "^5.3.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, "node_modules/@hyperjump/json-pointer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-1.1.0.tgz", diff --git a/package.json b/package.json index 42ceea97931..c0a55f20126 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "@blockly/block-test": "^6.0.4", "@blockly/dev-tools": "^8.0.4", "@blockly/theme-modern": "^6.0.3", + "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", From 73a45b0dbd94d10b7d3a5c1014913403a5c692f6 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 18 Jul 2024 14:15:16 +0100 Subject: [PATCH 3/5] fix(tests): Use BASIC output as DETAILED is no longer supported See issue hyperjump-io/json-chema#68 for additional info. --- tests/migration/validate-renamings.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index b0f0e6f7fbf..b0647f29130 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -15,7 +15,7 @@ import JSON5 from 'json5'; import {readFile} from 'fs/promises'; import {posixPath} from '../../scripts/helpers.js'; import {validate} from '@hyperjump/json-schema/draft-2020-12'; -import {DETAILED} from '@hyperjump/json-schema/experimental'; +import {BASIC} from '@hyperjump/json-schema/experimental'; /** @type {URL} Renaming schema filename. */ const SCHEMA_URL = new URL('renamings.schema.json', import.meta.url); @@ -29,7 +29,7 @@ const RENAMINGS_URL = new URL( const renamingsJson5 = await readFile(RENAMINGS_URL); const renamings = JSON5.parse(renamingsJson5); -const output = await validate(SCHEMA_URL, renamings, DETAILED); +const output = await validate(SCHEMA_URL, renamings, BASIC); if (!output.valid) { console.log('Renamings file is invalid.'); From dfd41eee445ed8f9b9ed5263e2a77b7f360e3096 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 18 Jul 2024 16:06:55 +0100 Subject: [PATCH 4/5] feat(tests): Add more informational output in case of test failure Since the BASIC output of the schema verifier is (slightly) less helpful than the old DETAILED output, add an additional output containing the first invalid path, e.g.: #/9.3.0/0/exports/textToDom/newModule in the results object returned by validate, since this is the most useful part of that info. Also use console.error and console.info instead of console.log where appropriate. --- tests/migration/validate-renamings.mjs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index b0647f29130..600e7e1252e 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -32,9 +32,10 @@ const renamings = JSON5.parse(renamingsJson5); const output = await validate(SCHEMA_URL, renamings, BASIC); if (!output.valid) { - console.log('Renamings file is invalid.'); - console.log('Maybe this validator output will help you find the problem:'); - console.log(JSON5.stringify(output, undefined, ' ')); + console.error(`Renamings file is invalid. First error occurs at: + ${output.errors[0].instanceLocation}`); + console.info(`Here is the full validator output, in case that helps:\n`, + output); process.exit(1); } @@ -45,7 +46,7 @@ Object.entries(renamings).forEach(([version, modules]) => { const seen = new Set(); for (const {oldName} of modules) { if (seen.has(oldName)) { - console.log( + console.error( `Duplicate entry for module ${oldName} ` + `in version ${version}.`, ); ok = false; @@ -54,7 +55,7 @@ Object.entries(renamings).forEach(([version, modules]) => { } }); if (!ok) { - console.log('Renamings file is invalid.'); + console.error('Renamings file is invalid.'); process.exit(1); } // Default is a successful exit 0. From 193d1977d89735799085c5fec76af5f592fb2a3c Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 18 Jul 2024 16:09:57 +0100 Subject: [PATCH 5/5] chore(tests): Format --- tests/migration/validate-renamings.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index 600e7e1252e..439e216c813 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -34,8 +34,10 @@ const output = await validate(SCHEMA_URL, renamings, BASIC); if (!output.valid) { console.error(`Renamings file is invalid. First error occurs at: ${output.errors[0].instanceLocation}`); - console.info(`Here is the full validator output, in case that helps:\n`, - output); + console.info( + `Here is the full validator output, in case that helps:\n`, + output, + ); process.exit(1); }