@elgato/cli 1.5.1 → 1.7.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/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import chalk6 from "chalk";
|
|
|
10
10
|
|
|
11
11
|
// src/validation/entry.ts
|
|
12
12
|
import chalk from "chalk";
|
|
13
|
-
import { EOL } from "
|
|
13
|
+
import { EOL } from "os";
|
|
14
14
|
var ValidationEntry = class {
|
|
15
15
|
/**
|
|
16
16
|
* Initializes a new instance of the {@link ValidationEntry} class.
|
|
@@ -295,10 +295,10 @@ var ValidationContext = class {
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// src/validation/plugin/plugin.ts
|
|
298
|
-
import { basename, dirname, join, resolve } from "
|
|
298
|
+
import { basename as basename2, dirname, join as join2, resolve as resolve2 } from "path";
|
|
299
299
|
|
|
300
300
|
// src/json/file-context.ts
|
|
301
|
-
import { existsSync, readFileSync } from "
|
|
301
|
+
import { existsSync, readFileSync } from "fs";
|
|
302
302
|
|
|
303
303
|
// src/json/map.ts
|
|
304
304
|
var JsonObjectMap = class {
|
|
@@ -648,6 +648,9 @@ function getComparison(comparison) {
|
|
|
648
648
|
|
|
649
649
|
// src/stream-deck.ts
|
|
650
650
|
import find from "find-process";
|
|
651
|
+
import { readdirSync, readlinkSync } from "fs";
|
|
652
|
+
import os from "os";
|
|
653
|
+
import { basename, join, resolve } from "path";
|
|
651
654
|
function isPredefinedLayoutLike(value) {
|
|
652
655
|
return value.startsWith("$") === true && !value.endsWith(".json");
|
|
653
656
|
}
|
|
@@ -661,11 +664,11 @@ function isValidPluginId(uuid) {
|
|
|
661
664
|
// src/validation/plugin/plugin.ts
|
|
662
665
|
var directorySuffix = ".sdPlugin";
|
|
663
666
|
async function createContext(path) {
|
|
664
|
-
const id =
|
|
667
|
+
const id = basename2(path).replace(/\.sdPlugin$/, "");
|
|
665
668
|
const { manifest, layout } = await import("@elgato/schemas/streamdeck/plugins/json");
|
|
666
669
|
return {
|
|
667
670
|
hasValidId: isValidPluginId(id),
|
|
668
|
-
manifest: new ManifestJsonFileContext(
|
|
671
|
+
manifest: new ManifestJsonFileContext(join2(path, "manifest.json"), manifest, layout),
|
|
669
672
|
id
|
|
670
673
|
};
|
|
671
674
|
}
|
|
@@ -685,7 +688,7 @@ var ManifestJsonFileContext = class extends JsonFileContext {
|
|
|
685
688
|
const compiledLayoutSchema = new JsonSchema(layoutSchema);
|
|
686
689
|
this.value.Actions?.forEach((action) => {
|
|
687
690
|
if (action.Encoder?.layout !== void 0 && !isPredefinedLayoutLike(action.Encoder?.layout.value)) {
|
|
688
|
-
const filePath =
|
|
691
|
+
const filePath = resolve2(dirname(path), action.Encoder.layout.value);
|
|
689
692
|
this.layoutFiles.push({
|
|
690
693
|
location: action.Encoder.layout.location,
|
|
691
694
|
layout: new JsonFileContext(filePath, compiledLayoutSchema)
|
|
@@ -761,7 +764,7 @@ var layoutItemKeysAreUnique = rule(function(plugin) {
|
|
|
761
764
|
});
|
|
762
765
|
|
|
763
766
|
// src/validation/plugin/rules/layout-schema.ts
|
|
764
|
-
import { existsSync as existsSync2 } from "
|
|
767
|
+
import { existsSync as existsSync2 } from "fs";
|
|
765
768
|
var layoutsExistAndSchemasAreValid = rule(function(plugin) {
|
|
766
769
|
plugin.manifest.layoutFiles.forEach(({ layout, location }) => {
|
|
767
770
|
if (!existsSync2(layout.path)) {
|
|
@@ -806,8 +809,8 @@ var categoryMatchesName = rule(function(plugin) {
|
|
|
806
809
|
});
|
|
807
810
|
|
|
808
811
|
// src/validation/plugin/rules/manifest-files-exist.ts
|
|
809
|
-
import { existsSync as existsSync4 } from "
|
|
810
|
-
import { basename as
|
|
812
|
+
import { existsSync as existsSync4 } from "fs";
|
|
813
|
+
import { basename as basename4, extname, join as join4, resolve as resolve4 } from "path";
|
|
811
814
|
|
|
812
815
|
// src/system/fs.ts
|
|
813
816
|
import ignore from "ignore";
|
|
@@ -818,16 +821,18 @@ import {
|
|
|
818
821
|
existsSync as existsSync3,
|
|
819
822
|
lstatSync,
|
|
820
823
|
mkdirSync,
|
|
821
|
-
readlinkSync,
|
|
824
|
+
readlinkSync as readlinkSync2,
|
|
822
825
|
rmSync
|
|
823
|
-
} from "
|
|
824
|
-
import {
|
|
825
|
-
import {
|
|
826
|
+
} from "fs";
|
|
827
|
+
import { lstat, mkdir, readdir, readFile } from "fs/promises";
|
|
828
|
+
import { platform } from "os";
|
|
829
|
+
import { basename as basename3, join as join3, resolve as resolve3 } from "path";
|
|
830
|
+
import { createInterface } from "readline";
|
|
826
831
|
var streamDeckIgnoreFilename = ".sdignore";
|
|
827
832
|
var defaultIgnorePatterns = [streamDeckIgnoreFilename, ".git", "/.env*", "*.log", "*.js.map"];
|
|
828
833
|
async function getIgnores(path, defaultPatterns = defaultIgnorePatterns) {
|
|
829
834
|
const i = ignore().add(defaultPatterns);
|
|
830
|
-
const file =
|
|
835
|
+
const file = join3(path, streamDeckIgnoreFilename);
|
|
831
836
|
if (existsSync3(file)) {
|
|
832
837
|
const fileStream = createReadStream(file);
|
|
833
838
|
try {
|
|
@@ -849,7 +854,7 @@ async function getIgnores(path, defaultPatterns = defaultIgnorePatterns) {
|
|
|
849
854
|
var manifestFilesExist = rule(async function(plugin) {
|
|
850
855
|
const missingHighRes = /* @__PURE__ */ new Set();
|
|
851
856
|
const ignores = await getIgnores(this.path);
|
|
852
|
-
if (ignores(
|
|
857
|
+
if (ignores(basename4(plugin.manifest.path))) {
|
|
853
858
|
this.addError(plugin.manifest.path, "Manifest file must not be ignored", {
|
|
854
859
|
suggestion: `Review ${streamDeckIgnoreFilename} file`
|
|
855
860
|
});
|
|
@@ -872,7 +877,7 @@ var manifestFilesExist = rule(async function(plugin) {
|
|
|
872
877
|
const possiblePaths = typeof opts === "object" && !opts.includeExtension ? opts.extensions.map((ext) => `${node.value}${ext}`) : [node.value];
|
|
873
878
|
let resolvedPath = void 0;
|
|
874
879
|
for (const possiblePath of possiblePaths) {
|
|
875
|
-
const path =
|
|
880
|
+
const path = resolve4(this.path, possiblePath);
|
|
876
881
|
if (existsSync4(path)) {
|
|
877
882
|
if (resolvedPath !== void 0) {
|
|
878
883
|
this.addWarning(
|
|
@@ -900,11 +905,11 @@ var manifestFilesExist = rule(async function(plugin) {
|
|
|
900
905
|
return;
|
|
901
906
|
}
|
|
902
907
|
if (extname(resolvedPath) === ".png") {
|
|
903
|
-
const fullPath =
|
|
908
|
+
const fullPath = join4(this.path, resolvedPath);
|
|
904
909
|
if (missingHighRes.has(fullPath)) {
|
|
905
910
|
return;
|
|
906
911
|
}
|
|
907
|
-
if (!existsSync4(
|
|
912
|
+
if (!existsSync4(join4(this.path, `${node.value}@2x.png`))) {
|
|
908
913
|
this.addWarning(fullPath, "should have high-resolution (@2x) variant", {
|
|
909
914
|
location: {
|
|
910
915
|
key: node.location.key
|
|
@@ -917,7 +922,7 @@ var manifestFilesExist = rule(async function(plugin) {
|
|
|
917
922
|
});
|
|
918
923
|
|
|
919
924
|
// src/validation/plugin/rules/manifest-schema.ts
|
|
920
|
-
import { existsSync as existsSync5 } from "
|
|
925
|
+
import { existsSync as existsSync5 } from "fs";
|
|
921
926
|
var manifestExistsAndSchemaIsValid = rule(function(plugin) {
|
|
922
927
|
if (!existsSync5(this.path)) {
|
|
923
928
|
return;
|
|
@@ -1005,10 +1010,10 @@ var manifestUuids = rule(async function(plugin) {
|
|
|
1005
1010
|
});
|
|
1006
1011
|
|
|
1007
1012
|
// src/validation/plugin/rules/path-input.ts
|
|
1008
|
-
import { existsSync as existsSync6, lstatSync as lstatSync2 } from "
|
|
1009
|
-
import { basename as
|
|
1013
|
+
import { existsSync as existsSync6, lstatSync as lstatSync2 } from "fs";
|
|
1014
|
+
import { basename as basename5 } from "path";
|
|
1010
1015
|
var pathIsDirectoryAndUuid = rule(function(plugin) {
|
|
1011
|
-
const name =
|
|
1016
|
+
const name = basename5(this.path);
|
|
1012
1017
|
if (!existsSync6(this.path)) {
|
|
1013
1018
|
this.addError(this.path, "Directory not found");
|
|
1014
1019
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elgato/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Stream Deck CLI tool for building with Stream Deck.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"streamdeck": "bin/streamdeck.mjs",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"log-symbols": "^7.0.0",
|
|
68
68
|
"rage-edit": "^1.2.0",
|
|
69
69
|
"semver": "^7.6.3",
|
|
70
|
-
"tar": "^7.
|
|
70
|
+
"tar": "^7.5.3"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@elgato/eslint-config": "^0.1.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@types/semver": "^7.5.8",
|
|
86
86
|
"rollup": "^4.30.1",
|
|
87
87
|
"tslib": "^2.8.1",
|
|
88
|
-
"tsup": "^8.
|
|
88
|
+
"tsup": "^8.5.1",
|
|
89
89
|
"typescript": "^5.7.3"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"CodePath": "bin/plugin.js",
|
|
26
26
|
"Description": <%- JSON.stringify(description) %>,
|
|
27
27
|
"Icon": "imgs/plugin/marketplace",
|
|
28
|
-
"SDKVersion":
|
|
28
|
+
"SDKVersion": 3,
|
|
29
29
|
"Software": {
|
|
30
|
-
"MinimumVersion": "6.
|
|
30
|
+
"MinimumVersion": "6.9"
|
|
31
31
|
},
|
|
32
32
|
"OS": [
|
|
33
33
|
{
|
package/template/src/plugin.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import streamDeck
|
|
1
|
+
import streamDeck from "@elgato/streamdeck";
|
|
2
2
|
|
|
3
3
|
import { IncrementCounter } from "./actions/increment-counter";
|
|
4
4
|
|
|
5
5
|
// We can enable "trace" logging so that all messages between the Stream Deck, and the plugin are recorded. When storing sensitive information
|
|
6
|
-
streamDeck.logger.setLevel(
|
|
6
|
+
streamDeck.logger.setLevel("trace");
|
|
7
7
|
|
|
8
8
|
// Register the increment action.
|
|
9
9
|
streamDeck.actions.registerAction(new IncrementCounter());
|