From 8aa472615e21f63b5129ca1e84133c616e3d0168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ro=C5=BCek?= Date: Fri, 3 May 2024 01:24:17 +0200 Subject: [PATCH] chore: remove some deps used by benchmark --- benchmarks/utils/hook.mjs | 13 +-- benchmarks/utils/load-document.mjs | 6 +- package-lock.json | 136 ++++------------------------- package.json | 2 - 4 files changed, 27 insertions(+), 130 deletions(-) diff --git a/benchmarks/utils/hook.mjs b/benchmarks/utils/hook.mjs index f1a251d..4d7f044 100644 --- a/benchmarks/utils/hook.mjs +++ b/benchmarks/utils/hook.mjs @@ -1,9 +1,12 @@ -import * as fs from 'node:fs/promises'; -const { dependencies } = JSON.parse( - await fs.readFile('../../package.json', 'utf8'), -); +const dependencies = [ + '@jsep-plugin/regex', + '@jsep-plugin/ternary', + 'jsep', + 'astring', +]; + export async function resolve(specifier, context, nextResolve) { - if (Object.hasOwn(dependencies, specifier)) { + if (dependencies.includes(specifier)) { return nextResolve(`https://cdn.skypack.dev/${specifier}`, context); } diff --git a/benchmarks/utils/load-document.mjs b/benchmarks/utils/load-document.mjs index a63f0d6..4545da3 100644 --- a/benchmarks/utils/load-document.mjs +++ b/benchmarks/utils/load-document.mjs @@ -7,7 +7,9 @@ export default async function loadDocument(scenario, document) { if (!document) { assert.ok(scenario.defaultDocument); const { fileURLToPath } = await import('node:url'); - const { JSONSchemaFaker } = await import('json-schema-faker'); + const { JSONSchemaFaker } = await import( + 'https://cdn.skypack.dev/json-schema-faker' + ); const cwd = path.join(path.dirname(fileURLToPath(import.meta.url)), '..'); const schema = JSON.parse( @@ -17,7 +19,7 @@ export default async function loadDocument(scenario, document) { return JSONSchemaFaker.generate(schema); } - const yaml = await import('js-yaml'); + const yaml = await import('https://cdn.skypack.dev://js-yaml'); if (document.startsWith('https://')) { return yaml.load(await (await fetch(document)).text()); diff --git a/package-lock.json b/package-lock.json index eddfa62..9b0ed32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,8 +18,6 @@ "eslint-plugin-simple-import-sort": "^12.1.0", "husky": "^9.0.10", "iso-bench": "^2.4.7", - "js-yaml": "^4.1.0", - "json-schema-faker": "^0.5.5", "jsonpath-plus": "^8.0.0", "lodash-es": "^4.17.21", "prettier": "^3.2.5", @@ -51,17 +49,6 @@ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@eslint-community/regexpp": { "version": "4.10.0", "dev": true, @@ -311,11 +298,6 @@ "concat-map": "0.0.1" } }, - "node_modules/call-me-maybe": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -456,6 +438,18 @@ "eslint": ">=5.0.0" } }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", "dev": true, @@ -495,15 +489,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "dev": true, @@ -544,18 +529,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/esprima": { - "version": "4.0.1", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/esquery": { "version": "1.5.0", "dev": true, @@ -567,14 +540,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "dev": true, @@ -586,10 +551,11 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -673,11 +639,6 @@ "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, - "node_modules/format-util": { - "version": "1.0.5", - "dev": true, - "license": "MIT" - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -816,60 +777,6 @@ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, - "node_modules/json-schema-faker": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/json-schema-faker/-/json-schema-faker-0.5.5.tgz", - "integrity": "sha512-MlnBqcsM1t8jdHs00ltae0rlSwWI2nrd1IfnAF+UcHsqKFrlAhrbDFVKiA8C0E860PuspKoV4oImJdvtF7aqwg==", - "dev": true, - "dependencies": { - "json-schema-ref-parser": "^6.1.0", - "jsonpath-plus": "^7.2.0" - }, - "bin": { - "jsf": "bin/gen.cjs" - } - }, - "node_modules/json-schema-faker/node_modules/jsonpath-plus": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-7.2.0.tgz", - "integrity": "sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA==", - "dev": true, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/json-schema-ref-parser": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.12.1", - "ono": "^4.0.11" - } - }, - "node_modules/json-schema-ref-parser/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/json-schema-ref-parser/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -961,14 +868,6 @@ "dev": true, "license": "MIT" }, - "node_modules/ono": { - "version": "4.0.11", - "dev": true, - "license": "MIT", - "dependencies": { - "format-util": "^1.0.3" - } - }, "node_modules/optionator": { "version": "0.9.3", "dev": true, @@ -1187,11 +1086,6 @@ "node": ">=8" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/strip-ansi": { "version": "6.0.1", "dev": true, diff --git a/package.json b/package.json index 74bb450..ca8803b 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,6 @@ "eslint-plugin-simple-import-sort": "^12.1.0", "husky": "^9.0.10", "iso-bench": "^2.4.7", - "js-yaml": "^4.1.0", - "json-schema-faker": "^0.5.5", "jsonpath-plus": "^8.0.0", "lodash-es": "^4.17.21", "prettier": "^3.2.5",