lumia-plugin 0.2.5 → 0.2.6
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.
|
@@ -33,7 +33,7 @@ class ShowcasePluginTemplate extends Plugin {
|
|
|
33
33
|
const actions = Array.isArray(config.actions) ? config.actions : [];
|
|
34
34
|
for (const action of actions) {
|
|
35
35
|
if (action?.type === "trigger_alert") {
|
|
36
|
-
await this._triggerSampleAlert(action.
|
|
36
|
+
await this._triggerSampleAlert(action.value);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lumia-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Command-line tools for creating, building, and validating Lumia Stream plugins.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"lumia-plugin": "scripts/cli.js"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"author": "Lumia Stream",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lumiastream/plugin": "^0.2.
|
|
27
|
+
"@lumiastream/plugin": "^0.2.6",
|
|
28
28
|
"jszip": "3.10.1"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/scripts/build-plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const fs = require("fs");
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
4
5
|
const {
|
|
5
6
|
readManifest,
|
|
6
7
|
validateManifest,
|
|
@@ -64,6 +65,21 @@ async function main() {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
try {
|
|
68
|
+
const packageJsonPath = path.join(pluginDir, "package.json");
|
|
69
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
70
|
+
console.log("• Running npm install...");
|
|
71
|
+
const result = spawnSync("npm", ["install"], {
|
|
72
|
+
cwd: pluginDir,
|
|
73
|
+
stdio: "inherit",
|
|
74
|
+
});
|
|
75
|
+
if (result.status !== 0) {
|
|
76
|
+
console.error("✖ npm install failed. Aborting build.");
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
console.log("• No package.json found; skipping npm install.");
|
|
81
|
+
}
|
|
82
|
+
|
|
67
83
|
const { manifest } = await readManifest(pluginDir);
|
|
68
84
|
const errors = validateManifest(manifest);
|
|
69
85
|
if (errors.length) {
|
|
@@ -72,10 +88,30 @@ async function main() {
|
|
|
72
88
|
process.exit(1);
|
|
73
89
|
}
|
|
74
90
|
|
|
91
|
+
const entryFile =
|
|
92
|
+
typeof manifest.main === "string" && manifest.main.trim()
|
|
93
|
+
? manifest.main.trim()
|
|
94
|
+
: "main.js";
|
|
95
|
+
const entryPath = path.resolve(pluginDir, entryFile);
|
|
96
|
+
if (!fs.existsSync(entryPath)) {
|
|
97
|
+
console.error(`✖ Entry file not found: ${entryFile}`);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
console.log(`• Running syntax check on ${entryFile}...`);
|
|
102
|
+
const checkResult = spawnSync("node", ["--check", entryPath], {
|
|
103
|
+
cwd: pluginDir,
|
|
104
|
+
stdio: "inherit",
|
|
105
|
+
});
|
|
106
|
+
if (checkResult.status !== 0) {
|
|
107
|
+
console.error("✖ Syntax check failed. Aborting build.");
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
|
|
75
111
|
const files = await collectFiles(pluginDir);
|
|
76
112
|
if (!files.length) {
|
|
77
113
|
console.error(
|
|
78
|
-
"✖ No files found to package (did you point to the plugin root?)"
|
|
114
|
+
"✖ No files found to package (did you point to the plugin root?)",
|
|
79
115
|
);
|
|
80
116
|
process.exit(1);
|
|
81
117
|
}
|