From 88b36b890e2c1b82867cb86417d6abfde13bae90 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 23 Sep 2021 07:45:29 +0530 Subject: chore: added more verifications for recipe's package.json --- scripts/package.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts/package.js') diff --git a/scripts/package.js b/scripts/package.js index 26580d5..2675ffb 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -117,8 +117,12 @@ const compress = (src, dest) => new Promise((resolve, reject) => { const topLevelKeys = Object.keys(config); topLevelKeys.forEach(key => { - if (typeof(config[key]) === 'string' && config[key] === '') { - configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); + if (typeof(config[key]) === 'string') { + if (config[key] === '') { + configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); + } + } else if ((key === 'config' || key === 'aliases') && typeof(config[key]) !== 'object') { + configErrors.push(`The recipe's package.json contains unexpected value for key: ${key}`); } }); @@ -135,6 +139,10 @@ const compress = (src, dest) => new Promise((resolve, reject) => { configErrors.push(`The recipe's package.json contains the following keys that are not recognized: ${unrecognizedConfigKeys}`); } + // if (config.config.hasCustomUrl !== undefined && config.config.hasHostedOption !== undefined) { + // configErrors.push("The recipe's package.json contains both 'hasCustomUrl' and 'hasHostedOption'. Please remove 'hasCustomUrl' since it is overridden by 'hasHostedOption'"); + // } + configKeys.forEach(key => { if (typeof(config.config[key]) === 'string' && config.config[key] === '') { configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); -- cgit v1.2.3-54-g00ecf