From 31b02a08dac8bf27212fdb213a7d93b5b3a685ba Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 7 Apr 2024 15:04:28 +0800 Subject: [PATCH] fix: use @eggjs/ajv-keywords and @eggjs/ajv-formats (#204) - https://github.com/eggjs/ajv-keywords/commit/1ce38b62e1181550e58926f53b2cc6963c152bde - https://github.com/eggjs/ajv-formats/commit/8b82af10efb4421a3d9428402b0f5576c5493811 ## Summary by CodeRabbit - **Chores** - Updated the dependency for keyword validation in the plugin system to improve stability and compatibility. - Added the `ajv` package as a new dev dependency in `package.json`. --- package.json | 1 + plugin/ajv/lib/Ajv.ts | 4 ++-- plugin/ajv/package.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f5266cbc..3dd72666 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "devDependencies": { "@eggjs/tsconfig": "^1.0.0", "@istanbuljs/nyc-config-typescript": "^1.0.1", + "ajv": "^8.12.0", "eslint": "^8.0.0", "eslint-config-egg": "^12.0.0", "eslint-plugin-import": "^2.24.2", diff --git a/plugin/ajv/lib/Ajv.ts b/plugin/ajv/lib/Ajv.ts index beca399d..31bc5249 100644 --- a/plugin/ajv/lib/Ajv.ts +++ b/plugin/ajv/lib/Ajv.ts @@ -1,6 +1,6 @@ import Ajv2019, { type Schema } from 'ajv/dist/2019'; -import addFormats from 'ajv-formats'; -import keyWords from 'ajv-keywords'; +import addFormats from '@eggjs/ajv-formats'; +import keyWords from '@eggjs/ajv-keywords'; import { type Ajv as IAjv, AjvInvalidParamError } from '@eggjs/tegg/ajv'; import { SingletonProto, AccessLevel, LifecycleInit } from '@eggjs/tegg'; diff --git a/plugin/ajv/package.json b/plugin/ajv/package.json index 9c2220a4..b553d640 100644 --- a/plugin/ajv/package.json +++ b/plugin/ajv/package.json @@ -49,8 +49,8 @@ "@eggjs/tegg": "^3.36.0", "@sinclair/typebox": "^0.32.20", "ajv": "^8.12.0", - "ajv-formats": "^3.0.1", - "ajv-keywords": "^5.1.0" + "@eggjs/ajv-formats": "^3.0.1", + "@eggjs/ajv-keywords": "^5.1.0" }, "devDependencies": { "@eggjs/tegg-config": "^3.36.0",