unoverse 0.1.17 → 0.1.18

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/bin/unoverse.mjs CHANGED
@@ -20,9 +20,15 @@ import { create } from "../lib/create.mjs";
20
20
  * root. Found means the operator commands exist; not found means they simply are not
21
21
  * offered, instead of being advertised and then refusing.
22
22
  */
23
+ // Two layouts, one search. A universe keeps the machinery in .unoverse/; the platform
24
+ // monorepo keeps it in scripts/. Neither is typed by a human.
25
+ const OPERATOR = [".unoverse/operator.sh", "scripts/operator.sh"];
26
+
23
27
  function findUniverse() {
24
28
  for (let dir = process.cwd(); ; ) {
25
- if (existsSync(join(dir, "scripts/lib/common.sh"))) return dir;
29
+ for (const rel of OPERATOR) {
30
+ if (existsSync(join(dir, rel))) return { root: dir, script: join(dir, rel) };
31
+ }
26
32
  const parent = resolve(dir, "..");
27
33
  if (parent === dir) return null;
28
34
  dir = parent;
@@ -30,11 +36,8 @@ function findUniverse() {
30
36
  }
31
37
 
32
38
  /** Run an operator command in the universe we are standing in. */
33
- function operator(root, args) {
34
- const r = spawnSync("bash", [join(root, "scripts/operator.sh"), ...args], {
35
- stdio: "inherit",
36
- cwd: root,
37
- });
39
+ function operator(u, args) {
40
+ const r = spawnSync("bash", [u.script, ...args], { stdio: "inherit", cwd: u.root });
38
41
  process.exit(r.status ?? 0);
39
42
  }
40
43
 
package/lib/create.mjs CHANGED
@@ -242,7 +242,10 @@ export async function create(nameArg) {
242
242
  // already in hand and already validated, so hand it over and configure now.
243
243
  rl.close();
244
244
  console.log("");
245
- const r = spawnSync("bash", [`${name}/scripts/operator.sh`, "init"], {
245
+ const operatorScript = [".unoverse/operator.sh", "scripts/operator.sh"]
246
+ .map((rel) => `${name}/${rel}`)
247
+ .find((f) => existsSync(f));
248
+ const r = spawnSync("bash", [operatorScript, "init"], {
246
249
  stdio: "inherit",
247
250
  cwd: name,
248
251
  env: { ...process.env, UNOVERSE_DOCR_TOKEN: token },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
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",