@greatstore/cli 0.0.7 → 0.0.9
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/cli.js +14 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -598,7 +598,8 @@ async function pushCommand(args) {
|
|
|
598
598
|
const data = await request(url, { method: "POST", multipart: form });
|
|
599
599
|
const sourceNote = sourceText === null ? " (no source uploaded \u2014 `component.tsx` not found in cwd)" : "";
|
|
600
600
|
process.stdout.write(
|
|
601
|
-
`Pushed ${name} v${data.version} (draft) to ${slug}${sourceNote}.
|
|
601
|
+
`Pushed ${name} v${data.version} (draft) to ${slug}${sourceNote}. View: ${data.permalink}
|
|
602
|
+
Run \`gs publish ${name}\` to promote.
|
|
602
603
|
`
|
|
603
604
|
);
|
|
604
605
|
}
|
|
@@ -621,8 +622,10 @@ async function publishCommand(args) {
|
|
|
621
622
|
body = {};
|
|
622
623
|
}
|
|
623
624
|
const data = await request(url, { method: "POST", body });
|
|
624
|
-
process.stdout.write(
|
|
625
|
-
`)
|
|
625
|
+
process.stdout.write(
|
|
626
|
+
`Published ${name} (live = v${data.live_version}). View: ${data.permalink}
|
|
627
|
+
`
|
|
628
|
+
);
|
|
626
629
|
}
|
|
627
630
|
|
|
628
631
|
// src/commands/unpublish.ts
|
|
@@ -728,6 +731,7 @@ function manifest(name) {
|
|
|
728
731
|
return JSON.stringify(
|
|
729
732
|
{
|
|
730
733
|
name,
|
|
734
|
+
displayName: defaultDisplayName(name),
|
|
731
735
|
description: `Renders the ${name} widget.`,
|
|
732
736
|
displayMode: "inline",
|
|
733
737
|
inputSchema: {
|
|
@@ -739,6 +743,12 @@ function manifest(name) {
|
|
|
739
743
|
2
|
|
740
744
|
) + "\n";
|
|
741
745
|
}
|
|
746
|
+
function defaultDisplayName(name) {
|
|
747
|
+
const words = name.split("_").filter(Boolean);
|
|
748
|
+
if (words.length === 0) return name;
|
|
749
|
+
const first = words[0];
|
|
750
|
+
return first.charAt(0).toUpperCase() + first.slice(1) + (words.length > 1 ? " " + words.slice(1).join(" ") : "");
|
|
751
|
+
}
|
|
742
752
|
function component(name) {
|
|
743
753
|
return `import React from "react";
|
|
744
754
|
|
|
@@ -874,7 +884,7 @@ function pascal(name) {
|
|
|
874
884
|
}
|
|
875
885
|
|
|
876
886
|
// src/index.ts
|
|
877
|
-
var VERSION = true ? "0.0.
|
|
887
|
+
var VERSION = true ? "0.0.9" : "0.0.0-dev";
|
|
878
888
|
var HELP = `gs \u2014 GreatStore CLI (v${VERSION})
|
|
879
889
|
|
|
880
890
|
Usage:
|