Move schemas to constant folder (#15207)

- move schemas to constants
- increase npm package version
This commit is contained in:
martmull
2025-10-20 15:41:53 +02:00
committed by GitHub
parent 3aa448d951
commit 7723fa70a4
13 changed files with 27 additions and 23 deletions
@@ -8,6 +8,7 @@ import {
SERVERLESS_FUNCTION_SCHEMA_URL,
TRIGGER_SCHEMA_URL,
} from '../constants/schemas';
import { BASE_SCHEMAS_PATH } from '../constants/constants-path';
export class SchemaValidationError extends Error {
constructor(
@@ -49,8 +50,7 @@ export const validateSchema = async (
let schema;
for (const name of Object.keys(schemaUrls) as (keyof typeof schemaUrls)[]) {
const schemasDir = path.join(__dirname, '../../schemas');
const schemaPath = path.join(schemasDir, `${name}.schema.json`);
const schemaPath = path.join(BASE_SCHEMAS_PATH, `${name}.schema.json`);
ajv.addSchema(await fs.readJson(schemaPath));
if (name === schemaName) {