diff options
author | 2021-09-23 07:45:29 +0530 | |
---|---|---|
committer | 2021-09-23 07:45:29 +0530 | |
commit | 88b36b890e2c1b82867cb86417d6abfde13bae90 (patch) | |
tree | bb20bf57c97c9d16ab8239c9335e01a87abddec9 | |
parent | feature: Add new recipe for 'stackoverflow-chat' (diff) | |
download | ferdium-recipes-88b36b890e2c1b82867cb86417d6abfde13bae90.tar.gz ferdium-recipes-88b36b890e2c1b82867cb86417d6abfde13bae90.tar.zst ferdium-recipes-88b36b890e2c1b82867cb86417d6abfde13bae90.zip |
chore: added more verifications for recipe's package.json
-rw-r--r-- | scripts/package.js | 12 |
1 files changed, 10 insertions, 2 deletions
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) => { | |||
117 | 117 | ||
118 | const topLevelKeys = Object.keys(config); | 118 | const topLevelKeys = Object.keys(config); |
119 | topLevelKeys.forEach(key => { | 119 | topLevelKeys.forEach(key => { |
120 | if (typeof(config[key]) === 'string' && config[key] === '') { | 120 | if (typeof(config[key]) === 'string') { |
121 | configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); | 121 | if (config[key] === '') { |
122 | configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); | ||
123 | } | ||
124 | } else if ((key === 'config' || key === 'aliases') && typeof(config[key]) !== 'object') { | ||
125 | configErrors.push(`The recipe's package.json contains unexpected value for key: ${key}`); | ||
122 | } | 126 | } |
123 | }); | 127 | }); |
124 | 128 | ||
@@ -135,6 +139,10 @@ const compress = (src, dest) => new Promise((resolve, reject) => { | |||
135 | configErrors.push(`The recipe's package.json contains the following keys that are not recognized: ${unrecognizedConfigKeys}`); | 139 | configErrors.push(`The recipe's package.json contains the following keys that are not recognized: ${unrecognizedConfigKeys}`); |
136 | } | 140 | } |
137 | 141 | ||
142 | // if (config.config.hasCustomUrl !== undefined && config.config.hasHostedOption !== undefined) { | ||
143 | // configErrors.push("The recipe's package.json contains both 'hasCustomUrl' and 'hasHostedOption'. Please remove 'hasCustomUrl' since it is overridden by 'hasHostedOption'"); | ||
144 | // } | ||
145 | |||
138 | configKeys.forEach(key => { | 146 | configKeys.forEach(key => { |
139 | if (typeof(config.config[key]) === 'string' && config.config[key] === '') { | 147 | if (typeof(config.config[key]) === 'string' && config.config[key] === '') { |
140 | configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); | 148 | configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); |