From 75e34e6aede6d0e5541c648e2fa8d5978365bdbb Mon Sep 17 00:00:00 2001 From: Wil Wilsman Date: Fri, 6 Nov 2020 14:40:19 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Load=20core=20config=20schema=20?= =?UTF-8?q?for=20cli-config=20validation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli-config/package.json | 4 ++++ packages/cli-config/src/hooks/init.js | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 packages/cli-config/src/hooks/init.js diff --git a/packages/cli-config/package.json b/packages/cli-config/package.json index 527e11a1d..cb6a83f35 100644 --- a/packages/cli-config/package.json +++ b/packages/cli-config/package.json @@ -24,6 +24,9 @@ "oclif": { "bin": "percy", "commands": "./dist/commands", + "hooks": { + "init": "./dist/hooks/init" + }, "topics": { "config": { "description": "manage Percy config files" @@ -34,6 +37,7 @@ "@oclif/command": "^1.8.0", "@oclif/config": "^1.17.0", "@percy/config": "^1.0.0-beta.20", + "@percy/core": "^1.0.0-beta.20", "@percy/logger": "^1.0.0-beta.20", "path-type": "^4.0.0" } diff --git a/packages/cli-config/src/hooks/init.js b/packages/cli-config/src/hooks/init.js new file mode 100644 index 000000000..735ef4b31 --- /dev/null +++ b/packages/cli-config/src/hooks/init.js @@ -0,0 +1,7 @@ +import PercyConfig from '@percy/config'; +import { schema } from '@percy/core/dist/config'; + +// ensures the core schema is loaded +export default function() { + PercyConfig.addSchema(schema); +}