From 0afcabe959e24ee7fa11f11e9808cfe0f7cf07a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 18:47:04 +0100 Subject: [PATCH] chore(deps): Bump @hyperjump/json-schema from 0.23.3 to 1.5.0 (#7079) * chore(deps): Bump @hyperjump/json-schema from 0.23.3 to 1.5.0 Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 0.23.3 to 1.5.0. - [Commits](https://github.com/hyperjump-io/json-schema/compare/v0.23.3...v1.5.0) --- updated-dependencies: - dependency-name: "@hyperjump/json-schema" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * chore(tests): Compatibility updates to validate-renamings.js A minimal set of updates to validate-renamings.js to make it compatible with @hyperjump/json-schema v1.5. The main difference is that that package now ships ESM rather than CJS modules, forcing the script to use import rather than require, with various knock-on effects (no __dirname variable, must be named *.mjs, etc.) * chore(tests) Remove unneeded IIFE * chore(tests): Additional tidy-up of ESM version Now that validate-renamings is an ES module, we can do some other cleanup to it. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Christopher Allen --- package-lock.json | 260 ++++++++++++------------- package.json | 2 +- scripts/gulpfiles/test_tasks.js | 2 +- tests/migration/validate-renamings.js | 79 -------- tests/migration/validate-renamings.mjs | 60 ++++++ 5 files changed, 186 insertions(+), 217 deletions(-) delete mode 100644 tests/migration/validate-renamings.js create mode 100755 tests/migration/validate-renamings.mjs diff --git a/package-lock.json b/package-lock.json index 3b7f4fb02..1f1d57a4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@blockly/block-test": "^3.0.0", "@blockly/dev-tools": "^5.0.0", "@blockly/theme-modern": "^3.0.0", - "@hyperjump/json-schema": "^0.23.3", + "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", "@typescript-eslint/eslint-plugin": "^5.33.1", @@ -474,28 +474,13 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "node_modules/@hyperjump/json": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@hyperjump/json/-/json-0.1.0.tgz", - "integrity": "sha512-jWsAOHjweWhi0UEBCN57YZzyTt76Z6Fm/OJXOfNBJbEZt569AcTRsjv6Dqj5t4gQhW9td72oquiyaVp9oHbhBQ==", - "dev": true, - "dependencies": { - "@hyperjump/json-pointer": "^0.9.2", - "moo": "^0.5.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, "node_modules/@hyperjump/json-pointer": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-0.9.6.tgz", - "integrity": "sha512-3szMJLfz+1wtfPHnGi1sHzwFfFdZqIZLCCYtaD47vLZMAQCbtoBRVZn44jJgIQ6v37+8fom5rsxSSIMKWi0zbg==", + "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==", "dev": true, - "hasInstallScript": true, "dependencies": { - "just-curry-it": "^5.2.1" + "just-curry-it": "^5.3.0" }, "funding": { "type": "github", @@ -503,34 +488,22 @@ } }, "node_modules/@hyperjump/json-schema": { - "version": "0.23.3", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-0.23.3.tgz", - "integrity": "sha512-3YqAQpYY1U16SeP+LfMzBySqW5FHF9gZcOMKeeRywJkowsZ1JuOOiYCmYXptlRwXSB1jVa9ITC0lvfO84OaSQQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.5.0.tgz", + "integrity": "sha512-sMkn+evx0Pz0r5K1sZ/oVSaybmIxCF21fKETamoEZegZ30nbqB+kf1XP8+vA41SoXgf6Ut1z2N0B2vnMPyG/xA==", "dev": true, - "hasInstallScript": true, "dependencies": { - "@hyperjump/json-schema-core": "^0.28.0", - "fastest-stable-stringify": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/@hyperjump/json-schema-core": { - "version": "0.28.5", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-core/-/json-schema-core-0.28.5.tgz", - "integrity": "sha512-+f5P3oHYCQru3s+Ha+E10rIyEvyK0Hfa2oj3+cDoGaVMbT4Jg5TgCoIM7B5rl3t3KRA7EOmrLjKFGeLi5yd1pg==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@hyperjump/json": "^0.1.0", - "@hyperjump/json-pointer": "^0.9.4", - "@hyperjump/pact": "^0.2.3", + "@hyperjump/json-pointer": "^1.0.0", + "@hyperjump/pact": "^1.0.0", + "@hyperjump/uri": "^1.2.0", "content-type": "^1.0.4", - "node-fetch": "^2.6.5", - "pubsub-js": "^1.9.4", - "uri-js": "^4.4.1" + "fastest-stable-stringify": "^2.0.2", + "just-curry-it": "^5.3.0", + "undici": "^5.19.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" }, "funding": { "type": "github", @@ -538,24 +511,27 @@ } }, "node_modules/@hyperjump/pact": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-0.2.4.tgz", - "integrity": "sha512-BGmyLaUSCMVyHrwXr67rMxgiQHPHwcmVCjROoY8q232EpMz9d9aFCkgGhdx//yEfHM7zgsm0zZ8RD/F89uPySg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-1.0.0.tgz", + "integrity": "sha512-d4YYXhVictDbkhjWbRA+Qk8PiufDTSRZg7tWMU07sl0wA/rh9AtL0cPJdpxSsjtDVDBlNSjsOr+RTKDU2IKqEA==", "dev": true, - "hasInstallScript": true, "dependencies": { - "just-curry-it": "^3.1.0" + "just-curry-it": "^5.3.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/jdesrosiers" } }, - "node_modules/@hyperjump/pact/node_modules/just-curry-it": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-3.2.1.tgz", - "integrity": "sha512-Q8206k8pTY7krW32cdmPsP+DqqLgWx/hYPSj9/+7SYqSqz7UuwPbfSe07lQtvuuaVyiSJveXk0E5RydOuWwsEg==", - "dev": true + "node_modules/@hyperjump/uri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@hyperjump/uri/-/uri-1.2.0.tgz", + "integrity": "sha512-v/OE8Kg0xdd1wYRjyAI8zPxQEAgWuhqSy5mJm0/FAIUdN6S6b75DBUSl2J3ps6QSCID3fnjXqJyevrOOH67YAA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -2998,6 +2974,18 @@ "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", "dev": true }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -3673,9 +3661,9 @@ } }, "node_modules/content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, "engines": { "node": ">= 0.6" @@ -7715,9 +7703,9 @@ } }, "node_modules/just-curry-it": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-5.2.1.tgz", - "integrity": "sha512-M8qhhO9WVNc3yZgf3qfiNxMIsQlHqFHJ3vMI8N/rkp852h1utOB/N3ebS8jeXGAwYSbkdd0K6zP9eZneUtjHwA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-5.3.0.tgz", + "integrity": "sha512-silMIRiFjUWlfaDhkgSzpuAyQ6EX/o09Eu8ZBfmFwQMbax7+LQzeIU2CBrICT6Ne4l86ITCGvUCBpCubWYy0Yw==", "dev": true }, "node_modules/just-debounce": { @@ -8703,12 +8691,6 @@ "integrity": "sha512-hkvf4EtPJRMQlPC3UbMoRs0vTAFAYdzFQ+gpMb8A+9znae1c43q8Mab9iVsgTcg/4PNiLGGn3SlDIa8uvK1FIQ==", "dev": true }, - "node_modules/moo": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", - "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", - "dev": true - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -9798,12 +9780,6 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, - "node_modules/pubsub-js": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", - "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==", - "dev": true - }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -11367,6 +11343,15 @@ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/streamx": { "version": "2.13.2", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.13.2.tgz", @@ -12036,6 +12021,18 @@ "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=", "dev": true }, + "node_modules/undici": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", + "dev": true, + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", @@ -13383,67 +13380,46 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "@hyperjump/json": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@hyperjump/json/-/json-0.1.0.tgz", - "integrity": "sha512-jWsAOHjweWhi0UEBCN57YZzyTt76Z6Fm/OJXOfNBJbEZt569AcTRsjv6Dqj5t4gQhW9td72oquiyaVp9oHbhBQ==", - "dev": true, - "requires": { - "@hyperjump/json-pointer": "^0.9.2", - "moo": "^0.5.1" - } - }, "@hyperjump/json-pointer": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-0.9.6.tgz", - "integrity": "sha512-3szMJLfz+1wtfPHnGi1sHzwFfFdZqIZLCCYtaD47vLZMAQCbtoBRVZn44jJgIQ6v37+8fom5rsxSSIMKWi0zbg==", + "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==", "dev": true, "requires": { - "just-curry-it": "^5.2.1" + "just-curry-it": "^5.3.0" } }, "@hyperjump/json-schema": { - "version": "0.23.3", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-0.23.3.tgz", - "integrity": "sha512-3YqAQpYY1U16SeP+LfMzBySqW5FHF9gZcOMKeeRywJkowsZ1JuOOiYCmYXptlRwXSB1jVa9ITC0lvfO84OaSQQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-1.5.0.tgz", + "integrity": "sha512-sMkn+evx0Pz0r5K1sZ/oVSaybmIxCF21fKETamoEZegZ30nbqB+kf1XP8+vA41SoXgf6Ut1z2N0B2vnMPyG/xA==", "dev": true, "requires": { - "@hyperjump/json-schema-core": "^0.28.0", - "fastest-stable-stringify": "^2.0.2" - } - }, - "@hyperjump/json-schema-core": { - "version": "0.28.5", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-core/-/json-schema-core-0.28.5.tgz", - "integrity": "sha512-+f5P3oHYCQru3s+Ha+E10rIyEvyK0Hfa2oj3+cDoGaVMbT4Jg5TgCoIM7B5rl3t3KRA7EOmrLjKFGeLi5yd1pg==", - "dev": true, - "requires": { - "@hyperjump/json": "^0.1.0", - "@hyperjump/json-pointer": "^0.9.4", - "@hyperjump/pact": "^0.2.3", + "@hyperjump/json-pointer": "^1.0.0", + "@hyperjump/pact": "^1.0.0", + "@hyperjump/uri": "^1.2.0", "content-type": "^1.0.4", - "node-fetch": "^2.6.5", - "pubsub-js": "^1.9.4", - "uri-js": "^4.4.1" + "fastest-stable-stringify": "^2.0.2", + "just-curry-it": "^5.3.0", + "undici": "^5.19.1", + "uuid": "^9.0.0" } }, "@hyperjump/pact": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-0.2.4.tgz", - "integrity": "sha512-BGmyLaUSCMVyHrwXr67rMxgiQHPHwcmVCjROoY8q232EpMz9d9aFCkgGhdx//yEfHM7zgsm0zZ8RD/F89uPySg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-1.0.0.tgz", + "integrity": "sha512-d4YYXhVictDbkhjWbRA+Qk8PiufDTSRZg7tWMU07sl0wA/rh9AtL0cPJdpxSsjtDVDBlNSjsOr+RTKDU2IKqEA==", "dev": true, "requires": { - "just-curry-it": "^3.1.0" - }, - "dependencies": { - "just-curry-it": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-3.2.1.tgz", - "integrity": "sha512-Q8206k8pTY7krW32cdmPsP+DqqLgWx/hYPSj9/+7SYqSqz7UuwPbfSe07lQtvuuaVyiSJveXk0E5RydOuWwsEg==", - "dev": true - } + "just-curry-it": "^5.3.0" } }, + "@hyperjump/uri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@hyperjump/uri/-/uri-1.2.0.tgz", + "integrity": "sha512-v/OE8Kg0xdd1wYRjyAI8zPxQEAgWuhqSy5mJm0/FAIUdN6S6b75DBUSl2J3ps6QSCID3fnjXqJyevrOOH67YAA==", + "dev": true + }, "@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -15243,6 +15219,15 @@ "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", "dev": true }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -15773,9 +15758,9 @@ } }, "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true }, "convert-source-map": { @@ -18987,9 +18972,9 @@ } }, "just-curry-it": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-5.2.1.tgz", - "integrity": "sha512-M8qhhO9WVNc3yZgf3qfiNxMIsQlHqFHJ3vMI8N/rkp852h1utOB/N3ebS8jeXGAwYSbkdd0K6zP9eZneUtjHwA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-5.3.0.tgz", + "integrity": "sha512-silMIRiFjUWlfaDhkgSzpuAyQ6EX/o09Eu8ZBfmFwQMbax7+LQzeIU2CBrICT6Ne4l86ITCGvUCBpCubWYy0Yw==", "dev": true }, "just-debounce": { @@ -19800,12 +19785,6 @@ "integrity": "sha512-hkvf4EtPJRMQlPC3UbMoRs0vTAFAYdzFQ+gpMb8A+9znae1c43q8Mab9iVsgTcg/4PNiLGGn3SlDIa8uvK1FIQ==", "dev": true }, - "moo": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", - "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -20637,12 +20616,6 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, - "pubsub-js": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", - "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==", - "dev": true - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -21904,6 +21877,12 @@ } } }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true + }, "streamx": { "version": "2.13.2", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.13.2.tgz", @@ -22436,6 +22415,15 @@ "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", "dev": true }, + "undici": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", + "dev": true, + "requires": { + "busboy": "^1.6.0" + } + }, "union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", diff --git a/package.json b/package.json index e0f6f01b7..cb1b92f3d 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@blockly/block-test": "^3.0.0", "@blockly/dev-tools": "^5.0.0", "@blockly/theme-modern": "^3.0.0", - "@hyperjump/json-schema": "^0.23.3", + "@hyperjump/json-schema": "^1.5.0", "@microsoft/api-documenter": "^7.22.4", "@microsoft/api-extractor": "^7.29.5", "@typescript-eslint/eslint-plugin": "^5.33.1", diff --git a/scripts/gulpfiles/test_tasks.js b/scripts/gulpfiles/test_tasks.js index 8f87411ee..236a21d77 100644 --- a/scripts/gulpfiles/test_tasks.js +++ b/scripts/gulpfiles/test_tasks.js @@ -153,7 +153,7 @@ function build() { * @return {Promise} Asynchronous result. */ function renamings() { - return runTestCommand('renamings', 'node tests/migration/validate-renamings.js'); + return runTestCommand('renamings', 'tests/migration/validate-renamings.mjs'); } /** diff --git a/tests/migration/validate-renamings.js b/tests/migration/validate-renamings.js deleted file mode 100644 index 9a23ce23e..000000000 --- a/tests/migration/validate-renamings.js +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @fileoverview A script to validate the renamings file - * (scripts/migration/renamings.json5) agaist the schema - * (renamings-schema.json). - */ - -/* global require __dirname process */ - -const JsonSchema = require('@hyperjump/json-schema'); -const JSON5 = require('json5'); -const fs = require('fs'); -const path = require('path'); -const {posixPath} = require('../../scripts/helpers'); - -/** - * Renaming schema filename. - * @type {string} - */ -const SCHEMA_FILENAME = path.join(__dirname, 'renamings.schema.json'); - -/** - * Renamings filename. - * @type {string} - */ -const RENAMINGS_FILENAME = path.resolve( - __dirname, - '../../scripts/migration/renamings.json5' -); - -// Can't use top-level await outside a module, and can't use require -// in a module, so use an IIAFE. -(async function () { - const schemaUrl = 'file://' + posixPath(path.resolve(SCHEMA_FILENAME)); - const schema = await JsonSchema.get(schemaUrl); - - const renamingsJson5 = fs.readFileSync(RENAMINGS_FILENAME); - const renamings = JSON5.parse(renamingsJson5); - - const output = await JsonSchema.validate( - schema, - renamings, - JsonSchema.DETAILED - ); - - 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, ' ')); - process.exit(1); - } - - // File passed schema validation. Do some additional checks. - let ok = true; - Object.entries(renamings).forEach(([version, modules]) => { - // Scan through modules and check for duplicates. - const seen = new Set(); - for (const {oldName} of modules) { - if (seen.has(oldName)) { - console.log( - `Duplicate entry for module ${oldName} ` + `in version ${version}.` - ); - ok = false; - } - seen.add(oldName); - } - }); - if (!ok) { - console.log('Renamings file is invalid.'); - process.exit(1); - } - // Default is a successful exit 0. -})(); diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs new file mode 100755 index 000000000..5ea838b3a --- /dev/null +++ b/tests/migration/validate-renamings.mjs @@ -0,0 +1,60 @@ +#!/usr/bin/env node +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview A script to validate the renamings file + * (scripts/migration/renamings.json5) agaist the schema + * (renamings-schema.json). + */ + +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'; + +/** @type {URL} Renaming schema filename. */ +const SCHEMA_URL = new URL('renamings.schema.json', import.meta.url); + +/** @type {URL} Renamings filename. */ +const RENAMINGS_URL = new URL( + '../../scripts/migration/renamings.json5', + import.meta.url +); + +const renamingsJson5 = await readFile(RENAMINGS_URL); +const renamings = JSON5.parse(renamingsJson5); + +const output = await validate(SCHEMA_URL, renamings, DETAILED); + +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, ' ')); + process.exit(1); +} + +// File passed schema validation. Do some additional checks. +let ok = true; +Object.entries(renamings).forEach(([version, modules]) => { + // Scan through modules and check for duplicates. + const seen = new Set(); + for (const {oldName} of modules) { + if (seen.has(oldName)) { + console.log( + `Duplicate entry for module ${oldName} ` + `in version ${version}.` + ); + ok = false; + } + seen.add(oldName); + } +}); +if (!ok) { + console.log('Renamings file is invalid.'); + process.exit(1); +} +// Default is a successful exit 0.