From d60ec04bb43c955870a93ccf9f8da63f170ab24c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Aug 2021 02:19:26 +0000 Subject: [PATCH] update: update dependency @apextoaster/js-yaml-schema to v0.5.0 (#836) * update: update dependency @apextoaster/js-yaml-schema to v0.5.0 * fix(parser): add include tag back to updated schema Co-authored-by: Renovate Bot Co-authored-by: ssube --- package.json | 2 +- src/parser/YamlParser.ts | 22 +++++++++++++--------- yarn.lock | 8 ++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index eda786f..c69aaab 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "license": "MIT", "devDependencies": { "@apextoaster/js-utils": "0.4.0", - "@apextoaster/js-yaml-schema": "0.4.0-4", + "@apextoaster/js-yaml-schema": "0.5.0", "@istanbuljs/nyc-config-typescript": "1.0.1", "@microsoft/api-documenter": "7.13.34", "@microsoft/api-extractor": "7.18.4", diff --git a/src/parser/YamlParser.ts b/src/parser/YamlParser.ts index 10a3413..ce7bdb1 100644 --- a/src/parser/YamlParser.ts +++ b/src/parser/YamlParser.ts @@ -1,4 +1,4 @@ -import { createSchema } from '@apextoaster/js-yaml-schema'; +import { createInclude, createSchema } from '@apextoaster/js-yaml-schema'; import { existsSync, readFileSync, realpathSync } from 'fs'; import { DEFAULT_SCHEMA, dump, loadAll, Schema } from 'js-yaml'; import { join } from 'path'; @@ -11,15 +11,19 @@ export class YamlParser implements Parser { protected schema: Schema; constructor() { - this.schema = createSchema({ - include: { - exists: existsSync, - join, - read: readFileSync, - resolve: realpathSync, - schema: DEFAULT_SCHEMA, - }, + const include = createInclude({ + exists: existsSync, + join, + read: readFileSync, + resolve: realpathSync, + schema: DEFAULT_SCHEMA, }); + + this.schema = createSchema({}).extend([ + include.includeType, + ]); + + include.setSchema(this.schema); } public dump(...data: Array): string { diff --git a/yarn.lock b/yarn.lock index 5e93d2b..a6a728f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://artifacts.apextoaster.com/repository/group-npm/@apextoaster/js-utils/-/js-utils-0.4.0.tgz#2fc1b83af1a4196ea2487d261c9bf6a6d922e814" integrity sha512-vJHsEK5jFVSUQi8cNb5GhsQMEPyedBxGgxh6/s99GHGiQOMWZtkkNacjagOPGUGPqHymybthrqAhHkLlLQCkSw== -"@apextoaster/js-yaml-schema@0.4.0-4": - version "0.4.0-4" - resolved "https://artifacts.apextoaster.com/repository/group-npm/@apextoaster/js-yaml-schema/-/js-yaml-schema-0.4.0-4.tgz#fe9aa034f94a395b8c7eb62b638883a8bc6cbe7d" - integrity sha512-StRuVWApi4O5esIoEeMfYIImK821OcMTiJ2siihQKJgXAc/HDWuAEeq0K0DgZBZP0lHjEuFOheeDNHeCLNH/fA== +"@apextoaster/js-yaml-schema@0.5.0": + version "0.5.0" + resolved "https://artifacts.apextoaster.com/repository/group-npm/@apextoaster/js-yaml-schema/-/js-yaml-schema-0.5.0.tgz#89fad34edfc10c610c3cf14b903394b8e69ebd43" + integrity sha512-141EWf39jhL6uIEjVbd3eNeopfUTXlEBV8CIzE/p8m8WfzV0vn3KmcSEVZNy6FJgyclW5a0bay2KF/TqRrCmPw== "@babel/code-frame@7.12.11": version "7.12.11"