Skip to content

Commit

Permalink
feat: add Stream Deck 6.7 (#10)
Browse files Browse the repository at this point in the history
* feat: add Stream Deck 6.7

* test: fix incorrect test file ref

---------

Co-authored-by: Richard Herman <[email protected]>
  • Loading branch information
GeekyEggo and GeekyEggo authored Jul 23, 2024
1 parent f8d701e commit 289d6a7
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@

# Change Log

## 0.3.6

### ✨ New

- Add Stream Deck 6.7.

## 0.3.5

### ✨ New

- Add `@elgato/schemas/streamdeck/plugins/json` export.

## 0.3.4
Expand Down
2 changes: 1 addition & 1 deletion src/streamdeck/plugins/manifest/__tests__/all.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { validateStreamDeckPluginManifest } from "@tests";

describe.each(["v6.4", "v6.5", "v6.6"])("%s", (version) => {
describe.each(["v6.4", "v6.5", "v6.6", "v6.7"])("%s", (version) => {
const filePath = `${version}.json`;

/**
Expand Down
91 changes: 91 additions & 0 deletions src/streamdeck/plugins/manifest/__tests__/files/v6.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"$schema": "../../../../../../streamdeck/plugins/manifest.json",
"Actions": [
{
"Controllers": ["Encoder", "Keypad"],
"DisableAutomaticStates": true,
"DisableCaching": false,
"Encoder": {
"background": "background",
"Icon": "icon",
"layout": "$A0",
"StackColor": "#000000",
"TriggerDescription": {
"LongTouch": "Long touch",
"Push": "Push",
"Rotate": "Rotate",
"Touch": "Touch"
}
},
"Icon": "action-icon",
"Name": "Action One",
"OS": ["mac", "windows"],
"PropertyInspectorPath": "action.html",
"States": [
{
"FontFamily": "Arial",
"FontSize": 12,
"FontStyle": "Bold",
"FontUnderline": true,
"Image": "action-state-image",
"MultiActionImage": "action-state-multi-action-image",
"Name": "Action State One",
"ShowTitle": true,
"Title": "State One",
"TitleAlignment": "bottom",
"TitleColor": "#000000"
}
],
"SupportedInMultiActions": true,
"Tooltip": "This is the tooltip",
"UserTitleEnabled": true,
"UUID": "com.elgato.test.one",
"VisibleInActionsList": true
}
],
"ApplicationsToMonitor": {
"mac": ["finder"],
"windows": ["explorer.exe"]
},
"Author": "Elgato",
"Category": "Testing",
"CategoryIcon": "category-icon",
"CodePath": "main.js",
"CodePathMac": "main-darwin.js",
"CodePathWin": "main-windows.js",
"DefaultWindowSize": [500, 650],
"Description": "Manifest version 6.4",
"Icon": "icon",
"Name": "Test Manifest",
"Nodejs": {
"Debug": "break",
"GenerateProfilerOutput": false,
"Version": "20"
},
"OS": [
{
"MinimumVersion": "13",
"Platform": "mac"
},
{
"MinimumVersion": "10",
"Platform": "windows"
}
],
"Profiles": [
{
"DeviceType": 7,
"DontAutoSwitchWhenInstalled": true,
"Name": "Test Profile",
"Readonly": true
}
],
"PropertyInspectorPath": "pi.html",
"SDKVersion": 2,
"Software": {
"MinimumVersion": "6.7"
},
"URL": "https://www.elgato.com",
"UUID": "com.elgato.test",
"Version": "1.0.0.0"
}
47 changes: 47 additions & 0 deletions src/streamdeck/plugins/manifest/__tests__/v6.7.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { validateStreamDeckPluginManifest } from "@tests";

const VERSION = "6.7";

describe("v6.7", () => {
/**
* Asserts a valid v6.7 manifest.
*/
test("full manifest", () => {
// Arrange, act, assert.
const errors = validateStreamDeckPluginManifest("v6.7.json");
expect(errors).toHaveLength(0);
});

/**
* Asserts more than 2 states are allowed.
*/
test("Actions[].States[] allow more than 2 items", () => {
// Arrange, act, assert.
const errors = validateStreamDeckPluginManifest("v6.7.json", (m) => {
m.Actions[0].States.push({ Image: "imgs/two" });
m.Actions[0].States.push({ Image: "imgs/three" });
m.Actions[0].States.push({ Image: "imgs/four" });
});
expect(errors).toHaveLength(0);
});

describe("v6.7 features", () => {
/**
* Asserts `Actions[].OS` is not valid for a v6.5 manifest.
*/
test("Actions[].OS is valid", () => {
// Arrange, act, assert.
const errors = validateStreamDeckPluginManifest("Actions[].OS.json", (m) => (m.Software.MinimumVersion = VERSION));
expect(errors).toHaveLength(0);
});

/**
* Asserts `Profiles[].AutoInstall` is not valid for a v6.5 manifest.
*/
test("Profiles[].AutoInstall is valid", () => {
// Arrange, act, assert.
const errors = validateStreamDeckPluginManifest("Profiles[].AutoInstall.json", (m) => (m.Software.MinimumVersion = VERSION));
expect(errors).toHaveLength(0);
});
});
});
2 changes: 1 addition & 1 deletion src/streamdeck/plugins/manifest/latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type Software = {
/**
* Minimum version of the Stream Deck application required for this plugin to run.
*/
MinimumVersion: "6.4" | "6.5" | "6.6";
MinimumVersion: "6.4" | "6.5" | "6.6" | "6.7";
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/streamdeck/plugins/manifest/v6.6.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Manifest } from "./latest";
import type { Manifest_6_7 } from "./v6.7";

/**
* Defines the plugin and available actions, and all information associated with them, including the plugin's entry point, all iconography, action default behavior, etc.
*/
export type Manifest_6_6 = Omit<Manifest, "Software"> & {
export type Manifest_6_6 = Omit<Manifest_6_7, "Software"> & {
/**
* Determines the Stream Deck software requirements for this plugin.
*/
Expand Down
16 changes: 16 additions & 0 deletions src/streamdeck/plugins/manifest/v6.7.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Manifest } from "./latest";

/**
* Defines the plugin and available actions, and all information associated with them, including the plugin's entry point, all iconography, action default behavior, etc.
*/
export type Manifest_6_7 = Omit<Manifest, "Software"> & {
/**
* Determines the Stream Deck software requirements for this plugin.
*/
Software: {
/**
* Minimum version of the Stream Deck application required for this plugin to run.
*/
MinimumVersion: "6.7";
};
};
3 changes: 2 additions & 1 deletion src/streamdeck/plugins/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { type Manifest_6_4 } from "./manifest/v6.4";
import { type Manifest_6_5 } from "./manifest/v6.5";
import { type Manifest_6_6 } from "./manifest/v6.6";
import { type Manifest_6_7 } from "./manifest/v6.7";

/**
* Defines the plugin and available actions, and all information associated with them, including the plugin's entry point, all iconography, action default behavior, etc.
*/
export type Manifest = JsonSchema<Manifest_6_4> | JsonSchema<Manifest_6_5> | JsonSchema<Manifest_6_6>;
export type Manifest = JsonSchema<Manifest_6_4> | JsonSchema<Manifest_6_5> | JsonSchema<Manifest_6_6> | JsonSchema<Manifest_6_7>;

export type { Layout } from "./layout";

Expand Down

0 comments on commit 289d6a7

Please sign in to comment.