lumia-plugin 0.2.6 → 0.2.7
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lumia-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
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.7",
|
|
28
28
|
"jszip": "3.10.1"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/scripts/build-plugin.js
CHANGED
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
|
|
12
12
|
function parseArgs() {
|
|
13
13
|
const args = process.argv.slice(2);
|
|
14
|
-
const options = { dir: process.cwd(), outFile: null };
|
|
14
|
+
const options = { dir: process.cwd(), outFile: null, install: false };
|
|
15
15
|
while (args.length) {
|
|
16
16
|
const arg = args.shift();
|
|
17
17
|
switch (arg) {
|
|
@@ -23,6 +23,10 @@ function parseArgs() {
|
|
|
23
23
|
case "-o":
|
|
24
24
|
options.outFile = path.resolve(args.shift() || "");
|
|
25
25
|
break;
|
|
26
|
+
case "--install":
|
|
27
|
+
case "-i":
|
|
28
|
+
options.install = true;
|
|
29
|
+
break;
|
|
26
30
|
case "--help":
|
|
27
31
|
case "-h":
|
|
28
32
|
printHelp();
|
|
@@ -49,6 +53,7 @@ Usage: npx lumia-plugin build [options]
|
|
|
49
53
|
Options:
|
|
50
54
|
--dir, -d Plugin directory (defaults to cwd)
|
|
51
55
|
--out, -o Output file path (defaults to ./<id>-<version>.lumiaplugin)
|
|
56
|
+
--install, -i Run npm install before packaging
|
|
52
57
|
--help, -h Show this help message
|
|
53
58
|
`);
|
|
54
59
|
}
|
|
@@ -67,14 +72,18 @@ async function main() {
|
|
|
67
72
|
try {
|
|
68
73
|
const packageJsonPath = path.join(pluginDir, "package.json");
|
|
69
74
|
if (fs.existsSync(packageJsonPath)) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
if (options.install) {
|
|
76
|
+
console.log("• Running npm install...");
|
|
77
|
+
const result = spawnSync("npm", ["install"], {
|
|
78
|
+
cwd: pluginDir,
|
|
79
|
+
stdio: "inherit",
|
|
80
|
+
});
|
|
81
|
+
if (result.status !== 0) {
|
|
82
|
+
console.error("✖ npm install failed. Aborting build.");
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
console.log("• Skipping npm install (use --install to enable).");
|
|
78
87
|
}
|
|
79
88
|
} else {
|
|
80
89
|
console.log("• No package.json found; skipping npm install.");
|