MCPcopy Create free account
hub / github.com/dailydotdev/apps / runCreate

Function runCreate

packages/world-cli/bin/world.js:335–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333}
334
335async function runCreate() {
336 const handle = positional[0] ?? process.env.WORLD_USER;
337 if (!handle) {
338 die(
339 "Usage: world create <handle> [--realm forge] [--family house] [--dir builders]"
340 );
341 }
342
343 const t = await resolveRealmTarget(handle, {
344 realm: flag("realm"),
345 district: flag("district"),
346 family: flag("family"),
347 });
348 const directory = resolve(flag("dir") ?? "builders");
349 const defaultName =
350 t.scope === "realm"
351 ? `${t.realm}.js`
352 : `${t.niche}-${t.family}.js`;
353 const file = resolve(flag("file") ?? join(directory, defaultName));
354 const result =
355 t.scope === "realm"
356 ? await scaffoldRealm(file, t.realm, t.family)
357 : await scaffoldOverride(file, t.realm, t.family);
358 const budget = budgetOf(t.family, t.level);
359
360 process.stdout.write(
361 [
362 "",
363 t.scope === "realm"
364 ? ` realm ${REALM_NAMES[t.realm]}, ${t.realmDistricts.length} districts`
365 : ` override ${t.niche} (${t.realm}), level ${t.level}, ${t.reads} reads`,
366 ` family ${t.family}, tier ${
367 budget.tier
368 }, envelope ${budget.envelope.join(" x ")}`,
369 ` budget ${budget.maxOps} shapes, ${budget.maxTriangles} triangles, ${budget.maxGlow} glow`,
370 ` file ${file} (${result})`,
371 ` colours ${paletteKeys(t.realm).join(", ")}`,
372 "",
373 ].join("\n")
374 );
375}
376
377async function runDev() {
378 const handle = positional[0] ?? process.env.WORLD_USER;

Callers

nothing calls this directly

Calls 8

budgetOfFunction · 0.90
paletteKeysFunction · 0.90
dieFunction · 0.85
resolveRealmTargetFunction · 0.85
flagFunction · 0.85
resolveFunction · 0.85
scaffoldRealmFunction · 0.85
scaffoldOverrideFunction · 0.85

Tested by

no test coverage detected