From 4fd71222c96115c84b6f0aa87e22222a546c8649 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 23 Apr 2025 02:34:59 +0300 Subject: [PATCH] fix: missing `@types/json-schema` in types --- lib/cli.js | 6 ++++- package.json | 3 ++- types.d.ts | 74 ++++++++++++++++++++++++---------------------------- yarn.lock | 8 +++--- 4 files changed, 45 insertions(+), 46 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 7b580623d..168bdef7a 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -8,7 +8,11 @@ const path = require("path"); const webpackSchema = require("../schemas/WebpackOptions.json"); -/** @typedef {Parameters[0] & { absolutePath: boolean, instanceof: string, cli: { helper?: boolean, exclude?: boolean, description?: string, negatedDescription?: string, resetDescription?: string } }} Schema */ +/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */ +/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ +/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ +/** @typedef {JSONSchema4 | JSONSchema6 | JSONSchema7} JSONSchema */ +/** @typedef {JSONSchema & { absolutePath: boolean, instanceof: string, cli: { helper?: boolean, exclude?: boolean, description?: string, negatedDescription?: string, resetDescription?: string } }} Schema */ // TODO add originPath to PathItem for better errors /** diff --git a/package.json b/package.json index f125b636d..453ab64d5 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", @@ -23,7 +24,7 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^4.3.0", + "schema-utils": "^4.3.2", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.11", "watchpack": "^2.4.1", diff --git a/types.d.ts b/types.d.ts index 7a33b50d9..25c2cd0e9 100644 --- a/types.d.ts +++ b/types.d.ts @@ -92,10 +92,7 @@ import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema"; import { ListenOptions, Server } from "net"; import { validate as validateFunction } from "schema-utils"; import { default as ValidationError } from "schema-utils/declarations/ValidationError"; -import { - Extend, - ValidationErrorConfiguration -} from "schema-utils/declarations/validate"; +import { ValidationErrorConfiguration } from "schema-utils/declarations/validate"; import { AsArray, AsyncParallelHook, @@ -16238,42 +16235,39 @@ declare namespace exports { export namespace cli { export let getArguments: ( schema?: - | (JSONSchema4 & - Extend & { - absolutePath: boolean; - instanceof: string; - cli: { - helper?: boolean; - exclude?: boolean; - description?: string; - negatedDescription?: string; - resetDescription?: string; - }; - }) - | (JSONSchema6 & - Extend & { - absolutePath: boolean; - instanceof: string; - cli: { - helper?: boolean; - exclude?: boolean; - description?: string; - negatedDescription?: string; - resetDescription?: string; - }; - }) - | (JSONSchema7 & - Extend & { - absolutePath: boolean; - instanceof: string; - cli: { - helper?: boolean; - exclude?: boolean; - description?: string; - negatedDescription?: string; - resetDescription?: string; - }; - }) + | (JSONSchema4 & { + absolutePath: boolean; + instanceof: string; + cli: { + helper?: boolean; + exclude?: boolean; + description?: string; + negatedDescription?: string; + resetDescription?: string; + }; + }) + | (JSONSchema6 & { + absolutePath: boolean; + instanceof: string; + cli: { + helper?: boolean; + exclude?: boolean; + description?: string; + negatedDescription?: string; + resetDescription?: string; + }; + }) + | (JSONSchema7 & { + absolutePath: boolean; + instanceof: string; + cli: { + helper?: boolean; + exclude?: boolean; + description?: string; + negatedDescription?: string; + resetDescription?: string; + }; + }) ) => Flags; export let processArguments: ( args: Flags, diff --git a/yarn.lock b/yarn.lock index ce4fd1ba3..956765d9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5480,10 +5480,10 @@ schema-utils@^3.0.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" -schema-utils@^4.0.0, schema-utils@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" - integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== +schema-utils@^4.0.0, schema-utils@^4.3.0, schema-utils@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.2.tgz#0c10878bf4a73fd2b1dfd14b9462b26788c806ae" + integrity sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ== dependencies: "@types/json-schema" "^7.0.9" ajv "^8.9.0"