@campfiire/spark-cli 0.1.2 → 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
|
@@ -147,6 +147,10 @@ async function buildCommand() {
|
|
|
147
147
|
await build({
|
|
148
148
|
root: projectDir,
|
|
149
149
|
plugins: [react()],
|
|
150
|
+
define: {
|
|
151
|
+
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
152
|
+
"process.env": JSON.stringify({})
|
|
153
|
+
},
|
|
150
154
|
build: {
|
|
151
155
|
outDir: "dist",
|
|
152
156
|
emptyOutDir: true,
|
|
@@ -415,11 +419,11 @@ async function submitCommand() {
|
|
|
415
419
|
}
|
|
416
420
|
process.exit(1);
|
|
417
421
|
}
|
|
418
|
-
const
|
|
419
|
-
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}`);
|
|
420
424
|
console.log(`
|
|
421
|
-
Status: ${kleur5.yellow(
|
|
422
|
-
console.log(` ID: ${kleur5.dim(spark.id)}`);
|
|
425
|
+
Status: ${kleur5.yellow(data.submittedVersion.status)}`);
|
|
426
|
+
console.log(` ID: ${kleur5.dim(data.spark.id)}`);
|
|
423
427
|
console.log(kleur5.bold("\nNext step:"));
|
|
424
428
|
console.log(` ${kleur5.cyan("campfire-spark status")} ${kleur5.dim("# check review status")}`);
|
|
425
429
|
console.log();
|
|
@@ -512,7 +516,7 @@ async function requestDomainCommand(domain) {
|
|
|
512
516
|
|
|
513
517
|
// src/index.ts
|
|
514
518
|
var program = new Command();
|
|
515
|
-
program.name("campfire-spark").description("CLI for developing custom Campfire sparks").version("0.1.
|
|
519
|
+
program.name("campfire-spark").description("CLI for developing custom Campfire sparks").version("0.1.3");
|
|
516
520
|
program.command("init").description("Scaffold a new spark project").argument("[name]", "Project name").action(initCommand);
|
|
517
521
|
program.command("dev").description("Start local development server with mock SDK").option("-p, --port <number>", "Dev server port", "4321").action(devCommand);
|
|
518
522
|
program.command("build").description("Build the spark bundle for production").action(buildCommand);
|
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
|
}
|