unoverse 0.1.12 → 0.1.13

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.
Files changed (2) hide show
  1. package/lib/create.mjs +21 -6
  2. package/package.json +1 -1
package/lib/create.mjs CHANGED
@@ -17,6 +17,7 @@ const STARTER_TARBALL =
17
17
 
18
18
  const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
19
19
  const dim = (s) => `\x1b[2m${s}\x1b[0m`;
20
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
20
21
  const ok = (s) => console.log(` \x1b[32m✓\x1b[0m ${s}`);
21
22
  const fail = (s) => console.log(` \x1b[31m✗\x1b[0m ${s}`);
22
23
 
@@ -98,13 +99,27 @@ function download(dir, stripComponents = 1, filter = "") {
98
99
  export async function create(nameArg) {
99
100
  const rl = createInterface({ input: process.stdin, output: process.stdout });
100
101
  try {
101
- console.log(`\n ${cyan(" What are you building?")}\n`);
102
- console.log(` 1. ${"A Studio project".padEnd(20)}Components, nodes and agent skills`);
103
- console.log(` ${dim(" " + "".padEnd(20) + "Most people start here")}`);
104
- console.log(` 2. ${"A universe".padEnd(20)}Run the platform on your own infrastructure`);
105
- console.log(` 3. ${"A client app".padEnd(20)}A website that talks to a universe\n`);
102
+ // THE SELECTION IS SHOWN IN THE LIST, not as "[1]" in the prompt. A bracketed
103
+ // default is a shell convention, not a selection: it puts the answer somewhere
104
+ // other than where the reader is looking. The marked row carries it instead.
105
+ const OPTIONS = [
106
+ ["Studio", "Components, agents and workflows", "Most people start here"],
107
+ ["Universe", "Run the platform yourself, on your own infrastructure"],
108
+ ["Client", "A client accelerator that talks to unoverse"],
109
+ ];
110
+ const NAME_W = Math.max(...OPTIONS.map(([n]) => n.length)) + 3;
106
111
 
107
- const choice = (await ask(rl, "Choose [1]: ")) || "1";
112
+ console.log(`\n ${cyan(" What are you building?")}\n`);
113
+ OPTIONS.forEach(([name, desc, note], i) => {
114
+ const selected = i === 0;
115
+ const mark = selected ? cyan("❯") : " ";
116
+ const label = selected ? bold(name) : name;
117
+ console.log(` ${mark} ${i + 1} ${label}${" ".repeat(NAME_W - name.length)}${desc}`);
118
+ if (note) console.log(` ${" ".repeat(NAME_W + 1)}${dim(note)}`);
119
+ });
120
+ console.log("");
121
+
122
+ const choice = (await ask(rl, `Enter to choose, or type 2 or 3: `)) || "1";
108
123
 
109
124
  if (choice === "1") {
110
125
  console.log(`\n ${dim("Launching Unoverse Studio. It creates and manages your projects.")}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "The Unoverse front door — create a Studio project, a universe, or a client app, and launch Studio.",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "type": "module",