Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add platformLocalRequiredFeatures #365

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions assets/app/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,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
Loading