Skip to content

Commit

Permalink
feat: add app widget transparent to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenwienk committed Dec 23, 2024
1 parent 205902d commit 0d76303
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions assets/app/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,9 @@
"height": {
"type": ["number", "string"]
},
"transparent": {
"type": "boolean"
},
"settings": {
"type": "array"
},
Expand Down
12 changes: 8 additions & 4 deletions lib/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ class App {
}

for (const [widgetId, widget] of Object.entries(appJson.widgets)) {
if (widget.deprecated != null && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) {
throw new Error(`App widgets deprecated property require a compatibility of at least >=12.3.0. (${this._path})`);
if (widget.transparent !== undefined && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) {
throw new Error(`App widgets transparent property requires a compatibility of at least >=12.3.0. (${this._path})`);
}

if (widget.devices != null && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) {
throw new Error(`App widgets devices property require a compatibility of at least >=12.3.0. (${this._path})`);
if (widget.deprecated !== undefined && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) {
throw new Error(`App widgets deprecated property requires a compatibility of at least >=12.3.0. (${this._path})`);
}

if (widget.devices !== undefined && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) {
throw new Error(`App widgets devices property requires a compatibility of at least >=12.3.0. (${this._path})`);
}

// if widget.devices && widget.devices.type === 'global'
Expand Down

0 comments on commit 0d76303

Please sign in to comment.