Skip to content

Commit

Permalink
Merge pull request #383 from athombv/master
Browse files Browse the repository at this point in the history
Merge master into production (#minor)
  • Loading branch information
RobinBol authored Dec 7, 2023
2 parents 776af22 + 48f2042 commit f1062e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assets/app/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,17 @@
]
}
},
"platformLocalRequiredFeatures": {
"type": "array",
"items": {
"type": "string",
"enum": [
"nfc",
"speaker",
"ledring"
]
}
},
"tags": {
"$ref": "#/definitions/i18nArray"
},
Expand Down
12 changes: 12 additions & 0 deletions lib/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ class App {
}
}

// validate that there are no platform local required features defined when targetting cloud
if ((appJson.platforms || []).includes('cloud')
&& (appJson.platformLocalRequiredFeatures || []).length > 0) {
throw new Error('The property `platformLocalRequiredFeatures` can not be used in combination with platform: `cloud`.');
}

// validate that platforms includes local when using platformLocalRequiredFeatures
if ((appJson.platforms || []).includes('local') === false
&& (appJson.platformLocalRequiredFeatures || []).length > 0) {
console.warn('Warning: using `platformLocalRequiredFeatures` requires `platforms: [local]`.');
}

if (levelVerified) {
if (appJson.platforms === undefined) {
throw new Error('The property `platforms` is required in order to publish a verified app.');
Expand Down

0 comments on commit f1062e4

Please sign in to comment.