@unoverse-platform/studio 0.1.10 → 0.1.12

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/bin/studio.mjs +30 -20
  2. package/package.json +2 -1
package/bin/studio.mjs CHANGED
@@ -93,32 +93,42 @@ async function scaffoldIfEmpty() {
93
93
  }
94
94
 
95
95
  console.log(`\n No project here yet.\n\n ${cwd}\n`);
96
+
97
+ /**
98
+ * THE HOLDER IS CALLED `studio`. THE NAME YOU TYPE IS A PROJECT INSIDE IT.
99
+ *
100
+ * Studio used to scaffold into the cwd, which made whatever directory you were standing
101
+ * in your repository. Fixing that by naming the folder after the project overcorrected:
102
+ * it produced `sab/rx/sab`, and it said the wrong thing about what the folder IS.
103
+ *
104
+ * This folder is not a project. It is the workspace a developer authors in, holding
105
+ * `prompts/`, `nodes/`, one `.claude/` skill and an `rx/` of MANY projects — every one
106
+ * of which is an org that publishes under its own name. Naming it after the first
107
+ * project claims the second one belongs to the first, and the fifth project makes that
108
+ * plainly false while the folder still carries the first one's name.
109
+ *
110
+ * So the holder is always `studio/`, and the name you typed is where it belongs: the
111
+ * project, at `rx/<name>/`.
112
+ */
113
+ const home = join(cwd, "studio");
114
+ if (existsSync(home) && readdirSync(home).some((f) => !f.startsWith("."))) {
115
+ // Not a re-prompt: a different project name would not make this folder free, and the
116
+ // loop below would ask forever. (A `studio/` that IS a project was already found and
117
+ // entered above, so getting here means it is something else.)
118
+ console.log(` ./studio already has something in it, and it is not a Studio workspace.\n`);
119
+ process.exit(1);
120
+ }
121
+
96
122
  const rl = createInterface({ input: process.stdin, output: process.stdout });
97
123
 
98
124
  // Ask until the name is usable. It becomes a folder AND an item's `org` column, so a
99
125
  // rejection here is cheaper than a rename after something has been published.
100
- let name, home;
126
+ let name;
101
127
  for (;;) {
102
128
  name = (await rl.question(" Name your project [my-project]: ")).trim() || "my-project";
103
129
  const bad = checkProjectName(name);
104
- if (bad) {
105
- console.log(` ${bad}\n`);
106
- continue;
107
- }
108
-
109
- /**
110
- * THE NAME OWNS A FOLDER. Studio used to scaffold into the cwd, which made whatever
111
- * directory you happened to be standing in your repository: run it once in a scratch
112
- * folder and that scratch folder now holds a real project, with the name you typed
113
- * used only for rx/<name>/. Asking for a name and then not putting it anywhere you
114
- * can see reads as the tool ignoring you.
115
- */
116
- home = join(cwd, name);
117
- if (existsSync(home) && readdirSync(home).some((f) => !f.startsWith("."))) {
118
- console.log(` ./${name} already has something in it\n`);
119
- continue;
120
- }
121
- break;
130
+ if (!bad) break;
131
+ console.log(` ${bad}\n`);
122
132
  }
123
133
  rl.close();
124
134
 
@@ -130,7 +140,7 @@ async function scaffoldIfEmpty() {
130
140
  createFirstProject(home, name);
131
141
  // Studio reads from the cwd, and the project is no longer the folder we launched in.
132
142
  process.chdir(home);
133
- console.log(`\n Created ${name}/ with rx/${name}/, prompts/ and nodes/\n`);
143
+ console.log(`\n Created studio/ with rx/${name}/, prompts/ and nodes/\n`);
134
144
  }
135
145
 
136
146
  await scaffoldIfEmpty();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unoverse-platform/studio",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "description": "Unoverse Studio: the local authoring app. Reads your own rx/ folder, no backend.",
6
6
  "scripts": {
@@ -11,6 +11,7 @@
11
11
  "prepack": "node scripts/vendor-sdk.mjs"
12
12
  },
13
13
  "dependencies": {
14
+ "@cfworker/json-schema": "^4.1.1",
14
15
  "@codemirror/autocomplete": "^6.18.6",
15
16
  "@codemirror/commands": "^6.8.1",
16
17
  "@codemirror/lang-javascript": "^6.2.4",