@elgato/cli 0.3.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elgato/cli",
3
- "version": "0.3.1",
4
- "description": "CLI tool for building with Stream Deck.",
3
+ "version": "1.0.0",
4
+ "description": "Stream Deck CLI tool for building with Stream Deck.",
5
5
  "bin": {
6
6
  "streamdeck": "bin/streamdeck.mjs",
7
7
  "sd": "bin/streamdeck.mjs"
@@ -1,14 +1,17 @@
1
1
  {
2
- /* Prefer tabs over spaces for accessibility */
3
- "editor.insertSpaces": false,
4
- "editor.detectIndentation": false,
5
- /* Explorer */
6
- "explorer.fileNesting.enabled": true,
7
- "explorer.fileNesting.patterns": {
8
- "*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
9
- "package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, rollup.config.mjs, tsconfig.json"
10
- },
11
- "files.exclude": {
12
- "node_modules": true
13
- }
2
+ /* JSON schemas */
3
+ "json.schemas": [
4
+ {
5
+ "fileMatch": [
6
+ "**/manifest.json"
7
+ ],
8
+ "url": "https://schemas.elgato.com/streamdeck/plugins/manifest.json"
9
+ },
10
+ {
11
+ "fileMatch": [
12
+ "**/layouts/*.json"
13
+ ],
14
+ "url": "https://schemas.elgato.com/streamdeck/plugins/layout.json"
15
+ }
16
+ ]
14
17
  }
@@ -8,6 +8,7 @@
8
8
  "UUID": "<%- uuid %>.increment",
9
9
  "Icon": "imgs/actions/counter/icon",
10
10
  "Tooltip": "Displays a count, which increments by one on press.",
11
+ "PropertyInspectorPath": "ui/increment-counter.html",
11
12
  "Controllers": [
12
13
  "Keypad"
13
14
  ],
@@ -26,7 +27,7 @@
26
27
  "Icon": "imgs/plugin/marketplace",
27
28
  "SDKVersion": 2,
28
29
  "Software": {
29
- "MinimumVersion": "6.5"
30
+ "MinimumVersion": "6.4"
30
31
  },
31
32
  "OS": [
32
33
  {
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head lang="en">
5
+ <title>Increment Counter Settings</title>
6
+ <meta charset="utf-8" />
7
+ <script src="https://sdpi-components.dev/releases/v3/sdpi-components.js"></script>
8
+ </head>
9
+
10
+ <body>
11
+ <!--
12
+ Learn more about property inspector components at https://sdpi-components.dev/docs/components
13
+ -->
14
+ <sdpi-item label="Increment By">
15
+ <sdpi-range setting="incrementBy" min="1" max="5" step="1" default="1" showlabels></sdpi-range>
16
+ </sdpi-item>
17
+ </body>
18
+
19
+ </html>
@@ -1,22 +1,22 @@
1
1
  {
2
- "scripts": {
3
- "build": "rollup -c",
4
- "watch": "rollup -c -w --watch.onEnd=\"streamdeck restart <%- uuid %>\""
5
- },
6
- "type": "module",
7
- "devDependencies": {
8
- "@elgato/cli": <%- JSON.stringify(npm.cli) %>,
9
- "@rollup/plugin-commonjs": "^25.0.5",
10
- "@rollup/plugin-node-resolve": "^15.2.2",
11
- "@rollup/plugin-terser": "^0.4.4",
12
- "@rollup/plugin-typescript": "^11.1.5",
13
- "@tsconfig/node20": "^20.1.2",
14
- "@types/node": "20.8.10",
15
- "rollup": "^4.0.2",
16
- "tslib": "^2.6.2",
17
- "typescript": "^5.2.2"
18
- },
19
- "dependencies": {
20
- "@elgato/streamdeck": <%- JSON.stringify(npm.streamDeck) %>
21
- }
22
- }
2
+ "scripts": {
3
+ "build": "rollup -c",
4
+ "watch": "rollup -c -w --watch.onEnd=\"streamdeck restart <%- uuid %>\""
5
+ },
6
+ "type": "module",
7
+ "devDependencies": {
8
+ "@elgato/cli": <%- JSON.stringify(npm.cli) %>,
9
+ "@rollup/plugin-commonjs": "^28.0.0",
10
+ "@rollup/plugin-node-resolve": "^15.2.2",
11
+ "@rollup/plugin-terser": "^0.4.4",
12
+ "@rollup/plugin-typescript": "^12.1.0",
13
+ "@tsconfig/node20": "^20.1.2",
14
+ "@types/node": "~20.15.0",
15
+ "rollup": "^4.0.2",
16
+ "tslib": "^2.6.2",
17
+ "typescript": "^5.2.2"
18
+ },
19
+ "dependencies": {
20
+ "@elgato/streamdeck": <%- JSON.stringify(npm.streamDeck) %>
21
+ }
22
+ }
@@ -6,11 +6,11 @@ import { action, KeyDownEvent, SingletonAction, WillAppearEvent } from "@elgato/
6
6
  @action({ UUID: "<%- uuid %>.increment" })
7
7
  export class IncrementCounter extends SingletonAction<CounterSettings> {
8
8
  /**
9
- * The {@link SingletonAction.onWillAppear} event is useful for setting the visual representation of an action when it become visible. This could be due to the Stream Deck first
9
+ * The {@link SingletonAction.onWillAppear} event is useful for setting the visual representation of an action when it becomes visible. This could be due to the Stream Deck first
10
10
  * starting up, or the user navigating between pages / folders etc.. There is also an inverse of this event in the form of {@link streamDeck.client.onWillDisappear}. In this example,
11
11
  * we're setting the title to the "count" that is incremented in {@link IncrementCounter.onKeyDown}.
12
12
  */
13
- onWillAppear(ev: WillAppearEvent<CounterSettings>): void | Promise<void> {
13
+ override onWillAppear(ev: WillAppearEvent<CounterSettings>): void | Promise<void> {
14
14
  return ev.action.setTitle(`${ev.payload.settings.count ?? 0}`);
15
15
  }
16
16
 
@@ -20,14 +20,15 @@ export class IncrementCounter extends SingletonAction<CounterSettings> {
20
20
  * and action information where applicable. In this example, our action will display a counter that increments by one each press. We track the current count on the action's persisted
21
21
  * settings using `setSettings` and `getSettings`.
22
22
  */
23
- async onKeyDown(ev: KeyDownEvent<CounterSettings>): Promise<void> {
24
- // Determine the current count from the settings.
25
- let count = ev.payload.settings.count ?? 0;
26
- count++;
23
+ override async onKeyDown(ev: KeyDownEvent<CounterSettings>): Promise<void> {
24
+ // Update the count from the settings.
25
+ const { settings } = ev.payload;
26
+ settings.incrementBy ??= 1;
27
+ settings.count = (settings.count ?? 0) + settings.incrementBy;
27
28
 
28
29
  // Update the current count in the action's settings, and change the title.
29
- await ev.action.setSettings({ count });
30
- await ev.action.setTitle(`${count}`);
30
+ await ev.action.setSettings(settings);
31
+ await ev.action.setTitle(`${settings.count}`);
31
32
  }
32
33
  }
33
34
 
@@ -35,5 +36,6 @@ export class IncrementCounter extends SingletonAction<CounterSettings> {
35
36
  * Settings for {@link IncrementCounter}.
36
37
  */
37
38
  type CounterSettings = {
38
- count: number;
39
+ count?: number;
40
+ incrementBy?: number;
39
41
  };
@@ -5,7 +5,8 @@
5
5
  "node"
6
6
  ],
7
7
  "module": "ES2022",
8
- "moduleResolution": "Bundler"
8
+ "moduleResolution": "Bundler",
9
+ "noImplicitOverride": true
9
10
  },
10
11
  "include": [
11
12
  "src/**/*.ts"