@campfiire/spark-cli 0.1.3 → 0.1.4
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
|
@@ -419,11 +419,11 @@ async function submitCommand() {
|
|
|
419
419
|
}
|
|
420
420
|
process.exit(1);
|
|
421
421
|
}
|
|
422
|
-
const
|
|
423
|
-
spinner.succeed(`Submitted ${kleur5.cyan(spark.name)} v${
|
|
422
|
+
const data = await res.json();
|
|
423
|
+
spinner.succeed(`Submitted ${kleur5.cyan(data.spark.name)} v${data.submittedVersion.version}`);
|
|
424
424
|
console.log(`
|
|
425
|
-
Status: ${kleur5.yellow(
|
|
426
|
-
console.log(` ID: ${kleur5.dim(spark.id)}`);
|
|
425
|
+
Status: ${kleur5.yellow(data.submittedVersion.status)}`);
|
|
426
|
+
console.log(` ID: ${kleur5.dim(data.spark.id)}`);
|
|
427
427
|
console.log(kleur5.bold("\nNext step:"));
|
|
428
428
|
console.log(` ${kleur5.cyan("campfire-spark status")} ${kleur5.dim("# check review status")}`);
|
|
429
429
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campfiire/spark-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "CLI for developing custom Campfire sparks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsup",
|
|
19
|
-
"dev": "tsup --watch",
|
|
19
|
+
"dev": "TSUP_NO_DTS=1 tsup --watch",
|
|
20
20
|
"lint": "tsc --noEmit",
|
|
21
21
|
"start": "tsx src/index.ts",
|
|
22
22
|
"prepublishOnly": "yarn build"
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"plugin",
|
|
49
49
|
"sdk"
|
|
50
50
|
]
|
|
51
|
-
}
|
|
51
|
+
}
|
|
@@ -29,6 +29,7 @@ export default defineSpark({
|
|
|
29
29
|
const [campfire, setCampfire] = useState<SparkSDKCampfire | null>(null);
|
|
30
30
|
const [members, setMembers] = useState<SparkSDKMember[]>([]);
|
|
31
31
|
const [loading, setLoading] = useState(true);
|
|
32
|
+
const [error, setError] = useState<string | null>(null);
|
|
32
33
|
|
|
33
34
|
useEffect(() => {
|
|
34
35
|
Promise.all([sdk.getCampfire(), sdk.getMembers({ limit: 5 })])
|
|
@@ -37,9 +38,43 @@ export default defineSpark({
|
|
|
37
38
|
setMembers(m);
|
|
38
39
|
setLoading(false);
|
|
39
40
|
})
|
|
40
|
-
.catch(() =>
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
// Surface SDK errors so they're visible during development.
|
|
43
|
+
// A common cause is forgetting to declare the required
|
|
44
|
+
// permissions in manifest.json (e.g. "spark:read.campfire").
|
|
45
|
+
console.error("[Spark] SDK call failed:", err);
|
|
46
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
47
|
+
setLoading(false);
|
|
48
|
+
});
|
|
41
49
|
}, [sdk]);
|
|
42
50
|
|
|
51
|
+
if (error) {
|
|
52
|
+
return (
|
|
53
|
+
<div style={{ padding: "0.5rem" }}>
|
|
54
|
+
<p
|
|
55
|
+
style={{
|
|
56
|
+
color: "var(--destructive, #ef4444)",
|
|
57
|
+
fontSize: "0.875rem",
|
|
58
|
+
fontWeight: 500,
|
|
59
|
+
margin: "0 0 0.25rem",
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
Spark error
|
|
63
|
+
</p>
|
|
64
|
+
<p
|
|
65
|
+
style={{
|
|
66
|
+
color: "var(--muted-foreground)",
|
|
67
|
+
fontSize: "0.75rem",
|
|
68
|
+
margin: 0,
|
|
69
|
+
fontFamily: "ui-monospace, monospace",
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{error}
|
|
73
|
+
</p>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
43
78
|
if (loading) {
|
|
44
79
|
return <p style={{ color: "var(--muted-foreground)" }}>Loading...</p>;
|
|
45
80
|
}
|